From 26267a7a41312c3160604766d17f361dc80c2a52 Mon Sep 17 00:00:00 2001 From: Nico Huber Date: Sun, 4 Dec 2016 02:45:58 +0100 Subject: buildgcc: Be less restrictive when trying to build GNAT It turned out that newer GNAT versions can build our current (5.3.0) GNAT without bootstrapping. So adapt the version enforcement. Change-Id: Ie7189e8bcadeee56cf5c2172e8c0ae7cd534685a Signed-off-by: Nico Huber Reviewed-on: https://review.coreboot.org/17706 Tested-by: build bot (Jenkins) Reviewed-by: Stefan Reinauer Reviewed-by: Paul Menzel --- util/crossgcc/buildgcc | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'util/crossgcc') diff --git a/util/crossgcc/buildgcc b/util/crossgcc/buildgcc index d64b687dd9..97c38b8d95 100755 --- a/util/crossgcc/buildgcc +++ b/util/crossgcc/buildgcc @@ -211,6 +211,10 @@ buildcc_major() { echo "${GCC_VERSION}" | cut -d. -f1 } +buildcc_minor() { + echo "${GCC_VERSION}" | cut -d. -f2 +} + buildcc_version() { echo "${GCC_VERSION}" | cut -d. -f1-2 } @@ -237,9 +241,14 @@ ada_requested() { check_gnat() { if hostcc_has_gnat1; then - if [ "$(hostcc_version)" != "$(buildcc_version)" -a "${BOOTSTRAP}" != "1" ]; then + if [ \( "$(hostcc_major)" -lt "$(buildcc_major)" -o \ + \( "$(hostcc_major)" -eq "$(buildcc_major)" -a \ + "$(hostcc_minor)" -lt "$(buildcc_minor)" \) \) \ + -a \ + "${BOOTSTRAP}" != "1" ]; \ + then printf "\n${RED}ERROR:${red} Building the Ada compiler (gnat $(buildcc_version)) " - printf "with a different host compiler\n version ($(hostcc_version)) " + printf "with an older host compiler\n version ($(hostcc_version)) " printf "requires bootstrapping (-b).${NC}\n\n" HALT_FOR_TOOLS=1 fi -- cgit v1.2.3