[PATCH] D85627: [polly][cmake] Don't build LLVMPolly.so without PIC
Rainer Orth via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Aug 19 07:51:13 PDT 2020
ro updated this revision to Diff 286559.
ro added a comment.
Improve comments.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D85627/new/
https://reviews.llvm.org/D85627
Files:
polly/CMakeLists.txt
polly/cmake/CMakeLists.txt
polly/lib/CMakeLists.txt
Index: polly/lib/CMakeLists.txt
===================================================================
--- polly/lib/CMakeLists.txt
+++ polly/lib/CMakeLists.txt
@@ -137,8 +137,9 @@
# Create a loadable module Polly.so that can be loaded using
# LLVM's/clang's "-load" option.
-if (MSVC)
- # Add dummy target, because loadable modules are not supported on Windows
+if (MSVC OR NOT LLVM_ENABLE_PIC)
+ # Add dummy target, either because loadable modules are not supported
+ # as on Windows or because PIC code has been disabled
add_custom_target(LLVMPolly)
set_target_properties(LLVMPolly PROPERTIES FOLDER "Polly")
else ()
Index: polly/cmake/CMakeLists.txt
===================================================================
--- polly/cmake/CMakeLists.txt
+++ polly/cmake/CMakeLists.txt
@@ -10,8 +10,8 @@
endif()
set(POLLY_CONFIG_EXPORTED_TARGETS Polly ${ISL_TARGET})
-if (NOT MSVC)
- # LLVMPolly is a dummy target on Win
+if (NOT MSVC AND LLVM_ENABLE_PIC)
+ # LLVMPolly is a dummy target on Win or PIC code is disabled.
list(APPEND POLLY_CONFIG_EXPORTED_TARGETS LLVMPolly)
endif()
if (POLLY_ENABLE_GPGPU_CODEGEN)
Index: polly/CMakeLists.txt
===================================================================
--- polly/CMakeLists.txt
+++ polly/CMakeLists.txt
@@ -39,8 +39,10 @@
set(POLLY_GTEST_AVAIL 1)
endif()
- # Make sure the isl c files are built as fPIC
- set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC")
+ if (LLVM_ENABLE_PIC)
+ # Make sure the isl c files are built as fPIC if possible
+ set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fPIC")
+ endif ()
# Set directory for polly-isl-test.
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "${CMAKE_CURRENT_BINARY_DIR}/bin")
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D85627.286559.patch
Type: text/x-patch
Size: 1699 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200819/095b0e83/attachment.bin>
More information about the llvm-commits
mailing list