diff --git a/ports/qtbase/55c53f9.diff b/ports/qtbase/55c53f9.diff new file mode 100644 index 00000000000000..9dd524a795aaee --- /dev/null +++ b/ports/qtbase/55c53f9.diff @@ -0,0 +1,70 @@ +From 55c53f9b21d96cd74200a54cd2b1e5f87d643f19 Mon Sep 17 00:00:00 2001 +From: Marc Mutz +Date: Thu, 19 Sep 2024 14:37:58 +0200 +Subject: [PATCH] Fix compilation with clang-cl + +Like for VxWorks, we need to undef QT_COMPILER_SUPPORTS_INT128, not +QT_SUPPORTS_INT128, because there is no clang-cl configuration where + supports qint128, therefore no mode we can force Qt's +own build into to make sure that the qint128 Qt ABI exists in the DLLs +on platforms that principally support it (like libstdc++). + +Requires to include a stdlib header into qsystemdetection.h, which +included nothing before, to enable checking of stdlib defines. + +Amends 1f9a660eb2d5c6e3cb9c80dc292f3ec355296515. + +Task-number: QTBUG-128675 +Pick-to: 6.8 6.8.0 +Change-Id: Ic4a63502edbec3d4ca5e16934bf83119e84b0ad6 +--- + +diff --git a/src/corelib/global/qsystemdetection.h b/src/corelib/global/qsystemdetection.h +index 0cbcef2..6d0a044 100644 +--- a/src/corelib/global/qsystemdetection.h ++++ b/src/corelib/global/qsystemdetection.h +@@ -11,6 +11,10 @@ + #ifndef QSYSTEMDETECTION_H + #define QSYSTEMDETECTION_H + ++#ifdef __cplusplus ++# include // to enable stdlib detection ++#endif ++ + /* + The operating system, must be one of: (Q_OS_x) + +@@ -240,11 +244,16 @@ + #endif + + #if defined(__SIZEOF_INT128__) ++# define QT_COMPILER_SUPPORTS_INT128 __SIZEOF_INT128__ + // Compiler used in VxWorks SDK declares __SIZEOF_INT128__ but VxWorks doesn't support this type, + // so we can't rely solely on compiler here. +-#if !defined(Q_OS_VXWORKS) +-# define QT_COMPILER_SUPPORTS_INT128 __SIZEOF_INT128__ +-#endif ++# ifdef Q_OS_VXWORKS ++# undef QT_COMPILER_SUPPORTS_INT128 ++# endif ++// Ditto clang-cl vs. MSSTL: ++# if defined(__clang__) && defined(_MSVC_STL_VERSION) // Clang with MSVC's STL ++# undef QT_COMPILER_SUPPORTS_INT128 // MSVC's STL doesn't support int128 ++# endif + #endif // defined(__SIZEOF_INT128__) + + #endif // QSYSTEMDETECTION_H +diff --git a/src/corelib/global/qtypes.h b/src/corelib/global/qtypes.h +index 28f84db..a863e99 100644 +--- a/src/corelib/global/qtypes.h ++++ b/src/corelib/global/qtypes.h +@@ -72,9 +72,6 @@ + # if defined(__GLIBCXX__) && defined(__STRICT_ANSI__) // -ansi/-std=c++NN instead of gnu++NN + # undef QT_SUPPORTS_INT128 // breaks on libstdc++ + # endif +-# if defined(__clang__) && defined(_MSVC_STL_VERSION) // Clang with MSVC's STL +-# undef QT_SUPPORTS_INT128 // MSVC's STL doesn't support int128 +-# endif + #else + # undef QT_SUPPORTS_INT128 + #endif diff --git a/ports/qtbase/portfile.cmake b/ports/qtbase/portfile.cmake index de590a1a67d4a9..dc8bdeb3bb4da8 100644 --- a/ports/qtbase/portfile.cmake +++ b/ports/qtbase/portfile.cmake @@ -23,6 +23,7 @@ set(${PORT}_PATCHES fix_deploy_windows.patch fix-link-lib-discovery.patch macdeployqt-symlinks.patch + 55c53f9.diff ) if(VCPKG_TARGET_IS_WINDOWS AND NOT VCPKG_TARGET_IS_MINGW) diff --git a/triplets/x64-win-llvm/x64-win-llvm-toolchain.cmake b/triplets/x64-win-llvm/x64-win-llvm-toolchain.cmake index 25a1488631b7b5..2bf23c133fdddf 100644 --- a/triplets/x64-win-llvm/x64-win-llvm-toolchain.cmake +++ b/triplets/x64-win-llvm/x64-win-llvm-toolchain.cmake @@ -133,7 +133,7 @@ if(NOT _VCPKG_WINDOWS_TOOLCHAIN) set(CHARSET_FLAG "") endif() - set(common_flags "/nologo /DWIN32 /D_WINDOWS -Wno-implicit-function-declaration${CHARSET_FLAG}") + set(common_flags "/nologo /DWIN32 /D_WINDOWS -Wno-implicit-function-declaration${CHARSET_FLAG} -msse4.2 -m64") set(CMAKE_CXX_FLAGS "${common_flags} /GR /EHsc ${VCPKG_CXX_FLAGS}" CACHE STRING "") set(CMAKE_C_FLAGS "${common_flags} ${VCPKG_C_FLAGS}" CACHE STRING "") @@ -160,6 +160,5 @@ if(NOT _VCPKG_WINDOWS_TOOLCHAIN) string(APPEND CMAKE_EXE_LINKER_FLAGS_DEBUG_INIT " /nologo ${VCPKG_LINKER_FLAGS} ${VCPKG_LINKER_FLAGS_DEBUG} ") unset(CHARSET_FLAG) - unset(MP_BUILD_FLAG) unset(VCPKG_CRT_LINK_FLAG_PREFIX) endif()