From 8f2cdad882ba8859f297826a851a7e08564104b4 Mon Sep 17 00:00:00 2001 From: Patrick Georgi Date: Mon, 10 Jul 2017 11:48:34 +0200 Subject: [PATCH] crossgcc: Prefer gnatgcc over gcc if available For distros that package and version gnat independently from gcc (such as Ubuntu), try to build with gnatgcc first. This fixes the issue of gcc -print-prog-name=gnat1 failing because gcc is of a different version. Change-Id: Icec6d1fba8855e88ac91d47842dcb7f6b9d35461 Signed-off-by: Patrick Georgi Reviewed-on: https://review.coreboot.org/20517 Reviewed-by: Paul Menzel Tested-by: build bot (Jenkins) Reviewed-by: Stefan Reinauer --- util/crossgcc/buildgcc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/util/crossgcc/buildgcc b/util/crossgcc/buildgcc index d00941762d..0f4dd7a9a6 100755 --- a/util/crossgcc/buildgcc +++ b/util/crossgcc/buildgcc @@ -982,7 +982,9 @@ if [ -n "$CC" ]; then HALT_FOR_TOOLS=1 fi else - if searchtool gcc "Free Software Foundation" nofail > /dev/null; then + if searchtool gnatgcc "Free Software Foundation" nofail > /dev/null; then + CC=gnatgcc + elif searchtool gcc "Free Software Foundation" nofail > /dev/null; then CC=gcc else searchtool cc '^' nofail > /dev/null || please_install gcc