diff options
author | Louis Dionne <ldionne@apple.com> | 2019-03-20 18:16:24 +0000 |
---|---|---|
committer | Louis Dionne <ldionne@apple.com> | 2019-03-20 18:16:24 +0000 |
commit | 2d0b4d6bb3c12278d60ef7c957c0dba77d81dc95 (patch) | |
tree | 65daa94c9fef9c1f7d516fe0efb959645ae0d550 | |
parent | 00b5ecab5d8133fe437cf4668b46cb5d2716447f (diff) | |
download | bcm5719-llvm-2d0b4d6bb3c12278d60ef7c957c0dba77d81dc95.tar.gz bcm5719-llvm-2d0b4d6bb3c12278d60ef7c957c0dba77d81dc95.zip |
[libc++][CMake] Clean up some of the libc++ re-exporting logic
Summary:
This change allows specifying the version of libc++abi's ABI to re-export
when configuring CMake. It also clearly identifies which ABI version of
libc++abi each export file contains.
Finally, it removes hardcoded knowledge about the 10.9 SDK for MacOS,
since that knowledge is not relevant anymore. Indeed, libc++ can't be
built with the toolchain that came with the 10.9 SDK anyway because
the version of Clang it includes is too old (for example if you want
to build a working libc++.dylib, you need bugfixes to visibility
attributes that are only in recent Clangs).
Reviewers: dexonsmith, EricWF
Subscribers: mgorny, christof, jkorous, arphaman, libcxx-commits
Differential Revision: https://reviews.llvm.org/D59489
llvm-svn: 356587
-rw-r--r-- | libcxx/CMakeLists.txt | 2 | ||||
-rw-r--r-- | libcxx/cmake/Modules/HandleLibCXXABI.cmake | 1 | ||||
-rw-r--r-- | libcxx/docs/index.rst | 2 | ||||
-rw-r--r-- | libcxx/lib/CMakeLists.txt | 22 | ||||
-rw-r--r-- | libcxx/lib/libc++abi.v1.exp (renamed from libcxx/lib/libc++abi.exp) | 0 | ||||
-rw-r--r-- | libcxx/lib/libc++abi.v2.exp (renamed from libcxx/lib/libc++abi2.exp) | 0 | ||||
-rw-r--r-- | libcxx/lib/libc++sjlj-abi.v1.exp (renamed from libcxx/lib/libc++sjlj-abi.exp) | 0 | ||||
-rw-r--r-- | libcxx/www/index.html | 5 |
8 files changed, 4 insertions, 28 deletions
diff --git a/libcxx/CMakeLists.txt b/libcxx/CMakeLists.txt index 9e0d5edbb3c..d9ef20ad02b 100644 --- a/libcxx/CMakeLists.txt +++ b/libcxx/CMakeLists.txt @@ -120,6 +120,8 @@ option(LIBCXX_ABI_FORCE_MICROSOFT "Ignore auto-detection and force use of the Mi option(LIBCXX_HIDE_FROM_ABI_PER_TU_BY_DEFAULT "Enable per TU ABI insulation by default. To be used by vendors." OFF) set(LIBCXX_ABI_DEFINES "" CACHE STRING "A semicolon separated list of ABI macros to define in the site config header.") option(LIBCXX_USE_COMPILER_RT "Use compiler-rt instead of libgcc" OFF) +set(LIBCXX_LIBCPPABI_VERSION "2" CACHE STRING "Version of libc++abi's ABI to re-export from libc++ when re-exporting is enabled. + Note that this is not related to the version of libc++'s ABI itself!") if (NOT LIBCXX_ENABLE_SHARED AND NOT LIBCXX_ENABLE_STATIC) message(FATAL_ERROR "libc++ must be built as either a shared or static library.") diff --git a/libcxx/cmake/Modules/HandleLibCXXABI.cmake b/libcxx/cmake/Modules/HandleLibCXXABI.cmake index 89f2e97d8b1..44c59a57341 100644 --- a/libcxx/cmake/Modules/HandleLibCXXABI.cmake +++ b/libcxx/cmake/Modules/HandleLibCXXABI.cmake @@ -103,7 +103,6 @@ elseif ("${LIBCXX_CXX_ABI_LIBNAME}" STREQUAL "libcxxabi") else() set(CXXABI_LIBNAME cxxabi_shared) endif() - set(LIBCXX_LIBCPPABI_VERSION "2" PARENT_SCOPE) else() # Assume c++abi is installed in the system, rely on -lc++abi link flag. set(CXXABI_LIBNAME "c++abi") diff --git a/libcxx/docs/index.rst b/libcxx/docs/index.rst index 80c2a8ddd8e..0fd35407f34 100644 --- a/libcxx/docs/index.rst +++ b/libcxx/docs/index.rst @@ -121,8 +121,6 @@ This list contains known issues with libc++ * Building libc++ with ``-fno-rtti`` is not supported. However linking against it with ``-fno-rtti`` is supported. -* On OS X v10.8 and older the CMake option ``-DLIBCXX_LIBCPPABI_VERSION=""`` - must be used during configuration. A full list of currently open libc++ bugs can be `found here`__. diff --git a/libcxx/lib/CMakeLists.txt b/libcxx/lib/CMakeLists.txt index 9af75ef3941..e73e459e3fd 100644 --- a/libcxx/lib/CMakeLists.txt +++ b/libcxx/lib/CMakeLists.txt @@ -136,28 +136,10 @@ if (LIBCXX_TARGETING_MSVC) endif() if (LIBCXX_OSX_REEXPORT_LIBCXXABI_SYMBOLS) - 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") - endif() - endif() - endif() - if ("armv7" IN_LIST CMAKE_OSX_ARCHITECTURES) - set(RE_EXPORT_LIST "${CMAKE_CURRENT_SOURCE_DIR}/libc++sjlj-abi.exp") + set(RE_EXPORT_LIST "${CMAKE_CURRENT_SOURCE_DIR}/libc++sjlj-abi.v${LIBCXX_LIBCPPABI_VERSION}.exp") else() - set(RE_EXPORT_LIST "${CMAKE_CURRENT_SOURCE_DIR}/libc++abi${LIBCXX_LIBCPPABI_VERSION}.exp") + set(RE_EXPORT_LIST "${CMAKE_CURRENT_SOURCE_DIR}/libc++abi.v${LIBCXX_LIBCPPABI_VERSION}.exp") endif() add_link_flags( "-compatibility_version 1" diff --git a/libcxx/lib/libc++abi.exp b/libcxx/lib/libc++abi.v1.exp index 879b4dd141e..879b4dd141e 100644 --- a/libcxx/lib/libc++abi.exp +++ b/libcxx/lib/libc++abi.v1.exp diff --git a/libcxx/lib/libc++abi2.exp b/libcxx/lib/libc++abi.v2.exp index 40c055dae97..40c055dae97 100644 --- a/libcxx/lib/libc++abi2.exp +++ b/libcxx/lib/libc++abi.v2.exp diff --git a/libcxx/lib/libc++sjlj-abi.exp b/libcxx/lib/libc++sjlj-abi.v1.exp index f494e17cfde..f494e17cfde 100644 --- a/libcxx/lib/libc++sjlj-abi.exp +++ b/libcxx/lib/libc++sjlj-abi.v1.exp diff --git a/libcxx/www/index.html b/libcxx/www/index.html index c707bc18b3a..d7563a78ddf 100644 --- a/libcxx/www/index.html +++ b/libcxx/www/index.html @@ -190,11 +190,6 @@ Building libc++ with <code>-fno-rtti</code> is not supported. However linking against it with <code>-fno-rtti</code> is supported. </li> - <li> - On OS X v10.8 and older the CMake option - <code>-DLIBCXX_LIBCPPABI_VERSION=""</code> must be used during - configuration. - </li> </ul> </p> |