Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 949374 - dev-lang/rust-1.84.1[nightly]: rustc: undefined symbol: _ZN3std2rt19lang_start_internal17h12de313c8fa04a78E
Summary: dev-lang/rust-1.84.1[nightly]: rustc: undefined symbol: _ZN3std2rt19lang_star...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Randy Barlow
URL:
Whiteboard:
Keywords: PullRequest
Depends on:
Blocks:
 
Reported: 2025-02-06 18:35 UTC by Ben Buhse
Modified: 2025-02-10 00:57 UTC (History)
11 users (show)

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


Attachments
build.log (file_949374.txt,9.05 KB, text/plain)
2025-02-06 18:36 UTC, Ben Buhse
Details
build.log (build.log,32.67 KB, text/plain)
2025-02-07 02:44 UTC, John Turner
Details
portage patch to update rustc_driver version (0001-Add-version-to-rustc_driver.patch,1.02 KB, text/plain)
2025-02-09 01:55 UTC, demize
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ben Buhse 2025-02-06 18:35:13 UTC
Trying to emerge dev-util/maturin-1.8.2:0 fails during the compile phase

Reproducible: Always

Steps to Reproduce:
1. emerge -v1 dev-util/maturin with ~amd64 enabled
Actual Results:  
 * ERROR: dev-util/maturin-1.8.2::gentoo failed (compile phase):
 *   cargo build failed
 * 
 * Call stack:
 *     ebuild.sh, line  136:  Called src_compile
 *   environment, line 4406:  Called distutils-r1_src_compile
 *   environment, line 2291:  Called _distutils-r1_run_common_phase 'python_compile_all'
 *   environment, line  766:  Called multibuild_foreach_variant 'distutils-r1_run_phase' 'python_compile_all'
 *   environment, line 3368:  Called _multibuild_run 'distutils-r1_run_phase' 'python_compile_all'
 *   environment, line 3366:  Called distutils-r1_run_phase 'python_compile_all'
 *   environment, line 2270:  Called python_compile_all
 *   environment, line 3643:  Called cargo_src_compile
 *   environment, line 1933:  Called die
 * The specific snippet of code:
 *       cargo_env "${@}" || die "cargo build failed"
 * 
 * If you need support, post the output of `emerge --info '=dev-util/maturin-1.8.2::gentoo'`,
 * the complete build log and the output of `emerge -pqv '=dev-util/maturin-1.8.2::gentoo'`.
 * The complete build log is located at '/var/tmp/portage/dev-util/maturin-1.8.2/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/dev-util/maturin-1.8.2/temp/environment'.
 * Working directory: '/var/tmp/portage/dev-util/maturin-1.8.2/work/maturin-1.8.2'
 * S: '/var/tmp/portage/dev-util/maturin-1.8.2/work/maturin-1.8.2'

Expected Results:  
Build should succeed and the emerge should continue

$ emerge -pqv '=dev-util/maturin-1.8.2::gentoo'
[ebuild     U ] dev-util/maturin-1.8.2 [1.8.1] USE="ssl -debug -doc -test" PYTHON_TARGETS="python3_12 -pypy3 -python3_10 -python3_11 -python3_13" 

$ emerge --info '=dev-util/maturin-1.8.2::gentoo'
Portage 3.0.67 (python 3.12.9-final-0, default/linux/amd64/23.0/hardened, gcc-14, glibc-2.40-r8, 6.13.1-gentoo-dist x86_64)
=================================================================
                         System Settings
=================================================================
System uname: Linux-6.13.1-gentoo-dist-x86_64-AMD_Ryzen_7_3700X_8-Core_Processor-with-glibc2.40
KiB Mem:    32748496 total,   1124472 free
KiB Swap:   33554428 total,  27459708 free
Timestamp of repository gentoo: Thu, 06 Feb 2025 15:03:41 +0000
Head commit of repository gentoo: efc550417d234aeb5f25ca82a8571ef245ca3a5f

Timestamp of repository ace: Wed, 05 Feb 2025 18:48:30 +0000
Head commit of repository ace: 90cba947f82e4252d459e235a3234e8a5b7167be

Head commit of repository buhserepo: 84e0fe971cee1a1d2827a3d41e290aaef671641d

Timestamp of repository gentoo-zh: Thu, 06 Feb 2025 14:33:23 +0000
Head commit of repository gentoo-zh: c3c65fada1394f617df6a9efc50d054deb3e063b

Timestamp of repository guru: Thu, 06 Feb 2025 09:33:32 +0000
Head commit of repository guru: eb722cbd89be199a843c3fce4f088b7a83a51848

Timestamp of repository haskell: Thu, 06 Feb 2025 12:18:21 +0000
Head commit of repository haskell: 3b20cd2f1a64f5268131cc19f991beb459b99c4a

Head commit of repository librewolf: edee332b42d5b174260928c8ad237e03caba5874

Timestamp of repository racket-overlay: Tue, 28 Jan 2025 07:37:04 +0000
Head commit of repository racket-overlay: a594d37676c220722a4877cd4a04f3951d757881

Timestamp of repository sam_c: Tue, 28 Jan 2025 07:36:56 +0000
Head commit of repository sam_c: eb723c82db0983f7973df5ba092b1aaee5af3d69

Timestamp of repository steam-overlay: Wed, 05 Feb 2025 18:48:29 +0000
Head commit of repository steam-overlay: 5b1fd31c48074c752648dd949fc7c6bc3fc20783

sh dash 0.5.12-r1
ld GNU ld (Gentoo 2.43 p3) 2.43.1
app-misc/pax-utils:        1.3.8::gentoo
app-shells/bash:           5.2_p37::gentoo
dev-build/autoconf:        2.71-r7::gentoo, 2.72-r1::gentoo
dev-build/automake:        1.17-r1::gentoo
dev-build/cmake:           3.31.5::gentoo
dev-build/libtool:         2.5.4::gentoo
dev-build/make:            4.4.1-r100::gentoo
dev-build/meson:           1.7.0::gentoo
dev-java/java-config:      2.3.4::gentoo
dev-lang/perl:             5.40.0-r1::gentoo
dev-lang/python:           3.11.11_p1::gentoo, 3.12.9::gentoo, 3.13.2::gentoo
dev-lang/rust:             1.84.0::gentoo, 1.84.1::gentoo
dev-lang/rust-bin:         1.84.0::gentoo, 1.84.1::gentoo
llvm-core/clang:           18.1.8-r6::gentoo, 19.1.7::gentoo
llvm-core/lld:             18.1.8::gentoo, 19.1.7::gentoo
llvm-core/llvm:            18.1.8-r6::gentoo, 19.1.7::gentoo
sys-apps/baselayout:       2.17::gentoo
sys-apps/openrc:           0.56::gentoo
sys-apps/sandbox:          2.43::gentoo
sys-devel/binutils:        2.43-r2::gentoo, 2.44::gentoo
sys-devel/binutils-config: 5.5.2::gentoo
sys-devel/gcc:             14.2.1_p20241221::gentoo
sys-devel/gcc-config:      2.12.1::gentoo
sys-kernel/linux-headers:  6.13::gentoo (virtual/os-headers)
sys-libs/glibc:            2.40-r8::gentoo
Repositories:

gentoo
    location: /var/db/repos/gentoo
    sync-type: git
    sync-uri: https://github.com/gentoo-mirror/gentoo.git
    priority: -1000
    volatile: False

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

buhserepo
    location: /var/db/repos/buhserepo
    sync-type: git
    sync-uri: https://codeberg.org/bwbuhse/buhserepo.git
    masters: gentoo
    volatile: False

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

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

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

librewolf
    location: /var/db/repos/librewolf
    sync-type: git
    sync-uri: https://codeberg.org/librewolf/gentoo.git
    masters: gentoo
    volatile: False

racket-overlay
    location: /var/db/repos/racket-overlay
    sync-type: git
    sync-uri: https://github.com/gentoo-mirror/racket-overlay.git
    masters: gentoo
    volatile: False

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

steam-overlay
    location: /var/db/repos/steam-overlay
    sync-type: git
    sync-uri: https://github.com/gentoo-mirror/steam-overlay.git
    masters: gentoo
    volatile: False

Binary Repositories:

binhost
    priority: 9999
    sync-uri: https://distfiles.gentoo.org/releases/amd64/binpackages/23.0/x86-64

ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="*"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O3 -pipe -march=native -flto=auto -Werror=odr -Werror=lto-type-mismatch -Werror=strict-aliasing"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/lib64/libreoffice/program/sofficerc /usr/share/config /usr/share/gnupg/qualified.txt /var/bind"
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/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c"
CXXFLAGS="-O3 -pipe -march=native -flto=auto -Werror=odr -Werror=lto-type-mismatch -Werror=strict-aliasing"
DISTDIR="/var/cache/distfiles"
ENV_UNSET="CARGO_HOME DBUS_SESSION_BUS_ADDRESS DISPLAY GDK_PIXBUF_MODULE_FILE 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 XDG_STATE_HOME"
FCFLAGS="-O3 -pipe -march=native -flto=auto -Werror=odr -Werror=lto-type-mismatch -Werror=strict-aliasing"
FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs binpkg-multi-instance binpkg-request-signature buildpkg-live config-protect-if-modified distlocks ebuild-locks fixlafiles ipc-sandbox merge-sync merge-wait multilib-strict network-sandbox news parallel-fetch pid-sandbox pkgdir-index-trusted preserve-libs protect-owned qa-unresolved-soname-deps sandbox strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-O3 -pipe -march=native -flto=auto -Werror=odr -Werror=lto-type-mismatch -Werror=strict-aliasing"
GENTOO_MIRRORS="http://distfiles.gentoo.org"
LANG="en_US.utf8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed -Wl,-z,pack-relative-relocs -fuse-ld=mold"
LEX="flex"
MAKEOPTS="-j16"
PKGDIR="/var/cache/binpkgs"
PORTAGE_COMPRESS="zstd"
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"
RUSTFLAGS="-C target-cpu=native -C opt-level=3"
SHELL="/bin/bash"
USE="X a52 aac acl acpi alsa amd64 bluetooth branding bzip2 cairo cdda cdr cet crypt cups dbus dist-kernel dri dts dvd dvdr elogind encode exif flac gdbm gif gpm gtk gui hardened iconv icu ipv6 jpeg kf6compat lcms libnotify libtirpc lto mad mng mp3 mp4 mpeg multilib ncurses networkmanager nls ogg opengl openmp pam pango pcre pdf pic pie png policykit ppds pulseaudio qml qt5 qt6 readline sdl seccomp sound spell ssl ssp startup-notification svg test-rust tiff truetype udev udisks unicode upower usb vaapi vdpau vorbis vulkan wayland wxwidgets x264 xattr xcb xft xml xtpax xv xvid zink zlib zsh-completion" ABI_X86="64" ADA_TARGET="gcc_13" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_anon authn_dbm authn_file authz_dbm authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir env expires ext_filter file_cache filter headers include info log_config logio 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 aes avx avx2 f16c fma3 pclmul popcnt rdrand sha sse3 sse4_1 sse4_2 sse4a ssse3" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock greis isync itrax navcom oceanserver oncore rtcm104v2 rtcm104v3 sirf skytraq superstar2 tsip tripmate tnt ublox" GRUB_PLATFORMS="efi-64" GUILE_SINGLE_TARGET="3-0" GUILE_TARGETS="3-0" INPUT_DEVICES="libinput" KERNEL="linux" LCD_DEVICES="bayrad cfontz glk hd44780 lb216 lcdm001 mtxorb text" LUA_SINGLE_TARGET="lua5-1" LUA_TARGETS="lua5-1" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php8-2" POSTGRES_TARGETS="postgres16" PYTHON_SINGLE_TARGET="python3_12" PYTHON_TARGETS="python3_12" RUBY_TARGETS="ruby32" VIDEO_CARDS="amdgpu radeonsi" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipp2p iface geoip fuzzy condition tarpit sysrq proto logmark ipmark dhcpmac delude chaos account"
Unset:  ADDR2LINE, AR, ARFLAGS, AS, ASFLAGS, CC, CCLD, CONFIG_SHELL, CPP, CPPFLAGS, CTARGET, CXX, CXXFILT, ELFEDIT, EMERGE_DEFAULT_OPTS, EXTRA_ECONF, F77FLAGS, FC, GCOV, GPROF, INSTALL_MASK, LC_ALL, LD, LFLAGS, LIBTOOL, LINGUAS, MAKE, MAKEFLAGS, NM, OBJCOPY, OBJDUMP, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, PYTHONPATH, RANLIB, READELF, SIZE, STRINGS, STRIP, YACC, YFLAGS
Comment 1 Ben Buhse 2025-02-06 18:36:00 UTC
Created attachment 918267 [details]
build.log
Comment 2 Ionen Wolkens gentoo-dev 2025-02-06 18:49:14 UTC
 * Using Rust 1.84.1 (source)
--- stderr
/usr/lib/rust/1.84.1/bin/rustc: symbol lookup error: /usr/lib/rust/1.84.1/bin/rustc: undefined symbol: _ZN3std2rt19lang_start_internal17h12de313c8fa04a78E

The rust compiler itself appears broken and this isn't maturin-specific. Seen a few other people mention this since 1.84.1 but haven't looked into it myself.

Don't think(?) we already got a bug for this so I'll reassign.
Comment 3 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2025-02-06 18:53:06 UTC
$ echo_ZN3std2rt19lang_start_internal17h12de313c8fa04a78E | c++filt
std::rt::lang_start_internal::h12de313c8fa04a78

Wonder if..
a) any chance it's related to bug 936635, or
b) any chance it's related to 94e2375d8bbaa777c83a3bffd60355075ee6ff83

but that's speculation and having done no other investigation yet.
Comment 4 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2025-02-06 18:58:42 UTC
Another piece of speculation:
```
dev-lang/rust:             1.84.0::gentoo, 1.84.1::gentoo
dev-lang/rust-bin:         1.84.0::gentoo, 1.84.1::gentoo
```

Wonder if it's mixing up the two. Could you look in /usr/lib/rust/lib* and see if anything has echo_ZN3std2rt19lang_start_internal17h12de313c8fa04a78E? (use nm -D)
Comment 5 Ionen Wolkens gentoo-dev 2025-02-06 19:28:28 UTC
>-fuse-ld=mold
Turns out at least one other user that ran into this was also using mold, have not tested but pretty good odds it's related.
Comment 6 CaptainBlood 2025-02-06 20:16:48 UTC
With linker default to mold, 1.84.1 binary build from both bootstrapping 1.84.0 and binary 1.84.1 raised same kinda issue here:

>>> Preparing source in /var/no-tmpfs/portage/sys-process/bottom-0.10.1-r1/work/bottom-0.10.1 ...
>>> Source prepared.
>>> Configuring source in /var/no-tmpfs/portage/sys-process/bottom-0.10.1-r1/work/bottom-0.10.1 ...
 * Configured with: --no-default-features
>>> Source configured.
>>> Compiling source in /var/no-tmpfs/portage/sys-process/bottom-0.10.1-r1/work/bottom-0.10.1 ...
 * /usr/lib/rust/1.84.1/bin/cargo build --release --no-default-features
error: process didn't exit successfully: `/usr/lib/rust/1.84.1/bin/rustc -vV` (exit status: 127)
--- stderr
/usr/lib/rust/1.84.1/bin/rustc: symbol lookup error: /usr/lib/rust/1.84.1/bin/rustc: undefined symbol: _ZN3std2rt19lang_start_internal17h12de313c8fa04a78E


Latest mold worked fine:
2025-01-09T19:03:59 >>> sys-devel/mold-2.36.0: 29′57
for
2025-01-11T21:41:07 >>> dev-lang/rust-1.84.0: 5:10:02
here.
Comment 7 Ben Buhse 2025-02-06 22:02:13 UTC
Removing dev-lang/rust-1.84.1 then re-emerging it without `-fuse-ld=mold` resulted in a working rustc. Like CaptainBlood, dev-lang/rust-1.84.0 with mold worked just fine.
Comment 8 John Turner 2025-02-07 02:44:02 UTC
Created attachment 918268 [details]
build.log
Comment 9 John Turner 2025-02-07 02:44:44 UTC
I am also hitting this bug, but I'm not on mold, I'm using the default linker for the profile "default/linux/amd64/23.0/split-usr/desktop".
Comment 10 Zhixu Liu 2025-02-07 04:13:23 UTC
I did a fresh build of rust-1.84.1 can't reproduce this problem

> # for f in /usr/bin/rustc-1.*; do v=${f#/usr/bin/rustc-}; echo $f; sym=$(nm -D $f | grep ZN3 | awk '{print $2}'); echo "  ${sym}"; nm -D /usr/lib/rust/lib-${v}/lib{rustc_driver,std}*.so | grep $sym; done
> /usr/bin/rustc-1.77.1
>   _ZN3std2rt19lang_start_internal17h3d58b05717c4874bE
> 000000000005e990 T _ZN3std2rt19lang_start_internal17h3d58b05717c4874bE
> /usr/bin/rustc-1.81.0
>   _ZN3std2rt19lang_start_internal17h34a698b8dadbf2cbE
> 0000000000064640 T _ZN3std2rt19lang_start_internal17h34a698b8dadbf2cbE
> /usr/bin/rustc-1.83.0
>   _ZN3std2rt19lang_start_internal17h5a7c2a7e33f540e2E
> 00000000080cea50 T _ZN3std2rt19lang_start_internal17h5a7c2a7e33f540e2E
> nm: '/usr/lib/rust/lib-1.83.0/libstd*.so': No such file
> /usr/bin/rustc-1.84.1
>   _ZN3std2rt19lang_start_internal17hddd854785a7efe62E
> 00000000083354c0 T _ZN3std2rt19lang_start_internal17hddd854785a7efe62E
> nm: '/usr/lib/rust/lib-1.84.1/libstd*.so': No such file

from 1.83 (or 1.82, I don't have this version installed), std::rt::lang_start_internal::* was moved from libstd-*.so to librustc_driver-*.so (or libstd-*.so is merged info later)

so for the problematic build, can we run the shell command above and "ldd /usr/bin/rustc-1.84.1", then post the output here?
Comment 11 demize 2025-02-07 05:34:48 UTC
I'm getting this problem on 1.84.1 as well, so here's the output of those for my machine:

> demize@yveltal ~ $ for f in /usr/bin/rustc-1.*; do v=${f#/usr/bin/rustc-}; echo $f; sym=$(nm -D $f | grep ZN3 | awk '{print $2}'); echo "  ${sym}"; nm -D /usr/lib/rust/lib-${v}/lib{rustc_driver,std}*.so | grep $sym; done
> /usr/bin/rustc-1.84.0
>   _ZN3std2rt19lang_start_internal17ha12261f6b12259fcE
> 00000000053a2a90 T _ZN3std2rt19lang_start_internal17ha12261f6b12259fcE
> nm: '/usr/lib/rust/lib-1.84.0/libstd*.so': No such file
> /usr/bin/rustc-1.84.1
>   _ZN3std2rt19lang_start_internal17h4065f74216a31b4fE
> 000000000539cde0 T _ZN3std2rt19lang_start_internal17h4065f74216a31b4fE
> nm: '/usr/lib/rust/lib-1.84.1/libstd*.so': No such file
> demize@yveltal ~ $ ldd /usr/bin/rustc-1.84.1
>         linux-vdso.so.1 (0x00007f2e4bb6f000)
>         librustc_driver-6f6761e2f1b0d7ca.so => /usr/lib/rust/lib-1.84.0/librustc_driver-6f6761e2f1b0d7ca.so (0x00007f2e46200000)
>         libc.so.6 => /usr/lib64/libc.so.6 (0x00007f2e46027000)
>         libLLVM.so.19.1+libcxx => /usr/lib/llvm/19/lib64/libLLVM.so.19.1+libcxx (0x00007f2e3e400000)
>         libc++.so.1 => /usr/lib64/libc++.so.1 (0x00007f2e3e2fa000)
>         libc++abi.so.1 => /usr/lib64/libc++abi.so.1 (0x00007f2e4bb05000)
>         libunwind.so.1 => /usr/lib64/libunwind.so.1 (0x00007f2e4baf6000)
>         libm.so.6 => /usr/lib64/libm.so.6 (0x00007f2e45f77000)
>         /lib64/ld-linux-x86-64.so.2 (0x00007f2e4bb71000)
>         libffi.so.8 => /usr/lib64/libffi.so.8 (0x00007f2e4bae9000)
>         libz.so.1 => /usr/lib64/libz.so.1 (0x00007f2e4bac5000)
>         libzstd.so.1 => /usr/lib64/libzstd.so.1 (0x00007f2e3e1de000)
Comment 12 Ionen Wolkens gentoo-dev 2025-02-07 05:47:51 UTC
For those affected it'd be good to always know if using mold or not, so far comment #9 mentioned not using mold so maybe it's something else... albeit all the mold reports still seem odd so it may not be entirely unrelated.

That aside, maybe it depends on what rust version it was built with (source, bin, same-version, or version minus 1), esp if std related per comment #10
Comment 13 demize 2025-02-07 05:53:32 UTC
No mold on my end, but I am using LTO. emerge --info:

> Portage 3.0.67 (python 3.13.2-final-0, default/linux/amd64/23.0/llvm/systemd, gcc-14, glibc-2.40-r8, 6.13.1-gentoo-x86_64.vhz x86_64)
> =================================================================
                         > System Settings
> =================================================================
> System uname: Linux-6.13.1-gentoo-x86_64.vhz-x86_64-AMD_Ryzen_7_5800X_8-Core_Processor-with-glibc2.40
> KiB Mem:    32773616 total,    986332 free
> KiB Swap:   50331644 total,  50309120 free
> Timestamp of repository gentoo: Thu, 06 Feb 2025 23:45:00 +0000
> Head commit of repository gentoo: f1a47f75b7d37843cb73d8a060e15afa9c626f23
> Timestamp of repository guru: Thu, 06 Feb 2025 16:03:19 +0000
> Head commit of repository guru: 4e319b01649541f89d5571edef96d2a942139672
> 
> sh bash 5.2_p37
> ld GNU ld (Gentoo 2.43 p3) 2.43.1
> app-misc/pax-utils:        1.3.8::gentoo
> app-shells/bash:           5.2_p37::gentoo
> dev-build/autoconf:        2.71-r7::gentoo, 2.72-r1::gentoo
> dev-build/automake:        1.17-r1::gentoo
> dev-build/cmake:           3.31.5::gentoo
> dev-build/libtool:         2.5.4::gentoo
> dev-build/make:            4.4.1-r100::gentoo
> dev-build/meson:           1.7.0::gentoo
> dev-lang/perl:             5.40.0-r1::gentoo
> dev-lang/python:           3.10.16_p1::gentoo, 3.11.11_p1::gentoo, 3.12.9::gentoo, 3.13.2::gentoo
> dev-lang/rust:             1.84.0::gentoo, 1.84.1::gentoo
> llvm-core/clang:           18.1.8-r6::gentoo, 19.1.7::gentoo
> llvm-core/lld:             18.1.8::gentoo, 19.1.7::gentoo
> llvm-core/llvm:            18.1.8-r6::gentoo, 19.1.7::gentoo
> sys-apps/baselayout:       2.17::gentoo
> sys-apps/sandbox:          2.43::gentoo
> sys-apps/systemd:          257.2::gentoo
> sys-devel/binutils:        2.43-r2::gentoo, 2.44::gentoo
> sys-devel/binutils-config: 5.5.2::gentoo
> sys-devel/gcc:             14.2.1_p20241221::gentoo
> sys-devel/gcc-config:      2.12.1::gentoo
> sys-kernel/linux-headers:  6.13::gentoo (virtual/os-headers)
> sys-libs/glibc:            2.40-r8::gentoo
> Repositories:
> 
> gentoo
    > location: /var/db/repos/gentoo
    > sync-type: rsync
    > sync-uri: rsync://rsync.gentoo.org/gentoo-portage
    > priority: -1000
    > volatile: False
    > sync-rsync-verify-metamanifest: yes
    > sync-rsync-verify-jobs: 1
    > sync-rsync-extra-opts: 
    > sync-rsync-verify-max-age: 3
> 
> demize-testing
    > location: /var/db/repos/demize-testing
    > masters: gentoo
    > volatile: True
> 
> guru
    > location: /var/db/repos/guru
    > sync-type: git
    > sync-uri: https://github.com/gentoo-mirror/guru.git
    > masters: gentoo
    > volatile: False
> 
> Binary Repositories:
> 
> gentoobinhost
    > priority: 1
    > sync-uri: rsync://mirror.csclub.uwaterloo.ca/gentoo-distfiles/releases/amd64/binpackages/23.0/x86-64_llvm
> 
> ACCEPT_KEYWORDS="amd64"
> ACCEPT_LICENSE="*"
> ADDR2LINE="llvm-addr2line"
> AR="llvm-ar"
> AS="clang -c"
> CBUILD="x86_64-pc-linux-gnu"
> CC="clang"
> CFLAGS="-march=native -O2 -pipe -flto -Werror=odr -Werror=strict-aliasing"
> CHOST="x86_64-pc-linux-gnu"
> CONFIG_PROTECT="/etc /usr/share/config /usr/share/gnupg/qualified.txt /var/bind"
> 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"
> CPP="clang-cpp"
> CXX="clang++"
> CXXFLAGS="-march=native -O2 -pipe -flto -Werror=odr -Werror=strict-aliasing"
> DISTDIR="/var/cache/distfiles"
> EMERGE_DEFAULT_OPTS="-j3 -l20"
> ENV_UNSET="CARGO_HOME DBUS_SESSION_BUS_ADDRESS DISPLAY GDK_PIXBUF_MODULE_FILE 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 XDG_STATE_HOME"
> FCFLAGS="-march=native -O2 -pipe -flto -Werror=odr -Werror=strict-aliasing"
> FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs binpkg-multi-instance buildpkg-live config-protect-if-modified distlocks ebuild-locks fixlafiles ipc-sandbox merge-sync merge-wait multilib-strict network-sandbox news parallel-fetch pid-sandbox pkgdir-index-trusted preserve-libs protect-owned qa-unresolved-soname-deps sandbox strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
> FFLAGS="-march=native -O2 -pipe -flto -Werror=odr -Werror=strict-aliasing"
> GENTOO_MIRRORS="rsync://mirror.csclub.uwaterloo.ca/gentoo-distfiles     rsync://mirrors.rit.edu/gentoo/"
> LANG="en_US.utf8"
> LD="ld.lld"
> LDFLAGS="-Wl,-O1 -Wl,--as-needed -Wl,-z,pack-relative-relocs -Wl,--as-needed"
> LEX="flex"
> MAKEOPTS="-j14 -l14"
> NM="llvm-nm"
> OBJCOPY="llvm-objcopy"
> OBJDUMP="llvm-objdump"
> 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"
> RANLIB="llvm-ranlib"
> READELF="llvm-readelf"
> SHELL="/bin/fish"
> STRINGS="llvm-strings"
> STRIP="llvm-strip"
> USE="X acl alsa amd64 bzip2 cet clang crypt cups dbus ffmpeg flac gdbm harfbuzz iconv icu ipv6 jpeg kde libtirpc llvm-libunwind lto multilib ncurses nls ogg opengl openmp opus pam pcre pipewire png policykit pulseaudio qml qt6 readline screencast seccomp ssl systemd test-rust udev unicode v4l wayland xattr zlib" ABI_X86="64" ADA_TARGET="gcc_13" APACHE2_MODULES="authn_core authz_core socache_shmcb unixd actions alias auth_basic authn_anon authn_dbm authn_file authz_dbm authz_groupfile authz_host authz_owner authz_user autoindex cache cgi cgid dav dav_fs dav_lock deflate dir env expires ext_filter file_cache filter headers include info log_config logio 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 aes avx avx2 f16c fma3 pclmul popcnt rdrand sha sse3 sse4_1 sse4_2 sse4a ssse3 vpclmulqdq" ELIBC="glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock greis isync itrax navcom oceanserver oncore rtcm104v2 rtcm104v3 sirf skytraq superstar2 tsip tripmate tnt ublox" GUILE_SINGLE_TARGET="3-0" GUILE_TARGETS="3-0" INPUT_DEVICES="libinput" KERNEL="linux" L10N="en en-CA en-US ja" LCD_DEVICES="bayrad cfontz glk hd44780 lb216 lcdm001 mtxorb text" LUA_SINGLE_TARGET="lua5-1" LUA_TARGETS="lua5-1" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php8-2" POSTGRES_TARGETS="postgres16" PYTHON_SINGLE_TARGET="python3_12" PYTHON_TARGETS="python3_12 python3_13" RUBY_TARGETS="ruby32" VIDEO_CARDS="nvidia" XTABLES_ADDONS="quota2 psd pknock lscan length2 ipv4options ipp2p iface geoip fuzzy condition tarpit sysrq proto logmark ipmark dhcpmac delude chaos account"
> Unset:  ARFLAGS, ASFLAGS, CCLD, CONFIG_SHELL, CPPFLAGS, CTARGET, CXXFILT, ELFEDIT, EXTRA_ECONF, F77FLAGS, FC, GCOV, GPROF, INSTALL_MASK, LC_ALL, LFLAGS, LIBTOOL, LINGUAS, MAKE, MAKEFLAGS, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, PYTHONPATH, RUSTFLAGS, SIZE, YACC, YFLAGS
> 
> =================================================================
                        > Package Settings
> =================================================================
> 
> dev-lang/rust-1.84.0::gentoo was built with the following:
> USE="clippy doc (llvm-libunwind) lto nightly rust-analyzer rust-src rustfmt system-llvm (-big-endian) -debug -dist (-miri) (-parallel-compiler) -test -verify-sig -wasm" ABI_X86="(64) -32 (-x32)" CPU_FLAGS_X86="sse2" LLVM_SLOT="(19)" LLVM_TARGETS="(X86) -AArch64 -AMDGPU -ARC -ARM -AVR -BPF -CSKY -DirectX -Hexagon -Lanai -LoongArch -M68k -MSP430 -Mips -NVPTX -PowerPC -RISCV -SPIRV -Sparc -SystemZ -VE -WebAssembly -XCore -Xtensa"
> CFLAGS="-march=native -O2 -pipe -Werror=odr -Werror=strict-aliasing"
> CXXFLAGS="-march=native -O2 -pipe -Werror=odr -Werror=strict-aliasing"
> FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs binpkg-multi-instance buildpkg-live config-protect-if-modified distlocks ebuild-locks fixlafiles ipc-sandbox merge-sync merge-wait multilib-strict network-sandbox news parallel-fetch pid-sandbox pkgdir-index-trusted preserve-libs protect-owned qa-unresolved-soname-deps sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
> 
> 
> dev-lang/rust-1.84.1::gentoo was built with the following:
> USE="clippy doc (llvm-libunwind) lto nightly rust-analyzer rust-src rustfmt system-llvm (-big-endian) -debug -dist (-miri) (-parallel-compiler) -test -verify-sig -wasm" ABI_X86="(64) -32 (-x32)" CPU_FLAGS_X86="sse2" LLVM_SLOT="(19)" LLVM_TARGETS="(X86) -AArch64 -AMDGPU -ARC -ARM -AVR -BPF -CSKY -DirectX -Hexagon -Lanai -LoongArch -M68k -MSP430 -Mips -NVPTX -PowerPC -RISCV -SPIRV -Sparc -SystemZ -VE -WebAssembly -XCore -Xtensa"
> CFLAGS="-march=native -O2 -pipe -Werror=odr -Werror=strict-aliasing"
> CXXFLAGS="-march=native -O2 -pipe -Werror=odr -Werror=strict-aliasing"

Likely would have been built with dev-lang/rust-1.84.0, though I can't confirm, I don't have the logs anymore.
Comment 14 Zhixu Liu 2025-02-07 05:59:05 UTC
forget one things, does rustc report error on the same symbol as shown by "nm -D"?

(In reply to demize from comment #11)
> I'm getting this problem on 1.84.1 as well, so here's the output of those
> for my machine:
> 
> > demize@yveltal ~ $ for f in /usr/bin/rustc-1.*; do v=${f#/usr/bin/rustc-}; echo $f; sym=$(nm -D $f | grep ZN3 | awk '{print $2}'); echo "  ${sym}"; nm -D /usr/lib/rust/lib-${v}/lib{rustc_driver,std}*.so | grep $sym; done
> > /usr/bin/rustc-1.84.0
> >   _ZN3std2rt19lang_start_internal17ha12261f6b12259fcE
> > 00000000053a2a90 T _ZN3std2rt19lang_start_internal17ha12261f6b12259fcE
> > nm: '/usr/lib/rust/lib-1.84.0/libstd*.so': No such file
> > /usr/bin/rustc-1.84.1
> >   _ZN3std2rt19lang_start_internal17h4065f74216a31b4fE
> > 000000000539cde0 T _ZN3std2rt19lang_start_internal17h4065f74216a31b4fE
> > nm: '/usr/lib/rust/lib-1.84.1/libstd*.so': No such file
> > demize@yveltal ~ $ ldd /usr/bin/rustc-1.84.1
> >         linux-vdso.so.1 (0x00007f2e4bb6f000)
> >         librustc_driver-6f6761e2f1b0d7ca.so => /usr/lib/rust/lib-1.84.0/librustc_driver-6f6761e2f1b0d7ca.so (0x00007f2e46200000)
> >         libc.so.6 => /usr/lib64/libc.so.6 (0x00007f2e46027000)
> >         libLLVM.so.19.1+libcxx => /usr/lib/llvm/19/lib64/libLLVM.so.19.1+libcxx (0x00007f2e3e400000)
> >         libc++.so.1 => /usr/lib64/libc++.so.1 (0x00007f2e3e2fa000)
> >         libc++abi.so.1 => /usr/lib64/libc++abi.so.1 (0x00007f2e4bb05000)
> >         libunwind.so.1 => /usr/lib64/libunwind.so.1 (0x00007f2e4baf6000)
> >         libm.so.6 => /usr/lib64/libm.so.6 (0x00007f2e45f77000)
> >         /lib64/ld-linux-x86-64.so.2 (0x00007f2e4bb71000)
> >         libffi.so.8 => /usr/lib64/libffi.so.8 (0x00007f2e4bae9000)
> >         libz.so.1 => /usr/lib64/libz.so.1 (0x00007f2e4bac5000)
> >         libzstd.so.1 => /usr/lib64/libzstd.so.1 (0x00007f2e3e1de000)
Comment 15 demize 2025-02-07 06:08:32 UTC
Hmm, no it does not:

> /usr/lib/rust/1.84.1/bin/rustc: symbol lookup error: /usr/lib/rust/1.84.1/bin/rustc: undefined symbol: _RNvCshkNoClsajma_17rustc_driver_impl4main

Looks like a completely different symbol, actually.
Comment 16 Zhixu Liu 2025-02-07 06:16:17 UTC
(In reply to demize from comment #15)
> Hmm, no it does not:
> 
> > /usr/lib/rust/1.84.1/bin/rustc: symbol lookup error: /usr/lib/rust/1.84.1/bin/rustc: undefined symbol: _RNvCshkNoClsajma_17rustc_driver_impl4main
> 
> Looks like a completely different symbol, actually.

# c++filt _RNvCshkNoClsajma_17rustc_driver_impl4main
rustc_driver_impl[c9ea9ef2ff3bedfc]::main

# nm -D /usr/bin/rustc-1.84.1 | grep _17rustc_driver_impl4main
                 U _RNvCscFApmJ8stDA_17rustc_driver_impl4main
# nm -D /usr/lib/rust/lib-1.84.1/librustc*.so | grep 17rustc_driver_impl4main
00000000054f07a0 T _RNvCscFApmJ8stDA_17rustc_driver_impl4main

above is on my pc, please post your output here then.
Comment 17 demize 2025-02-07 06:28:59 UTC
Built with LTO disabled, and now I -am- getting the same symbol as `nm -D`:

> rustc: symbol lookup error: rustc: undefined symbol: _ZN3std2rt19lang_start_internal17h4065f74216a31b4fE

Updated emerge --info over as a gist, so I'm not throwing too much onto this page (and your email inboxes): https://gist.github.com/demize/300722de328996962c8a2714b308d203.

I'll have to rebuild with LTO enabled again to check the other symbol; I'll let that run overnight, it's gonna take longer.
Comment 18 nvinson234 2025-02-07 07:28:09 UTC
(In reply to Zhixu Liu from comment #10)
> I did a fresh build of rust-1.84.1 can't reproduce this problem
> 
> > # for f in /usr/bin/rustc-1.*; do v=${f#/usr/bin/rustc-}; echo $f; sym=$(nm -D $f | grep ZN3 | awk '{print $2}'); echo "  ${sym}"; nm -D /usr/lib/rust/lib-${v}/lib{rustc_driver,std}*.so | grep $sym; done
> > /usr/bin/rustc-1.77.1
> >   _ZN3std2rt19lang_start_internal17h3d58b05717c4874bE
> > 000000000005e990 T _ZN3std2rt19lang_start_internal17h3d58b05717c4874bE
> > /usr/bin/rustc-1.81.0
> >   _ZN3std2rt19lang_start_internal17h34a698b8dadbf2cbE
> > 0000000000064640 T _ZN3std2rt19lang_start_internal17h34a698b8dadbf2cbE
> > /usr/bin/rustc-1.83.0
> >   _ZN3std2rt19lang_start_internal17h5a7c2a7e33f540e2E
> > 00000000080cea50 T _ZN3std2rt19lang_start_internal17h5a7c2a7e33f540e2E
> > nm: '/usr/lib/rust/lib-1.83.0/libstd*.so': No such file
> > /usr/bin/rustc-1.84.1
> >   _ZN3std2rt19lang_start_internal17hddd854785a7efe62E
> > 00000000083354c0 T _ZN3std2rt19lang_start_internal17hddd854785a7efe62E
> > nm: '/usr/lib/rust/lib-1.84.1/libstd*.so': No such file
> 
> from 1.83 (or 1.82, I don't have this version installed),
> std::rt::lang_start_internal::* was moved from libstd-*.so to
> librustc_driver-*.so (or libstd-*.so is merged info later)
> 
> so for the problematic build, can we run the shell command above and "ldd
> /usr/bin/rustc-1.84.1", then post the output here?

Could you repeat this test, but echo the value of $v as well? I've been working on this with John in IRC. In John's case the library in his 1.84.0 directory has the same name as the one in 1.84.1. This confuses the runtime loader and loads the wrong library when running rustc-1.84.1 which results in the undefined symbol error.
Comment 19 Zhixu Liu 2025-02-07 08:07:05 UTC
(In reply to nvinson234 from comment #18)
> (In reply to Zhixu Liu from comment #10)
> > I did a fresh build of rust-1.84.1 can't reproduce this problem
> > 
> > > # for f in /usr/bin/rustc-1.*; do v=${f#/usr/bin/rustc-}; echo $f; sym=$(nm -D $f | grep ZN3 | awk '{print $2}'); echo "  ${sym}"; nm -D /usr/lib/rust/lib-${v}/lib{rustc_driver,std}*.so | grep $sym; done
> > > /usr/bin/rustc-1.77.1
> > >   _ZN3std2rt19lang_start_internal17h3d58b05717c4874bE
> > > 000000000005e990 T _ZN3std2rt19lang_start_internal17h3d58b05717c4874bE
> > > /usr/bin/rustc-1.81.0
> > >   _ZN3std2rt19lang_start_internal17h34a698b8dadbf2cbE
> > > 0000000000064640 T _ZN3std2rt19lang_start_internal17h34a698b8dadbf2cbE
> > > /usr/bin/rustc-1.83.0
> > >   _ZN3std2rt19lang_start_internal17h5a7c2a7e33f540e2E
> > > 00000000080cea50 T _ZN3std2rt19lang_start_internal17h5a7c2a7e33f540e2E
> > > nm: '/usr/lib/rust/lib-1.83.0/libstd*.so': No such file
> > > /usr/bin/rustc-1.84.1
> > >   _ZN3std2rt19lang_start_internal17hddd854785a7efe62E
> > > 00000000083354c0 T _ZN3std2rt19lang_start_internal17hddd854785a7efe62E
> > > nm: '/usr/lib/rust/lib-1.84.1/libstd*.so': No such file
> > 
> > from 1.83 (or 1.82, I don't have this version installed),
> > std::rt::lang_start_internal::* was moved from libstd-*.so to
> > librustc_driver-*.so (or libstd-*.so is merged info later)
> > 
> > so for the problematic build, can we run the shell command above and "ldd
> > /usr/bin/rustc-1.84.1", then post the output here?
> 
> Could you repeat this test, but echo the value of $v as well? I've been
> working on this with John in IRC. In John's case the library in his 1.84.0
> directory has the same name as the one in 1.84.1. This confuses the runtime
> loader and loads the wrong library when running rustc-1.84.1 which results
> in the undefined symbol error.

v is extracted from the file, so for /usr/bin/rustc-1.77.1, v is 1.77.1
i'll try emerge 1.84.0 as well to see what happens
Comment 20 demize 2025-02-07 13:09:36 UTC
(In reply to Zhixu Liu from comment #16)
> # c++filt _RNvCshkNoClsajma_17rustc_driver_impl4main
> rustc_driver_impl[c9ea9ef2ff3bedfc]::main
> 
> # nm -D /usr/bin/rustc-1.84.1 | grep _17rustc_driver_impl4main
>                  U _RNvCscFApmJ8stDA_17rustc_driver_impl4main
> # nm -D /usr/lib/rust/lib-1.84.1/librustc*.so | grep 17rustc_driver_impl4main
> 00000000054f07a0 T _RNvCscFApmJ8stDA_17rustc_driver_impl4main
> 
> above is on my pc, please post your output here then.


Here's mine:

> demize@yveltal ~ $ c++filt _RNvCshkNoClsajma_17rustc_driver_impl4main
> rustc_driver_impl[c9ea9ef2ff3bedfc]::main
> demize@yveltal ~ $ nm -D /usr/bin/rustc-1.84.1 | grep _17rustc_driver_impl4main
>                  U _RNvCshkNoClsajma_17rustc_driver_impl4main
> demize@yveltal ~ $ nm -D /usr/lib/rust/lib-1.84.1/librustc*.so | grep 17rustc_driver_impl4main
> 00000000026e51f0 T _RNvCshkNoClsajma_17rustc_driver_impl4main


(In reply to nvinson234 from comment #18)
> Could you repeat this test, but echo the value of $v as well? I've been
> working on this with John in IRC. In John's case the library in his 1.84.0
> directory has the same name as the one in 1.84.1. This confuses the runtime
> loader and loads the wrong library when running rustc-1.84.1 which results
> in the undefined symbol error.


And here's mine for this, and the contents of my 1.84 directories, in case it helps:

> demize@yveltal ~ $ for f in /usr/bin/rustc-1.*; do v=${f#/usr/bin/rustc-}; echo "v=$v"; echo $f; sym=$(nm -D $f | grep ZN3 | awk '{print $2}'); echo "  ${sym}"; nm -D /usr/lib/rust/lib-${v}/lib{rustc_driver,std}*.so | grep $sym; done
> v=1.84.0
> /usr/bin/rustc-1.84.0
>   _ZN3std2rt19lang_start_internal17ha12261f6b12259fcE
> 00000000053a2a90 T _ZN3std2rt19lang_start_internal17ha12261f6b12259fcE
> nm: '/usr/lib/rust/lib-1.84.0/libstd*.so': No such file
> v=1.84.1
> /usr/bin/rustc-1.84.1
>   _ZN3std2rt19lang_start_internal17h4065f74216a31b4fE
> 000000000539cde0 T _ZN3std2rt19lang_start_internal17h4065f74216a31b4fE
> nm: '/usr/lib/rust/lib-1.84.1/libstd*.so': No such file
> demize@yveltal ~ $ ls /usr/lib/rust/lib-1.84.1/
> librustc_driver-6f6761e2f1b0d7ca.so  rustlib
> demize@yveltal ~ $ ls /usr/lib/rust/lib-1.84.0/
> librustc_driver-6f6761e2f1b0d7ca.so  rustlib
Comment 21 Zhixu Liu 2025-02-07 13:39:47 UTC
Considering that it is suspected that different versions of rust use the same librustc_driver, please following steps bellow and report the result if you encounter the problem:

1. run rustc or other rust related program which has the problem to get the undefined symbol, for example, if

# rustc
/usr/lib/rust/1.84.1/bin/rustc: symbol lookup error: /usr/lib/rust/1.84.1/bin/rustc: undefined symbol: _ZN3std2rt19lang_start_internal17h12de313c8fa04a78E

strip the hash from the symbol and define USM="_ZN3std2rt19lang_start_internal", if unsure, please run "c++filt _ZN3..." to find the hash position (i'm not sure it is always in the end of the string)

2. run following shell script (replace rustc to the correct program if problem is not found by run rustc)

# USM="std2rt19lang_start_internal" 
# for f in /usr/bin/rustc-*; do v=${f#/usr/bin/rustc-}; echo $f; sym=$(nm -D $f | grep ${USM} | awk '{print $2}'); echo "  ${sym}"; nm -D /usr/lib/rust/lib-${v}/lib{rustc_driver,std}*.so | grep $sym; done
/usr/bin/rustc-1.83.0
  _ZN3std2rt19lang_start_internal17h5a7c2a7e33f540e2E
00000000080cea50 T _ZN3std2rt19lang_start_internal17h5a7c2a7e33f540e2E
nm: '/usr/lib/rust/lib-1.83.0/libstd*.so': No such file
/usr/bin/rustc-1.84.1
  _ZN3std2rt19lang_start_internal17hddd854785a7efe62E
00000000083354c0 T _ZN3std2rt19lang_start_internal17hddd854785a7efe62E
nm: '/usr/lib/rust/lib-1.84.1/libstd*.so': No such file
# lddtree /usr/bin/rustc-*
Comment 22 Zhixu Liu 2025-02-07 13:41:29 UTC
> > demize@yveltal ~ $ ls /usr/lib/rust/lib-1.84.1/
> > librustc_driver-6f6761e2f1b0d7ca.so  rustlib
> > demize@yveltal ~ $ ls /usr/lib/rust/lib-1.84.0/
> > librustc_driver-6f6761e2f1b0d7ca.so  rustlib

both 1.84.0 and 1.84.1 have the same rustc_driver.so, can you post the output of "lddtree /usr/bin/rustc-*"?
Comment 23 Zhixu Liu 2025-02-07 14:00:03 UTC
(In reply to Zhixu Liu from comment #21)
> Considering that it is suspected that different versions of rust use the
> same librustc_driver, please following steps bellow and report the result if
> you encounter the problem:
> 
> 1. run rustc or other rust related program which has the problem to get the
> undefined symbol, for example, if
> 
> # rustc
> /usr/lib/rust/1.84.1/bin/rustc: symbol lookup error:
> /usr/lib/rust/1.84.1/bin/rustc: undefined symbol:
> _ZN3std2rt19lang_start_internal17h12de313c8fa04a78E
> 
> strip the hash from the symbol and define
> USM="_ZN3std2rt19lang_start_internal", if unsure, please run "c++filt
> _ZN3..." to find the hash position (i'm not sure it is always in the end of
> the string)
> 
> 2. run following shell script (replace rustc to the correct program if
> problem is not found by run rustc)
> 
> # USM="std2rt19lang_start_internal" 
> # for f in /usr/bin/rustc-*; do v=${f#/usr/bin/rustc-}; echo $f; sym=$(nm -D
> $f | grep ${USM} | awk '{print $2}'); echo "  ${sym}"; nm -D
> /usr/lib/rust/lib-${v}/lib{rustc_driver,std}*.so | grep $sym; done
> /usr/bin/rustc-1.83.0
>   _ZN3std2rt19lang_start_internal17h5a7c2a7e33f540e2E
> 00000000080cea50 T _ZN3std2rt19lang_start_internal17h5a7c2a7e33f540e2E
> nm: '/usr/lib/rust/lib-1.83.0/libstd*.so': No such file
> /usr/bin/rustc-1.84.1
>   _ZN3std2rt19lang_start_internal17hddd854785a7efe62E
> 00000000083354c0 T _ZN3std2rt19lang_start_internal17hddd854785a7efe62E
> nm: '/usr/lib/rust/lib-1.84.1/libstd*.so': No such file
> # lddtree /usr/bin/rustc-*

forget one command: "ls -l /usr/lib/rust/lib-*/librustc*.so"
Comment 24 demize 2025-02-07 14:08:09 UTC
(In reply to Zhixu Liu from comment #22)
> > > demize@yveltal ~ $ ls /usr/lib/rust/lib-1.84.1/
> > > librustc_driver-6f6761e2f1b0d7ca.so  rustlib
> > > demize@yveltal ~ $ ls /usr/lib/rust/lib-1.84.0/
> > > librustc_driver-6f6761e2f1b0d7ca.so  rustlib
> 
> both 1.84.0 and 1.84.1 have the same rustc_driver.so, can you post the
> output of "lddtree /usr/bin/rustc-*"?

Here you go:

> demize@yveltal ~ $ lddtree /usr/bin/rustc-*
> rustc-1.84.0 => /usr/bin/rustc-1.84.0 (interpreter => /lib64/ld-linux-x86-64.so.2)
>     librustc_driver-6f6761e2f1b0d7ca.so => /usr/lib/rust/lib-1.84.0/librustc_driver-6f6761e2f1b0d7ca.so
>         libLLVM.so.19.1+libcxx => /usr/lib/llvm/19/lib64/libLLVM.so.19.1+libcxx
>             libffi.so.8 => /usr/lib64/libffi.so.8
>             libz.so.1 => /usr/lib64/libz.so.1
>             libzstd.so.1 => /usr/lib64/libzstd.so.1
>         libc++.so.1 => /usr/lib64/libc++.so.1
>         libc++abi.so.1 => /usr/lib64/libc++abi.so.1
>         libunwind.so.1 => /usr/lib64/libunwind.so.1
>         libm.so.6 => /usr/lib64/libm.so.6
>         ld-linux-x86-64.so.2 => /lib64/ld-linux-x86-64.so.2
>     libc.so.6 => /usr/lib64/libc.so.6
> rustc-1.84.1 => /usr/bin/rustc-1.84.1 (interpreter => /lib64/ld-linux-x86-64.so.2)
>     librustc_driver-6f6761e2f1b0d7ca.so => /usr/lib/rust/lib-1.84.0/librustc_driver-6f6761e2f1b0d7ca.so
>         libLLVM.so.19.1+libcxx => /usr/lib/llvm/19/lib64/> libLLVM.so.19.1+libcxx
>             libffi.so.8 => /usr/lib64/libffi.so.8
>             libz.so.1 => /usr/lib64/libz.so.1
>             libzstd.so.1 => /usr/lib64/libzstd.so.1
>         libc++.so.1 => /usr/lib64/libc++.so.1
>         libc++abi.so.1 => /usr/lib64/libc++abi.so.1
>         libunwind.so.1 => /usr/lib64/libunwind.so.1
>         libm.so.6 => /usr/lib64/libm.so.6
>         ld-linux-x86-64.so.2 => /lib64/ld-linux-x86-64.so.2
>     libc.so.6 => /usr/lib64/libc.so.6

Consistent with the theory they're both pointing to the same driver.
Comment 25 Zhixu Liu 2025-02-07 14:11:50 UTC
> > demize@yveltal ~ $ lddtree /usr/bin/rustc-*
> > rustc-1.84.0 => /usr/bin/rustc-1.84.0 (interpreter => /lib64/ld-linux-x86-64.so.2)
> >     librustc_driver-6f6761e2f1b0d7ca.so => /usr/lib/rust/lib-1.84.0/librustc_driver-6f6761e2f1b0d7ca.so
> > rustc-1.84.1 => /usr/bin/rustc-1.84.1 (interpreter => /lib64/ld-linux-x86-64.so.2)
> >     librustc_driver-6f6761e2f1b0d7ca.so => /usr/lib/rust/lib-1.84.0/librustc_driver-6f6761e2f1b0d7ca.so
> 
> Consistent with the theory they're both pointing to the same driver.

yes, both version use rustc driver of 1.84.0, so it looks like a hash collision during rust build, ...
Comment 26 nvinson234 2025-02-07 18:34:16 UTC
building without the 'nightly' USE flag set appears to be a work-around.
Comment 27 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2025-02-07 18:50:18 UTC
[18:18] <sam_> maybe we need to customise the hash
[18:19] <sam_> (append PVR or something to whatever the hash input is)
[18:44] <sam_> https://github.com/rust-lang/rust/blob/64e06c0f5578829373743884b708d494136c3e8f/compiler/rustc_metadata/src/locator.rs#L168
[18:44] <sam_> so maybe -C metadata=gentoo-${PVR}
[18:44] <sam_> (possibly)
Comment 28 CaptainBlood 2025-02-07 20:01:19 UTC
1.84.0(1.84.0)^t(19:27:42 07/02/2025)(clippy doc miri nightly rust-analyzer rust-src rustfmt verify-sig wasm -big-endian -debug -dist -llvm-libunwind -lto -parallel-compiler -system-llvm -test ABI_MIPS="-n32 -n64 -o32" ABI_S390="-32 -64" ABI_X86="64 -32 -x32" CPU_FLAGS_X86="sse2" LLVM_SLOT="19" LLVM_TARGETS="WebAssembly X86 -AArch64 -AMDGPU -ARC -ARM -AVR -BPF -CSKY -DirectX -Hexagon -Lanai -LoongArch -M68k -MSP430 -Mips -NVPTX -PowerPC -RISCV -SPIRV -Sparc -SystemZ -VE -XCore -Xtensa") here.

Indeed, 1.84.0 & 1.84.1 can't coexist here.

Both are working fine when single.
Comment 29 CaptainBlood 2025-02-08 00:39:42 UTC
Mixing dev-lang/rust-bin-1.84.1 and dev-lang/rust-1.84.0, alternatively dev-lang/rust-bin-1.84.0 and dev-lang/rust-1.84.1 raises same issue.

Sounds like 1.84.0 and 1.84.1 should be in the same slot, or is it?
Comment 30 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2025-02-08 00:49:07 UTC
(In reply to CaptainBlood from comment #29)
> Sounds like 1.84.0 and 1.84.1 should be in the same slot, or is it?

No, that'd be a nasty workaround for this. It would be an option but it doesn't make it the right one. We'd much rather have them all parallel installable but salt the hash if required.
Comment 31 Zhixu Liu 2025-02-08 01:19:19 UTC
(In reply to nvinson234 from comment #26)
> building without the 'nightly' USE flag set appears to be a work-around.

reproduced with USE="nightly", while rust-bin don't have this problem.

# lddtree /usr/bin/rustc-*|grep rustc
rustc-1.84.0 => /usr/bin/rustc-1.84.0 (interpreter => /lib64/ld-linux-x86-64.so.2)
    librustc_driver-6f6761e2f1b0d7ca.so => /usr/lib/rust/lib-1.84.0/librustc_driver-6f6761e2f1b0d7ca.so
rustc-1.84.1 => /usr/bin/rustc-1.84.1 (interpreter => /lib64/ld-linux-x86-64.so.2)
    librustc_driver-6f6761e2f1b0d7ca.so => /usr/lib/rust/lib-1.84.0/librustc_driver-6f6761e2f1b0d7ca.so
rustc-bin-1.84.0 => /usr/bin/rustc-bin-1.84.0 (interpreter => /lib64/ld-linux-x86-64.so.2)
    librustc_driver-7bea7fca18409d2b.so => /usr/lib/rust/lib-bin-1.84.0/librustc_driver-7bea7fca18409d2b.so
rustc-bin-1.84.1 => /usr/bin/rustc-bin-1.84.1 (interpreter => /lib64/ld-linux-x86-64.so.2)
    librustc_driver-cbb5ad48aac6e327.so => /usr/lib/rust/lib-bin-1.84.1/librustc_driver-cbb5ad48aac6e327.so
# ls -l /usr/lib/rust/lib-*/librustc*
-rw-r--r-- 1 root root 223330920 Feb  7 18:44 /usr/lib/rust/lib-1.84.0/librustc_driver-6f6761e2f1b0d7ca.so
-rw-r--r-- 1 root root 223322728 Feb  7 19:23 /usr/lib/rust/lib-1.84.1/librustc_driver-6f6761e2f1b0d7ca.so
-rwxr-xr-x 1 root root 139602768 Feb  8 01:14 /usr/lib/rust/lib-bin-1.84.0/librustc_driver-7bea7fca18409d2b.so
-rwxr-xr-x 1 root root 139591440 Feb  7 04:34 /usr/lib/rust/lib-bin-1.84.1/librustc_driver-cbb5ad48aac6e327.so
Comment 32 demize 2025-02-09 01:55:13 UTC
Created attachment 918338 [details]
portage patch to update rustc_driver version
Comment 33 demize 2025-02-09 02:00:06 UTC
Per jyn's suggestion on Github, I used the attached patch with emerge (`/etc/portage/patches/dev-lang/rust-1.84.1/0001-Add-version-to-rustc_driver.patch`) to build rust 1.84.1 with the `nightly` USE flag, and I can confirm it works.

> demize@yveltal ~ $ lddtree /usr/bin/rustc-*
> rustc-1.84.0 => /usr/bin/rustc-1.84.0 (interpreter => /lib64/ld-linux-x86-64.so.2)
>     librustc_driver-6f6761e2f1b0d7ca.so => /usr/lib/rust/lib-1.84.0/librustc_driver-6f6761e2f1b0d7ca.so
>         libLLVM.so.19.1+libcxx => /usr/lib/llvm/19/lib64/libLLVM.so.19.1+libcxx
>             libffi.so.8 => /usr/lib64/libffi.so.8
>             libz.so.1 => /usr/lib64/libz.so.1
>             libzstd.so.1 => /usr/lib64/libzstd.so.1
>         libc++.so.1 => /usr/lib64/libc++.so.1
>         libc++abi.so.1 => /usr/lib64/libc++abi.so.1
>         libunwind.so.1 => /usr/lib64/libunwind.so.1
>         libm.so.6 => /usr/lib64/libm.so.6
>         ld-linux-x86-64.so.2 => /lib64/ld-linux-x86-64.so.2
>     libc.so.6 => /usr/lib64/libc.so.6
> rustc-1.84.1 => /usr/bin/rustc-1.84.1 (interpreter => /lib64/ld-linux-x86-64.so.2)
>     librustc_driver-c90edbe29e7704a8.so => /usr/lib/rust/lib-1.84.1/librustc_driver-c90edbe29e7704a8.so
>         libLLVM.so.19.1+libcxx => /usr/lib/llvm/19/lib64/libLLVM.so.19.1+libcxx
>             libffi.so.8 => /usr/lib64/libffi.so.8
>             libz.so.1 => /usr/lib64/libz.so.1
>             libzstd.so.1 => /usr/lib64/libzstd.so.1
>         libc++.so.1 => /usr/lib64/libc++.so.1
>         libc++abi.so.1 => /usr/lib64/libc++abi.so.1
>         libunwind.so.1 => /usr/lib64/libunwind.so.1
>         libm.so.6 => /usr/lib64/libm.so.6
>         ld-linux-x86-64.so.2 => /lib64/ld-linux-x86-64.so.2
>     libc.so.6 => /usr/lib64/libc.so.6
> demize@yveltal ~ $ rustc -v -V
> rustc 1.84.1-nightly (e71f9a9a9 2025-01-27) (gentoo)
> binary: rustc
> commit-hash: e71f9a9a98b0faf423844bf0ba7438f29dc27d58
> commit-date: 2025-01-27
> host: x86_64-unknown-linux-gnu
> release: 1.84.1-nightly
> LLVM version: 19.1.7
> demize@yveltal ~ $ /usr/bin/rustc
> rustc         rustc-1.84.0  rustc-1.84.1  
> demize@yveltal ~ $ /usr/bin/rustc-1.84.0 -v -V
> rustc 1.84.0-nightly (9fc6b4312 2025-01-07) (gentoo)
> binary: rustc
> commit-hash: 9fc6b43126469e3858e2fe86cafb4f0fd5068869
> commit-date: 2025-01-07
> host: x86_64-unknown-linux-gnu
> release: 1.84.0-nightly
> LLVM version: 19.1.6

This is with an unpatched 1.84.0, though jyn's note about needing to do this every version (with a unique version number) is likely correct. I'm not sure how to accomplish that automatically, or I'd probably try to submit an actual patch here.
Comment 34 demize 2025-02-09 02:12:32 UTC
Oh, I missed Jubilee's comment (https://github.com/rust-lang/rust/issues/136701#issuecomment-2645993901) -- disregard my testing then, that seems like a better solution here.
Comment 35 Zhixu Liu 2025-02-09 04:53:34 UTC
(In reply to demize from comment #34)
> Oh, I missed Jubilee's comment
> (https://github.com/rust-lang/rust/issues/136701#issuecomment-2645993901) --
> disregard my testing then, that seems like a better solution here.

i think the patch (better if upstream fix it) is also ok, like double insurance to avoid the symbol lookup issue in this bug.
Comment 36 Larry the Git Cow gentoo-dev 2025-02-10 00:19:22 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=201924167bcc6a1ba7406065973f17995136dc2a

commit 201924167bcc6a1ba7406065973f17995136dc2a
Author:     Matt Jolly <kangie@gentoo.org>
AuthorDate: 2025-02-09 00:39:13 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2025-02-10 00:16:35 +0000

    dev-lang/rust: Set RPATH instead of using ld.so.conf for libs
    
    For a reason lost to the sands of time, Gentoo was previously
    disabling the `rpath` option in the Rust config.toml and instead
    adding Rust the Rust lib path to `ld.so.conf` via entries installed
    in `/etc/env.d`.
    
    This was fine before we enabled slotting on the Rust package, however
    with increasing numbers of Rust slots a hash collision was inevitable
    and eventually happened between 1.84.0 and 1.84.1, resulting in
    `undefined symbol` errors when invoking `rustc` or `cargo`.
    
    Since we install Rust in a very similar way to upstream, it makes
    sense to set the `RUNPATH` to `$ORIGIN/../lib` as their packaging
    does and not pollute ld.so.conf with Rust paths.
    
    This enables dev-lang/rust binaries to search relative to
    their install location, and will therefore always respect EPREFIX.
    
    Also drop obsolete 1.82.0-r100; no need to revbump that.
    
    Closes: https://bugs.gentoo.org/949374
    Signed-off-by: Matt Jolly <kangie@gentoo.org>
    Signed-off-by: Sam James <sam@gentoo.org>

 ...-1.71.1-r100.ebuild => rust-1.71.1-r101.ebuild} |   5 +-
 ...-1.74.1-r100.ebuild => rust-1.74.1-r101.ebuild} |   3 +-
 ...-1.75.0-r100.ebuild => rust-1.75.0-r101.ebuild} |   5 +-
 ...-1.76.0-r100.ebuild => rust-1.76.0-r101.ebuild} |   5 +-
 ...-1.77.1-r100.ebuild => rust-1.77.1-r101.ebuild} |   5 +-
 ...-1.79.0-r100.ebuild => rust-1.78.0-r101.ebuild} |   5 +-
 ...-1.78.0-r100.ebuild => rust-1.79.0-r101.ebuild} |   5 +-
 ...-1.80.1-r100.ebuild => rust-1.80.1-r101.ebuild} |   5 +-
 ...-1.81.0-r100.ebuild => rust-1.81.0-r101.ebuild} |   5 +-
 dev-lang/rust/rust-1.82.0-r100.ebuild              | 756 ---------------------
 ...-1.82.0-r101.ebuild => rust-1.82.0-r102.ebuild} |   5 +-
 ...rust-1.83.0-r1.ebuild => rust-1.83.0-r2.ebuild} |   3 +-
 .../{rust-1.84.0.ebuild => rust-1.84.0-r1.ebuild}  |   3 +-
 .../{rust-1.84.1.ebuild => rust-1.84.1-r1.ebuild}  |   3 +-
 14 files changed, 22 insertions(+), 791 deletions(-)

Additionally, it has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=3697cf96012982634868d7e845bbc844c77c9a9b

commit 3697cf96012982634868d7e845bbc844c77c9a9b
Author:     Sam James <sam@gentoo.org>
AuthorDate: 2025-02-10 00:17:31 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2025-02-10 00:17:31 +0000

    dev-lang/rust: disable LTO by default for older Rusts too
    
    We have to revbump for bug #949374 anyway so this is a good time to change
    it.
    
    Propagate the change we did in d7f3dfefc2ab978d5d38b50d1e061c4a530d85f8 for
    older rusts accordingly.
    
    Bug: https://bugs.gentoo.org/949374
    Signed-off-by: Sam James <sam@gentoo.org>

 dev-lang/rust/rust-1.71.1-r101.ebuild | 2 +-
 dev-lang/rust/rust-1.74.1-r101.ebuild | 2 +-
 dev-lang/rust/rust-1.75.0-r101.ebuild | 2 +-
 3 files changed, 3 insertions(+), 3 deletions(-)

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=6a2c619fe521b9c5a54347539497c4171d46e8de

commit 6a2c619fe521b9c5a54347539497c4171d46e8de
Author:     Matt Jolly <kangie@gentoo.org>
AuthorDate: 2025-02-09 14:12:23 +0000
Commit:     Sam James <sam@gentoo.org>
CommitDate: 2025-02-10 00:16:37 +0000

    profiles: mask Rust revisions that use ld.so.conf
    
    We want all of our users to migrate to the RPATH
    revisions quickly. This should warn and encourage
    that.
    
    Bug: https://bugs.gentoo.org/949374
    Signed-off-by: Matt Jolly <kangie@gentoo.org>
    Signed-off-by: Sam James <sam@gentoo.org>

 profiles/package.mask | 30 ++++++++++++++++++++++++++++++
 1 file changed, 30 insertions(+)