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 <pgeorgi@google.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/43143
Reviewed-by: HAOUAS Elyes <ehaouas@noos.fr>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
This commit is contained in:
Patrick Georgi 2020-07-06 16:35:56 +02:00
parent b087a940a2
commit f2741aa632
1 changed files with 15 additions and 23 deletions

View File

@ -1178,33 +1178,25 @@ if [ -z "${LANGUAGES}" ]; then
LANGUAGES="${DEFAULT_LANGUAGES}" LANGUAGES="${DEFAULT_LANGUAGES}"
fi fi
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 ada_requested; then
if have_gnat; 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
please_install gnat gcc-ada please_install gnat gcc-ada
exit 1 exit 1
fi 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
fi # GCC fi # GCC