deletion of clang_cflags & clang_asflags from Soong

Clang_cflags and clang_asflags are depecrated.
Set up BUILD_BROKEN flags so partners can bypass errors
from using them

Bug: 226636335
Test: m nothing & treehugger
Change-Id: Ic1d90b72decc4c6c1f7e6dda95a2c56ab2c26d86
This commit is contained in:
Alix
2022-04-26 19:17:51 +00:00
parent 5aa5dc4121
commit 1879c68261
4 changed files with 116 additions and 4 deletions

View File

@@ -441,12 +441,24 @@ func (compiler *baseCompiler) compilerFlags(ctx ModuleContext, flags Flags, deps
// TODO: debug
flags.Local.CFlags = append(flags.Local.CFlags, esc(compiler.Properties.Release.Cflags)...)
CheckBadCompilerFlags(ctx, "clang_cflags", compiler.Properties.Clang_cflags)
CheckBadCompilerFlags(ctx, "clang_asflags", compiler.Properties.Clang_asflags)
if !ctx.DeviceConfig().BuildBrokenClangCFlags() && len(compiler.Properties.Clang_cflags) != 0 {
ctx.PropertyErrorf("clang_cflags", "property is deprecated, see Changes.md file")
} else {
CheckBadCompilerFlags(ctx, "clang_cflags", compiler.Properties.Clang_cflags)
}
if !ctx.DeviceConfig().BuildBrokenClangAsFlags() && len(compiler.Properties.Clang_asflags) != 0 {
ctx.PropertyErrorf("clang_asflags", "property is deprecated, see Changes.md file")
} else {
CheckBadCompilerFlags(ctx, "clang_asflags", compiler.Properties.Clang_asflags)
}
flags.Local.CFlags = config.ClangFilterUnknownCflags(flags.Local.CFlags)
flags.Local.CFlags = append(flags.Local.CFlags, esc(compiler.Properties.Clang_cflags)...)
flags.Local.AsFlags = append(flags.Local.AsFlags, esc(compiler.Properties.Clang_asflags)...)
if !ctx.DeviceConfig().BuildBrokenClangCFlags() {
flags.Local.CFlags = append(flags.Local.CFlags, esc(compiler.Properties.Clang_cflags)...)
}
if !ctx.DeviceConfig().BuildBrokenClangAsFlags() {
flags.Local.AsFlags = append(flags.Local.AsFlags, esc(compiler.Properties.Clang_asflags)...)
}
flags.Local.CppFlags = config.ClangFilterUnknownCflags(flags.Local.CppFlags)
flags.Local.ConlyFlags = config.ClangFilterUnknownCflags(flags.Local.ConlyFlags)
flags.Local.LdFlags = config.ClangFilterUnknownCflags(flags.Local.LdFlags)