This is an archive of the discontinued LLVM Phabricator instance.

[libcxx] Build with -fvisibility-inlines-hidden -- Remove 20 inline definitions from the dylib
ClosedPublic

Authored by EricWF on Oct 13 2016, 11:08 PM.

Details

Summary

This patch turns on -fvisibility-inlines-hidden when building the dylib. This is important so that libc++.dylib doesn't accidentally export inline-functions which are ODR used somewhere in the dylib.

On OS X this change has no effect on the current ABI of the dylib. Unfortunately on Linux there are already ~20 inline functions which are unintentionally exported by the dylib. Almost all of these are implicitly generated destructors. I believe removing these function definitions is safe because every "linkage unit" which uses these functions has its own definition, and therefore shouldn't be dependent on libc++.dylib to provide them.

Also could a FreeBSD maintainer comment on the ABI compatibility of this patch?

Diff Detail

Repository
rL LLVM

Event Timeline

EricWF updated this revision to Diff 74618.Oct 13 2016, 11:08 PM
EricWF retitled this revision from to [libcxx] Build with -fvisibility-inlines-hidden -- Remove 20 inline definitions from the dylib.
EricWF updated this object.
EricWF added a subscriber: cfe-commits.

I just spoke with Jonathan Wakely about this change, and he believes that it should be ABI safe.

emaste added inline comments.Oct 14 2016, 6:54 AM
lib/abi/CHANGELOG.TXT
22 ↗(On Diff #74618)

Should we also include in this comment the further justification from your Phabricator description above (about having own definitions)?

dim accepted this revision.Oct 14 2016, 10:48 AM
dim edited edge metadata.

LGTM.

This revision is now accepted and ready to land.Oct 14 2016, 10:48 AM
compnerd accepted this revision.Oct 14 2016, 10:58 AM
compnerd edited edge metadata.
EricWF updated this revision to Diff 75770.Oct 25 2016, 12:52 PM
EricWF edited edge metadata.
  • Address review comments by adding better documentation in the CHANGELOG.TXT.
EricWF closed this revision.Oct 25 2016, 12:53 PM
This revision was automatically updated to reflect the committed changes.