From 31603f60201c3fc90c66ee30a62ccb02cbb18e14 Mon Sep 17 00:00:00 2001 From: Samuli Piippo Date: Tue, 7 Jun 2016 15:27:41 +0300 Subject: binutils: fix native builds when host has gcc5 Cherry pick upstream commit to fix -Werror=logical-not-parentheses error when building with native gcc5. Taken from oe/fido, since this has not been applied in dizzy. Task-number: QTBUG-53862 Change-Id: I5e6e267e689d43389556fd806883dc93f120ed19 Reviewed-by: Heikki Halmet --- ...86.c-Werror-logical-not-parentheses-error.patch | 76 ++++++++++++++++++++++ recipes/binutils/binutils_2.24.bbappend | 27 ++++++++ 2 files changed, 103 insertions(+) create mode 100644 recipes/binutils/binutils/Fix-tc-i386.c-Werror-logical-not-parentheses-error.patch create mode 100644 recipes/binutils/binutils_2.24.bbappend diff --git a/recipes/binutils/binutils/Fix-tc-i386.c-Werror-logical-not-parentheses-error.patch b/recipes/binutils/binutils/Fix-tc-i386.c-Werror-logical-not-parentheses-error.patch new file mode 100644 index 0000000..0511c39 --- /dev/null +++ b/recipes/binutils/binutils/Fix-tc-i386.c-Werror-logical-not-parentheses-error.patch @@ -0,0 +1,76 @@ +From 360ddc990a941bc506576f45a3858d38f508410b Mon Sep 17 00:00:00 2001 +From: Alan Modra +Date: Fri, 12 Sep 2014 09:46:30 +0930 +Subject: [PATCH] Fix tc-i386.c -Werror=logical-not-parentheses error + + * config/tc-i386.c (match_template): Remove redundant "!!" testing + single-bit bitfields. + (build_modrm_byte): Don't compare single-bit bitfields to "1". + +Upstream commit: +https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;a=commit;h=ac4eb736520174305bf6e691827f7473b858cff1 + +Manually resolved gas/ChangeLog conflict by placing the change at the +top of the file. +gas/config/tc-i386.c patched with offset + +Signed-off-by: George McCollister +--- + gas/ChangeLog | 6 ++++++ + gas/config/tc-i386.c | 12 ++++++------ + 2 files changed, 12 insertions(+), 6 deletions(-) + +diff --git a/gas/ChangeLog b/gas/ChangeLog +index 7fafa26..c6e60c9 100644 +--- a/gas/ChangeLog ++++ b/gas/ChangeLog +@@ -1,3 +1,9 @@ ++2014-09-12 Alan Modra ++ ++ * config/tc-i386.c (match_template): Remove redundant "!!" testing ++ single-bit bitfields. ++ (build_modrm_byte): Don't compare single-bit bitfields to "1". ++ + 2013-11-18 H.J. Lu + + * config/tc-i386.c (lex_got): Add a dummy "int bnd_prefix" +diff --git a/gas/config/tc-i386.c b/gas/config/tc-i386.c +index 3c423da..4464091 100644 +--- a/gas/config/tc-i386.c ++++ b/gas/config/tc-i386.c +@@ -4672,9 +4672,9 @@ match_template (void) + && !operand_types[0].bitfield.regymm + && !operand_types[0].bitfield.regzmm) + || (!operand_types[t->operands > 1].bitfield.regmmx +- && !!operand_types[t->operands > 1].bitfield.regxmm +- && !!operand_types[t->operands > 1].bitfield.regymm +- && !!operand_types[t->operands > 1].bitfield.regzmm)) ++ && operand_types[t->operands > 1].bitfield.regxmm ++ && operand_types[t->operands > 1].bitfield.regymm ++ && operand_types[t->operands > 1].bitfield.regzmm)) + && (t->base_opcode != 0x0fc7 + || t->extension_opcode != 1 /* cmpxchg8b */)) + continue; +@@ -4689,7 +4689,7 @@ match_template (void) + && ((!operand_types[0].bitfield.regmmx + && !operand_types[0].bitfield.regxmm) + || (!operand_types[t->operands > 1].bitfield.regmmx +- && !!operand_types[t->operands > 1].bitfield.regxmm))) ++ && operand_types[t->operands > 1].bitfield.regxmm))) + continue; + + /* Do not verify operands when there are none. */ +@@ -6139,8 +6139,8 @@ build_modrm_byte (void) + op = i.tm.operand_types[vvvv]; + op.bitfield.regmem = 0; + if ((dest + 1) >= i.operands +- || (op.bitfield.reg32 != 1 +- && !op.bitfield.reg64 != 1 ++ || (!op.bitfield.reg32 ++ && op.bitfield.reg64 + && !operand_type_equal (&op, ®xmm) + && !operand_type_equal (&op, ®ymm) + && !operand_type_equal (&op, ®zmm) +-- +2.4.3 + diff --git a/recipes/binutils/binutils_2.24.bbappend b/recipes/binutils/binutils_2.24.bbappend new file mode 100644 index 0000000..5d37646 --- /dev/null +++ b/recipes/binutils/binutils_2.24.bbappend @@ -0,0 +1,27 @@ +############################################################################# +## +## Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies). +## +## This file is part of the Qt Enterprise Embedded Scripts of the Qt +## framework. +## +## $QT_BEGIN_LICENSE$ +## Commercial License Usage Only +## Licensees holding valid commercial Qt license agreements with Digia +## with an appropriate addendum covering the Qt Enterprise Embedded Scripts, +## may use this file in accordance with the terms contained in said license +## agreement. +## +## For further information use the contact form at +## http://www.qt.io/contact-us. +## +## +## $QT_END_LICENSE$ +## +############################################################################# + +FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" + +SRC_URI += "\ + file://Fix-tc-i386.c-Werror-logical-not-parentheses-error.patch \ + " -- cgit v1.2.3-54-g00ecf