Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 398391 - sys-devel/llvm-3.0: gold EPREFIX "fix" breaks clean install
Summary: sys-devel/llvm-3.0: gold EPREFIX "fix" breaks clean install
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Development (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Bernard Cafarelli
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-01-10 13:58 UTC by Rafał Mużyło
Modified: 2012-02-03 13:12 UTC (History)
1 user (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Rafał Mużyło 2012-01-10 13:58:28 UTC
If llvm isn't already installed and is being built with gold useflags, lvm fails to build.

Simply removing $(SharedLibDir) sed line fixes the problem.

The exact failure is:
llvm[2]: Linking Release Loadable Module LLVMgold.so
i686-pc-linux-gnu-g++ -I/mnt/workbox/builds/portage/sys-devel/llvm-3.0/work/llvm
-3.0.src/include -I/mnt/workbox/builds/portage/sys-devel/llvm-3.0/work/llvm-3.0.
src/tools/gold  -DNDEBUG -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS   -fno-exceptions -fPIC -Woverloaded-virtual -Wcast-qual -O2 -march=athlon -mtune=athlon -pipe -I/usr/include/ -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 /usr/lib/llvm/libLTO.so  -Wl,-R -Wl,'$ORIGIN' -L/mnt/workbox/builds/portage/sys-devel/llvm-3.0/work/llvm-3.0.src/Release/lib -L/mnt/workbox/builds/portage/sys-devel/llvm-3.0/work/llvm-3.0.src/Release/lib -Wl,-O1 -Wl,--as-needed -Wl,--sort-common -Wl,-z,relro -Wl,-O1 -Wl,--as-needed -Wl,--sort-common -Wl,-z,relro -Wl,-O1 -Wl,--as-needed -Wl,--sort-common -Wl,-z,relro -Wl,-O1 -Wl,--as-needed -Wl,--sort-common -Wl,-z,relro -Wl,-O1 -Wl,--as-needed -Wl,--sort-common -Wl,-z,relro -Wl,-O1 -Wl,--as-needed -Wl,--sort-common -Wl,-z,relro   -pedantic -Wno-long-long -Wall -W -Wno-unused-parameter -Wwrite-strings    -shared -o /mnt/workbox/builds/portage/sys-devel/llvm-3.0/work/llvm-3.0.src/Release/lib/LLVMgold.so /mnt/workbox/builds/portage/sys-devel/llvm-3.0/work/llvm-3.0.src/tools/gold/Release/gold-plugin.o \
   -lLLVM-3.0 -Wl,--version-script,/mnt/workbox/builds/portage/sys-devel/llvm-3.0/work/llvm-3.0.src/tools/gold/Release/gold.exports.map -lpthread -lffi -ldl -lm
i686-pc-linux-gnu-g++: /usr/lib/llvm/libLTO.so: No such file or directory.

Obviously, on a rebuild, the failure is irreproducible, as the needed file is already installed.
Comment 1 Fabian Groffen gentoo-dev 2012-01-10 19:38:06 UTC
I suspect SharedLibDir is empty in this case, so we force it to be something.  We'd have to patch the "source" of SharedLibDir.
Comment 2 Rafał Mużyło 2012-01-11 02:29:16 UTC
Well, after removing that block, the command line looks like this:
i686-pc-linux-gnu-g++ -I/mnt/workbox/builds/portage/sys-devel/llvm-3.0/work/llvm-3.0.src/include -I/mnt/workbox/builds/portage/sys-devel/llvm-3.0/work/llvm-3.0.src/tools/gold  -DNDEBUG -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS   -fno-exceptions -fPIC -Woverloaded-virtual -Wcast-qual -O2 -march=athlon -mtune=athlon -pipe -I/usr/include/ -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 /mnt/workbox/builds/portage/sys-devel/llvm-3.0/work/llvm-3.0.src/Release/lib/libLTO.so  -Wl,-R -Wl,'$ORIGIN' -L/mnt/workbox/builds/portage/sys-devel/llvm-3.0/work/llvm-3.0.src/Release/lib -L/mnt/workbox/builds/portage/sys-devel/llvm-3.0/work/llvm-3.0.src/Release/lib -Wl,-O1 -Wl,--as-needed -Wl,--sort-common -Wl,-z,relro -Wl,-O1 -Wl,--as-needed -Wl,--sort-common -Wl,-z,relro -Wl,-O1 -Wl,--as-needed -Wl,--sort-common -Wl,-z,relro -Wl,-O1 -Wl,--as-needed -Wl,--sort-common -Wl,-z,relro -Wl,-O1 -Wl,--as-needed -Wl,--sort-common -Wl,-z,relro -Wl,-O1 -Wl,--as-needed -Wl,--sort-common -Wl,-z,relro   -pedantic -Wno-long-long -Wall -W -Wno-unused-parameter -Wwrite-strings    -shared -o /mnt/workbox/builds/portage/sys-devel/llvm-3.0/work/llvm-3.0.src/Release/lib/LLVMgold.so /mnt/workbox/builds/portage/sys-devel/llvm-3.0/work/llvm-3.0.src/tools/gold/Release/gold-plugin.o \
   -lLLVM-3.0 -Wl,--version-script,/mnt/workbox/builds/portage/sys-devel/llvm-3.0/work/llvm-3.0.src/tools/gold/Release/gold.exports.map -lpthread -lffi -ldl -lm

so the difference is exactly the path to the just built lib, instead of the one in the live system.
Comment 3 Rafał Mużyło 2012-01-18 18:57:13 UTC
Well, on the other hand, it seems that removing $(SharedLibDir) sed line instead prepends ${WORKDIR} to LLVMgold.so rpath.
So it comes down to adding proper ${DESTDIR} support to llvm build system.

Might be quite tricky.
Comment 4 Fabian Groffen gentoo-dev 2012-01-19 07:56:28 UTC
(In reply to comment #3)
> Well, on the other hand, it seems that removing $(SharedLibDir) sed line
> instead prepends ${WORKDIR} to LLVMgold.so rpath.
> So it comes down to adding proper ${DESTDIR} support to llvm build system.
> 
> Might be quite tricky.

I absolutely concur with that.  Hence the hacking with install_names, iso a proper fix.
Comment 5 Bernard Cafarelli gentoo-dev 2012-02-03 13:12:16 UTC
Luckily for us, the patch is simple and it is in upstream SVN:
http://llvm.org/viewvc/llvm-project?view=rev&revision=145095

This is now in 3.0-1 (9999 is OK), thanks for the report!