[PATCH] D44650: Fix build of llvm-cfi-verify on mingw32
Valentin Churavy via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Mar 19 16:16:13 PDT 2018
vchuravy created this revision.
Herald added subscribers: llvm-commits, JDevlieghere, aprantl, mgorny.
While cross-compiling LLVM for MINGW32 I am running into the following
issue:
../../lib/libLLVMSymbolize.a(Symbolize.cpp.obj):Symbolize.cpp:(.text+0x840):
multiple definition of `llvm::symbolize::LLVMSymbolizer::flush()'
../../lib/libLLVM.dll.a(d023843.o):(.text+0x0): first defined here
../../lib/libLLVMMC.a(MCContext.cpp.obj):MCContext.cpp:(.text+0x6300):
multiple definition of `llvm::MCContext::~MCContext()'
../../lib/libLLVM.dll.a(d023604.o):(.text+0x0): first defined here
../../lib/libLLVMSupport.a(CommandLine.cpp.obj):CommandLine.cpp:(.text+0x0):
multiple definition of `llvm::cl::GenericOptionValue::anchor()'
../../lib/libLLVM.dll.a(d015473.o):(.text+0x0): first defined here
Which appears because `llvm-cfi-verify` is build both against the
`libLLVM.a.dll` and transient dependencies:
cat tools/llvm-cfi-verify/CMakeFiles/llvm-cfi-verify.dir/link.txt
/usr/local/bin/cmake -E remove -f
CMakeFiles/llvm-cfi-verify.dir/objects.a
/opt/x86_64-w64-mingw32/bin/x86_64-w64-mingw32-ar cr
CMakeFiles/llvm-cfi-verify.dir/objects.a
@CMakeFiles/llvm-cfi-verify.dir/objects1.rsp
/opt/x86_64-w64-mingw32/bin/x86_64-w64-mingw32-g++ -m64
-D__USING_SJLJ_EXCEPTIONS__ -D__CRT__NO_INLINE__ -Wa,-mbig-obj
-Werror=date-time -std=gnu++11 -Wall -W -Wno-unused-parameter
-Wwrite-strings -Wcast-qual -Wno-missing-field-initializers -pedantic
-Wno-long-long -Wno-maybe-uninitialized -Wdelete-non-virtual-dtor
-Wno-comment -O2 -DNDEBUG -Wl,--stack,16777216 -Wl,--whole-archive
CMakeFiles/llvm-cfi-verify.dir/objects.a -Wl,--no-whole-archive -o
../../bin/llvm-cfi-verify.exe
-Wl,--out-implib,../../lib/libllvm-cfi-verify.dll.a
-Wl,--major-image-version,0,--minor-image-version,0
@CMakeFiles/llvm-cfi-verify.dir/linklibs.rsp
cat tools/llvm-cfi-verify/CMakeFiles/llvm-cfi-verify.dir/linklibs.rsp
../../lib/libLLVM.dll.a ../../lib/libLLVMCFIVerify.a
../../lib/libLLVMSymbolize.a ../../lib/libLLVMDebugInfoDWARF.a
../../lib/libLLVMDebugInfoPDB.a ../../lib/libLLVMObject.a
../../lib/libLLVMMCParser.a ../../lib/libLLVMMC.a
../../lib/libLLVMBitReader.a ../../lib/libLLVMCore.a
../../lib/libLLVMBinaryFormat.a ../../lib/libLLVMDebugInfoCodeView.a
../../lib/libLLVMDebugInfoMSF.a ../../lib/libLLVMSupport.a -lpsapi
-lshell32 -lole32 -luuid -ladvapi32 ../../lib/libLLVMDemangle.a
-lkernel32 -luser32 -lgdi32 -lwinspool -lshell32 -lole32 -loleaut32
-luuid -lcomdlg32 -ladvapi32
We can avoid this mess by passing in `DISABLE_LLVM_LINK_LLVM_DYLIB` to
`add_llvm_tool`
Repository:
rL LLVM
https://reviews.llvm.org/D44650
Files:
tools/llvm-cfi-verify/CMakeLists.txt
Index: tools/llvm-cfi-verify/CMakeLists.txt
===================================================================
--- tools/llvm-cfi-verify/CMakeLists.txt
+++ tools/llvm-cfi-verify/CMakeLists.txt
@@ -11,7 +11,7 @@
Symbolize
)
-add_llvm_tool(llvm-cfi-verify
+add_llvm_tool(llvm-cfi-verify DISABLE_LLVM_LINK_LLVM_DYLIB
llvm-cfi-verify.cpp)
add_subdirectory(lib)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D44650.139025.patch
Type: text/x-patch
Size: 372 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180319/bec35220/attachment.bin>
More information about the llvm-commits
mailing list