Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 804645 - sys-libs/glibc-2.33-r3, r4: fails to build with /bin/sh = zsh , "__LINUX_KERNEL_VERSION" is not defined
Summary: sys-libs/glibc-2.33-r3, r4: fails to build with /bin/sh = zsh , "__LINUX_KERN...
Status: UNCONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: AMD64 Linux
: Normal normal (vote)
Assignee: Gentoo Toolchain Maintainers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-07-27 15:13 UTC by Johannes Penßel
Modified: 2022-02-07 02:55 UTC (History)
1 user (show)

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


Attachments
glibc build.log (file_804645.txt,241.67 KB, text/plain)
2021-07-27 15:13 UTC, Johannes Penßel
Details
/var/tmp/portage/sys-libs/glibc-2.33-r4/work/build-x86-x86_64-pc-linux-gnu-nptl/config.log (file_804645.txt,44.08 KB, text/plain)
2021-07-27 15:16 UTC, Johannes Penßel
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Johannes Penßel 2021-07-27 15:13:35 UTC
Created attachment 727314 [details]
glibc build.log

When emerging glibc-2.33-r3/r4 (I couldn't test earlier verions due to a libxcrypt dependency conflict), the build fails with the error mentioned above. My last successful glibc emerge was on July 18th (2.33-r3).

Attempted fixes so far:

rebuilding gcc/binutils/libtool
reverting to kernel version 5.13.4
rebuilding the kernel using rebuilt gcc (built with clang 12.0.1 normally)


relevant code snippet:
	
In file included from ../sysdeps/unix/sysv/linux/sysdep.h:22,
                 from ../sysdeps/unix/sysv/linux/i386/sysdep.h:23,
                 from ../sysdeps/i386/nptl/tls.h:28,
                 from ../sysdeps/i386/i686/nptl/tls.h:33,
                 from errno-loc.c:21:
../sysdeps/unix/sysv/linux/i386/kernel-features.h:21:5: warning: "__LINUX_KERNEL_VERSION" is not defined, evaluates to 0 [-Wundef]
   21 | #if __LINUX_KERNEL_VERSION >= 0x040300
      |     ^~~~~~~~~~~~~~~~~~~~~~
In file included from ../sysdeps/unix/sysv/linux/sysdep.h:22,
                 from ../sysdeps/unix/sysv/linux/i386/sysdep.h:23,
                 from ../sysdeps/i386/start.S:55:
../sysdeps/unix/sysv/linux/i386/kernel-features.h:21:5: error: "__LINUX_KERNEL_VERSION" is not defined, evaluates to 0 [-Werror=undef]
   21 | #if __LINUX_KERNEL_VERSION >= 0x040300
      |     ^~~~~~~~~~~~~~~~~~~~~~
In file included from ../sysdeps/unix/sysv/linux/sysdep.h:22,
                 from ../sysdeps/unix/sysv/linux/i386/sysdep.h:23,
                 from ../sysdeps/i386/start.S:55:
../sysdeps/unix/sysv/linux/i386/kernel-features.h:21:5: error: "__LINUX_KERNEL_VERSION" is not defined, evaluates to 0 [-Werror=undef]
   21 | #if __LINUX_KERNEL_VERSION >= 0x040300
      |     ^~~~~~~~~~~~~~~~~~~~~~
cc1: some warnings being treated as errors
cc1: some warnings being treated as errors
make[2]: *** [/var/tmp/portage/sys-libs/glibc-2.33-r4/work/build-x86-x86_64-pc-linux-gnu-nptl/sysd-rules:721: /var/tmp/portage/sys-libs/glibc-2.33-r4/work/build-x86-x86_64-pc-linux-gnu-nptl/csu/start.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[2]: *** [/var/tmp/portage/sys-libs/glibc-2.33-r4/work/build-x86-x86_64-pc-linux-gnu-nptl/sysd-rules:737: /var/tmp/portage/sys-libs/glibc-2.33-r4/work/build-x86-x86_64-pc-linux-gnu-nptl/csu/start.os] Error 1
In file included from ../sysdeps/unix/sysv/linux/sysdep.h:22,
                 from ../sysdeps/unix/sysv/linux/i386/sysdep.h:23,
                 from ../sysdeps/i386/nptl/tls.h:28,
                 from ../sysdeps/i386/i686/nptl/tls.h:33,
                 from ../include/link.h:51,
                 from ../csu/abi-note.c:56,
                 from ../sysdeps/x86/abi-note.c:29:
../sysdeps/unix/sysv/linux/i386/kernel-features.h:21:5: warning: "__LINUX_KERNEL_VERSION" is not defined, evaluates to 0 [-Wundef]
   21 | #if __LINUX_KERNEL_VERSION >= 0x040300
      |     ^~~~~~~~~~~~~~~~~~~~~~
make[2]: Leaving directory '/var/tmp/portage/sys-libs/glibc-2.33-r4/work/glibc-2.33/csu'
make[1]: *** [Makefile:480: csu/subdir_lib] Error 2
make[1]: Leaving directory '/var/tmp/portage/sys-libs/glibc-2.33-r4/work/glibc-2.33'
make: *** [Makefile:9: all] Error 2
make: Leaving directory '/var/tmp/portage/sys-libs/glibc-2.33-r4/work/build-x86-x86_64-pc-linux-gnu-nptl'
 * ERROR: sys-libs/glibc-2.33-r4::gentoo failed (compile phase):
 *   emake failed
 *
 * If you need support, post the output of `emerge --info '=sys-libs/glibc-2.33-r4::gentoo'`,
 * the complete build log and the output of `emerge -pqv '=sys-libs/glibc-2.33-r4::gentoo'`.
 * The complete build log is located at '/var/tmp/portage/sys-libs/glibc-2.33-r4/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/sys-libs/glibc-2.33-r4/temp/environment'.
 * Working directory: '/var/tmp/portage/sys-libs/glibc-2.33-r4/work/glibc-2.33'
 * S: '/var/tmp/portage/sys-libs/glibc-2.33-r4/work/glibc-2.33'

emerge --info:

Portage 3.0.20 (python 3.9.6-final-0, default/linux/amd64/17.1/desktop, gcc-11.1.0, glibc-2.33-r3, 5.13.5-gentoo x86_64)
=================================================================
                         System Settings
=================================================================
System uname: Linux-5.13.5-gentoo-x86_64-11th_Gen_Intel-R-_Core-TM-_i5-1135G7_@_2.40GHz-with-glibc2.33
KiB Mem:     7891492 total,   6217796 free
KiB Swap:   15359996 total,  15359996 free
Timestamp of repository gentoo: Tue, 27 Jul 2021 05:23:39 +0000
Head commit of repository gentoo: 21f9e31f373b70d8434e599441a7a1093c4aa7a5

Timestamp of repository guru: Mon, 26 Jul 2021 14:21:38 +0000
Head commit of repository guru: 01121dfec7062973f881865c5ec0101646f10e32

Timestamp of repository lto-overlay: Sat, 17 Jul 2021 08:07:16 +0000
Head commit of repository lto-overlay: 3a22a1305a69797c48ded0eeb69fd27bdf3ff9e0

Timestamp of repository mv: Sun, 25 Jul 2021 19:51:55 +0000
Head commit of repository mv: 89738b9cf3fc004e432046648d2b2027706c1539

Head commit of repository tlp: ced908095a1bafc1af3583efc4a24b39e2ab8c12

Timestamp of repository ulm: Fri, 02 Jul 2021 15:53:54 +0000
Head commit of repository ulm: c4a1b9f79ff5f1eb31e8d6735229a021631268ca

sh zsh 5.8
ld GNU ld (Gentoo 2.36.1 p4) 2.36.1
ccache version 4.3 [disabled]
app-shells/bash:          5.1_p8::gentoo
dev-lang/perl:            5.34.0-r1::gentoo
dev-lang/python:          3.9.6-r1::lto-overlay, 3.10.0_beta4::gentoo
dev-lang/rust:            1.53.0::gentoo
dev-util/ccache:          4.3-r3::gentoo
dev-util/cmake:           3.21.0::gentoo
sys-apps/baselayout:      2.7-r3::gentoo
sys-apps/openrc:          0.43.3::gentoo
sys-apps/sandbox:         2.24::gentoo
sys-devel/autoconf:       2.13-r1::gentoo, 2.69-r5::gentoo
sys-devel/automake:       1.16.3-r1::gentoo
sys-devel/binutils:       2.36.1-r2::gentoo
sys-devel/gcc:            11.1.0-r2::gentoo
sys-devel/gcc-config:     2.4::gentoo
sys-devel/libtool:        2.4.6-r6::gentoo
sys-devel/make:           4.3::gentoo
sys-kernel/linux-headers: 5.13::gentoo (virtual/os-headers)
sys-libs/glibc:           2.33-r3::gentoo
Repositories:

gentoo
    location: /var/db/repos/gentoo
    sync-type: git
    sync-uri: https://github.com/gentoo-mirror/gentoo.git
    priority: -1000
    sync-git-verify-commit-signature: yes

guru
    location: /var/db/repos/guru
    sync-type: git
    sync-uri: https://github.com/gentoo-mirror/guru.git
    masters: gentoo

lto-overlay
    location: /var/db/repos/lto-overlay
    sync-type: git
    sync-uri: https://github.com/gentoo-mirror/lto-overlay.git
    masters: gentoo mv

mv
    location: /var/db/repos/mv
    sync-type: git
    sync-uri: https://github.com/gentoo-mirror/mv.git
    masters: gentoo

tlp
    location: /var/db/repos/tlp
    sync-type: git
    sync-uri: https://github.com/dywisor/tlp-portage.git
    masters: gentoo

ulm
    location: /var/db/repos/ulm
    sync-type: git
    sync-uri: https://github.com/gentoo-mirror/ulm.git
    masters: gentoo

ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="*"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=native -O3 -fgraphite-identity -floop-nest-optimize -fdevirtualize-at-ltrans -fipa-pta -fno-semantic-interposition -flto=8 -fuse-linker-plugin -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/gnupg/qualified.txt"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-march=native -O3 -fgraphite-identity -floop-nest-optimize -fdevirtualize-at-ltrans -fipa-pta -fno-semantic-interposition -flto=8 -fuse-linker-plugin -pipe"
DISTDIR="/var/cache/distfiles"
ENV_UNSET="CARGO_HOME DBUS_SESSION_BUS_ADDRESS DISPLAY GOBIN GOPATH PERL5LIB PERL5OPT PERLPREFIX PERL_CORE PERL_MB_OPT PERL_MM_OPT XAUTHORITY XDG_CACHE_HOME XDG_CONFIG_HOME XDG_DATA_HOME XDG_RUNTIME_DIR"
FCFLAGS="-march=native -O3 -fgraphite-identity -floop-nest-optimize -fdevirtualize-at-ltrans -fipa-pta -fno-semantic-interposition -flto=8 -fuse-linker-plugin -pipe"
FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs config-protect-if-modified distlocks ebuild-locks fixlafiles ipc-sandbox merge-sync multilib-strict network-sandbox news parallel-fetch pid-sandbox preserve-libs protect-owned qa-unresolved-soname-deps sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-march=native -O3 -fgraphite-identity -floop-nest-optimize -fdevirtualize-at-ltrans -fipa-pta -fno-semantic-interposition -flto=8 -fuse-linker-plugin -pipe"
GENTOO_MIRRORS="http://distfiles.gentoo.org"
LANG="en_US.utf8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
MAKEOPTS="-j8"
PKGDIR="/var/cache/binpkgs"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --omit-dir-times --compress --force --whole-file --delete --stats --human-readable --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages --exclude=/.git"
PORTAGE_TMPDIR="/var/tmp"
USE="X a52 aac acl acpi alsa amd64 blake2 bluetooth branding bzip2 cacert cairo cet cjk clang cli crypt cuda cups curl dbus dhcpcd dri drm dts egl elogind emboss encode exif expat ffmpeg flac fluidsynth fontconfig fontforge fortran gbm gcrypt gdbm gif git gles2 gmp gnutls gpm grub gstreamer gtk gtk3 gui iconv icu idn ipv6 iwd jack jemalloc jit jpeg jpeg2k kms ladspa lcms ldap libcaca libgig libglvnd libkms libnotify libtirpc llvm-libunwind lm-sensors logrotate lto lv2 lz4 lzma lzo mad metric mng modern-top mp3 mp4 mpeg multilib multitarget ncurses networkmanager nftables nls nptl ogg opencl opengl openh264 openmp opus pam pango pcre pdf pgo pkcs11 pkcs7 png policykit ppds pulseaudio qt5 rar readline resolvconf sasl scanner sctp sdl seccomp snmp split-usr ssl startup-notification svg syslog tcl tcpd threads tiff tk truetype udev udisks unicode upower usb v4l vaapi vdpau vorbis vpx wayland webengine webp wifi wxwidgets x264 x265 xattr xcb xml xv xvid zip zlib zsh-completion zstd" ABI_X86="64" ADA_TARGET="gnat_2018" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" CALLIGRA_FEATURES="karbon sheets words" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" CPU_FLAGS_X86="aes avx avx2 avx512f avx512dq avx512cd avx512bw avx512vl avx512vbmi f16c fma3 mmx mmxext pclmul popcnt rdrand sha sse sse2 sse3 sse4_1 sse4_2 ssse3" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock greis isync itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf skytraq superstar2 timing tsip tripmate tnt ublox ubx" INPUT_DEVICES="libinput" KERNEL="linux" L10N="*" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LUA_SINGLE_TARGET="lua5-1" LUA_TARGETS="lua5-1" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php7-3 php7-4" POSTGRES_TARGETS="postgres10 postgres11" PYTHON_SINGLE_TARGET="python3_9" PYTHON_TARGETS="python3_9" RUBY_TARGETS="ruby26" USERLAND="GNU" VIDEO_CARDS="intel i965 iris nvidia" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq proto steal rawnat logmark ipmark dhcpmac delude chaos account"
Unset:  CC, CPPFLAGS, CTARGET, CXX, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LC_ALL, LINGUAS, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, RUSTFLAGS 

emerge -pqv:

[ebuild     U ] sys-libs/glibc-2.33-r4 [2.33-r3] USE="multiarch (multilib) ssp (static-libs) -audit -caps (-cet) -compile-locales (-crypt) -custom-cflags -doc -gd -headers-only -multilib-bootstrap -nscd -profile (-selinux) -static-pie -suid -systemd% -systemtap -test (-vanilla)"
Comment 1 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2021-07-27 15:15:18 UTC
>sh zsh 5.8

Seems suspicious. Could you please try with /bin/sh pointing to e.g. bash or dash?
Comment 2 Johannes Penßel 2021-07-27 15:16:59 UTC
Created attachment 727317 [details]
/var/tmp/portage/sys-libs/glibc-2.33-r4/work/build-x86-x86_64-pc-linux-gnu-nptl/config.log
Comment 3 Andreas K. Hüttel archtester gentoo-dev 2021-07-27 15:24:49 UTC
checking installed Linux kernel header files... 3.2.0 or later
/var/tmp/portage/sys-libs/glibc-2.33-r4/work/glibc-2.33/sysdeps/unix/sysv/linux/configure:167: parse error near `user_version=$((`ech...'

^ here we have it
Comment 4 Johannes Penßel 2021-07-27 15:29:54 UTC
Turns out the problem was that I decided to disable bash in eselect-sh a few days ago. With bash selected in eselect-sh, the build works fine again, even though I'm still using zsh.
Comment 5 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2022-02-07 02:55:24 UTC
I think someone motivated to use ZSH as /bin/sh needs to report this upstream.