[all-commits] [llvm/llvm-project] a6e556: [libc++][release] Do not force building the runtim...
Louis Dionne via All-commits
all-commits at lists.llvm.org
Wed Dec 8 08:35:31 PST 2021
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: a6e5563dfaff0cb7147058b9c49e38b611a28fb1
https://github.com/llvm/llvm-project/commit/a6e5563dfaff0cb7147058b9c49e38b611a28fb1
Author: Louis Dionne <ldionne.2 at gmail.com>
Date: 2021-12-08 (Wed, 08 Dec 2021)
Changed paths:
M libcxx/docs/ReleaseNotes.rst
M libcxx/src/CMakeLists.txt
M libcxx/test/libcxx/debug/extern-templates.sh.cpp
M libcxx/utils/libcxx/test/dsl.py
M libcxx/utils/libcxx/test/features.py
M libcxxabi/src/CMakeLists.txt
M libunwind/src/CMakeLists.txt
M llvm/utils/release/test-release.sh
Log Message:
-----------
[libc++][release] Do not force building the runtimes with -fPIC
There's a lot of history behind this, so here's a summary:
1. I stopped forcing -fPIC when building the runtimes in 30f305efe279,
before the LLVM 9 release back in 2019.
2. Someone complained that libc++.a couldn't be used in shared libraries
built without -fPIC (http://llvm.org/PR43604) since the LLVM 9 release.
This had been caused by my removal of -fPIC when building libc++.a in (1).
3. I suggested two ways of fixing the issue, the first being to force
-fPIC back unconditionally (http://llvm.org/D104328), and the second
being to specify that option explicitly when building the LLVM release
(http://llvm.org/D104327). We converged on the first solution.
4. I landed D104328, which forced building the runtimes with -fPIC.
This was included in the LLVM 13.0 release.
5. People complained about that and requested that we be able to
customize this setting (basically we should have done the second
solution).
This patch makes it such that the LLVM release script will specifically
ask for building with -fPIC using CMAKE_POSITION_INDEPENDENT_CODE,
however by default the runtimes will not force that option onto users.
This patch has the unintended effect that Clang and the LLVM libraries
(not only the runtime ones like libc++) will also be built with -fPIC
in the release. It would be better if we could specify that -fPIC is to
be used only when building the runtimes, however this is left as a
future improvement. The release should probably be using a bootstrapping
build and passing those options to the stage that builds the runtimes
only, see https://reviews.llvm.org/D112748 for that change.
Differential Revision: https://reviews.llvm.org/D110261
More information about the All-commits
mailing list