[libcxx-commits] [PATCH] D59250: [libc++] Do not force building with -fPIC (re-applying)

Louis Dionne via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Tue Mar 12 06:25:49 PDT 2019

ldionne created this revision.
ldionne added reviewers: EricWF, smeenai.
Herald added subscribers: libcxx-commits, dexonsmith, jkorous, christof, mgorny.

In r355746, we stopped forcing to build with -fPIC because that should
be specified by the CMAKE_POSITION_INDEPENDENT_CODE option at CMake
configure time (and by default -fPIC is used for shared libraries anyways).

However, r355746 had to be reverted in r355756 because we were not
actually building the shared library with -fPIC. The reason is that
we were sharing an object library between the static and the shared
library, which caused flags for static libraries to be used when
building object files that were going to be used for a shared library.

Since this is resolved, we can stop forcing -fPIC again.

  rCXX libc++



Index: libcxx/lib/CMakeLists.txt
--- libcxx/lib/CMakeLists.txt
+++ libcxx/lib/CMakeLists.txt
@@ -105,10 +105,6 @@
 # Setup flags.
-if (NOT WIN32)
-  add_flags_if_supported(-fPIC)

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D59250.190246.patch
Type: text/x-patch
Size: 344 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20190312/c9eed069/attachment.bin>

More information about the libcxx-commits mailing list