From 5495ff4d7885ea69d57501a6cbde834cf2a0c60f Mon Sep 17 00:00:00 2001 From: Petro Karashchenko Date: Fri, 16 Feb 2024 14:22:07 +0100 Subject: [PATCH] libs/libxx: add patch to remove mach/mach_time.h inclusion Inclusion of mach/mach_time.h by libcxx/src/chrono.cpp breaks the build on latest MACOS dues to https://forums.developer.apple.com/forums/thread/746737 The interface from mach/mach_time.h is not referenced in chrono.cpp so it is safe to remove it Signed-off-by: Petro Karashchenko --- libs/libxx/0001-libcxx-remove-mach-time-h.patch | 13 +++++++++++++ libs/libxx/libcxx.cmake | 4 +++- libs/libxx/libcxx.defs | 1 + 3 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 libs/libxx/0001-libcxx-remove-mach-time-h.patch diff --git a/libs/libxx/0001-libcxx-remove-mach-time-h.patch b/libs/libxx/0001-libcxx-remove-mach-time-h.patch new file mode 100644 index 0000000000..7019bc6d56 --- /dev/null +++ b/libs/libxx/0001-libcxx-remove-mach-time-h.patch @@ -0,0 +1,13 @@ +--- libcxx/src/chrono.cpp ++++ libcxx/src/chrono.cpp +@@ -48,10 +48,6 @@ + # include + #endif + +-#if __has_include() +-# include +-#endif +- + #if defined(__ELF__) && defined(_LIBCPP_LINK_RT_LIB) + # pragma comment(lib, "rt") + #endif diff --git a/libs/libxx/libcxx.cmake b/libs/libxx/libcxx.cmake index b20dbf724d..47b8c040e4 100644 --- a/libs/libxx/libcxx.cmake +++ b/libs/libxx/libcxx.cmake @@ -43,7 +43,9 @@ if(NOT EXISTS ${CMAKE_CURRENT_LIST_DIR}/libcxx) patch -p1 -d ${CMAKE_CURRENT_LIST_DIR}/libcxx < ${CMAKE_CURRENT_LIST_DIR}/0001_fix_stdatomic_h_miss_typedef.patch && patch -p3 -d ${CMAKE_CURRENT_LIST_DIR}/libcxx < - ${CMAKE_CURRENT_LIST_DIR}/mbstate_t.patch + ${CMAKE_CURRENT_LIST_DIR}/mbstate_t.patch && patch -p1 -d + ${CMAKE_CURRENT_LIST_DIR}/libcxx < + ${CMAKE_CURRENT_LIST_DIR}/0001-libcxx-remove-mach-time-h.patch DOWNLOAD_NO_PROGRESS true TIMEOUT 30) diff --git a/libs/libxx/libcxx.defs b/libs/libxx/libcxx.defs index ed456f82dd..4f8bfd3ca6 100644 --- a/libs/libxx/libcxx.defs +++ b/libs/libxx/libcxx.defs @@ -30,6 +30,7 @@ libcxx: libcxx-$(LIBCXX_VERSION).src.tar.xz --exclude libcxx-$(LIBCXX_VERSION).src/test/std/pstl $(Q) mv libcxx-$(LIBCXX_VERSION).src libcxx $(Q) patch -p2 < mbstate_t.patch + $(Q) patch -p0 < 0001-libcxx-remove-mach-time-h.patch $(Q) touch $@ endif