There seems to be a trivial bug in the Darwin-specific section of this build: --- /opt/gentoo/portage/../usr/portage/sys-devel/llvm/llvm-3.4.ebuild 2014-02-16 06:32:00.000000000 +0000 +++ /opt/gentoo/portage/../usr/portage/local/overlay/sys-devel/llvm/llvm-3.4.ebuild 2014-03-10 00:10:45.000000000 +0000 @@ -433,7 +433,7 @@ # to just fix this, so we correct it post-install local lib= f= odylib= libpv=${PV} if [[ ${CHOST} == *-darwin* ]] ; then - eval $(grep PACKAGE_VERSION= configure) + eval $(grep 'PACKAGE_VERSION=' "${WORKDIR}"/llvm-${PV}/configure) [[ -n ${PACKAGE_VERSION} ]] && libpv=${PACKAGE_VERSION} for lib in lib{EnhancedDisassembly,LLVM-${libpv},LTO,profile_rt,clang}.dylib LLVMHello.dylib ; do # libEnhancedDisassembly is Darwin10 only, so non-fatal ... which allows grep to find PACKAGE_VERSION from the configure script (although this should equal $PV regardless, so there should be no effect other than grep now succeeding) - but then the build fails during installation with: >>> Completed installing llvm-3.4 into /opt/gentoo/var/tmp/portage/sys-devel/llvm-3.4/image/ ecompressdir: bzip2 -9 /usr/share/doc ecompressdir: bzip2 -9 /usr/share/man * QA Notice: invalid self-reference install_name /opt/gentoo/var/tmp/portage/sys-devel/llvm-3.4/work/llvm-3.4-default/Release/lib/clang/3.4/lib/darwin/libclang_rt.asan_iossim_dynamic.dylib in /opt/gentoo/usr/lib/clang/3.4/lib/darwin/libclang_rt.asan_iossim_dynamic.dylib * QA Notice: invalid self-reference install_name /opt/gentoo/var/tmp/portage/sys-devel/llvm-3.4/work/llvm-3.4-default/Release/lib/clang/3.4/lib/darwin/libclang_rt.asan_iossim_dynamic.dylib in /opt/gentoo/usr/lib/clang/3.4/lib/darwin/libclang_rt.asan_iossim_dynamic.dylib * QA Notice: invalid self-reference install_name /opt/gentoo/var/tmp/portage/sys-devel/llvm-3.4/work/llvm-3.4-default/Release/lib/clang/3.4/lib/darwin/libclang_rt.asan_osx_dynamic.dylib in /opt/gentoo/usr/lib/clang/3.4/lib/darwin/libclang_rt.asan_osx_dynamic.dylib * QA Notice: invalid self-reference install_name /opt/gentoo/var/tmp/portage/sys-devel/llvm-3.4/work/llvm-3.4-default/Release/lib/clang/3.4/lib/darwin/libclang_rt.asan_osx_dynamic.dylib in /opt/gentoo/usr/lib/clang/3.4/lib/darwin/libclang_rt.asan_osx_dynamic.dylib * ERROR: sys-devel/llvm-3.4 failed: * invalid install_name found, your application or library will crash at runtime * * Call stack: * misc-functions.sh, line 1925: Called install_qa_check * misc-functions.sh, line 307: Called install_qa_check_macho * misc-functions.sh, line 1135: Called die * The specific snippet of code: * has allow_broken_install_names ${FEATURES} || \ * die "invalid install_name found, your application or library will crash at runtime" *
emerge --info: $ MAKEOPTS="-j1" USE="clang multitarget xml" emerge --info '=sys-devel/llvm-3.4' Portage 2.2.8-prefix (prefix/darwin/macos/10.9/x64, gcc-4.2.1, unavailable, 13.1.0 x86_64) ================================================================= System Settings ================================================================= System uname: Darwin-13.1.0-x86_64-i386-64bit Timestamp of tree: Sat, 08 Mar 2014 11:36:26 +0000 app-shells/bash: 4.2_p45-r1 dev-lang/python: 2.7.5-r4, 3.3.3 dev-util/cmake: 2.8.12.2 dev-util/pkgconfig: 0.28 sys-devel/autoconf: 2.69 sys-devel/automake: 1.14 sys-devel/gcc-config: 1.8-r00.1 sys-devel/libtool: 2.4.2 sys-devel/make: 4.0-r1 Repositories: gentoo_prefix srcshelton ACCEPT_KEYWORDS="x64-macos ~x64-macos" ACCEPT_LICENSE="* -@EULA" CBUILD="x86_64-apple-darwin13" CFLAGS="-march=core2 -msse4.2 -mssse3 -O2 -pipe" CHOST="x86_64-apple-darwin13" CONFIG_PROTECT="/etc" CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/env.d /etc/gconf /etc/gentoo-release /etc/revdep-rebuild /etc/terminfo" CXXFLAGS="-march=core2 -msse4.2 -mssse3 -O2 -pipe" DISTDIR="/opt/gentoo/usr/portage/distfiles" FCFLAGS="" FEATURES="assume-digests binpkg-logs collision-protect config-protect-if-modified distlocks ebuild-locks fixlafiles force-prefix merge-sync news nostrip parallel-fetch preserve-libs protect-owned sfperms strict unknown-features-warn unmerge-logs unmerge-orphans userfetch userpriv usersandbox usersync" FFLAGS="" GENTOO_MIRRORS="http://distfiles.gentoo.org" LDFLAGS="-Wl,-dead_strip_dylibs" MAKEOPTS="-j1" PKGDIR="/opt/gentoo/usr/portage/packages" PORTAGE_CONFIGROOT="/opt/gentoo/" 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" PORTAGE_TMPDIR="/opt/gentoo/var/tmp" PORTDIR="/opt/gentoo/usr/portage" PORTDIR_OVERLAY="/opt/gentoo/usr/portage/local/overlay" USE="aqua berkdb bzip2 clang coreaudio cracklib crypt cxx gdbm icu idn ipv6 libedit lzma mmx mmxext modules multitarget ncurses nls objc objc++ pcre prefix python readline sqlite sse sse2 ssl unicode x64-macos xml zlib" 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="kexi words flow plan sheets stage tables krita karbon braindump author" CAMERAS="ptp2" COLLECTD_PLUGINS="df interface irq load memory rrdtool swap syslog" ELIBC="Darwin" 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" INPUT_DEVICES="keyboard mouse" KERNEL="Darwin" 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_SINGLE_TARGET="python2_7" PYTHON_TARGETS="python2_7 python3_3" RUBY_TARGETS="ruby19 ruby18" USERLAND="GNU" 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, LANG, LC_ALL, PORTAGE_BUNZIP2_COMMAND, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, SYNC, USE_PYTHON ================================================================= Package Settings ================================================================= sys-devel/llvm-3.4 was built with the following: USE="libffi multitarget ncurses (prefix) python static-analyzer xml -clang -debug -doc -gold -ocaml -test -udis86" PYTHON_TARGETS="python2_7 -pypy2_0 -python2_6" VIDEO_CARDS="radeon" CFLAGS="-march=core2 -msse4.2 -mssse3 -O2 -pipe"
Further context: make -j1 -C /opt/gentoo/var/tmp/portage/sys-devel/llvm-3.4/work/llvm-3.4_cmake/cmake/modules DESTDIR=/opt/gentoo/var/tmp/portage/sys-devel/llvm-3.4/image/ install make: Entering directory '/opt/gentoo/var/tmp/portage/sys-devel/llvm-3.4/work/llvm-3.4_cmake/cmake/modules' Install the project... -- Install configuration: "Gentoo" -- Installing: /opt/gentoo/var/tmp/portage/sys-devel/llvm-3.4/image/opt/gentoo/usr/share/llvm/cmake/LLVMConfig.cmake -- Installing: /opt/gentoo/var/tmp/portage/sys-devel/llvm-3.4/image/opt/gentoo/usr/share/llvm/cmake/LLVMConfigVersion.cmake -- Installing: /opt/gentoo/var/tmp/portage/sys-devel/llvm-3.4/image/opt/gentoo/usr/share/llvm/cmake/LLVM-Config.cmake -- Installing: /opt/gentoo/var/tmp/portage/sys-devel/llvm-3.4/image/opt/gentoo/usr/share/llvm/cmake/. -- Installing: /opt/gentoo/var/tmp/portage/sys-devel/llvm-3.4/image/opt/gentoo/usr/share/llvm/cmake/./AddLLVM.cmake -- Installing: /opt/gentoo/var/tmp/portage/sys-devel/llvm-3.4/image/opt/gentoo/usr/share/llvm/cmake/./AddLLVMDefinitions.cmake -- Installing: /opt/gentoo/var/tmp/portage/sys-devel/llvm-3.4/image/opt/gentoo/usr/share/llvm/cmake/./ChooseMSVCCRT.cmake -- Installing: /opt/gentoo/var/tmp/portage/sys-devel/llvm-3.4/image/opt/gentoo/usr/share/llvm/cmake/./GetSVN.cmake -- Installing: /opt/gentoo/var/tmp/portage/sys-devel/llvm-3.4/image/opt/gentoo/usr/share/llvm/cmake/./HandleLLVMOptions.cmake -- Installing: /opt/gentoo/var/tmp/portage/sys-devel/llvm-3.4/image/opt/gentoo/usr/share/llvm/cmake/./LLVMParseArguments.cmake -- Installing: /opt/gentoo/var/tmp/portage/sys-devel/llvm-3.4/image/opt/gentoo/usr/share/llvm/cmake/./LLVMProcessSources.cmake -- Installing: /opt/gentoo/var/tmp/portage/sys-devel/llvm-3.4/image/opt/gentoo/usr/share/llvm/cmake/./TableGen.cmake make: Leaving directory '/opt/gentoo/var/tmp/portage/sys-devel/llvm-3.4/work/llvm-3.4_cmake/cmake/modules' * fixing install_name of libLLVM-3.4.dylib ... [ ok ] * fixing install_name of libLTO.dylib ... [ ok ] * fixing install_name of libclang.dylib ... [ ok ] * fixing install_name of LLVMHello.dylib ... [ ok ] * fixing install_name reference to of FileCheck ... [ ok ] * fixing install_name reference to @rpath/libLLVM-3.4.dylib of bugpoint ... [ ok ] * fixing install_name reference to of c-index-test ... [ ok ] * fixing install_name reference to @rpath/libLLVM-3.4.dylib of clang ... [ ok ] * fixing install_name reference to /opt/gentoo/usr/lib/libLLVM-3.4.dylib of clang++ ... [ ok ] * fixing install_name reference to @rpath/libLLVM-3.4.dylib of clang-apply-replacements ... [ ok ] * fixing install_name reference to @rpath/libLLVM-3.4.dylib of clang-check ... [ ok ] * fixing install_name reference to @rpath/libLLVM-3.4.dylib of clang-format ... [ ok ] * fixing install_name reference to @rpath/libLLVM-3.4.dylib of clang-modernize ... [ ok ] * fixing install_name reference to of clang-tblgen ... [ ok ] * fixing install_name reference to @rpath/libLLVM-3.4.dylib of clang-tidy ... [ ok ] * fixing install_name reference to @rpath/libLLVM-3.4.dylib of llc ... [ ok ] * fixing install_name reference to @rpath/libLLVM-3.4.dylib of lli ... [ ok ] * fixing install_name reference to of lli-child-target ... [ ok ] * fixing install_name reference to @rpath/libLLVM-3.4.dylib of llvm-ar ... [ ok ] * fixing install_name reference to @rpath/libLLVM-3.4.dylib of llvm-as ... [ ok ] * fixing install_name reference to @rpath/libLLVM-3.4.dylib of llvm-bcanalyzer ... [ ok ] * fixing install_name reference to of llvm-config ... [ ok ] * fixing install_name reference to @rpath/libLLVM-3.4.dylib of llvm-cov ... [ ok ] * fixing install_name reference to @rpath/libLLVM-3.4.dylib of llvm-diff ... [ ok ] * fixing install_name reference to @rpath/libLLVM-3.4.dylib of llvm-dis ... [ ok ] * fixing install_name reference to @rpath/libLLVM-3.4.dylib of llvm-dwarfdump ... [ ok ] * fixing install_name reference to @rpath/libLLVM-3.4.dylib of llvm-extract ... [ ok ] * fixing install_name reference to @rpath/libLLVM-3.4.dylib of llvm-link ... [ ok ] * fixing install_name reference to @rpath/libLLVM-3.4.dylib of llvm-mc ... [ ok ] * fixing install_name reference to @rpath/libLLVM-3.4.dylib of llvm-mcmarkup ... [ ok ] * fixing install_name reference to @rpath/libLLVM-3.4.dylib of llvm-nm ... [ ok ] * fixing install_name reference to @rpath/libLLVM-3.4.dylib of llvm-objdump ... [ ok ] * fixing install_name reference to /opt/gentoo/usr/lib/libLLVM-3.4.dylib of llvm-ranlib ... [ ok ] * fixing install_name reference to @rpath/libLLVM-3.4.dylib of llvm-readobj ... [ ok ] * fixing install_name reference to @rpath/libLLVM-3.4.dylib of llvm-rtdyld ... [ ok ] * fixing install_name reference to @rpath/libLLVM-3.4.dylib of llvm-size ... [ ok ] * fixing install_name reference to @rpath/libLLVM-3.4.dylib of llvm-stress ... [ ok ] * fixing install_name reference to @rpath/libLLVM-3.4.dylib of llvm-symbolizer ... [ ok ] * fixing install_name reference to of llvm-tblgen ... [ ok ] * fixing install_name reference to @rpath/libLLVM-3.4.dylib of macho-dump ... [ ok ] * fixing install_name reference to @rpath/libLLVM-3.4.dylib of opt ... [ ok ] * fixing install_name reference to @rpath/libLLVM-3.4.dylib of pp-trace ... [ ok ] * fixing install_name reference to of x86_64-apple-darwin13-llvm-config ... [ ok ] * fixing install_name reference to @rpath/libLLVM-3.4.dylib of libLTO.dylib ... [ ok ] * fixing install_name reference to @rpath/libLLVM-3.4.dylib of libclang.dylib ... [ ok ] * python2_7: running python_inst !!! Section 'gentoo' in repos.conf has name different from repository name 'gentoo_prefix' set inside repository >>> Completed installing llvm-3.4 into /opt/gentoo/var/tmp/portage/sys-devel/llvm-3.4/image/ ecompressdir: bzip2 -9 /usr/share/doc ecompressdir: bzip2 -9 /usr/share/man * QA Notice: invalid self-reference install_name /opt/gentoo/var/tmp/portage/sys-devel/llvm-3.4/work/llvm-3.4-default/Release/lib/clang/3.4/lib/darwin/libclang_rt.asan_iossim_dynamic.dylib in /opt/gentoo/usr/lib/clang/3.4/lib/darwin/libclang_rt.asan_iossim_dynamic.dylib * QA Notice: invalid self-reference install_name /opt/gentoo/var/tmp/portage/sys-devel/llvm-3.4/work/llvm-3.4-default/Release/lib/clang/3.4/lib/darwin/libclang_rt.asan_iossim_dynamic.dylib in /opt/gentoo/usr/lib/clang/3.4/lib/darwin/libclang_rt.asan_iossim_dynamic.dylib * QA Notice: invalid self-reference install_name /opt/gentoo/var/tmp/portage/sys-devel/llvm-3.4/work/llvm-3.4-default/Release/lib/clang/3.4/lib/darwin/libclang_rt.asan_osx_dynamic.dylib in /opt/gentoo/usr/lib/clang/3.4/lib/darwin/libclang_rt.asan_osx_dynamic.dylib * QA Notice: invalid self-reference install_name /opt/gentoo/var/tmp/portage/sys-devel/llvm-3.4/work/llvm-3.4-default/Release/lib/clang/3.4/lib/darwin/libclang_rt.asan_osx_dynamic.dylib in /opt/gentoo/usr/lib/clang/3.4/lib/darwin/libclang_rt.asan_osx_dynamic.dylib * ERROR: sys-devel/llvm-3.4 failed: * invalid install_name found, your application or library will crash at runtime * * Call stack: * misc-functions.sh, line 1925: Called install_qa_check * misc-functions.sh, line 307: Called install_qa_check_macho * misc-functions.sh, line 1135: Called die * The specific snippet of code: * has allow_broken_install_names ${FEATURES} || \ * die "invalid install_name found, your application or library will crash at runtime" *
N.B. Built with MAKEOPTS="-j1", because with the default of -j7, the build process aborts with: llvm[4]: Compiling Indexing.cpp for Release build (PIC) if x86_64-apple-darwin13-g++ -I/opt/gentoo/var/tmp/portage/sys-devel/llvm-3.4/work/llvm-3.4-default/include -I/opt/gentoo/var/tmp/portage/sys-devel/llvm-3.4/work/llvm-3.4-default/tools/clang/tools/libclang -I/opt/gentoo/var/tmp/portage/sys-devel/llvm-3.4/work/llvm-3.4/include -I/opt/gentoo/var/tmp/portage/sys-devel/llvm-3.4/work/llvm-3.4/tools/clang/tools/libclang -DNDEBUG -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/opt/gentoo/var/tmp/portage/sys-devel/llvm-3.4/work/llvm-3.4/tools/clang/tools/libclang/../../include -I/opt/gentoo/var/tmp/portage/sys-devel/llvm-3.4/work/llvm-3.4-default/tools/clang/tools/libclang/../../include -fvisibility-inlines-hidden -fno-exceptions -fno-common -Woverloaded-virtual -Wcast-qual -fno-strict-aliasing -march=core2 -msse4.2 -mssse3 -O2 -pipe -march=core2 -msse4.2 -mssse3 -O2 -pipe -march=core2 -msse4.2 -mssse3 -O2 -pipe -march=core2 -msse4.2 -mssse3 -O2 -pipe -march=core2 -msse4.2 -mssse3 -O2 -pipe -march=core2 -msse4.2 -mssse3 -O2 -pipe -march=core2 -msse4.2 -mssse3 -O2 -pipe -march=core2 -msse4.2 -mssse3 -O2 -pipe -march=core2 -msse4.2 -mssse3 -O2 -pipe -I/opt/gentoo/usr/lib/libffi-3.0.13/include -I/opt/gentoo/usr/lib/libffi-3.0.13/include -m64 -pedantic -Wno-long-long -Wall -W -Wno-unused-parameter -Wwrite-strings -Wno-missing-field-initializers -c -MMD -MP -MF "/opt/gentoo/var/tmp/portage/sys-devel/llvm-3.4/work/llvm-3.4-default/tools/clang/tools/libclang/Release/Indexing.d.tmp" -MT "/opt/gentoo/var/tmp/portage/sys-devel/llvm-3.4/work/llvm-3.4-default/tools/clang/tools/libclang/Release/Indexing.o" -MT "/opt/gentoo/var/tmp/portage/sys-devel/llvm-3.4/work/llvm-3.4-default/tools/clang/tools/libclang/Release/Indexing.d" /opt/gentoo/var/tmp/portage/sys-devel/llvm-3.4/work/llvm-3.4/tools/clang/tools/libclang/Indexing.cpp -o /opt/gentoo/var/tmp/portage/sys-devel/llvm-3.4/work/llvm-3.4-default/tools/clang/tools/libclang/Release/Indexing.o ; \ then /opt/gentoo/bin/mv -f "/opt/gentoo/var/tmp/portage/sys-devel/llvm-3.4/work/llvm-3.4-default/tools/clang/tools/libclang/Release/Indexing.d.tmp" "/opt/gentoo/var/tmp/portage/sys-devel/llvm-3.4/work/llvm-3.4-default/tools/clang/tools/libclang/Release/Indexing.d"; else /opt/gentoo/bin/rm "/opt/gentoo/var/tmp/portage/sys-devel/llvm-3.4/work/llvm-3.4-default/tools/clang/tools/libclang/Release/Indexing.d.tmp"; exit 1; fi /opt/gentoo/var/tmp/portage/sys-devel/llvm-3.4/work/llvm-3.4/Makefile.rules:841: recipe for target 'all' failed make[3]: *** [all] Error 1 make[3]: Leaving directory '/opt/gentoo/var/tmp/portage/sys-devel/llvm-3.4/work/llvm-3.4-default/tools/clang/tools' /opt/gentoo/var/tmp/portage/sys-devel/llvm-3.4/work/llvm-3.4/Makefile.rules:841: recipe for target 'all' failed make[2]: *** [all] Error 1 make[2]: Leaving directory '/opt/gentoo/var/tmp/portage/sys-devel/llvm-3.4/work/llvm-3.4-default/tools/clang' /opt/gentoo/var/tmp/portage/sys-devel/llvm-3.4/work/llvm-3.4/Makefile.rules:900: recipe for target 'clang/.makeall' failed make[1]: *** [clang/.makeall] Error 2 make[1]: Leaving directory '/opt/gentoo/var/tmp/portage/sys-devel/llvm-3.4/work/llvm-3.4-default/tools' /opt/gentoo/var/tmp/portage/sys-devel/llvm-3.4/work/llvm-3.4/Makefile.rules:841: recipe for target 'all' failed make: *** [all] Error 1 make: INTERNAL: Exiting with 1 jobserver tokens available; should be 7! * ERROR: sys-devel/llvm-3.4 failed (compile phase): * emake failed *
there's a patch available in https://bugs.gentoo.org/show_bug.cgi?id=503220 that and some other things are available in my overlay too https://github.com/fishman/timebomb-gentoo-osx-overlay i'm currently using clang 3.4 for a project i'm working on, but there are actually a few issues you need to work around if you do things this way
I believe this is fixed as I compiled 3.4 and 3.5 in order to bootstrap today.