Merge "Add support for AUTO_*_INITIALIZE to build/soong." am: 7f0560d962
am: b28643b33f
am: 9e239e9b85
am: d574f6ff1b
Change-Id: I5554077d9311e636f4ea277965ec34d70727b318
This commit is contained in:
commit
4ebe705827
1 changed files with 16 additions and 2 deletions
|
@ -150,8 +150,22 @@ func init() {
|
|||
pctx.StaticVariable("HostGlobalLdflags", strings.Join(hostGlobalLdflags, " "))
|
||||
pctx.StaticVariable("HostGlobalLldflags", strings.Join(hostGlobalLldflags, " "))
|
||||
|
||||
pctx.StaticVariable("CommonClangGlobalCflags",
|
||||
strings.Join(append(ClangFilterUnknownCflags(commonGlobalCflags), "${ClangExtraCflags}"), " "))
|
||||
pctx.VariableFunc("CommonClangGlobalCflags", func(ctx android.PackageVarContext) string {
|
||||
flags := ClangFilterUnknownCflags(commonGlobalCflags)
|
||||
flags = append(flags, "${ClangExtraCflags}")
|
||||
|
||||
// http://b/131390872
|
||||
// Automatically initialize any uninitialized stack variables.
|
||||
// Prefer zero-init if both options are set.
|
||||
if ctx.Config().IsEnvTrue("AUTO_ZERO_INITIALIZE") {
|
||||
flags = append(flags, "-ftrivial-auto-var-init=zero -enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang")
|
||||
} else if ctx.Config().IsEnvTrue("AUTO_PATTERN_INITIALIZE") {
|
||||
flags = append(flags, "-ftrivial-auto-var-init=pattern")
|
||||
}
|
||||
|
||||
return strings.Join(flags, " ")
|
||||
})
|
||||
|
||||
pctx.VariableFunc("DeviceClangGlobalCflags", func(ctx android.PackageVarContext) string {
|
||||
if ctx.Config().Fuchsia() {
|
||||
return strings.Join(ClangFilterUnknownCflags(deviceGlobalCflags), " ")
|
||||
|
|
Loading…
Reference in a new issue