diff --git a/libcxx/include/__config b/libcxx/include/__config --- a/libcxx/include/__config +++ b/libcxx/include/__config @@ -171,11 +171,6 @@ // reduces the number of weak definitions generated in programs that use // iostreams by providing a single strong definition in the shared library. # define _LIBCPP_ABI_ENABLE_ADDITIONAL_IOSTREAM_EXPLICIT_INSTANTIATIONS_1 - -// Define a key function for `bad_function_call` in the library, to centralize -// its vtable and typeinfo to libc++ rather than having all other libraries -// using that class define their own copies. -# define _LIBCPP_ABI_BAD_FUNCTION_CALL_KEY_FUNCTION # endif # define _LIBCPP_TOSTRING2(x) #x diff --git a/libcxx/include/__functional/function.h b/libcxx/include/__functional/function.h --- a/libcxx/include/__functional/function.h +++ b/libcxx/include/__functional/function.h @@ -50,15 +50,6 @@ : public exception { public: -// Note that when a key function is not used, every translation unit that uses -// bad_function_call will end up containing a weak definition of the vtable and -// typeinfo. -#ifdef _LIBCPP_ABI_BAD_FUNCTION_CALL_KEY_FUNCTION - ~bad_function_call() _NOEXCEPT override; -#else - ~bad_function_call() _NOEXCEPT override {} -#endif - #ifdef _LIBCPP_ABI_BAD_FUNCTION_CALL_GOOD_WHAT_MESSAGE const char* what() const _NOEXCEPT override; #endif diff --git a/libcxx/lib/abi/CHANGELOG.TXT b/libcxx/lib/abi/CHANGELOG.TXT --- a/libcxx/lib/abi/CHANGELOG.TXT +++ b/libcxx/lib/abi/CHANGELOG.TXT @@ -16,6 +16,21 @@ Version 17.0 ------------ +* [libc++] Remove _LIBCPP_ABI_BAD_FUNCTION_CALL_KEY_FUNCTION + + The destructor was always defined inline in the stable ABI, so all TUs have a weak definition of the symbols, which + means that if the strong definition from the dylib is removed, there is still an equivalent weak definition available. + + All platforms + ------------- + Symbol removed: _ZNKSt9exception4whatEv + Symbol removed: _ZNSt3__117bad_function_callD0Ev + Symbol removed: _ZNSt3__117bad_function_callD1Ev + Symbol removed: _ZNSt3__117bad_function_callD2Ev + Symbol removed: _ZTINSt3__117bad_function_callE + Symbol removed: _ZTSNSt3__117bad_function_callE + Symbol removed: _ZTVNSt3__117bad_function_callE + * [libc++] Remove explicit instantiations of __insertion_sort_incomplete and __sort5 from the dylib These instantiations were never visible, because they are only used in `__sort`, which is also explicitly diff --git a/libcxx/lib/abi/x86_64-unknown-linux-gnu.libcxxabi.v1.stable.exceptions.nonew.abilist b/libcxx/lib/abi/x86_64-unknown-linux-gnu.libcxxabi.v1.stable.exceptions.nonew.abilist --- a/libcxx/lib/abi/x86_64-unknown-linux-gnu.libcxxabi.v1.stable.exceptions.nonew.abilist +++ b/libcxx/lib/abi/x86_64-unknown-linux-gnu.libcxxabi.v1.stable.exceptions.nonew.abilist @@ -1,6 +1,5 @@ {'is_defined': False, 'name': '_ZNKSt11logic_error4whatEv', 'type': 'FUNC'} {'is_defined': False, 'name': '_ZNKSt13runtime_error4whatEv', 'type': 'FUNC'} -{'is_defined': False, 'name': '_ZNKSt9exception4whatEv', 'type': 'FUNC'} {'is_defined': False, 'name': '_ZNSt11logic_errorD2Ev', 'type': 'FUNC'} {'is_defined': False, 'name': '_ZNSt12length_errorD1Ev', 'type': 'FUNC'} {'is_defined': False, 'name': '_ZNSt12out_of_rangeD1Ev', 'type': 'FUNC'} @@ -1154,9 +1153,6 @@ {'is_defined': True, 'name': '_ZNSt3__117__widen_from_utf8ILm32EED0Ev', 'type': 'FUNC'} {'is_defined': True, 'name': '_ZNSt3__117__widen_from_utf8ILm32EED1Ev', 'type': 'FUNC'} {'is_defined': True, 'name': '_ZNSt3__117__widen_from_utf8ILm32EED2Ev', 'type': 'FUNC'} -{'is_defined': True, 'name': '_ZNSt3__117bad_function_callD0Ev', 'type': 'FUNC'} -{'is_defined': True, 'name': '_ZNSt3__117bad_function_callD1Ev', 'type': 'FUNC'} -{'is_defined': True, 'name': '_ZNSt3__117bad_function_callD2Ev', 'type': 'FUNC'} {'is_defined': True, 'name': '_ZNSt3__117declare_reachableEPv', 'type': 'FUNC'} {'is_defined': True, 'name': '_ZNSt3__117iostream_categoryEv', 'type': 'FUNC'} {'is_defined': True, 'name': '_ZNSt3__117moneypunct_bynameIcLb0EE4initEPKc', 'type': 'FUNC'} @@ -1690,7 +1686,6 @@ {'is_defined': True, 'name': '_ZTINSt3__117__assoc_sub_stateE', 'size': 24, 'type': 'OBJECT'} {'is_defined': True, 'name': '_ZTINSt3__117__widen_from_utf8ILm16EEE', 'size': 24, 'type': 'OBJECT'} {'is_defined': True, 'name': '_ZTINSt3__117__widen_from_utf8ILm32EEE', 'size': 24, 'type': 'OBJECT'} -{'is_defined': True, 'name': '_ZTINSt3__117bad_function_callE', 'size': 24, 'type': 'OBJECT'} {'is_defined': True, 'name': '_ZTINSt3__117moneypunct_bynameIcLb0EEE', 'size': 24, 'type': 'OBJECT'} {'is_defined': True, 'name': '_ZTINSt3__117moneypunct_bynameIcLb1EEE', 'size': 24, 'type': 'OBJECT'} {'is_defined': True, 'name': '_ZTINSt3__117moneypunct_bynameIwLb0EEE', 'size': 24, 'type': 'OBJECT'} @@ -1824,7 +1819,6 @@ {'is_defined': True, 'name': '_ZTSNSt3__117__assoc_sub_stateE', 'size': 28, 'type': 'OBJECT'} {'is_defined': True, 'name': '_ZTSNSt3__117__widen_from_utf8ILm16EEE', 'size': 35, 'type': 'OBJECT'} {'is_defined': True, 'name': '_ZTSNSt3__117__widen_from_utf8ILm32EEE', 'size': 35, 'type': 'OBJECT'} -{'is_defined': True, 'name': '_ZTSNSt3__117bad_function_callE', 'size': 28, 'type': 'OBJECT'} {'is_defined': True, 'name': '_ZTSNSt3__117moneypunct_bynameIcLb0EEE', 'size': 35, 'type': 'OBJECT'} {'is_defined': True, 'name': '_ZTSNSt3__117moneypunct_bynameIcLb1EEE', 'size': 35, 'type': 'OBJECT'} {'is_defined': True, 'name': '_ZTSNSt3__117moneypunct_bynameIwLb0EEE', 'size': 35, 'type': 'OBJECT'} @@ -1959,7 +1953,6 @@ {'is_defined': True, 'name': '_ZTVNSt3__117__assoc_sub_stateE', 'size': 48, 'type': 'OBJECT'} {'is_defined': True, 'name': '_ZTVNSt3__117__widen_from_utf8ILm16EEE', 'size': 96, 'type': 'OBJECT'} {'is_defined': True, 'name': '_ZTVNSt3__117__widen_from_utf8ILm32EEE', 'size': 96, 'type': 'OBJECT'} -{'is_defined': True, 'name': '_ZTVNSt3__117bad_function_callE', 'size': 40, 'type': 'OBJECT'} {'is_defined': True, 'name': '_ZTVNSt3__117moneypunct_bynameIcLb0EEE', 'size': 112, 'type': 'OBJECT'} {'is_defined': True, 'name': '_ZTVNSt3__117moneypunct_bynameIcLb1EEE', 'size': 112, 'type': 'OBJECT'} {'is_defined': True, 'name': '_ZTVNSt3__117moneypunct_bynameIwLb0EEE', 'size': 112, 'type': 'OBJECT'} diff --git a/libcxx/src/functional.cpp b/libcxx/src/functional.cpp --- a/libcxx/src/functional.cpp +++ b/libcxx/src/functional.cpp @@ -10,12 +10,6 @@ _LIBCPP_BEGIN_NAMESPACE_STD -#ifdef _LIBCPP_ABI_BAD_FUNCTION_CALL_KEY_FUNCTION -bad_function_call::~bad_function_call() noexcept -{ -} -#endif - #ifdef _LIBCPP_ABI_BAD_FUNCTION_CALL_GOOD_WHAT_MESSAGE const char* bad_function_call::what() const noexcept diff --git a/libcxx/test/std/utilities/function.objects/bind/func.bind/func.bind.bind/copy.pass.cpp b/libcxx/test/std/utilities/function.objects/bind/func.bind/func.bind.bind/copy.pass.cpp --- a/libcxx/test/std/utilities/function.objects/bind/func.bind/func.bind.bind/copy.pass.cpp +++ b/libcxx/test/std/utilities/function.objects/bind/func.bind/func.bind.bind/copy.pass.cpp @@ -6,18 +6,7 @@ // //===----------------------------------------------------------------------===// -// Address Sanitizer doesn't instrument weak symbols on Linux. When a key -// function is defined for bad_function_call's vtable, its typeinfo and vtable -// will be defined as strong symbols in the library and weak symbols in other -// translation units. Only the strong symbol will be instrumented, increasing -// its size (due to the redzone) and leading to a serious ODR violation -// resulting in a crash. -// Some relevant bugs: -// https://github.com/google/sanitizers/issues/1017 -// https://github.com/google/sanitizers/issues/619 -// https://github.com/google/sanitizers/issues/398 -// https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68016 -// UNSUPPORTED: c++03, asan +// UNSUPPORTED: c++03 // diff --git a/libcxx/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.inv/invoke.pass.cpp b/libcxx/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.inv/invoke.pass.cpp --- a/libcxx/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.inv/invoke.pass.cpp +++ b/libcxx/test/std/utilities/function.objects/func.wrap/func.wrap.func/func.wrap.func.inv/invoke.pass.cpp @@ -14,22 +14,6 @@ // R operator()(ArgTypes... args) const -// This test runs in C++03, but we have deprecated using std::function in C++03. -// ADDITIONAL_COMPILE_FLAGS: -D_LIBCPP_DISABLE_DEPRECATION_WARNINGS -D_LIBCPP_ENABLE_CXX03_FUNCTION - -// Address Sanitizer doesn't instrument weak symbols on Linux. When a key -// function is defined for bad_function_call's vtable, its typeinfo and vtable -// will be defined as strong symbols in the library and weak symbols in other -// translation units. Only the strong symbol will be instrumented, increasing -// its size (due to the redzone) and leading to a serious ODR violation -// resulting in a crash. -// Some relevant bugs: -// https://github.com/google/sanitizers/issues/1017 -// https://github.com/google/sanitizers/issues/619 -// https://github.com/google/sanitizers/issues/398 -// https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68016 -// UNSUPPORTED: asan - #include #include diff --git a/libcxx/test/std/utilities/function.objects/func.wrap/func.wrap.func/robust_against_adl.pass.cpp b/libcxx/test/std/utilities/function.objects/func.wrap/func.wrap.func/robust_against_adl.pass.cpp --- a/libcxx/test/std/utilities/function.objects/func.wrap/func.wrap.func/robust_against_adl.pass.cpp +++ b/libcxx/test/std/utilities/function.objects/func.wrap/func.wrap.func/robust_against_adl.pass.cpp @@ -6,18 +6,7 @@ // //===----------------------------------------------------------------------===// -// Address Sanitizer doesn't instrument weak symbols on Linux. When a key -// function is defined for bad_function_call's vtable, its typeinfo and vtable -// will be defined as strong symbols in the library and weak symbols in other -// translation units. Only the strong symbol will be instrumented, increasing -// its size (due to the redzone) and leading to a serious ODR violation -// resulting in a crash. -// Some relevant bugs: -// https://github.com/google/sanitizers/issues/1017 -// https://github.com/google/sanitizers/issues/619 -// https://github.com/google/sanitizers/issues/398 -// https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68016 -// UNSUPPORTED: c++03, asan +// UNSUPPORTED: c++03 //