clang failed to link binaries when -flto option is used.
This bug report will be marked for expiration in 57 days if no further activity occurs. (find out why)
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
llvm-toolchain-3.9 (Ubuntu) |
Invalid
|
Undecided
|
Unassigned | ||
llvm-toolchain-snapshot (Ubuntu) |
Incomplete
|
Undecided
|
Unassigned |
Bug Description
clang-3.3/3.4 cannot link a simple binary if -flto option is used (in order to enable link-time-
The following command clearly shows the problem:
user@ubuntu:/tmp$ echo 'int main() {}' | clang -xc - -flto -v
Ubuntu clang version 3.4-1ubuntu1 (trunk) (based on LLVM 3.4)
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-
clang -cc1 version 3.4 based upon LLVM 3.4 default target x86_64-pc-linux-gnu
ignoring nonexistent directory "/usr/bin/
ignoring duplicate directory "/usr/include/
#include "..." search starts here:
#include <...> search starts here:
/usr/local/include
/usr/include/
/usr/include/
/usr/include
End of search list.
"/usr/bin/ld" -z relro --hash-style=gnu --build-id --eh-frame-hdr -m elf_x86_64 -dynamic-linker /lib64/
/usr/bin/ld: /usr/bin/
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Ubuntu release 13.10
BTW, there are other issues related to link-time-
Status changed to 'Confirmed' because the bug affects multiple users.