OSDN Git Service

[libc++] Simplify how we re-export symbols from libc++abi
authorLouis Dionne <ldionne@apple.com>
Wed, 30 Sep 2020 23:17:16 +0000 (19:17 -0400)
committerLouis Dionne <ldionne@apple.com>
Thu, 1 Oct 2020 12:30:27 +0000 (08:30 -0400)
Instead of managing two copies of the symbol lists, reuse the same list
in libc++abi and libc++.

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

libcxx/lib/abi/CHANGELOG.TXT
libcxx/lib/abi/x86_64-apple-darwin.v1.abilist
libcxx/lib/libc++abi-exceptions.exp [deleted file]
libcxx/lib/libc++abi-exceptions.sjlj.exp [deleted file]
libcxx/lib/libc++abi-new-delete.exp [deleted file]
libcxx/src/CMakeLists.txt
libcxxabi/src/CMakeLists.txt

index 0672fb3..7ed2b7e 100644 (file)
@@ -13,6 +13,20 @@ Afterwards the ABI list should be updated to include the new changes.
 New entries should be added directly below the "Version" header.
 
 ------------
+Version 12.0
+------------
+
+* XXXXXXX - [libc++] Simplify how we re-export symbols from libc++abi
+
+  We re-export some symbols that were exported from libc++abi but not from
+  libc++. Exporting new symbols is not an ABI break.
+
+  x86_64-apple-apple-darwin
+  -------------------------
+  Symbol added: ___cxa_allocate_dependent_exception
+  Symbol added: ___cxa_free_dependent_exception
+
+------------
 Version 10.0
 ------------
 
index db06a4c..e141feb 100644 (file)
 {'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__131__arrive_barrier_algorithm_baseEPNS_24__barrier_algorithm_baseEh'}
 {'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__132__destroy_barrier_algorithm_baseEPNS_24__barrier_algorithm_baseE'}
 {'type': 'FUNC', 'is_defined': True, 'name': '__ZNSt3__134__construct_barrier_algorithm_baseERl'}
+{'type': 'U', 'is_defined': False, 'name': '___cxa_allocate_dependent_exception'}
+{'type': 'U', 'is_defined': False, 'name': '___cxa_free_dependent_exception'}
+{'type': 'I', 'is_defined': True, 'name': '___cxa_allocate_dependent_exception'}
+{'type': 'I', 'is_defined': True, 'name': '___cxa_free_dependent_exception'}
diff --git a/libcxx/lib/libc++abi-exceptions.exp b/libcxx/lib/libc++abi-exceptions.exp
deleted file mode 100644 (file)
index 600a65f..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-___cxa_allocate_exception
-___cxa_begin_catch
-___cxa_call_unexpected
-___cxa_current_exception_type
-___cxa_end_catch
-___cxa_free_exception
-___cxa_get_exception_ptr
-___cxa_rethrow
-___cxa_throw
-___gxx_personality_v0
diff --git a/libcxx/lib/libc++abi-exceptions.sjlj.exp b/libcxx/lib/libc++abi-exceptions.sjlj.exp
deleted file mode 100644 (file)
index 10073d6..0000000
+++ /dev/null
@@ -1,10 +0,0 @@
-___cxa_allocate_exception
-___cxa_begin_catch
-___cxa_call_unexpected
-___cxa_current_exception_type
-___cxa_end_catch
-___cxa_free_exception
-___cxa_get_exception_ptr
-___cxa_rethrow
-___cxa_throw
-___gxx_personality_sj0
diff --git a/libcxx/lib/libc++abi-new-delete.exp b/libcxx/lib/libc++abi-new-delete.exp
deleted file mode 100644 (file)
index 9f74b03..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-__ZdaPv
-__ZdaPvRKSt9nothrow_t
-__ZdaPvSt11align_val_t
-__ZdaPvSt11align_val_tRKSt9nothrow_t
-__ZdaPvm
-__ZdaPvmSt11align_val_t
-__ZdlPv
-__ZdlPvRKSt9nothrow_t
-__ZdlPvSt11align_val_t
-__ZdlPvSt11align_val_tRKSt9nothrow_t
-__ZdlPvm
-__ZdlPvmSt11align_val_t
-__Znam
-__ZnamRKSt9nothrow_t
-__ZnamSt11align_val_t
-__ZnamSt11align_val_tRKSt9nothrow_t
-__Znwm
-__ZnwmRKSt9nothrow_t
-__ZnwmSt11align_val_t
-__ZnwmSt11align_val_tRKSt9nothrow_t
index dcd53c8..fc9fc0e 100644 (file)
@@ -212,18 +212,6 @@ if (LIBCXX_ENABLE_SHARED)
       "-Wl,-reexported_symbols_list,${CMAKE_CURRENT_SOURCE_DIR}/../lib/libc++abi.v${LIBCXX_LIBCPPABI_VERSION}.exp"
       "-Wl,-force_symbols_not_weak_list,${CMAKE_CURRENT_SOURCE_DIR}/../lib/notweak.exp"
       "-Wl,-force_symbols_weak_list,${CMAKE_CURRENT_SOURCE_DIR}/../lib/weak.exp")
-
-    if (LIBCXX_ENABLE_EXCEPTIONS)
-      if ("${CMAKE_OSX_ARCHITECTURES}" MATCHES "^(armv6|armv7|armv7s)$")
-        target_link_libraries(cxx_shared PRIVATE "-Wl,-reexported_symbols_list,${CMAKE_CURRENT_SOURCE_DIR}/../lib/libc++abi-exceptions.sjlj.exp")
-      else()
-        target_link_libraries(cxx_shared PRIVATE "-Wl,-reexported_symbols_list,${CMAKE_CURRENT_SOURCE_DIR}/../lib/libc++abi-exceptions.exp")
-      endif()
-    endif()
-
-    if (NOT LIBCXX_ENABLE_NEW_DELETE_DEFINITIONS)
-      target_link_libraries(cxx_shared PRIVATE "-Wl,-reexported_symbols_list,${CMAKE_CURRENT_SOURCE_DIR}/../lib/libc++abi-new-delete.exp")
-    endif()
   endif()
 
   # Generate a linker script in place of a libc++.so symlink.
index 85e3fda..e9e4540 100644 (file)
@@ -204,19 +204,27 @@ if (LIBCXXABI_ENABLE_SHARED)
 
   # -exported_symbols_list is only available on Apple platforms
   if (APPLE)
-    target_link_libraries(cxxabi_shared PRIVATE "-Wl,-exported_symbols_list,${CMAKE_CURRENT_SOURCE_DIR}/../lib/itanium-base.exp")
+    function(export_symbols file)
+      target_link_libraries(cxxabi_shared PRIVATE "-Wl,-exported_symbols_list,${file}")
+    endfunction()
+    function(reexport_symbols file)
+      export_symbols("${file}")
+      target_link_libraries(cxxabi_shared INTERFACE "-Wl,-reexported_symbols_list,${file}")
+    endfunction()
+
+    export_symbols("${CMAKE_CURRENT_SOURCE_DIR}/../lib/itanium-base.exp")
 
     if (LIBCXXABI_ENABLE_NEW_DELETE_DEFINITIONS)
-      target_link_libraries(cxxabi_shared PRIVATE "-Wl,-exported_symbols_list,${CMAKE_CURRENT_SOURCE_DIR}/../lib/new-delete.exp")
+      reexport_symbols("${CMAKE_CURRENT_SOURCE_DIR}/../lib/new-delete.exp")
     endif()
 
     if (LIBCXXABI_ENABLE_EXCEPTIONS)
-      target_link_libraries(cxxabi_shared PRIVATE "-Wl,-exported_symbols_list,${CMAKE_CURRENT_SOURCE_DIR}/../lib/exceptions.exp")
+      reexport_symbols("${CMAKE_CURRENT_SOURCE_DIR}/../lib/exceptions.exp")
 
       if ("${CMAKE_OSX_ARCHITECTURES}" MATCHES "^(armv6|armv7|armv7s)$")
-        target_link_libraries(cxxabi_shared PRIVATE "-Wl,-exported_symbols_list,${CMAKE_CURRENT_SOURCE_DIR}/../lib/personality-sjlj.exp")
+        reexport_symbols("${CMAKE_CURRENT_SOURCE_DIR}/../lib/personality-sjlj.exp")
       else()
-        target_link_libraries(cxxabi_shared PRIVATE "-Wl,-exported_symbols_list,${CMAKE_CURRENT_SOURCE_DIR}/../lib/personality-v0.exp")
+        reexport_symbols("${CMAKE_CURRENT_SOURCE_DIR}/../lib/personality-v0.exp")
       endif()
     endif()
   endif()