This is the mail archive of the glibc-bugs@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


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.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]