[LLVMbugs] [Bug 9798] New: Linker flags fail / can't find crtbegin.o

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Tue Apr 26 05:20:29 PDT 2011


           Summary: Linker flags fail / can't find crtbegin.o
           Product: clang
           Version: trunk
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: -New Bugs
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: jpakkane at gmail.com
                CC: llvmbugs at cs.uiuc.edu

When using latest SVN checkout on Ubuntu 11/04 beta I get the following error
on a trivial C compile:


/mnt/data/src/llvm/builddir/bin/clang foo.c -v
clang version 3.0 (trunk 130194)
Target: i386-pc-linux-gnu
Thread model: posix
 "/mnt/data/src/llvm/builddir/bin/clang-3.0" -cc1 -triple i386-pc-linux-gnu
-emit-obj -mrelax-all -disable-free -main-file-name foo.c -mrelocation-model
static -mdisable-fp-elim -masm-verbose -mconstructor-aliases -target-cpu
pentium4 -momit-leaf-frame-pointer -v -resource-dir
/mnt/data/src/llvm/builddir/bin/../lib/clang/3.0 -ferror-limit 19
-fmessage-length 179 -fgnu-runtime -fdiagnostics-show-option
-fcolor-diagnostics -o /tmp/cc-GgBD6l.o -x c foo.c
clang -cc1 version 3.0 based upon llvm 3.0 hosted on i386-pc-linux-gnu
#include "..." search starts here:
#include <...> search starts here:
End of search list.
 "/usr/bin/ld" -z relro --hash-style=gnu --build-id --eh-frame-hdr -m elf_i386
-dynamic-linker /lib/ld-linux.so.2 -o a.out /usr/lib/../lib/crt1.o
/usr/lib/../lib/crti.o crtbegin.o -L -L/../../../../lib -L/lib/../lib
-L/usr/lib/../lib -L/../../.. -L/usr/lib/ /tmp/cc-GgBD6l.o -lgcc --as-needed
-lgcc_s --no-as-needed -lc -lgcc --as-needed -lgcc_s --no-as-needed crtend.o
/usr/bin/ld: cannot find crtbegin.o: No such file or directory
/usr/bin/ld: cannot find -lgcc
/usr/bin/ld: cannot find -lgcc_s
clang-3: error: linker command failed with exit code 1 (use -v to see


This is very similar to bug 8897 and bug 9731.

The missing files can be found in these directories:


The "i386-linux-gnu" part does not exist in the directories listed in

Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.

More information about the llvm-bugs mailing list