Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 714742 - sys-libs/compiler-rt-sanitizers-10.0.0: final link failed: bad value
Summary: sys-libs/compiler-rt-sanitizers-10.0.0: final link failed: bad value
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: LLVM support project
Depends on:
Blocks: werror 712488
  Show dependency tree
Reported: 2020-03-25 17:22 UTC by Craig Andrews
Modified: 2022-08-24 04:59 UTC (History)
9 users (show)

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

build.log (build.log,502.44 KB, text/x-log)
2020-03-25 17:23 UTC, Craig Andrews

Note You need to log in before you can comment on or make changes to this bug.
Description Craig Andrews gentoo-dev 2020-03-25 17:22:56 UTC
/usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: /var/tmp/portage/sys-libs/compiler-rt-sanitizers-10.0.0/temp/lto-llvm-57a428.o: relocation R_X86_64_PC32 against symbol `_ZN11__sanitizer14PageSizeCachedE' can not be used when making a shared object; recompile with -fPIC
/usr/lib/gcc/x86_64-pc-linux-gnu/9.3.0/../../../../x86_64-pc-linux-gnu/bin/ld: final link failed: bad value

Reproducible: Always

# emerge --info
Portage 2.3.96 (python 3.8.2-final-0, default/linux/amd64/17.1/systemd, gcc-9.3.0, glibc-2.30-r6, 5.4.0-rc6 x86_64)
System uname: Linux-5.4.0-rc6-x86_64-Intel-R-_Core-TM-_i5-6500_CPU_@_3.20GHz-with-glibc2.4
KiB Mem:    16141608 total,   2481028 free
KiB Swap:   18310136 total,  17833720 free
Timestamp of repository gentoo: Wed, 25 Mar 2020 12:30:01 +0000
Head commit of repository gentoo: 4133f51dfa8bf136da42d2d178e3c71870e4b9d8
sh bash 5.0_p16
ld GNU ld (Gentoo 2.34 p1) 2.34.0
ccache version 3.7.8 [enabled]
app-shells/bash:          5.0_p16::gentoo
dev-java/java-config:     2.2.0-r4::gentoo
dev-lang/perl:            5.30.1::gentoo
dev-lang/python:          2.7.17-r1::gentoo, 3.7.7::gentoo, 3.8.2::gentoo
dev-util/ccache:          3.7.8-r1::gentoo
dev-util/cmake:           3.17.0::gentoo
dev-util/pkgconfig:       0.29.2::gentoo
sys-apps/baselayout:      2.7::gentoo
sys-apps/sandbox:         2.18::gentoo
sys-devel/autoconf:       2.13-r1::gentoo, 2.69-r5::gentoo
sys-devel/automake:       1.16.2::gentoo
sys-devel/binutils:       2.34::gentoo
sys-devel/gcc:            9.3.0::gentoo
sys-devel/gcc-config:     2.2.1::gentoo
sys-devel/libtool:        2.4.6-r6::gentoo
sys-devel/make:           4.3::gentoo
sys-kernel/linux-headers: 5.5::gentoo (virtual/os-headers)
sys-libs/glibc:           2.30-r6::gentoo

    location: /var/cache/portage
    sync-type: rsync
    sync-uri: rsync://
    priority: -1000
    sync-rsync-verify-max-age: 24
    sync-rsync-verify-jobs: 1
    sync-rsync-verify-metamanifest: yes

    location: /usr/local/portage
    masters: gentoo
    priority: 0

ACCEPT_KEYWORDS="amd64 ~amd64"
CFLAGS="-O2 -march=native -pipe -fuse-linker-plugin -flto -Wl,-flto -ftree-vectorize -ftree-slp-vectorize -falign-functions=32 -fgraphite-identity -floop-nest-optimize -fno-common"
CONFIG_PROTECT="/etc /usr/share/gnupg/qualified.txt"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/php/apache2-php7.4/ext-active/ /etc/php/cgi-php7.4/ext-active/ /etc/php/cli-php7.4/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-O2 -march=native -pipe -fuse-linker-plugin -flto -Wl,-flto -ftree-vectorize -ftree-slp-vectorize -falign-functions=32 -fgraphite-identity -floop-nest-optimize -fno-common"
EMERGE_DEFAULT_OPTS="--jobs=4 --load-average=4.5"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs candy ccache cgroup clean-logs collision-protect config-protect-if-modified distlocks ebuild-locks fixlafiles ipc-sandbox merge-sync mount-sandbox multilib-strict network-sandbox news parallel-fetch parallel-install pid-sandbox preserve-libs protect-owned qa-unresolved-soname-deps sandbox sfperms splitdebug strict strict-keepdir unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-O2 -pipe"
LDFLAGS="-Wl,-O1 -Wl,--as-needed -flto -Wl,--hash-style=gnu"
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"
USE="X a52 aac aacs acl acpi aiglx alac alsa amd64 amr amrnb amrwb animation apache2 apng argon2 artworkextra asf aspnet2 asyncns authdaemond avahi avi bash-completion bcmath berkdb bitmap-fonts bluetooth bluray bmp bonjour brotli btrfs bzip2 cairo caps cdda cddb cdparanoia cdr celt chm clang cli crypt cryptsetup css cups curl daap dbus device-mapper dga dhclient dirac divx4linux dlloader dns dnssec dovecot-sasl dpms dri dri3 dts dv dvb dvd dvdr dvdread egl enca encode exif ext4 faac fame fat fbcondecor fbsplash ffmpeg fftw firefox flac fontconfig foomaticdb fortran freetype ftp fuse gaim gd gdbm geoip gif gimpprint glamor gles gles1 gles2 glib glibc-omitfp glitz glut gost gphoto2 graphite gsm gstreamer gstreamer10 gtk gtk2 gudev hardenedphp hbci howl howl-compat http2 https hwdb iconv icu idn imagemagick imap imlib innodb ipv6 java java5 javafx jbig jce joystick jpeg jpeg2k junit kdbus kdehiddenvisibility kvm lapack lcms libfame libglvnd libkms libnotify librtmp libtirpc libusb live llvm lm_sensors lvm lz4 lzma lzo mad maildir mdadm mdnsresponder-compat metalink mjpeg mmap mms mng motif mozilla mozsvg mp3 mpeg mpeg2 mplayer mpx multilib musepack mysql mythtv natspec ncurses nemesi network networkmanager nls nptl nptlonly ntfs ocl-icd offensive ofx ogg oggvorbis openal opencl openexr opengl openmp openvg opus pam pango pcre pcre16 pcre32 pcsc-lite pdf pdflib perl pgo phonon pic pie png pnp policykit ppd ppds pulseaudio python quicktime quvi rar readline rtc rtmp schroedinger screensaver sctp sdl seccomp session sftp sharedmem shout smp sna sni sox speex spell split-usr sqlite srt ssh ssl steamruntime suspend2 svg systemd theora threads tiff tls transcode truetype truetype-fonts type-fonts udev udisks unicode unzip upnp ups usb user-session uxa v4l2 vaapi vcd videos virgl vorbis vpx vulkan wayland webdav webp webservices wifi win32codecs wmf wv x264 x265 xanim xattr xcb xcomposite xdg xinerama xml xml2 xpm xprint xrandr xv xvfb xvid xvmc zeroconf zip zlib zstd" ABI_X86="64" ADA_TARGET="gnat_2018" ALSA_CARDS="hda-intel" APACHE2_MODULES="actions alias auth_basic authn_core authz_core authn_socache cache_disk authn_alias authn_anon authn_dbm authn_file authz_dbm authz_groupfile authz_host authz_owner authz_user autoindex brotli cache dav dav_fs dav_lock dconf 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 auth_digest proxy proxy_ajp proxy_connect proxy_http proxy_fcgi reqtimeout cgi cgid unixd socache_shmcb proxy_html xml2enc" APACHE2_MPMS="event" 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" CURL_SSL="openssl" 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" GRUB_PLATFORMS="efi-64 pc" INPUT_DEVICES="evdev joystick keyboard mouse" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LIRC_DEVICES="userspace" NGINX_MODULES_HTTP="access auth_basic autoindex brotli browser charset empty_gif fastcgi geo grpc gunzip gzip limit_conn limit_req map memcached mirror proxy referer rewrite scgi split_clients ssi upstream_hash upstream_ip_hash upstream_keepalive upstream_least_conn upstream_zone userid uwsgi" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php7-4" POSTGRES_TARGETS="postgres10 postgres11" PYTHON_SINGLE_TARGET="python3_7" PYTHON_TARGETS="python3_7 python3_8" QEMU_SOFTMMU_TARGETS="arm i386 x86_64" QEMU_USER_TARGETS="arm i386 x86_64" RUBY_TARGETS="ruby27" USERLAND="GNU" VIDEO_CARDS="intel i965 iris amdgpu radeon radeonsi" 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"
Comment 1 Craig Andrews gentoo-dev 2020-03-25 17:23:14 UTC
Created attachment 625810 [details]
Comment 2 ninuje 2020-03-25 22:02:20 UTC
AFAICT, this is because *FLAGS unsupported by Clang no longer get stripped by strip-unsupported-flags (for some reason, I could have sworn things were just fine when I built rc4), which in turn makes CMake/Clang's own CFLAGS tests fail (in particular, this one:, causing the build to forgo necessary CFLAGS...
Comment 3 ninuje 2020-03-25 22:03:54 UTC
(In reply to ninuje from comment #2)
> AFAICT, this is because *FLAGS unsupported by Clang no longer get stripped
> by strip-unsupported-flags (for some reason, I could have sworn things were
> just fine when I built rc4), which in turn makes CMake/Clang's own CFLAGS
> tests fail (in particular, this one:
> d32170dbd5b0d54436537b6b75beaf44324e0c28/compiler-rt/CMakeLists.txt#L268),
> causing the build to forgo necessary CFLAGS...

Confirmed that a build without offending CFLAGS went just fine on my end, but I'm guessing a real fix would belong in the flag-o-matic eclass?
Comment 4 ninuje 2020-03-25 22:05:18 UTC
This of course depends on USE clang ;).
Comment 5 ninuje 2020-03-25 22:09:44 UTC
Quite possibly a side-effect of / #712488 

That would explain why I wasn't seeing this with previous Clang 10 RCs.
Comment 6 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2020-03-26 06:05:18 UTC
(In reply to ninuje from comment #5)
> Quite possibly a side-effect of
> eclass?id=ab8fe14ae2e9110faa85ca1c4528b470c0be1535 / #712488 
> That would explain why I wasn't seeing this with previous Clang 10 RCs.

Yep, that would make sense.  Many build systems use -Werror to verify flags.
Comment 7 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2020-03-26 06:06:32 UTC
slyfox, do you remember that old policy that changes to widely used eclasses are supposed to go through ml review?
Comment 8 Sergei Trofimovich (RETIRED) gentoo-dev 2020-03-26 07:46:41 UTC
Having the breakage caused by warnings is unfortunate, but not unexpected.

Unrelated warnings should not break feature detection. bug #712488 is a good example of the opposite. I would also expect -Weverything (or milder variants widespread of warnings like -fstack-protector-all) to break the same without an eclass change.
Comment 9 Larry the Git Cow gentoo-dev 2020-03-26 07:51:07 UTC
The bug has been referenced in the following commit(s):

commit a5003d48705fa9b501022d4e6326c8f516a2eec0
Author:     Sergei Trofimovich <>
AuthorDate: 2020-03-26 07:49:07 +0000
Commit:     Sergei Trofimovich <>
CommitDate: 2020-03-26 07:50:41 +0000

    flag-o-matic.eclass: revert "don't use -Werror in test-flag-PROG(), bug #712488"
    This reverts commit ab8fe14ae2e9110faa85ca1c4528b470c0be1535.
    Triggers build failures on sys-libs/compiler-rt-sanitizers.
    Reported-by: Craig Andrews
    Signed-off-by: Sergei Trofimovich <>

 eclass/flag-o-matic.eclass   | 19 +++++++++++--------
 eclass/tests/ | 10 ++++------
 2 files changed, 15 insertions(+), 14 deletions(-)
Comment 10 Sergei Trofimovich (RETIRED) gentoo-dev 2020-03-26 08:02:14 UTC
The specific option that induces warning is:

    clang-10: warning: optimization flag '-fuse-linker-plugin' is not supported [-Wignored-optimization-argument]
Comment 11 Larry the Git Cow gentoo-dev 2022-07-26 04:46:53 UTC
The bug has been referenced in the following commit(s):

commit 4b535e8f1ed0f6afd8e23e0e0c99b65bea6163f6
Author:     Sam James <>
AuthorDate: 2022-07-26 04:41:01 +0000
Commit:     Sam James <>
CommitDate: 2022-07-26 04:41:22 +0000

    flag-o-matic.eclass: add bug references re -Qunused-arguments
    To ensure we pay attention to these if changing in future (like I've been wondering
    Signed-off-by: Sam James <>

 eclass/flag-o-matic.eclass | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
Comment 12 Larry the Git Cow gentoo-dev 2022-08-24 04:57:00 UTC
The bug has been referenced in the following commit(s):

commit ddba1d149e82dba88b72f992729ad4158f640e32
Author:     Alexander Miller <>
AuthorDate: 2022-08-07 01:34:33 +0000
Commit:     Sam James <>
CommitDate: 2022-08-24 04:55:53 +0000

    flag-o-matic.eclass: test-flag-PROG, strip unused args that generate warnings
    A number of configure checks used by CMake and autoconf (and probably
    other build systems) relies on warning-free compiler runs. A combination
    of compiler and flags that always generates warnings can cause
    misconfiguration and/or build failures.
    Since commit ae9870d9f6b1394ede86176443770b36d7e60ac1, flags that
    generate warnings that could be suppressed with -Qunused-arguments
    are accepted anyway to avoid stripping all linker flags (#627474).
    But commit 28d6437fc7009002f98f28e8900e994109927726 added linker
    invocation for linker flags tests, so the workaround shouldn't be
    necessary any more.
    Drop the extra -Qunused-arguments check and reject all flags that
    generate warnings to avoid configuration issues.
    If it turns out that stripping these unused flags is still problematic,
    we could accept them and actually add -Qunused-arguments to the
    relevant *FLAGS to silence the warnings, but that would require
    bigger changes, so let's try the simpler and cleaner solution first.
    Signed-off-by: Alexander Miller <>
    Signed-off-by: Sam James <>

 eclass/flag-o-matic.eclass | 22 +++++++++++-----------
 1 file changed, 11 insertions(+), 11 deletions(-)