diff --git a/cc/cc.go b/cc/cc.go index 2d967ed50..358bff61a 100644 --- a/cc/cc.go +++ b/cc/cc.go @@ -1089,10 +1089,6 @@ func (c *Module) clang(ctx BaseModuleContext) bool { ctx.PropertyErrorf("clang", "false (GCC) is no longer supported") } - if !c.toolchain(ctx).ClangSupported() { - panic("GCC is no longer supported") - } - return !c.Properties.Gcc } diff --git a/cc/config/toolchain.go b/cc/config/toolchain.go index fefe7c2c3..930b18ffc 100644 --- a/cc/config/toolchain.go +++ b/cc/config/toolchain.go @@ -57,7 +57,6 @@ type Toolchain interface { IncludeFlags() string InstructionSetFlags(string) (string, error) - ClangSupported() bool ClangTriple() string ToolchainClangCflags() string ToolchainClangLdflags() string @@ -132,10 +131,6 @@ func (toolchainBase) ToolchainClangLdflags() string { return "" } -func (toolchainBase) ClangSupported() bool { - return true -} - func (toolchainBase) ShlibSuffix() string { return ".so" } diff --git a/cc/config/x86_windows_host.go b/cc/config/x86_windows_host.go index 9003e858c..65b9e6c42 100644 --- a/cc/config/x86_windows_host.go +++ b/cc/config/x86_windows_host.go @@ -233,10 +233,6 @@ func (t *toolchainWindowsX8664) WindresFlags() string { return "-F pe-x86-64" } -func (t *toolchainWindows) ClangSupported() bool { - return true -} - func (t *toolchainWindowsX86) ClangTriple() string { return "i686-windows-gnu" } diff --git a/cc/makevars.go b/cc/makevars.go index c4ef5f1e5..51089fdd3 100644 --- a/cc/makevars.go +++ b/cc/makevars.go @@ -136,7 +136,6 @@ func makeVarsProvider(ctx android.MakeVarsContext) { ctx.Strict("DEFAULT_C_STD_VERSION", config.CStdVersion) ctx.Strict("DEFAULT_CPP_STD_VERSION", config.CppStdVersion) - ctx.Strict("DEFAULT_GCC_CPP_STD_VERSION", config.GccCppStdVersion) ctx.Strict("EXPERIMENTAL_C_STD_VERSION", config.ExperimentalCStdVersion) ctx.Strict("EXPERIMENTAL_CPP_STD_VERSION", config.ExperimentalCppStdVersion) @@ -217,34 +216,6 @@ func makeVarsToolchain(ctx android.MakeVarsContext, secondPrefix string, productExtraLdflags += "-static" } - ctx.Strict(makePrefix+"GLOBAL_CFLAGS", strings.Join([]string{ - toolchain.Cflags(), - "${config.CommonGlobalCflags}", - fmt.Sprintf("${config.%sGlobalCflags}", hod), - toolchain.ToolchainCflags(), - productExtraCflags, - }, " ")) - ctx.Strict(makePrefix+"GLOBAL_CONLYFLAGS", strings.Join([]string{ - "${config.CommonGlobalConlyflags}", - }, " ")) - ctx.Strict(makePrefix+"GLOBAL_CPPFLAGS", strings.Join([]string{ - "${config.CommonGlobalCppflags}", - fmt.Sprintf("${config.%sGlobalCppflags}", hod), - toolchain.Cppflags(), - }, " ")) - ctx.Strict(makePrefix+"GLOBAL_LDFLAGS", strings.Join([]string{ - fmt.Sprintf("${config.%sGlobalLdflags}", hod), - toolchain.Ldflags(), - toolchain.ToolchainLdflags(), - productExtraLdflags, - }, " ")) - ctx.Strict(makePrefix+"GLOBAL_LLDFLAGS", strings.Join([]string{ - fmt.Sprintf("${config.%sGlobalLldflags}", hod), - toolchain.Ldflags(), - toolchain.ToolchainLdflags(), - productExtraLdflags, - }, " ")) - includeFlags, err := ctx.Eval(toolchain.IncludeFlags()) if err != nil { panic(err) @@ -267,60 +238,51 @@ func makeVarsToolchain(ctx android.MakeVarsContext, secondPrefix string, ctx.Strict(makePrefix+"thumb_CFLAGS", flags) } - if toolchain.ClangSupported() { - clangPrefix := secondPrefix + "CLANG_" + typePrefix - clangExtras := "-target " + toolchain.ClangTriple() - clangExtras += " -B" + config.ToolPath(toolchain) + clangPrefix := secondPrefix + "CLANG_" + typePrefix + clangExtras := "-target " + toolchain.ClangTriple() + clangExtras += " -B" + config.ToolPath(toolchain) - ctx.Strict(clangPrefix+"GLOBAL_CFLAGS", strings.Join([]string{ - toolchain.ClangCflags(), - "${config.CommonClangGlobalCflags}", - fmt.Sprintf("${config.%sClangGlobalCflags}", hod), - toolchain.ToolchainClangCflags(), - clangExtras, - productExtraCflags, - }, " ")) - ctx.Strict(clangPrefix+"GLOBAL_CPPFLAGS", strings.Join([]string{ - "${config.CommonClangGlobalCppflags}", - fmt.Sprintf("${config.%sGlobalCppflags}", hod), - toolchain.ClangCppflags(), - }, " ")) - ctx.Strict(clangPrefix+"GLOBAL_LDFLAGS", strings.Join([]string{ - fmt.Sprintf("${config.%sGlobalLdflags}", hod), - toolchain.ClangLdflags(), - toolchain.ToolchainClangLdflags(), - productExtraLdflags, - clangExtras, - }, " ")) - ctx.Strict(clangPrefix+"GLOBAL_LLDFLAGS", strings.Join([]string{ - fmt.Sprintf("${config.%sGlobalLldflags}", hod), - toolchain.ClangLldflags(), - toolchain.ToolchainClangLdflags(), - productExtraLdflags, - clangExtras, - }, " ")) + ctx.Strict(clangPrefix+"GLOBAL_CFLAGS", strings.Join([]string{ + toolchain.ClangCflags(), + "${config.CommonClangGlobalCflags}", + fmt.Sprintf("${config.%sClangGlobalCflags}", hod), + toolchain.ToolchainClangCflags(), + clangExtras, + productExtraCflags, + }, " ")) + ctx.Strict(clangPrefix+"GLOBAL_CPPFLAGS", strings.Join([]string{ + "${config.CommonClangGlobalCppflags}", + fmt.Sprintf("${config.%sGlobalCppflags}", hod), + toolchain.ClangCppflags(), + }, " ")) + ctx.Strict(clangPrefix+"GLOBAL_LDFLAGS", strings.Join([]string{ + fmt.Sprintf("${config.%sGlobalLdflags}", hod), + toolchain.ClangLdflags(), + toolchain.ToolchainClangLdflags(), + productExtraLdflags, + clangExtras, + }, " ")) + ctx.Strict(clangPrefix+"GLOBAL_LLDFLAGS", strings.Join([]string{ + fmt.Sprintf("${config.%sGlobalLldflags}", hod), + toolchain.ClangLldflags(), + toolchain.ToolchainClangLdflags(), + productExtraLdflags, + clangExtras, + }, " ")) - if target.Os.Class == android.Device { - ctx.Strict(secondPrefix+"ADDRESS_SANITIZER_RUNTIME_LIBRARY", strings.TrimSuffix(config.AddressSanitizerRuntimeLibrary(toolchain), ".so")) - ctx.Strict(secondPrefix+"HWADDRESS_SANITIZER_RUNTIME_LIBRARY", strings.TrimSuffix(config.HWAddressSanitizerRuntimeLibrary(toolchain), ".so")) - ctx.Strict(secondPrefix+"HWADDRESS_SANITIZER_STATIC_LIBRARY", strings.TrimSuffix(config.HWAddressSanitizerStaticLibrary(toolchain), ".a")) - ctx.Strict(secondPrefix+"UBSAN_RUNTIME_LIBRARY", strings.TrimSuffix(config.UndefinedBehaviorSanitizerRuntimeLibrary(toolchain), ".so")) - ctx.Strict(secondPrefix+"UBSAN_MINIMAL_RUNTIME_LIBRARY", strings.TrimSuffix(config.UndefinedBehaviorSanitizerMinimalRuntimeLibrary(toolchain), ".a")) - ctx.Strict(secondPrefix+"TSAN_RUNTIME_LIBRARY", strings.TrimSuffix(config.ThreadSanitizerRuntimeLibrary(toolchain), ".so")) - ctx.Strict(secondPrefix+"SCUDO_RUNTIME_LIBRARY", strings.TrimSuffix(config.ScudoRuntimeLibrary(toolchain), ".so")) - } - - // This is used by external/gentoo/... - ctx.Strict("CLANG_CONFIG_"+target.Arch.ArchType.Name+"_"+typePrefix+"TRIPLE", - toolchain.ClangTriple()) - - ctx.Strict(makePrefix+"CLANG_SUPPORTED", "true") - } else { - ctx.Strict(makePrefix+"CLANG_SUPPORTED", "") + if target.Os.Class == android.Device { + ctx.Strict(secondPrefix+"ADDRESS_SANITIZER_RUNTIME_LIBRARY", strings.TrimSuffix(config.AddressSanitizerRuntimeLibrary(toolchain), ".so")) + ctx.Strict(secondPrefix+"HWADDRESS_SANITIZER_RUNTIME_LIBRARY", strings.TrimSuffix(config.HWAddressSanitizerRuntimeLibrary(toolchain), ".so")) + ctx.Strict(secondPrefix+"HWADDRESS_SANITIZER_STATIC_LIBRARY", strings.TrimSuffix(config.HWAddressSanitizerStaticLibrary(toolchain), ".a")) + ctx.Strict(secondPrefix+"UBSAN_RUNTIME_LIBRARY", strings.TrimSuffix(config.UndefinedBehaviorSanitizerRuntimeLibrary(toolchain), ".so")) + ctx.Strict(secondPrefix+"UBSAN_MINIMAL_RUNTIME_LIBRARY", strings.TrimSuffix(config.UndefinedBehaviorSanitizerMinimalRuntimeLibrary(toolchain), ".a")) + ctx.Strict(secondPrefix+"TSAN_RUNTIME_LIBRARY", strings.TrimSuffix(config.ThreadSanitizerRuntimeLibrary(toolchain), ".so")) + ctx.Strict(secondPrefix+"SCUDO_RUNTIME_LIBRARY", strings.TrimSuffix(config.ScudoRuntimeLibrary(toolchain), ".so")) } - ctx.Strict(makePrefix+"CC", gccCmd(toolchain, "gcc")) - ctx.Strict(makePrefix+"CXX", gccCmd(toolchain, "g++")) + // This is used by external/gentoo/... + ctx.Strict("CLANG_CONFIG_"+target.Arch.ArchType.Name+"_"+typePrefix+"TRIPLE", + toolchain.ClangTriple()) if target.Os == android.Darwin { ctx.Strict(makePrefix+"AR", "${config.MacArPath}")