Consistently use -std=gnu99 for gcc as well as clang. am: 5a0401ab9c

am: 3a136c085e

Change-Id: I41234f55760561183fae448fa20d123b82ade651
This commit is contained in:
Elliott Hughes 2016-10-13 14:58:04 +00:00 committed by android-build-merger
commit e6836a508a
4 changed files with 9 additions and 8 deletions

View File

@ -233,6 +233,7 @@ func (compiler *baseCompiler) compilerFlags(ctx ModuleContext, flags Flags) Flag
if !ctx.noDefaultCompilerFlags() { if !ctx.noDefaultCompilerFlags() {
flags.GlobalFlags = append(flags.GlobalFlags, instructionSetFlags) flags.GlobalFlags = append(flags.GlobalFlags, instructionSetFlags)
flags.ConlyFlags = append(flags.ConlyFlags, "${config.CommonGlobalConlyflags}")
if flags.Clang { if flags.Clang {
flags.AsFlags = append(flags.AsFlags, tc.ClangAsflags()) flags.AsFlags = append(flags.AsFlags, tc.ClangAsflags())
@ -241,8 +242,6 @@ func (compiler *baseCompiler) compilerFlags(ctx ModuleContext, flags Flags) Flag
tc.ClangCflags(), tc.ClangCflags(),
"${config.CommonClangGlobalCflags}", "${config.CommonClangGlobalCflags}",
fmt.Sprintf("${config.%sClangGlobalCflags}", hod)) fmt.Sprintf("${config.%sClangGlobalCflags}", hod))
flags.ConlyFlags = append(flags.ConlyFlags, "${config.ClangExtraConlyflags}")
} else { } else {
flags.CppFlags = append(flags.CppFlags, "${config.CommonGlobalCppflags}") flags.CppFlags = append(flags.CppFlags, "${config.CommonGlobalCppflags}")
flags.GlobalFlags = append(flags.GlobalFlags, flags.GlobalFlags = append(flags.GlobalFlags,

View File

@ -93,10 +93,6 @@ func init() {
"-Wno-expansion-to-defined", "-Wno-expansion-to-defined",
}, " ")) }, " "))
pctx.StaticVariable("ClangExtraConlyflags", strings.Join([]string{
"-std=gnu99",
}, " "))
pctx.StaticVariable("ClangExtraCppflags", strings.Join([]string{ pctx.StaticVariable("ClangExtraCppflags", strings.Join([]string{
// Disable -Winconsistent-missing-override until we can clean up the existing // Disable -Winconsistent-missing-override until we can clean up the existing
// codebase for it. // codebase for it.

View File

@ -37,6 +37,10 @@ var (
"-UDEBUG", "-UDEBUG",
} }
commonGlobalConlyflags = []string{
"-std=gnu99",
}
deviceGlobalCflags = []string{ deviceGlobalCflags = []string{
"-fdiagnostics-color", "-fdiagnostics-color",
@ -72,6 +76,7 @@ func init() {
} }
pctx.StaticVariable("CommonGlobalCflags", strings.Join(commonGlobalCflags, " ")) pctx.StaticVariable("CommonGlobalCflags", strings.Join(commonGlobalCflags, " "))
pctx.StaticVariable("CommonGlobalConlyflags", strings.Join(commonGlobalConlyflags, " "))
pctx.StaticVariable("DeviceGlobalCflags", strings.Join(deviceGlobalCflags, " ")) pctx.StaticVariable("DeviceGlobalCflags", strings.Join(deviceGlobalCflags, " "))
pctx.StaticVariable("HostGlobalCflags", strings.Join(hostGlobalCflags, " ")) pctx.StaticVariable("HostGlobalCflags", strings.Join(hostGlobalCflags, " "))
pctx.StaticVariable("NoOverrideGlobalCflags", strings.Join(noOverrideGlobalCflags, " ")) pctx.StaticVariable("NoOverrideGlobalCflags", strings.Join(noOverrideGlobalCflags, " "))

View File

@ -113,7 +113,9 @@ func makeVarsToolchain(ctx android.MakeVarsContext, secondPrefix string,
toolchain.ToolchainCflags(), toolchain.ToolchainCflags(),
productExtraCflags, productExtraCflags,
}, " ")) }, " "))
ctx.Strict(makePrefix+"GLOBAL_CONLYFLAGS", "") ctx.Strict(makePrefix+"GLOBAL_CONLYFLAGS", strings.Join([]string{
"${config.CommonGlobalConlyflags}",
}, " "))
ctx.Strict(makePrefix+"GLOBAL_CPPFLAGS", strings.Join([]string{ ctx.Strict(makePrefix+"GLOBAL_CPPFLAGS", strings.Join([]string{
"${config.CommonGlobalCppflags}", "${config.CommonGlobalCppflags}",
toolchain.Cppflags(), toolchain.Cppflags(),
@ -161,7 +163,6 @@ func makeVarsToolchain(ctx android.MakeVarsContext, secondPrefix string,
clangExtras, clangExtras,
productExtraCflags, productExtraCflags,
}, " ")) }, " "))
ctx.Strict(clangPrefix+"GLOBAL_CONLYFLAGS", "${config.ClangExtraConlyflags}")
ctx.Strict(clangPrefix+"GLOBAL_CPPFLAGS", strings.Join([]string{ ctx.Strict(clangPrefix+"GLOBAL_CPPFLAGS", strings.Join([]string{
"${config.CommonClangGlobalCppflags}", "${config.CommonClangGlobalCppflags}",
toolchain.ClangCppflags(), toolchain.ClangCppflags(),