[runtimes] Always build libc++, libc++abi and libunwind with -fPIC
authorLouis Dionne <ldionne.2@gmail.com>
Tue, 15 Jun 2021 22:47:38 +0000 (18:47 -0400)
committerLouis Dionne <ldionne.2@gmail.com>
Tue, 27 Jul 2021 18:19:05 +0000 (14:19 -0400)
commit21c24ae9029a1fcd1c76b61b1c48b81b5c66c606
tree5f63c4757c264fd3d9675f5e489ebb9c46ee068b
parent45478619e3eb5860e48a9258a7ac1cfb09fcbb5f
[runtimes] Always build libc++, libc++abi and libunwind with -fPIC

Building the libraries with -fPIC ensures that we can link an executable
against the static libraries with -fPIE. Furthermore, there is apparently
basically no downside to building the libraries with position independent
code, since modern toolchains are sufficiently clever.

This commit enforces that we always build the runtime libraries with -fPIC.
This is another take on D104327, which instead makes the decision of whether
to build with -fPIC or not to the build script that drives the runtimes'
build.

Fixes http://llvm.org/PR43604.

Differential Revision: https://reviews.llvm.org/D104328
libcxx/src/CMakeLists.txt
libcxxabi/src/CMakeLists.txt
libunwind/src/CMakeLists.txt