From c374dee8b63994eeea34a9cd2d67e480d3239e19 Mon Sep 17 00:00:00 2001 From: Felix Singer Date: Wed, 4 Oct 2023 03:10:52 +0000 Subject: [PATCH] util/crossgcc/buildgcc: Fix detection of GNAT on recent versions gnatgcc is deprecated and in recent GCC releases its purpose is fulfilled by the gcc binary. In case of a deprecated gnatgcc version is installed, it doesn't provide the expected output and hostcc_has_gnat1() fails. In this case, just set the value of CC to gcc. It's still required to install GNAT in addition to GCC. Change-Id: I730bdfda81268d10bd2a41ef5cb4e3810b76a42c Signed-off-by: Felix Singer Reviewed-on: https://review.coreboot.org/c/coreboot/+/78215 Tested-by: build bot (Jenkins) Reviewed-by: Martin L Roth --- util/crossgcc/buildgcc | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/util/crossgcc/buildgcc b/util/crossgcc/buildgcc index ebc9fcb49a..d336556bb0 100755 --- a/util/crossgcc/buildgcc +++ b/util/crossgcc/buildgcc @@ -1080,7 +1080,17 @@ if [ -n "$CC" ]; then fi else if searchtool gnatgcc "Free Software Foundation" nofail > /dev/null; then + # gnatgcc is deprecated and in recent GCC releases its purpose is + # fulfilled by the gcc binary. In case of a deprecated gnatgcc + # version is installed, it doesn't provide the expected output and + # hostcc_has_gnat1() fails. In this case, just set the value of CC + # to gcc. + # TODO: Remove this whole branch when time is appropriate as the + # second branch fulfills our needs. CC=gnatgcc + if ! hostcc_has_gnat1; then + CC=gcc + fi elif searchtool gcc "Free Software Foundation" nofail > /dev/null; then CC=gcc else