Remove clang indirection without affecting build.ninja

Remove cflags that are not handled by clang from the global defaults,
and remove calls to ClangFilterUnknownCflags.

Squash lists of clang-specific default flags into the main default
flags lists.

Rename Toolchain.Clang*flags to Toolchain.*flags.

Rename Go variables with Clang in the name that have no non-Clang
equivalent.

Remove unused ninja variables.

Bug: 68947919
Test: no change to build.ninja for aosp_cf_x86_64_phone-userdebug or aosp_crosshatch-userdebug
Change-Id: Id287945315d53e5eaef197adbbb4f1302f2e3680
This commit is contained in:
Colin Cross
2021-07-14 17:03:16 -07:00
parent 1c19b81e3d
commit 33bac24bb9
19 changed files with 234 additions and 355 deletions

View File

@@ -212,13 +212,13 @@ func makeVarsToolchain(ctx android.MakeVarsContext, secondPrefix string,
ctx.StrictRaw(makePrefix+"C_SYSTEM_INCLUDES", strings.Join(systemIncludes, " "))
if target.Arch.ArchType == android.Arm {
flags, err := toolchain.ClangInstructionSetFlags("arm")
flags, err := toolchain.InstructionSetFlags("arm")
if err != nil {
panic(err)
}
ctx.Strict(makePrefix+"arm_CFLAGS", flags)
flags, err = toolchain.ClangInstructionSetFlags("thumb")
flags, err = toolchain.InstructionSetFlags("thumb")
if err != nil {
panic(err)
}
@@ -230,29 +230,29 @@ func makeVarsToolchain(ctx android.MakeVarsContext, secondPrefix string,
ctx.Strict(clangPrefix+"TRIPLE", toolchain.ClangTriple())
ctx.Strict(clangPrefix+"GLOBAL_CFLAGS", strings.Join([]string{
toolchain.ClangCflags(),
toolchain.Cflags(),
"${config.CommonClangGlobalCflags}",
fmt.Sprintf("${config.%sClangGlobalCflags}", hod),
toolchain.ToolchainClangCflags(),
toolchain.ToolchainCflags(),
clangExtras,
productExtraCflags,
}, " "))
ctx.Strict(clangPrefix+"GLOBAL_CPPFLAGS", strings.Join([]string{
"${config.CommonClangGlobalCppflags}",
fmt.Sprintf("${config.%sGlobalCppflags}", hod),
toolchain.ClangCppflags(),
toolchain.Cppflags(),
}, " "))
ctx.Strict(clangPrefix+"GLOBAL_LDFLAGS", strings.Join([]string{
fmt.Sprintf("${config.%sGlobalLdflags}", hod),
toolchain.ClangLdflags(),
toolchain.ToolchainClangLdflags(),
toolchain.Ldflags(),
toolchain.ToolchainLdflags(),
productExtraLdflags,
clangExtras,
}, " "))
ctx.Strict(clangPrefix+"GLOBAL_LLDFLAGS", strings.Join([]string{
fmt.Sprintf("${config.%sGlobalLldflags}", hod),
toolchain.ClangLldflags(),
toolchain.ToolchainClangLdflags(),
toolchain.Lldflags(),
toolchain.ToolchainLdflags(),
productExtraLdflags,
clangExtras,
}, " "))