Automatically detect export lists for OS X.
Summary: Libc++ reexports symbols from the system libc++abi using -reexport_symbols_list. This can cause a linker failure if the list contains symbols not defined in the system libc++abi. This patch attempts to detect the OS X version and use it to determine the correct symbol list. It's my understanding that `lib/libc++abi2.exp` should be used on 10.9 and greater. Otherwise 'lib/libc++abi.exp' should be used This fixes PR25666 (https://llvm.org/bugs/show_bug.cgi?id=25666) Reviewers: mclow.lists, bcraig, dexonsmith, EricWF Subscribers: cfe-commits Differential Revision: http://reviews.llvm.org/D20772 git-svn-id: https://llvm.org/svn/llvm-project/libcxx/trunk@272723 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -88,8 +88,22 @@ add_link_flags_if_supported(-nodefaultlibs)
|
|||||||
if ( APPLE AND (LIBCXX_CXX_ABI_LIBNAME STREQUAL "libcxxabi" OR
|
if ( APPLE AND (LIBCXX_CXX_ABI_LIBNAME STREQUAL "libcxxabi" OR
|
||||||
LIBCXX_CXX_ABI_LIBNAME STREQUAL "none"))
|
LIBCXX_CXX_ABI_LIBNAME STREQUAL "none"))
|
||||||
if (NOT DEFINED LIBCXX_LIBCPPABI_VERSION)
|
if (NOT DEFINED LIBCXX_LIBCPPABI_VERSION)
|
||||||
|
set(LIBCXX_LIBCPPABI_VERSION "2") # Default value
|
||||||
|
execute_process(
|
||||||
|
COMMAND xcrun --show-sdk-version
|
||||||
|
OUTPUT_VARIABLE sdk_ver
|
||||||
|
RESULT_VARIABLE res
|
||||||
|
OUTPUT_STRIP_TRAILING_WHITESPACE)
|
||||||
|
if (res EQUAL 0)
|
||||||
|
message(STATUS "Found SDK version ${sdk_ver}")
|
||||||
|
string(REPLACE "10." "" sdk_ver "${sdk_ver}")
|
||||||
|
if (sdk_ver LESS 9)
|
||||||
|
set(LIBCXX_LIBCPPABI_VERSION "")
|
||||||
|
else()
|
||||||
set(LIBCXX_LIBCPPABI_VERSION "2")
|
set(LIBCXX_LIBCPPABI_VERSION "2")
|
||||||
endif()
|
endif()
|
||||||
|
endif()
|
||||||
|
endif()
|
||||||
|
|
||||||
if ( CMAKE_OSX_DEPLOYMENT_TARGET STREQUAL "10.6" )
|
if ( CMAKE_OSX_DEPLOYMENT_TARGET STREQUAL "10.6" )
|
||||||
add_definitions(-D__STRICT_ANSI__)
|
add_definitions(-D__STRICT_ANSI__)
|
||||||
|
|||||||
Reference in New Issue
Block a user