Try to conditional link the pref lib

This commit is contained in:
Sameer Rahmani 2022-06-18 10:47:32 +01:00
parent b1858524e1
commit fb7097565d
2 changed files with 8 additions and 7 deletions

View File

@ -279,6 +279,10 @@ if(CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME)
# endforeach(arch)
set(CONDITIONAL_COMPONENTS "")
if(LLVM_USE_PERF)
list(APPEND CONDITIONAL_COMPONENTS PerfJITEvents)
endif()
llvm_map_components_to_libnames(llvm_libs
core
support
@ -289,6 +293,7 @@ if(CMAKE_PROJECT_NAME STREQUAL PROJECT_NAME)
# x86asmparser
# x86codegen
ExecutionEngine
${CONDITIONAL_COMPONENTS}
${LLVM_TARGETS_TO_BUILD}
)

View File

@ -106,13 +106,9 @@ Halley::Halley(std::unique_ptr<SereneContext> ctx,
? llvm::JITEventListener::createGDBRegistrationListener()
: nullptr),
perfListener(
// TODO: [llvm] Remove this line when apt.llvm.org fixed the undefined symbol
// for createPerfJITEventListener
#define LLVM_USE_PERF 0
ctx->opts.JITenablePerfNotificationListener
? llvm::JITEventListener::createPerfJITEventListener()
: nullptr),
perfListener(ctx->opts.JITenablePerfNotificationListener
? llvm::JITEventListener::createPerfJITEventListener()
: nullptr),
jtmb(jtmb), dl(dl), ctx(std::move(ctx)){};
// MaybeJITPtr Halley::lookup(exprs::Symbol &sym) const {