[libcxx-commits] [libcxx] 3537338 - [libc++][libunwind] Fixes to allow GCC 13 to compile libunwind/libc++abi/libc++

Nikolas Klauser via libcxx-commits libcxx-commits at lists.llvm.org
Fri Aug 4 00:51:50 PDT 2023


Author: Nikolas Klauser
Date: 2023-08-04T00:51:43-07:00
New Revision: 3537338d1ab9b6da4b58499877953deb81c59e5e

URL: https://github.com/llvm/llvm-project/commit/3537338d1ab9b6da4b58499877953deb81c59e5e
DIFF: https://github.com/llvm/llvm-project/commit/3537338d1ab9b6da4b58499877953deb81c59e5e.diff

LOG: [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

Added: 
    

Modified: 
    libcxx/include/__type_traits/remove_cv.h
    libcxx/include/__type_traits/remove_cvref.h
    libunwind/src/CMakeLists.txt

Removed: 
    


################################################################################
diff  --git a/libcxx/include/__type_traits/remove_cv.h b/libcxx/include/__type_traits/remove_cv.h
index 8fe8fb0e49596f..c4bf612794bd55 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 <class _Tp>
 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 4dc950ac31ad8e..e8e8745ab09609 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 <class _Tp>
 using __remove_cvref_t _LIBCPP_NODEBUG = __remove_cvref(_Tp);
 #else

diff  --git a/libunwind/src/CMakeLists.txt b/libunwind/src/CMakeLists.txt
index e5897fedd2125e..bb2ada94d939d4 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}")


        


More information about the libcxx-commits mailing list