Merge "Remove GCC support from Make"
This commit is contained in:
commit
2f7e3bb4d0
4
cc/cc.go
4
cc/cc.go
|
@ -1089,10 +1089,6 @@ func (c *Module) clang(ctx BaseModuleContext) bool {
|
||||||
ctx.PropertyErrorf("clang", "false (GCC) is no longer supported")
|
ctx.PropertyErrorf("clang", "false (GCC) is no longer supported")
|
||||||
}
|
}
|
||||||
|
|
||||||
if !c.toolchain(ctx).ClangSupported() {
|
|
||||||
panic("GCC is no longer supported")
|
|
||||||
}
|
|
||||||
|
|
||||||
return !c.Properties.Gcc
|
return !c.Properties.Gcc
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -57,7 +57,6 @@ type Toolchain interface {
|
||||||
IncludeFlags() string
|
IncludeFlags() string
|
||||||
InstructionSetFlags(string) (string, error)
|
InstructionSetFlags(string) (string, error)
|
||||||
|
|
||||||
ClangSupported() bool
|
|
||||||
ClangTriple() string
|
ClangTriple() string
|
||||||
ToolchainClangCflags() string
|
ToolchainClangCflags() string
|
||||||
ToolchainClangLdflags() string
|
ToolchainClangLdflags() string
|
||||||
|
@ -132,10 +131,6 @@ func (toolchainBase) ToolchainClangLdflags() string {
|
||||||
return ""
|
return ""
|
||||||
}
|
}
|
||||||
|
|
||||||
func (toolchainBase) ClangSupported() bool {
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
|
|
||||||
func (toolchainBase) ShlibSuffix() string {
|
func (toolchainBase) ShlibSuffix() string {
|
||||||
return ".so"
|
return ".so"
|
||||||
}
|
}
|
||||||
|
|
|
@ -233,10 +233,6 @@ func (t *toolchainWindowsX8664) WindresFlags() string {
|
||||||
return "-F pe-x86-64"
|
return "-F pe-x86-64"
|
||||||
}
|
}
|
||||||
|
|
||||||
func (t *toolchainWindows) ClangSupported() bool {
|
|
||||||
return true
|
|
||||||
}
|
|
||||||
|
|
||||||
func (t *toolchainWindowsX86) ClangTriple() string {
|
func (t *toolchainWindowsX86) ClangTriple() string {
|
||||||
return "i686-windows-gnu"
|
return "i686-windows-gnu"
|
||||||
}
|
}
|
||||||
|
|
120
cc/makevars.go
120
cc/makevars.go
|
@ -136,7 +136,6 @@ func makeVarsProvider(ctx android.MakeVarsContext) {
|
||||||
|
|
||||||
ctx.Strict("DEFAULT_C_STD_VERSION", config.CStdVersion)
|
ctx.Strict("DEFAULT_C_STD_VERSION", config.CStdVersion)
|
||||||
ctx.Strict("DEFAULT_CPP_STD_VERSION", config.CppStdVersion)
|
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_C_STD_VERSION", config.ExperimentalCStdVersion)
|
||||||
ctx.Strict("EXPERIMENTAL_CPP_STD_VERSION", config.ExperimentalCppStdVersion)
|
ctx.Strict("EXPERIMENTAL_CPP_STD_VERSION", config.ExperimentalCppStdVersion)
|
||||||
|
|
||||||
|
@ -217,34 +216,6 @@ func makeVarsToolchain(ctx android.MakeVarsContext, secondPrefix string,
|
||||||
productExtraLdflags += "-static"
|
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())
|
includeFlags, err := ctx.Eval(toolchain.IncludeFlags())
|
||||||
if err != nil {
|
if err != nil {
|
||||||
panic(err)
|
panic(err)
|
||||||
|
@ -267,60 +238,51 @@ func makeVarsToolchain(ctx android.MakeVarsContext, secondPrefix string,
|
||||||
ctx.Strict(makePrefix+"thumb_CFLAGS", flags)
|
ctx.Strict(makePrefix+"thumb_CFLAGS", flags)
|
||||||
}
|
}
|
||||||
|
|
||||||
if toolchain.ClangSupported() {
|
clangPrefix := secondPrefix + "CLANG_" + typePrefix
|
||||||
clangPrefix := secondPrefix + "CLANG_" + typePrefix
|
clangExtras := "-target " + toolchain.ClangTriple()
|
||||||
clangExtras := "-target " + toolchain.ClangTriple()
|
clangExtras += " -B" + config.ToolPath(toolchain)
|
||||||
clangExtras += " -B" + config.ToolPath(toolchain)
|
|
||||||
|
|
||||||
ctx.Strict(clangPrefix+"GLOBAL_CFLAGS", strings.Join([]string{
|
ctx.Strict(clangPrefix+"GLOBAL_CFLAGS", strings.Join([]string{
|
||||||
toolchain.ClangCflags(),
|
toolchain.ClangCflags(),
|
||||||
"${config.CommonClangGlobalCflags}",
|
"${config.CommonClangGlobalCflags}",
|
||||||
fmt.Sprintf("${config.%sClangGlobalCflags}", hod),
|
fmt.Sprintf("${config.%sClangGlobalCflags}", hod),
|
||||||
toolchain.ToolchainClangCflags(),
|
toolchain.ToolchainClangCflags(),
|
||||||
clangExtras,
|
clangExtras,
|
||||||
productExtraCflags,
|
productExtraCflags,
|
||||||
}, " "))
|
}, " "))
|
||||||
ctx.Strict(clangPrefix+"GLOBAL_CPPFLAGS", strings.Join([]string{
|
ctx.Strict(clangPrefix+"GLOBAL_CPPFLAGS", strings.Join([]string{
|
||||||
"${config.CommonClangGlobalCppflags}",
|
"${config.CommonClangGlobalCppflags}",
|
||||||
fmt.Sprintf("${config.%sGlobalCppflags}", hod),
|
fmt.Sprintf("${config.%sGlobalCppflags}", hod),
|
||||||
toolchain.ClangCppflags(),
|
toolchain.ClangCppflags(),
|
||||||
}, " "))
|
}, " "))
|
||||||
ctx.Strict(clangPrefix+"GLOBAL_LDFLAGS", strings.Join([]string{
|
ctx.Strict(clangPrefix+"GLOBAL_LDFLAGS", strings.Join([]string{
|
||||||
fmt.Sprintf("${config.%sGlobalLdflags}", hod),
|
fmt.Sprintf("${config.%sGlobalLdflags}", hod),
|
||||||
toolchain.ClangLdflags(),
|
toolchain.ClangLdflags(),
|
||||||
toolchain.ToolchainClangLdflags(),
|
toolchain.ToolchainClangLdflags(),
|
||||||
productExtraLdflags,
|
productExtraLdflags,
|
||||||
clangExtras,
|
clangExtras,
|
||||||
}, " "))
|
}, " "))
|
||||||
ctx.Strict(clangPrefix+"GLOBAL_LLDFLAGS", strings.Join([]string{
|
ctx.Strict(clangPrefix+"GLOBAL_LLDFLAGS", strings.Join([]string{
|
||||||
fmt.Sprintf("${config.%sGlobalLldflags}", hod),
|
fmt.Sprintf("${config.%sGlobalLldflags}", hod),
|
||||||
toolchain.ClangLldflags(),
|
toolchain.ClangLldflags(),
|
||||||
toolchain.ToolchainClangLdflags(),
|
toolchain.ToolchainClangLdflags(),
|
||||||
productExtraLdflags,
|
productExtraLdflags,
|
||||||
clangExtras,
|
clangExtras,
|
||||||
}, " "))
|
}, " "))
|
||||||
|
|
||||||
if target.Os.Class == android.Device {
|
if target.Os.Class == android.Device {
|
||||||
ctx.Strict(secondPrefix+"ADDRESS_SANITIZER_RUNTIME_LIBRARY", strings.TrimSuffix(config.AddressSanitizerRuntimeLibrary(toolchain), ".so"))
|
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_RUNTIME_LIBRARY", strings.TrimSuffix(config.HWAddressSanitizerRuntimeLibrary(toolchain), ".so"))
|
||||||
ctx.Strict(secondPrefix+"HWADDRESS_SANITIZER_STATIC_LIBRARY", strings.TrimSuffix(config.HWAddressSanitizerStaticLibrary(toolchain), ".a"))
|
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_RUNTIME_LIBRARY", strings.TrimSuffix(config.UndefinedBehaviorSanitizerRuntimeLibrary(toolchain), ".so"))
|
||||||
ctx.Strict(secondPrefix+"UBSAN_MINIMAL_RUNTIME_LIBRARY", strings.TrimSuffix(config.UndefinedBehaviorSanitizerMinimalRuntimeLibrary(toolchain), ".a"))
|
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+"TSAN_RUNTIME_LIBRARY", strings.TrimSuffix(config.ThreadSanitizerRuntimeLibrary(toolchain), ".so"))
|
||||||
ctx.Strict(secondPrefix+"SCUDO_RUNTIME_LIBRARY", strings.TrimSuffix(config.ScudoRuntimeLibrary(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", "")
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ctx.Strict(makePrefix+"CC", gccCmd(toolchain, "gcc"))
|
// This is used by external/gentoo/...
|
||||||
ctx.Strict(makePrefix+"CXX", gccCmd(toolchain, "g++"))
|
ctx.Strict("CLANG_CONFIG_"+target.Arch.ArchType.Name+"_"+typePrefix+"TRIPLE",
|
||||||
|
toolchain.ClangTriple())
|
||||||
|
|
||||||
if target.Os == android.Darwin {
|
if target.Os == android.Darwin {
|
||||||
ctx.Strict(makePrefix+"AR", "${config.MacArPath}")
|
ctx.Strict(makePrefix+"AR", "${config.MacArPath}")
|
||||||
|
|
Loading…
Reference in New Issue