Index: build/android/envsetup.sh |
diff --git a/build/android/envsetup.sh b/build/android/envsetup.sh |
index b0024858d70492f11ba2de8a541d7c71341a9f03..10e69f6a4b5d59d5838c0b02945ae713928f0fe7 100755 |
--- a/build/android/envsetup.sh |
+++ b/build/android/envsetup.sh |
@@ -104,7 +104,23 @@ export AR_target=$(echo -n ${ANDROID_TOOLCHAIN}/*-ar) |
# Performs a gyp_chromium run to convert gyp->Makefile for android code. |
android_gyp() { |
echo "GYP_GENERATORS set to '$GYP_GENERATORS'" |
- "${CHROME_SRC}/build/gyp_chromium" --depth="${CHROME_SRC}" --check "$@" |
+ # http://crbug.com/143889. |
+ # In case we are doing a Clang build, we have to unset CC_target and |
+ # CXX_target. Otherwise GYP ends up generating a gcc build (although we set |
+ # 'clang' to 1). This behavior was introduced by |
+ # 54d2f6fe6d8a7b9d9786bd1f8540df6b4f46b83f in GYP. |
+ ( |
+ # Fork to avoid side effects on the user's environment variables. |
+ if echo "$GYP_DEFINES" | tr ' ' '\n' | grep -q '^clang=' | tail -n1 | \ |
+ grep -xq clang=1; then |
+ if echo "$CC_target" | grep -q gcc; then |
+ unset AR_target |
Yaron
2012/09/04 17:16:19
Note that I'm actually planning to remove the *_ta
Philippe
2012/09/05 15:23:24
Yes that sounds good, please assign the underlying
|
+ unset CC_target |
+ unset CXX_target |
+ fi |
+ fi |
+ "${CHROME_SRC}/build/gyp_chromium" --depth="${CHROME_SRC}" --check "$@" |
+ ) |
} |
# FLOCK needs to be null on system that has no flock |