[LLVMbugs] [Bug 9829] New: undefined reference to __mingw_vprintf when linking to libLLVMCore.a

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Mon May 2 09:10:20 PDT 2011


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

           Summary: undefined reference to __mingw_vprintf when linking to
                    libLLVMCore.a
           Product: libraries
           Version: 2.9
          Platform: PC
        OS/Version: Windows XP
            Status: NEW
          Severity: normal
          Priority: P
         Component: Core LLVM classes
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: dash4893h4932 at abv.bg
                CC: llvmbugs at cs.uiuc.edu


hello,

on winxp-sp2-x86 installing the following official packages in /llvm/:

llvm-gcc4.2-2.9-x86-mingw32.tar.bz2
llvm-2.9-mingw32-i386.tar.bz2
binutils-2.20-1-mingw32-bin.tar.gz

compiling example at:

http://gnuu.org/2009/09/18/writing-your-own-toy-compiler/all/1/

constructing and adjusting cmd line:

perl llvm-config --libs core jit native --cxxflags --ldflags

llvm-g++ *.cpp -o a.exe -I/llvm/include -DNDEBUG -D__NO_CTYPE_INLINE
-D_GNU_SOURCE -D__STDC_LIMIT_MACROS -D__STDC_CONSTANT_MACROS -O2
-fomit-frame-pointer -fno-exceptions -Woverloaded-virtual -Wcast-qual
-L/llvm/lib -lLLVMX86Disassembler -lLLVMX86AsmParser -lLLVMX86CodeGen
-lLLVMSelectionDAG -lLLVMAsmPrinter -lLLVMMCParser -lLLVMX86AsmPrinter
-lLLVMX86Utils -lLLVMX86Info -lLLVMJIT -lLLVMExecutionEngine -lLLVMCodeGen
-lLLVMScalarOpts -lLLVMInstCombine -lLLVMTransformUtils -lLLVMipa
-lLLVMAnalysis -lLLVMTarget -lLLVMMC -lLLVMCore -lLLVMSupport
-lLLVMSystemZCodeGen -lLLVMSystemZInfo -lpsapi -limagehlp -lm


results in:

Warning: .drectve `-aligncomm:___CTOR_LIST__,2 ' unrecognized
Warning: .drectve `-aligncomm:___DTOR_LIST__,2' unrecognized
/llvm/lib/libLLVMCore.a(PassManager.o)(.text+0x13):PassManager.cpp: undefined
reference to `__mingw_vprintf'
/llvm/lib/libLLVMSupport.a(Signals.o)(.text+0x1b):Signals.cpp: undefined
reference to `__mingw_vfprintf'
/llvm/lib/libLLVMSupport.a(Path.o)(.text+0x1b):Path.cpp: undefined reference to
`__mingw_vsprintf'
collect2: ld returned 1 exit status

---

collect2 suggest that the mingw versions of these functions were linked.
'grep' does not return any files containing these symbols in llvm/lib. the
closest possible location is /llvm/lib/libmingwex.a, which contains symbols
like __mingw_vsnprintf, __mingw_snprintf.
a solution is to define the symbols manually e.g. blank functions in a object
file.

D.K.

P.S.1:
i've sent an email yesterday to the list directly, but using the BZ system
might be better...i was also able to recompiled the support / core libraries
from the 2.9 source with mingw-gcc-4.4.1, but got a lot of SJLJ errors instead
of the '__mingw_*' when linking.

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