Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 893382 - sys-devel/clang-14.0.6-r1: relocation R_X86_64_TPOFF32 against `_ZL13BottomOfStack' can not be used when making a shared object; recompile with -fPIC
Summary: sys-devel/clang-14.0.6-r1: relocation R_X86_64_TPOFF32 against `_ZL13BottomOf...
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: 2023-02-06 11:57 UTC by Stijn Tintel
Modified: 2023-02-07 01:38 UTC (History)
0 users

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


Attachments
build.log (sys-devel:clang-14.0.6-r1:20230206-112835.log.xz,112.33 KB, application/x-xz)
2023-02-06 11:58 UTC, Stijn Tintel
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Stijn Tintel 2023-02-06 11:57:04 UTC
sys-devel/clang-14.0.6-r1 fails to build. Using a newer version is not an option as dev-util/intel-graphics-compiler depends on clang <= 14.

/usr/lib/gcc/x86_64-pc-linux-gnu/12/../../../../x86_64-pc-linux-gnu/bin/ld: lib/Basic/CMakeFiles/obj.clangBasic.dir/Stack.cpp.o: relocation R_X86_64_TPOFF32 against `_ZL13BottomOfStack' can not be
 used when making a shared object; recompile with -fPIC
/usr/lib/gcc/x86_64-pc-linux-gnu/12/../../../../x86_64-pc-linux-gnu/bin/ld: failed to set dynamic section sizes: bad value
collect2: error: ld returned 1 exit status

Reproducible: Always

Steps to Reproduce:
1. emerge -av1 clang:14

Actual Results:  
>>> Failed to emerge sys-devel/clang-14.0.6-r1


Portage 3.0.43 (python 3.10.9-final-0, default/linux/amd64/17.1/desktop/plasma/systemd, gcc-12, glibc-2.36-r5, 6.1.9-gentoo-x86_64 x86_64)
=================================================================
                         System Settings
=================================================================
System uname: Linux-6.1.9-gentoo-x86_64-x86_64-Intel-R-_Xeon-R-_CPU_E5-2673_v4_@_2.30GHz-with-glibc2.36
KiB Mem:   264033964 total, 227727548 free
KiB Swap:          0 total,         0 free
Timestamp of repository gentoo: Sun, 05 Feb 2023 23:30:01 +0000
Head commit of repository gentoo: cbf9e4e33028c4974ba48ea246c691e5668d7cb2
Head commit of repository go-overlay: bde6b0fe1edcb9202c5c95b1f286cdf1fa64ddea

Timestamp of repository guru: Sat, 04 Feb 2023 12:31:52 +0000
Head commit of repository guru: 8ff21cc03aa1fc9c92cb5b8ccaaf7b3e439dc1ee

Head commit of repository iamben: 01a484d28fc82710e42df93447cc98876c615238

Head commit of repository linuxunderground-overlay: 3de09e604dc5e382bc66309af7820854eb90c7f6

Timestamp of repository monero: Tue, 26 Jul 2022 05:02:30 +0000
Head commit of repository monero: f09efc008db5f08668b8341baba0d46b8488e3cd

Head commit of repository pentoo: ef7f2f39dcf433775640279d6a521d7d98972b1e

Timestamp of repository steam-overlay: Mon, 30 Jan 2023 17:48:24 +0000
Head commit of repository steam-overlay: cb2e509008f4686631582637696f9f98d10588d6

Timestamp of repository wayland-desktop: Wed, 01 Feb 2023 02:31:52 +0000
Head commit of repository wayland-desktop: d9a7f398886bc437252fece3ecbe800b8cd98a72

sh bash 5.1_p16-r2
ld GNU ld (Gentoo 2.39 p5) 2.39.0
distcc 3.4 x86_64-pc-linux-gnu [disabled]
ccache version 4.7.4 [disabled]
app-misc/pax-utils:        1.3.5::gentoo
app-shells/bash:           5.1_p16-r2::gentoo
dev-java/java-config:      2.3.1::gentoo
dev-lang/perl:             5.36.0-r1::gentoo
dev-lang/python:           3.9.16-r1::gentoo, 3.10.9-r1::gentoo, 3.11.1-r1::gentoo
dev-lang/rust:             1.66.1::gentoo
dev-util/ccache:           4.7.4::gentoo
dev-util/cmake:            3.24.3::gentoo
dev-util/meson:            0.64.1::gentoo
sys-apps/baselayout:       2.9::gentoo
sys-apps/sandbox:          2.29::gentoo
sys-apps/systemd:          252.4-r1::gentoo
sys-devel/autoconf:        2.13-r7::gentoo, 2.71-r5::gentoo
sys-devel/automake:        1.16.5::gentoo
sys-devel/binutils:        2.39-r4::gentoo
sys-devel/binutils-config: 5.4.1::gentoo
sys-devel/clang:           15.0.7-r1::gentoo
sys-devel/gcc:             12.2.1_p20230121-r1::gentoo
sys-devel/gcc-config:      2.8::gentoo
sys-devel/libtool:         2.4.7-r1::gentoo
sys-devel/lld:             14.0.6-r1::gentoo, 15.0.7::gentoo
sys-devel/llvm:            14.0.6-r2::gentoo, 15.0.7::gentoo
sys-devel/make:            4.3::gentoo
sys-kernel/linux-headers:  5.15-r3::gentoo (virtual/os-headers)
sys-libs/glibc:            2.36-r5::gentoo
Repositories:

gentoo
    location: /var/db/repos/gentoo
    sync-type: rsync
    sync-uri: rsync://rsync.gentoo.org/gentoo-portage
    priority: -1000
    volatile: True
    sync-rsync-verify-jobs: 1
    sync-rsync-extra-opts: --exclude-from=/etc/portage/rsync.exclude
    sync-rsync-verify-metamanifest: yes
    sync-rsync-verify-max-age: 24

crossdev
    location: /var/lib/crossdev/overlay
    masters: gentoo stintel_local pentoo misc2 misc go-overlay
    volatile: True

go-overlay
    location: /var/repo/go-overlay
    sync-type: git
    sync-uri: https://github.com/Dr-Terrible/go-overlay.git
    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: True

iamben
    location: /var/repo/iamben-overlay
    sync-type: git
    sync-uri: https://github.com/benkohler/iamben-overlay.git
    masters: gentoo
    volatile: True

linuxunderground-overlay
    location: /var/repo/linuxunderground
    sync-type: git
    sync-uri: https://github.com/linuxunderground/gentoo.overlay.git
    masters: gentoo
    volatile: True

misc
    location: /usr/local/portage/misc
    masters: gentoo
    volatile: True

misc2
    location: /usr/local/portage/misc2
    masters: gentoo
    volatile: True

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

mozilla-sync
    location: /home/stijn/Development/mozilla-sync-overlay
    masters: gentoo
    volatile: True

pentoo
    location: /var/repo/pentoo
    sync-type: git
    sync-uri: https://github.com/pentoo/pentoo-overlay.git
    masters: gentoo
    volatile: True

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

stintel
    location: /home/stijn/Development/gentoo-overlay
    masters: guru gentoo
    volatile: True

stintel_local
    location: /usr/local/portage/stintel
    masters: gentoo
    priority: 0
    volatile: True

wayland-desktop
    location: /var/db/repos/wayland-desktop
    sync-type: git
    sync-uri: https://github.com/gentoo-mirror/wayland-desktop.git
    masters: gentoo
    volatile: True

ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="@FREE AdobeFlash-11.x dlj-1.1 NVIDIA-CUDA Oracle-BCLA-JavaSE skype-eula skype-4.0.0.7-copyright googleearth Google-TOS Xerox teamspeak3 intel-ucode bh-luxi MSttfEULA freedist MPEG-4 netperf fping NVIDIA-r2 worldofpadman MPL-2 all-rights-reserved BitstreamCyberbit Alasir unRAR linux-fw-redistributable inmon-sflow VIGRA PassMark-EULA no-source-code"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS=" -ggdb -pipe -O2 -march=broadwell -maes -mrtm -D_FORTIFY_SOURCE=2 -fasynchronous-unwind-tables -fstack-protector-strong --param l1-cache-size=32 --param l1-cache-line-size=64 --param l2-cache-size=4096"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/lib64/libreoffice/program/sofficerc /usr/share/config /usr/share/gnupg/qualified.txt /usr/share/maven-bin-3.8/conf /usr/share/themes/oxygen-gtk/gtk-2.0 /var/ossec/etc"
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/apache2-php8.0/ext-active/ /etc/php/apache2-php8.1/ext-active/ /etc/php/cgi-php7.4/ext-active/ /etc/php/cgi-php8.0/ext-active/ /etc/php/cgi-php8.1/ext-active/ /etc/php/cli-php7.4/ext-active/ /etc/php/cli-php8.0/ext-active/ /etc/php/cli-php8.1/ext-active/ /etc/php/fpm-php7.4/ext-active/ /etc/php/fpm-php8.0/ext-active/ /etc/php/fpm-php8.1/ext-active/ /etc/php/phpdbg-php7.4/ext-active/ /etc/php/phpdbg-php8.0/ext-active/ /etc/php/phpdbg-php8.1/ext-active/ /etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS=" -ggdb -pipe -O2 -march=broadwell -maes -mrtm -D_FORTIFY_SOURCE=2 -fasynchronous-unwind-tables -fstack-protector-strong --param l1-cache-size=32 --param l1-cache-line-size=64 --param l2-cache-size=4096"
DISTDIR="/var/cache/distfiles"
EMERGE_DEFAULT_OPTS="--keep-going"
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="-O2 -pipe"
FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs buildpkg buildpkg-live clean-logs compressdebug 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 splitdebug strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="http://ftp.ntua.gr/pub/linux/gentoo/ http://mirror.leaseweb.com/gentoo"
LANG="en_US.utf8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
LEX="flex"
LINGUAS="en en_US en_GB nl"
MAKEOPTS="--jobs=40 --load-average=60"
PKGDIR="/var/cache/binpkgs"
PORTAGE_BZIP2_COMMAND="lbzip2"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_EXTRA_OPTS="--exclude-from=/etc/portage/rsync.exclude"
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"
SHELL="/bin/bash"
USE="7zip X a52 aac acl acpi activities adns aes aio alac alsa amd64 applet async audit avahi avx avx2 bash-completion bluetooth bpf branding btrfs bzip2 cairo caps caps-ng cdda cddb cdparanoia cdr cli crypt cryptsetup cscope css cups d3d9 daap dbus declarative device-mapper dri drm dts dvb dvd dvdr enca encode exif f16c fam flac fma3 foomaticdb fortran ftp g3dvl gdbm geoclue geoip geoipv2 gif gimp gimpprint git gpm gsm gtk gui gupnp hardened hddtemp hidpi http2 hwloc iconv icu idn imap infinality inotify iproute2 ipv6 jpeg jpeg2k kde keyring kvm kwallet laptop lcms libglvnd libnotify libtirpc libvirt lm_sensors logrotate lto lvm lzo mad matroska metric mmap mmx mmxext mng modemmanager mozilla mp3 mp4 mpeg msn mtp multilib ncurses netlink network network-cron networkmanager nfs nls nptl nsplugin ntp numa obex offensive ogg openal opencl openexr opengl openmp opus osmesa pam pango pci pclmul pcre pdf pkcs11 plasma pm-utils pmu png policykit popcnt posix ppds pulseaudio qml qt5 quicktime rar raw rdesktop rdrand readline rtc rtlsdr samba schroedinger screencast sctp sdl seccomp semantic-desktop sharedmem smartcard smp snmp sockets sound speex spell spice split-usr srt sse sse2 sse2_4way sse3 sse4_1 sse4_2 ssl ssse3 startup-notification svg systemd taglib test-rust theora tiff truetype udev udisks unicode upnp upower usb v4l v4l2 vaapi vdpau vim vim-syntax vnc vorbis vpx vulkan wayland webdav webp widescreen widgets wifi wma wmf wxwidgets x264 x265 xattr xcb xcomposite xft xinerama xml xml2 xmp xprint xv xvid zeroconf zip zlib zsh-completion zstd zvbi" ABI_X86="64 32" ADA_TARGET="gnat_2021" ALSA_CARDS="emu10k1x hda-intel" 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" APACHE2_MPMS="worker" CALLIGRA_FEATURES="karbon sheets words" CAMERAS="ptp2" COLLECTD_PLUGINS="contextswitch cpu cpufreq df disk entropy ethstat filecount fscache hddtemp interface irq libvirt load memory mysql netlink network nginx ntpd ping processes protocols rrdcached rrdtool sensors snmp swap syslog table tcpconns thermal unixsock uptime write_graphite" CPU_FLAGS_X86="aes avx avx2 f16c fma3 mmx mmxext pclmul popcnt rdrand 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" GRUB_PLATFORMS="efi-64 pc" INPUT_DEVICES="evdev keyboard libinput mouse roccat_tyon synaptics" KERNEL="linux" L10N="en en-GB en-US nl" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="wiki-publisher" LUA_SINGLE_TARGET="lua5-1" LUA_TARGETS="lua5-1" NGINX_MODULES_HTTP="access addition auth_basic autoindex browser charset dav empty_gif fancyindex fastcgi geo geoip gzip gzip_static headers_more limit_req limit_zone map memcached mp4 proxy realip referer rewrite scgi spdy split_clients ssi stub_status upload upload_progress upstream_ip_hash userid uwsgi" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php7-4 php8-0" POSTGRES_TARGETS="postgres12 postgres13" PYTHON_SINGLE_TARGET="python3_10" PYTHON_TARGETS="python3_10" QEMU_SOFTMMU_TARGETS="aarch64 arm i386 sparc64 x86_64" QEMU_USER_TARGETS="aarch64 arm i386 sparc64 x86_64" RUBY_TARGETS="ruby27 ruby30" USERLAND="GNU" VIDEO_CARDS="amdgpu dummy i965 intel radeonsi" 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:  ADDR2LINE, AR, ARFLAGS, AS, ASFLAGS, CC, CCLD, CONFIG_SHELL, CPP, CPPFLAGS, CTARGET, CXX, CXXFILT, ELFEDIT, EXTRA_ECONF, F77FLAGS, FC, GCOV, GPROF, INSTALL_MASK, LC_ALL, LD, LFLAGS, LIBTOOL, MAKE, MAKEFLAGS, NM, OBJCOPY, OBJDUMP, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, RANLIB, READELF, RUSTFLAGS, SIZE, STRINGS, STRIP, YACC, YFLAGS
Comment 1 Stijn Tintel 2023-02-06 11:58:50 UTC
Created attachment 849976 [details]
build.log
Comment 2 Stijn Tintel 2023-02-06 13:37:25 UTC
The error suggests recompiling with -fPIC but the build log suggests this is unsupported:

-- Linker detection: GNU ld
-- Performing Test C_SUPPORTS_FPIC
-- Performing Test C_SUPPORTS_FPIC - Failed
-- Performing Test CXX_SUPPORTS_FPIC
-- Performing Test CXX_SUPPORTS_FPIC - Failed
CMake Warning at /usr/lib/llvm/14/lib/cmake/llvm/HandleLLVMOptions.cmake:276 (message):
  -fPIC is not supported.


FWIW, same version built fine half a year ago:
2022-08-09T18:32:40 >>> sys-devel/clang-14.0.6-r1: 26 minutes, 38 seconds

At that time, it was built using sys-devel/gcc-11.3.0. I've tried with gcc:11 (11.3.1_p20230120-r1), but this causes other problems:

/usr/lib/gcc/x86_64-pc-linux-gnu/11/../../../../x86_64-pc-linux-gnu/bin/ld: /usr/lib/llvm/14/lib/libLLVMSupport.a(CommandLine.cpp.o): in function `llvm::E
rror llvm::handleErrorImpl<llvm::consumeError(llvm::Error)::{lambda(llvm::ErrorInfoBase const&)#1}>(std::unique_ptr<llvm::ErrorInfoBase, std::default_dele
te<llvm::ErrorInfoBase> >, llvm::consumeError(llvm::Error)::{lambda(llvm::ErrorInfoBase const&)#1}&&) [clone .isra.0]':
CommandLine.cpp:(.text._ZN4llvm15handleErrorImplIZNS_12consumeErrorENS_5ErrorEEUlRKNS_13ErrorInfoBaseEE_JEEES1_St10unique_ptrIS2_St14default_deleteIS2_EEO
T_DpOT0_.isra.0+0x8d): undefined reference to `std::__glibcxx_assert_fail(char const*, int, char const*, char const*)'
/usr/lib/gcc/x86_64-pc-linux-gnu/11/../../../../x86_64-pc-linux-gnu/bin/ld: /usr/lib/llvm/14/lib/libLLVMSupport.a(CommandLine.cpp.o): in function `ExpandR
esponseFile(llvm::StringRef, llvm::StringSaver&, void (*)(llvm::StringRef, llvm::StringSaver&, llvm::SmallVectorImpl<char const*>&, bool), llvm::SmallVect
orImpl<char const*>&, bool, bool, bool, llvm::vfs::FileSystem&)':
CommandLine.cpp:(.text._ZL18ExpandResponseFileN4llvm9StringRefERNS_11StringSaverEPFvS0_S2_RNS_15SmallVectorImplIPKcEEbES7_bbbRNS_3vfs10FileSystemE+0x8a9):
 undefined reference to `std::__glibcxx_assert_fail(char const*, int, char const*, char const*)'
/usr/lib/gcc/x86_64-pc-linux-gnu/11/../../../../x86_64-pc-linux-gnu/bin/ld: /usr/lib/llvm/14/lib/libLLVMSupport.a(CommandLine.cpp.o): in function `llvm::E
rrorList::join(llvm::Error, llvm::Error)':
CommandLine.cpp:(.text._ZN4llvm9ErrorList4joinENS_5ErrorES1_[_ZN4llvm9ErrorList4joinENS_5ErrorES1_]+0x3ae): undefined reference to `std::__glibcxx_assert_
fail(char const*, int, char const*, char const*)'
/usr/lib/gcc/x86_64-pc-linux-gnu/11/../../../../x86_64-pc-linux-gnu/bin/ld: /usr/lib/llvm/14/lib/libLLVMSupport.a(ConvertUTFWrapper.cpp.o): in function `l
lvm::convertUTF16ToUTF8String(llvm::ArrayRef<char>, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >&) [clone .localalias]'
:
ConvertUTFWrapper.cpp:(.text._ZN4llvm24convertUTF16ToUTF8StringENS_8ArrayRefIcEERNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE+0x24d): undefined re
ference to `std::__glibcxx_assert_fail(char const*, int, char const*, char const*)'
/usr/lib/gcc/x86_64-pc-linux-gnu/11/../../../../x86_64-pc-linux-gnu/bin/ld: ConvertUTFWrapper.cpp:(.text._ZN4llvm24convertUTF16ToUTF8StringENS_8ArrayRefIc
EERNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE+0x275): undefined reference to `std::__glibcxx_assert_fail(char const*, int, char const*, char con
st*)'
/usr/lib/gcc/x86_64-pc-linux-gnu/11/../../../../x86_64-pc-linux-gnu/bin/ld: /usr/lib/llvm/14/lib/libLLVMSupport.a(DebugCounter.cpp.o):DebugCounter.cpp:(.t
ext._ZNK12_GLOBAL__N_116DebugCounterList15printOptionInfoEj+0x5a1): more undefined references to `std::__glibcxx_assert_fail(char const*, int, char const*
, char const*)' follow
collect2: error: ld returned 1 exit status
Comment 3 Stijn Tintel 2023-02-06 15:48:56 UTC
Adding this to /etc/portage/env/sys-devel/clang does fix it:
CFLAGS="${CFLAGS} -fPIC"
CXXFLAGS="${CFLAGS} -fPIC"

The question is: why is this needed all of a sudden?