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
This commit is contained in:
Oscar Fuentes 2011-07-28 02:33:52 +00:00
parent 3f01f673e5
commit 4ebc5916e9
6 changed files with 12 additions and 0 deletions

View File

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

View File

@ -5,3 +5,5 @@ add_llvm_library(LLVMMBlazeDesc
MBlazeMCTargetDesc.cpp
)
add_dependencies(LLVMMBlazeDesc MBlazeCommonTableGen)
target_link_libraries(LLVMMBlazeDesc LLVMMBlazeAsmPrinter)

View File

@ -3,3 +3,5 @@ add_llvm_library(LLVMMSP430Desc
MSP430MCAsmInfo.cpp
)
add_dependencies(LLVMMSP430Desc MSP430CommonTableGen)
target_link_libraries(LLVMMSP430Desc LLVMMSP430AsmPrinter)

View File

@ -3,3 +3,5 @@ add_llvm_library(LLVMMipsDesc
MipsMCAsmInfo.cpp
)
add_dependencies(LLVMMipsDesc MipsCommonTableGen)
target_link_libraries(LLVMMipsDesc LLVMMipsAsmPrinter)

View File

@ -6,3 +6,5 @@ add_llvm_library(LLVMPowerPCDesc
PPCPredicates.cpp
)
add_dependencies(LLVMPowerPCDesc PowerPCCommonTableGen)
target_link_libraries(LLVMPowerPCDesc LLVMPowerPCAsmPrinter)

View File

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