From: Oscar Fuentes Date: Thu, 28 Jul 2011 02:33:52 +0000 (+0000) Subject: Explicitly declare a library dependency of LLVM*Desc to X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=4ebc5916e9b3a43af8aff8e1b8744b1644457a4b;p=oota-llvm.git Explicitly declare a library dependency of LLVM*Desc to LLVM*AsmPrinter. GenLibDeps.pl fails to detect vtable references. As this is the only referenced symbol from LLVM*Desc to LLVM*AsmPrinter on optimized builds, the algorithm that creates the list of libraries to be linked into tools doesn't know about the dependency and sometimes places the libraries on the wrong order, yielding error messages like this: ../../lib/libLLVMARMDesc.a(ARMMCTargetDesc.cpp.o): In function `llvm::ARMInstPrinter::ARMInstPrinter(llvm::MCAsmInfo const&)': ARMMCTargetDesc.cpp:(.text._ZN4llvm14ARMInstPrinterC1ERKNS_9MCAsmInfoE [llvm::ARMInstPrinter::ARMInstPrinter(llvm::MCAsmInfo const&)]+0x2a): undefined reference to `vtable for llvm::ARMInstPrinter' git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@136328 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Target/ARM/MCTargetDesc/CMakeLists.txt b/lib/Target/ARM/MCTargetDesc/CMakeLists.txt index aca56716779..df2cf81be2c 100644 --- a/lib/Target/ARM/MCTargetDesc/CMakeLists.txt +++ b/lib/Target/ARM/MCTargetDesc/CMakeLists.txt @@ -10,3 +10,5 @@ add_dependencies(LLVMARMDesc ARMCommonTableGen) # Hack: we need to include 'main' target directory to grab private headers include_directories(${CMAKE_CURRENT_SOURCE_DIR}/.. ${CMAKE_CURRENT_BINARY_DIR}/..) + +target_link_libraries(LLVMARMDesc LLVMARMAsmPrinter) diff --git a/lib/Target/MBlaze/MCTargetDesc/CMakeLists.txt b/lib/Target/MBlaze/MCTargetDesc/CMakeLists.txt index ef8d679d745..247dfe884ea 100644 --- a/lib/Target/MBlaze/MCTargetDesc/CMakeLists.txt +++ b/lib/Target/MBlaze/MCTargetDesc/CMakeLists.txt @@ -5,3 +5,5 @@ add_llvm_library(LLVMMBlazeDesc MBlazeMCTargetDesc.cpp ) add_dependencies(LLVMMBlazeDesc MBlazeCommonTableGen) + +target_link_libraries(LLVMMBlazeDesc LLVMMBlazeAsmPrinter) diff --git a/lib/Target/MSP430/MCTargetDesc/CMakeLists.txt b/lib/Target/MSP430/MCTargetDesc/CMakeLists.txt index f30317b606b..45b9ae88954 100644 --- a/lib/Target/MSP430/MCTargetDesc/CMakeLists.txt +++ b/lib/Target/MSP430/MCTargetDesc/CMakeLists.txt @@ -3,3 +3,5 @@ add_llvm_library(LLVMMSP430Desc MSP430MCAsmInfo.cpp ) add_dependencies(LLVMMSP430Desc MSP430CommonTableGen) + +target_link_libraries(LLVMMSP430Desc LLVMMSP430AsmPrinter) diff --git a/lib/Target/Mips/MCTargetDesc/CMakeLists.txt b/lib/Target/Mips/MCTargetDesc/CMakeLists.txt index 332c1a0a8b0..98760c5cd25 100644 --- a/lib/Target/Mips/MCTargetDesc/CMakeLists.txt +++ b/lib/Target/Mips/MCTargetDesc/CMakeLists.txt @@ -3,3 +3,5 @@ add_llvm_library(LLVMMipsDesc MipsMCAsmInfo.cpp ) add_dependencies(LLVMMipsDesc MipsCommonTableGen) + +target_link_libraries(LLVMMipsDesc LLVMMipsAsmPrinter) diff --git a/lib/Target/PowerPC/MCTargetDesc/CMakeLists.txt b/lib/Target/PowerPC/MCTargetDesc/CMakeLists.txt index a2b20b29c7d..78e7ab5a808 100644 --- a/lib/Target/PowerPC/MCTargetDesc/CMakeLists.txt +++ b/lib/Target/PowerPC/MCTargetDesc/CMakeLists.txt @@ -6,3 +6,5 @@ add_llvm_library(LLVMPowerPCDesc PPCPredicates.cpp ) add_dependencies(LLVMPowerPCDesc PowerPCCommonTableGen) + +target_link_libraries(LLVMPowerPCDesc LLVMPowerPCAsmPrinter) diff --git a/lib/Target/X86/MCTargetDesc/CMakeLists.txt b/lib/Target/X86/MCTargetDesc/CMakeLists.txt index be113711c05..4e7995d76b8 100644 --- a/lib/Target/X86/MCTargetDesc/CMakeLists.txt +++ b/lib/Target/X86/MCTargetDesc/CMakeLists.txt @@ -9,3 +9,5 @@ add_dependencies(LLVMX86Desc X86CommonTableGen) # Hack: we need to include 'main' target directory to grab private headers include_directories(${CMAKE_CURRENT_SOURCE_DIR}/.. ${CMAKE_CURRENT_BINARY_DIR}/..) + +target_link_libraries(LLVMX86Desc LLVMX86AsmPrinter)