diff --git a/libcxx/lib/abi/CHANGELOG.TXT b/libcxx/lib/abi/CHANGELOG.TXT index 58cbf9aef038..f85738ede01d 100644 --- a/libcxx/lib/abi/CHANGELOG.TXT +++ b/libcxx/lib/abi/CHANGELOG.TXT @@ -16,6 +16,21 @@ New entries should be added directly below the "Version" header. Version 14.0 ------------ +* [libc++] Resolve missing table_size symbol + + This commit added an out-of-line definition for `table_size` in the library. + This is not an ABI break since we are just adding a symbol to the library. + In fact, any program that would have attempted to refer to that symbol would + have previously failed to link. + + x86_64-apple-apple-darwin + ------------------------- + Symbol added: _ZNSt3__15ctypeIcE10table_sizeE + + x86_64-unknown-linux-gnu + ------------------------ + Symbol added: _ZNSt3__15ctypeIcE10table_sizeE + * [libc++] Always define a key function for std::bad_function_call in the dylib This commit added a new explicit instantiation of std::bad_function_call's diff --git a/libcxx/lib/abi/arm64-apple-darwin.libcxxabi.v1.stable.exceptions.no_new_in_libcxx.abilist b/libcxx/lib/abi/arm64-apple-darwin.libcxxabi.v1.stable.exceptions.no_new_in_libcxx.abilist index f037b1bc27de..4c6661d38ae5 100644 --- a/libcxx/lib/abi/arm64-apple-darwin.libcxxabi.v1.stable.exceptions.no_new_in_libcxx.abilist +++ b/libcxx/lib/abi/arm64-apple-darwin.libcxxabi.v1.stable.exceptions.no_new_in_libcxx.abilist @@ -1646,6 +1646,7 @@ {'is_defined': True, 'name': '__ZNSt3__14stolERKNS_12basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEEPmi', 'type': 'FUNC'} {'is_defined': True, 'name': '__ZNSt3__14wcinE', 'size': 0, 'type': 'OBJECT'} {'is_defined': True, 'name': '__ZNSt3__15alignEmmRPvRm', 'type': 'FUNC'} +{'is_defined': True, 'name': '__ZNSt3__15ctypeIcE10table_sizeE', 'size': 0, 'type': 'OBJECT'} {'is_defined': True, 'name': '__ZNSt3__15ctypeIcE13classic_tableEv', 'type': 'FUNC'} {'is_defined': True, 'name': '__ZNSt3__15ctypeIcE2idE', 'size': 0, 'type': 'OBJECT'} {'is_defined': True, 'name': '__ZNSt3__15ctypeIcEC1EPKjbm', 'type': 'FUNC'} diff --git a/libcxx/lib/abi/x86_64-apple-darwin.libcxxabi.v1.stable.exceptions.no_new_in_libcxx.abilist b/libcxx/lib/abi/x86_64-apple-darwin.libcxxabi.v1.stable.exceptions.no_new_in_libcxx.abilist index 2318cb41b77a..178e46ed6660 100644 --- a/libcxx/lib/abi/x86_64-apple-darwin.libcxxabi.v1.stable.exceptions.no_new_in_libcxx.abilist +++ b/libcxx/lib/abi/x86_64-apple-darwin.libcxxabi.v1.stable.exceptions.no_new_in_libcxx.abilist @@ -1646,6 +1646,7 @@ {'is_defined': True, 'name': '__ZNSt3__14stolERKNS_12basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEEPmi', 'type': 'FUNC'} {'is_defined': True, 'name': '__ZNSt3__14wcinE', 'size': 0, 'type': 'OBJECT'} {'is_defined': True, 'name': '__ZNSt3__15alignEmmRPvRm', 'type': 'FUNC'} +{'is_defined': True, 'name': '__ZNSt3__15ctypeIcE10table_sizeE', 'size': 0, 'type': 'OBJECT'} {'is_defined': True, 'name': '__ZNSt3__15ctypeIcE13classic_tableEv', 'type': 'FUNC'} {'is_defined': True, 'name': '__ZNSt3__15ctypeIcE2idE', 'size': 0, 'type': 'OBJECT'} {'is_defined': True, 'name': '__ZNSt3__15ctypeIcEC1EPKjbm', 'type': 'FUNC'} diff --git a/libcxx/lib/abi/x86_64-unknown-linux-gnu.libcxxabi.v1.stable.exceptions.no_new_in_libcxx.abilist b/libcxx/lib/abi/x86_64-unknown-linux-gnu.libcxxabi.v1.stable.exceptions.no_new_in_libcxx.abilist index c815c446df1b..36f101ad4d75 100644 --- a/libcxx/lib/abi/x86_64-unknown-linux-gnu.libcxxabi.v1.stable.exceptions.no_new_in_libcxx.abilist +++ b/libcxx/lib/abi/x86_64-unknown-linux-gnu.libcxxabi.v1.stable.exceptions.no_new_in_libcxx.abilist @@ -1337,6 +1337,7 @@ {'is_defined': True, 'name': '_ZNSt3__14stolERKNS_12basic_stringIwNS_11char_traitsIwEENS_9allocatorIwEEEEPmi', 'type': 'FUNC'} {'is_defined': True, 'name': '_ZNSt3__14wcinE', 'size': 168, 'type': 'OBJECT'} {'is_defined': True, 'name': '_ZNSt3__15alignEmmRPvRm', 'type': 'FUNC'} +{'is_defined': True, 'name': '_ZNSt3__15ctypeIcE10table_sizeE', 'size': 8, 'type': 'OBJECT'} {'is_defined': True, 'name': '_ZNSt3__15ctypeIcE13classic_tableEv', 'type': 'FUNC'} {'is_defined': True, 'name': '_ZNSt3__15ctypeIcE21__classic_lower_tableEv', 'type': 'FUNC'} {'is_defined': True, 'name': '_ZNSt3__15ctypeIcE21__classic_upper_tableEv', 'type': 'FUNC'} diff --git a/libcxx/src/locale.cpp b/libcxx/src/locale.cpp index 289523708163..79f03b85fab3 100644 --- a/libcxx/src/locale.cpp +++ b/libcxx/src/locale.cpp @@ -988,6 +988,8 @@ ctype::do_narrow(const char_type* low, const char_type* high, char dfau locale::id ctype::id; +const size_t ctype::table_size; + ctype::ctype(const mask* tab, bool del, size_t refs) : locale::facet(refs), __tab_(tab), diff --git a/libcxx/test/std/localization/locale.categories/category.ctype/facet.ctype.special/facet.ctype.char.statics/table_size.pass.cpp b/libcxx/test/std/localization/locale.categories/category.ctype/facet.ctype.special/facet.ctype.char.statics/table_size.pass.cpp new file mode 100644 index 000000000000..576177591e88 --- /dev/null +++ b/libcxx/test/std/localization/locale.categories/category.ctype/facet.ctype.special/facet.ctype.char.statics/table_size.pass.cpp @@ -0,0 +1,31 @@ +//===----------------------------------------------------------------------===// +// +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. +// See https://llvm.org/LICENSE.txt for license information. +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception +// +//===----------------------------------------------------------------------===// + +// + +// template <> class ctype + +// Make sure we can reference std::ctype::table_size. + +// Before https://llvm.org/D110647, the shared library did not contain +// std::ctype::table_size, so this test fails with a link error. +// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx10.{{9|10|11|12|13|14|15}} +// XFAIL: use_system_cxx_lib && target={{.+}}-apple-macosx{{11|12|13}} + +#include +#include + +#include "test_macros.h" + +int main(int, char**) { + typedef std::ctype F; + const size_t* G = &F::table_size; + assert(*G >= 256); + + return 0; +}