[PATCH] D85626: [tools][remarks-shlib] Don't build libRemarks.so without PIC
Rainer Orth via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Sep 18 07:08:11 PDT 2020
ro updated this revision to Diff 292742.
ro added a comment.
Wrap whole file in `if(LLVM_ENABLE_PIC)`.
Tested on `amd64-pc-solaris2.11` with and without `-DLLVM_ENABLE_PIC=Off`.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D85626/new/
https://reviews.llvm.org/D85626
Files:
llvm/tools/remarks-shlib/CMakeLists.txt
Index: llvm/tools/remarks-shlib/CMakeLists.txt
===================================================================
--- llvm/tools/remarks-shlib/CMakeLists.txt
+++ llvm/tools/remarks-shlib/CMakeLists.txt
@@ -1,27 +1,32 @@
-set(LLVM_LINK_COMPONENTS
- Remarks
- )
+# Building shared libraries requires PIC objects.
+if(LLVM_ENABLE_PIC)
+
+ set(LLVM_LINK_COMPONENTS
+ Remarks
+ )
-set(SOURCES
- libremarks.cpp
- )
+ set(SOURCES
+ libremarks.cpp
+ )
-set(LLVM_EXPORTED_SYMBOL_FILE ${CMAKE_CURRENT_SOURCE_DIR}/Remarks.exports)
+ set(LLVM_EXPORTED_SYMBOL_FILE ${CMAKE_CURRENT_SOURCE_DIR}/Remarks.exports)
-add_llvm_library(Remarks SHARED INSTALL_WITH_TOOLCHAIN ${SOURCES})
+ add_llvm_library(Remarks SHARED INSTALL_WITH_TOOLCHAIN ${SOURCES})
-if (LLVM_INTEGRATED_CRT_ALLOC AND MSVC)
- # Make sure we search LLVMSupport first, before the CRT libs
- set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -INCLUDE:malloc")
-endif()
+ if (LLVM_INTEGRATED_CRT_ALLOC AND MSVC)
+ # Make sure we search LLVMSupport first, before the CRT libs
+ set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -INCLUDE:malloc")
+ endif()
-install(FILES ${LLVM_MAIN_INCLUDE_DIR}/llvm-c/Remarks.h
- DESTINATION include/llvm-c
- COMPONENT Remarks)
+ install(FILES ${LLVM_MAIN_INCLUDE_DIR}/llvm-c/Remarks.h
+ DESTINATION include/llvm-c
+ COMPONENT Remarks)
-if (APPLE)
- set(REMARKS_VERSION ${LLVM_VERSION_MAJOR})
- set_property(TARGET Remarks APPEND_STRING PROPERTY
- LINK_FLAGS
- " -compatibility_version 1 -current_version ${REMARKS_VERSION}.${LLVM_VERSION_MINOR}.${LLVM_VERSION_PATCH}")
+ if (APPLE)
+ set(REMARKS_VERSION ${LLVM_VERSION_MAJOR})
+ set_property(TARGET Remarks APPEND_STRING PROPERTY
+ LINK_FLAGS
+ " -compatibility_version 1 -current_version ${REMARKS_VERSION}.${LLVM_VERSION_MINOR}.${LLVM_VERSION_PATCH}")
+ endif()
+
endif()
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D85626.292742.patch
Type: text/x-patch
Size: 1949 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200918/532b454b/attachment.bin>
More information about the llvm-commits
mailing list