Skip to content

Conversation

@glaubitz
Copy link
Contributor

@glaubitz glaubitz commented Dec 7, 2025

Fixes the build on 32-bit PowerPC which currently fails with:

FAILED: [code=1] src/CMakeFiles/kcov-system-daemon.dir/engines/ptrace_linux.cc.o
/usr/bin/c++ -DPACKAGE -DPACKAGE_VERSION -I/home/glaubitz/kcov/src/include -std=c++17 -g -Wall -D_GLIBCXX_USE_NANOSLEEP -DKCOV_LIBRARY_PREFIX=/tmp -DKCOV_HAS_LIBBFD=0 -DKCOV_LIBFD_DISASM_STYLED=0 -O3 -DNDEBUG -MD -MT src/CMakeFiles/kcov-system-daemon.dir/engines/ptrace_linux.cc.o -MF src/CMakeFiles/kcov-system-daemon.dir/engines/ptrace_linux.cc.o.d -o src/CMakeFiles/kcov-system-daemon.dir/engines/ptrace_linux.cc.o -c /home/glaubitz/kcov/src/engines/ptrace_linux.cc
In file included from /usr/lib/linux/uapi/powerpc/asm/sigcontext.h:12,
                 from /usr/include/powerpc-linux-gnu/bits/sigcontext.h:30,
                 from /usr/include/signal.h:301,
                 from /usr/include/powerpc-linux-gnu/sys/wait.h:36,
                 from /home/glaubitz/kcov/src/engines/ptrace_linux.cc:4:
/home/glaubitz/kcov/src/engines/ptrace_linux.cc: In function 'long int getRegs(pid_t, void*, void*, size_t)':
/home/glaubitz/kcov/src/engines/ptrace_linux.cc:334:23: error: invalid conversion from 'int' to '__ptrace_request' [-fpermissive]
  334 |         return ptrace(PTRACE_GETREGS, pid, NULL, regs);
      |                       ^~~~~~~~~~~~~~
      |                       |
      |                       int
In file included from /usr/include/powerpc-linux-gnu/sys/ptrace.h:285,
                 from /home/glaubitz/kcov/src/engines/ptrace_linux.cc:3:
/usr/include/powerpc-linux-gnu/bits/ptrace-shared.h:152:47: note: initializing argument 1 of 'long int ptrace(__ptrace_request, ...)'
  152 | extern long int ptrace (enum __ptrace_request __request, ...) __THROW;
      |                         ~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~
/home/glaubitz/kcov/src/engines/ptrace_linux.cc: In function 'long int setRegs(pid_t, void*, void*, size_t)':
/home/glaubitz/kcov/src/engines/ptrace_linux.cc:382:23: error: invalid conversion from 'int' to '__ptrace_request' [-fpermissive]
  382 |         return ptrace(PTRACE_SETREGS, pid, NULL, regs);
      |                       ^~~~~~~~~~~~~~
      |                       |
      |                       int
/usr/include/powerpc-linux-gnu/bits/ptrace-shared.h:152:47: note: initializing argument 1 of 'long int ptrace(__ptrace_request, ...)'
  152 | extern long int ptrace (enum __ptrace_request __request, ...) __THROW;
      |                         ~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~

Tested on 32- and 64-bit PowerPC, both little- and big-endian.

@glaubitz
Copy link
Contributor Author

glaubitz commented Dec 7, 2025

FWIW, the workaround is necessary due to a bug in glibc which has been reported upstream.

@SimonKagstrom
Copy link
Owner

Thanks! Didn't know it was an actual GCC bug, but good to know!

I see that the arch build fail with an internal compiler error for ppc64le. Still, one bug at a time :-)

@SimonKagstrom SimonKagstrom merged commit 4d2966c into SimonKagstrom:master Dec 7, 2025
6 of 10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants