From 39d450b374f1430098ea771b3922e2b100414c6f Mon Sep 17 00:00:00 2001 From: Colin Cross Date: Mon, 6 Nov 2017 12:53:30 -0800 Subject: [PATCH 1/2] Move -fno-canonical-system-headers to global cflags -fno-canonical-system-headers is required for gcc to use relative paths to system headers in deps files, and is stripped out for clang. Move it to the global flags so it affects windows gcc builds. Bug: 68719465 Test: m checkbuild Test: prebuilts/build-tools/linux-x86/bin/ninja -f out/combined-${TARGET_PRODUCT}.ninja -t deps | grep -E '^[[:space:]]*/' | sort | uniq Change-Id: Ia9befd7cf8cfd714241e636fb786c319aecc79fe --- cc/config/global.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cc/config/global.go b/cc/config/global.go index 7362f2e51..de4fa116c 100644 --- a/cc/config/global.go +++ b/cc/config/global.go @@ -36,6 +36,7 @@ var ( // Make paths in deps files relative "-no-canonical-prefixes", + "-fno-canonical-system-headers", "-DNDEBUG", "-UDEBUG", @@ -54,7 +55,6 @@ var ( deviceGlobalCflags = []string{ "-fdiagnostics-color", - "-fno-canonical-system-headers", "-ffunction-sections", "-funwind-tables", "-fstack-protector-strong", From d7903535ea3240977545475f8a46e5a233956382 Mon Sep 17 00:00:00 2001 From: Colin Cross Date: Mon, 6 Nov 2017 12:55:44 -0800 Subject: [PATCH 2/2] Use relative paths in copygcclib.sh deps files Strip $PWD/ off the beginning of the path printed by gcc. Bug: 68719465 Test: m checkbuild Test: prebuilts/build-tools/linux-x86/bin/ninja -f out/combined-${TARGET_PRODUCT}.ninja -t deps | grep -E '^[[:space:]]*/' | sort | uniq --- scripts/copygcclib.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/copygcclib.sh b/scripts/copygcclib.sh index 93c52cc58..4bd6f9b47 100755 --- a/scripts/copygcclib.sh +++ b/scripts/copygcclib.sh @@ -2,6 +2,6 @@ OUT=$1 shift -LIBPATH=$($@) +LIBPATH=$($@ | sed -e "s|^$PWD/||") cp -f $LIBPATH $OUT echo "$OUT: $LIBPATH" > ${OUT}.d