aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSamuli Piippo <samuli.piippo@qt.io>2022-08-16 13:28:54 +0000
committerQt Cherry-pick Bot <cherrypick_bot@qt-project.org>2022-08-18 14:40:25 +0000
commit2d1d42613a933d39c4520a952a4dab5b65612136 (patch)
tree7a5a3d63dd2b27980ab0d0686fbb49a56ecc575f
parent4da092df76e28983031c2f5d62be6d4a16405489 (diff)
mingw: switch to using UCRT
Windows Universal CRT is the current recommended C Runtime for Windows 10 and later. It provides better support than the previously used msvcrt. Patch GCC and configure mingw to switch to the UCRT for all mingw nativesdk builds. Fixes: QTBUG-104784 Change-Id: I424ed5bc4e0ccfd5900c14ddd586897346618f00 Reviewed-by: Mikko Gronoff <mikko.gronoff@qt.io> (cherry picked from commit 1d7da636575ffc2d300f6dcaf2bc539f7651bca7) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
-rw-r--r--meta-boot2qt-distro/recipes-devtools/gcc/gcc-source_1%.bbappend33
-rw-r--r--meta-boot2qt-distro/recipes-devtools/gcc/gcc/0001-mingw-use-UCRT-instead-msvcrt.patch22
-rw-r--r--meta-boot2qt-distro/recipes-devtools/mingw-w64/nativesdk-mingw-w64-headers_%.bbappend1
-rw-r--r--meta-boot2qt-distro/recipes-devtools/mingw-w64/nativesdk-mingw-w64-runtime_%.bbappend1
4 files changed, 57 insertions, 0 deletions
diff --git a/meta-boot2qt-distro/recipes-devtools/gcc/gcc-source_1%.bbappend b/meta-boot2qt-distro/recipes-devtools/gcc/gcc-source_1%.bbappend
new file mode 100644
index 00000000..a617295f
--- /dev/null
+++ b/meta-boot2qt-distro/recipes-devtools/gcc/gcc-source_1%.bbappend
@@ -0,0 +1,33 @@
+############################################################################
+##
+## Copyright (C) 2022 The Qt Company Ltd.
+## Contact: https://www.qt.io/licensing/
+##
+## This file is part of the Boot to Qt meta layer.
+##
+## $QT_BEGIN_LICENSE:GPL$
+## Commercial License Usage
+## Licensees holding valid commercial Qt licenses may use this file in
+## accordance with the commercial license agreement provided with the
+## Software or, alternatively, in accordance with the terms contained in
+## a written agreement between you and The Qt Company. For licensing terms
+## and conditions see https://www.qt.io/terms-conditions. For further
+## information use the contact form at https://www.qt.io/contact-us.
+##
+## GNU General Public License Usage
+## Alternatively, this file may be used under the terms of the GNU
+## General Public License version 3 or (at your option) any later version
+## approved by the KDE Free Qt Foundation. The licenses are as published by
+## the Free Software Foundation and appearing in the file LICENSE.GPL3
+## included in the packaging of this file. Please review the following
+## information to ensure the GNU General Public License requirements will
+## be met: https://www.gnu.org/licenses/gpl-3.0.html.
+##
+## $QT_END_LICENSE$
+##
+############################################################################
+
+FILESEXTRAPATHS:append := "${THISDIR}/gcc:"
+SRC_URI += "\
+ file://0001-mingw-use-UCRT-instead-msvcrt.patch \
+"
diff --git a/meta-boot2qt-distro/recipes-devtools/gcc/gcc/0001-mingw-use-UCRT-instead-msvcrt.patch b/meta-boot2qt-distro/recipes-devtools/gcc/gcc/0001-mingw-use-UCRT-instead-msvcrt.patch
new file mode 100644
index 00000000..40d60730
--- /dev/null
+++ b/meta-boot2qt-distro/recipes-devtools/gcc/gcc/0001-mingw-use-UCRT-instead-msvcrt.patch
@@ -0,0 +1,22 @@
+From 0f74aff547da30db47f67f28e6c2d19f2eab89b3 Mon Sep 17 00:00:00 2001
+From: Samuli Piippo <samuli.piippo@qt.io>
+Date: Tue, 16 Aug 2022 13:21:28 +0000
+Subject: [PATCH] mingw: use UCRT instead msvcrt
+
+---
+ gcc/config/i386/mingw32.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/gcc/config/i386/mingw32.h b/gcc/config/i386/mingw32.h
+index d3ca0cd0279..f5ab7490970 100644
+--- a/gcc/config/i386/mingw32.h
++++ b/gcc/config/i386/mingw32.h
+@@ -185,7 +185,7 @@ along with GCC; see the file COPYING3. If not see
+ #define REAL_LIBGCC_SPEC \
+ "%{mthreads:-lmingwthrd} -lmingw32 \
+ " SHARED_LIBGCC_SPEC " \
+- -lmoldname -lmingwex -lmsvcrt -lkernel32"
++ -lmoldname -lmingwex -lucrt -lkernel32"
+
+ #undef STARTFILE_SPEC
+ #define STARTFILE_SPEC "%{shared|mdll:dllcrt2%O%s} \
diff --git a/meta-boot2qt-distro/recipes-devtools/mingw-w64/nativesdk-mingw-w64-headers_%.bbappend b/meta-boot2qt-distro/recipes-devtools/mingw-w64/nativesdk-mingw-w64-headers_%.bbappend
new file mode 100644
index 00000000..331df2ff
--- /dev/null
+++ b/meta-boot2qt-distro/recipes-devtools/mingw-w64/nativesdk-mingw-w64-headers_%.bbappend
@@ -0,0 +1 @@
+EXTRA_OECONF += "--with-default-msvcrt=ucrt"
diff --git a/meta-boot2qt-distro/recipes-devtools/mingw-w64/nativesdk-mingw-w64-runtime_%.bbappend b/meta-boot2qt-distro/recipes-devtools/mingw-w64/nativesdk-mingw-w64-runtime_%.bbappend
index 1b5fb46b..aefa8056 100644
--- a/meta-boot2qt-distro/recipes-devtools/mingw-w64/nativesdk-mingw-w64-runtime_%.bbappend
+++ b/meta-boot2qt-distro/recipes-devtools/mingw-w64/nativesdk-mingw-w64-runtime_%.bbappend
@@ -1 +1,2 @@
EXTRA_OECONF:x86-64 = "--disable-lib32"
+EXTRA_OECONF += "--with-default-msvcrt=ucrt"