From 3f12d9321ac9d7ea6a4609aec697760c658af6f9 Mon Sep 17 00:00:00 2001 From: Nico Huber Date: Thu, 31 Aug 2017 23:11:18 +0200 Subject: buildgcc: Fix up cross GCC building MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add a missing line-break escape and, rather cosmetic, guard execution of $CXX which we allow but don't force to be set. Change-Id: Icf6d3b7de4b7999b8214489f28997964c490d1e9 Signed-off-by: Nico Huber Reviewed-on: https://review.coreboot.org/21307 Reviewed-by: Patrick Georgi Tested-by: build bot (Jenkins) Reviewed-by: Philippe Mathieu-Daudé --- util/crossgcc/buildgcc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'util/crossgcc') diff --git a/util/crossgcc/buildgcc b/util/crossgcc/buildgcc index 9cbdfc6001..0834929f8d 100755 --- a/util/crossgcc/buildgcc +++ b/util/crossgcc/buildgcc @@ -659,7 +659,7 @@ build_cross_GCC() { # Work around crazy code generator in GCC that confuses CLANG. $CC --version | grep clang >/dev/null 2>&1 && \ CLANGFLAGS="-fbracket-depth=1024" - $CXX --version | grep clang >/dev/null 2>&1 && \ + [ -n "$CXX" ] && $CXX --version | grep clang >/dev/null 2>&1 && \ CLANGCXXFLAGS="-fbracket-depth=1024" # GCC does not honor HOSTCFLAGS at all. CFLAGS are used for @@ -670,7 +670,7 @@ build_cross_GCC() { # Also set the CXX version of the flags because GCC is now compiled # using C++. CC="$(hostcc target)" CXX="$(hostcxx target)" \ - CFLAGS_FOR_TARGET="-O2 -Dinhibit_libc" + CFLAGS_FOR_TARGET="-O2 -Dinhibit_libc" \ CFLAGS="$HOSTCFLAGS $CLANGFLAGS" \ CFLAGS_FOR_BUILD="$HOSTCFLAGS $CLANGFLAGS" \ CXXFLAGS="$HOSTCFLAGS $CLANGCXXFLAGS" \ -- cgit v1.2.3