mirror of
https://github.com/llvm-mirror/libcxx.git
synced 2025-10-20 22:10:03 +08:00
[libcxx] Fix check-cxx-abilist on OS X
Summary: Recent commits broke the check-cxx-abilist by changing the default OS X to use `-rexport_library` instead of `-reexport_symbol_list`. Apparently `-reexport_library` doesn't export the symbols into `libc++.dylib`s symbol table, whereas `-reexport_symbol_list` does. This means the change removed ~500 symbols from the symbol table. I've been told this change is non ABI breaking, but it does make it harder to maintain the ABI lists, and hence the ABI. This patch fixes the issue by switching back to `-reexport_symbol_list`. It still avoid the issues fixed in r299052 by putting the new/delete symbols in a different symbol list file, which is only exported when LIBCXX_ENABLE_NEW_DELETE_DEFINITIONS in OFF. Reviewers: mehdi_amini, smeenai, dexonsmith Reviewed By: smeenai Subscribers: mgorny, cfe-commits Differential Revision: https://reviews.llvm.org/D31644 git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@300390 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -155,11 +155,7 @@ if (LIBCXX_OSX_REEXPORT_SYSTEM_ABI_LIBRARY)
|
|||||||
"-Wl,-unexported_symbols_list,${CMAKE_CURRENT_SOURCE_DIR}/libc++unexp.exp"
|
"-Wl,-unexported_symbols_list,${CMAKE_CURRENT_SOURCE_DIR}/libc++unexp.exp"
|
||||||
"/usr/lib/libSystem.B.dylib")
|
"/usr/lib/libSystem.B.dylib")
|
||||||
else()
|
else()
|
||||||
if (LIBCXX_ENABLE_NEW_DELETE_DEFINITIONS)
|
if (DEFINED CMAKE_OSX_SYSROOT AND NOT CMAKE_OSX_SYSROOT STREQUAL "")
|
||||||
# We can't use the "-reexported_symbols_list" when we build the
|
|
||||||
# new/delete operators as part of the dylib: the linker would fail.
|
|
||||||
set(OSX_RE_EXPORT_LINE "-Wl,-reexport_library,${CMAKE_OSX_SYSROOT}/usr/lib/libc++abi.dylib")
|
|
||||||
elseif (DEFINED CMAKE_OSX_SYSROOT AND NOT CMAKE_OSX_SYSROOT STREQUAL "")
|
|
||||||
list(FIND CMAKE_OSX_ARCHITECTURES "armv7" OSX_HAS_ARMV7)
|
list(FIND CMAKE_OSX_ARCHITECTURES "armv7" OSX_HAS_ARMV7)
|
||||||
if (NOT OSX_HAS_ARMV7 EQUAL -1)
|
if (NOT OSX_HAS_ARMV7 EQUAL -1)
|
||||||
set(OSX_RE_EXPORT_LINE
|
set(OSX_RE_EXPORT_LINE
|
||||||
@@ -171,8 +167,10 @@ if (LIBCXX_OSX_REEXPORT_SYSTEM_ABI_LIBRARY)
|
|||||||
endif()
|
endif()
|
||||||
else()
|
else()
|
||||||
set(OSX_RE_EXPORT_LINE "/usr/lib/libc++abi.dylib -Wl,-reexported_symbols_list,${CMAKE_CURRENT_SOURCE_DIR}/libc++abi${LIBCXX_LIBCPPABI_VERSION}.exp")
|
set(OSX_RE_EXPORT_LINE "/usr/lib/libc++abi.dylib -Wl,-reexported_symbols_list,${CMAKE_CURRENT_SOURCE_DIR}/libc++abi${LIBCXX_LIBCPPABI_VERSION}.exp")
|
||||||
|
if (NOT LIBCXX_ENABLE_NEW_DELETE_DEFINITIONS)
|
||||||
|
add_link_flags("/usr/lib/libc++abi.dylib -Wl,-reexported_symbols_list,${CMAKE_CURRENT_SOURCE_DIR}/libc++abi-new-delete.exp")
|
||||||
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
add_link_flags(
|
add_link_flags(
|
||||||
"-compatibility_version 1"
|
"-compatibility_version 1"
|
||||||
"-install_name /usr/lib/libc++.1.dylib"
|
"-install_name /usr/lib/libc++.1.dylib"
|
||||||
|
8
lib/libc++abi-new-delete.exp
Normal file
8
lib/libc++abi-new-delete.exp
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
__ZdaPv
|
||||||
|
__ZdlPv
|
||||||
|
__ZdlPvRKSt9nothrow_t
|
||||||
|
__Znam
|
||||||
|
__ZdaPvRKSt9nothrow_t
|
||||||
|
__Znwm
|
||||||
|
__ZnwmRKSt9nothrow_t
|
||||||
|
__ZnamRKSt9nothrow_t
|
@@ -209,14 +209,6 @@ __ZNSt20bad_array_new_lengthC2Ev
|
|||||||
__ZNSt20bad_array_new_lengthD0Ev
|
__ZNSt20bad_array_new_lengthD0Ev
|
||||||
__ZNSt20bad_array_new_lengthD2Ev
|
__ZNSt20bad_array_new_lengthD2Ev
|
||||||
__ZSt10unexpectedv
|
__ZSt10unexpectedv
|
||||||
__ZdaPv
|
|
||||||
__ZdlPv
|
|
||||||
__ZdlPvRKSt9nothrow_t
|
|
||||||
__Znam
|
|
||||||
__ZdaPvRKSt9nothrow_t
|
|
||||||
__Znwm
|
|
||||||
__ZnwmRKSt9nothrow_t
|
|
||||||
__ZnamRKSt9nothrow_t
|
|
||||||
__ZTISt10bad_typeid
|
__ZTISt10bad_typeid
|
||||||
__ZTISt8bad_cast
|
__ZTISt8bad_cast
|
||||||
___cxa_bad_typeid
|
___cxa_bad_typeid
|
||||||
|
Reference in New Issue
Block a user