microsoft / microsoft/ProcMon-for-Linux

Build fails with gcc 12

Open
#86 1 comment 1 reaction 1 assignee View on GitHub

@MarioHewardt is already working on this.

Since Jun 1, 2022.

bug
Dominant language
C
Stars
4.7k
Forks
295
Avg merge
2d 9h
Merged PRs (30d)
9

Description

Using procmon 1.0.1 on openSUSE Tumbleweed, with the following cmake parameters:

/usr/bin/cmake /home/abuild/rpmbuild/BUILD/ProcMon-for-Linux-1.0.1/. '-GUnix Makefiles' -DCMAKE_INSTALL_PREFIX:PATH=/usr -DINCLUDE_INSTALL_DIR:PATH=/usr/include -DLIB_INSTALL_DIR:PATH=/usr/lib64 -DSYSCONF_INSTALL_DIR:PATH=/etc -DSHARE_INSTALL_PREFIX:PATH=/usr/share -DCMAKE_INSTALL_LIBDIR:PATH=lib64 -DCMAKE_INSTALL_LIBEXECDIR=/usr/libexec -DCMAKE_BUILD_TYPE=RelWithDebInfo '-DCMAKE_C_FLAGS=-O2 -Wall -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=3 -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables -fstack-clash-protection -Werror=return-type -flto=auto -g -DNDEBUG' '-DCMAKE_CXX_FLAGS=-O2 -Wall -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=3 -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables -fstack-clash-protection -Werror=return-type -flto=auto -g -DNDEBUG' '-DCMAKE_Fortran_FLAGS=-O2 -Wall -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=3 -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables -fstack-clash-protection -Werror=return-type -flto=auto -g -DNDEBUG' '-DCMAKE_EXE_LINKER_FLAGS=-flto=auto -Wl,--as-needed -Wl,--no-undefined -Wl,-z,now' '-DCMAKE_MODULE_LINKER_FLAGS=-flto=auto -Wl,--as-needed' '-DCMAKE_SHARED_LINKER_FLAGS=-flto=auto -Wl,--as-needed -Wl,--no-undefined -Wl,-z,now' -DLIB_SUFFIX=64 -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON -DBUILD_SHARED_LIBS:BOOL=ON -DBUILD_STATIC_LIBS:BOOL=OFF -DCMAKE_COLOR_MAKEFILE:BOOL=OFF -DCMAKE_INSTALL_DO_STRIP:BOOL=OFF -DCMAKE_MODULES_INSTALL_DIR=/usr/lib64/cmake/procmon

and this is where it fails:

[ 53%] Building CXX object src/tracer/CMakeFiles/tracer-static.dir/ebpf/raw_ebpf_event.cpp.o
cd /home/abuild/rpmbuild/BUILD/ProcMon-for-Linux-1.0.1/build/src/tracer && /usr/bin/c++  -I/home/abuild/rpmbuild/BUILD/ProcMon-for-Linux-1.0.1/build/src -I/usr/include/bcc/compat -I/usr/include/ncurses -O2 -Wall -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=3 -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables -fstack-clash-protection -Werror=return-type -flto=auto -g -DNDEBUG -g -fno-omit-frame-pointer -DELPP_THREAD_SAFE -D ELPP_DEFAULT_LOG_FILE='"/var/log/procmon.log"' -O2 -g -DNDEBUG -std=gnu++17 -MD -MT src/tracer/CMakeFiles/tracer-static.dir/ebpf/raw_ebpf_event.cpp.o -MF CMakeFiles/tracer-static.dir/ebpf/raw_ebpf_event.cpp.o.d -o CMakeFiles/tracer-static.dir/ebpf/raw_ebpf_event.cpp.o -c /home/abuild/rpmbuild/BUILD/ProcMon-for-Linux-1.0.1/src/tracer/ebpf/raw_ebpf_event.cpp
[ 57%] Building CXX object src/tracer/CMakeFiles/tracer-static.dir/ebpf/syscall_schema.cpp.o
cd /home/abuild/rpmbuild/BUILD/ProcMon-for-Linux-1.0.1/build/src/tracer && /usr/bin/c++  -I/home/abuild/rpmbuild/BUILD/ProcMon-for-Linux-1.0.1/build/src -I/usr/include/bcc/compat -I/usr/include/ncurses -O2 -Wall -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=3 -fstack-protector-strong -funwind-tables -fasynchronous-unwind-tables -fstack-clash-protection -Werror=return-type -flto=auto -g -DNDEBUG -g -fno-omit-frame-pointer -DELPP_THREAD_SAFE -D ELPP_DEFAULT_LOG_FILE='"/var/log/procmon.log"' -O2 -g -DNDEBUG -std=gnu++17 -MD -MT src/tracer/CMakeFiles/tracer-static.dir/ebpf/syscall_schema.cpp.o -MF CMakeFiles/tracer-static.dir/ebpf/syscall_schema.cpp.o.d -o CMakeFiles/tracer-static.dir/ebpf/syscall_schema.cpp.o -c /home/abuild/rpmbuild/BUILD/ProcMon-for-Linux-1.0.1/src/tracer/ebpf/syscall_schema.cpp
In file included from /home/abuild/rpmbuild/BUILD/ProcMon-for-Linux-1.0.1/src/tracer/ebpf/syscall_schema.cpp:4:
/home/abuild/rpmbuild/BUILD/ProcMon-for-Linux-1.0.1/src/tracer/ebpf/syscall_schema.h: In static member function 'static std::vector<SyscallSchema::SyscallSchema> SyscallSchema::Utils::CollectSyscallSchema()':
/home/abuild/rpmbuild/BUILD/ProcMon-for-Linux-1.0.1/src/tracer/ebpf/syscall_schema.h:100:26: error: 'strcpy' is not a member of 'std'
  100 |                     std::strcpy(schema.syscallName, match[2].str().c_str());
      |                          ^~~~~~
/home/abuild/rpmbuild/BUILD/ProcMon-for-Linux-1.0.1/src/tracer/ebpf/syscall_schema.h:124:34: error: 'strcpy' is not a member of 'std'
  124 |                             std::strcpy(schema.argNames[argCount], argName.c_str());
      |                                  ^~~~~~
make[2]: *** [src/tracer/CMakeFiles/tracer-static.dir/build.make:121: src/tracer/CMakeFiles/tracer-static.dir/ebpf/syscall_schema.cpp.o] Error 1

No error with gcc 11.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.