Merge "Move global asflags to config to share with Bazel"

This commit is contained in:
Treehugger Robot 2022-06-28 02:34:59 +00:00 committed by Gerrit Code Review
commit 8624baab51
3 changed files with 10 additions and 6 deletions

View file

@ -4076,7 +4076,7 @@ func TestIncludeDirectoryOrdering(t *testing.T) {
{
name: "assemble",
src: "foo.s",
expected: combineSlices(baseExpectedFlags, []string{"-D__ASSEMBLY__", "-fdebug-default-version=4"}, expectedIncludes, lastIncludes),
expected: combineSlices(baseExpectedFlags, []string{"${config.CommonGlobalAsflags}"}, expectedIncludes, lastIncludes),
},
}

View file

@ -493,11 +493,7 @@ 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.AsFlags = append(flags.Global.AsFlags, "${config.CommonGlobalAsflags}")
flags.Global.CppFlags = append(flags.Global.CppFlags, tc.Cppflags())

View file

@ -117,6 +117,13 @@ var (
commonGlobalConlyflags = []string{}
commonGlobalAsflags = []string{
"-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.
"-fdebug-default-version=4",
}
deviceGlobalCflags = []string{
"-ffunction-sections",
"-fdata-sections",
@ -313,6 +320,7 @@ func init() {
}
exportedVars.ExportStringListStaticVariable("CommonGlobalConlyflags", commonGlobalConlyflags)
exportedVars.ExportStringListStaticVariable("CommonGlobalAsflags", commonGlobalAsflags)
exportedVars.ExportStringListStaticVariable("DeviceGlobalCppflags", deviceGlobalCppflags)
exportedVars.ExportStringListStaticVariable("DeviceGlobalLdflags", deviceGlobalLdflags)
exportedVars.ExportStringListStaticVariable("DeviceGlobalLldflags", deviceGlobalLldflags)