From f2741aa632f900cccede42148671ac76165a7eea Mon Sep 17 00:00:00 2001 From: Patrick Georgi Date: Mon, 6 Jul 2020 16:35:56 +0200 Subject: [PATCH] util/crossgcc: Always bootstrap for gcc < 4.9 Building cbfstool requires at least 4.9 due to optimizer bugs in gcc 3.x to 4.8.x, so let's not work around ancient compilers in our tree but ensure that users get a newer compiler. Closes: https://ticket.coreboot.org/issues/240 Change-Id: I4e0f80e2790514e6a1b5d5de1a373f365df1569c Signed-off-by: Patrick Georgi Reviewed-on: https://review.coreboot.org/c/coreboot/+/43143 Reviewed-by: HAOUAS Elyes Reviewed-by: Angel Pons Reviewed-by: Paul Menzel Tested-by: build bot (Jenkins) --- util/crossgcc/buildgcc | 38 +++++++++++++++----------------------- 1 file changed, 15 insertions(+), 23 deletions(-) diff --git a/util/crossgcc/buildgcc b/util/crossgcc/buildgcc index 17c89e82b2..dc59ce1ebc 100755 --- a/util/crossgcc/buildgcc +++ b/util/crossgcc/buildgcc @@ -1178,33 +1178,25 @@ if [ -z "${LANGUAGES}" ]; then LANGUAGES="${DEFAULT_LANGUAGES}" fi fi +if [ "$BOOTSTRAP" != 1 ] && \ + { [ "$(hostcc_major)" -lt 4 ] || \ + { [ "$(hostcc_major)" -eq 4 ] && \ + [ "$(hostcc_minor)" -lt 9 ] ; } ; } +then + printf "\n${red}WARNING${NC}\n" + printf "Building coreboot requires a host compiler newer than 4.9.x while\n" + printf "yours is $(hostcc_version).\n" + printf "Enabling bootstrapping to provide a sufficiently new compiler:\n" + printf "This will take significantly longer than a usual build.\n" + printf "Alternatively you can abort now and update your host compiler.\n" + timeout 15 + BOOTSTRAP=1 +fi if ada_requested; then - if have_gnat; then - if [ "$BOOTSTRAP" != 1 ] && \ - { [ "$(hostcc_major)" -lt 4 ] || \ - { [ "$(hostcc_major)" -eq 4 ] && \ - [ "$(hostcc_minor)" -lt 9 ] ; } ; } - then - printf "\n${red}WARNING${NC}\n" - printf "Building the Ada compiler (GNAT $(buildcc_version)) with a host compiler older\n" - printf "than 4.9.x (yours $(hostcc_version)) requires bootstrapping. This will take\n" - printf "significantly longer than a usual build. You can abort and update\n" - printf "your host GNAT or disable Ada support with BUILD_LANGUAGES=c (or\n" - printf "\`-l c\` in case you invoke \`buildgcc\` directly).\n" - timeout 15 - BOOTSTRAP=1 - fi - else + if ! have_gnat; then please_install gnat gcc-ada exit 1 fi -else - if [ "$(hostcc_major)" -lt 4 ] && [ "$BOOTSTRAP" != 1 ]; then - printf "\n${red}WARNING${NC}\n" - printf "Building GCC $(buildcc_version) with a very old host compiler ($(hostcc_version)).\n" - printf "Bootstrapping (-b) is recommended.\n" - timeout 10 - fi fi fi # GCC