Clang compiler cannot link programs on hard float ARM system
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Raspbian |
Fix Released
|
Undecided
|
Unassigned | ||
clang (Debian) |
Fix Released
|
Unknown
|
Bug Description
This is clang and LLVM, as retrieved via apt-get install llvm clang, from the official RPI rasbpian derived image.
I don't believe what c or c++ file is used matters; so long as it has main() and should compile to an executable program. The same file builds with g++
This bug limits the usefulness of clang - it is possible to compile to assembly, but not to have clang control the assembler and linker as would be desired.
pi@raspberrypi ~/src $ clang -x c++ interp.c -v
Debian clang version 3.0-6 (tags/RELEASE_
Target: arm-unknown-
Thread model: posix
clang: warning: unknown platform, assuming -mfloat-abi=soft
"/usr/bin/clang" -cc1 -triple armv4t-
clang -cc1 version 3.0 based upon llvm 3.0 hosted on arm-unknown-
ignoring nonexistent directory "/usr/bin/
ignoring nonexistent directory "/usr/include/
ignoring nonexistent directory "/usr/bin/
ignoring duplicate directory "/usr/include/
ignoring duplicate directory "/usr/include/
ignoring duplicate directory "/usr/include/
ignoring duplicate directory "/usr/include/
ignoring duplicate directory "/usr/include/
ignoring duplicate directory "/usr/include/
ignoring duplicate directory "/usr/include/
ignoring duplicate directory "/usr/include/
ignoring duplicate directory "/usr/local/
ignoring duplicate directory "/usr/include/
ignoring duplicate directory "/usr/include/
ignoring duplicate directory "/usr/include/
ignoring duplicate directory "/usr/include"
#include "..." search starts here:
#include <...> search starts here:
/usr/include/
/usr/include/
/usr/include/
/usr/local/include
/usr/include/
/usr/include
/usr/include/
/usr/lib/
/usr/lib/
End of search list.
"/usr/bin/as" -o /tmp/interp-
"/usr/bin/ld" -X --hash-style=both --build-id --eh-frame-hdr -m armelf_linux_eabi -dynamic-linker /lib/ld-linux.so.3 -o a.out crt1.o crti.o /usr/lib/
/usr/bin/ld: cannot find crt1.o: No such file or directory
/usr/bin/ld: cannot find crti.o: No such file or directory
clang: error: linker command failed with exit code 1 (use -v to see invocation)
pi@raspberrypi ~/src $
Suggested fix? Track upstream clang / LLVM. This looks to be a bug in Clang, possibly being addressed in clang trunk.
Changed in clang (Debian): | |
status: | Unknown → Fix Released |
Filed as clang bug http:// llvm.org/ bugs/show_ bug.cgi? id=13506