[Bug libc/28938] New: [csky, microblaze, or1k, powerpc] typedef for greg_t missing in sys/ucontext.h on some architectures

Arfrever.FTA at GMail dot Com sourceware-bugzilla@sourceware.org
Thu Mar 3 14:19:52 GMT 2022


https://sourceware.org/bugzilla/show_bug.cgi?id=28938

            Bug ID: 28938
           Summary: [csky, microblaze, or1k, powerpc] typedef for greg_t
                    missing in sys/ucontext.h on some architectures
           Product: glibc
           Version: unspecified
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: libc
          Assignee: unassigned at sourceware dot org
          Reporter: Arfrever.FTA at GMail dot Com
                CC: drepper.fsp at gmail dot com
  Target Milestone: ---

Original bug report: https://bugs.gentoo.org/834450

> In file included from include/libucontext/libucontext.h:5,
>                  from arch/ppc/makecontext.c:19:
> include/libucontext/bits.h:8:9: error: unknown type name 'greg_t'
>     8 | typedef greg_t libucontext_greg_t;
>       |         ^~~~~~


In glibc 2.35:

The following sys/ucontext.h files define both greg_t and gregset_t:

sysdeps/arm/sys/ucontext.h
sysdeps/i386/sys/ucontext.h
sysdeps/m68k/sys/ucontext.h
sysdeps/mips/sys/ucontext.h
sysdeps/unix/sysv/linux/aarch64/sys/ucontext.h
sysdeps/unix/sysv/linux/alpha/sys/ucontext.h
sysdeps/unix/sysv/linux/arm/sys/ucontext.h
sysdeps/unix/sysv/linux/hppa/sys/ucontext.h
sysdeps/unix/sysv/linux/m68k/sys/ucontext.h
sysdeps/unix/sysv/linux/mips/sys/ucontext.h
sysdeps/unix/sysv/linux/riscv/sys/ucontext.h
sysdeps/unix/sysv/linux/s390/sys/ucontext.h
sysdeps/unix/sysv/linux/sh/sys/ucontext.h
sysdeps/unix/sysv/linux/sparc/sys/ucontext.h
sysdeps/unix/sysv/linux/x86/sys/ucontext.h

The following sys/ucontext.h files define gregset_t, but not greg_t:

sysdeps/unix/sysv/linux/csky/sys/ucontext.h
sysdeps/unix/sysv/linux/powerpc/sys/ucontext.h

The following sys/ucontext.h files do not define greg_t or gregset_t:

sysdeps/generic/sys/ucontext.h
sysdeps/unix/sysv/linux/arc/sys/ucontext.h
sysdeps/unix/sysv/linux/ia64/sys/ucontext.h
sysdeps/unix/sysv/linux/microblaze/sys/ucontext.h
sysdeps/unix/sysv/linux/nios2/sys/ucontext.h
sysdeps/unix/sysv/linux/or1k/sys/ucontext.h


In musl, sys/ucontext.h includes ucontext.h, which includes signal.h, which
includes bits/signal.h.

In musl, the following bits/signal.h files define greg_t and gregset_t:

arch/aarch64/bits/signal.h
arch/arm/bits/signal.h
arch/i386/bits/signal.h
arch/m68k/bits/signal.h
arch/microblaze/bits/signal.h
arch/mips/bits/signal.h
arch/mips64/bits/signal.h
arch/mipsn32/bits/signal.h
arch/or1k/bits/signal.h
arch/powerpc/bits/signal.h
arch/powerpc64/bits/signal.h
arch/riscv64/bits/signal.h
arch/s390x/bits/signal.h
arch/sh/bits/signal.h
arch/x32/bits/signal.h
arch/x86_64/bits/signal.h


In glibc, typedef for greg_t needs to be added at least in:

sysdeps/unix/sysv/linux/powerpc/sys/ucontext.h
  (In musl, in arch/powerpc/bits/signal.h: 'typedef unsigned long greg_t,
gregset_t[48]')
  (In musl, in arch/powerpc64/bits/signal.h: 'typedef unsigned long greg_t,
gregset_t[48]')

And probably also in:

sysdeps/unix/sysv/linux/csky/sys/ucontext.h
  (Not supported by musl, but 'typedef unsigned long greg_t' seems obvious.)
sysdeps/unix/sysv/linux/microblaze/sys/ucontext.h
  (In musl: 'typedef unsigned long greg_t, gregset_t[38]')
sysdeps/unix/sysv/linux/or1k/sys/ucontext.h
  (In musl: 'typedef unsigned long greg_t, gregset_t[34]')

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


More information about the Glibc-bugs mailing list