This is an archive of the discontinued LLVM Phabricator instance.

[libcxx] Mark local printf variants as _LIBCPP_HIDDEN to prevent them from becoming part of the DSO.
AbandonedPublic

Authored by EricWF on Mar 26 2015, 9:52 PM.

Details

Summary

This patch marks 3 symbols as hidden. The symbols are:

  1. ZNSt3110sscanf_lEPKcP15__locale_structS1_z
  2. _ZNSt3112asprintf_lEPPcP15__locale_structPKcz
  3. _ZNSt3112snprintf_lEPcmP15__locale_structPKcz

I used _LIBCPP_HIDDEN as opposed to _LIBCPP_INLINE_VISIBILITY because varargs functions cannot be inlined.

I used sym_check to ensure that these symbols are not already present in the system libraries for OS X 10.10 and FreeBSD 10.1. I don't know of any other platforms that require strict ABI compatibility. Playstation perhaps?

@danalbert: Will this change affect android? Can you check to see if these symbols have been shipped?

On linux these symbols are spuriously emitted into the DSO depending on the optimisation level.

See http://ds2.efcs.ca:8080/builders/abi-checker-debug/builds/5/steps/test.libcxx.abi.release/logs/stdio for an example of this problem.

Diff Detail

Event Timeline

EricWF updated this revision to Diff 22776.Mar 26 2015, 9:52 PM
EricWF retitled this revision from to [libcxx] Mark local printf variants as _LIBCPP_HIDDEN to prevent them from becoming part of the DSO..
EricWF updated this object.
EricWF edited the test plan for this revision. (Show Details)
EricWF added reviewers: mclow.lists, danalbert.
EricWF added subscribers: Unknown Object (MLST), danalbert.
mclow.lists edited edge metadata.Jun 23 2015, 8:34 AM

Could this be solved using the technique proposed in http://reviews.llvm.org/D8652 ?

danalbert edited edge metadata.Jul 14 2015, 3:35 PM

@danalbert: Will this change affect android? Can you check to see if these symbols have been shipped?

This looks safe from my end. The sooner the better so that doesn't change :)

This or the internal namespace change sgtm.