Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 818664 - sys-libs/compiler-rt-13.0.0 Fails to emerge due to compiler error
Summary: sys-libs/compiler-rt-13.0.0 Fails to emerge due to compiler error
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-17 10:41 UTC by Fabio Coatti
Modified: 2021-11-06 14:03 UTC (History)
1 user (show)

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


Attachments
build.log (build.log,36.85 KB, text/x-log)
2021-10-17 10:41 UTC, Fabio Coatti
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Fabio Coatti 2021-10-17 10:41:11 UTC
I'm trying to emerge sys-libs/compiler-rt-13.0.0 but the process fails with this error:
FAILED: lib/builtins/CMakeFiles/clang_rt.builtins-i386.dir/adddf3.c.o 
/usr/lib/llvm/13/bin/x86_64-pc-linux-gnu-clang -DVISIBILITY_HIDDEN   -DNDEBUG -march=native -O3 -pipe -fpie -fpic -fstack-protector-strong -fstack-clash-protection -Wall -Wno-unused-parameter  -m32 -fno-lto -std=c11 -fPIC -fno-builtin -fvisibility=hidden -fomit-frame-pointer -MD -MT lib/builtins/CMakeFiles/clang_rt.builtins-i386.dir/adddf3.c.o -MF lib/builtins/CMakeFiles/clang_rt.builtins-i386.dir/adddf3.c.o.d -o lib/builtins/CMakeFiles/clang_rt.builtins-i386.dir/adddf3.c.o -c /var/tmp/portage/sys-libs/compiler-rt-13.0.0/work/compiler-rt/lib/builtins/adddf3.c
PLEASE submit a bug report to https://bugs.llvm.org/ and include the crash backtrace, preprocessed source, and associated run script.
Stack dump:
0.      Program arguments: /usr/lib/llvm/13/bin/x86_64-pc-linux-gnu-clang -DVISIBILITY_HIDDEN -DNDEBUG -march=native -O3 -pipe -fpie -fpic -fstack-protector-strong -fstack-clash-protection -Wall -Wno-unused-parameter -m32 -fno-lto -std=c11 -fPIC -fno-builtin -fvisibility=hidden -fomit-frame-pointer -MD -MT lib/builtins/CMakeFiles/clang_rt.builtins-i386.dir/adddf3.c.o -MF lib/builtins/CMakeFiles/clang_rt.builtins-i386.dir/adddf3.c.o.d -o lib/builtins/CMakeFiles/clang_rt.builtins-i386.dir/adddf3.c.o -c /var/tmp/portage/sys-libs/compiler-rt-13.0.0/work/compiler-rt/lib/builtins/adddf3.c
1.      <eof> parser at end of file
2.      Optimizer
 #0 0x00007fef76459f2f (/usr/lib/llvm/13/bin/../lib64/libLLVM-13.so+0x81cf2f)
 #1 0x00007fef7643956c llvm::sys::CleanupOnSignal(unsigned long) (/usr/lib/llvm/13/bin/../lib64/libLLVM-13.so+0x7fc56c)
 #2 0x00007fef763a5058 (/usr/lib/llvm/13/bin/../lib64/libLLVM-13.so+0x768058)
 #3 0x00007fef7587e320 (/lib64/libc.so.6+0x38320)
 #4 0x00007fef76eab135 (/usr/lib/llvm/13/bin/../lib64/libLLVM-13.so+0x126e135)
 #5 0x00007fef76ead407 (/usr/lib/llvm/13/bin/../lib64/libLLVM-13.so+0x1270407)
 #6 0x00007fef76eaf4b1 llvm::PromoteMemToReg(llvm::ArrayRef<llvm::AllocaInst*>, llvm::DominatorTree&, llvm::AssumptionCache*) (/usr/lib/llvm/13/bin/../lib64/libLLVM-13.so+0x12724b1)
 #7 0x00007fef771f1807 llvm::SROA::runImpl(llvm::Function&, llvm::DominatorTree&, llvm::AssumptionCache&) (/usr/lib/llvm/13/bin/../lib64/libLLVM-13.so+0x15b4807)
 #8 0x00007fef77f344e3 (/usr/lib/llvm/13/bin/../lib64/libLLVM-13.so+0x22f74e3)
 #9 0x00007fef765c9dea llvm::PassManager<llvm::Function, llvm::AnalysisManager<llvm::Function> >::run(llvm::Function&, llvm::AnalysisManager<llvm::Function>&) (/usr/lib/llvm/13/bin/../lib64/libLLVM-13.so+0x98cdea)
#10 0x00007fef77df2b32 (/usr/lib/llvm/13/bin/../lib64/libLLVM-13.so+0x21b5b32)
#11 0x00007fef765ca2ca llvm::ModuleToFunctionPassAdaptor::run(llvm::Module&, llvm::AnalysisManager<llvm::Module>&) (/usr/lib/llvm/13/bin/../lib64/libLLVM-13.so+0x98d2ca)
#12 0x00007fef77df2ae2 (/usr/lib/llvm/13/bin/../lib64/libLLVM-13.so+0x21b5ae2)
#13 0x00007fef765c980f llvm::PassManager<llvm::Module, llvm::AnalysisManager<llvm::Module> >::run(llvm::Module&, llvm::AnalysisManager<llvm::Module>&) (/usr/lib/llvm/13/bin/../lib64/libLLVM-13.so+0x98c80f)
#14 0x00007fef7b74c21e (/usr/lib/llvm/13/bin/../lib64/libclang-cpp.so.13+0x284321e)
#15 0x00007fef7a7aa56d clang::EmitBackendOutput(clang::DiagnosticsEngine&, clang::HeaderSearchOptions const&, clang::CodeGenOptions const&, clang::TargetOptions const&, clang::LangOptions const&, llvm::StringRef, llvm::Module*, clang::BackendAction, std::unique_ptr<llvm::raw_pwrite_stream, std::default_delete<llvm::raw_pwrite_stream> >) (/usr/lib/llvm/13/bin/../lib64/libclang-cpp.so.13+0x18a156d)
#16 0x00007fef7aa8742d (/usr/lib/llvm/13/bin/../lib64/libclang-cpp.so.13+0x1b7e42d)
#17 0x00007fef79aa9335 clang::ParseAST(clang::Sema&, bool, bool) (/usr/lib/llvm/13/bin/../lib64/libclang-cpp.so.13+0xba0335)
#18 0x00007fef7b0b1139 clang::FrontendAction::Execute() (/usr/lib/llvm/13/bin/../lib64/libclang-cpp.so.13+0x21a8139)
#19 0x00007fef7b053507 clang::CompilerInstance::ExecuteAction(clang::FrontendAction&) (/usr/lib/llvm/13/bin/../lib64/libclang-cpp.so.13+0x214a507)
#20 0x00007fef7b0ff9ed clang::ExecuteCompilerInvocation(clang::CompilerInstance*) (/usr/lib/llvm/13/bin/../lib64/libclang-cpp.so.13+0x21f69ed)
#21 0x000058d5e2c393dc cc1_main(llvm::ArrayRef<char const*>, char const*, void*) (/usr/lib/llvm/13/bin/x86_64-pc-linux-gnu-clang+0x163dc)
#22 0x000058d5e2c3da15 (/usr/lib/llvm/13/bin/x86_64-pc-linux-gnu-clang+0x1aa15)
#23 0x00007fef7adb9025 (/usr/lib/llvm/13/bin/../lib64/libclang-cpp.so.13+0x1eb0025)
#24 0x00007fef763863c3 llvm::CrashRecoveryContext::RunSafely(llvm::function_ref<void ()>) (/usr/lib/llvm/13/bin/../lib64/libLLVM-13.so+0x7493c3)
#25 0x00007fef7ade8362 clang::driver::CC1Command::Execute(llvm::ArrayRef<llvm::Optional<llvm::StringRef> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*, bool*) const (/usr/lib/llvm/13/bin/../lib64/libclang-cpp.so.13+0x1edf362)
#26 0x00007fef7ada161c clang::driver::Compilation::ExecuteCommand(clang::driver::Command const&, clang::driver::Command const*&) const (/usr/lib/llvm/13/bin/../lib64/libclang-cpp.so.13+0x1e9861c)
#27 0x00007fef7ada1a49 clang::driver::Compilation::ExecuteJobs(clang::driver::JobList const&, llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*> >&) const (/usr/lib/llvm/13/bin/../lib64/libclang-cpp.so.13+0x1e98a49)
#28 0x00007fef7ada8981 clang::driver::Driver::ExecuteCompilation(clang::driver::Compilation&, llvm::SmallVectorImpl<std::pair<int, clang::driver::Command const*> >&) (/usr/lib/llvm/13/bin/../lib64/libclang-cpp.so.13+0x1e9f981)
#29 0x000058d5e2c32401 main (/usr/lib/llvm/13/bin/x86_64-pc-linux-gnu-clang+0xf401)
#30 0x00007fef758697fd __libc_start_main (/lib64/libc.so.6+0x237fd)
#31 0x000058d5e2c33b4a _start (/usr/lib/llvm/13/bin/x86_64-pc-linux-gnu-clang+0x10b4a)
clang-13: error: clang frontend command failed with exit code 139 (use -v to see invocation)
clang version 13.0.0
Target: i386-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/lib/llvm/13/bin
clang-13: note: diagnostic msg: 
********************

PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang-13: note: diagnostic msg: /var/tmp/portage/sys-libs/compiler-rt-13.0.0/temp/adddf3-29db37.c
clang-13: note: diagnostic msg: /var/tmp/portage/sys-libs/compiler-rt-13.0.0/temp/adddf3-29db37.sh
clang-13: note: diagnostic msg: 

********************


Reproducible: Always




hobbes ~ # emerge --info
Portage 3.0.28 (python 3.9.7-final-0, default/linux/amd64/17.1/desktop/plasma/systemd, gcc-11.2.0, glibc-2.33-r7, 5.14.12-cova x86_64)
=================================================================
System uname: Linux-5.14.12-cova-x86_64-Intel-R-_Core-TM-_i7-6820HQ_CPU_@_2.70GHz-with-glibc2.33
KiB Mem:    65678676 total,  46006612 free
KiB Swap:    8388604 total,   8388604 free
Timestamp of repository gentoo: Sun, 17 Oct 2021 08:06:32 +0000
Head commit of repository gentoo: 0cb3b6784f94bd1cbb0cd2fa1495005d7e1b77d6

sh bash 5.1_p8
ld GNU gold (Gentoo 2.37_p1 p0 2.37) 1.16
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/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.13.4-r2::gentoo, 1.16.5::gentoo
sys-devel/binutils:       2.37_p1::gentoo
sys-devel/gcc:            8.5.0-r1::gentoo, 9.4.0::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: https://anongit.gentoo.org/git/repo/sync/gentoo.git
    priority: -1000
    sync-git-verify-commit-signature: yes

kde
    location: /var/lib/layman/kde
    sync-type: laymansync
    sync-uri: https://anongit.gentoo.org/git/proj/kde.git
    masters: gentoo
    priority: 50

local
    location: /usr/overlay
    masters: gentoo
    priority: 51

ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="* -@EULA"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=native -O3 -fgraphite-identity -floop-nest-optimize -ftree-loop-distribution -flto=4 -fuse-linker-plugin -pipe -fpie -fpic -fstack-protector-strong -fstack-clash-protection"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/lib64/libreoffice/program/sofficerc /usr/share/config /usr/share/easy-rsa /usr/share/gnupg/qualified.txt /usr/share/sddm/scripts/Xsetup"
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 /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/texmf/web2c"
CXXFLAGS="-march=native -O3 -fgraphite-identity -floop-nest-optimize -ftree-loop-distribution -flto=4 -fuse-linker-plugin -pipe -fpie -fpic -fstack-protector-strong -fstack-clash-protection"
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="-O2 -pipe"
FEATURES="assume-digests binpkg-docompress binpkg-dostrip binpkg-logs binpkg-multi-instance clean-logs 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 xattr"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="http://mirror.eu.oneandone.net/linux/distributions/gentoo/gentoo/ http://linux.rz.ruhr-uni-bochum.de/download/gentoo-mirror/ http://ftp-stud.hs-esslingen.de/pub/Mirrors/gentoo/"
LANG="en_IE.utf8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed -march=native -O3 -fgraphite-identity -floop-nest-optimize -ftree-loop-distribution -flto=4 -fuse-linker-plugin -pipe -fpie -fpic -fstack-protector-strong -fstack-clash-protection -Wl,--as-needed -Wl,--hash-style=gnu"
LINGUAS="en it de"
MAKEOPTS="-j4"
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="3dnow 3dnowext 3dnowprefetch X \ a52 aac aalib acl acpi activities aim alsa amd64 apng appstream ares asf ati audio audiofile avahi bash-completion bidi bl bluetooth branding bri bzip2 cairo caps cdda cdr cjk cli crypt cups curl dba dbus declarative device-mapper dga divx divx4linux dri dts dv dvb dvd dvdr dvdread eap-sim edl egl emboss encode ethereal evdev exif expat faad fam fame fbcon ffmpeg fftw flac force-cgi-redirect fortran ftp gallium garmin gd gdbm gif gimp gmedia gmp gnutls gphoto2 gpm gps gsm gtk gui h264 h323 iconv icq icu idn ifp ilbc imagemagick imap innodb ipod iproute2 ipv6 ithreads jabber java javascript joystick jpeg kde kipi kontact kvm kwallet lastfm lcms libglvnd libnotify libtirpc libvirtd live lm_sensors lua lvm lxc lzma lzo mad maildir matroska mbox mdnsresponder-compat mhash mime mjpeg mmap mmx mmxext mng mozdevelop mozilla mp3 mp4 mpeg msn mtp multilib mysql ncurses network networkmanager new-hpcups nfsv4 njb nls nptl nptlonly offensive ofx ogg oggvorbis ogm openal openexr opengl openmp oscar pam pango parted pcap pcre pdf phonon php plasma plotutils png policykit ppds pulseaudio qemu qml qt5 readline real rtc ruby samba sasl sdl seccomp semantic-desktop semantic-destkop sha512 sip slang slp smartcard sndfile snmp sox speex spell split-usr srt sse sse2 ssh ssl ssse3 startup-notification svg symlink systemd tcltk tcpd telepathy theora threads tiff tk touchpad tremor truetype udev udisks unicode upower usb utempter v4l v4l2 vaapi vcd vde vdpaum vhosts video videos vim-syntax virt-network virtualbox vorbis vulkan wav wayland widgets wifi wmf wmp wps wxwidgets wxwindows x264 xanim xattr xcb xface xft xine xinerama xml xosd xpm xscreensaver xsl xv xvid zeroconf zlib zpm" ABI_X86="64 32" 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 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" GRUB_PLATFORMS="efi-64 pc" INPUT_DEVICES="libinput" KERNEL="linux" L10N="en it de en_IE" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" LLVM_TARGETS="X86" 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_8" PYTHON_TARGETS="python3_8 python3_9" QEMU_SOFTMMU_TARGETS="i386 x86_64" QEMU_USER_TARGETS="i386 x86_64" RUBY_TARGETS="ruby26 ruby27 ruby30" USERLAND="GNU" VIDEO_CARDS="i965 intel nvidia v4l" 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:  CC, CPPFLAGS, CTARGET, CXX, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LC_ALL, PORTAGE_BINHOST, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, RUSTFLAGS
Comment 1 Fabio Coatti 2021-10-17 10:41:50 UTC
Created attachment 745434 [details]
build.log
Comment 2 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2021-10-17 10:42:38 UTC
I suggest trying with more vanilla C(XX)FLAGS but this will probably need to go upstream.
Comment 3 Fabio Coatti 2021-10-17 11:43:04 UTC
(In reply to Sam James from comment #2)
> I suggest trying with more vanilla C(XX)FLAGS but this will probably need to
> go upstream.

Let me try that. Likely I'll raise anyway an issue upstream, at least the situation should be handled in a nicer way, but let's see what happens with saner flags :)
Comment 4 Fabio Coatti 2021-10-18 16:36:45 UTC
(In reply to Sam James from comment #2)
> I suggest trying with more vanilla C(XX)FLAGS but this will probably need to
> go upstream.

I've been able to make it work, so I leave it here in case someone hits the same issue.

To emerge compiler-rt without errors I had to recompile with "vanilla" compilation flags the clang-related packages:
sys-devel/clang sys-devel/clang-runtime sys-devel/clang-common sys-devel/llvm sys-devel/llvm-common
I used something like 
CFLAGS="-O2 -pipe" 
CXXFLAGS="${CFLAGS}"                                                            
LDFLAGS="-Wl,--as-needed -O2 -pipe"

After this, the process of compiler-rt compilation went fine.

So I guess this issue can be closed :)
Comment 5 Klaus Kusche 2021-11-06 13:19:01 UTC
As far as I can tell from the stack backtraces and error messages, 
I've a very similar problem here.

Additionally, I get error messages which indicate corruption of llvm's internal data structures: 
"corrupted double-linked list" or "corrupted size vs. prev_size"

I've rather aggressive CFLAGS in my make.conf:
-pipe -march=native -mtune=native -msahf -maccumulate-outgoing-args -flto -fuse-linker-plugin -O3 -fomit-frame-pointer -fsched-pressure -flive-range-shrinkage -fweb -ftracer -fivopts -ftree-loop-im -frename-registers -fstdarg-opt

I'll try with less aggressive optimizations...
Comment 6 Klaus Kusche 2021-11-06 14:03:17 UTC
(In reply to Klaus Kusche from comment #5)
> I'll try with less aggressive optimizations...

Going down to O3 without other optimizations and without lto solved the problem.