[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 12:24:39 PDT 2018


ldionne added a comment.

In https://reviews.llvm.org/D50652#1197775, @rnk wrote:

> I'd prefer not to do this, since internal_linkage generates smaller, more debuggable code by default. I think the symbol table size increase may be specific to MachO, and it may be possible to work around this by changing ld64 to pool strings for symbols by default. I don't know enough about MachO to say if this is possible.
>
> I also think the symbol table size problem may be limited to "large" users of C++: people with 500+ object files using libc++ in a DSO. I'm more comfortable imposing a cost on these users to ask them to opt in to some setting that disables internal_linkage and always_inline than I am leaving always_inline on by default, which adversely affects all users.


One thing to keep in mind is that we do not have a solution that allows removing both `internal_linkage` and `always_inline`. It's either `internal_linkage` or `always_inline`, but you can't get rid of both until we fix some problems with extern template declarations and visibility attributes. What I can do, however, is reverse the default to use `internal_linkage`, and then have a temporary hook that allows Chromium to stay on `always_inline`. In the future, we'd remove that hook and the choice would be between `internal_linkage` and nothing at all.


Repository:
  rCXX libc++

https://reviews.llvm.org/D50652





More information about the cfe-commits mailing list