Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 397547 - sys-devel/clang-9999: passes wrong ../lib/LLVMgold.so path to the linker
Summary: sys-devel/clang-9999: passes wrong ../lib/LLVMgold.so path to the linker
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Bernard Cafarelli
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-01-03 21:23 UTC by Michał Górny
Modified: 2012-02-03 14:27 UTC (History)
0 users

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 Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2012-01-03 21:23:34 UTC
As you can see in the snippet below, clang with LTO enabled passes the following to the linker: '-plugin /usr/bin/../lib/LLVMgold.so'; while the LLVMgold.so library is actually installed as ../lib64/llvm/LLVMgold.so.

--
$ clang -v -O4 a.c
clang version 3.1 (trunk)
Target: x86_64-pc-linux-gnu
Thread model: posix
 "/usr/bin/clang" -cc1 -triple x86_64-pc-linux-gnu -emit-llvm-bc -disable-free -disable-llvm-verifier -main-file-name a.c -mrelocation-model static -masm-verbose -mconstructor-aliases -munwind-tables -target-cpu x86-64 -target-linker-version 2.22 -momit-leaf-frame-pointer -v -resource-dir /usr/bin/../lib/clang/3.1 -fmodule-cache-path /var/tmp/clang-module-cache -internal-isystem /usr/local/include -internal-isystem /usr/bin/../lib/clang/3.1/include -internal-externc-isystem /usr/include -internal-externc-isystem /usr/lib/gcc/x86_64-pc-linux-gnu/4.6.2/include -O3 -fdebug-compilation-dir /tmp -ferror-limit 19 -fmessage-length 97 -mstackrealign -fgnu-runtime -fobjc-runtime-has-arc -fobjc-runtime-has-weak -fobjc-fragile-abi -fdiagnostics-show-option -fcolor-diagnostics -o /tmp/a-lBMy60.o -x c a.c
clang -cc1 version 3.1 based upon LLVM 3.1svn default target x86_64-pc-linux-gnu
#include "..." search starts here:
#include <...> search starts here:
 /usr/local/include
 /usr/bin/../lib/clang/3.1/include
 /usr/include
 /usr/lib/gcc/x86_64-pc-linux-gnu/4.6.2/include
End of search list.
 "/usr/bin/x86_64-pc-linux-gnu-ld" --eh-frame-hdr -m elf_x86_64 -dynamic-linker /lib64/ld-linux-x86-64.so.2 -o a.out /usr/lib/gcc/x86_64-pc-linux-gnu/4.6.2/../../../../lib64/crt1.o /usr/lib/gcc/x86_64-pc-linux-gnu/4.6.2/../../../../lib64/crti.o /usr/lib/gcc/x86_64-pc-linux-gnu/4.6.2/crtbegin.o -L/usr/lib/gcc/x86_64-pc-linux-gnu/4.6.2 -L/usr/lib/gcc/x86_64-pc-linux-gnu/4.6.2/../../../../lib64 -L/lib/../lib64 -L/usr/lib/../lib64 -L/usr/lib/gcc/x86_64-pc-linux-gnu/4.6.2/../../../../x86_64-pc-linux-gnu/lib -L/usr/lib/gcc/x86_64-pc-linux-gnu/4.6.2/../../.. -L/lib -L/usr/lib /tmp/a-lBMy60.o -lgcc --as-needed -lgcc_s --no-as-needed -lc -lgcc --as-needed -lgcc_s --no-as-needed /usr/lib/gcc/x86_64-pc-linux-gnu/4.6.2/crtend.o /usr/lib/gcc/x86_64-pc-linux-gnu/4.6.2/../../../../lib64/crtn.o -plugin /usr/bin/../lib/LLVMgold.so
Comment 1 Bernard Cafarelli gentoo-dev 2012-02-03 14:27:18 UTC
Yet another hardcoded path hidden in the source (here, tools/clang/lib/Driver/Tools.cpp)

Fixed in new 3.0-r2 bum and live 9999 :)