[cfe-dev] [LLVMdev] Clang64 on Windows using Mingw64 yields many linking errors?

Mikael Lyngvig mikael at lyngvig.org
Mon Jun 11 05:40:05 PDT 2012


Here goes:

Linking CXX executable ..\braceless0.exe
clang version 3.2 (trunk 157524)
Target: x86_64-w64-mingw32
Thread model: posix
 "c:/Mingw64/bin/x86_64-w64-mingw32-g++.exe" -v -O3 -D NDEBUG
"-Lc:\\Synology\\clang-3.2-WIN64\\lib" -m64 -o "..\\braceless0.exe" CM
akeFiles/braceless0.dir/Braceless.cpp.obj "..\\libAST.a"
"..\\libCompiler.a" "..\\libDriver.a" "..\\libBackend.a"
"..\\libFrontend.a" "..\\libToolbox.a" -lLLVMAsmParser
-lLLVMInstrumentation -lLLVMLinker -lLLVMArchive -lLLVMBitReader
-lLLVMDebugInfo -lLLVMJIT -lLLVMVectorize -LLVMBitWriter -lLLVMTableGen
-lLLVMCppBackendCodeGen -lLLVMCppBackendInfo -lLLVMX86CodeGen
-lLLVMSelectionDAG -lLLVMAsmPrinter -lLLVMX86Disassembler
-lLLVMX86AsmParser -lLLVMX86Desc -lLLVMX86Info -lLLVMX86AsmPrinter
-lLLVMX86Utils -LLVMInterpreter -lLLVMCodeGen -lLLVMScalarOpts
-lLLVMInstCombine -lLLVMTransformUtils -lLLVMipa -lLLVMAnalysis -lLLVMMCJIT
-LLVMRuntimeDyld -lLLVMExecutionEngine -lLLVMTarget -lLLVMMC -lLLVMObject
-lLLVMCore -lLLVMSupport -lDbgHelp -lPsapi -lkernel32 -luser32 -lgdi32
-lwinspool -lshell32 -lole32 -loleaut32 -luuid -lcomdlg32 -ladvapi32
Using built-in specs.
COLLECT_GCC=c:/Mingw64/bin/x86_64-w64-mingw32-g++.exe
COLLECT_LTO_WRAPPER=c:/mingw64/bin/../libexec/gcc/x86_64-w64-mingw32/4.7.1/lto-wrapper.exe
Target: x86_64-w64-mingw32
Configured with: /home/drangon/work/mingw-w64-dgn/source/gcc/configure
--host=x86_64-w64-mingw32 --target=x86_64-w64-mingw32 --disab
le-nls --enable-languages=c,c++,objc,obj-c++
--with-gmp=/home/drangon/work/mingw-w64-dgn/build/for_target
--enable-twoprocess --disa
ble-libstdcxx-pch --disable-win32-registry
--prefix=/home/drangon/work/mingw-w64-dgn/target
--with-sysroot=/home/drangon/work/mingw-
w64-dgn/target
Thread model: win32
gcc version 4.7.1 20120524 (prerelease) (GCC)
4-w64-mingw32/4.7.1/../../../../x86_64-w64-mingw32/bin/
LIBRARY_PATH=c:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/4.7.1/;c:/mingw64/bin/../lib/gcc/;c:/mingw64/bin/../lib/gcc/x86_64-w64-min
gw32/4.7.1/../../../../x86_64-w64-mingw32/lib/../lib/;c:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/4.7.1/../../../../lib/;c:/mingw64
/bin/../lib/gcc/x86_64-w64-mingw32/4.7.1/../../../../x86_64-w64-mingw32/lib/;c:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/4.7.1/../.
./../
COLLECT_GCC_OPTIONS='-v' '-O3' '-D' 'NDEBUG'
'-Lc:\Synology\clang-3.2-WIN64\lib' '-m64' '-o' '..\braceless0.exe'
'-shared-libgcc' '-
mtune=generic' '-march=x86-64'
 c:/mingw64/bin/../libexec/gcc/x86_64-w64-mingw32/4.7.1/collect2.exe
--sysroot=/home/drangon/work/mingw-w64-dgn/target -m i386pep -Bdynamic -o
..\braceless0.exe
c:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/4.7.1/../../../../x86_64-w64-mingw32/lib/../lib/crt2.o
c:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/4.7.1/../../../../x86_64-w64-mingw32/lib/../lib/crtbegin.o
-Lc:\Synology\clang-3.2-WIN64\lib
-c:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/4.7.1
-Lc:/mingw64/bin/../lib/gcc
-Lc:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/4.7.1/../../../../x86_64-w64-mingw32/lib/../lib
-Lc:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/4.7.1/../../../../lib
-Lc:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/4.7.1/../../../../x86_64-w64-mingw32/lib
-Lc:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/4.7.1/../../..
CMakeFiles/braceless0.dir/Braceless.cpp.obj ..\libAST.a ..\libCompiler.a
..\libDriver.a ..\libBackend.a ..\libFrontend.a ..\libToolbox.a
-lLLVMAsmParser -lLLVMInstrumentation -lLLVMLinker -lLLVMArchive
-lLLVMBitReader -lLLVMDebugInfo -lLLVMJIT -LLVMVectorize -lLLVMBitWriter
-lLLVMTableGen -lLLVMCppBackendCodeGen -lLLVMCppBackendInfo
-lLLVMX86CodeGen -lLLVMSelectionDAG -lLLVMAsmPrinter -lLLVMX86Disassembler
-lLLVMX86AsmParser -lLLVMX86Desc -lLLVMX86Info -lLLVMX86AsmPrinter
-lLLVMX86Utils -LLVMInterpreter -lLLVMCodeGen -lLLVMScalarOpts
-lLLVMInstCombine -lLLVMTransformUtils -lLLVMipa -lLLVMAnalysis -lLLVMMCJIT
-LLVMRuntimeDyld -lLLVMExecutionEngine -lLLVMTarget -lLLVMMC -lLLVMObject
-lLLVMCore -lLLVMSupport -lDbgHelp -lPsapi -lkernel32 -user32 -lgdi32
-lwinspool -lshell32 -lole32 -loleaut32 -luuid -lcomdlg32 -ladvapi32
-lstdc++ -lmingw32 -lgcc_s -lgcc -lmoldname -lmingwex -lmsvcrt -ladvapi32
-lshell32 -luser32 -lkernel32 -lmingw32 -lgcc_s -lgcc -lmoldname -lmingwex
-lmsvcrt
c:/mingw64/bin/../lib/gcc/x86_64-w64-mingw32/4.7.1/../../../../x86_64-w64-mingw32/lib/../lib/crtend.o
c:\Synology\clang-3.2-WIN64\lib/libLLVMJIT.a(JIT.cpp.obj):JIT.cpp:(.text$_ZN4llvm15SmallVectorImplINS_15TargetAlignElemEEaSERKS2_[ll
vm::SmallVectorImpl<llvm::TargetAlignElem>::operator=(llvm::SmallVectorImpl<llvm::TargetAlignElem>
const&)]+0x0): multiple definitio
n of
`llvm::SmallVectorImpl<llvm::TargetAlignElem>::operator=(llvm::SmallVectorImpl<llvm::TargetAlignElem>
const&)'

I'm wondering if it can be related to the Drangon v4.7.1 release of Mingw64
that I am using?  It is apparently a prerelease, although it works fine for
my program.  In any event, I'd be the last to be surprised if it is simply
me doing something wrong...


Cheers,
Mikael
-- Love Thy Frog, Dammit!

2012/6/11 Justin Holewinski <justin.holewinski at gmail.com>

>
>
> On Mon, Jun 11, 2012 at 7:57 AM, Mikael Lyngvig <mikael at lyngvig.org>wrote:
>
>> Nope, I didn't include the part where it says "very long path pointing to
>> Mingw64 ld.exe".  So it is not related to MS tools at all.  In fact, the MS
>> tools are not even in the path.
>>
>> Here's the linker command that CMake uses:
>>
>> c:\Synology\clang-3.2-win64\bin\clang++.exe -O3 -DNDEBUG
>> CMakeFiles/braceless0.dir/Braceless.cpp.obj -o ..\braceless0.exe
>> -Lc:\Synology\clang-3.2-WIN64\lib ..\libAST.a ..\libCompiler.a
>> ..\libDriver.a ..\libBackend.a ..\libFrontend.a ..\libToolbox.a
>> -lLLVMAsmParser -lLLVMInstrumentation -lLLVMLinker -lLLVMArchive
>> -lLLVMBitReader -lLLVMDebugInfo -lLLVMJIT -lLLVMVectorize -lLLVMBitWriter
>> -lLLVMTableGen -lLLVMCppBackendCodeGen -lLLVMCppBackendInfo
>> -lLLVMX86CodeGen -lLLVMSelectionDAG -lLLVMAsmPrinter -lLLVMX86Disassembler
>> -lLLVMX86AsmParser -lLLVMX86Desc -lLLVMX86Info -lLLVMX86AsmPrinter
>> -lLLVMX86Utils -lLLVMInterpreter -lLLVMCodeGen -lLLVMScalarOpts
>> -lLLVMInstCombine -lLLVMTransformUtils -lLLVMipa -lLLVMAnalysis -lLLVMMCJIT
>> -lLLVMRuntimeDyld -lLLVMExecutionEngine -lLLVMTarget -lLLVMMC -lLLVMObject
>> -lLLVMCore -lLLVMSupport -lDbgHelp -lPsapi -lkernel32 -luser32 -lgdi32
>> -lwinspool -lshell32 -lole32 -loleaut32 -luuid -lcomdlg32 -ladvapi32
>>
>> I must admit that I don't know how to get Clang to display what linker command it uses when asked to perform the link. The linker, ld.exe, is located in the Mingw64 directory as expected.
>>
>>
>> Add -v to your CMAKE_CXX_FLAGS.
>
>> Cheers,
>> Mikael
>> -- Love Thy Frog!
>> 2012/6/11 Anton Korobeynikov <anton at korobeynikov.info>
>>
>>> > I don't think that's the issue here.  CMake happily tries to link with
>>> the
>>> > mingw libs,
>>> Right, but it seems via MS link...
>>>
>>> --
>>> With best regards, Anton Korobeynikov
>>> Faculty of Mathematics and Mechanics, Saint Petersburg State University
>>>
>>
>>
>
>
> --
>
> Thanks,
>
> Justin Holewinski
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20120611/200de731/attachment.html>


More information about the cfe-dev mailing list