[LLVMbugs] [Bug 10993] New: llvm-ld -native fails with .a archive produced by llvm-ar

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Thu Sep 22 19:57:28 PDT 2011


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

           Summary: llvm-ld -native fails with .a archive produced by
                    llvm-ar
           Product: tools
           Version: 2.9
          Platform: Macintosh
        OS/Version: MacOS X
            Status: NEW
          Severity: normal
          Priority: P
         Component: llvm-ld
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: luddy.harrison at gmail.com
                CC: llvmbugs at cs.uiuc.edu


Created an attachment (id=7332)
 --> (http://llvm.org/bugs/attachment.cgi?id=7332)
test case; a directory with 3 C++ files and a makefile.

I've attached a small example with makefile that reproduces the problem.  I'm
doing this on 10.7 with the latest XCode installed, and llvm-2.9 installed in
/usr/local.

Two C++ files are compiled with clang++ -O4, a lib.a archive created of them
using llvm-ar, and llvm-ld used to link them.  I'm hoping to get LTO from this
model of compilation archiving and linking, and perhaps to specialize llvm-ld
for some particular linking work.  Unfortunately when -native is given to
llvm-ld it seems to misread the archive file (?)

llvm-ld without -native completes without reporting an error, although I
haven't tried executing the result (I need native code).

the example works fine if I use libtool for the archiving and clang++ for the
final link step.  I've included commented-out lines in the Makefile to test
this case.

Best regards,

-Luddy

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