[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


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

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

/Developer/usr/bin/clang -shared -ccc-host-triple i386-pc-mingw32 -ccc-gcc-name
/Developer/Cocotron/1.0/Windows/i386/gcc-4.3.1/bin/i386-pc-mingw32msvc-gcc
-I/Developer/Cocotron/1.0/Windows/i386/llvm-clang-trunk/i386-pc-mingw32msvc/include
exportTest.c

produces
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 :
http://lists.cs.uiuc.edu/pipermail/cfe-dev/2011-June/015757.html


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() 
To 
   name += DLLExportedGlobals[i]->getName().substr(1); 

AND 

Line 637:
        name += DLLExportedFns[i]->getName(); 
To 
        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