[libcxx-commits] [PATCH] D110261: [libc++][release] Do not force building the runtimes with -fPIC
Louis Dionne via Phabricator via libcxx-commits
libcxx-commits at lists.llvm.org
Tue Nov 9 06:50:10 PST 2021
ldionne updated this revision to Diff 385803.
ldionne added a comment.
Rebase onto main. Gentle ping, I do not know how to verify that this is going to fix the
issues that people were seeing.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D110261/new/
https://reviews.llvm.org/D110261
Files:
libcxx/docs/ReleaseNotes.rst
libcxx/src/CMakeLists.txt
libcxxabi/src/CMakeLists.txt
libunwind/src/CMakeLists.txt
llvm/utils/release/test-release.sh
Index: llvm/utils/release/test-release.sh
===================================================================
--- llvm/utils/release/test-release.sh
+++ llvm/utils/release/test-release.sh
@@ -386,12 +386,14 @@
echo "#" env CC="$c_compiler" CXX="$cxx_compiler" \
cmake -G "$generator" \
-DCMAKE_BUILD_TYPE=$BuildType -DLLVM_ENABLE_ASSERTIONS=$Assertions \
+ -DCMAKE_POSITION_INDEPENDENT_CODE=ON \
-DLLVM_ENABLE_PROJECTS="$project_list" \
$ExtraConfigureFlags $BuildDir/llvm-project/llvm \
2>&1 | tee $LogDir/llvm.configure-Phase$Phase-$Flavor.log
env CC="$c_compiler" CXX="$cxx_compiler" \
cmake -G "$generator" \
-DCMAKE_BUILD_TYPE=$BuildType -DLLVM_ENABLE_ASSERTIONS=$Assertions \
+ -DCMAKE_POSITION_INDEPENDENT_CODE=ON \
-DLLVM_ENABLE_PROJECTS="$project_list" \
$ExtraConfigureFlags $BuildDir/llvm-project/llvm \
2>&1 | tee $LogDir/llvm.configure-Phase$Phase-$Flavor.log
Index: libunwind/src/CMakeLists.txt
===================================================================
--- libunwind/src/CMakeLists.txt
+++ libunwind/src/CMakeLists.txt
@@ -145,7 +145,6 @@
OUTPUT_NAME "unwind"
VERSION "1.0"
SOVERSION "1"
- POSITION_INDEPENDENT_CODE ON
)
list(APPEND LIBUNWIND_BUILD_TARGETS "unwind_shared")
if (LIBUNWIND_INSTALL_SHARED_LIBRARY)
@@ -171,7 +170,6 @@
LINK_FLAGS "${LIBUNWIND_LINK_FLAGS}"
LINKER_LANGUAGE C
OUTPUT_NAME "unwind"
- POSITION_INDEPENDENT_CODE ON
)
if(LIBUNWIND_HIDE_SYMBOLS)
Index: libcxxabi/src/CMakeLists.txt
===================================================================
--- libcxxabi/src/CMakeLists.txt
+++ libcxxabi/src/CMakeLists.txt
@@ -192,7 +192,6 @@
SOVERSION "1"
VERSION "${LIBCXXABI_LIBRARY_VERSION}"
DEFINE_SYMBOL ""
- POSITION_INDEPENDENT_CODE ON
)
list(APPEND LIBCXXABI_BUILD_TARGETS "cxxabi_shared")
@@ -245,7 +244,6 @@
COMPILE_FLAGS "${LIBCXXABI_COMPILE_FLAGS}"
LINK_FLAGS "${LIBCXXABI_LINK_FLAGS}"
OUTPUT_NAME "c++abi"
- POSITION_INDEPENDENT_CODE ON
)
if(LIBCXXABI_HERMETIC_STATIC_LIBRARY)
Index: libcxx/src/CMakeLists.txt
===================================================================
--- libcxx/src/CMakeLists.txt
+++ libcxx/src/CMakeLists.txt
@@ -206,7 +206,6 @@
VERSION "${LIBCXX_ABI_VERSION}.0"
SOVERSION "${LIBCXX_ABI_VERSION}"
DEFINE_SYMBOL ""
- POSITION_INDEPENDENT_CODE ON
)
cxx_add_common_build_flags(cxx_shared)
cxx_set_common_defines(cxx_shared)
@@ -281,7 +280,6 @@
COMPILE_FLAGS "${LIBCXX_COMPILE_FLAGS}"
LINK_FLAGS "${LIBCXX_LINK_FLAGS}"
OUTPUT_NAME "c++"
- POSITION_INDEPENDENT_CODE ON
)
cxx_add_common_build_flags(cxx_static)
cxx_set_common_defines(cxx_static)
Index: libcxx/docs/ReleaseNotes.rst
===================================================================
--- libcxx/docs/ReleaseNotes.rst
+++ libcxx/docs/ReleaseNotes.rst
@@ -126,3 +126,7 @@
.. code-block:: bash
$ cmake -S <monorepo>/runtimes -B build -DLLVM_ENABLE_RUNTIMES="libcxx;libcxxabi" <LIBCXX-OPTIONS> <LIBCXXABI-OPTIONS>
+
+- Libc++, libc++abi and libunwind will not be built with ``-fPIC`` by default anymore.
+ If you want to build those runtimes with position independent code, please specify
+ ``-DCMAKE_POSITION_INDEPENDENT_CODE=ON`` explicitly when configuring the build.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D110261.385803.patch
Type: text/x-patch
Size: 3465 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20211109/bd059e92/attachment-0001.bin>
More information about the libcxx-commits
mailing list