Bug 770487 - clang cannot find libgcc
clang cannot find libgcc
Status: CLOSED DUPLICATE of bug 750187
Product: Fedora
Classification: Fedora
Component: llvm (Show other bugs)
16
i686 Linux
unspecified Severity high
: ---
: ---
Assigned To: Michel Alexandre Salim
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2011-12-26 21:04 EST by Mark Heily
Modified: 2011-12-29 09:32 EST (History)
4 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2011-12-29 09:32:42 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)

  None (edit)
Description Mark Heily 2011-12-26 21:04:03 EST
Description of problem:

  clang fails to link a simple C program because it cannot find libgcc.

  It looking for libgcc in /usr/lib/gcc/i686-redhat-linux/4.6.1
  but the files are actually located in /usr/lib/gcc/i686-redhat-linux/4.6.2

  As a workaround, you can create a symlink from 4.6.1 -> 4.6.2 like this:

     sudo ln -s 4.6.2 /usr/lib/gcc/i686-redhat-linux/4.6.1

Version-Release number of selected component (if applicable):

  clang version 2.9 (tags/RELEASE_29/final)


How reproducible:

  try to build an executable binary.

Steps to Reproduce:
1. yum install clang
2. echo 'int main() { exit(0); }' > /tmp/test.c
3. clang /tmp/test.c
  
Actual results:

/usr/bin/ld: cannot find crt1.o: No such file or directory
/usr/bin/ld: cannot find crti.o: No such file or directory
/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: error: linker command failed with exit code 1 (use -v to see invocation)

Expected results:

 An executable file named 'a.out'

Additional info:

 Here is the output of 'clang -v test.c':

clang version 2.9 (tags/RELEASE_29/final)
Target: i386-redhat-linux-gnu
Thread model: posix
 "/usr/bin/clang" -cc1 -triple i386-redhat-linux-gnu -emit-obj -mrelax-all -disable-free -disable-llvm-verifier -main-file-name test.c -mrelocation-model static -mdisable-fp-elim -masm-verbose -mconstructor-aliases -target-cpu pentium4 -target-linker-version 2.21.53.0.1 -momit-leaf-frame-pointer -v -resource-dir /usr/bin/../lib/clang/2.9 -ferror-limit 19 -fmessage-length 80 -fgnu-runtime -fdiagnostics-show-option -fcolor-diagnostics -o /tmp/cc-kWS6Uf.o -x c /tmp/test.c
clang -cc1 version 2.9 based upon llvm 2.9 hosted on i386-redhat-linux-gnu
ignoring nonexistent directory "/usr/lib/gcc/i686-redhat-linux/4.6.1/include"
#include "..." search starts here:
#include <...> search starts here:
 /usr/local/include
 /usr/bin/../lib/clang/2.9/include
 /usr/include
End of search list.
 "/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-kWS6Uf.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: cannot find crt1.o: No such file or directory
/usr/bin/ld: cannot find crti.o: No such file or directory
/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: error: linker command failed with exit code 1 (use -v to see invocation)
Comment 1 Aravind vijayan 2011-12-29 09:32:42 EST
Thank you for the bug report. This particular bug has already been reported into our bug tracking system, but please feel free to report any further bugs you find.



-- 
Fedora Bugzappers volunteer triage team
https://fedoraproject.org/wiki/BugZappers

*** This bug has been marked as a duplicate of bug 750187 ***

Note You need to log in before you can comment on or make changes to this bug.