Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 770334 - sys-libs/glibc-2.32-r7: cannot bootstrap on Arch Linux that has glibc-2.33
Summary: sys-libs/glibc-2.32-r7: cannot bootstrap on Arch Linux that has glibc-2.33
Status: RESOLVED FIXED
Alias: None
Product: Gentoo/Alt
Classification: Unclassified
Component: Prefix Support (show other bugs)
Hardware: AMD64 Linux
: Normal normal (vote)
Assignee: Gentoo Prefix
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-02-13 01:34 UTC by Joey Dumont
Modified: 2021-04-03 09:29 UTC (History)
0 users

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Joey Dumont 2021-02-13 01:34:00 UTC
sys-libs/glibc-2.32-r7 cannot compile as the stage2 gcc libraries have undefined symbols related to @GLIBC_2.33.

Reproducible: Always

Steps to Reproduce:
1.Bootstrap on Arch Linux with glibc-2.33 while Gentoo has glibc-2.32-r7
2.
3.
Actual Results:  
I tried bootstrapping prefix on Arch Linux with glibc-2.33 today again, and I cannot emerge sys-libs/glibc-2.32-r7 in stage3 of the bootstrap. The emake fails with the following error messages:

/cvmfs/software.dumont.ca/2021.02/compat/linux/x86_64/tmp/usr/lib/gcc/x86_64-pc-linux-gnu/10.2.0/../../../../x86_64-pc-linux-gnu/bin/ld: /cvmfs/software.dumont.ca/2021.02/compat/linux/x86_64/tmp/usr/lib/gcc/x86_64-pc-linux-gnu/10.2.0/libstdc++.so: undefined reference to `fstat64@GLIBC_2.33'
/cvmfs/software.dumont.ca/2021.02/compat/linux/x86_64/tmp/usr/lib/gcc/x86_64-pc-linux-gnu/10.2.0/../../../../x86_64-pc-linux-gnu/bin/ld: /cvmfs/software.dumont.ca/2021.02/compat/linux/x86_64/tmp/usr/lib/gcc/x86_64-pc-linux-gnu/10.2.0/libstdc++.so: undefined reference to `lstat@GLIBC_2.33'
/cvmfs/software.dumont.ca/2021.02/compat/linux/x86_64/tmp/usr/lib/gcc/x86_64-pc-linux-gnu/10.2.0/../../../../x86_64-pc-linux-gnu/bin/ld: /cvmfs/software.dumont.ca/2021.02/compat/linux/x86_64/tmp/usr/lib/gcc/x86_64-pc-linux-gnu/10.2.0/libstdc++.so: undefined reference to `stat@GLIBC_2.33'
collect2: error: ld returned 1 exit status
make[2]: *** [../Rules:218: /cvmfs/software.dumont.ca/2021.02/compat/linux/x86_64/var/tmp/portage/sys-libs/glibc-2.32-r7/work/build-amd64-x86_64-pc-linux-gnu-nptl/support/links-dso-program] Error 1
make[2]: Leaving directory '/cvmfs/software.dumont.ca/2021.02/compat/linux/x86_64/var/tmp/portage/sys-libs/glibc-2.32-r7/work/glibc-2.32/support'
make[1]: *** [Makefile:471: support/others] Error 2
make[1]: Leaving directory '/cvmfs/software.dumont.ca/2021.02/compat/linux/x86_64/var/tmp/portage/sys-libs/glibc-2.32-r7/work/glibc-2.32'
make: *** [Makefile:9: all] Error 2

It seems that the stage2 gcc gets the latest versions of these symbols from the host glibc:

objdump -D /cvmfs/software.dumont.ca/2021.02/compat/linux/x86_64/tmp/usr/lib/gcc/x86_64-pc-linux-gnu/10.2.0/libstdc++.so | grep GLIBC_2.33
   a71e0:	ff 25 0a 2f 1c 00    	jmp    *0x1c2f0a(%rip)        # 26a0f0 <fstat64@GLIBC_2.33>
   a88b0:	ff 25 a2 23 1c 00    	jmp    *0x1c23a2(%rip)        # 26ac58 <lstat@GLIBC_2.33>
   a8c00:	ff 25 fa 21 1c 00    	jmp    *0x1c21fa(%rip)        # 26ae00 <stat@GLIBC_2.33>

Is the fix simply to wait that glibc-2.33 lands in the Gentoo overlay? Or is there something proactive that should be done here?


 $ /cvmfs/software.dumont.ca/2021.02/compat/linux/x86_64/tmp/bin/emerge --info
--- Invalid atom in /cvmfs/software.dumont.ca/2021.02/compat/linux/x86_64/tmp/etc/portage/package.accept_keywords: sys-devel/gcc-11_pre20200206
Portage 3.0.12.0.2-prefix (python 3.8.6-final-0, default/linux/amd64/17.1/no-multilib/prefix/kernel-3.2+, gcc-10.2.0, unavailable, 5.10.15-arch1-1 x86_64)
=================================================================
System uname: Linux-5.10.15-arch1-1-x86_64-with-glibc2.33
KiB Mem:    16299876 total,    715848 free
KiB Swap:   16777212 total,  16422080 free
Timestamp of repository gentoo: Wed, 10 Feb 2021 00:45:01 +0000
Head commit of repository gentoo: 703d753d49c938a1340adf0d4ea9dd42db88ce0d
sh bash 5.1_p4
ld GNU ld (GNU Binutils) 2.36
app-shells/bash:      5.1_p4::gentoo
sys-devel/binutils:   2.35.2::gentoo
sys-devel/gcc:        10.2.0-r5::gentoo
sys-devel/gcc-config: 2.3.3::gentoo
Repositories:

gentoo
    location: /cvmfs/software.dumont.ca/2021.02/compat/linux/x86_64/var/db/repos/gentoo
    sync-type: rsync
    sync-uri: rsync://rsync.prefix.bitzolder.nl/gentoo-portage-prefix
    priority: -1000
    sync-rsync-verify-metamanifest: yes
    sync-rsync-extra-opts: 
    sync-rsync-verify-max-age: 24
    sync-rsync-verify-jobs: 1

ACCEPT_KEYWORDS="amd64 ~amd64 ~amd64-linux"
ACCEPT_LICENSE="@FREE"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -pipe -O2 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc"
CONFIG_PROTECT_MASK="/etc/env.d /etc/gconf /etc/gentoo-release /etc/terminfo"
CXXFLAGS="-O2 -pipe -O2 -pipe"
DISTDIR="/cvmfs/software.dumont.ca/2021.02/compat/linux/x86_64/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="-O2 -pipe"
FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs config-protect-if-modified distlocks ebuild-locks fixlafiles force-prefix ipc-sandbox merge-sync multilib-strict network-sandbox news parallel-fetch pid-sandbox preserve-libs protect-owned qa-unresolved-soname-deps sfperms strict unknown-features-warn unmerge-logs unmerge-orphans unprivileged"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="http://distfiles.gentoo.org"
LANG="en_CA.UTF-8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
MAKEOPTS="-j5"
PKGDIR="/cvmfs/software.dumont.ca/2021.02/compat/linux/x86_64/tmp/var/cache/binpkgs"
PORTAGE_CONFIGROOT="/cvmfs/software.dumont.ca/2021.02/compat/linux/x86_64/tmp/"
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="/cvmfs/software.dumont.ca/2021.02/compat/linux/x86_64/tmp/var/tmp"
USE="amd64 bootstrap bzip2 clang cli crypt dri iconv internal-glib ipv6 libglvnd libtirpc ncurses nptl openmp prefix seccomp split-usr ssl tcpd unicode zlib" 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="mmx mmxext sse sse2" 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" 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_8" PYTHON_TARGETS="python3_8" RUBY_TARGETS="ruby26" USERLAND="GNU" VIDEO_CARDS="amdgpu fbdev intel nouveau radeon radeonsi vesa dummy v4l" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipset ipp2p iface geoip fuzzy condition tee tarpit sysrq 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
Comment 1 Benda Xu gentoo-dev 2021-02-13 08:41:19 UTC
Thanks Joey, do you have the build.log of sys-libs/glibc?  That will tell the root cause of this bug.
Comment 2 Joey Dumont 2021-02-13 13:05:39 UTC
Oops, sorry, forgot to link it: https://drive.google.com/file/d/1mBeEDBxno8g6fRnrOE6LdB9VxWj7Hb2J/view?usp=sharing

It's 20MB large, so unfortunately it needs to be externally linked.
Comment 3 Joey Dumont 2021-02-18 18:33:50 UTC
So, the stage2 libstdc++ picks up symbols from the host libc that are not in the libc version that we are trying to boostrap. In short:

$ objdump -T /usr/lib64/libc.so.6 | grep "GLIBC.*fstat"
00000000000ef570  w   DF .text	0000000000000032  GLIBC_2.33  fstatat
00000000000ef960  w   DF .text	0000000000000025  GLIBC_2.2.5 fstatfs
00000000000efa10  w   DF .text	000000000000006c  GLIBC_2.2.5 fstatvfs
00000000000ef530  w   DF .text	0000000000000018  GLIBC_2.33  fstat
00000000000ef960  w   DF .text	0000000000000025  GLIBC_2.2.5 fstatfs64
00000000000ef530  w   DF .text	0000000000000018  GLIBC_2.33  fstat64
00000000000efa10  w   DF .text	000000000000006c  GLIBC_2.2.5 fstatvfs64
00000000000ef530 g    DF .text	0000000000000018  GLIBC_PRIVATE __fstat64
00000000000ef570  w   DF .text	0000000000000032  GLIBC_2.33  fstatat64

objdump -T /cvmfs/software.dumont.ca/2021.02/compat/linux/x86_64/var/tmp/portage/sys-libs/glibc-2.32-r7/work/build-amd64-x86_64-pc-linux-gnu-nptl/libc.so |grep "GLIBC.*fstat"
00000000000ed2a0  w   DF .text	0000000000000021  GLIBC_2.2.5 fstatfs
00000000000ed340  w   DF .text	000000000000006c  GLIBC_2.2.5 fstatvfs
00000000000ed2a0  w   DF .text	0000000000000021  GLIBC_2.2.5 fstatfs64
00000000000ed340  w   DF .text	000000000000006c  GLIBC_2.2.5 fstatvfs64

When trying to emerge glibc, rpath-link is set to EPREFIX/var/tmp/portage/sys-libs/glibc-2.32-r7/work/build-amd64-x86_64-pc-linux-gnu-nptl/libc.so, so the linker is trying to use the newly built libc.so to link crtn.o. 

I'm not sure what the fix is. I've been reading online that glibc doesn't really support bootstrapping an older glibc from a newer one. Maybe statically linking the stage2 libstdc++?
Comment 4 Joey Dumont 2021-03-04 10:45:38 UTC
I tried the workaround in https://bugs.gentoo.org/702342#c13, as I thought the issue was similar, but I got the same error.
Comment 5 Andreas K. Hüttel archtester gentoo-dev 2021-03-17 20:24:01 UTC
There's only one fix, and that is using glibc-2.33.

(It'll go into ~arch soon.)
Comment 6 Joey Dumont 2021-03-18 01:02:40 UTC
Thank you, that's what I suspected when I first opened the bug report. I was hoping there was some kind of magic to fix it.

Should I confirm that bootstrap works as expected when 2.33 lands on ~arch before we close this, or do you want to close it now?
Comment 7 Gavin Deshotel 2021-04-03 05:34:35 UTC
Error is reproducible on my Artix Linux machine as well.
Comment 8 Larry the Git Cow gentoo-dev 2021-04-03 09:29:50 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=403201568d69cb5d00cedfb8799ef8a12e239d0c

commit 403201568d69cb5d00cedfb8799ef8a12e239d0c
Author:     Andreas K. Hüttel <dilfridge@gentoo.org>
AuthorDate: 2021-04-03 09:29:12 +0000
Commit:     Andreas K. Hüttel <dilfridge@gentoo.org>
CommitDate: 2021-04-03 09:29:39 +0000

    sys-libs/glibc: Re-keyword 2.33
    
    Closes: https://bugs.gentoo.org/770334
    Bug: https://bugs.gentoo.org/769989
    Package-Manager: Portage-3.0.13, Repoman-3.0.2
    Signed-off-by: Andreas K. Huettel <dilfridge@gentoo.org>

 sys-libs/glibc/glibc-2.33.ebuild | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)