Skip to content

Commit

Permalink
fix a bit
Browse files Browse the repository at this point in the history
  • Loading branch information
Neumann-A committed Jan 12, 2025
1 parent 3fd9721 commit f001738
Show file tree
Hide file tree
Showing 3 changed files with 72 additions and 2 deletions.
70 changes: 70 additions & 0 deletions ports/qtbase/55c53f9.diff
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
From 55c53f9b21d96cd74200a54cd2b1e5f87d643f19 Mon Sep 17 00:00:00 2001
From: Marc Mutz <[email protected]>
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
<type_traits> 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 <utility> // 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 <type_traits> 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
1 change: 1 addition & 0 deletions ports/qtbase/portfile.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
3 changes: 1 addition & 2 deletions triplets/x64-win-llvm/x64-win-llvm-toolchain.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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 "")
Expand All @@ -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()

0 comments on commit f001738

Please sign in to comment.