This is an archive of the discontinued LLVM Phabricator instance.

[libc++] Do not force building with -fPIC (re-applying)
ClosedPublic

Authored by ldionne on Mar 12 2019, 6:25 AM.

Details

Summary

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.

Diff Detail

Repository
rCXX libc++

Event Timeline

ldionne created this revision.Mar 12 2019, 6:25 AM

@EricWF Any objection to re-shipping this since https://reviews.llvm.org/D59248 has landed?

Go nuts. I'm assuming it should work now :-D

This revision was not accepted when it landed; it landed in state Needs Review.Mar 14 2019, 7:37 AM
This revision was automatically updated to reflect the committed changes.