[libcxx-commits] [PATCH] D60049: [libc++abi] Add LIBCXXABI_ENABLE_PIC cmake option

Sam Clegg via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Tue Apr 2 17:34:06 PDT 2019


This revision was automatically updated to reflect the committed changes.
Closed by commit rG31d7394dc7c7: [libc++abi] Add LIBCXXABI_ENABLE_PIC cmake option (authored by sbc100).

Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D60049/new/

https://reviews.llvm.org/D60049

Files:
  libcxxabi/CMakeLists.txt
  libcxxabi/src/CMakeLists.txt


Index: libcxxabi/src/CMakeLists.txt
===================================================================
--- libcxxabi/src/CMakeLists.txt
+++ libcxxabi/src/CMakeLists.txt
@@ -155,6 +155,10 @@
                           COMPILE_FLAGS
                             "${LIBCXXABI_COMPILE_FLAGS}")
 
+  if(LIBCXXABI_ENABLE_PIC)
+    set_target_properties(${name} PROPERTIES POSITION_INDEPENDENT_CODE ON)
+  endif()
+
   if(ARGS_DEFINES)
     target_compile_definitions(${name} PRIVATE ${ARGS_DEFINES})
   endif()
@@ -177,7 +181,6 @@
 endif()
 
 cxxabi_object_library(cxxabi_shared_objects)
-set_target_properties(cxxabi_shared_objects PROPERTIES POSITION_INDEPENDENT_CODE ON)
 
 set(cxxabi_static_sources $<TARGET_OBJECTS:cxxabi_static_objects>)
 set(cxxabi_shared_sources $<TARGET_OBJECTS:cxxabi_shared_objects>)
Index: libcxxabi/CMakeLists.txt
===================================================================
--- libcxxabi/CMakeLists.txt
+++ libcxxabi/CMakeLists.txt
@@ -46,6 +46,7 @@
 option(LIBCXXABI_ENABLE_EXCEPTIONS "Use exceptions." ON)
 option(LIBCXXABI_ENABLE_ASSERTIONS "Enable assertions independent of build mode." ON)
 option(LIBCXXABI_ENABLE_PEDANTIC "Compile with pedantic enabled." ON)
+option(LIBCXXABI_ENABLE_PIC "Build Position-Independent Code, even in static library" ON)
 option(LIBCXXABI_ENABLE_WERROR "Fail and stop if a warning is triggered." OFF)
 option(LIBCXXABI_USE_LLVM_UNWINDER "Build and use the LLVM unwinder." OFF)
 option(LIBCXXABI_ENABLE_STATIC_UNWINDER "Statically link the LLVM unwinder." OFF)


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D60049.193403.patch
Type: text/x-patch
Size: 1529 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20190403/09098d40/attachment.bin>


More information about the libcxx-commits mailing list