From 6bff1eb9b0994ce2152c2f0a9f7ea62f18b0204b Mon Sep 17 00:00:00 2001 From: Nikolas Klauser Date: Thu, 3 Aug 2023 16:37:22 -0700 Subject: [PATCH] [libc++][libunwind] Fixes to allow GCC 13 to compile libunwind/libc++abi/libc++ These are changes to allow GCC 13 to successfully compile the runtimes stack. Reviewed By: ldionne, #libc, #libunwind, MaskRay Spies: MaskRay, zibi, SeanP, power-llvm-team, mstorsjo, arichardson, libcxx-commits Differential Revision: https://reviews.llvm.org/D151387 (cherry picked from commit 3537338d1ab9b6da4b58499877953deb81c59e5e) --- libcxx/include/__type_traits/remove_cv.h | 2 +- libcxx/include/__type_traits/remove_cvref.h | 2 +- libunwind/src/CMakeLists.txt | 5 ----- 3 files changed, 2 insertions(+), 7 deletions(-) diff --git a/libcxx/include/__type_traits/remove_cv.h b/libcxx/include/__type_traits/remove_cv.h index 8fe8fb0..c4bf612 100644 --- a/libcxx/include/__type_traits/remove_cv.h +++ b/libcxx/include/__type_traits/remove_cv.h @@ -19,7 +19,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD -#if __has_builtin(__remove_cv) +#if __has_builtin(__remove_cv) && !defined(_LIBCPP_COMPILER_GCC) template struct remove_cv { using type _LIBCPP_NODEBUG = __remove_cv(_Tp); diff --git a/libcxx/include/__type_traits/remove_cvref.h b/libcxx/include/__type_traits/remove_cvref.h index 4dc950ac..e8e8745 100644 --- a/libcxx/include/__type_traits/remove_cvref.h +++ b/libcxx/include/__type_traits/remove_cvref.h @@ -20,7 +20,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD -#if __has_builtin(__remove_cvref) +#if __has_builtin(__remove_cvref) && !defined(_LIBCPP_COMPILER_GCC) template using __remove_cvref_t _LIBCPP_NODEBUG = __remove_cvref(_Tp); #else diff --git a/libunwind/src/CMakeLists.txt b/libunwind/src/CMakeLists.txt index e5897fe..bb2ada9 100644 --- a/libunwind/src/CMakeLists.txt +++ b/libunwind/src/CMakeLists.txt @@ -80,11 +80,6 @@ endif() # Setup flags. add_link_flags_if(CXX_SUPPORTS_UNWINDLIB_EQ_NONE_FLAG --unwindlib=none) -if (CXX_SUPPORTS_NOSTDLIBXX_FLAG) - add_link_flags_if_supported(-nostdlib++) -else() - add_link_flags_if_supported(-nodefaultlibs) -endif() # MINGW_LIBRARIES is defined in config-ix.cmake add_library_flags_if(MINGW "${MINGW_LIBRARIES}") -- 2.7.4