[LLVMbugs] [Bug 12795] New: Linking shared library fails on Win7 64-bit with x64_64-w64-mingw32-gcc-4.6.3

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Thu May 10 23:29:11 PDT 2012


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

             Bug #: 12795
           Summary: Linking shared library fails on Win7 64-bit with
                    x64_64-w64-mingw32-gcc-4.6.3
           Product: Build scripts
           Version: 3.0
          Platform: PC
        OS/Version: Windows NT
            Status: NEW
          Severity: normal
          Priority: P
         Component: Makefiles
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: valtron2000 at gmail.com
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified


I did managed to get it working, though, and it seems to be a problem with a
makefile (or perhaps the autoconf).

How I ran configure:
sh ../llvm-3.0.src/configure --disable-pthreads --enable-shared
--enable-optimizations --enable-targets=host

I then ran make with no options. Everything goes OK until the final linking of
LLVM-3.0.dll:

llvm[1]: Linking Release Shared Library LLVM-3.0.dll
Cannot export Z10MakeErrMsgPSsRKSs: symbol not defined
Cannot export Z4FindIN4llvm15SubtargetInfoKVEEPKT_NS0_9StringRefES4_y: symbol
not defined
Cannot export Z4FindIN4llvm18SubtargetFeatureKVEEPKT_NS0_9StringRefES4_y:
symbol not defined
Cannot export
ZN4PBQP19HeuristicSolverImplINS_10Heuristics6BriggsEE7applyR2ESt14_List_iteratorINS_5Graph9NodeEntryEE:
symbol not defined
Cannot export ZN4llvm10AllocaInst12setAlignmentEj: symbol not defined
Cannot export
ZN4llvm10AllocaInstC1EPNS_4TypeEPNS_5ValueERKNS_5TwineEPNS_10BasicBlockE:
symbol not defined
Cannot export
ZN4llvm10AllocaInstC1EPNS_4TypeEPNS_5ValueERKNS_5TwineEPNS_11InstructionE:
symbol not defined
Cannot export
ZN4llvm10AllocaInstC1EPNS_4TypeEPNS_5ValueEjRKNS_5TwineEPNS_10BasicBlockE:
symbol not defined
Cannot export
ZN4llvm10AllocaInstC1EPNS_4TypeEPNS_5ValueEjRKNS_5TwineEPNS_11InstructionE:
symbol not defined
... (12693 of these errors in total, one for each export in LLVM-3.0.def) ...

The command it fails on is:

g++ -I/c/Users/mti/Desktop/llvm-3.0.src/include
-I/c/Users/mti/Desktop/llvm-3.0.src/tools/llvm-shlib -I/c/Users/mti/Desk
top/llvm-build/include -I/c/Users/mti/Desktop/llvm-build/tools/llvm-shlib 
-DNDEBUG -D__NO_CTYPE_INLINE -D_GNU_SOURCE -D
__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -O2
-fomit-frame-pointer -fno-exceptions -fno-rtti -
Woverloaded-virtual -Wcast-qual  -O2
-L/c/Users/mti/Desktop/llvm-build/Release/lib
-L/c/Users/mti/Desktop/llvm-build/Rel
ease/lib     -pedantic -Wno-long-long -Wall -W -Wno-unused-parameter
-Wwrite-strings   -shared /c/Users/mti/Desktop/llvm
-build/tools/llvm-shlib/Release/LLVM-3.0.def -o
/c/Users/mti/Desktop/llvm-build/Release/bin/LLVM-3.0.dll  \
            -lLLVMAnalysis -lLLVMArchive -lLLVMAsmParser -lLLVMAsmPrinter
-lLLVMBitReader -lLLVMBitWriter -lLLVMCodeGen
-lLLVMCore -lLLVMDebugInfo -lLLVMExecutionEngine -lLLVMInstCombine
-lLLVMInstrumentation -lLLVMInterpreter -lLLVMJIT -lL
LVMLinker -lLLVMMC -lLLVMMCDisassembler -lLLVMMCJIT -lLLVMMCParser -lLLVMObject
-lLLVMRuntimeDyld -lLLVMScalarOpts -lLLV
MSelectionDAG -lLLVMSupport -lLLVMTarget -lLLVMTransformUtils
-lLLVMX86AsmParser -lLLVMX86AsmPrinter -lLLVMX86CodeGen -l
LLVMX86Desc -lLLVMX86Disassembler -lLLVMX86Info -lLLVMX86Utils -lLLVMipa
-lLLVMipo -lpsapi -limagehlp -lm

To fix it, I replaced "LLVM-3.0.def" in the above command with "LLVM-3.0.a.o",
and the DLL gets created. I haven't run the tests, but the DLL seems to work
(using it in a Java project, managed to compile and execute a simple file).

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