[LLVMbugs] [Bug 18279] New: llvm build with -flto installs libclang_rt.* archives that contain bitcode
bugzilla-daemon at llvm.org
bugzilla-daemon at llvm.org
Thu Dec 19 03:20:14 PST 2013
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: unassignedbugs at nondot.org
Reporter: octoploid at yandex.com
CC: llvmbugs at cs.uiuc.edu
Classification: Unclassified
When llvm is build with -flto installs libclang_rt.* archives that contain
bitcode.
For example:
markus at 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 at x4 ~ % clang -flto -fsanitize=undefined -O2 -g un.c
markus at x4 ~ %
(enabling the linker plugin by hang also works:)
markus at x4 ~ % clang -Wl,-plugin /usr/local/bin/../lib/LLVMgold.so
-Wl,-plugin-opt=mcpu=x86-64 -fsanitize=undefined -O2 -g un.c
markus at 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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20131219/c6fc3b30/attachment.html>
More information about the llvm-bugs
mailing list