diff --git a/libcxx/CMakeLists.txt b/libcxx/CMakeLists.txt --- a/libcxx/CMakeLists.txt +++ b/libcxx/CMakeLists.txt @@ -71,6 +71,7 @@ #=============================================================================== # Setup CMake Options #=============================================================================== +include(CheckCXXSymbolExists) include(CMakeDependentOption) include(HandleCompilerRT) @@ -310,6 +311,10 @@ option(LIBCXX_HERMETIC_STATIC_LIBRARY "Do not export any symbols from the static library." OFF) +check_cxx_symbol_exists(__SIZEOF_INT128__ "" LIBCXX_HAVE_INT128) +cmake_dependent_option(LIBCXX_USE_INT128 "Use __int128 in the library" ON +"LIBCXX_HAVE_INT128" OFF) + #=============================================================================== # Check option configurations #=============================================================================== @@ -897,6 +902,7 @@ # easier to grep for target specific flags once the feature is complete. config_define_if_not(LIBCXX_ENABLE_INCOMPLETE_FEATURES _LIBCPP_HAS_NO_INCOMPLETE_FORMAT) config_define_if_not(LIBCXX_ENABLE_INCOMPLETE_FEATURES _LIBCPP_HAS_NO_INCOMPLETE_RANGES) +config_define_if_not(LIBCXX_USE_INT128 _LIBCPP_HAS_NO_INT128) if (LIBCXX_ABI_DEFINES) set(abi_defines) diff --git a/libcxx/include/__config b/libcxx/include/__config --- a/libcxx/include/__config +++ b/libcxx/include/__config @@ -795,10 +795,6 @@ typedef unsigned int char32_t; #endif -#ifndef __SIZEOF_INT128__ -#define _LIBCPP_HAS_NO_INT128 -#endif - #ifdef _LIBCPP_CXX03_LANG # define static_assert(...) _Static_assert(__VA_ARGS__) # define decltype(...) __decltype(__VA_ARGS__) diff --git a/libcxx/include/__config_site.in b/libcxx/include/__config_site.in --- a/libcxx/include/__config_site.in +++ b/libcxx/include/__config_site.in @@ -33,6 +33,7 @@ #cmakedefine _LIBCPP_HAS_NO_WIDE_CHARACTERS #cmakedefine _LIBCPP_HAS_NO_INCOMPLETE_FORMAT #cmakedefine _LIBCPP_HAS_NO_INCOMPLETE_RANGES +#cmakedefine _LIBCPP_HAS_NO_INT128 @_LIBCPP_ABI_DEFINES@ diff --git a/libcxx/lib/abi/CMakeLists.txt b/libcxx/lib/abi/CMakeLists.txt --- a/libcxx/lib/abi/CMakeLists.txt +++ b/libcxx/lib/abi/CMakeLists.txt @@ -7,7 +7,7 @@ # Right now, this is done by using the ABI identifier as the filename containing # the list of symbols exported by libc++ for that configuration, however we could # make it more sophisticated if the number of ABI-affecting parameters grew. -function(cxx_abi_list_identifier result triple abi_library abi_version unstable exceptions new_delete_in_libcxx) +function(cxx_abi_list_identifier result triple abi_library abi_version unstable exceptions new_delete_in_libcxx using_int128) set(abi_properties) if ("${triple}" MATCHES "darwin") @@ -35,6 +35,11 @@ else() list(APPEND abi_properties "no_new_in_libcxx") endif() + if (${using_int128}) + list(APPEND abi_properties "int128") + else() + list(APPEND abi_properties "no_int128") + endif() list(JOIN abi_properties "." tmp) set(${result} "${tmp}" PARENT_SCOPE) @@ -47,6 +52,7 @@ "${LIBCXX_ABI_UNSTABLE}" "${LIBCXX_ENABLE_EXCEPTIONS}" "${LIBCXX_ENABLE_NEW_DELETE_DEFINITIONS}" + "${LIBCXX_USE_INT128}" ) if (TARGET cxx_shared) diff --git a/libcxx/lib/abi/arm64-apple-darwin.libcxxabi.v1.stable.exceptions.no_new_in_libcxx.abilist b/libcxx/lib/abi/arm64-apple-darwin.libcxxabi.v1.stable.exceptions.no_new_in_libcxx.int128.abilist rename from libcxx/lib/abi/arm64-apple-darwin.libcxxabi.v1.stable.exceptions.no_new_in_libcxx.abilist rename to libcxx/lib/abi/arm64-apple-darwin.libcxxabi.v1.stable.exceptions.no_new_in_libcxx.int128.abilist diff --git a/libcxx/lib/abi/x86_64-apple-darwin.libcxxabi.v1.stable.exceptions.no_new_in_libcxx.abilist b/libcxx/lib/abi/x86_64-apple-darwin.libcxxabi.v1.stable.exceptions.no_new_in_libcxx.int128.abilist rename from libcxx/lib/abi/x86_64-apple-darwin.libcxxabi.v1.stable.exceptions.no_new_in_libcxx.abilist rename to libcxx/lib/abi/x86_64-apple-darwin.libcxxabi.v1.stable.exceptions.no_new_in_libcxx.int128.abilist diff --git a/libcxx/lib/abi/x86_64-unknown-linux-gnu.libcxxabi.v1.stable.exceptions.no_new_in_libcxx.abilist b/libcxx/lib/abi/x86_64-unknown-linux-gnu.libcxxabi.v1.stable.exceptions.no_new_in_libcxx.int128.abilist rename from libcxx/lib/abi/x86_64-unknown-linux-gnu.libcxxabi.v1.stable.exceptions.no_new_in_libcxx.abilist rename to libcxx/lib/abi/x86_64-unknown-linux-gnu.libcxxabi.v1.stable.exceptions.no_new_in_libcxx.int128.abilist