刚刚编译的铿锵-2.9版本,它不能链接世界你好的例子。还有就是错误:铿锵-2.9 crt1未找到错误
crt1.o: No such file: No such file or directory
LLVM配置为默认+ --enable-shared
。具有相同选项的llvm-2.8版本在同一台机器上正常工作。
$ clang -v a.c
clang version 2.9 (tags/RELEASE_29/final)
Target: i386-pc-linux-gnu
Thread model: posix
"/root/bin/clang" -cc1 -triple i386-pc-linux-gnu -emit-obj -mrelax-all -disable-free -disable-llvm-verifier -main-file-name a.c -mrelocation-model static -mdisable-fp-elim -masm-verbose -mconstructor-aliases -target-cpu pentium4 -target-linker-version 2.18 -momit-leaf-frame-pointer -v -resource-dir /root/lib/clang/2.9 -ferror-limit 19 -fmessage-length 157 -fgnu-runtime -fdiagnostics-show-option -fcolor-diagnostics -o /tmp/cc-2ueoYy.o -x c a.c
clang -cc1 version 2.9 based upon llvm 2.9 hosted on i386-pc-linux-gnu
ignoring nonexistent directory "/usr/local/include"
#include "..." search starts here:
#include <...> search starts here:
/root/lib/clang/2.9/include
/usr/include
End of search list.
a.c:1:1: warning: type specifier missing, defaults to 'int' [-Wimplicit-int]
main(){}
^~~~
1 warning generated.
"/usr/bin/ld" --eh-frame-hdr -m elf_i386 -dynamic-linker /lib/ld-linux.so.2 -o a.out crt1.o crti.o crtbegin.o -L -L/../../.. /tmp/cc-2ueoYy.o -lgcc --as-needed -lgcc_s --no-as-needed -lc -lgcc --as-needed -lgcc_s --no-as-needed crtend.o crtn.o
/usr/bin/ld: crt1.o: No such file: No such file or directory
clang: error: linker command failed with exit code 1 (use -v to see invocation)
同样的错误在这里http://permalink.gmane.org/gmane.comp.compilers.clang.devel/12101 和http://comments.gmane.org/gmane.comp.compilers.clang.devel/14269和http://permalink.gmane.org/gmane.comp.compilers.llvm.bugs/11352
我可以边学边用LLVM-2.8比较 - 新版本试图组装文件本身,和旧版本的GCC调用做组装并链接步骤。
请不要复制clang linker problem,因为我无法编辑LLVM的源代码,因此接受的解决方案对我无用。
我有同样的问题... – skeept 2011-04-15 04:27:30
@skeept,你尝试从答案的解决方案吗?将你的gcc版本添加到GccVersions数组中。 – osgx 2011-04-15 11:09:33