[libcxx-commits] [libcxx] r358690 - [libc++] Make sure we re-export some missing libc++abi symbols from libc++

Louis Dionne via libcxx-commits libcxx-commits at lists.llvm.org
Thu Apr 18 10:18:15 PDT 2019


Author: ldionne
Date: Thu Apr 18 10:18:15 2019
New Revision: 358690

URL: http://llvm.org/viewvc/llvm-project?rev=358690&view=rev
Log:
[libc++] Make sure we re-export some missing libc++abi symbols from libc++

Summary:
Ensure we re-export __cxa_throw_bad_array_new_length and
__cxa_uncaught_exceptions from libc++, since they are now
provided by libc++abi.

Doing this allows us to stop linking explicitly against libc++abi in
the libc++abi tests, since libc++ re-exports all the necessary symbols.
However, there is one caveat to that. We don't want libc++ to re-export
__cxa_uncaught_exception (the singular form), since it's only provided
for backwards compatibility. Hence, for the single test where we check
this backwards compatibility, we explicitly link against libc++abi.

PR27405
PR22654

Reviewers: EricWF

Subscribers: christof, jkorous, dexonsmith, libcxx-commits

Tags: #libc

Differential Revision: https://reviews.llvm.org/D60424

Modified:
    libcxx/trunk/lib/abi/CHANGELOG.TXT
    libcxx/trunk/lib/abi/x86_64-apple-darwin.v1.abilist
    libcxx/trunk/lib/libc++abi.v2.exp
    libcxx/trunk/utils/libcxx/test/target_info.py

Modified: libcxx/trunk/lib/abi/CHANGELOG.TXT
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/lib/abi/CHANGELOG.TXT?rev=358690&r1=358689&r2=358690&view=diff
==============================================================================
--- libcxx/trunk/lib/abi/CHANGELOG.TXT (original)
+++ libcxx/trunk/lib/abi/CHANGELOG.TXT Thu Apr 18 10:18:15 2019
@@ -16,6 +16,23 @@ New entries should be added directly bel
 Version 9.0
 -----------
 
+* rXXXXX - Re-rexport missing symbols from libc++abi
+
+  libc++ now re-exports `__cxa_throw_bad_array_new_length` and `__cxa_uncaught_exceptions`,
+  both of which are provided by libc++abi. This is not an ABI break because
+  we're just adding symbols. Also, this does mean that libc++ can't be linked
+  against an older version of libc++abi that doesn't provide those symbols,
+  however doing so is not supported anyway.
+
+  x86_64-unknown-linux-gnu
+  ------------------------
+  TODO
+
+  x86_64-apple-apple-darwin
+  -------------------------
+  Symbol added: ___cxa_throw_bad_array_new_length
+  Symbol added: ___cxa_uncaught_exceptions
+
 * r356518 - Integrate <filesystem> support into the shared library
 
   This patch introduces support for <filesystem> into the shared library,

Modified: libcxx/trunk/lib/abi/x86_64-apple-darwin.v1.abilist
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/lib/abi/x86_64-apple-darwin.v1.abilist?rev=358690&r1=358689&r2=358690&view=diff
==============================================================================
--- libcxx/trunk/lib/abi/x86_64-apple-darwin.v1.abilist (original)
+++ libcxx/trunk/lib/abi/x86_64-apple-darwin.v1.abilist Thu Apr 18 10:18:15 2019
@@ -2321,7 +2321,10 @@
 {'is_defined': False, 'name': '___cxa_rethrow_primary_exception', 'type': 'U'}
 {'is_defined': False, 'name': '___cxa_throw', 'type': 'U'}
 {'is_defined': True, 'name': '___cxa_throw', 'type': 'I'}
+{'is_defined': False, 'name': '___cxa_throw_bad_array_new_length', 'type': 'U'}
+{'is_defined': True, 'name': '___cxa_throw_bad_array_new_length', 'type': 'I'}
 {'is_defined': False, 'name': '___cxa_uncaught_exceptions', 'type': 'U'}
+{'is_defined': True, 'name': '___cxa_uncaught_exceptions', 'type': 'I'}
 {'is_defined': False, 'name': '___cxa_vec_cctor', 'type': 'U'}
 {'is_defined': True, 'name': '___cxa_vec_cctor', 'type': 'I'}
 {'is_defined': False, 'name': '___cxa_vec_cleanup', 'type': 'U'}

Modified: libcxx/trunk/lib/libc++abi.v2.exp
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/lib/libc%2B%2Babi.v2.exp?rev=358690&r1=358689&r2=358690&view=diff
==============================================================================
--- libcxx/trunk/lib/libc++abi.v2.exp (original)
+++ libcxx/trunk/lib/libc++abi.v2.exp Thu Apr 18 10:18:15 2019
@@ -15,6 +15,8 @@ ___cxa_pure_virtual
 ___cxa_deleted_virtual
 ___cxa_begin_catch
 ___cxa_throw
+___cxa_throw_bad_array_new_length
+___cxa_uncaught_exceptions
 ___cxa_vec_cctor
 ___cxa_vec_cleanup
 ___cxa_vec_ctor

Modified: libcxx/trunk/utils/libcxx/test/target_info.py
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/utils/libcxx/test/target_info.py?rev=358690&r1=358689&r2=358690&view=diff
==============================================================================
--- libcxx/trunk/utils/libcxx/test/target_info.py (original)
+++ libcxx/trunk/utils/libcxx/test/target_info.py Thu Apr 18 10:18:15 2019
@@ -156,15 +156,6 @@ class DarwinLocalTI(DefaultTargetInfo):
             env['DYLD_LIBRARY_PATH'] = ':'.join(library_paths)
 
     def allow_cxxabi_link(self):
-        # FIXME: PR27405
-        # libc++ *should* export all of the symbols found in libc++abi on OS X.
-        # For this reason LibcxxConfiguration will not link libc++abi in OS X.
-        # However __cxa_throw_bad_new_array_length doesn't get exported into
-        # libc++ yet so we still need to explicitly link libc++abi when testing
-        # libc++abi
-        # See PR22654.
-        if(self.full_config.get_lit_conf('name', '') == 'libc++abi'):
-            return True
         # Don't link libc++abi explicitly on OS X because the symbols
         # should be available in libc++ directly.
         return False




More information about the libcxx-commits mailing list