Michal Suchanek 3f366f
From: Cyril Bur <cyrilbur@gmail.com>
Michal Suchanek 3f366f
To: linuxppc-dev@lists.ozlabs.org
Michal Suchanek 3f366f
Subject: [PATCH v2] powerpc: Blacklist GCC 5.4 6.1 and 6.2
Michal Suchanek 3f366f
Date: Mon, 13 Feb 2017 14:35:36 +1100
Michal Suchanek 3f366f
Message-Id: <20170213033536.8908-1-cyrilbur@gmail.com>
Michal Suchanek 3f366f
Michal Suchanek 3f366f
References: boo#1028895
Michal Suchanek 3f366f
Patch-mainline: submitted http://patchwork.ozlabs.org/patch/727105/
Michal Suchanek 3f366f
Michal Suchanek 3f366f
A bug in the -02 optimisation of GCC 5.4 6.1 and 6.2 causes
Michal Suchanek 3f366f
setup_command_line() to not pass the correct first argument to strcpy
Michal Suchanek 3f366f
and therefore not actually copy the command_line.
Michal Suchanek 3f366f
Michal Suchanek 3f366f
A workaround patch was proposed: http://patchwork.ozlabs.org/patch/673130/
Michal Suchanek 3f366f
some discussion ensued.
Michal Suchanek 3f366f
Michal Suchanek 3f366f
A GCC bug was raised: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71709
Michal Suchanek 3f366f
The bug has been fixed in 7.0 and backported to GCC 5 and GCC 6.
Michal Suchanek 3f366f
Michal Suchanek 3f366f
At the time of writing GCC 5.4 is the most recent and is affected. GCC
Michal Suchanek 3f366f
6.3 contains the backported fix, has been tested and appears safe to
Michal Suchanek 3f366f
use.
Michal Suchanek 3f366f
Michal Suchanek 3f366f
Heavy-lifting-by: Akshay Adiga <akshay.adiga@linux.vnet.ibm.com>
Michal Suchanek 3f366f
Signed-off-by: Cyril Bur <cyrilbur@gmail.com>
Michal Suchanek 3f366f
Acked-by: Michal Suchanek <msuchanek@suse.de>
Michal Suchanek 3f366f
---
Michal Suchanek 3f366f
v2: Added check to only blacklist compilers on little-endian
Michal Suchanek 3f366f
Thomas Zimmermann 50a6d2
 arch/powerpc/Makefile |    9 +++++++++
Thomas Zimmermann 50a6d2
 1 file changed, 9 insertions(+)
Michal Suchanek 3f366f
Michal Suchanek 3f366f
--- a/arch/powerpc/Makefile
Michal Suchanek 3f366f
+++ b/arch/powerpc/Makefile
Thomas Zimmermann 50a6d2
@@ -449,3 +449,12 @@ checkbin:
Michal Suchanek 3f366f
 		echo -n '*** Please use a different binutils version.' ; \
Michal Suchanek 3f366f
 		false ; \
Michal Suchanek 3f366f
 	fi
Michal Suchanek 3f366f
+	@if test "x${CONFIG_CPU_LITTLE_ENDIAN}" = "xy" \
Michal Suchanek 3f366f
+		&& { test "$(cc-version)" = "0504" \
Michal Suchanek 3f366f
+		|| test "$(cc-version)" = "0601" \
Michal Suchanek 3f366f
+		|| test "$(cc-version)" = "0602" ; } ; then \
Michal Suchanek 3f366f
+		echo -n '*** GCC-5.4 6.1 6.2 have a bad -O2 optimisation ' ; \
Michal Suchanek 3f366f
+		echo 'which will cause lost command_line options (at least).' ; \
Michal Suchanek 3f366f
+		echo '*** Please use a different GCC version.' ; \
Michal Suchanek 3f366f
+		false ; \
Michal Suchanek 3f366f
+	fi