Skip to content

Commit 6a884a9

Browse files
authored
[libc++] Always keep libc++abi re-exports up-to-date (#79012)
Previously, the list of libc++abi symbols that we re-export from libc++ would be partly encoded in libc++abi (and re-exported automatically via the cxxabi-reexports target), and partly hard-coded in libcxx/lib/libc++abi.exp. The duplication of information led to symbols not being exported from libc++ after being added to libc++abi when they should have been. This patch removes the duplication of information. After this patch, the full list of symbols to re-export from libc++abi is handled by the cxxabi-reexports target and is stored in libcxxabi. The symbols newly re-exported from libc++ are mainly new fundamental typeinfos and a bunch of functions and classes that are part of libc++abi but are most likely implementation details. In the future, it would be possible to try to trim down the set of what we export from libc++abi (and hence what we re-export from libc++) to remove some implementation detail symbols. Fixes #79008
1 parent 7b66b5d commit 6a884a9

13 files changed

+579
-613
lines changed

libcxx/lib/abi/CHANGELOG.TXT

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,71 @@ 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 19.0
17+
------------
18+
19+
* [libc++] Always keep libc++abi re-exports up-to-date
20+
21+
This patch makes sure that the set of libc++abi symbols re-exported from libc++
22+
is up-to-date with the symbols that libc++abi re-exports. As such, it adds several
23+
symbols that were left out of the libc++ re-exports list. Exporting new symbols
24+
is not an ABI break.
25+
26+
<arch>-apple-darwin
27+
-------------------
28+
Symbol reexported: ___cxa_current_primary_exception
29+
Symbol reexported: ___cxa_decrement_exception_refcount
30+
Symbol reexported: ___cxa_increment_exception_refcount
31+
Symbol reexported: ___cxa_new_handler
32+
Symbol reexported: ___cxa_rethrow_primary_exception
33+
Symbol reexported: ___cxa_terminate_handler
34+
Symbol reexported: ___cxa_uncaught_exception
35+
Symbol reexported: ___cxa_unexpected_handler
36+
Symbol reexported: __ZTIDh
37+
Symbol reexported: __ZTIDu
38+
Symbol reexported: __ZTIg
39+
Symbol reexported: __ZTIn
40+
Symbol reexported: __ZTIN10__cxxabiv116__enum_type_infoE
41+
Symbol reexported: __ZTIN10__cxxabiv116__shim_type_infoE
42+
Symbol reexported: __ZTIN10__cxxabiv117__array_type_infoE
43+
Symbol reexported: __ZTIN10__cxxabiv117__class_type_infoE
44+
Symbol reexported: __ZTIN10__cxxabiv117__pbase_type_infoE
45+
Symbol reexported: __ZTIN10__cxxabiv119__pointer_type_infoE
46+
Symbol reexported: __ZTIN10__cxxabiv120__function_type_infoE
47+
Symbol reexported: __ZTIN10__cxxabiv120__si_class_type_infoE
48+
Symbol reexported: __ZTIN10__cxxabiv121__vmi_class_type_infoE
49+
Symbol reexported: __ZTIN10__cxxabiv123__fundamental_type_infoE
50+
Symbol reexported: __ZTIN10__cxxabiv129__pointer_to_member_type_infoE
51+
Symbol reexported: __ZTIo
52+
Symbol reexported: __ZTIPDh
53+
Symbol reexported: __ZTIPDu
54+
Symbol reexported: __ZTIPg
55+
Symbol reexported: __ZTIPKDh
56+
Symbol reexported: __ZTIPKDu
57+
Symbol reexported: __ZTIPKg
58+
Symbol reexported: __ZTIPKn
59+
Symbol reexported: __ZTIPKo
60+
Symbol reexported: __ZTIPn
61+
Symbol reexported: __ZTIPo
62+
Symbol reexported: __ZTSDh
63+
Symbol reexported: __ZTSDu
64+
Symbol reexported: __ZTSg
65+
Symbol reexported: __ZTSn
66+
Symbol reexported: __ZTSN10__cxxabiv116__shim_type_infoE
67+
Symbol reexported: __ZTSo
68+
Symbol reexported: __ZTSPDh
69+
Symbol reexported: __ZTSPDu
70+
Symbol reexported: __ZTSPg
71+
Symbol reexported: __ZTSPKDh
72+
Symbol reexported: __ZTSPKDu
73+
Symbol reexported: __ZTSPKg
74+
Symbol reexported: __ZTSPKn
75+
Symbol reexported: __ZTSPKo
76+
Symbol reexported: __ZTSPn
77+
Symbol reexported: __ZTSPo
78+
Symbol reexported: __ZTVN10__cxxabiv116__shim_type_infoE
79+
1580
------------
1681
Version 18.0
1782
------------

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

Lines changed: 98 additions & 0 deletions
Large diffs are not rendered by default.

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

Lines changed: 98 additions & 0 deletions
Large diffs are not rendered by default.

libcxx/src/CMakeLists.txt

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -231,19 +231,14 @@ if (LIBCXX_ENABLE_SHARED)
231231
# In particular, we don't re-export the symbols if libc++abi is merged statically
232232
# into libc++ because in that case there's no dylib to re-export from.
233233
if (APPLE AND LIBCXX_CXX_ABI MATCHES "libcxxabi$"
234-
AND NOT DEFINED LIBCXX_OSX_REEXPORT_LIBCXXABI_SYMBOLS
235234
AND NOT LIBCXX_STATICALLY_LINK_ABI_IN_SHARED_LIBRARY)
236-
set(LIBCXX_OSX_REEXPORT_LIBCXXABI_SYMBOLS ON)
237-
endif()
235+
target_link_libraries(cxx_shared PRIVATE cxxabi-reexports)
238236

239-
if (LIBCXX_OSX_REEXPORT_LIBCXXABI_SYMBOLS)
237+
# TODO: These exports controls should not be tied to whether we re-export libc++abi symbols
240238
target_link_libraries(cxx_shared PRIVATE
241239
"-Wl,-unexported_symbols_list,${CMAKE_CURRENT_SOURCE_DIR}/../lib/libc++unexp.exp"
242-
"-Wl,-reexported_symbols_list,${CMAKE_CURRENT_SOURCE_DIR}/../lib/libc++abi.exp"
243240
"-Wl,-force_symbols_not_weak_list,${CMAKE_CURRENT_SOURCE_DIR}/../lib/notweak.exp"
244241
"-Wl,-force_symbols_weak_list,${CMAKE_CURRENT_SOURCE_DIR}/../lib/weak.exp")
245-
246-
target_link_libraries(cxx_shared PRIVATE $<TARGET_NAME_IF_EXISTS:cxxabi-reexports>)
247242
endif()
248243

249244
# Generate a linker script in place of a libc++.so symlink.

libcxxabi/lib/cxxabiv1.exp

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# Typeinfos for types from libc++abi
2+
__ZTIN10__cxxabiv116__enum_type_infoE
3+
__ZTIN10__cxxabiv116__shim_type_infoE
4+
__ZTIN10__cxxabiv117__array_type_infoE
5+
__ZTIN10__cxxabiv117__class_type_infoE
6+
__ZTIN10__cxxabiv117__pbase_type_infoE
7+
__ZTIN10__cxxabiv119__pointer_type_infoE
8+
__ZTIN10__cxxabiv120__function_type_infoE
9+
__ZTIN10__cxxabiv120__si_class_type_infoE
10+
__ZTIN10__cxxabiv121__vmi_class_type_infoE
11+
__ZTIN10__cxxabiv123__fundamental_type_infoE
12+
__ZTIN10__cxxabiv129__pointer_to_member_type_infoE
13+
14+
# Typeinfo names for types from libc++abi
15+
__ZTSN10__cxxabiv116__enum_type_infoE
16+
__ZTSN10__cxxabiv116__shim_type_infoE
17+
__ZTSN10__cxxabiv117__array_type_infoE
18+
__ZTSN10__cxxabiv117__class_type_infoE
19+
__ZTSN10__cxxabiv117__pbase_type_infoE
20+
__ZTSN10__cxxabiv119__pointer_type_infoE
21+
__ZTSN10__cxxabiv120__function_type_infoE
22+
__ZTSN10__cxxabiv120__si_class_type_infoE
23+
__ZTSN10__cxxabiv121__vmi_class_type_infoE
24+
__ZTSN10__cxxabiv123__fundamental_type_infoE
25+
__ZTSN10__cxxabiv129__pointer_to_member_type_infoE
26+
27+
# Vtables for libc++abi types
28+
__ZTVN10__cxxabiv116__enum_type_infoE
29+
__ZTVN10__cxxabiv116__shim_type_infoE
30+
__ZTVN10__cxxabiv117__array_type_infoE
31+
__ZTVN10__cxxabiv117__class_type_infoE
32+
__ZTVN10__cxxabiv117__pbase_type_infoE
33+
__ZTVN10__cxxabiv119__pointer_type_infoE
34+
__ZTVN10__cxxabiv120__function_type_infoE
35+
__ZTVN10__cxxabiv120__si_class_type_infoE
36+
__ZTVN10__cxxabiv121__vmi_class_type_infoE
37+
__ZTVN10__cxxabiv123__fundamental_type_infoE
38+
__ZTVN10__cxxabiv129__pointer_to_member_type_infoE

libcxxabi/lib/fundamental-types.exp

Lines changed: 153 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,153 @@
1+
# Typeinfos for fundamental types
2+
__ZTIa
3+
__ZTIb
4+
__ZTIc
5+
__ZTId
6+
__ZTIDh
7+
__ZTIDi
8+
__ZTIDn
9+
__ZTIDs
10+
__ZTIDu
11+
__ZTIe
12+
__ZTIf
13+
__ZTIg
14+
__ZTIh
15+
__ZTIi
16+
__ZTIj
17+
__ZTIl
18+
__ZTIm
19+
__ZTIn
20+
__ZTIo
21+
__ZTIPa
22+
__ZTIPb
23+
__ZTIPc
24+
__ZTIPd
25+
__ZTIPDh
26+
__ZTIPDi
27+
__ZTIPDn
28+
__ZTIPDs
29+
__ZTIPDu
30+
__ZTIPe
31+
__ZTIPf
32+
__ZTIPg
33+
__ZTIPh
34+
__ZTIPi
35+
__ZTIPj
36+
__ZTIPKa
37+
__ZTIPKb
38+
__ZTIPKc
39+
__ZTIPKd
40+
__ZTIPKDh
41+
__ZTIPKDi
42+
__ZTIPKDn
43+
__ZTIPKDs
44+
__ZTIPKDu
45+
__ZTIPKe
46+
__ZTIPKf
47+
__ZTIPKg
48+
__ZTIPKh
49+
__ZTIPKi
50+
__ZTIPKj
51+
__ZTIPKl
52+
__ZTIPKm
53+
__ZTIPKn
54+
__ZTIPKo
55+
__ZTIPKs
56+
__ZTIPKt
57+
__ZTIPKv
58+
__ZTIPKw
59+
__ZTIPKx
60+
__ZTIPKy
61+
__ZTIPl
62+
__ZTIPm
63+
__ZTIPn
64+
__ZTIPo
65+
__ZTIPs
66+
__ZTIPt
67+
__ZTIPv
68+
__ZTIPw
69+
__ZTIPx
70+
__ZTIPy
71+
__ZTIs
72+
__ZTIt
73+
__ZTIv
74+
__ZTIw
75+
__ZTIx
76+
__ZTIy
77+
78+
# Typeinfo names for fundamental types
79+
__ZTSa
80+
__ZTSb
81+
__ZTSc
82+
__ZTSd
83+
__ZTSDh
84+
__ZTSDi
85+
__ZTSDn
86+
__ZTSDs
87+
__ZTSDu
88+
__ZTSe
89+
__ZTSf
90+
__ZTSg
91+
__ZTSh
92+
__ZTSi
93+
__ZTSj
94+
__ZTSl
95+
__ZTSm
96+
__ZTSn
97+
__ZTSo
98+
__ZTSPa
99+
__ZTSPb
100+
__ZTSPc
101+
__ZTSPd
102+
__ZTSPDh
103+
__ZTSPDi
104+
__ZTSPDn
105+
__ZTSPDs
106+
__ZTSPDu
107+
__ZTSPe
108+
__ZTSPf
109+
__ZTSPg
110+
__ZTSPh
111+
__ZTSPi
112+
__ZTSPj
113+
__ZTSPKa
114+
__ZTSPKb
115+
__ZTSPKc
116+
__ZTSPKd
117+
__ZTSPKDh
118+
__ZTSPKDi
119+
__ZTSPKDn
120+
__ZTSPKDs
121+
__ZTSPKDu
122+
__ZTSPKe
123+
__ZTSPKf
124+
__ZTSPKg
125+
__ZTSPKh
126+
__ZTSPKi
127+
__ZTSPKj
128+
__ZTSPKl
129+
__ZTSPKm
130+
__ZTSPKn
131+
__ZTSPKo
132+
__ZTSPKs
133+
__ZTSPKt
134+
__ZTSPKv
135+
__ZTSPKw
136+
__ZTSPKx
137+
__ZTSPKy
138+
__ZTSPl
139+
__ZTSPm
140+
__ZTSPn
141+
__ZTSPo
142+
__ZTSPs
143+
__ZTSPt
144+
__ZTSPv
145+
__ZTSPw
146+
__ZTSPx
147+
__ZTSPy
148+
__ZTSs
149+
__ZTSt
150+
__ZTSv
151+
__ZTSw
152+
__ZTSx
153+
__ZTSy

0 commit comments

Comments
 (0)