diff --git a/cc/config/global.go b/cc/config/global.go index 85ebd6076..ec6dbcee7 100644 --- a/cc/config/global.go +++ b/cc/config/global.go @@ -16,6 +16,7 @@ package config import ( "runtime" + "slices" "strings" "android/soong/android" @@ -400,7 +401,7 @@ func init() { exportedVars.ExportStringList("CommonGlobalCflags", commonGlobalCflags) pctx.VariableFunc("CommonGlobalCflags", func(ctx android.PackageVarContext) string { - flags := commonGlobalCflags + flags := slices.Clone(commonGlobalCflags) // http://b/131390872 // Automatically initialize any uninitialized stack variables.