[coreboot-gerrit] Change in coreboot[master]: crossgcc: Fix building with clang++ in the presence of gcc

Patrick Georgi (Code Review) gerrit at coreboot.org
Mon Jun 26 07:25:51 CEST 2017


Patrick Georgi has uploaded this change for review. ( https://review.coreboot.org/20365


Change subject: crossgcc: Fix building with clang++ in the presence of gcc
......................................................................

crossgcc: Fix building with clang++ in the presence of gcc

Some environments (<grumble>cros_sdk</grumble>) provide gcc as $CC and
clang++ as $CXX. The latter needs the higher bracket-depth while the
former has no idea what it means, so tell CC and CXX individually.

Change-Id: I72b75fb9bb5df3a9b1561ee8821ec43ada29b24f
Signed-off-by: Patrick Georgi <pgeorgi at chromium.org>
---
M util/crossgcc/buildgcc
1 file changed, 9 insertions(+), 4 deletions(-)



  git pull ssh://review.coreboot.org:29418/coreboot refs/changes/65/20365/1

diff --git a/util/crossgcc/buildgcc b/util/crossgcc/buildgcc
index 4d1f25a..01da659 100755
--- a/util/crossgcc/buildgcc
+++ b/util/crossgcc/buildgcc
@@ -621,7 +621,9 @@
 build_cross_GCC() {
 	# Work around crazy code generator in GCC that confuses CLANG.
 	$CC --version | grep clang >/dev/null 2>&1 && \
-		HOSTCFLAGS="$HOSTCFLAGS -fbracket-depth=1024"
+		CLANGFLAGS="-fbracket-depth=1024"
+	$CXX --version | grep clang >/dev/null 2>&1 && \
+		CLANGCXXFLAGS="-fbracket-depth=1024"
 
 	# GCC does not honor HOSTCFLAGS at all. CFLAGS are used for
 	# both target and host object files.
@@ -630,9 +632,12 @@
 	# libiberty is not compiled with CFLAGS_FOR_BUILD.
 	# Also set the CXX version of the flags because GCC is now compiled
 	# using C++.
-	CC="$CC" CFLAGS_FOR_TARGET="-O2 -Dinhibit_libc" CFLAGS="$HOSTCFLAGS" \
-		CFLAGS_FOR_BUILD="$HOSTCFLAGS" CXXFLAGS="$HOSTCFLAGS" \
-		CXXFLAGS_FOR_BUILD="$HOSTCFLAGS" ../gcc-${GCC_VERSION}/configure \
+	CC="$CC" CFLAGS_FOR_TARGET="-O2 -Dinhibit_libc"
+		CFLAGS="$HOSTCFLAGS $CLANGFLAGS" \
+		CFLAGS_FOR_BUILD="$HOSTCFLAGS $CLANGFLAGS" \
+		CXXFLAGS="$HOSTCFLAGS $CLANGCXXFLAGS" \
+		CXXFLAGS_FOR_BUILD="$HOSTCFLAGS $CLANGCXXFLAGS" \
+		../gcc-${GCC_VERSION}/configure \
 		--prefix=$TARGETDIR --libexecdir=$TARGETDIR/lib \
 		--target=${TARGETARCH} --disable-werror --disable-shared \
 		--enable-lto --enable-plugins --enable-gold --enable-ld=default \

-- 
To view, visit https://review.coreboot.org/20365
To unsubscribe, visit https://review.coreboot.org/settings

Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I72b75fb9bb5df3a9b1561ee8821ec43ada29b24f
Gerrit-Change-Number: 20365
Gerrit-PatchSet: 1
Gerrit-Owner: Patrick Georgi <pgeorgi at google.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.coreboot.org/pipermail/coreboot-gerrit/attachments/20170626/ccd9c8ae/attachment-0001.html>


More information about the coreboot-gerrit mailing list