Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 834450 - sys-libs/libucontext-1.1-r1 - 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'
Summary: sys-libs/libucontext-1.1-r1 - In file included from include/libucontext/libuc...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: PPC Linux
: Normal normal (vote)
Assignee: Gentoo musl team
URL:
Whiteboard:
Keywords: PullRequest
Depends on:
Blocks: 834327
  Show dependency tree
 
Reported: 2022-03-01 20:52 UTC by ernsteiswuerfel
Modified: 2022-09-25 01:27 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
emerge --info (file_834450.txt,6.12 KB, text/plain)
2022-03-01 20:52 UTC, ernsteiswuerfel
Details
build.log (libucontext-1.1-r1:20220301-204434.log,5.27 KB, text/plain)
2022-03-01 20:53 UTC, ernsteiswuerfel
Details

Note You need to log in before you can comment on or make changes to this bug.
Description ernsteiswuerfel archtester 2022-03-01 20:52:50 UTC
Created attachment 766126 [details]
emerge --info

[...]
make -j1 ARCH=ppc 'LDFLAGS=-Wl,-O1 -Wl,--as-needed -Wl,--hash-style=gnu' LIBDIR=/usr/lib all docs 
cp arch/common/include/libucontext/bits.h include/libucontext/bits.h
powerpc-unknown-linux-gnu-gcc -std=gnu99 -D_BSD_SOURCE -fPIC -DPIC -O2 -mcpu=7450 -pipe -DEXPORT_UNPREFIXED -Iinclude -Iarch/ppc -Iarch/common -c -o arch/ppc/makecontext.o arch/ppc/makecontext.c
In file included from /usr/include/bits/libc-header-start.h:33,
                 from /usr/include/stdint.h:26,
                 from /usr/lib/gcc/powerpc-unknown-linux-gnu/11.2.0/include/stdint.h:9,
                 from arch/ppc/makecontext.c:15:
/usr/include/features.h:187:3: warning: #warning "_BSD_SOURCE and _SVID_SOURCE are deprecated, use _DEFAULT_SOURCE" [-Wcpp]
  187 | # warning "_BSD_SOURCE and _SVID_SOURCE are deprecated, use _DEFAULT_SOURCE"
      |   ^~~~~~~
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;
      |         ^~~~~~
arch/ppc/makecontext.c: In function 'libucontext_makecontext':
arch/ppc/makecontext.c:39:26: error: 'union uc_regs_ptr' has no member named 'gregs'; did you mean 'regs'?
   39 |         ucp->uc_mcontext.gregs[REG_NIP]  = (uintptr_t) func;
      |                          ^~~~~
      |                          regs
arch/ppc/makecontext.c:40:26: error: 'union uc_regs_ptr' has no member named 'gregs'; did you mean 'regs'?
   40 |         ucp->uc_mcontext.gregs[REG_LNK]  = (uintptr_t) &libucontext_trampoline;
      |                          ^~~~~
      |                          regs
arch/ppc/makecontext.c:41:26: error: 'union uc_regs_ptr' has no member named 'gregs'; did you mean 'regs'?
   41 |         ucp->uc_mcontext.gregs[REG_R31]  = (uintptr_t) ucp->uc_link;
      |                          ^~~~~
      |                          regs
arch/ppc/makecontext.c:42:26: error: 'union uc_regs_ptr' has no member named 'gregs'; did you mean 'regs'?
   42 |         ucp->uc_mcontext.gregs[REG_SP]   = (uintptr_t) sp;
      |                          ^~~~~
      |                          regs
arch/ppc/makecontext.c:50:42: error: 'union uc_regs_ptr' has no member named 'gregs'; did you mean 'regs'?
   50 |                         ucp->uc_mcontext.gregs[i + 3] = va_arg (va, libucontext_greg_t);
      |                                          ^~~~~
      |                                          regs
make: *** [Makefile:108: arch/ppc/makecontext.o] Error 1
 * ERROR: sys-libs/libucontext-1.1-r1::gentoo failed (compile phase):
 *   emake failed
Comment 1 ernsteiswuerfel archtester 2022-03-01 20:53:11 UTC
Created attachment 766127 [details]
build.log
Comment 2 Arfrever Frehtes Taifersar Arahesis 2022-03-03 16:17:09 UTC
I think that this is bug in glibc version of sys/ucontext.h header on some architectures (rather only PPC{32,64} relevant for Gentoo):

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

Problem should not occur in musl systems.


In glibc system, you can add this line to your /usr/include/sys/ucontext.h (e.g. somewhere close to definition of gregset_t):
	typedef unsigned long greg_t;
And try building sys-libs/libucontext again.
Comment 3 matoro archtester 2022-06-30 02:34:05 UTC
Is sys-libs/libucontext ONLY intended to be used on musl?  Based on the description, it seems like it's not totally useless on glibc systems (maybe you want an alternative ucontext implementation for a specific project?) but I want to make sure that upstream even supports that as a use case before opening a ticket with them.
Comment 4 Larry the Git Cow gentoo-dev 2022-09-25 01:27:48 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=07d32a980a910272e3d2e92d70c8b8f38c9406da

commit 07d32a980a910272e3d2e92d70c8b8f38c9406da
Author:     matoro <matoro@users.noreply.github.com>
AuthorDate: 2022-09-19 01:31:15 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2022-09-25 01:27:23 +0000

    profiles: mask sys-libs/libucontext on non-musl
    
    Closes: https://bugs.gentoo.org/834450
    Closes: https://github.com/gentoo/gentoo/pull/27342
    Signed-off-by: Sam James <sam@gentoo.org>

 profiles/base/package.mask          | 1 +
 profiles/features/musl/package.mask | 1 +
 2 files changed, 2 insertions(+)