Skip to content

Commit 34d0c99

Browse files
authored
[libc++] Stop trying to avoid exporting some typeinfo names (llvm#110925)
When the library was initially written, it was not built with hidden visibility. In an attempt to reduce the number of symbols exported from libc++, an explicit list of symbols to avoid exporting was passed to the linker. This was only done on Apple platforms. Since then, the library has moved on in several ways. First, we now build with hidden visibility by default, so arbitrary symbols don't get exported from the library for no reason. Second, we have proper visibility control via source annotations, so we export exactly what we want to, and we do that from the sources. This patch removes the explicit list of symbols to avoid exporting from the library, which at this point doesn't cover much anyways. The only symbols we will now be exporting that we were not before are some typeinfo names for implementation-detail types. While we technically wouldn't have to export those (I don't think any user can get their hands on those typeinfo names), that makes the library more consistent on all platforms.
1 parent 8e049fa commit 34d0c99

5 files changed

+91
-20
lines changed

libcxx/lib/abi/CHANGELOG.TXT

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,47 @@ To generate a summary, re-generate the new ABI list using the
1212

1313
New entries should be added directly below the "Version" header.
1414

15+
------------
16+
Version 20.0
17+
------------
18+
19+
* [libc++] Stop trying to avoid exporting some typeinfo names
20+
21+
This patch removes the explicit list of symbols to avoid exporting
22+
from the library, which at this point doesn't cover much anyways.
23+
That makes us export some new symbols on Appl platforms, namely the
24+
typeinfo names for some implementation-detail types. While we
25+
technically wouldn't have to export those (I don't think any user
26+
can get their hands on those typeinfo names), that makes the library
27+
more consistent on all platforms.
28+
29+
<arch>-apple-darwin
30+
-------------------
31+
Symbol added: __ZTSNSt3__114__codecvt_utf8IDsEE
32+
Symbol added: __ZTSNSt3__114__codecvt_utf8IwEE
33+
Symbol added: __ZTSNSt3__114__shared_countE
34+
Symbol added: __ZTSNSt3__114codecvt_bynameIDiDu11__mbstate_tEE
35+
Symbol added: __ZTSNSt3__114codecvt_bynameIDic11__mbstate_tEE
36+
Symbol added: __ZTSNSt3__114codecvt_bynameIDsDu11__mbstate_tEE
37+
Symbol added: __ZTSNSt3__114codecvt_bynameIDsc11__mbstate_tEE
38+
Symbol added: __ZTSNSt3__114codecvt_bynameIcc11__mbstate_tEE
39+
Symbol added: __ZTSNSt3__114codecvt_bynameIwc11__mbstate_tEE
40+
Symbol added: __ZTSNSt3__115__codecvt_utf16IDiLb0EEE
41+
Symbol added: __ZTSNSt3__115__codecvt_utf16IDiLb1EEE
42+
Symbol added: __ZTSNSt3__115__codecvt_utf16IDsLb0EEE
43+
Symbol added: __ZTSNSt3__115__codecvt_utf16IDsLb1EEE
44+
Symbol added: __ZTSNSt3__115__codecvt_utf16IwLb0EEE
45+
Symbol added: __ZTSNSt3__115__codecvt_utf16IwLb1EEE
46+
Symbol added: __ZTSNSt3__116__narrow_to_utf8ILm16EEE
47+
Symbol added: __ZTSNSt3__116__narrow_to_utf8ILm32EEE
48+
Symbol added: __ZTSNSt3__117__assoc_sub_stateE
49+
Symbol added: __ZTSNSt3__117__widen_from_utf8ILm16EEE
50+
Symbol added: __ZTSNSt3__117__widen_from_utf8ILm32EEE
51+
Symbol added: __ZTSNSt3__119__shared_weak_countE
52+
Symbol added: __ZTSNSt3__120__codecvt_utf8_utf16IDiEE
53+
Symbol added: __ZTSNSt3__120__codecvt_utf8_utf16IDsEE
54+
Symbol added: __ZTSNSt3__120__codecvt_utf8_utf16IwEE
55+
1556
------------
1657
Version 19.0
1758
------------

libcxx/lib/abi/arm64-apple-darwin.libcxxabi.v1.stable.exceptions.nonew.abilist

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2238,12 +2238,28 @@
22382238
{'is_defined': True, 'name': '__ZTSNSt3__113basic_istreamIwNS_11char_traitsIwEEEE', 'size': 0, 'type': 'OBJECT'}
22392239
{'is_defined': True, 'name': '__ZTSNSt3__113basic_ostreamIcNS_11char_traitsIcEEEE', 'size': 0, 'type': 'OBJECT'}
22402240
{'is_defined': True, 'name': '__ZTSNSt3__113basic_ostreamIwNS_11char_traitsIwEEEE', 'size': 0, 'type': 'OBJECT'}
2241+
{'is_defined': True, 'name': '__ZTSNSt3__114__codecvt_utf8IDiEE', 'size': 0, 'type': 'OBJECT'}
2242+
{'is_defined': True, 'name': '__ZTSNSt3__114__codecvt_utf8IDsEE', 'size': 0, 'type': 'OBJECT'}
2243+
{'is_defined': True, 'name': '__ZTSNSt3__114__codecvt_utf8IwEE', 'size': 0, 'type': 'OBJECT'}
2244+
{'is_defined': True, 'name': '__ZTSNSt3__114__shared_countE', 'size': 0, 'type': 'OBJECT'}
22412245
{'is_defined': True, 'name': '__ZTSNSt3__114basic_ifstreamIcNS_11char_traitsIcEEEE', 'size': 0, 'type': 'OBJECT'}
22422246
{'is_defined': True, 'name': '__ZTSNSt3__114basic_iostreamIcNS_11char_traitsIcEEEE', 'size': 0, 'type': 'OBJECT'}
22432247
{'is_defined': True, 'name': '__ZTSNSt3__114basic_ofstreamIcNS_11char_traitsIcEEEE', 'size': 0, 'type': 'OBJECT'}
2248+
{'is_defined': True, 'name': '__ZTSNSt3__114codecvt_bynameIDiDu11__mbstate_tEE', 'size': 0, 'type': 'OBJECT'}
2249+
{'is_defined': True, 'name': '__ZTSNSt3__114codecvt_bynameIDic11__mbstate_tEE', 'size': 0, 'type': 'OBJECT'}
2250+
{'is_defined': True, 'name': '__ZTSNSt3__114codecvt_bynameIDsDu11__mbstate_tEE', 'size': 0, 'type': 'OBJECT'}
2251+
{'is_defined': True, 'name': '__ZTSNSt3__114codecvt_bynameIDsc11__mbstate_tEE', 'size': 0, 'type': 'OBJECT'}
2252+
{'is_defined': True, 'name': '__ZTSNSt3__114codecvt_bynameIcc11__mbstate_tEE', 'size': 0, 'type': 'OBJECT'}
2253+
{'is_defined': True, 'name': '__ZTSNSt3__114codecvt_bynameIwc11__mbstate_tEE', 'size': 0, 'type': 'OBJECT'}
22442254
{'is_defined': True, 'name': '__ZTSNSt3__114collate_bynameIcEE', 'size': 0, 'type': 'OBJECT'}
22452255
{'is_defined': True, 'name': '__ZTSNSt3__114collate_bynameIwEE', 'size': 0, 'type': 'OBJECT'}
22462256
{'is_defined': True, 'name': '__ZTSNSt3__114error_categoryE', 'size': 0, 'type': 'OBJECT'}
2257+
{'is_defined': True, 'name': '__ZTSNSt3__115__codecvt_utf16IDiLb0EEE', 'size': 0, 'type': 'OBJECT'}
2258+
{'is_defined': True, 'name': '__ZTSNSt3__115__codecvt_utf16IDiLb1EEE', 'size': 0, 'type': 'OBJECT'}
2259+
{'is_defined': True, 'name': '__ZTSNSt3__115__codecvt_utf16IDsLb0EEE', 'size': 0, 'type': 'OBJECT'}
2260+
{'is_defined': True, 'name': '__ZTSNSt3__115__codecvt_utf16IDsLb1EEE', 'size': 0, 'type': 'OBJECT'}
2261+
{'is_defined': True, 'name': '__ZTSNSt3__115__codecvt_utf16IwLb0EEE', 'size': 0, 'type': 'OBJECT'}
2262+
{'is_defined': True, 'name': '__ZTSNSt3__115__codecvt_utf16IwLb1EEE', 'size': 0, 'type': 'OBJECT'}
22472263
{'is_defined': True, 'name': '__ZTSNSt3__115basic_streambufIcNS_11char_traitsIcEEEE', 'size': 0, 'type': 'OBJECT'}
22482264
{'is_defined': True, 'name': '__ZTSNSt3__115basic_streambufIwNS_11char_traitsIwEEEE', 'size': 0, 'type': 'OBJECT'}
22492265
{'is_defined': True, 'name': '__ZTSNSt3__115basic_stringbufIcNS_11char_traitsIcEENS_9allocatorIcEEEE', 'size': 0, 'type': 'OBJECT'}
@@ -2255,15 +2271,24 @@
22552271
{'is_defined': True, 'name': '__ZTSNSt3__115time_get_bynameIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 0, 'type': 'OBJECT'}
22562272
{'is_defined': True, 'name': '__ZTSNSt3__115time_put_bynameIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 0, 'type': 'OBJECT'}
22572273
{'is_defined': True, 'name': '__ZTSNSt3__115time_put_bynameIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 0, 'type': 'OBJECT'}
2274+
{'is_defined': True, 'name': '__ZTSNSt3__116__narrow_to_utf8ILm16EEE', 'size': 0, 'type': 'OBJECT'}
2275+
{'is_defined': True, 'name': '__ZTSNSt3__116__narrow_to_utf8ILm32EEE', 'size': 0, 'type': 'OBJECT'}
2276+
{'is_defined': True, 'name': '__ZTSNSt3__117__assoc_sub_stateE', 'size': 0, 'type': 'OBJECT'}
2277+
{'is_defined': True, 'name': '__ZTSNSt3__117__widen_from_utf8ILm16EEE', 'size': 0, 'type': 'OBJECT'}
2278+
{'is_defined': True, 'name': '__ZTSNSt3__117__widen_from_utf8ILm32EEE', 'size': 0, 'type': 'OBJECT'}
22582279
{'is_defined': True, 'name': '__ZTSNSt3__117bad_function_callE', 'size': 0, 'type': 'OBJECT'}
22592280
{'is_defined': True, 'name': '__ZTSNSt3__117moneypunct_bynameIcLb0EEE', 'size': 0, 'type': 'OBJECT'}
22602281
{'is_defined': True, 'name': '__ZTSNSt3__117moneypunct_bynameIcLb1EEE', 'size': 0, 'type': 'OBJECT'}
22612282
{'is_defined': True, 'name': '__ZTSNSt3__117moneypunct_bynameIwLb0EEE', 'size': 0, 'type': 'OBJECT'}
22622283
{'is_defined': True, 'name': '__ZTSNSt3__117moneypunct_bynameIwLb1EEE', 'size': 0, 'type': 'OBJECT'}
22632284
{'is_defined': True, 'name': '__ZTSNSt3__118basic_stringstreamIcNS_11char_traitsIcEENS_9allocatorIcEEEE', 'size': 0, 'type': 'OBJECT'}
2285+
{'is_defined': True, 'name': '__ZTSNSt3__119__shared_weak_countE', 'size': 0, 'type': 'OBJECT'}
22642286
{'is_defined': True, 'name': '__ZTSNSt3__119bad_expected_accessIvEE', 'size': 0, 'type': 'OBJECT'}
22652287
{'is_defined': True, 'name': '__ZTSNSt3__119basic_istringstreamIcNS_11char_traitsIcEENS_9allocatorIcEEEE', 'size': 0, 'type': 'OBJECT'}
22662288
{'is_defined': True, 'name': '__ZTSNSt3__119basic_ostringstreamIcNS_11char_traitsIcEENS_9allocatorIcEEEE', 'size': 0, 'type': 'OBJECT'}
2289+
{'is_defined': True, 'name': '__ZTSNSt3__120__codecvt_utf8_utf16IDiEE', 'size': 0, 'type': 'OBJECT'}
2290+
{'is_defined': True, 'name': '__ZTSNSt3__120__codecvt_utf8_utf16IDsEE', 'size': 0, 'type': 'OBJECT'}
2291+
{'is_defined': True, 'name': '__ZTSNSt3__120__codecvt_utf8_utf16IwEE', 'size': 0, 'type': 'OBJECT'}
22672292
{'is_defined': True, 'name': '__ZTSNSt3__13pmr15memory_resourceE', 'size': 0, 'type': 'OBJECT'}
22682293
{'is_defined': True, 'name': '__ZTSNSt3__13pmr25monotonic_buffer_resourceE', 'size': 0, 'type': 'OBJECT'}
22692294
{'is_defined': True, 'name': '__ZTSNSt3__13pmr26synchronized_pool_resourceE', 'size': 0, 'type': 'OBJECT'}

libcxx/lib/abi/x86_64-apple-darwin.libcxxabi.v1.stable.exceptions.nonew.abilist

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2264,13 +2264,29 @@
22642264
{'is_defined': True, 'name': '__ZTSNSt3__113basic_istreamIwNS_11char_traitsIwEEEE', 'size': 0, 'type': 'OBJECT'}
22652265
{'is_defined': True, 'name': '__ZTSNSt3__113basic_ostreamIcNS_11char_traitsIcEEEE', 'size': 0, 'type': 'OBJECT'}
22662266
{'is_defined': True, 'name': '__ZTSNSt3__113basic_ostreamIwNS_11char_traitsIwEEEE', 'size': 0, 'type': 'OBJECT'}
2267+
{'is_defined': True, 'name': '__ZTSNSt3__114__codecvt_utf8IDiEE', 'size': 0, 'type': 'OBJECT'}
2268+
{'is_defined': True, 'name': '__ZTSNSt3__114__codecvt_utf8IDsEE', 'size': 0, 'type': 'OBJECT'}
2269+
{'is_defined': True, 'name': '__ZTSNSt3__114__codecvt_utf8IwEE', 'size': 0, 'type': 'OBJECT'}
2270+
{'is_defined': True, 'name': '__ZTSNSt3__114__shared_countE', 'size': 0, 'type': 'OBJECT'}
22672271
{'is_defined': True, 'name': '__ZTSNSt3__113messages_baseE', 'size': 0, 'type': 'OBJECT'}
22682272
{'is_defined': True, 'name': '__ZTSNSt3__114basic_ifstreamIcNS_11char_traitsIcEEEE', 'size': 0, 'type': 'OBJECT'}
22692273
{'is_defined': True, 'name': '__ZTSNSt3__114basic_iostreamIcNS_11char_traitsIcEEEE', 'size': 0, 'type': 'OBJECT'}
22702274
{'is_defined': True, 'name': '__ZTSNSt3__114basic_ofstreamIcNS_11char_traitsIcEEEE', 'size': 0, 'type': 'OBJECT'}
2275+
{'is_defined': True, 'name': '__ZTSNSt3__114codecvt_bynameIDiDu11__mbstate_tEE', 'size': 0, 'type': 'OBJECT'}
2276+
{'is_defined': True, 'name': '__ZTSNSt3__114codecvt_bynameIDic11__mbstate_tEE', 'size': 0, 'type': 'OBJECT'}
2277+
{'is_defined': True, 'name': '__ZTSNSt3__114codecvt_bynameIDsDu11__mbstate_tEE', 'size': 0, 'type': 'OBJECT'}
2278+
{'is_defined': True, 'name': '__ZTSNSt3__114codecvt_bynameIDsc11__mbstate_tEE', 'size': 0, 'type': 'OBJECT'}
2279+
{'is_defined': True, 'name': '__ZTSNSt3__114codecvt_bynameIcc11__mbstate_tEE', 'size': 0, 'type': 'OBJECT'}
2280+
{'is_defined': True, 'name': '__ZTSNSt3__114codecvt_bynameIwc11__mbstate_tEE', 'size': 0, 'type': 'OBJECT'}
22712281
{'is_defined': True, 'name': '__ZTSNSt3__114collate_bynameIcEE', 'size': 0, 'type': 'OBJECT'}
22722282
{'is_defined': True, 'name': '__ZTSNSt3__114collate_bynameIwEE', 'size': 0, 'type': 'OBJECT'}
22732283
{'is_defined': True, 'name': '__ZTSNSt3__114error_categoryE', 'size': 0, 'type': 'OBJECT'}
2284+
{'is_defined': True, 'name': '__ZTSNSt3__115__codecvt_utf16IDiLb0EEE', 'size': 0, 'type': 'OBJECT'}
2285+
{'is_defined': True, 'name': '__ZTSNSt3__115__codecvt_utf16IDiLb1EEE', 'size': 0, 'type': 'OBJECT'}
2286+
{'is_defined': True, 'name': '__ZTSNSt3__115__codecvt_utf16IDsLb0EEE', 'size': 0, 'type': 'OBJECT'}
2287+
{'is_defined': True, 'name': '__ZTSNSt3__115__codecvt_utf16IDsLb1EEE', 'size': 0, 'type': 'OBJECT'}
2288+
{'is_defined': True, 'name': '__ZTSNSt3__115__codecvt_utf16IwLb0EEE', 'size': 0, 'type': 'OBJECT'}
2289+
{'is_defined': True, 'name': '__ZTSNSt3__115__codecvt_utf16IwLb1EEE', 'size': 0, 'type': 'OBJECT'}
22742290
{'is_defined': True, 'name': '__ZTSNSt3__115basic_streambufIcNS_11char_traitsIcEEEE', 'size': 0, 'type': 'OBJECT'}
22752291
{'is_defined': True, 'name': '__ZTSNSt3__115basic_streambufIwNS_11char_traitsIwEEEE', 'size': 0, 'type': 'OBJECT'}
22762292
{'is_defined': True, 'name': '__ZTSNSt3__115basic_stringbufIcNS_11char_traitsIcEENS_9allocatorIcEEEE', 'size': 0, 'type': 'OBJECT'}
@@ -2282,15 +2298,24 @@
22822298
{'is_defined': True, 'name': '__ZTSNSt3__115time_get_bynameIwNS_19istreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 0, 'type': 'OBJECT'}
22832299
{'is_defined': True, 'name': '__ZTSNSt3__115time_put_bynameIcNS_19ostreambuf_iteratorIcNS_11char_traitsIcEEEEEE', 'size': 0, 'type': 'OBJECT'}
22842300
{'is_defined': True, 'name': '__ZTSNSt3__115time_put_bynameIwNS_19ostreambuf_iteratorIwNS_11char_traitsIwEEEEEE', 'size': 0, 'type': 'OBJECT'}
2301+
{'is_defined': True, 'name': '__ZTSNSt3__116__narrow_to_utf8ILm16EEE', 'size': 0, 'type': 'OBJECT'}
2302+
{'is_defined': True, 'name': '__ZTSNSt3__116__narrow_to_utf8ILm32EEE', 'size': 0, 'type': 'OBJECT'}
2303+
{'is_defined': True, 'name': '__ZTSNSt3__117__assoc_sub_stateE', 'size': 0, 'type': 'OBJECT'}
2304+
{'is_defined': True, 'name': '__ZTSNSt3__117__widen_from_utf8ILm16EEE', 'size': 0, 'type': 'OBJECT'}
2305+
{'is_defined': True, 'name': '__ZTSNSt3__117__widen_from_utf8ILm32EEE', 'size': 0, 'type': 'OBJECT'}
22852306
{'is_defined': True, 'name': '__ZTSNSt3__117bad_function_callE', 'size': 0, 'type': 'OBJECT'}
22862307
{'is_defined': True, 'name': '__ZTSNSt3__117moneypunct_bynameIcLb0EEE', 'size': 0, 'type': 'OBJECT'}
22872308
{'is_defined': True, 'name': '__ZTSNSt3__117moneypunct_bynameIcLb1EEE', 'size': 0, 'type': 'OBJECT'}
22882309
{'is_defined': True, 'name': '__ZTSNSt3__117moneypunct_bynameIwLb0EEE', 'size': 0, 'type': 'OBJECT'}
22892310
{'is_defined': True, 'name': '__ZTSNSt3__117moneypunct_bynameIwLb1EEE', 'size': 0, 'type': 'OBJECT'}
22902311
{'is_defined': True, 'name': '__ZTSNSt3__118basic_stringstreamIcNS_11char_traitsIcEENS_9allocatorIcEEEE', 'size': 0, 'type': 'OBJECT'}
2312+
{'is_defined': True, 'name': '__ZTSNSt3__119__shared_weak_countE', 'size': 0, 'type': 'OBJECT'}
22912313
{'is_defined': True, 'name': '__ZTSNSt3__119bad_expected_accessIvEE', 'size': 0, 'type': 'OBJECT'}
22922314
{'is_defined': True, 'name': '__ZTSNSt3__119basic_istringstreamIcNS_11char_traitsIcEENS_9allocatorIcEEEE', 'size': 0, 'type': 'OBJECT'}
22932315
{'is_defined': True, 'name': '__ZTSNSt3__119basic_ostringstreamIcNS_11char_traitsIcEENS_9allocatorIcEEEE', 'size': 0, 'type': 'OBJECT'}
2316+
{'is_defined': True, 'name': '__ZTSNSt3__120__codecvt_utf8_utf16IDiEE', 'size': 0, 'type': 'OBJECT'}
2317+
{'is_defined': True, 'name': '__ZTSNSt3__120__codecvt_utf8_utf16IDsEE', 'size': 0, 'type': 'OBJECT'}
2318+
{'is_defined': True, 'name': '__ZTSNSt3__120__codecvt_utf8_utf16IwEE', 'size': 0, 'type': 'OBJECT'}
22942319
{'is_defined': True, 'name': '__ZTSNSt3__13pmr15memory_resourceE', 'size': 0, 'type': 'OBJECT'}
22952320
{'is_defined': True, 'name': '__ZTSNSt3__13pmr25monotonic_buffer_resourceE', 'size': 0, 'type': 'OBJECT'}
22962321
{'is_defined': True, 'name': '__ZTSNSt3__13pmr26__null_memory_resource_impE', 'size': 0, 'type': 'OBJECT'}

libcxx/lib/libc++unexp.exp

Lines changed: 0 additions & 19 deletions
This file was deleted.

libcxx/src/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,6 @@ if (LIBCXX_ENABLE_SHARED)
219219

220220
# TODO: These exports controls should not be tied to whether we re-export libc++abi symbols
221221
target_link_libraries(cxx_shared PRIVATE
222-
"-Wl,-unexported_symbols_list,${CMAKE_CURRENT_SOURCE_DIR}/../lib/libc++unexp.exp"
223222
"-Wl,-force_symbols_not_weak_list,${CMAKE_CURRENT_SOURCE_DIR}/../lib/notweak.exp"
224223
"-Wl,-force_symbols_weak_list,${CMAKE_CURRENT_SOURCE_DIR}/../lib/weak.exp")
225224
endif()

0 commit comments

Comments
 (0)