SimonKagstrom / kcov

Code coverage tool for compiled programs, Python and Bash which uses debugging information to collect and report data without special compilation options
http://simonkagstrom.github.io/kcov/
GNU General Public License v2.0
710 stars 109 forks source link

Build failure on macOS 11 #403

Closed p-linnane closed 1 year ago

p-linnane commented 1 year ago

Hello 👋 . I'm a maintainer for the Homebrew project. While packaging v42 of kcov we've run into a build failure only on macOS 11.

  [ 98%] Building C object src/CMakeFiles/kcov.dir/version.c.o
  cd /tmp/kcov-20230819-6253-1grw8gb/kcov-42/build/src && /usr/local/Homebrew/Library/Homebrew/shims/mac/super/clang -DPACKAGE -DPACKAGE_VERSION -I/tmp/kcov-20230819-6253-1grw8gb/kcov-42/src/include -I/usr/local/opt/dwarfutils/include/libdwarf-0 -O3 -DNDEBUG -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX11.sdk -MD -MT src/CMakeFiles/kcov.dir/version.c.o -MF CMakeFiles/kcov.dir/version.c.o.d -o CMakeFiles/kcov.dir/version.c.o -c /tmp/kcov-20230819-6253-1grw8gb/kcov-42/build/src/version.c
  In file included from /tmp/kcov-20230819-6253-1grw8gb/kcov-42/src/engines/mach-engine.cc:29:
  /Library/Developer/CommandLineTools/SDKs/MacOSX11.sdk/usr/include/sys/ptrace.h:99:42: error: unknown type name 'caddr_t'
  int     ptrace(int _request, pid_t _pid, caddr_t _addr, int _data);
                                           ^
  /tmp/kcov-20230819-6253-1grw8gb/kcov-42/src/engines/mach-engine.cc:157:13: error: no matching function for call to 'ptrace'
              ptrace(PT_THUPDATE, m_pid, (caddr_t)(uintptr_t)thread_port, codes[1]);
              ^~~~~~
  /Library/Developer/CommandLineTools/SDKs/MacOSX11.sdk/usr/include/sys/ptrace.h:99:9: note: candidate function not viable: no known conversion from 'caddr_t' (aka 'char *') to 'int' for 3rd argument; dereference the argument with *
  int     ptrace(int _request, pid_t _pid, caddr_t _addr, int _data);
          ^
  2 errors generated.
  make[2]: *** [src/CMakeFiles/kcov.dir/engines/mach-engine.cc.o] Error 1
  make[2]: *** Waiting for unfinished jobs....
  make[1]: *** [src/CMakeFiles/kcov.dir/all] Error 2
  make: *** [all] Error 2

The relevant GitHub Actions run can be found here.

Relates to https://github.com/Homebrew/homebrew-core/pull/139915.

SimonKagstrom commented 1 year ago

I don't have a Big Sur machine to test on anymore, but does it work with 6bc5f1d?

SimonKagstrom commented 1 year ago

Fixed with 5ad546c, and the github actions should now build for big sur as well.

p-linnane commented 1 year ago

Confirming this fixed the issue on Big Sur. Thank you!