[Bug libc/24813] New: <asm/sigcontext.h> and <signal.h> are mutually incompatible on Linux

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[Bug libc/24813] New: <asm/sigcontext.h> and <signal.h> are mutually incompatible on Linux

fweimer at redhat dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=24813

            Bug ID: 24813
           Summary: <asm/sigcontext.h> and <signal.h> are mutually
                    incompatible on Linux
           Product: glibc
           Version: 2.29
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: libc
          Assignee: unassigned at sourceware dot org
          Reporter: luto at kernel dot org
                CC: drepper.fsp at gmail dot com
  Target Milestone: ---

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.

--
You are receiving this mail because:
You are on the CC list for the bug.
Reply | Threaded
Open this post in threaded view
|

[Bug libc/24813] <asm/sigcontext.h> and <signal.h> are mutually incompatible on Linux

fweimer at redhat dot com
https://sourceware.org/bugzilla/show_bug.cgi?id=24813

Carlos O'Donell <carlos at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |carlos at redhat dot com

--- Comment #1 from Carlos O'Donell <carlos at redhat dot com> ---
Andy, Thanks. This looks like the usual header coordination issues we face.
Thanks for filling a bug for this so we can track it.

--
You are receiving this mail because:
You are on the CC list for the bug.