From cdcb680dbdd5eca4974eab623a782a0bc3c074e6 Mon Sep 17 00:00:00 2001 From: Colin Cross Date: Thu, 9 Jun 2022 11:07:01 -0700 Subject: [PATCH] Use -fdebug-default-version=4 for assembly files -fdebug-default-version=5 is causing $TMPDIR to end up in the dwarf debug data, which causes the buildbot results to be nondeterministic. Pass -fdebug-default-version=4 for assembly files as a workaround. Bug: 235105792 Test: lunch aosp_arm-userdebug && m libbase && llvm-dwarfdump --debug-line out/target/product/generic/symbols/system/lib/libbase.so Change-Id: Ife04e3c898bbb1291f71b8365fbca854cd2d2b66 --- cc/cc_test.go | 2 +- cc/compiler.go | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/cc/cc_test.go b/cc/cc_test.go index fb246243f..38f63835d 100644 --- a/cc/cc_test.go +++ b/cc/cc_test.go @@ -4076,7 +4076,7 @@ func TestIncludeDirectoryOrdering(t *testing.T) { { name: "assemble", src: "foo.s", - expected: combineSlices(baseExpectedFlags, []string{"-D__ASSEMBLY__"}, expectedIncludes, lastIncludes), + expected: combineSlices(baseExpectedFlags, []string{"-D__ASSEMBLY__", "-fdebug-default-version=4"}, expectedIncludes, lastIncludes), }, } diff --git a/cc/compiler.go b/cc/compiler.go index c7e9c9a95..cd1d92c0b 100644 --- a/cc/compiler.go +++ b/cc/compiler.go @@ -495,6 +495,10 @@ func (compiler *baseCompiler) compilerFlags(ctx ModuleContext, flags Flags, deps flags.Global.AsFlags = append(flags.Global.AsFlags, "-D__ASSEMBLY__") + // TODO(b/235105792): override global -fdebug-default-version=5, it is causing $TMPDIR to + // end up in the dwarf data for crtend_so.S. + flags.Global.AsFlags = append(flags.Global.AsFlags, "-fdebug-default-version=4") + flags.Global.CppFlags = append(flags.Global.CppFlags, tc.Cppflags()) flags.Global.YasmFlags = append(flags.Global.YasmFlags, tc.YasmFlags())