The sys-devel/llvm-3.1-r2 package is needed when installing xorg-server on a 3.11.7-hardened-r1 system. The compile fails with an error "Constants.cpp:1384:1: internal compiler error: Segmentation fault". Reproducible: Always Steps to Reproduce: 1. Use the gentoo-hardened profile. 2. Attempt to emerge the sys-devel/llvm-3.1-r2 package. Actual Results: Constants.cpp: In static member function ‘static llvm::Constant* llvm::ConstantExpr::getCast(unsigned int, llvm::Constant*, llvm::Type*)’: Constants.cpp:1384:1: internal compiler error: Segmentation fault Please submit a full bug report, with preprocessed source if appropriate. See <https://bugs.gentoo.org/> for instructions. {standard input}: Assembler messages: {standard input}: Error: open CFI at the end of file; missing .cfi_endproc directive /bin/rm: cannot remove ‘/var/tmp/portage/sys-devel/llvm-3.1-r2/work/llvm-3.1.src/lib/VMCore/Release/Constants.d.tmp’: No such file or directory make[1]: *** [/var/tmp/portage/sys-devel/llvm-3.1-r2/work/llvm-3.1.src/lib/VMCore/Release/Constants.o] Error 1 make[1]: *** Waiting for unfinished jobs.... make[1]: Leaving directory `/var/tmp/portage/sys-devel/llvm-3.1-r2/work/llvm-3.1.src/lib/VMCore' make: *** [all] Error 1 * ERROR: sys-devel/llvm-3.1-r2::gentoo failed (compile phase): * emake failed Expected Results: The package is compiled and installed correctly.
Created attachment 369304 [details] emerge-info.log
Created attachment 369306 [details] emerge-pqv.log
Created attachment 369308 [details] build.log
Created attachment 369310 [details] llvm-environment.log
Do you get that fault consistently? Please try building again. It looks like an issue with your computer rather than LLVM.
The segfault is consistent - every time I compile it crashes at the same spot.
I can reproduce this bug with -mtune=atom, maybe it is related. If i use CFLAGS="-O2 -pipe --mtune=atom" on an intel atom pc it fails. If i use CFLAGS="-O2 -pipe -mtune=atom" on an intel core i5 2500k it fails too. If i use CFLAGS="-O2 -pipe -mtune=corei7-avx" it is successful on an intel core i5 2500k If i use CFLAGS="-O2 -pipe" on a intel atom it is successful too. Can someone try to reproduce the bug with -mtune=atom ?
Created attachment 370962 [details] emerge --info It is not on an hardened profile the profile is : default/linux/amd64/13.0/desktop/kde/systemd
it fails too with =sys-devel/llvm-3.3-r3 and -mtune=atom the compile with -mtune=corei7-avx is fine the error message is : /var/tmp/portage/sys-devel/llvm-3.3-r3/work/llvm-3.3.src/tools/llvm-readobj/Error.cpp: In member function 'virtual std::string {anonymous}::_readobj_error_category::message(int) const': /var/tmp/portage/sys-devel/llvm-3.3-r3/work/llvm-3.3.src/tools/llvm-readobj/Error.cpp:49:1: internal compiler error: Segmentation fault Please submit a full bug report, with preprocessed source if appropriate. See <https://bugs.gentoo.org/> for instructions. {standard input}: Assembler messages: {standard input}: Error: open CFI at the end of file; missing .cfi_endproc directive make[2]: *** [/var/tmp/portage/sys-devel/llvm-3.3-r3/work/llvm-3.3.src-amd64/tools/llvm-readobj/Release/Error.o] Error 1 make[2]: Leaving directory `/var/tmp/portage/sys-devel/llvm-3.3-r3/work/llvm-3.3.src-amd64/tools/llvm-readobj' make[1]: *** [llvm-readobj/.makeall] Error 2 make[1]: Leaving directory `/var/tmp/portage/sys-devel/llvm-3.3-r3/work/llvm-3.3.src-amd64/tools' make: *** [all] Error 1
Several months ago, while using OpenRC, I could flawlessly emerge llvm. A few weeks ago, after already changed to systemd, emerge llvm (3.1-r2 -> 3.3-r3) has failed during a world update. Since then I had tried to emerge llvm-3.3-r3 using various modifications of the environment (e.g. changing default python version), but had no success. I have also tried to reemerge llvm-3.1-r2, which was previously installed, but this also failed. llvm is the only package that cannot be emerged. # uname -a Linux t01 3.12.13-gentoo #1 SMP Mon Mar 10 01:32:10 CET 2014 x86_64 Intel(R) Atom(TM) CPU 230 @ 1.60GHz GenuineIntel GNU/Linux # eselect profile show Current /etc/portage/make.profile symlink: default/linux/amd64/13.0/desktop/gnome/systemd # emerge --info llvm|grep FLAGS CFLAGS="-march=native -O2 -pipe" CXXFLAGS="-march=native -O2 -pipe" FCFLAGS="-O2 -pipe" FFLAGS="-O2 -pipe" LDFLAGS="-Wl,-O1 -Wl,--as-needed" Unset: CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LANG, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, USE_PYTHON # emerge -1av =llvm-3.1-r2 ... llvm[2]: Compiling ExpandISelPseudos.cpp for Release build if x86_64-pc-linux-gnu-g++ -I/var/tmp/portage/sys-devel/llvm-3.1-r2/work/llvm-3.1.src/include -I/var/tmp/portage/sys-devel/llvm-3.1-r2/work/llvm-3.1.src/lib/CodeGen -DNDEBUG -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -fvisibility-inlines-hidden -fno-exceptions -fPIC -Woverloaded-virtual -Wcast-qual -march=native -O2 -pipe -I/usr/lib64/libffi-3.0.11/include -pedantic -Wno-long-long -Wall -W -Wno-unused-parameter -Wwrite-strings -c -MMD -MP -MF "/var/tmp/portage/sys-devel/llvm-3.1-r2/work/llvm-3.1.src/lib/CodeGen/Release/ExpandISelPseudos.d.tmp" -MT "/var/tmp/portage/sys-devel/llvm-3.1-r2/work/llvm-3.1.src/lib/CodeGen/Release/ExpandISelPseudos.o" -MT "/var/tmp/portage/sys-devel/llvm-3.1-r2/work/llvm-3.1.src/lib/CodeGen/Release/ExpandISelPseudos.d" ExpandISelPseudos.cpp -o /var/tmp/portage/sys-devel/llvm-3.1-r2/work/llvm-3.1.src/lib/CodeGen/Release/ExpandISelPseudos.o ; \ then /bin/mv -f "/var/tmp/portage/sys-devel/llvm-3.1-r2/work/llvm-3.1.src/lib/CodeGen/Release/ExpandISelPseudos.d.tmp" "/var/tmp/portage/sys-devel/llvm-3.1-r2/work/llvm-3.1.src/lib/CodeGen/Release/ExpandISelPseudos.d"; else /bin/rm "/var/tmp/portage/sys-devel/llvm-3.1-r2/work/llvm-3.1.src/lib/CodeGen/Release/ExpandISelPseudos.d.tmp"; exit 1; fi X86ELFWriterInfo.cpp: In member function 'virtual long int llvm::X86ELFWriterInfo::getDefaultAddendForRelTy(unsigned int, long int) const': X86ELFWriterInfo.cpp:85:1: internal compiler error: Segmentation fault Please submit a full bug report, with preprocessed source if appropriate. See <https://bugs.gentoo.org/> for instructions. {standard input}: Assembler messages: {standard input}: Error: open CFI at the end of file; missing .cfi_endproc directive make[3]: *** [/var/tmp/portage/sys-devel/llvm-3.1-r2/work/llvm-3.1.src/lib/Target/X86/Release/X86ELFWriterInfo.o] Error 1 make[3]: Leaving directory `/var/tmp/portage/sys-devel/llvm-3.1-r2/work/llvm-3.1.src/lib/Target/X86' make[2]: *** [X86/.makeall] Error 2 make[2]: Leaving directory `/var/tmp/portage/sys-devel/llvm-3.1-r2/work/llvm-3.1.src/lib/Target' make[1]: *** [Target/.makeall] Error 2 make[1]: *** Waiting for unfinished jobs.... llvm[2]: Compiling ExpandPostRAPseudos.cpp for Release build ... x86_64-pc-linux-gnu-ranlib /var/tmp/portage/sys-devel/llvm-3.1-r2/work/llvm-3.1.src/Release/lib/libLLVMCodeGen.a make[2]: Leaving directory `/var/tmp/portage/sys-devel/llvm-3.1-r2/work/llvm-3.1.src/lib/CodeGen' make[1]: Leaving directory `/var/tmp/portage/sys-devel/llvm-3.1-r2/work/llvm-3.1.src/lib' make: *** [all] Error 1 * ERROR: sys-devel/llvm-3.1-r2::gentoo failed (compile phase): * emake failed ... # emerge -1av =llvm-3.3-r3 ... llvm[2]: Linking Release executable llvm-rtdyld x86_64-pc-linux-gnu-g++ -I/var/tmp/portage/sys-devel/llvm-3.3-r3/work/llvm-3.3.src-amd64/include -I/var/tmp/portage/sys-devel/llvm-3.3-r3/work/llvm-3.3.src-amd64/tools/llvm-rtdyld -I/var/tmp/portage/sys-devel/llvm-3.3-r3/work/llvm-3.3.src/include -I/var/tmp/portage/sys-devel/llvm-3.3-r3/work/llvm-3.3.src/tools/llvm-rtdyld -DNDEBUG -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -fvisibility-inlines-hidden -fno-exceptions -fPIC -Woverloaded-virtual -Wcast-qual -march=native -O2 -pipe -march=native -O2 -pipe -march=native -O2 -pipe -march=native -O2 -pipe -march=native -O2 -pipe -Wl,-R -Wl,'$ORIGIN/../lib' -L/var/tmp/portage/sys-devel/llvm-3.3-r3/work/llvm-3.3.src-amd64/Release/lib -L/var/tmp/portage/sys-devel/llvm-3.3-r3/work/llvm-3.3.src-amd64/Release/lib -Wl,--version-script=/var/tmp/portage/sys-devel/llvm-3.3-r3/work/llvm-3.3.src/autoconf/ExportMap.map -Wl,-O1 -Wl,--as-needed -Wl,-O1 -Wl,--as-needed -Wl,-O1 -Wl,--as-needed -Wl,-O1 -Wl,--as-needed -Wl,-O1 -Wl,--as-needed -pedantic -Wno-long-long -Wall -W -Wno-unused-parameter -Wwrite-strings -Wno-maybe-uninitialized -Wno-missing-field-initializers -o /var/tmp/portage/sys-devel/llvm-3.3-r3/work/llvm-3.3.src-amd64/Release/bin/llvm-rtdyld /var/tmp/portage/sys-devel/llvm-3.3-r3/work/llvm-3.3.src-amd64/tools/llvm-rtdyld/Release/llvm-rtdyld.o \ -lLLVM-3.3 -lz -lpthread -lffi -ldl -lm /var/tmp/portage/sys-devel/llvm-3.3-r3/work/llvm-3.3.src/tools/llvm-readobj/Error.cpp: In member function 'virtual std::string {anonymous}::_readobj_error_category::message(int) const': /var/tmp/portage/sys-devel/llvm-3.3-r3/work/llvm-3.3.src/tools/llvm-readobj/Error.cpp:49:1: internal compiler error: Segmentation fault Please submit a full bug report, with preprocessed source if appropriate. See <https://bugs.gentoo.org/> for instructions. {standard input}: Assembler messages: {standard input}: Error: open CFI at the end of file; missing .cfi_endproc directive make[2]: *** [/var/tmp/portage/sys-devel/llvm-3.3-r3/work/llvm-3.3.src-amd64/tools/llvm-readobj/Release/Error.o] Error 1 make[2]: Leaving directory `/var/tmp/portage/sys-devel/llvm-3.3-r3/work/llvm-3.3.src-amd64/tools/llvm-readobj' make[1]: *** [llvm-readobj/.makeall] Error 2 make[1]: *** Waiting for unfinished jobs.... llvm[2]: ======= Finished Linking Release Executable llvm-rtdyld make[2]: Leaving directory `/var/tmp/portage/sys-devel/llvm-3.3-r3/work/llvm-3.3.src-amd64/tools/llvm-rtdyld' make[1]: Leaving directory `/var/tmp/portage/sys-devel/llvm-3.3-r3/work/llvm-3.3.src-amd64/tools' make: *** [all] Error 1 * ERROR: sys-devel/llvm-3.3-r3::gentoo failed (compile phase): * emake failed ...
I was also using -mtune=atom.
*** Bug 505180 has been marked as a duplicate of this bug. ***
Created attachment 374428 [details] minimal c++ program to trigger the gcc bug from piotr5@netscape.net From original bug report (#505180): (piotr5 from comment #0) > Created attachment 373112 [details] > minimal c++ program to trigger the gcc bug > > g++ segfaults during compilation of tools/llvm-readobj/Error.cpp > seems to be a bug in the compiler, gcc-4.8.2 doesn't have that problem, so I > guess it's fixed upstream (or has been fixed in the total rewrite of gcc). > test this bug in your own gcc-version (with the sources attached): > > gcc -O -march=atom -c Error.cpp -o Error.o -fexpensive-optimizations > -freorder-blocks > > solution would be to either make gcc-4.8.2 the standard compiler by removing > the ~amd64 mask, or warn 64-bit users about this bug...
Adding toolchain for comment #13 (minimal cpp test file crashes g++)
*** Bug 507308 has been marked as a duplicate of this bug. ***
Marking confirmed per the multiple reports (thanks everyone for your investigations). Apparently this is limited to gcc 4.7? 4.8 (.1 and .2) has been reported to work fine
This looks very familiar but I can't seem to track it down at the moment.
I am currently seeing a very similar error in llvm-3.3-r3 on an atom based system with -march=native on amd64 platform, using gcc-4.7.3, but the segfault occurs in /var/tmp/portage/sys-devel/llvm-3.3-r3/work/llvm-3.3.src/tools/llvm-readobj/Error.cpp:49:1: internal compiler error: Segmentation fault I asked on http://forums.gentoo.org/viewtopic-t-989070.html but then I found this bug entry (afterwards). Just removing the -march=native in CFLAGS makes the problem go away.
Same error on Atom N450 architecture, but on Error.cpp file (as reported by Jens and in forum topic 989070). Like the above cases, compilation succeeds when removing "-march=atom" from make.conf just for that LLVM package. Gcc version : 4.7.3.
similar error on a hardened amd64 build. I'm using atom N2800. if x86_64-pc-linux-gnu-g++ -I/var/tmp/portage/sys-devel/llvm-3.3-r3/work/llvm-3.3.src-abi_x86_64.amd64/include -I/var/tmp/portage/sys-devel/llvm-3.3-r3/work/llvm-3.3.src-abi_x86_64.amd64/li b/IR -I/var/tmp/portage/sys-devel/llvm-3.3-r3/work/llvm-3.3.src/include -I/var/tmp/portage/sys-devel/llvm-3.3-r3/work/llvm-3.3.src/lib/IR -DNDEBUG -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D_ _STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -fvisibility-inlines-hidden -fno-exceptions -fPIC -Woverloaded-virtual -Wcast-qual -O2 -pipe -march=atom -O2 -pipe -march=atom -O2 -pipe -march=at om -I/usr/lib64/libffi-3.0.13/include -pedantic -Wno-long-long -Wall -W -Wno-unused-parameter -Wwrite-strings -Wno-maybe-uninitialized -Wno-missing-field-initializers -c -MMD -MP -MF "/ var/tmp/portage/sys-devel/llvm-3.3-r3/work/llvm-3.3.src-abi_x86_64.amd64/lib/IR/Release/Constants.d.tmp" -MT "/var/tmp/portage/sys-devel/llvm-3.3-r3/work/llvm-3.3.src-abi_x86_64.amd64/lib/IR /Release/Constants.o" -MT "/var/tmp/portage/sys-devel/llvm-3.3-r3/work/llvm-3.3.src-abi_x86_64.amd64/lib/IR/Release/Constants.d" /var/tmp/portage/sys-devel/llvm-3.3-r3/work/llvm-3.3.src/lib/ IR/Constants.cpp -o /var/tmp/portage/sys-devel/llvm-3.3-r3/work/llvm-3.3.src-abi_x86_64.amd64/lib/IR/Release/Constants.o ; \ then /bin/mv -f "/var/tmp/portage/sys-devel/llvm-3.3-r3/work/llvm-3.3.src-abi_x86_64.amd64/lib/IR/Release/Constants.d.tmp" "/var/tmp/portage/sys-devel/llvm-3.3-r3/work/llvm-3.3.src-a bi_x86_64.amd64/lib/IR/Release/Constants.d"; else /bin/rm "/var/tmp/portage/sys-devel/llvm-3.3-r3/work/llvm-3.3.src-abi_x86_64.amd64/lib/IR/Release/Constants.d.tmp"; exit 1; fi /var/tmp/portage/sys-devel/llvm-3.3-r3/work/llvm-3.3.src/lib/IR/Constants.cpp: In static member function ‘static llvm::Constant* llvm::ConstantExpr::getCast(unsigned int, llvm::Constant*, llm::Type*)’: /var/tmp/portage/sys-devel/llvm-3.3-r3/work/llvm-3.3.src/lib/IR/Constants.cpp:1467:1: internal compiler error: Segmentation fault emerge --info Portage 2.2.8-r1 (hardened/linux/amd64, gcc-4.7.3, glibc-2.17, 3.13.10-momoka x86_64) ================================================================= System uname: Linux-3.13.10-momoka-x86_64-Intel-R-_Atom-TM-_CPU_N2800_@_1.86GHz-with-gentoo-2.2 KiB Mem: 3067264 total, 464356 free KiB Swap: 6291452 total, 6291320 free Timestamp of tree: Mon, 09 Jun 2014 17:30:01 +0000 ld GNU ld (GNU Binutils) 2.23.2 app-shells/bash: 4.2_p45 dev-lang/python: 2.7.6, 3.3.3 dev-util/cmake: 2.8.12.2 dev-util/pkgconfig: 0.28 sys-apps/baselayout: 2.2 sys-apps/openrc: 0.12.4 sys-apps/sandbox: 2.6-r1 sys-devel/autoconf: 2.69 sys-devel/automake: 1.13.4 sys-devel/binutils: 2.23.2 sys-devel/gcc: 4.7.3-r1 sys-devel/gcc-config: 1.7.3 sys-devel/libtool: 2.4.2 sys-devel/make: 3.82-r4 sys-kernel/linux-headers: 3.13 (virtual/os-headers) sys-libs/glibc: 2.17 Repositories: gentoo cirno ACCEPT_KEYWORDS="amd64" ACCEPT_LICENSE="* -@EULA" CBUILD="x86_64-pc-linux-gnu" CFLAGS="-O2 -pipe -march=atom" CHOST="x86_64-pc-linux-gnu" CONFIG_PROTECT="/etc /usr/share/gnupg/qualified.txt" CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release /etc/sandbox.d /etc/terminfo" CXXFLAGS="-O2 -pipe -march=atom" DISTDIR="/opt/portage/distfiles" FCFLAGS="-O2 -pipe" FEATURES="assume-digests binpkg-logs buildpkg candy config-protect-if-modified distlocks ebuild-locks fixlafiles merge-sync news nodoc noinfo parallel-fetch preserve-libs protect-owned sandb ox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync xattr" FFLAGS="-O2 -pipe" GENTOO_MIRRORS="http://gentoo.leichen-sh.dev.anjuke.com/ http://ftp.jaist.ac.jp/pub/Linux/Gentoo" LANG="en_US.utf8" LDFLAGS="-Wl,-O1 -Wl,--as-needed" MAKEOPTS="-j1" PKGDIR="/opt/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 --e xclude=/local --exclude=/packages" PORTAGE_TMPDIR="/var/tmp" PORTDIR="/usr/portage" PORTDIR_OVERLAY="/var/lib/layman/cirno" SYNC="rsync://leichen-sh.dev.anjuke.com/gentoo-portage" USE="X acl amd64 bash-completion berkdb bzip2 cli cracklib crypt cxx dri gdbm gif hardened iconv ipv6 jbig jpeg jpeg2k justify mmx modules multilib ncurses nls nptl openmp pam pax_kernel pcr e png readline session sse sse2 ssl tcpd tiff unicode urandom xinerama xtpax zlib" ABI_X86="64" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 e s1938 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 a uthn_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 di sk_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 vhos t_alias" CALLIGRA_FEATURES="kexi words flow plan sheets stage tables krita karbon braindump author" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" ELIBC=" glibc" GPSD_PROTOCOLS="ashtech aivdm earthmate evermore fv18 garmin garmintxt gpsclock itrax mtk3301 nmea ntrip navcom oceanserver oldstyle oncore rtcm104v2 rtcm104v3 sirf superstar2 timing tsip tripmate tnt ublox ubx" GRUB_PLATFORMS="pc" INPUT_DEVICES="evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIO NS="presenter-console presenter-minimizer" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-5" PYTHON_SINGLE_TARGET="python2_7" PYTHON_TARGETS="python2_7 python3_3" RUBY_TARGETS="ruby19 ruby20" USERLAND="GNU" VIDEO_CARDS="intel i915 vesa fbdev" 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" USE_PYTHON="2.7 3.3" Unset: CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS
*** Bug 510986 has been marked as a duplicate of this bug. ***
Version long gone.