[LLVMbugs] [Bug 9145] New: llvm-ld with clang is failing on OS X, but not on Linux

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Fri Feb 4 20:40:02 PST 2011


http://llvm.org/bugs/show_bug.cgi?id=9145

           Summary: llvm-ld with clang is failing on OS X, but not on
                    Linux
           Product: new-bugs
           Version: unspecified
          Platform: PC
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: new bugs
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: endobson at mac.com
                CC: llvmbugs at cs.uiuc.edu


Trying to compile the following program:

eric at eric-dobsons-macbook () ~/proj/course/11Spring/compilers % cat tmp.ll
; ModuleID = 'tmp.ll'

define i32 @main(i32, i8**) {
entry:
  ret i32 0
}

eric at eric-dobsons-macbook () ~/proj/course/11Spring/compilers % llvmc -clang -v
-o tmp.bin tmp.ll
llc -O2 tmp.ll -o /tmp/llvm_jjsfVp/tmp.s 
as /tmp/llvm_jjsfVp/tmp.s -o /tmp/llvm_jjsfVp/tmp.o 
llvm-ld -native -disable-internalize /tmp/llvm_jjsfVp/tmp.o -o tmp.bin 
llvm-ld: warning: Ignoring file '/tmp/llvm_jjsfVp/tmp.o' because does not
contain bitcode.
Undefined symbols:
  "_main", referenced from:
      start in crt1.10.6.o
ld: symbol(s) not found
collect2: ld returned 1 exit status
llvm-ld: 

But when compling with llvm-gcc it succeeds 
eric at eric-dobsons-macbook () ~/proj/course/11Spring/compilers % llvmc -v -o
tmp.bin tmp.ll
llc -O2 tmp.ll -o /tmp/llvm_pFE0lx/tmp.s 
llvm-gcc -c -x assembler /tmp/llvm_pFE0lx/tmp.s -o /tmp/llvm_pFE0lx/tmp.o 
llvm-gcc /tmp/llvm_pFE0lx/tmp.o -o tmp.bin 


and on linux it succeeds as well


endobson at cslab3d () ~/tmp % llvmc -clang -v -o tmp.bin tmp.bc
llc -O2 tmp.bc -o /tmp/llvm_MUIdwt/tmp.s 
as /tmp/llvm_MUIdwt/tmp.s -o /tmp/llvm_MUIdwt/tmp.o 
llvm-ld -native -disable-internalize /tmp/llvm_MUIdwt/tmp.o -o tmp.bin

If llvm-ld does not support this option on OS X then llvmc should not invoke it
in this manner.

-- 
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