http://llvm.org/bugs/show_bug.cgi?id=18279
Bug ID: 18279
Summary: llvm build with -flto installs libclang_rt.* archives
that contain bitcode
Product: compiler-rt
Version: unspecified
Hardware: PC
OS: Linux
Status: NEW
Severity: normal
Priority: P
Component: compiler-rt
Assignee: [email protected]
Reporter: [email protected]
CC: [email protected]
Classification: Unclassified
When llvm is build with -flto installs libclang_rt.* archives that contain
bitcode.
For example:
markus@x4 ~ % clang -fsanitize=undefined -O2 -g un.c
/usr/lib64/gcc/x86_64-pc-linux-gnu/4.9.0/../../../../x86_64-pc-linux-gnu/bin/ld:
error: /usr/local/bin/../lib/clang/3.4/lib/linux/libclang_rt.san-x86_64.a:
member at 812 is not an ELF object
/usr/lib64/gcc/x86_64-pc-linux-gnu/4.9.0/../../../../x86_64-pc-linux-gnu/bin/ld:
error: /usr/local/bin/../lib/clang/3.4/lib/linux/libclang_rt.san-x86_64.a:
member at 44656 is not an ELF object
...
un.c:3: error: undefined reference to '__ubsan_handle_shift_out_of_bounds'
clang-3.4: error: linker command failed with exit code 1 (use -v to see
invocation)
(-flto works fine, because it enables the linker plugin:)
markus@x4 ~ % clang -flto -fsanitize=undefined -O2 -g un.c
markus@x4 ~ %
(enabling the linker plugin by hang also works:)
markus@x4 ~ % clang -Wl,-plugin /usr/local/bin/../lib/LLVMgold.so
-Wl,-plugin-opt=mcpu=x86-64 -fsanitize=undefined -O2 -g un.c
markus@x4 ~ %
One solution would be to always disable -flto for compiler-rt during the build.
Another one to enable the linker plugin by default for -flto builds in general.
--
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
LLVMbugs mailing list
[email protected]
http://lists.cs.uiuc.edu/mailman/listinfo/llvmbugs