[PATCH] D50652: [libcxx] By default, do not use internal_linkage to hide symbols from the ABI

Louis Dionne via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Aug 13 11:31:25 PDT 2018


ldionne added a comment.

The intent is for this patch to be cherry-picked onto the LLVM 7 release.

This is a straw man proposal to fix issues raised in https://reviews.llvm.org/D49240. The idea is that in the future, we would probably want the non-`internal_linkage` case to be the default. By introducing the `_LIBCPP_HIDE_FROM_ABI_PER_TU` setting, we're setting up libc++ users for the right default (i.e. no insane guarantee of being able to link TUs built with different libc++ versions), without actually changing any behavior for the LLVM 7 release. Once we have a solution that allows us to drop `_LIBCPP_ALWAYS_INLINE` from `_LIBCPP_HIDE_FROM_ABI` (in LLVM 8), we can just do it and everybody should see code size improvements, without a crazy increase in the number of symbols (as reported by Chromium). In LLVM8, the few projects that actually need to link TUs built with different libc++ versions can then just define `_LIBCPP_HIDE_FROM_ABI_PER_TU` to keep today's behavior.


Repository:
  rCXX libc++

https://reviews.llvm.org/D50652





More information about the cfe-commits mailing list