summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFelix Singer <felixsinger@posteo.net>2023-10-04 03:10:52 +0000
committerMartin L Roth <gaumless@gmail.com>2023-11-02 16:39:07 +0000
commitc374dee8b63994eeea34a9cd2d67e480d3239e19 (patch)
treedac9c5e42784926ed65d048b4110496b3b49c14e
parent750d171ba86849616bd6d7e195945afd526174c5 (diff)
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 <felixsinger@posteo.net> Reviewed-on: https://review.coreboot.org/c/coreboot/+/78215 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Martin L Roth <gaumless@gmail.com>
-rwxr-xr-xutil/crossgcc/buildgcc10
1 files changed, 10 insertions, 0 deletions
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