[libcxx] r343079 - [libc++] Remove Fuchsia-specific knowledge to pick the ABI version
Louis Dionne
ldionne at apple.com
Wed Sep 26 01:24:51 PDT 2018
Author: ldionne
Date: Wed Sep 26 01:24:51 2018
New Revision: 343079
URL: http://llvm.org/viewvc/llvm-project?rev=343079&view=rev
Log:
[libc++] Remove Fuchsia-specific knowledge to pick the ABI version
Summary:
The ABI version used by libc++ is a configuration option just like any other
configuration option. It is a knob that can be used by vendors to customize
the libc++ that they ship. As such, we should not be hardcoding vendor-specific
configuration choices in libc++.
When building libc++ for Fuchsia, Fuchsia's build scripts should simply define
the libc++ ABI version to 2 -- this will result in the _LIBCPP_ABI_VERSION
macro being defined in the __config header that is generated when libc++ is
built and installed, which is the correct way to customize libc++'s behavior
for specific vendors.
Reviewers: phosek, EricWF
Subscribers: mgorny, christof, dexonsmith, cfe-commits, libcxx-commits
Differential Revision: https://reviews.llvm.org/D52397
Modified:
libcxx/trunk/CMakeLists.txt
libcxx/trunk/include/__config
Modified: libcxx/trunk/CMakeLists.txt
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/CMakeLists.txt?rev=343079&r1=343078&r2=343079&view=diff
==============================================================================
--- libcxx/trunk/CMakeLists.txt (original)
+++ libcxx/trunk/CMakeLists.txt Wed Sep 26 01:24:51 2018
@@ -111,12 +111,7 @@ cmake_dependent_option(LIBCXX_INSTALL_FI
"Install libc++fs.a" ON
"LIBCXX_ENABLE_FILESYSTEM;LIBCXX_INSTALL_LIBRARY" OFF)
-if (FUCHSIA)
- set(DEFAULT_ABI_VERSION 2)
-else()
- set(DEFAULT_ABI_VERSION 1)
-endif()
-set(LIBCXX_ABI_VERSION ${DEFAULT_ABI_VERSION} CACHE STRING "ABI version of libc++.")
+set(LIBCXX_ABI_VERSION "1" CACHE STRING "ABI version of libc++. Can be either 1 or 2, where 2 is currently not stable. Defaults to 1.")
option(LIBCXX_ABI_UNSTABLE "Unstable ABI of libc++." OFF)
option(LIBCXX_ABI_FORCE_ITANIUM "Ignore auto-detection and force use of the Itanium ABI.")
option(LIBCXX_ABI_FORCE_MICROSOFT "Ignore auto-detection and force use of the Microsoft ABI.")
@@ -657,7 +652,7 @@ if (LIBCXX_STANDALONE_BUILD)
endif()
# Configuration file flags =====================================================
-if (NOT LIBCXX_ABI_VERSION EQUAL DEFAULT_ABI_VERSION)
+if (NOT LIBCXX_ABI_VERSION EQUAL 1)
config_define(${LIBCXX_ABI_VERSION} _LIBCPP_ABI_VERSION)
endif()
config_define_if(LIBCXX_ABI_UNSTABLE _LIBCPP_ABI_UNSTABLE)
Modified: libcxx/trunk/include/__config
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/__config?rev=343079&r1=343078&r2=343079&view=diff
==============================================================================
--- libcxx/trunk/include/__config (original)
+++ libcxx/trunk/include/__config Wed Sep 26 01:24:51 2018
@@ -36,11 +36,7 @@
#define _LIBCPP_VERSION 8000
#ifndef _LIBCPP_ABI_VERSION
-# ifdef __Fuchsia__
-# define _LIBCPP_ABI_VERSION 2
-# else
-# define _LIBCPP_ABI_VERSION 1
-# endif
+# define _LIBCPP_ABI_VERSION 1
#endif
#ifndef _LIBCPP_STD_VER
More information about the libcxx-commits
mailing list