Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 819036 - sys-libs/compiler-rt-13.0.0 - error loading plugin: /usr/lib/llvm/13/bin/../lib64/LLVMgold.so: cannot open shared object file: No such file or directory
Summary: sys-libs/compiler-rt-13.0.0 - error loading plugin: /usr/lib/llvm/13/bin/../l...
Status: UNCONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: LLVM support project
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-10-20 15:00 UTC by Anton Gubarkov
Modified: 2021-12-13 02:04 UTC (History)
3 users (show)

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 Anton Gubarkov 2021-10-20 15:00:59 UTC
cmake -C /var/tmp/portage/sys-libs/compiler-rt-13.0.0/work/compiler-rt-13.0.0_build/gentoo_common_config.cmake -G Ninja -DCMAKE_INSTALL_PREFIX=/usr -DCOMPILER_RT_INSTALL_PATH=/usr/lib/clang/13.0.0 -DCOMPILER_RT_INCLUDE_TESTS=no -DCOMPILER_RT_BUILD_LIBFUZZER=OFF -DCOMPILER_RT_BUILD_MEMPROF=OFF -DCOMPILER_RT_BUILD_ORC=OFF -DCOMPILER_RT_BUILD_PROFILE=OFF -DCOMPILER_RT_BUILD_SANITIZERS=OFF -DCOMPILER_RT_BUILD_XRAY=OFF -DPython3_EXECUTABLE=/usr/bin/python3.10 -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_TOOLCHAIN_FILE=/var/tmp/portage/sys-libs/compiler-rt-13.0.0/work/compiler-rt-13.0.0_build/gentoo_toolchain.cmake  /var/tmp/portage/sys-libs/compiler-rt-13.0.0/work/compiler-rt
loading initial cache file /var/tmp/portage/sys-libs/compiler-rt-13.0.0/work/compiler-rt-13.0.0_build/gentoo_common_config.cmake
-- The C compiler identification is Clang 13.0.0
-- The CXX compiler identification is Clang 13.0.0
-- The ASM compiler identification is Clang
-- Found assembler: /usr/lib/llvm/13/bin/x86_64-pc-linux-gnu-clang
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - failed
-- Check for working C compiler: /usr/lib/llvm/13/bin/x86_64-pc-linux-gnu-clang
-- Check for working C compiler: /usr/lib/llvm/13/bin/x86_64-pc-linux-gnu-clang - broken
CMake Error at /usr/share/cmake/Modules/CMakeTestCCompiler.cmake:69 (message):
  The C compiler

    "/usr/lib/llvm/13/bin/x86_64-pc-linux-gnu-clang"

  is not able to compile a simple test program.

  It fails with the following output:

    Change Dir: /var/tmp/portage/sys-libs/compiler-rt-13.0.0/work/compiler-rt-13.0.0_build/CMakeFiles/CMakeTmp

    Run Build Command(s):/usr/bin/ninja cmTC_abff3 && [1/2] Building C object CMakeFiles/cmTC_abff3.dir/testCCompiler.c.o
    [2/2] Linking C executable cmTC_abff3
    FAILED: cmTC_abff3
    : && /usr/lib/llvm/13/bin/x86_64-pc-linux-gnu-clang -march=native -O3 -falign-functions=32 -pipe -flto=thin -Wl,-O2 -Wl,--as-needed -march=native -O3 -falign-functions=32 -pipe -nodefaultlibs -lc CMakeFiles/cmTC_abff3.dir/testCCompiler.c.o -o cmTC_abff3   && :
    /usr/bin/x86_64-pc-linux-gnu-ld: /usr/lib/llvm/13/bin/../lib64/LLVMgold.so: error loading plugin: /usr/lib/llvm/13/bin/../lib64/LLVMgold.so: cannot open shared object file: No such file or directory
    clang-13: error: linker command failed with exit code 1 (use -v to see invocation)
    ninja: build stopped: subcommand failed.





  CMake will not be able to correctly generate this project.
Comment 1 Anton Gubarkov 2021-10-20 15:01:58 UTC
PF16W6Y2 ~ # emerge --info compiler-rt
Portage 3.0.28 (python 3.9.7-final-0, default/linux/amd64/17.1/desktop/gnome/systemd, gcc-11.2.0, glibc-2.33-r7, 5.14.10-gentoo x86_64)
=================================================================
                         System Settings
=================================================================
System uname: Linux-5.14.10-gentoo-x86_64-Intel-R-_Core-TM-_i7-8850H_CPU_@_2.60GHz-with-glibc2.33
KiB Mem:    32564672 total,    911296 free
KiB Swap:   33554428 total,  33330172 free
Timestamp of repository gentoo: Tue, 19 Oct 2021 19:21:28 +0000
Head commit of repository gentoo: e774fd6afd962d0b64501f5dbebfc8e5add6b388

Head commit of repository audio-overlay: 67c8fbcd0681d09261860c2f1bac1e9cb8fab08e

Head commit of repository lto-overlay: dde13f77f390545d64b1a64430f23b4bf10b65eb

Head commit of repository mv: 4c40ab98b3160ceece4aeb9b8b4a7613c3ce8eb8

sh bash 5.1_p8
ld GNU ld (Gentoo 2.36.1 p4) 2.36.1
ccache version 4.4.2 [disabled]
app-shells/bash:          5.1_p8::gentoo
dev-java/java-config:     2.3.1::gentoo
dev-lang/perl:            5.34.0-r3::gentoo
dev-lang/python:          2.7.18_p13::gentoo, 3.8.12_p1::gentoo, 3.9.7_p1::gentoo, 3.10.0_p1::gentoo
dev-lang/rust:            1.55.0::gentoo
dev-util/ccache:          4.4.2::gentoo
dev-util/cmake:           3.21.3::gentoo
sys-apps/baselayout:      2.8::gentoo
sys-apps/sandbox:         2.25::gentoo
sys-devel/autoconf:       2.13-r1::gentoo, 2.71-r1::gentoo
sys-devel/automake:       1.16.5::gentoo
sys-devel/binutils:       2.36.1-r2::gentoo, 2.37_p1::gentoo
sys-devel/gcc:            8.4.0-r2::gentoo, 10.3.0-r2::gentoo, 11.2.0::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.14::gentoo (virtual/os-headers)
sys-libs/glibc:           2.33-r7::gentoo
Repositories:

gentoo
    location: /usr/portage
    sync-type: git
    sync-uri: git://github.com/gentoo-mirror/gentoo.git
    priority: -1000

audio-overlay
    location: /var/lib/layman/audio-overlay
    sync-type: git
    sync-uri: https://github.com/gentoo-mirror/audio-overlay.git
    masters: gentoo
    priority: 50

calculate
    location: /var/lib/layman/calculate
    masters: gentoo
    priority: 50

dlang
    location: /var/lib/layman/dlang
    masters: gentoo
    priority: 50

gentoo-zh
    location: /var/lib/layman/gentoo-zh
    masters: gentoo
    priority: 50

go-overlay
    location: /var/lib/layman/go-overlay
    masters: gentoo
    priority: 50

lto-overlay
    location: /var/lib/layman/lto-overlay
    sync-type: git
    sync-uri: https://github.com/gentoo-mirror/lto-overlay.git
    masters: gentoo mv
    priority: 50

mv
    location: /var/lib/layman/mv
    sync-type: git
    sync-uri: https://github.com/gentoo-mirror/mv.git
    masters: gentoo
    priority: 50

steam-overlay
    location: /var/lib/layman/steam-overlay
    masters: gentoo
    priority: 50

tlp
    location: /var/lib/layman/tlp
    masters: gentoo
    priority: 50

rugubara
    location: /var/lib/layman/rugubara
    masters: gentoo
    priority: 100

ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="* -@EULA Vivaldi"
CBUILD="x86_64-pc-linux-gnu"
CC="clang"
CFLAGS="-march=native -O3 -fno-semantic-interposition -fgraphite-identity -floop-nest-optimize  -flto=12 -fuse-linker-plugin -falign-functions=32 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/lib64/libreoffice/program/sofficerc /usr/share/config /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"
CXX="clang++"
CXXFLAGS="-march=native -O3 -fno-semantic-interposition -fgraphite-identity -floop-nest-optimize  -flto=12 -fuse-linker-plugin -falign-functions=32 -pipe"
DISTDIR="/usr/portage/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 -fno-semantic-interposition -fgraphite-identity -floop-nest-optimize  -flto=12 -fuse-linker-plugin -falign-functions=32 -pipe"
FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs binpkg-multi-instance 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"
FFLAGS="-march=native -O3 -fno-semantic-interposition -fgraphite-identity -floop-nest-optimize  -flto=12 -fuse-linker-plugin -falign-functions=32 -pipe"
GENTOO_MIRRORS="http://gentoo.bloodhost.ru/ rsync://gentoo.bloodhost.ru/gentoo-distfiles http://ftp.ntua.gr/pub/linux/gentoo/"
LANG="en_US.utf8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
MAKEOPTS="-j6"
PKGDIR="/usr/portage/packages"
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 aio alsa amd64 ap bash-completion bluetooth branding bzip2 cacert cairo caps cdda cdr cgroup-hybrid chromecast clang cli client colord crypt cups dbus djvu dri dri3 dts dvd dvdr eds egl emboss encode evo exif fat ffmpeg fftw flac fortran gdbm gif gimp gles2 gnome gnome-keyring gnome-online-accounts gpm graphite gstreamer gtk gtk3 gui heif iconv icu introspection io-uring ipv6 jack jpeg jpeg2k lcms libglvnd libnotify libsecret libtirpc libzfs lm_sensors lto lv2 mad mng mp3 mp4 mpeg multilib native-headset nautilus ncat ncurses networkmanager nfs nls nptl ntfs nvenc nvme ogg opencl opengl openmp opus p2p pam pango pcre pdf png policykit ppds pulseaudio qt5 raw readline sdl sdl2 seccomp smp sna sound spell spice split-usr ssl startup-notification svg synaptics sysprof systemd tcpd thunderbolt tiff tracker truetype udev udisks uefi unicode upower usb usbredir user-session vaapi vala vdpau virgl vlc vorbis vulkan wayland webdav wireguard wxwidgets x264 x265 xattr xcb xml xv xvid zeroconf zfs zlib" ABI_X86="64" ADA_TARGET="gnat_2019" 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 f16c fma3 mmx mmxext pclmul popcnt 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 wacom" KERNEL="linux" L10N="en ru" 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="postgres12 postgres13" PYTHON_SINGLE_TARGET="python3_9" PYTHON_TARGETS="python3_8 python3_9" RUBY_TARGETS="ruby26 ruby27 ruby27 ruby30" 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:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LC_ALL, LINGUAS, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, RUSTFLAGS

=================================================================
                        Package Settings
=================================================================

sys-libs/compiler-rt-12.0.1::gentoo was built with the following:
USE="clang -test" ABI_X86="(64)"
CFLAGS="-march=native -O3 -falign-functions=32 -pipe"
CXXFLAGS="-march=native -O3 -falign-functions=32 -pipe"
FEATURES="sandbox unmerge-orphans merge-sync binpkg-logs parallel-fetch pid-sandbox assume-digests preserve-libs usersandbox fixlafiles config-protect-if-modified distlocks multilib-strict usersync binpkg-dostrip strict qa-unresolved-soname-deps ebuild-locks userfetch sfperms userpriv protect-owned binpkg-multi-instance network-sandbox unknown-features-warn news binpkg-docompress unmerge-logs ipc-sandbox"
LDFLAGS="-fuse-ld=lld -rtlib=compiler-rt"
Comment 2 Tee KOBAYASHI 2021-10-20 21:20:47 UTC
I guess -fuse-ld=lld has to be specified in LDFLAGS, which does not seem to be in the failure case.
Comment 3 Anton Gubarkov 2021-10-21 17:11:19 UTC
(In reply to Tee KOBAYASHI from comment #2)
> I guess -fuse-ld=lld has to be specified in LDFLAGS, which does not seem to
> be in the failure case.

Just 2 lines above, in my emerge info I have 
LDFLAGS="-fuse-ld=lld -rtlib=compiler-rt"
Comment 4 Tee KOBAYASHI 2021-10-22 01:14:32 UTC
(In reply to Anton Gubarkov from comment #3)
> Just 2 lines above, in my emerge info I have 
> LDFLAGS="-fuse-ld=lld -rtlib=compiler-rt"

Your emerge --info tells that "sys-libs/compiler-rt-12.0.1::gentoo was built with" that LDFLAGS. This does not necessarily mean that sys-libs/compiler-rt-13.0.0 (or even the rebuild of sys-libs/compiler-rt-12.0.1) is going to be built with the same LDFLAGS.
Comment 5 Anton Gubarkov 2021-10-26 09:57:27 UTC
I've added the -fuse-ld=lld to LDFLAGS:

PF16W6Y2 ~ # emerge --info
....
ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="* -@EULA Vivaldi"
CBUILD="x86_64-pc-linux-gnu"
CC="clang"
CFLAGS="-march=native -O3 -fno-semantic-interposition -fgraphite-identity -floop-nest-optimize  -flto=12 -fuse-linker-plugin -falign-functions=32 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/lib64/libreoffice/program/sofficerc /usr/share/config /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"
CXX="clang++"
CXXFLAGS="-march=native -O3 -fno-semantic-interposition -fgraphite-identity -floop-nest-optimize  -flto=12 -fuse-linker-plugin -falign-functions=32 -pipe"
DISTDIR="/usr/portage/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 -fno-semantic-interposition -fgraphite-identity -floop-nest-optimize  -flto=12 -fuse-linker-plugin -falign-functions=32 -pipe"
FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs binpkg-multi-instance 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"
FFLAGS="-march=native -O3 -fno-semantic-interposition -fgraphite-identity -floop-nest-optimize  -flto=12 -fuse-linker-plugin -falign-functions=32 -pipe"
GENTOO_MIRRORS="http://gentoo.bloodhost.ru/ rsync://gentoo.bloodhost.ru/gentoo-distfiles http://ftp.ntua.gr/pub/linux/gentoo/"
LANG="en_US.utf8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed -Wl,-fuse-ld=lld"
.....

However this change didn't affect the error as the package seems to override the LDFLAGS:


PF16W6Y2 ~ # emerge -uv compiler-rt

These are the packages that would be merged, in order:

Calculating dependencies... done!
[ebuild  NS    ] sys-libs/compiler-rt-13.0.0:13.0.0::gentoo [12.0.1:12.0.1::gentoo] USE="clang -debug% -test" 0 KiB

Total: 1 package (1 in new slot), Size of downloads: 0 KiB

>>> Recording sys-libs/compiler-rt:12.0.1 in "world" favorites file...

>>> Verifying ebuild manifests
tcpd thunderbolt tiff tracker truetype udev udisks uefi unicode upower usb usbredir user-session vaapi vala vdpau virgl vlc vorbis vulkan wayland webdav wireguard wxwidgets x264 x265 xattr xcb xml xv xv>>> Running pre-merge checks for sys-libs/compiler-rt-13.0.0
estro3 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>>> Emerging (1 of 1) sys-libs/compiler-rt-13.0.0::gentoo
 * llvmorg-13.0.0.tar.gz BLAKE2B SHA512 size ;-) ...                                                                                                                                               [ ok ]o * llvm-gentoo-patchset-13.0.0.tar.xz BLAKE2B SHA512 size ;-) ...                                                                                                                                  [ ok ]
 * FEATURES='protect-owned network-sandbox merge-sync preserve-libs unmerge-logs qa-unresolved-soname-deps config-protect-if-modified sandbox unmerge-orphans multilib-strict binpkg-docompress usersync userpriv binpkg-dostrip parallel-fetch assume-digests sfperms ebuild-locks strict unknown-features-warn pid-sandbox ipc-sandbox distlocks news usersandbox binpkg-logs userfetch fixlafiles binpkg-multi-instance'
 * CFLAGS='-march=native -O3 -falign-functions=32 -pipe -flto=thin'
 * CXXFLAGS='-march=native -O3 -falign-functions=32 -pipe -flto=thin'
 * FFLAGS='-march=native -O3 -falign-functions=32 -pipe -flto=thin'
 * FCFLAGS='-march=native -O3 -falign-functions=32 -pipe -flto=thin'
 * F77FLAGS='-march=native -O3 -falign-functions=32 -pipe -flto=thin'
 * LDFLAGS='-Wl,-O2 -Wl,--as-needed -march=native -O3 -falign-functions=32 -pipe -flto=thin'
 * MAKEOPTS='-j6'
 * USE_NONGNU='1'
 * clang version 13.0.0
 * clang version 13.0.0
 * GNU ld (Gentoo 2.36.1 p4) 2.36.1
 * Linux PF16W6Y2 5.14.13-gentoo #2 SMP Fri Oct 22 11:57:15 MSK 2021 x86_64 Intel(R) Core(TM) i7-8850H CPU @ 2.60GHz GenuineIntel GNU/Linux
...

-- Check for working C compiler: /usr/lib/llvm/13/bin/x86_64-pc-linux-gnu-clang
-- Check for working C compiler: /usr/lib/llvm/13/bin/x86_64-pc-linux-gnu-clang - broken
CMake Error at /usr/share/cmake/Modules/CMakeTestCCompiler.cmake:69 (message):
  The C compiler

    "/usr/lib/llvm/13/bin/x86_64-pc-linux-gnu-clang"

  is not able to compile a simple test program.

  It fails with the following output:

    Change Dir: /var/tmp/portage/sys-libs/compiler-rt-13.0.0/work/compiler-rt-13.0.0_build/CMakeFiles/CMakeTmp

    Run Build Command(s):/usr/bin/ninja cmTC_312b2 && [1/2] Building C object CMakeFiles/cmTC_312b2.dir/testCCompiler.c.o
    [2/2] Linking C executable cmTC_312b2
    FAILED: cmTC_312b2
    : && /usr/lib/llvm/13/bin/x86_64-pc-linux-gnu-clang -march=native -O3 -falign-functions=32 -pipe -flto=thin -Wl,-O2 -Wl,--as-needed -march=native -O3 -falign-functions=32 -pipe -nodefaultlibs -lc CMakeFiles/cmTC_312b2.dir/testCCompiler.c.o -o cmTC_312b2   && :
    /usr/bin/x86_64-pc-linux-gnu-ld: /usr/lib/llvm/13/bin/../lib64/LLVMgold.so: error loading plugin: /usr/lib/llvm/13/bin/../lib64/LLVMgold.so: cannot open shared object file: No such file or directory
    clang-13: error: linker command failed with exit code 1 (use -v to see invocation)
    ninja: build stopped: subcommand failed.





  CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
  CMakeLists.txt:10 (project)


-- Configuring incomplete, errors occurred!
See also "/var/tmp/portage/sys-libs/compiler-rt-13.0.0/work/compiler-rt-13.0.0_build/CMakeFiles/CMakeOutput.log".
See also "/var/tmp/portage/sys-libs/compiler-rt-13.0.0/work/compiler-rt-13.0.0_build/CMakeFiles/CMakeError.log".
 * ERROR: sys-libs/compiler-rt-13.0.0::gentoo failed (configure phase):
 *   cmake failed
 *
 * Call stack:
 *     ebuild.sh, line  127:  Called src_configure
 *   environment, line 4491:  Called cmake_src_configure
 *   environment, line 2607:  Called die
 * The specific snippet of code:
 *       "${CMAKE_BINARY}" "${cmakeargs[@]}" "${CMAKE_USE_DIR}" || die "cmake failed";
 *
 * If you need support, post the output of `emerge --info '=sys-libs/compiler-rt-13.0.0::gentoo'`,
 * the complete build log and the output of `emerge -pqv '=sys-libs/compiler-rt-13.0.0::gentoo'`.
 * The complete build log is located at '/var/tmp/portage/sys-libs/compiler-rt-13.0.0/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/sys-libs/compiler-rt-13.0.0/temp/environment'.
 * Working directory: '/var/tmp/portage/sys-libs/compiler-rt-13.0.0/work/compiler-rt-13.0.0_build'
 * S: '/var/tmp/portage/sys-libs/compiler-rt-13.0.0/work/compiler-rt'

>>> Failed to emerge sys-libs/compiler-rt-13.0.0, Log file:
-- The C compiler identification is Clang 13.0.0
>>>  '/var/tmp/portage/sys-libs/compiler-rt-13.0.0/temp/build.log'
-- The ASM compiler identification is Clang
 * Messages for package sys-libs/compiler-rt-13.0.0:

 * ERROR: sys-libs/compiler-rt-13.0.0::gentoo failed (configure phase):
 *   cmake failed
 *
 * Call stack:
 *     ebuild.sh, line  127:  Called src_configure
 *   environment, line 4491:  Called cmake_src_configure
 *   environment, line 2607:  Called die
 * The specific snippet of code:
 *       "${CMAKE_BINARY}" "${cmakeargs[@]}" "${CMAKE_USE_DIR}" || die "cmake failed";
 *
 * If you need support, post the output of `emerge --info '=sys-libs/compiler-rt-13.0.0::gentoo'`,
 * the complete build log and the output of `emerge -pqv '=sys-libs/compiler-rt-13.0.0::gentoo'`.
 * The complete build log is located at '/var/tmp/portage/sys-libs/compiler-rt-13.0.0/temp/build.log'.
 * The ebuild environment file is located at '/var/tmp/portage/sys-libs/compiler-rt-13.0.0/temp/environment'.
 * Working directory: '/var/tmp/portage/sys-libs/compiler-rt-13.0.0/work/compiler-rt-13.0.0_build'
 * S: '/var/tmp/portage/sys-libs/compiler-rt-13.0.0/work/compiler-rt'
PF16W6Y2 ~ # emerge --info
Comment 6 Anton Gubarkov 2021-10-26 10:36:46 UTC
I finally could find the place where I overwrite the LDFLAGS and compiler-rt finally reports that the -fuse-ld=lld  lands in the invocation.

PF16W6Y2 ~ # emerge -uv compiler-rt

These are the packages that would be merged, in order:

Calculating dependencies... done!
[ebuild  NS    ] sys-libs/compiler-rt-13.0.0:13.0.0::gentoo [12.0.1:12.0.1::gentoo] USE="clang -debug% -test" 0 KiB

Total: 1 package (1 in new slot), Size of downloads: 0 KiB


>>> Verifying ebuild manifests

>>> Running pre-merge checks for sys-libs/compiler-rt-13.0.0

>>> Emerging (1 of 1) sys-libs/compiler-rt-13.0.0::gentoo
 * llvmorg-13.0.0.tar.gz BLAKE2B SHA512 size ;-) ...                                                                                                                                               [ ok ]
 * llvm-gentoo-patchset-13.0.0.tar.xz BLAKE2B SHA512 size ;-) ...                                                                                                                                  [ ok ]
 * FEATURES='userfetch multilib-strict usersandbox ebuild-locks pid-sandbox config-protect-if-modified preserve-libs binpkg-multi-instance binpkg-logs usersync network-sandbox binpkg-dostrip assume-digests binpkg-docompress qa-unresolved-soname-deps strict fixlafiles userpriv news unmerge-orphans unmerge-logs ipc-sandbox merge-sync sandbox parallel-fetch distlocks sfperms protect-owned unknown-features-warn'
 * CFLAGS='-march=native -O3 -falign-functions=32 -pipe -flto=thin'
 * CXXFLAGS='-march=native -O3 -falign-functions=32 -pipe -flto=thin'
 * FFLAGS='-march=native -O3 -falign-functions=32 -pipe -flto=thin'
 * FCFLAGS='-march=native -O3 -falign-functions=32 -pipe -flto=thin'
 * F77FLAGS='-march=native -O3 -falign-functions=32 -pipe -flto=thin'
 * LDFLAGS='-Wl,-O1 -Wl,--as-needed -Wl,-fuse-ld=lld, -Wl,-O2 -Wl,--as-needed -march=native -O3 -falign-functions=32 -pipe -flto=thin'
 * MAKEOPTS='-j6'
 * USE_NONGNU='1'
 * clang version 13.0.0
 * clang version 13.0.0
 * GNU ld (Gentoo 2.36.1 p4) 2.36.1
 * Linux PF16W6Y2 5.14.13-gentoo #2 SMP Fri Oct 22 11:57:15 MSK 2021 x86_64 Intel(R) Core(TM) i7-8850H CPU @ 2.60GHz GenuineIntel GNU/Linux


But the sample compile test still fails":

cmake -C /var/tmp/portage/sys-libs/compiler-rt-13.0.0/work/compiler-rt-13.0.0_build/gentoo_common_config.cmake -G Ninja -DCMAKE_INSTALL_PREFIX=/usr -DCOMPILER_RT_INSTALL_PATH=/usr/lib/clang/13.0.0 -DCOMPILER_RT_INCLUDE_TESTS=no -DCOMPILER_RT_BUILD_LIBFUZZER=OFF -DCOMPILER_RT_BUILD_MEMPROF=OFF -DCOMPILER_RT_BUILD_ORC=OFF -DCOMPILER_RT_BUILD_PROFILE=OFF -DCOMPILER_RT_BUILD_SANITIZERS=OFF -DCOMPILER_RT_BUILD_XRAY=OFF -DPython3_EXECUTABLE=/usr/bin/python3.10 -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_TOOLCHAIN_FILE=/var/tmp/portage/sys-libs/compiler-rt-13.0.0/work/compiler-rt-13.0.0_build/gentoo_toolchain.cmake  /var/tmp/portage/sys-libs/compiler-rt-13.0.0/work/compiler-rt
loading initial cache file /var/tmp/portage/sys-libs/compiler-rt-13.0.0/work/compiler-rt-13.0.0_build/gentoo_common_config.cmake
-- The C compiler identification is Clang 13.0.0
-- The CXX compiler identification is Clang 13.0.0
-- The ASM compiler identification is Clang
-- Found assembler: /usr/lib/llvm/13/bin/x86_64-pc-linux-gnu-clang
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - failed
-- Check for working C compiler: /usr/lib/llvm/13/bin/x86_64-pc-linux-gnu-clang
-- Check for working C compiler: /usr/lib/llvm/13/bin/x86_64-pc-linux-gnu-clang - broken
CMake Error at /usr/share/cmake/Modules/CMakeTestCCompiler.cmake:69 (message):
  The C compiler

    "/usr/lib/llvm/13/bin/x86_64-pc-linux-gnu-clang"

  is not able to compile a simple test program.

  It fails with the following output:

    Change Dir: /var/tmp/portage/sys-libs/compiler-rt-13.0.0/work/compiler-rt-13.0.0_build/CMakeFiles/CMakeTmp

    Run Build Command(s):/usr/bin/ninja cmTC_bd4b6 && [1/2] Building C object CMakeFiles/cmTC_bd4b6.dir/testCCompiler.c.o
    [2/2] Linking C executable cmTC_bd4b6
    FAILED: cmTC_bd4b6
    : && /usr/lib/llvm/13/bin/x86_64-pc-linux-gnu-clang -march=native -O3 -falign-functions=32 -pipe -flto=thin -Wl,-O1 -Wl,--as-needed -Wl,-fuse-ld=lld, -Wl,-O2 -Wl,--as-needed -march=native -O3 -falign-functions=32 -pipe -nodefaultlibs -lc CMakeFiles/cmTC_bd4b6.dir/testCCompiler.c.o -o cmTC_bd4b6   && :
    /usr/bin/x86_64-pc-linux-gnu-ld: /usr/lib/llvm/13/bin/../lib64/LLVMgold.so: error loading plugin: /usr/lib/llvm/13/bin/../lib64/LLVMgold.so: cannot open shared object file: No such file or directory
    clang-13: error: linker command failed with exit code 1 (use -v to see invocation)
    ninja: build stopped: subcommand failed.





  CMake will not be able to correctly generate this project.
Call Stack (most recent call first):
  CMakeLists.txt:10 (project)
Comment 7 Anton Gubarkov 2021-10-30 13:59:49 UTC
I had to revert this change. This flag breaks too many ebuilds and doesn't help here either.
Comment 8 Klaus Kusche 2021-11-06 13:29:34 UTC
I had the same problem here.

The solution was to compile llvm with USE=gold.

As far as I can tell, the meaning of USE=gold in llvm is completely different
from USE=gold in all other ebuilds:

Other ebuilds: "Use the gold linker"
LLVM: Build the llvm plugin for the gnu linker
(not only for the gold linker, but also for the bfd linker!)
i.e. USE=gold is needed for llvm even if you don't use the gold linker!
Comment 9 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2021-11-06 14:58:09 UTC
The name is a historical one -- in the past, the plugin was used only by gold.  I suppose I could change it but I'd rather do that for a future release -- I don't want to force people to rebuild all old versions for that.

That said, I suppose we should default-enable it these days.  I'm going to do that today.
Comment 10 Larry the Git Cow gentoo-dev 2021-11-06 16:51:57 UTC
The bug has been referenced in the following commit(s):

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

commit d5146d4604f4bf79ce78853a315a6121c0545ebd
Author:     Michał Górny <mgorny@gentoo.org>
AuthorDate: 2021-11-06 14:59:22 +0000
Commit:     Michał Górny <mgorny@gentoo.org>
CommitDate: 2021-11-06 16:51:51 +0000

    sys-devel/llvm: Enable the linker plugin by default
    
    Bug: https://bugs.gentoo.org/819036
    Signed-off-by: Michał Górny <mgorny@gentoo.org>

 sys-devel/llvm/llvm-10.0.1.ebuild      | 2 +-
 sys-devel/llvm/llvm-11.1.0.ebuild      | 2 +-
 sys-devel/llvm/llvm-12.0.1.ebuild      | 2 +-
 sys-devel/llvm/llvm-13.0.0.9999.ebuild | 2 +-
 sys-devel/llvm/llvm-13.0.0.ebuild      | 2 +-
 sys-devel/llvm/llvm-14.0.0.9999.ebuild | 2 +-
 6 files changed, 6 insertions(+), 6 deletions(-)
Comment 11 Alec Ari 2021-12-13 02:04:42 UTC
I use LLD which doesn't need the "gold" USE flag enabled anywhere, and builds LTO objects just fine. The binutils gold linker isn't even installed as I'm using Clang+LLD system-wide.

If you wish to build compiler-rt without `USE="gold" sys-devel/llvm` use the ld.lld linker instead.