[LLVMbugs] [Bug 19822] New: Option --rtlib=compiler-rt points to non-existent runtime library.
bugzilla-daemon at llvm.org
bugzilla-daemon at llvm.org
Wed May 21 16:40:08 PDT 2014
http://llvm.org/bugs/show_bug.cgi?id=19822
Bug ID: 19822
Summary: Option --rtlib=compiler-rt points to non-existent
runtime library.
Product: compiler-rt
Version: unspecified
Hardware: PC
OS: Linux
Status: NEW
Severity: normal
Priority: P
Component: compiler-rt
Assignee: unassignedbugs at nondot.org
Reporter: eocallaghan at alterapraxis.com
CC: llvmbugs at cs.uiuc.edu
Classification: Unclassified
clang version 3.5.0 (trunk 209083)
Target: x86_64-unknown-linux-gnu
Thread model: posix
Hi,
Consider this simple example:
int main(void)
{
long long x = 10;
long long z = x / 3; // generates call to __udivdi3
return 0;
}
on a x64 host. Note that we have,
$ ls -l /usr/local/bin/../lib/clang/3.5.0/lib/linux/
20K -rw-r--r-- 1 root root 20K May 18 14:04 libclang_rt.asan_cxx-x86_64.a
4.1M -rw-r--r-- 1 root root 4.1M May 18 14:04 libclang_rt.asan-x86_64.a
740K -rw-r--r-- 1 root root 740K May 18 14:04 libclang_rt.dfsan-x86_64.a
220K -rw-r--r-- 1 root root 218K May 18 14:04 libclang_rt.full-x86_64.a
940K -rw-r--r-- 1 root root 940K May 18 14:04 libclang_rt.lsan-x86_64.a
2.4M -rw-r--r-- 1 root root 2.4M May 18 14:04 libclang_rt.msan-x86_64.a
28K -rw-r--r-- 1 root root 25K May 18 14:04 libclang_rt.profile-x86_64.a
676K -rw-r--r-- 1 root root 674K May 18 14:04 libclang_rt.san-x86_64.a
3.3M -rw-r--r-- 1 root root 3.3M May 18 14:04 libclang_rt.tsan-x86_64.a
24K -rw-r--r-- 1 root root 22K May 18 14:04 libclang_rt.ubsan_cxx-x86_64.a
100K -rw-r--r-- 1 root root 98K May 18 14:04 libclang_rt.ubsan-x86_64.a
While attempting to cross compile to a i386 target observe the invocation:
clang -m32 --rtlib=compiler-rt foo.c
/..//bin/ld: cannot find crtbegin.o: No such file or directory
/..//bin/ld: cannot find
/usr/local/bin/../lib/clang/3.5.0/lib/linux/libclang_rt.i386.a: No such file or
directory
clang: error: linker command failed with exit code 1 (use -v to see invocation)
of course we don't have 'libclang_rt.i386.a'. However, further the
--rtlib=compiler-rt option is even broken on the native target:
clang --rtlib=compiler-rt foo.c
/usr/bin/ld: cannot find
/usr/local/bin/../lib/clang/3.5.0/lib/linux/libclang_rt.x86_64.a: No such file
or directory
clang: error: linker command failed with exit code 1 (use -v to see invocation)
of course 'libclang_rt.x86_64.a' does not exist as we have the naming
convention libclang_rt.XXX-x86_64.a
Hence we have two problems here:
1.) The frontend option '--rtlib=compiler-rt' is both poorly documented and
broken. In fact, random bug reports on Google is how I found out about it then
I had to look at the frontend.
2.) No multilib support to cross compile from x86_64 to i386 target.
This currently blocks building coreboot with clang. Please advise..
Cheers,
Edward.
--
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20140521/9bd37059/attachment.html>
More information about the llvm-bugs
mailing list