aboutsummaryrefslogtreecommitdiffstats
path: root/meta-boot2qt-distro/recipes-devtools
diff options
context:
space:
mode:
authorSamuli Piippo <samuli.piippo@qt.io>2019-08-21 11:22:25 +0300
committerSamuli Piippo <samuli.piippo@qt.io>2019-08-29 12:44:48 +0300
commitc2fbdd1834c281e78ec40fb9fad3e6ccefbbf3ad (patch)
tree7a01295ce7b2ec39a4e879afcf3f0ea95fa9f66d /meta-boot2qt-distro/recipes-devtools
parentfa0fd3104b82e59b2af711640239e5174c8a7d21 (diff)
gcc: backport fix for gcc 8.3 mingw build issue
Fix is needed to compile nativesdk-qtbase for mingw. https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88568 Change-Id: I9bd958207c8f64099c2f8d86ae6708e67f9e569e Reviewed-by: Mikko Gronoff <mikko.gronoff@qt.io>
Diffstat (limited to 'meta-boot2qt-distro/recipes-devtools')
-rw-r--r--meta-boot2qt-distro/recipes-devtools/gcc/gcc-source_8.3.bbappend31
-rw-r--r--meta-boot2qt-distro/recipes-devtools/gcc/gcc/0001-PR-c-88568.patch56
2 files changed, 87 insertions, 0 deletions
diff --git a/meta-boot2qt-distro/recipes-devtools/gcc/gcc-source_8.3.bbappend b/meta-boot2qt-distro/recipes-devtools/gcc/gcc-source_8.3.bbappend
new file mode 100644
index 00000000..98687836
--- /dev/null
+++ b/meta-boot2qt-distro/recipes-devtools/gcc/gcc-source_8.3.bbappend
@@ -0,0 +1,31 @@
+############################################################################
+##
+## Copyright (C) 2019 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-PR-c-88568.patch"
diff --git a/meta-boot2qt-distro/recipes-devtools/gcc/gcc/0001-PR-c-88568.patch b/meta-boot2qt-distro/recipes-devtools/gcc/gcc/0001-PR-c-88568.patch
new file mode 100644
index 00000000..b3e62cda
--- /dev/null
+++ b/meta-boot2qt-distro/recipes-devtools/gcc/gcc/0001-PR-c-88568.patch
@@ -0,0 +1,56 @@
+From ff892b304ebacc9eab2be6528fcef28f06550176 Mon Sep 17 00:00:00 2001
+From: jakub <jakub@138bc75d-0d04-0410-961f-82ee72b054a4>
+Date: Sat, 9 Mar 2019 12:08:23 +0000
+Subject: [PATCH] PR c/88568
+
+ * attribs.c (handle_dll_attribute): Don't clear TREE_STATIC for dllimport on VAR_DECLs with RECORD_TYPE or UNION_TYPE DECL_CONTEXT.
+ * g++.dg/other/pr88568.C: New test.
+
+git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@269525 138bc75d-0d04-0410-961f-82ee72b054a4
+
+Upstream-Status: Backport
+Signed-off-by: Samuli Piippo <samuli.piippo@qt.io>
+
+---
+ gcc/attribs.c | 7 +++++--
+ gcc/testsuite/g++.dg/other/pr88568.C | 13 +++++++++++++
+ 2 files changed, 18 insertions(+), 2 deletions(-)
+ create mode 100644 gcc/testsuite/g++.dg/other/pr88568.C
+
+diff --git a/gcc/attribs.c b/gcc/attribs.c
+index f5f660a6a..fc21f799d 100644
+--- a/gcc/attribs.c
++++ b/gcc/attribs.c
+@@ -1685,8 +1685,11 @@ handle_dll_attribute (tree * pnode, tree name, tree args, int flags,
+ a function global scope, unless declared static. */
+ if (current_function_decl != NULL_TREE && !TREE_STATIC (node))
+ TREE_PUBLIC (node) = 1;
+- /* Clear TREE_STATIC because DECL_EXTERNAL is set. */
+- TREE_STATIC (node) = 0;
++ /* Clear TREE_STATIC because DECL_EXTERNAL is set, unless
++ it is a C++ static data member. */
++ if (DECL_CONTEXT (node) == NULL_TREE
++ || !RECORD_OR_UNION_TYPE_P (DECL_CONTEXT (node)))
++ TREE_STATIC (node) = 0;
+ }
+
+ if (*no_add_attrs == false)
+diff --git a/gcc/testsuite/g++.dg/other/pr88568.C b/gcc/testsuite/g++.dg/other/pr88568.C
+new file mode 100644
+index 000000000..9d344fd91
+--- /dev/null
++++ b/gcc/testsuite/g++.dg/other/pr88568.C
+@@ -0,0 +1,13 @@
++// PR c/88568
++// { dg-do compile }
++// { dg-require-dll "" }
++
++struct S {
++ __attribute__((dllimport)) static const char foo[];
++};
++
++int
++foo (int x)
++{
++ return S::foo[x];
++}