Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 494922 - sys-devel/llvm-9999 - ld: cannot find -lLTO
Summary: sys-devel/llvm-9999 - ld: cannot find -lLTO
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-12-21 05:14 UTC by Robert
Modified: 2013-12-24 20:07 UTC (History)
2 users (show)

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


Attachments
build.log.bz2 (build.log.bz2,153.92 KB, application/x-bzip)
2013-12-21 05:14 UTC, Robert
Details
output of emerge --info (emerge-info.txt,7.29 KB, text/plain)
2013-12-21 05:14 UTC, Robert
Details
emerge -pqv output (emerge-pqv.txt,346 bytes, text/plain)
2013-12-21 05:14 UTC, Robert
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Robert 2013-12-21 05:14:02 UTC
Created attachment 365796 [details]
build.log.bz2

I was told my emerge that llvm now has an xml USE flag so I decided to try to compile it but for some reason it wont compile. Emerge just fails with this:


/var/tmp/portage/sys-devel/llvm-9999/work/llvm-9999/Makefile.rules:841: recipe for target 'all' failed
make: *** [all] Error 1
 * ERROR: sys-devel/llvm-9999::gentoo failed (compile phase):
 *   emake failed


and the build log seems to be about the same. I had to compress the build log because it fails near what would have been the end of the compilation of llvm.
Comment 1 Robert 2013-12-21 05:14:29 UTC
Created attachment 365798 [details]
output of emerge --info
Comment 2 Robert 2013-12-21 05:14:53 UTC
Created attachment 365800 [details]
emerge -pqv output
Comment 3 Johannes Hirte 2013-12-21 16:27:53 UTC
Looks like llvm needs gcc with LTO support:


x86_64-pc-linux-gnu-g++ -O3 -march=amdfam10 -ftracer -fweb -pipe -O3 -march=amdfam10 -ftracer -fweb -pipe -O3 -march=amdfam10 -ftracer -fweb -pipe -O3 -march=amdfam10 -ftracer -fweb -pipe -O3 -march=amdfam10 -ftracer -fweb -pipe -I/usr/include/ -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O3 -march=amdfam10 -ftracer -fweb -pipe  -Wl,-R -Wl,'$ORIGIN' -rdynamic -L/var/tmp/portage/sys-devel/llvm-9999/work/llvm-9999-amd64/Release/lib -L/var/tmp/portage/sys-devel/llvm-9999/work/llvm-9999-amd64/Release/lib -Wl,-O1 -Wl,--sort-common -Wl,-z,combreloc -O3 -march=amdfam10 -ftracer -fweb -pipe -Wl,-O1 -Wl,--sort-common -Wl,-z,combreloc -O3 -march=amdfam10 -ftracer -fweb -pipe -Wl,-O1 -Wl,--sort-common -Wl,-z,combreloc -O3 -march=amdfam10 -ftracer -fweb -pipe -Wl,-O1 -Wl,--sort-common -Wl,-z,combreloc -O3 -march=amdfam10 -ftracer -fweb -pipe -Wl,-O1 -Wl,--sort-common -Wl,-z,combreloc -O3 -march=amdfam10 -ftracer -fweb -pipe -L/var/tmp/portage/sys-devel/llvm-9999/work/llvm-9999-amd64/Release/lib/lib -Wl,-O1 -Wl,--sort-common -Wl,-z,combreloc -O3 -march=amdfam10 -ftracer -fweb -pipe    -shared -o /var/tmp/portage/sys-devel/llvm-9999/work/llvm-9999-amd64/Release/lib/LLVMgold.so /var/tmp/portage/sys-devel/llvm-9999/work/llvm-9999-amd64/tools/gold/Release/gold-plugin.o \
   -lLLVM-3.5svn -Wl,--version-script,/var/tmp/portage/sys-devel/llvm-9999/work/llvm-9999-amd64/tools/gold/Release/gold.exports.map -ludis86 -lz -lpthread -lffi -lcurses -ldl -lm  -lLTO
/usr/lib/gcc/x86_64-pc-linux-gnu/4.8.2/../../../../x86_64-pc-linux-gnu/bin/ld: error: cannot find -lLTO
collect2: error: ld returned 1 exit status
/var/tmp/portage/sys-devel/llvm-9999/work/llvm-9999/Makefile.rules:1157: recipe for target '/var/tmp/portage/sys-devel/llvm-9999/work/llvm-9999-amd64/Release/lib/LLVMgold.so' failed
make[2]: *** [/var/tmp/portage/sys-devel/llvm-9999/work/llvm-9999-amd64/Release/lib/LLVMgold.so] Error 1
make[2]: Leaving directory '/var/tmp/portage/sys-devel/llvm-9999/work/llvm-9999-amd64/tools/gold'
/var/tmp/portage/sys-devel/llvm-9999/work/llvm-9999/Makefile.rules:900: recipe for target 'gold/.makeall' failed
make[1]: *** [gold/.makeall] Error 2
make[1]: *** Waiting for unfinished jobs....
Comment 4 Robert 2013-12-21 21:11:23 UTC
well I have compiled gcc with USE=lto since 4.5 at least. If this isn't enough to turn on LTO support please tell me what I have to do to get it turned on lol.
Comment 5 Johannes Hirte 2013-12-24 02:36:51 UTC
(In reply to Robert from comment #4)
> well I have compiled gcc with USE=lto since 4.5 at least. If this isn't
> enough to turn on LTO support please tell me what I have to do to get it
> turned on lol.

I was wrong about this. It's not the lto-support in gcc. I've made it work by disabling the gold-linker plugin of llvm (USE="-gold"). And this way I get the following message on install:

>>> Installing (1 of 1) sys-devel/llvm-9999
 * QA Notice: Symbolic link /usr/x86_64-pc-linux-gnu/binutils-bin/lib/bfd-plugins/LLVMgold.so points to /usr/lib64/LLVMgold.so which does not exist.
>>> Auto-cleaning packages...


/usr/x86_64-pc-linux-gnu/binutils-bin/lib/bfd-plugins/LLVMgold.so is a stale symlink, pointing to

ls -l /usr/x86_64-pc-linux-gnu/binutils-bin/lib/bfd-plugins/LLVMgold.so
lrwxrwxrwx 1 root root 29 Dec 24 03:30 /usr/x86_64-pc-linux-gnu/binutils-bin/lib/bfd-plugins/LLVMgold.so -> ../../../../lib64/LLVMgold.so

and belongs to sys-devel/llvm-9999 itself
Comment 6 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2013-12-24 10:11:00 UTC
It seems that it tries to link against system libLTO instead of built one. I will try to fix it later.

The USE=-gold symlink bug fixed.
Comment 7 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2013-12-24 20:07:17 UTC
+  24 Dec 2013; Michał Górny <mgorny@gentoo.org> llvm-9999.ebuild:
+  Fix libLTO linking parallel make issue, bug #494922.