Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 487584 - =sys-devel/llvm-3.3-r1[clang] - llvm-3.3.src/projects/compiler-rt/lib/msan/msan_linux.cc:20:10: fatal error: 'algorithm' file not found
Summary: =sys-devel/llvm-3.3-r1[clang] - llvm-3.3.src/projects/compiler-rt/lib/msan/ms...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: AMD64 Linux
: Normal normal (vote)
Assignee: Bernard Cafarelli
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-10-11 00:47 UTC by Captain Crutches
Modified: 2013-10-13 07:34 UTC (History)
3 users (show)

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


Attachments
Build log (build.log.tar.gz,3.19 KB, application/x-gzip)
2013-10-11 22:33 UTC, Captain Crutches
Details
Build log (llvm-build.log.gz,116.54 KB, application/x-gzip)
2013-10-12 10:33 UTC, Chris Kerr
Details
Build.log (should be readable now) (build.log.tar.gz,119.50 KB, application/x-gzip)
2013-10-12 15:55 UTC, Captain Crutches
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Captain Crutches 2013-10-11 00:47:20 UTC
When trying to emerge sys-devel/llvm-3.3-r1 with the clang USE flag enabled, it fails with this error, seemingly unable to find a standard C++ header:

COMPILE:   clang_linux/msan-x86_64/x86_64: /var/tmp/portage/sys-devel/llvm-3.3-r1/work/llvm-3.3.src/projects/compiler-rt/lib/msan/msan_report.cc
/var/tmp/portage/sys-devel/llvm-3.3-r1/work/llvm-3.3.src-amd64/Release/bin/clang -fno-exceptions -fPIC -funwind-tables -I/var/tmp/portage/sys-devel/llvm-3.3-r1/work/llvm-3.3.src/projects/compiler-rt/lib -I/var/tmp/portage/sys-devel/llvm-3.3-r1/work/llvm-3.3.src/projects/compiler-rt/include -Wall -Werror -O3 -fomit-frame-pointer -m64 -fPIE -fno-builtin -fno-rtti -c -o /var/tmp/portage/sys-devel/llvm-3.3-r1/work/llvm-3.3.src-amd64/tools/clang/runtime/compiler-rt/clang_linux/msan-x86_64/x86_64/SubDir.lib__msan/msan_report.o /var/tmp/portage/sys-devel/llvm-3.3-r1/work/llvm-3.3.src/projects/compiler-rt/lib/msan/msan_report.cc
/var/tmp/portage/sys-devel/llvm-3.3-r1/work/llvm-3.3.src/projects/compiler-rt/lib/msan/msan_linux.cc:20:10: fatal error: 'algorithm' file not found
#include <algorithm>
         ^

Builds just fine without the clang USE flag, and llvm-9999 builds fine with it.

Reproducible: Always

Steps to Reproduce:
1. emerge =sys-devel/llvm-3.3-r1 with clang USE flag
Actual Results:  
Build fails, see error in description

Expected Results:  
Package builds and installs properly

emerge --info

Portage 2.3.6-r5 (funtoo/1.0/linux-gnu/arch/x86-64bit, gcc-4.6.4, glibc-2.15-r4, 3.11.3-hardened x86_64)
=================================================================
System uname: Linux-3.11.3-hardened-x86_64-Intel-R-_Core-TM-_i7-3930K_CPU_@_3.20GHz-with-gentoo-2.2.0
KiB Mem:    65957488 total,  20238060 free
KiB Swap:    2283348 total,   2283348 free
Timestamp of tree: Thu, 10 Oct 2013 11:15:01 +0000
ld GNU ld (GNU Binutils) 2.22
app-shells/bash:          4.2_p45-r1
dev-java/java-config:     2.2.0-r1000
dev-lang/python:          2.7.5-r1000, 3.3.2-r1000
dev-util/cmake:           2.8.11.2
sys-apps/baselayout:      2.2.0-r4
sys-apps/openrc:          0.10.3-r1
sys-apps/sandbox:         2.6-r1
sys-devel/autoconf:       2.13, 2.69
sys-devel/automake:       1.11.6, 1.12.6, 1.13.4
sys-devel/binutils:       2.22-r1
sys-devel/gcc:            4.6.4-r2
sys-devel/gcc-config:     1.8
sys-devel/libtool:        2.4.2
sys-devel/make:           3.82-r4
sys-kernel/linux-headers: 3.4-r2 (virtual/os-headers)
sys-libs/glibc:           2.15-r4
Repositories: gentoo steam-overlay
ACCEPT_KEYWORDS="amd64 ~amd64"
ACCEPT_LICENSE="* -@EULA"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=corei7 -O2 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/config /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/revdep-rebuild /etc/sandbox.d /etc/terminfo /etc/udev/rules.d"
CXXFLAGS="-march=corei7 -O2 -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="assume-digests binpkg-logs config-protect-if-modified distlocks ebuild-locks fixlafiles merge-sync news parallel-fetch preserve-libs protect-owned sandbox sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch"
FFLAGS=""
GENTOO_MIRRORS="http://distfiles.gentoo.org"
LANG="en_US.UTF-8"
LDFLAGS="-Wl,-O1 -Wl,--sort-common -Wl,--as-needed"
MAKEOPTS="-j13"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
PORTDIR_OVERLAY="/var/lib/layman/steam"
SYNC="git://github.com/funtoo/ports-2012.git"
SYNC_USER="root"
USE="3ds X a52 aac aalib acl aften alsa amd64 apng audiofile berkdb bzip2 cairo canna caps cdda cdr center-tilde cgi cjk collada consolekit cracklib crypt css cups cxx dbus dds dga directx dri dv dvd dvdr dvdread exif faac faad fbcon ffmpeg flac fortran ftp gd gdbm ggi gif gimp glib gphoto2 gpm gsl gsm gstreamer gtk handbood hdf5 iconv icu imagemagick ipv6 jabber java joystick jpeg jpeg2k kde lame libaca libass lua lzma mad matroska matrox midi mikmod mmx mng modules mozilla mp3 mp4 mpeg mplayer mssql mudflap multilib musepack ncurses nls nptl ogg openal opencl openexr opengl openmp orc pam pch pcre pdf perl php plasma png policykit postscript pppd pulseaudio python qt4 quicktime raw readline resolvconf rss ruby samba sdl semantic-desktop shorten smpeg sndfile sound speex sqlite sqlite3 sse sse2 ssl svg tcl tcpd theora threads tiff tk truetype udev unicode usb v4l vcd videos vorbis wav wavpack wifi win32codecs wmf x264 xine xinerama xml xpm xv xvid zlib" ABI_X86="64" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801 hda-intel ice1724 intel8x0 intel8x0m maestro3 trident usb-audio via82xx via82xx-modem ymfpci" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="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 authn_core authz_core socache_shmcb unixd" 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 ubx" GRUB_PLATFORMS="pc" INPUT_DEVICES="evdev synaptics keyboard mouse" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" LIBREOFFICE_EXTENSIONS="presenter-console presenter-minimizer" OFFICE_IMPLEMENTATION="libreoffice" PHP_TARGETS="php5-5" PYTHON_ABIS="2.7 3.3" PYTHON_SINGLE_TARGET="python2_7" PYTHON_TARGETS="python2_7 python3_3" QEMU_SOFTMMU_TARGETS="i386 x86_64" QEMU_USER_TARGETS="i386 x86_64" RUBY_TARGETS="ruby18 ruby19 ruby20" USERLAND="GNU" VIDEO_CARDS="fglrx" 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"
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, INSTALL_MASK, LC_ALL, LINGUAS, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, SYNC_UMASK
Comment 1 Jeroen Roovers (RETIRED) gentoo-dev 2013-10-11 14:56:30 UTC
Please attach the entire build log to this bug report.
Comment 2 Captain Crutches 2013-10-11 22:33:44 UTC
Created attachment 360674 [details]
Build log
Comment 3 Captain Crutches 2013-10-11 22:34:30 UTC
Done.  Tried to attach it when I first filed the bug, but at 3.1 MB it was over the size limit.  Zipped to make it small enough to attach.
Comment 4 Chris Kerr 2013-10-12 10:33:42 UTC
Created attachment 360684 [details]
Build log

I have the same problem on a different toolchain, attaching my build.log for comparison.
Comment 5 Tom Wijsman (TomWij) (RETIRED) gentoo-dev 2013-10-12 12:04:06 UTC
Can't open the first build log, feel free to upload again.
Comment 6 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2013-10-12 13:08:33 UTC
This has been brought to my attention on IRC already and it's an issue within Funtoo's gcc install.

Gentoo installs C++ headers into:

  /usr/lib/gcc/x86_64-pc-linux-gnu/4.8.1/include/g++-v4

Funtoo installs them into:

  /usr/lib/gcc/x86_64-pc-linux-gnu/4.8.1/include/g++-v4.8

With clang looking for them in the former location only.

Please either fix Funtoo to use the same path as Gentoo does, or ask upstream to add support for your location. In either case, you are on the wrong Bugzilla.
Comment 7 Chris Kerr 2013-10-12 13:16:31 UTC
That's not the case - my C++ headers are in g++-v4

~ # ls /usr/lib/gcc/x86_64-pc-linux-gnu/4.8.0/include/g++-v4
algorithm  bitset    cfenv      climits    condition_variable  cstdbool  cstring  cxxabi.h   ext           future            ios       java    map      org       random            sstream    sun           tr2          unordered_map  x86_64-pc-linux-gnu
array      cassert   cfloat     clocale    csetjmp             cstddef   ctgmath  debug      fenv.h        gcj               iosfwd    javax   memory   ostream   ratio             stack      system_error  tuple        unordered_set
atomic     ccomplex  chrono     cmath      csignal             cstdint   ctime    decimal    forward_list  gnu               iostream  limits  mutex    parallel  regex             stdexcept  tgmath.h      type_traits  utility
backward   cctype    cinttypes  complex    cstdalign           cstdio    cwchar   deque      fstream       initializer_list  istream   list    new      profile   scoped_allocator  streambuf  thread        typeindex    valarray
bits       cerrno    ciso646    complex.h  cstdarg             cstdlib   cwctype  exception  functional    iomanip           iterator  locale  numeric  queue     set               string     tr1           typeinfo     vector
Comment 8 Chris Kerr 2013-10-12 13:23:27 UTC
However GCC 4.8.1 does install in g++-v4.8 ... confusing
Comment 9 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2013-10-12 15:52:18 UTC
(In reply to Chris Kerr from comment #7)
> That's not the case - my C++ headers are in g++-v4

Your 'emerge --info' then, please. If you could, I'd really appreciate the output of the failing clang invocation with '--verbose' added. If you didn't delete the build tree, that would be:

/var/tmp/portage/sys-devel/llvm-3.3-r1/work/llvm-3.3.src-amd64/Release/bin/clang --verbose -fno-exceptions -fPIC -funwind-tables -I/var/tmp/portage/sys-devel/llvm-3.3-r1/work/llvm-3.3.src/projects/compiler-rt/lib -I/var/tmp/portage/sys-devel/llvm-3.3-r1/work/llvm-3.3.src/projects/compiler-rt/include -Wall -Werror -O3 -fomit-frame-pointer -m64 -fPIE -fno-builtin -fno-rtti -c -o /var/tmp/portage/sys-devel/llvm-3.3-r1/work/llvm-3.3.src-amd64/tools/clang/runtime/compiler-rt/clang_linux/msan-x86_64/x86_64/SubDir.lib__msan/msan_linux.o /var/tmp/portage/sys-devel/llvm-3.3-r1/work/llvm-3.3.src/projects/compiler-rt/lib/msan/msan_linux.cc

(current directory doesn't matter)
Comment 10 Captain Crutches 2013-10-12 15:55:49 UTC
Created attachment 360716 [details]
Build.log (should be readable now)

(In reply to Tom Wijsman (TomWij) from comment #5)
> Can't open the first build log, feel free to upload again.

Here you go, should be fixed now.
Comment 11 Captain Crutches 2013-10-12 15:59:34 UTC
(In reply to Michał Górny from comment #6)
> This has been brought to my attention on IRC already and it's an issue
> within Funtoo's gcc install.
> 
> Gentoo installs C++ headers into:
> 
>   /usr/lib/gcc/x86_64-pc-linux-gnu/4.8.1/include/g++-v4
> 
> Funtoo installs them into:
> 
>   /usr/lib/gcc/x86_64-pc-linux-gnu/4.8.1/include/g++-v4.8
> 
> With clang looking for them in the former location only.
> 
> Please either fix Funtoo to use the same path as Gentoo does, or ask
> upstream to add support for your location. In either case, you are on the
> wrong Bugzilla.

Hmm, interesting.  Okay, thanks!
Comment 12 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2013-10-12 16:03:22 UTC
(In reply to Chris Kerr from comment #8)
> However GCC 4.8.1 does install in g++-v4.8 ... confusing

Er, that's weird. My gcc 4.8.1 is in g++-v4. Are you using regular Gentoo?
Comment 13 Chris Kerr 2013-10-12 16:48:32 UTC
It worked after upgrading to GCC 4.8.1 and following the instructions on the bugs.funtoo.org bug. Since GCC 4.8.0 is no longer in portage there is no point working out why it didn't work for me.
Comment 14 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2013-10-12 17:26:48 UTC
Ok, since the issue was fixed upstream, I will backport the patch to 3.3-r1.
Comment 15 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2013-10-13 07:34:36 UTC
+  13 Oct 2013; Michał Górny <mgorny@gentoo.org>
+  +files/clang-3.3-gcc-header-path.patch, llvm-3.3-r1.ebuild:
+  Backport g++-X.Y header location support. Fixes bug #487584.

I did that without revbump since the issue exhibited itself during build-time.