This tiny program: #define _GNU_SOURCE #include <signal.h> #include <asm/sigcontext.h> fails to compile with many errors like this: In file included from test_ucontext.c:5: /usr/include/asm/sigcontext.h:40:8: error: redefinition of ‘struct _fpx_sw_bytes’ 40 | struct _fpx_sw_bytes { | ^~~~~~~~~~~~~ In file included from /usr/include/signal.h:291, from test_ucontext.c:2: /usr/include/bits/sigcontext.h:31:8: note: originally defined here 31 | struct _fpx_sw_bytes | ^~~~~~~~~~~~~ Glibc's bits/sycontext.h is very similar to the kernel's asm/sigcontext.h, except that glibc's is a bit out of date and uses "__glibc_reserved1" instead of "padding". Could glibc be switched to use sigcontext.h from the kernel headers? This awful hack does indeed compile: #define _GNU_SOURCE #define _BITS_SIGCONTEXT_H 1 #include <asm/sigcontext.h> #include <signal.h> NB: this is a bit related to PR 21457 and, in particular, to commit 251287734e89. The latter made <asm/ucontext.h> start working.
Andy, Thanks. This looks like the usual header coordination issues we face. Thanks for filling a bug for this so we can track it.