[cfe-dev] crtbeing.o not found - linker error

Prasanth Anbalagan panbalag1 at gmail.com
Thu Jul 28 11:27:58 PDT 2011


I'm trying to execute clang on a simple c program. But I get the following

*[root at ssan-rhel5u4-07 bin]# *./clang -v test.c
clang version 3.0 (trunk 136103)
Target: x86_64-unknown-linux-gnu
Thread model: posix
 "/root/llvm/Debug+Asserts/bin/clang" -cc1 -triple x86_64-unknown-linux-gnu
-emit-obj -mrelax-all -disable-free -main-file-name test.c
-mrelocation-model static -mdisable-fp-elim -masm-verbose
-mconstructor-aliases -munwind-tables -target-cpu x86-64
-target-linker-version -momit-leaf-frame-pointer -v
-resource-dir /root/llvm/Debug+Asserts/bin/../lib/clang/3.0 -ferror-limit 19
-fmessage-length 221 -fdiagnostics-show-option -fcolor-diagnostics -o
/tmp/cc-Na8daP.o -x c test.c
clang -cc1 version 3.0 based upon llvm 3.0svn hosted on
ignoring nonexistent directory "/usr/include/x86_64-linux-gnu"
ignoring nonexistent directory "/usr/include/i686-linux-gnu/64"
ignoring nonexistent directory "/usr/include/i486-linux-gnu/64"
#include "..." search starts here:
#include <...> search starts here:
End of search list.
 "/usr/bin/ld" --hash-style=gnu --no-add-needed --eh-frame-hdr -m elf_x86_64
-dynamic-linker /lib64/ld-linux-x86-64.so.2 -o a.out
/usr/lib/../lib64/crt1.o /usr/lib/../lib64/crti.o crtbegin.o -L
-L/../../../../lib64 -L/lib/../lib64 -L/usr/lib/../lib64 -L/../../..
/tmp/cc-Na8daP.o -lgcc --as-needed -lgcc_s --no-as-needed -lc -lgcc
--as-needed -lgcc_s --no-as-needed crtend.o /usr/lib/../lib64/crtn.o
*/usr/bin/ld: crtbegin.o: No such file: No such file or directory*
clang: error: linker command failed with exit code 1 (use -v to see

*But when I try to locate the file, I can see them under*

*[root at ssan-rhel5u4-07 bin]#* locate crtbegin.o

*Any suggestions on how to resolve this? *

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20110728/1864a0a7/attachment.html>

More information about the cfe-dev mailing list