Index: libcxx/CMakeLists.txt =================================================================== --- libcxx/CMakeLists.txt +++ libcxx/CMakeLists.txt @@ -78,6 +78,7 @@ #=============================================================================== # Setup CMake Options #=============================================================================== +include(CheckCXXSymbolExists) include(CMakeDependentOption) include(HandleCompilerRT) @@ -325,6 +326,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 #=============================================================================== @@ -883,6 +888,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) Index: libcxx/include/__config =================================================================== --- libcxx/include/__config +++ libcxx/include/__config @@ -821,10 +821,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__) Index: libcxx/include/__config_site.in =================================================================== --- libcxx/include/__config_site.in +++ libcxx/include/__config_site.in @@ -32,6 +32,7 @@ #cmakedefine _LIBCPP_HAS_NO_WIDE_CHARACTERS #cmakedefine _LIBCPP_HAS_NO_INCOMPLETE_FORMAT #cmakedefine _LIBCPP_HAS_NO_INCOMPLETE_RANGES +#cmakedefine _LIBCPP_HAS_NO_INT128 // __USE_MINGW_ANSI_STDIO gets redefined on MinGW #ifdef __clang__ Index: libcxx/lib/abi/CMakeLists.txt =================================================================== --- libcxx/lib/abi/CMakeLists.txt +++ 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 debug_mode_enabled allow_incomplete) +function(cxx_abi_list_identifier result triple abi_library abi_version unstable exceptions new_delete_in_libcxx debug_mode_enabled allow_incomplete using_int128) set(abi_properties) if ("${triple}" MATCHES "darwin") @@ -45,6 +45,11 @@ else() list(APPEND abi_properties "noincomplete") 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) @@ -64,6 +69,7 @@ "${LIBCXX_ENABLE_NEW_DELETE_DEFINITIONS}" "${LIBCXX_ENABLE_DEBUG_MODE_SUPPORT}" "${LIBCXX_ENABLE_INCOMPLETE_FEATURES}" + "${LIBCXX_USE_INT128}" ) if (TARGET cxx_shared)