From 0e21ee85aaa334476f73e0f3d5c6ab6b46859c99 Mon Sep 17 00:00:00 2001 From: Christoph Egger Date: Wed, 26 Nov 2014 20:32:54 +0100 Subject: [PATCH] Clean up LLVM Linking and use LLVM.so LLVM.so prevents segfaults when running with an llvmized graphics driver as it avoids linking against LLVM multiple times (and using incompatible versions). --- CMakeLists.txt | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index bd078ad..87bed5a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -22,9 +22,10 @@ if(NOT LLVM_CONFIG) message(FATAL_ERROR "LLVM not found") endif() -execute_process(COMMAND ${LLVM_CONFIG} --cxxflags OUTPUT_VARIABLE LLVM_CFLAGS OUTPUT_STRIP_TRAILING_WHITESPACE) -execute_process(COMMAND ${LLVM_CONFIG} --ldflags OUTPUT_VARIABLE LLVM_LDFLAGS OUTPUT_STRIP_TRAILING_WHITESPACE) -execute_process(COMMAND ${LLVM_CONFIG} --libs OUTPUT_VARIABLE LLVM_LIBS OUTPUT_STRIP_TRAILING_WHITESPACE) +execute_process(COMMAND ${LLVM_CONFIG} --cxxflags OUTPUT_VARIABLE LLVM_CFLAGS OUTPUT_STRIP_TRAILING_WHITESPACE) +execute_process(COMMAND ${LLVM_CONFIG} --ldflags OUTPUT_VARIABLE LLVM_LDFLAGS OUTPUT_STRIP_TRAILING_WHITESPACE) +execute_process(COMMAND ${LLVM_CONFIG} --libs OUTPUT_VARIABLE LLVM_LIBS OUTPUT_STRIP_TRAILING_WHITESPACE) +execute_process(COMMAND ${LLVM_CONFIG} --system-libs OUTPUT_VARIABLE LLVM_SYSTEM_LIBS OUTPUT_STRIP_TRAILING_WHITESPACE) string(REPLACE -O2 '' LLVM_CFLAGS ${LLVM_CFLAGS}) @@ -63,4 +64,4 @@ ADD_DEFINITIONS(${QT_DEFINITIONS}) qt5_use_modules(frida Widgets) INCLUDE_DIRECTORIES("src") -TARGET_LINK_LIBRARIES(frida ${QT_LIBRARIES} ${LLVM_LDFLAGS} ${LLVM_LIBS} ${LOG4CXX_LDFLAGS} ${GUILE_LDFLAGS} -ltinfo -lpthread -ldl) +TARGET_LINK_LIBRARIES(frida ${QT_LIBRARIES} ${LLVM_LDFLAGS} -lLLVM-3.5 ${LLVM_SYSTEM_LIBS} ${LOG4CXX_LDFLAGS} ${GUILE_LDFLAGS}) -- 2.39.5