Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 417595

Summary: sys-devel/clang looks for some of its libraries in /usr/lib while installed to native ABI dir
Product: Gentoo Linux Reporter: Michał Górny <mgorny>
Component: Current packagesAssignee: Bernard Cafarelli <voyageur>
Status: RESOLVED FIXED    
Severity: normal CC: mgorny, ryao
Priority: Normal    
Version: unspecified   
Hardware: All   
OS: Linux   
See Also: http://llvm.org/bugs/show_bug.cgi?id=12954
Whiteboard:
Package list:
Runtime testing required: ---

Description Michał Górny archtester Gentoo Infrastructure gentoo-dev Security 2012-05-26 09:29:50 UTC
$ clang -O4 -faddress-sanitizer a.c
/usr/bin/x86_64-pc-linux-gnu-ld: error: cannot open /usr/bin/../lib/clang/3.1/lib/linux/libclang_rt.asan-x86_64.a: No such file or directory
lto-llvm.o-WK9UAf:ld-temp.o:function asan.module_ctor: error: undefined reference to '__asan_init'
clang: error: linker command failed with exit code 1 (use -v to see invocation)

That's because it looks for it in /usr/lib, while it is installed to /usr/lib64.

There's a lot of places in clang's sources where '../lib' is hardcoded. I wonder if it's easier to fix that all or just install clang into /usr/lib (much like gcc is installed on Gentoo).
Comment 1 Bernard Cafarelli gentoo-dev 2013-06-17 14:04:11 UTC
With the --with-clang-resource-dir configuration option and a few additional seds in makefiles (and one test), I have it working in 3.3_rc3 (and 9999 ebuild, though with hardcoded version there)