Fix absolute paths in clang debug output

As of the latest clang python wrapper, clang is being executed with an
absolute path. That means that clang-provided headers are written with
absolute paths in the debug info, making the builds non-reproducible
(especially with ccache).

So keep our current PWD=/proc/self/pwd -fdebug-prefix-map=/proc/self/cwd=,
but add a new -fdebug-prefix-map=$PWD/= to rewrite these absolute paths.

Bug: 36463318
Test: m -j libc adb; grep for path names
Test: spot check objdump -W before/after, see only expected diffs.
Change-Id: Ic2cdfca051d3c38b753fd5c1fcbeaca8bafc29ae
This commit is contained in:
Dan Willemsen
2017-03-27 16:53:38 -07:00
parent e7ee3c7bc2
commit 253cab89ee

View File

@@ -91,6 +91,10 @@ func init() {
// http://b/29823425 Disable -Wexpansion-to-defined for Clang update to r271374
"-Wno-expansion-to-defined",
// http://b/36463318 Clang executes with an absolute path, so clang-provided
// headers are now absolute.
"-fdebug-prefix-map=$$PWD/=",
}, " "))
pctx.StaticVariable("ClangExtraCppflags", strings.Join([]string{