POWER9 platforms switch to GCC6
Fixes: https://github.com/open-power/op-build/issues/755
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
diff --git a/openpower/configs/p9dsu_defconfig b/openpower/configs/p9dsu_defconfig
index bebfbcd..d72fc70 100644
--- a/openpower/configs/p9dsu_defconfig
+++ b/openpower/configs/p9dsu_defconfig
@@ -3,7 +3,7 @@
BR2_GLIBC_VERSION_2_25=y
BR2_BINUTILS_VERSION_2_28_X=y
BR2_BINUTILS_EXTRA_CONFIG_OPTIONS="--enable-targets=powerpc64-linux"
-BR2_GCC_VERSION_4_9_X=y
+BR2_GCC_VERSION_6_X=y
BR2_EXTRA_GCC_CONFIG_OPTIONS="--enable-targets=powerpc64-linux"
BR2_TOOLCHAIN_BUILDROOT_CXX=y
BR2_TARGET_GENERIC_HOSTNAME="skiroot"
diff --git a/openpower/configs/romulus_defconfig b/openpower/configs/romulus_defconfig
index b948c23..5bc88fb 100644
--- a/openpower/configs/romulus_defconfig
+++ b/openpower/configs/romulus_defconfig
@@ -3,7 +3,7 @@
BR2_GLIBC_VERSION_2_25=y
BR2_BINUTILS_VERSION_2_28_X=y
BR2_BINUTILS_EXTRA_CONFIG_OPTIONS="--enable-targets=powerpc64-linux"
-BR2_GCC_VERSION_4_9_X=y
+BR2_GCC_VERSION_6_X=y
BR2_EXTRA_GCC_CONFIG_OPTIONS="--enable-targets=powerpc64-linux"
BR2_TOOLCHAIN_BUILDROOT_CXX=y
BR2_TARGET_GENERIC_HOSTNAME="skiroot"
diff --git a/openpower/configs/witherspoon-redbud_defconfig b/openpower/configs/witherspoon-redbud_defconfig
index b1228f7..98ce74d 100644
--- a/openpower/configs/witherspoon-redbud_defconfig
+++ b/openpower/configs/witherspoon-redbud_defconfig
@@ -4,7 +4,7 @@
BR2_GLIBC_VERSION_2_25=y
BR2_BINUTILS_VERSION_2_28_X=y
BR2_BINUTILS_EXTRA_CONFIG_OPTIONS="--enable-targets=powerpc64-linux"
-BR2_GCC_VERSION_4_9_X=y
+BR2_GCC_VERSION_6_X=y
BR2_EXTRA_GCC_CONFIG_OPTIONS="--enable-targets=powerpc64-linux"
BR2_TOOLCHAIN_BUILDROOT_CXX=y
BR2_TARGET_GENERIC_HOSTNAME="skiroot"
diff --git a/openpower/configs/witherspoon-sequoia_defconfig b/openpower/configs/witherspoon-sequoia_defconfig
index 72c1ece..a15c2b3 100644
--- a/openpower/configs/witherspoon-sequoia_defconfig
+++ b/openpower/configs/witherspoon-sequoia_defconfig
@@ -3,7 +3,7 @@
BR2_GLIBC_VERSION_2_25=y
BR2_BINUTILS_VERSION_2_28_X=y
BR2_BINUTILS_EXTRA_CONFIG_OPTIONS="--enable-targets=powerpc64-linux"
-BR2_GCC_VERSION_4_9_X=y
+BR2_GCC_VERSION_6_X=y
BR2_EXTRA_GCC_CONFIG_OPTIONS="--enable-targets=powerpc64-linux"
BR2_TOOLCHAIN_BUILDROOT_CXX=y
BR2_TARGET_GENERIC_HOSTNAME="skiroot"
diff --git a/openpower/configs/zaius_defconfig b/openpower/configs/zaius_defconfig
index 301b79b..0332a2e 100644
--- a/openpower/configs/zaius_defconfig
+++ b/openpower/configs/zaius_defconfig
@@ -3,7 +3,7 @@
BR2_GLIBC_VERSION_2_25=y
BR2_BINUTILS_VERSION_2_28_X=y
BR2_BINUTILS_EXTRA_CONFIG_OPTIONS="--enable-targets=powerpc64-linux"
-BR2_GCC_VERSION_4_9_X=y
+BR2_GCC_VERSION_6_X=y
BR2_EXTRA_GCC_CONFIG_OPTIONS="--enable-targets=powerpc64-linux"
BR2_TOOLCHAIN_BUILDROOT_CXX=y
BR2_TARGET_GENERIC_HOSTNAME="skiroot"
diff --git a/openpower/package/hostboot/p9Patches/hostboot-0007-Disable-warnings-that-crop-up-a-lot-with-GCC6.patch b/openpower/package/hostboot/p9Patches/hostboot-0007-Disable-warnings-that-crop-up-a-lot-with-GCC6.patch
new file mode 100644
index 0000000..e8def56
--- /dev/null
+++ b/openpower/package/hostboot/p9Patches/hostboot-0007-Disable-warnings-that-crop-up-a-lot-with-GCC6.patch
@@ -0,0 +1,47 @@
+From 6f008e0bfdfbc9256f18ea0939dfc11d23348675 Mon Sep 17 00:00:00 2001
+From: Stewart Smith <stewart@linux.vnet.ibm.com>
+Date: Thu, 2 Mar 2017 16:15:25 +1100
+Subject: [PATCH] Disable warnings that crop up a lot with GCC6
+
+NOTE: THIS IS A TERRIBLE IDEA
+
+Instead, Hostboot developers should go and fix their code.
+
+Change-Id: I3e1da9f61ff442e49f143f51ccfc3c7c018beb1f
+Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
+---
+ src/build/mkrules/cflags.env.mk | 8 +++++---
+ 1 file changed, 5 insertions(+), 3 deletions(-)
+
+diff --git a/src/build/mkrules/cflags.env.mk b/src/build/mkrules/cflags.env.mk
+index 6bb900288388..428de9326400 100644
+--- a/src/build/mkrules/cflags.env.mk
++++ b/src/build/mkrules/cflags.env.mk
+@@ -5,7 +5,7 @@
+ #
+ # OpenPOWER HostBoot Project
+ #
+-# Contributors Listed Below - COPYRIGHT 2013,2016
++# Contributors Listed Below - COPYRIGHT 2013,2017
+ # [+] Google Inc.
+ # [+] International Business Machines Corp.
+ #
+@@ -40,11 +40,13 @@ endif
+
+ COMMONFLAGS += $(OPT_LEVEL) -nostdlib
+ CFLAGS += $(COMMONFLAGS) -mcpu=power7 -nostdinc -g -mno-vsx -mno-altivec\
+- -Wall -Werror -mtraceback=no -pipe -mabi=elfv1 \
++ -Wall -mtraceback=no -pipe -mabi=elfv1 \
++ -Wno-error=sizeof-array-argument \
++ -Wno-error=unused-function \
+ -ffunction-sections -fdata-sections -ffreestanding -mbig-endian
+ ASMFLAGS += $(COMMONFLAGS) -mcpu=power7 -mbig-endian -ffreestanding -mabi=elfv1
+ CXXFLAGS += $(CFLAGS) -nostdinc++ -fno-rtti -fno-exceptions -Wall \
+- -fuse-cxa-atexit -std=gnu++14
++ -fuse-cxa-atexit -std=gnu++14 -fpermissive
+ LDFLAGS += --nostdlib --sort-common -EB $(COMMONFLAGS)
+
+ INCFLAGS = $(addprefix -I, $(INCDIR) )
+--
+2.9.4
+
diff --git a/openpower/package/occ/p9Patches/0001-Use-gnu89-as-C-std.patch b/openpower/package/occ/p9Patches/0001-Use-gnu89-as-C-std.patch
new file mode 100644
index 0000000..2f59d83
--- /dev/null
+++ b/openpower/package/occ/p9Patches/0001-Use-gnu89-as-C-std.patch
@@ -0,0 +1,41 @@
+From 52c55ef2370b22d0f9b78e5d975b3c8b2b915d34 Mon Sep 17 00:00:00 2001
+From: Stewart Smith <stewart@linux.vnet.ibm.com>
+Date: Thu, 2 Mar 2017 17:13:22 +1100
+Subject: [PATCH] Use gnu89 as C std
+
+Change-Id: I1953f9762f6e3c0f1b8005977de69802f0e11934
+Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
+---
+ src/occBootLoader/img_defs.mk | 2 +-
+ src/occ_405/img_defs.mk | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/src/occBootLoader/img_defs.mk b/src/occBootLoader/img_defs.mk
+index a53d9db115b3..907c3d5ad353 100644
+--- a/src/occBootLoader/img_defs.mk
++++ b/src/occBootLoader/img_defs.mk
+@@ -226,7 +226,7 @@ PIPE-CFLAGS = -pipe -Wa,-m405
+ GCC-CFLAGS += -g -Wall -fsigned-char -msoft-float \
+ -m32 -mbig-endian -mcpu=405 -mmultiple -mstring \
+ -meabi -msdata=eabi -ffreestanding -fno-common \
+- -fno-inline-functions-called-once
++ -fno-inline-functions-called-once -std=gnu89
+
+ CFLAGS = -c $(GCC-CFLAGS) $(PIPE-CFLAGS) $(GCC-O-LEVEL) $(INCLUDES)
+
+diff --git a/src/occ_405/img_defs.mk b/src/occ_405/img_defs.mk
+index abdef45963e0..9e0f1b91596a 100644
+--- a/src/occ_405/img_defs.mk
++++ b/src/occ_405/img_defs.mk
+@@ -252,7 +252,7 @@ PIPE-CFLAGS = -pipe -Wa,-m405
+ GCC-CFLAGS += -g -Wall -fsigned-char -msoft-float \
+ -m32 -mbig-endian -mcpu=405 -mmultiple -mstring \
+ -meabi -msdata=eabi -ffreestanding -fno-common \
+- -fno-inline-functions-called-once
++ -fno-inline-functions-called-once -std=gnu89
+
+ CFLAGS = -c $(GCC-CFLAGS) $(PIPE-CFLAGS) $(GCC-O-LEVEL) $(INCLUDES)
+
+--
+2.9.3
+