[PATCH] D45304: [libcxx] Set ABI version 2 as default for Fuchsia

Petr Hosek via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Apr 4 17:11:04 PDT 2018


phosek created this revision.
phosek added a reviewer: EricWF.
Herald added subscribers: cfe-commits, christof, mgorny.
phosek added a comment.

I don't like this but I'm not sure if there's a better way to do this, do you have any ideas?


This avoids the need for a custom generated config file.


Repository:
  rCXX libc++

https://reviews.llvm.org/D45304

Files:
  libcxx/CMakeLists.txt
  libcxx/include/__config


Index: libcxx/include/__config
===================================================================
--- libcxx/include/__config
+++ libcxx/include/__config
@@ -36,8 +36,12 @@
 #define _LIBCPP_VERSION 7000
 
 #ifndef _LIBCPP_ABI_VERSION
+#ifdef __Fuchsia__
+#define _LIBCPP_ABI_VERSION 2
+#else
 #define _LIBCPP_ABI_VERSION 1
 #endif
+#endif
 
 #if defined(__ELF__)
 #  define _LIBCPP_OBJECT_FORMAT_ELF   1
Index: libcxx/CMakeLists.txt
===================================================================
--- libcxx/CMakeLists.txt
+++ libcxx/CMakeLists.txt
@@ -97,7 +97,12 @@
 cmake_dependent_option(LIBCXX_INSTALL_EXPERIMENTAL_LIBRARY
         "Install libc++experimental.a" ON
         "LIBCXX_ENABLE_EXPERIMENTAL_LIBRARY;LIBCXX_INSTALL_LIBRARY" OFF)
-set(LIBCXX_ABI_VERSION 1 CACHE STRING "ABI version of libc++.")
+if (FUCHSIA)
+  set(ABI_VERSION_DEFAULT 2)
+else()
+  set(ABI_VERSION_DEFAULT 1)
+endif()
+set(LIBCXX_ABI_VERSION ${ABI_VERSION_DEFAULT} CACHE STRING "ABI version of libc++.")
 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.")


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D45304.141091.patch
Type: text/x-patch
Size: 1239 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20180405/193240ff/attachment.bin>


More information about the cfe-commits mailing list