summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTobias Grosser <grosser@fim.uni-passau.de>2012-08-03 07:12:07 +0000
committerTobias Grosser <grosser@fim.uni-passau.de>2012-08-03 07:12:07 +0000
commit5a2925c6a1b3a9dd75a6462fac4c9c1c0fedb4fb (patch)
treefd26a3465197ba03932db1df2090bebabf29a0cb
parentcaa3e7a0ef8b79fd30c37d30dbb8a751150e807d (diff)
downloadbcm5719-llvm-5a2925c6a1b3a9dd75a6462fac4c9c1c0fedb4fb.tar.gz
bcm5719-llvm-5a2925c6a1b3a9dd75a6462fac4c9c1c0fedb4fb.zip
cmake: Fix building of Polly on Apple system
The Apple linker fails by default, if some function calls can not be resolved at link time. However, all functions that are part of LLVM itself will not be linked into Polly, but will be provided by the compiler that Polly is loaded into. Hence, during linking we need to ignore failures due to unresolved function calls. llvm-svn: 161234
-rw-r--r--polly/CMakeLists.txt10
-rwxr-xr-xpolly/lib/CMakeLists.txt2
2 files changed, 11 insertions, 1 deletions
diff --git a/polly/CMakeLists.txt b/polly/CMakeLists.txt
index 37b8c18e06e..da39a876602 100644
--- a/polly/CMakeLists.txt
+++ b/polly/CMakeLists.txt
@@ -170,6 +170,16 @@ macro(add_polly_library name)
ARCHIVE DESTINATION lib${LLVM_LIBDIR_SUFFIX})
endmacro(add_polly_library)
+macro(add_polly_loadable_module name)
+ set(srcs ${ARGN})
+ add_polly_library(${name} ${srcs})
+ if (APPLE)
+ # Darwin-specific linker flags for loadable modules.
+ set_target_properties(${name} PROPERTIES
+ LINK_FLAGS "-Wl,-flat_namespace -Wl,-undefined -Wl,suppress")
+ endif()
+endmacro(add_polly_loadable_module)
+
include_directories(
${CMAKE_CURRENT_SOURCE_DIR}/include
${CMAKE_CURRENT_SOURCE_DIR}/lib/JSON/include
diff --git a/polly/lib/CMakeLists.txt b/polly/lib/CMakeLists.txt
index e79e791658f..b73301eb02c 100755
--- a/polly/lib/CMakeLists.txt
+++ b/polly/lib/CMakeLists.txt
@@ -23,7 +23,7 @@ set(LLVM_USED_LIBS
PollyJSON
)
-add_polly_library(LLVMPolly
+add_polly_loadable_module(LLVMPolly
CodePreparation.cpp
DeadCodeElimination.cpp
IndependentBlocks.cpp
OpenPOWER on IntegriCloud