[llvm-commits] [polly] r161234 - in /polly/trunk: CMakeLists.txt lib/CMakeLists.txt

Tobias Grosser grosser at fim.uni-passau.de
Fri Aug 3 00:12:07 PDT 2012


Author: grosser
Date: Fri Aug  3 02:12:07 2012
New Revision: 161234

URL: http://llvm.org/viewvc/llvm-project?rev=161234&view=rev
Log:
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.

Modified:
    polly/trunk/CMakeLists.txt
    polly/trunk/lib/CMakeLists.txt

Modified: polly/trunk/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/CMakeLists.txt?rev=161234&r1=161233&r2=161234&view=diff
==============================================================================
--- polly/trunk/CMakeLists.txt (original)
+++ polly/trunk/CMakeLists.txt Fri Aug  3 02:12:07 2012
@@ -170,6 +170,16 @@
     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

Modified: polly/trunk/lib/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/polly/trunk/lib/CMakeLists.txt?rev=161234&r1=161233&r2=161234&view=diff
==============================================================================
--- polly/trunk/lib/CMakeLists.txt (original)
+++ polly/trunk/lib/CMakeLists.txt Fri Aug  3 02:12:07 2012
@@ -23,7 +23,7 @@
   PollyJSON
   )
 
-add_polly_library(LLVMPolly
+add_polly_loadable_module(LLVMPolly
   CodePreparation.cpp
   DeadCodeElimination.cpp
   IndependentBlocks.cpp





More information about the llvm-commits mailing list