From 4e893680f61c9a7eef8541510fac59638137fb23 Mon Sep 17 00:00:00 2001 From: Luis Fernandez Date: Wed, 17 Apr 2019 15:18:27 -0500 Subject: [PATCH] Configuration updates to compile with GCC 8 Edit op-build config files to use GCC 8 compiler. Temporarily added 0001-Fix-gcc8-signature-validation-anomaly HB patch. Temporarily added 0002-GCC8-Code-Fixes HB patch. Has 0003-space-saving-compile-options patch to reduce size of bootkernel. Signed-off-by: Luis Fernandez --- openpower/configs/p9dsu_defconfig | 2 +- openpower/configs/romulus_defconfig | 2 +- openpower/configs/witherspoon_defconfig | 2 +- openpower/configs/zaius_defconfig | 2 +- .../0003-space-saving-compile-options.patch | 13 ++ ...ix-gcc8-signature-validation-anomaly.patch | 111 ++++++++++++++++++ .../hostboot/0002-GCC8-Code-Fixes.patch | 59 ++++++++++ 7 files changed, 187 insertions(+), 4 deletions(-) create mode 100755 openpower/linux/0003-space-saving-compile-options.patch create mode 100644 openpower/package/hostboot/0001-Fix-gcc8-signature-validation-anomaly.patch create mode 100644 openpower/package/hostboot/0002-GCC8-Code-Fixes.patch diff --git a/openpower/configs/p9dsu_defconfig b/openpower/configs/p9dsu_defconfig index 7098561861..5988658b6c 100644 --- a/openpower/configs/p9dsu_defconfig +++ b/openpower/configs/p9dsu_defconfig @@ -1,7 +1,7 @@ BR2_powerpc64le=y BR2_powerpc_power8=y BR2_BINUTILS_EXTRA_CONFIG_OPTIONS="--enable-targets=powerpc64-linux" -BR2_GCC_VERSION_6_X=y +BR2_GCC_VERSION_8_X=y BR2_EXTRA_GCC_CONFIG_OPTIONS="--enable-targets=powerpc64-linux --disable-libsanitizer" BR2_TOOLCHAIN_BUILDROOT_CXX=y BR2_TARGET_GENERIC_HOSTNAME="skiroot" diff --git a/openpower/configs/romulus_defconfig b/openpower/configs/romulus_defconfig index 7bba1ef58b..16df1a4839 100644 --- a/openpower/configs/romulus_defconfig +++ b/openpower/configs/romulus_defconfig @@ -1,7 +1,7 @@ BR2_powerpc64le=y BR2_powerpc_power8=y BR2_BINUTILS_EXTRA_CONFIG_OPTIONS="--enable-targets=powerpc64-linux" -BR2_GCC_VERSION_6_X=y +BR2_GCC_VERSION_8_X=y BR2_EXTRA_GCC_CONFIG_OPTIONS="--enable-targets=powerpc64-linux --disable-libsanitizer" BR2_TOOLCHAIN_BUILDROOT_CXX=y BR2_TARGET_GENERIC_HOSTNAME="skiroot" diff --git a/openpower/configs/witherspoon_defconfig b/openpower/configs/witherspoon_defconfig index b1f5f7c91c..1455e352a4 100644 --- a/openpower/configs/witherspoon_defconfig +++ b/openpower/configs/witherspoon_defconfig @@ -1,7 +1,7 @@ BR2_powerpc64le=y BR2_powerpc_power8=y BR2_BINUTILS_EXTRA_CONFIG_OPTIONS="--enable-targets=powerpc64-linux" -BR2_GCC_VERSION_6_X=y +BR2_GCC_VERSION_8_X=y BR2_EXTRA_GCC_CONFIG_OPTIONS="--enable-targets=powerpc64-linux --disable-libsanitizer" BR2_TOOLCHAIN_BUILDROOT_CXX=y BR2_TARGET_GENERIC_HOSTNAME="skiroot" diff --git a/openpower/configs/zaius_defconfig b/openpower/configs/zaius_defconfig index b0dc89bcc6..cd04d5f3d2 100644 --- a/openpower/configs/zaius_defconfig +++ b/openpower/configs/zaius_defconfig @@ -1,7 +1,7 @@ BR2_powerpc64le=y BR2_powerpc_power8=y BR2_BINUTILS_EXTRA_CONFIG_OPTIONS="--enable-targets=powerpc64-linux" -BR2_GCC_VERSION_6_X=y +BR2_GCC_VERSION_8_X=y BR2_EXTRA_GCC_CONFIG_OPTIONS="--enable-targets=powerpc64-linux --disable-libsanitizer" BR2_TOOLCHAIN_BUILDROOT_CXX=y BR2_TARGET_GENERIC_HOSTNAME="skiroot" diff --git a/openpower/linux/0003-space-saving-compile-options.patch b/openpower/linux/0003-space-saving-compile-options.patch new file mode 100755 index 0000000000..ba211e5dbf --- /dev/null +++ b/openpower/linux/0003-space-saving-compile-options.patch @@ -0,0 +1,13 @@ +diff --git a/Makefile b/Makefile +index 46b6081..efa2361 100644 +--- a/Makefile ++++ b/Makefile +@@ -444,7 +444,7 @@ KBUILD_CFLAGS := -Wall -Wundef -Werror=strict-prototypes -Wno-trigraphs \ + -fno-strict-aliasing -fno-common -fshort-wchar -fno-PIE \ + -Werror=implicit-function-declaration -Werror=implicit-int \ + -Wno-format-security \ +- -std=gnu89 ++ -std=gnu89 -fno-asynchronous-unwind-tables -g0 -fno-shrink-wrap + KBUILD_CPPFLAGS := -D__KERNEL__ + KBUILD_AFLAGS_KERNEL := + KBUILD_CFLAGS_KERNEL := diff --git a/openpower/package/hostboot/0001-Fix-gcc8-signature-validation-anomaly.patch b/openpower/package/hostboot/0001-Fix-gcc8-signature-validation-anomaly.patch new file mode 100644 index 0000000000..3fe6c76ac1 --- /dev/null +++ b/openpower/package/hostboot/0001-Fix-gcc8-signature-validation-anomaly.patch @@ -0,0 +1,111 @@ +From 7c5b7b28ee43fed5ece1d5284db375e641502a3d Mon Sep 17 00:00:00 2001 +From: Nick Bofferding +Date: Sat, 15 Jun 2019 21:35:29 -0500 +Subject: [PATCH] Fix gcc8 signature validation anomaly + +Fixes an issue where signature validation fails when the crypto library is +compiled under GCC8. + +Change-Id: I4d586f7df537c062dd8e50a9c2052701446b2213 +--- + src/securerom/ecverify.C | 38 +++++++++++++++++++++++--------------- + 1 file changed, 23 insertions(+), 15 deletions(-) + +diff --git a/src/securerom/ecverify.C b/src/securerom/ecverify.C +index 6df77df..7b4b21d 100644 +--- a/src/securerom/ecverify.C ++++ b/src/securerom/ecverify.C +@@ -5,7 +5,7 @@ + /* */ + /* OpenPOWER HostBoot Project */ + /* */ +-/* Contributors Listed Below - COPYRIGHT 2016,2017 */ ++/* Contributors Listed Below - COPYRIGHT 2016,2019 */ + /* [+] International Business Machines Corp. */ + /* */ + /* */ +@@ -506,20 +506,22 @@ static void bn_mul (bn_t *r, const bn_t *a, const bn_t *b) + a += NWORDS; + for (i=0; i> 9; +- asm("addc %3,%7,%5\n" //t3 = *(--al) + t0; ++ --al; ++ --r; ++ asm("addc %3,%7,%5\n" //t3 = *(al) + t0; + "addze %2,%6\n" //t2 += ca; +- "addc %0,%4,%8\n" //*(--r) = t3 + t1; ++ "addc %0,%4,%8\n" //*(r) = t3 + t1; + "addze %1,%6" //t0 = t2 + ca; +- : "=r" (*(--r)), "=r" (t0), "=r" (t2), "=r" (t3) +- : "3" (t3), "1" (t0), "2" (t2), "r" (*(--al)), "r" (t1) ++ : "=r" (*(r)), "=r" (t0), "=r" (t2), "=r" (t3) ++ : "3" (t3), "1" (t0), "2" (t2), "r" (*(al)), "r" (t1) + ); + } + t1 = *(--ah) << 55; + t2 = (*ah >> 9)&BN_PRIME_MSW_MASK; +- asm("addc %3,%7,%5\n" //t3 = *(--al) + t0; ++ --al; ++ --r; ++ asm("addc %3,%7,%5\n" //t3 = *(al) + t0; + "addze %2,%6\n" //t2 += ca; +- "addc %0,%4,%8\n" //*(--r) = t3 + t1; ++ "addc %0,%4,%8\n" //*(r) = t3 + t1; + "addze %1,%6" //t0 = t2 + ca; +- : "=r" (*(--r)), "=r" (t0), "=r" (t2), "=r" (t3) +- : "3" (t3), "1" (t0), "2" (t2), "r" (*(--al)), "r" (t1) ++ : "=r" (*(r)), "=r" (t0), "=r" (t2), "=r" (t3) ++ : "3" (t3), "1" (t0), "2" (t2), "r" (*(al)), "r" (t1) + ); + *(--r) = (*(--al)&BN_PRIME_MSW_MASK) + t0; + } +@@ -702,15 +708,17 @@ static void __attribute__((noinline)) bn_modred_slow (bn_t *r) + bn_t t0 = *r >> 9; + *r &= BN_PRIME_MSW_MASK; + r += NWORDS; ++ --r; + asm("addc %0,%1,%2" + : "=r" (*r) +- : "0" (*(--r)), "r" (t0) ++ : "0" (*(r)), "r" (t0) + ); + for (i=0; i +Date: Tue, 18 Jun 2019 14:45:23 -0500 +Subject: [PATCH 2/2] GCC8 Code Fixes + +Code fix for when compiling with GCC8. + +Change-Id: I4d9f2f7ca070806992a19e5910c7d9ec33adb700 +--- + .../lib/utils/mcbist/gen_mss_mcbist_address.H | 26 +++++++++++----------- + 1 file changed, 13 insertions(+), 13 deletions(-) + +diff --git a/src/import/generic/memory/lib/utils/mcbist/gen_mss_mcbist_address.H b/src/import/generic/memory/lib/utils/mcbist/gen_mss_mcbist_address.H +index b87cacb..992b1b2 100644 +--- a/src/import/generic/memory/lib/utils/mcbist/gen_mss_mcbist_address.H ++++ b/src/import/generic/memory/lib/utils/mcbist/gen_mss_mcbist_address.H +@@ -162,14 +162,14 @@ class address + template< mss::mc_type MC = DEFAULT_MC_TYPE > + address( const ecc::trap_address& i_address ) + { +- this->set_field(i_address.get_field::PORT>()); +- this->set_field(i_address.get_field::DIMM>()); +- this->set_field(i_address.get_field::MRANK>()); +- this->set_field(i_address.get_field::SRANK>()); +- this->set_field(i_address.get_field::ROW>()); +- this->set_field(i_address.get_field::COL>()); +- this->set_field(i_address.get_field::BANK>()); +- this->set_field(i_address.get_field::BANK_GROUP>()); ++ this->set_field(i_address.template get_field::PORT>()); ++ this->set_field(i_address.template get_field::DIMM>()); ++ this->set_field(i_address.template get_field::MRANK>()); ++ this->set_field(i_address.template get_field::SRANK>()); ++ this->set_field(i_address.template get_field::ROW>()); ++ this->set_field(i_address.template get_field::COL>()); ++ this->set_field(i_address.template get_field::BANK>()); ++ this->set_field(i_address.template get_field::BANK_GROUP>()); + } + + /// +@@ -180,11 +180,11 @@ class address + template< mss::mc_type MC = DEFAULT_MC_TYPE > + address( const ecc::fwms::address& i_address ) + { +- this->set_field(i_address.get_field::DIMM>()); +- this->set_field(i_address.get_field::MRANK>()); +- this->set_field(i_address.get_field::SRANK>()); +- this->set_field(i_address.get_field::BANK_GROUP>()); +- this->set_field(i_address.get_field::BANK>()); ++ this->set_field(i_address.template get_field::DIMM>()); ++ this->set_field(i_address.template get_field::MRANK>()); ++ this->set_field(i_address.template get_field::SRANK>()); ++ this->set_field(i_address.template get_field::BANK_GROUP>()); ++ this->set_field(i_address.template get_field::BANK>()); + } + + /// +-- +1.8.2.2 +