[LLVMbugs] [Bug 10175] New: Wrong symbol names with cross compiling

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Thu Jun 23 03:03:19 PDT 2011


           Summary: Wrong symbol names with cross compiling
           Product: libraries
           Version: trunk
          Platform: Macintosh
        OS/Version: MacOS X
            Status: NEW
          Severity: normal
          Priority: P
         Component: Backend: X86
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: glenn at egastones.ch
                CC: llvmbugs at cs.uiuc.edu

The cross compiler produces wrong export symbols if you cross compile a windows

/Developer/usr/bin/clang -shared -ccc-host-triple i386-pc-mingw32 -ccc-gcc-name

Cannot export _Function1: symbol not found
collect2: ld returned 1 exit status
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Cotent of exportTest.c:

__declspec(dllexport) void __cdecl Function1(void)


see mailing list :

I have a workaround for this in lib/Target/X86/X86AsmPrinter.cpp to delete the
first character of the symbol wiht .substr(1) at line 624 and 637.

Line 624: 
    name += DLLExportedGlobals[i]->getName() 
   name += DLLExportedGlobals[i]->getName().substr(1); 


Line 637:
        name += DLLExportedFns[i]->getName(); 
        name += DLLExportedFns[i]->getName().substr(1); 

This is for sure the wrong place and this is only a hack.

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