Attempting to emerge firefox and ran into this. I've built firefox before, but I ended up doing voodoo and using rustup to install rust rather than using the Gentoo package... It appears that the bootstrap for rust assumes the system libraries will be up-to-date. I'm not very familiar with this process, but I found some relevant conversation on the rust-lang forums. They mention possibly using patchelf to modify the rpath on the bootstrap binaries to use the EPREFIX libc. https://users.rust-lang.org/t/building-rust-against-toolchain-in-non-standard-directory/16782 Reproducible: Always Steps to Reproduce: 1. Install prefix 2. emerge -a firefox (after various workarounds for e2fsprogs and nodejs) Actual Results: $ ebuild usr/portage/dev-lang/rust/rust-1.33.0.ebuild install ... Compiling serde_json v1.0.33 Compiling bootstrap v0.0.0 (/dev/shm/portage/dev-lang/rust-1.33.0/work/rustc-1.33.0-src/src/bootstrap) error: /lib64/libc.so.6: version `GLIBC_2.14' not found (required by /dev/shm/portage/dev-lang/rust-1.33.0/work/rustc-1.33.0-src/build/bootstrap/debug/deps/libserde_derive-7a071140702f03c6.so) --> src/bootstrap/lib.rs:114:1 | 114 | extern crate serde_derive; | ^^^^^^^^^^^^^^^^^^^^^^^^^^ error: aborting due to previous error error: Could not compile `bootstrap`. To learn more, run the command again with --verbose. Traceback (most recent call last): File "./x.py", line 11, in <module> bootstrap.main() File "/dev/shm/portage/dev-lang/rust-1.33.0/work/rustc-1.33.0-src/src/bootstrap/bootstrap.py", line 843, in main bootstrap(help_triggered) File "/dev/shm/portage/dev-lang/rust-1.33.0/work/rustc-1.33.0-src/src/bootstrap/bootstrap.py", line 814, in bootstrap build.build_bootstrap() File "/dev/shm/portage/dev-lang/rust-1.33.0/work/rustc-1.33.0-src/src/bootstrap/bootstrap.py", line 642, in build_bootstrap run(args, env=env, verbose=self.verbose) File "/dev/shm/portage/dev-lang/rust-1.33.0/work/rustc-1.33.0-src/src/bootstrap/bootstrap.py", line 141, in run raise RuntimeError(err) RuntimeError: failed to run: /dev/shm/portage/dev-lang/rust-1.33.0/work/rust-stage0/bin/cargo build --manifest-path /dev/shm/portage/dev-lang/rust-1.33.0/work/rustc-1.33.0-src/src/bootstrap/Cargo.toml --locked --frozen $ emerge --info setlocale: unsupported locale setting setlocale: unsupported locale setting Portage 2.3.62 (python 3.6.8-final-0, default/linux/amd64/17.0/no-multilib/prefix/kernel-2.6.32+, gcc-8.3.0, glibc-2.25-r11, 2.6.32-754.2.1.el6.x86_64 x86_64) ================================================================= System uname: Linux-2.6.32-754.2.1.el6.x86_64-x86_64-Intel-R-_Xeon-R-_Gold_6148_CPU_@_2.40GHz-with-redhat-6.10-Santiago KiB Mem: 528942136 total, 356382944 free KiB Swap: 524284 total, 286248 free Timestamp of repository gentoo: Fri, 29 Mar 2019 19:30:01 +0000 Head commit of repository gentoo: 9564db86ded70f1d6cb82b4555dab862a2e74450 sh bash 5.0_p3-r1 ld GNU ld (Gentoo 2.32 p1) 2.32.0 app-shells/bash: 5.0_p3-r1::gentoo dev-lang/perl: 5.28.0::gentoo dev-lang/python: 2.7.16::gentoo, 3.6.8::gentoo dev-util/cmake: 3.14.0::gentoo sys-apps/baselayout: 2.6-r1::gentoo sys-apps/sandbox: 2.17::gentoo sys-devel/autoconf: 2.13-r1::gentoo, 2.69-r4::gentoo sys-devel/automake: 1.16.1-r1::gentoo sys-devel/binutils: 2.32::gentoo sys-devel/gcc: 8.3.0::gentoo sys-devel/gcc-config: 2.0::gentoo sys-devel/libtool: 2.4.6-r5::gentoo sys-devel/make: 4.2.1-r4::gentoo sys-kernel/linux-headers: 5.0-r1::gentoo (virtual/os-headers) sys-libs/glibc: 2.25-r11::gentoo Repositories: gentoo location: /image/usr/portage sync-type: rsync sync-uri: rsync://rsync.gentoo.org/gentoo-portage priority: -1000 sync-rsync-extra-opts: sync-rsync-verify-metamanifest: no sync-rsync-verify-max-age: 24 sync-rsync-verify-jobs: 1 ACCEPT_KEYWORDS="amd64 ~amd64" ACCEPT_LICENSE="* -@EULA" CBUILD="x86_64-pc-linux-gnu" CFLAGS="-O2 -pipe -O2 -pipe" CHOST="x86_64-pc-linux-gnu" CONFIG_PROTECT="/etc /image/etc" CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/gconf /etc/sandbox.d /etc/terminfo /image/etc/env.d /image/etc/gentoo-release" CXXFLAGS="-O2 -pipe -O2 -pipe" DISTDIR="/image/usr/portage/distfiles" ENV_UNSET="DBUS_SESSION_BUS_ADDRESS DISPLAY GOBIN 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 sfperms strict unknown-features-warn unmerge-logs unmerge-orphans unprivileged" FFLAGS="-O2 -pipe" GENTOO_MIRRORS="http://distfiles.gentoo.org" LANG="en_US.UTF-8" LDFLAGS="-Wl,-O1 -Wl,--as-needed" MAKEOPTS="-j16" PKGDIR="/image/usr/portage/packages" PORTAGE_CONFIGROOT="/image/" 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="/dev/shm" USE="acl amd64 berkdb bzip2 cli crypt cxx dri fortran gdbm iconv ipv6 libtirpc ncurses nls nptl openmp pcre prefix readline seccomp ssl tcpd unicode zlib" ABI_X86="64" 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 isync itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf skytraq superstar2 timing tsip tripmate tnt ublox ubx" INPUT_DEVICES="libinput keyboard mouse" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" NETBEANS_MODULES="apisupport cnd groovy gsf harness ide identity j2ee java mobility nb php profiler soa visualweb webcommon websvccommon xml" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-6 php7-1" POSTGRES_TARGETS="postgres9_5 postgres10" PYTHON_SINGLE_TARGET="python3_6" PYTHON_TARGETS="python2_7 python3_6" RUBY_TARGETS="ruby24" 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
I used patchelf to set the interpreter on all the elf files in this directory, /dev/shm/portage/dev-lang/rust-1.33.0/work/rust-stage0/bin/, and that appears to have solved the bootstrap issue so far. While I was poking around /dev/shm/portage/dev-lang/rust-1.33.0/work/rustc-1.33.0-src/src/bootstrap/bootstrap.py I saw some checks for NixOS that make calls to patchelf if it's detected. I suspect the ebuild or potentially this python script would be the place to patch the stage0 bootstrap binaries. I should mention that I also used the patch from https://bugs.gentoo.org/673710 hoping that it would help with the bootstrap portion, but it did not. I'll respond to that thread if this build is successful.
Using patchelf to modify the interpreter on those stage0 binaries worked well. So that solves one of many issues with rust. I ran into two other issues that might warrant new bugs: 1. rust installer tries to install some bash completion scripts to /etc 2. rust installer attempts to resolve my prefix path as an absolute path, but if the prefix path has symlinks in it then it ends up using the symlink values instead. I'm not expert on symlinks, but the ebuild QA checker is angry because the files aren't in prefix (even though they really are!)
I think rust goes in the same bucket as ghc and alike, this is difficult as long as we need binary bootstrap bundles.
*** Bug 695318 has been marked as a duplicate of this bug. ***
Can confirm that rust-1.48.0 will also encounter the exact same error (`/lib64/libc.so.6: version `GLIBC_2.32' not found`) and needs the same patchelf to successfully build under prefix
Created attachment 689847 [details, diff] rust-1.50.0.ebuild patch fixes rust bootstrap for gentoo prefix Just ran into this issue while installing rust-1.50.0 in a Gentoo Prefix. I created the following ebuild patch that allowed successful installation. Note, the patch is based on this discussion from the rust forums: https://users.rust-lang.org/t/building-rust-against-toolchain-in-non-standard-directory/16782/10
Created attachment 689850 [details, diff] Updated rust-1.50.0.ebuild patch fixes rust bootstrap for gentoo prefix Corrected the patch (accidentally reversed the order of the diff the first time).
this patch looks good, I just wonder if we cannot get the path to the interpreter more dynamically, e.g. grab it from the running bash or at least using the symlinked target lib/ld64.so.1 or something
(In reply to Fabian Groffen from comment #8) > this patch looks good, I just wonder if we cannot get the path to the > interpreter more dynamically, e.g. grab it from the running bash or at least > using the symlinked target lib/ld64.so.1 or something I think this is what you're looking for - https://github.com/gentoo/gentoo/pull/19815. This PR is created on 2021.03.08 but sadly no reponse until know. I will contact gentoo prefix developers in person.
*** Bug 739574 has been marked as a duplicate of this bug. ***
The bug has been referenced in the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=18b519726110646e816e2b45e73ac39e3c9ee2bc commit 18b519726110646e816e2b45e73ac39e3c9ee2bc Author: Georgy Yakovlev <gyakovlev@gentoo.org> AuthorDate: 2021-04-03 22:33:49 +0000 Commit: Georgy Yakovlev <gyakovlev@gentoo.org> CommitDate: 2021-04-03 22:36:15 +0000 profiles/features/prefix: force rust[system-bootstrap] Bug: https://bugs.gentoo.org/682370 Bug: https://bugs.gentoo.org/739574 Closes: https://github.com/gentoo/gentoo/pull/19815 Signed-off-by: Georgy Yakovlev <gyakovlev@gentoo.org> profiles/features/prefix/package.use.force | 9 +++++++++ 1 file changed, 9 insertions(+)
Trying to install dev-lang/rust-1.58.1:stable/1.58::gentoo with the same error: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.33' not found. I've read this bug report and at some point there was a patch that sets on file var/db/repos/gentoo/profiles/features/prefix/package.use.force: dev-lang/rust system-bootstrap I've checked that I do have this USE set like that, but when emerging rust the USE flag is not used, shows as (-system-bootstrap) and then it fails compiling.
I don't have a prefix setup, so can't verify. use.force entry is still there. maybe it needs more work and unmasking, because it's also use.stable.mask'ed ? I'll leave it up to prefix team to decide.