Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 713556 - sys-devel/bison-3.5.3: ./lib/unistd.h:616:11: fatal error: getopt-cdefs.h: No such file or directory [musl]
Summary: sys-devel/bison-3.5.3: ./lib/unistd.h:616:11: fatal error: getopt-cdefs.h: No...
Status: RESOLVED UPSTREAM
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Hardened (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Gentoo musl team
URL:
Whiteboard: cdefs.h
Keywords:
Depends on:
Blocks:
 
Reported: 2020-03-20 02:36 UTC by Sam James
Modified: 2021-11-22 13:03 UTC (History)
2 users (show)

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


Attachments
build.log (file_713556.txt,79.79 KB, text/plain)
2020-03-20 02:36 UTC, Sam James
Details
emerge --info (file_713556.txt,6.22 KB, text/plain)
2020-03-20 02:37 UTC, Sam James
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Sam James archtester Gentoo Infrastructure gentoo-dev Security 2020-03-20 02:36:42 UTC
Created attachment 622922 [details]
build.log

...
x86_64-gentoo-linux-musl-gcc -DEXEEXT=\"\"   -I. -I./lib -I. -I./lib -DDEFAULT_TEXT_DOMAIN=\"bison-gnulib\"   -O2 -pipe -march=native -fdiagnostics-show-option -frecord-gcc-switches -O2 -pipe -march=native -fdiagnostics-color=always -c -o lib/libbison_a-bitsetv.o `test -f 'lib/bitsetv.c' || echo './'`lib/bitsetv.c
x86_64-gentoo-linux-musl-gcc -DEXEEXT=\"\"   -I. -I./lib -I. -I./lib -DDEFAULT_TEXT_DOMAIN=\"bison-gnulib\"   -O2 -pipe -march=native -fdiagnostics-show-option -frecord-gcc-switches -O2 -pipe -march=native -fdiagnostics-color=always -c -o lib/libbison_a-c-ctype.o `test -f 'lib/c-ctype.c' || echo './'`lib/c-ctype.c
x86_64-gentoo-linux-musl-gcc -DEXEEXT=\"\"   -I. -I./lib -I. -I./lib -DDEFAULT_TEXT_DOMAIN=\"bison-gnulib\"   -O2 -pipe -march=native -fdiagnostics-show-option -frecord-gcc-switches -O2 -pipe -march=native -fdiagnostics-color=always -c -o lib/libbison_a-c-strcasecmp.o `test -f 'lib/c-strcasecmp.c' || echo './'`lib/c-strcasecmp.c
x86_64-gentoo-linux-musl-gcc -DEXEEXT=\"\"   -I. -I./lib -I. -I./lib -DDEFAULT_TEXT_DOMAIN=\"bison-gnulib\"   -O2 -pipe -march=native -fdiagnostics-show-option -frecord-gcc-switches -O2 -pipe -march=native -fdiagnostics-color=always -c -o lib/libbison_a-c-strncasecmp.o `test -f 'lib/c-strncasecmp.c' || echo './'`lib/c-strncasecmp.c
x86_64-gentoo-linux-musl-gcc -DEXEEXT=\"\"   -I. -I./lib -I. -I./lib -DDEFAULT_TEXT_DOMAIN=\"bison-gnulib\"   -O2 -pipe -march=native -fdiagnostics-show-option -frecord-gcc-switches -O2 -pipe -march=native -fdiagnostics-color=always -c -o lib/libbison_a-careadlinkat.o `test -f 'lib/careadlinkat.c' || echo './'`lib/careadlinkat.c
In file included from lib/careadlinkat.h:24,
                 from lib/careadlinkat.c:23:
./lib/unistd.h:616:11: fatal error: getopt-cdefs.h: No such file or directory
  616 | # include <getopt-cdefs.h>
      |           ^~~~~~~~~~~~~~~~
compilation terminated.
make: *** [Makefile:4650: lib/libbison_a-careadlinkat.o] Error 1
Comment 1 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2020-03-20 02:37:35 UTC
Created attachment 622924 [details]
emerge --info
Comment 2 Michael 'veremitz' Everitt 2020-03-20 11:22:59 UTC
musl upstream has a FAQ entry specifically for this error:
https://wiki.musl-libc.org/faq.html#Q:-When-compiling-something-against-musl,-I-get-error-messages-about-%3Ccode%3Esys/cdefs.h%3C/code%3E

We will need to check/report upstream and patch affected code temporarily.
Comment 3 Georgy Yakovlev archtester gentoo-dev 2020-09-06 08:06:48 UTC
sys-devel/bison-3.7.2 builds fine on musl(tested on big-endian ppc64) without any patches or workarounds.

this bug is not actually musl specific.
you can still build older version of bison (tested 3.6.4 and 3.7.1) with MAKEOPTS="-j1"

the problem was a race in makefile, look at https://bugs.gentoo.org/716516

race just manifested for musl in the same header file every time.


commit fixing it: https://github.com/akimd/bison/commit/f7b642cff76d3b412fe3565b245f320fa205a4a0
Comment 4 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2021-11-22 13:03:29 UTC
(In reply to Georgy Yakovlev from comment #3)
> sys-devel/bison-3.7.2 builds fine on musl(tested on big-endian ppc64)
> without any patches or workarounds.
> 
> this bug is not actually musl specific.
> you can still build older version of bison (tested 3.6.4 and 3.7.1) with
> MAKEOPTS="-j1"
> 
> the problem was a race in makefile, look at https://bugs.gentoo.org/716516
> 
> race just manifested for musl in the same header file every time.
> 
> 
> commit fixing it:
> https://github.com/akimd/bison/commit/
> f7b642cff76d3b412fe3565b245f320fa205a4a0

I missed this comment, thank you!