Fix makevars (C|LD)FLAGS ordering

This better matches the order from cc/cc.go, so that any implicit
ordering behaves the same in Make and Soong.

Change-Id: I802d725f037a22c4b2f0ae28258af95efa37ce79
This commit is contained in:
Dan Willemsen 2016-05-18 23:00:57 -07:00
parent c264c16638
commit d26a713dca
1 changed files with 8 additions and 9 deletions

View File

@ -82,11 +82,11 @@ func makeVarsToolchain(ctx android.MakeVarsContext, secondPrefix string,
}
ctx.StrictSorted(makePrefix+"GLOBAL_CFLAGS", strings.Join([]string{
toolchain.ToolchainCflags(),
toolchain.Cflags(),
"${commonGlobalCflags}",
fmt.Sprintf("${%sGlobalCflags}", hod),
toolchain.ToolchainCflags(),
productExtraCflags,
toolchain.Cflags(),
}, " "))
ctx.StrictSorted(makePrefix+"GLOBAL_CONLYFLAGS", "")
ctx.StrictSorted(makePrefix+"GLOBAL_CPPFLAGS", strings.Join([]string{
@ -94,9 +94,9 @@ func makeVarsToolchain(ctx android.MakeVarsContext, secondPrefix string,
toolchain.Cppflags(),
}, " "))
ctx.StrictSorted(makePrefix+"GLOBAL_LDFLAGS", strings.Join([]string{
toolchain.Ldflags(),
toolchain.ToolchainLdflags(),
productExtraLdflags,
toolchain.Ldflags(),
}, " "))
if toolchain.ClangSupported() {
@ -107,13 +107,12 @@ func makeVarsToolchain(ctx android.MakeVarsContext, secondPrefix string,
}
ctx.StrictSorted(clangPrefix+"GLOBAL_CFLAGS", strings.Join([]string{
toolchain.ToolchainClangCflags(),
"${commonClangGlobalCflags}",
"${clangExtraCflags}",
fmt.Sprintf("${%sClangGlobalCflags}", hod),
productExtraCflags,
toolchain.ClangCflags(),
"${commonClangGlobalCflags}",
fmt.Sprintf("${%sClangGlobalCflags}", hod),
toolchain.ToolchainClangCflags(),
clangExtras,
productExtraCflags,
}, " "))
ctx.StrictSorted(clangPrefix+"GLOBAL_CONLYFLAGS", "${clangExtraConlyflags}")
ctx.StrictSorted(clangPrefix+"GLOBAL_CPPFLAGS", strings.Join([]string{
@ -121,9 +120,9 @@ func makeVarsToolchain(ctx android.MakeVarsContext, secondPrefix string,
toolchain.ClangCppflags(),
}, " "))
ctx.StrictSorted(clangPrefix+"GLOBAL_LDFLAGS", strings.Join([]string{
toolchain.ClangLdflags(),
toolchain.ToolchainClangLdflags(),
productExtraLdflags,
toolchain.ClangLdflags(),
clangExtras,
}, " "))
}