mirror of
https://github.com/RPCS3/llvm-mirror.git
synced 2024-11-23 11:13:28 +01:00
c884b23a0a
MCTargetOptionsCommandFlags.inc and CommandFlags.inc are headers which contain cl::opt with static storage. These headers are meant to be incuded by tools to make it easier to parametrize codegen/mc. However, these headers are also included in at least two libraries: lldCommon and handle-llvm. As a result, when creating DYLIB, clang-cpp holds a reference to the options, and lldCommon holds another reference. Linking the two in a single executable, as zig does[0], results in a double registration. This patch explores an other approach: the .inc files are moved to regular files, and the registration happens on-demand through static declaration of options in the constructor of a static object. [0] https://bugzilla.redhat.com/show_bug.cgi?id=1756977#c5 Differential Revision: https://reviews.llvm.org/D75579
58 lines
832 B
CMake
58 lines
832 B
CMake
if ( LLVM_INCLUDE_UTILS )
|
|
add_subdirectory(ChildTarget)
|
|
endif()
|
|
|
|
set(LLVM_LINK_COMPONENTS
|
|
CodeGen
|
|
Core
|
|
ExecutionEngine
|
|
IRReader
|
|
Interpreter
|
|
MC
|
|
MCJIT
|
|
Object
|
|
OrcError
|
|
OrcJIT
|
|
Passes
|
|
RuntimeDyld
|
|
SelectionDAG
|
|
Support
|
|
Target
|
|
TransformUtils
|
|
native
|
|
)
|
|
|
|
if( LLVM_USE_OPROFILE )
|
|
set(LLVM_LINK_COMPONENTS
|
|
${LLVM_LINK_COMPONENTS}
|
|
OProfileJIT
|
|
)
|
|
endif( LLVM_USE_OPROFILE )
|
|
|
|
if( LLVM_USE_INTEL_JITEVENTS )
|
|
set(LLVM_LINK_COMPONENTS
|
|
${LLVM_LINK_COMPONENTS}
|
|
DebugInfoDWARF
|
|
IntelJITEvents
|
|
Object
|
|
)
|
|
endif( LLVM_USE_INTEL_JITEVENTS )
|
|
|
|
if( LLVM_USE_PERF )
|
|
set(LLVM_LINK_COMPONENTS
|
|
${LLVM_LINK_COMPONENTS}
|
|
DebugInfoDWARF
|
|
PerfJITEvents
|
|
Object
|
|
)
|
|
endif( LLVM_USE_PERF )
|
|
|
|
add_llvm_tool(lli
|
|
lli.cpp
|
|
|
|
DEPENDS
|
|
intrinsics_gen
|
|
)
|
|
|
|
export_executable_symbols(lli)
|