Remove GCC-specific toolchain methods

Test: m
Change-Id: I06442347ade2d60bc42131b3126ecc17840c9e31
This commit is contained in:
Dan Willemsen 2018-10-07 21:06:36 -07:00
parent 6afcd9aab9
commit bd4abf5dfc
12 changed files with 14 additions and 358 deletions

View File

@ -48,7 +48,7 @@ var (
arm64Cppflags = []string{}
arm64CpuVariantCflags = map[string][]string{
arm64ClangCpuVariantCflags = map[string][]string{
"cortex-a53": []string{
"-mcpu=cortex-a53",
},
@ -61,9 +61,7 @@ var (
"-mcpu=cortex-a55",
},
"kryo": []string{
// Use the cortex-a57 cpu since some compilers
// don't support a Kryo specific target yet.
"-mcpu=cortex-a57",
"-mcpu=kryo",
},
"exynos-m1": []string{
"-mcpu=exynos-m1",
@ -72,8 +70,6 @@ var (
"-mcpu=exynos-m2",
},
}
arm64ClangCpuVariantCflags = copyVariantFlags(arm64CpuVariantCflags)
)
const (
@ -94,18 +90,13 @@ func init() {
"exynos-m2",
"denver64")
// Clang supports specific Kryo targeting
replaceFirst(arm64ClangCpuVariantCflags["kryo"], "-mcpu=cortex-a57", "-mcpu=kryo")
pctx.StaticVariable("arm64GccVersion", arm64GccVersion)
pctx.SourcePathVariable("Arm64GccRoot",
"prebuilts/gcc/${HostPrebuiltTag}/aarch64/aarch64-linux-android-${arm64GccVersion}")
pctx.StaticVariable("Arm64Cflags", strings.Join(arm64Cflags, " "))
pctx.StaticVariable("Arm64Ldflags", strings.Join(arm64Ldflags, " "))
pctx.StaticVariable("Arm64Lldflags", strings.Join(arm64Lldflags, " "))
pctx.StaticVariable("Arm64Cppflags", strings.Join(arm64Cppflags, " "))
pctx.StaticVariable("Arm64IncludeFlags", bionicHeaders("arm64"))
pctx.StaticVariable("Arm64ClangCflags", strings.Join(ClangFilterUnknownCflags(arm64Cflags), " "))
@ -116,45 +107,23 @@ func init() {
pctx.StaticVariable("Arm64ClangArmv8ACflags", strings.Join(arm64ArchVariantCflags["armv8-a"], " "))
pctx.StaticVariable("Arm64ClangArmv82ACflags", strings.Join(arm64ArchVariantCflags["armv8-2a"], " "))
pctx.StaticVariable("Arm64CortexA53Cflags",
strings.Join(arm64CpuVariantCflags["cortex-a53"], " "))
pctx.StaticVariable("Arm64ClangCortexA53Cflags",
strings.Join(arm64ClangCpuVariantCflags["cortex-a53"], " "))
pctx.StaticVariable("Arm64CortexA55Cflags",
strings.Join(arm64CpuVariantCflags["cortex-a55"], " "))
pctx.StaticVariable("Arm64ClangCortexA55Cflags",
strings.Join(arm64ClangCpuVariantCflags["cortex-a55"], " "))
pctx.StaticVariable("Arm64KryoCflags",
strings.Join(arm64CpuVariantCflags["kryo"], " "))
pctx.StaticVariable("Arm64ClangKryoCflags",
strings.Join(arm64ClangCpuVariantCflags["kryo"], " "))
pctx.StaticVariable("Arm64ExynosM1Cflags",
strings.Join(arm64CpuVariantCflags["cortex-a53"], " "))
pctx.StaticVariable("Arm64ClangExynosM1Cflags",
strings.Join(arm64ClangCpuVariantCflags["exynos-m1"], " "))
pctx.StaticVariable("Arm64ExynosM2Cflags",
strings.Join(arm64CpuVariantCflags["cortex-a53"], " "))
pctx.StaticVariable("Arm64ClangExynosM2Cflags",
strings.Join(arm64ClangCpuVariantCflags["exynos-m2"], " "))
}
var (
arm64CpuVariantCflagsVar = map[string]string{
"": "",
"cortex-a53": "${config.Arm64CortexA53Cflags}",
"cortex-a55": "${config.Arm64CortexA55Cflags}",
"cortex-a72": "${config.Arm64CortexA53Cflags}",
"cortex-a73": "${config.Arm64CortexA53Cflags}",
"cortex-a75": "${config.Arm64CortexA55Cflags}",
"kryo": "${config.Arm64KryoCflags}",
"exynos-m1": "${config.Arm64ExynosM1Cflags}",
"exynos-m2": "${config.Arm64ExynosM2Cflags}",
}
arm64ClangArchVariantCflagsVar = map[string]string{
"armv8-a": "${config.Arm64ClangArmv8ACflags}",
"armv8-2a": "${config.Arm64ClangArmv82ACflags}",
@ -178,7 +147,6 @@ type toolchainArm64 struct {
ldflags string
lldflags string
toolchainCflags string
toolchainClangCflags string
}
@ -198,22 +166,6 @@ func (t *toolchainArm64) GccVersion() string {
return arm64GccVersion
}
func (t *toolchainArm64) ToolchainCflags() string {
return t.toolchainCflags
}
func (t *toolchainArm64) Cflags() string {
return "${config.Arm64Cflags}"
}
func (t *toolchainArm64) Cppflags() string {
return "${config.Arm64Cppflags}"
}
func (t *toolchainArm64) Ldflags() string {
return t.ldflags
}
func (t *toolchainArm64) IncludeFlags() string {
return "${config.Arm64IncludeFlags}"
}
@ -277,7 +229,6 @@ func arm64ToolchainFactory(arch android.Arch) Toolchain {
"${config.Arm64Lldflags}",
extraLdflags,
}, " "),
toolchainCflags: variantOrDefault(arm64CpuVariantCflagsVar, arch.CpuVariant),
toolchainClangCflags: strings.Join(toolchainClangCflags, " "),
}
}

View File

@ -50,7 +50,7 @@ var (
"-Os",
}
armArchVariantCflags = map[string][]string{
armClangArchVariantCflags = map[string][]string{
"armv7-a": []string{
"-march=armv7-a",
"-mfloat-abi=softfp",
@ -68,7 +68,7 @@ var (
},
}
armCpuVariantCflags = map[string][]string{
armClangCpuVariantCflags = map[string][]string{
"cortex-a7": []string{
"-mcpu=cortex-a7",
"-mfpu=neon-vfpv4",
@ -118,7 +118,7 @@ var (
"-D__ARM_FEATURE_LPAE=1",
},
"krait": []string{
"-mcpu=cortex-a15",
"-mcpu=krait",
"-mfpu=neon-vfpv4",
// Fake an ARM compiler flag as these processors support LPAE which GCC/clang
// don't advertise.
@ -138,9 +138,6 @@ var (
"-D__ARM_FEATURE_LPAE=1",
},
}
armClangCpuVariantCflags = copyVariantFlags(armCpuVariantCflags)
armClangArchVariantCflags = copyVariantFlags(armArchVariantCflags)
)
const (
@ -174,49 +171,15 @@ func init() {
android.RegisterArchVariantFeatures(android.Arm, "armv7-a-neon", "neon")
android.RegisterArchVariantFeatures(android.Arm, "armv8-a", "neon")
// Krait is not supported by GCC, but is supported by Clang, so
// override the definitions when building modules with Clang.
replaceFirst(armClangCpuVariantCflags["krait"], "-mcpu=cortex-a15", "-mcpu=krait")
// The reason we use "-march=armv8-a+crc", instead of "-march=armv8-a", for
// gcc is the latter would conflict with any specified/supported -mcpu!
// All armv8-a cores supported by gcc 4.9 support crc, so it's safe
// to add +crc. Besides, the use of gcc is only for legacy code.
replaceFirst(armArchVariantCflags["armv8-a"], "-march=armv8-a", "-march=armv8-a+crc")
pctx.StaticVariable("armGccVersion", armGccVersion)
pctx.SourcePathVariable("ArmGccRoot",
"prebuilts/gcc/${HostPrebuiltTag}/arm/arm-linux-androideabi-${armGccVersion}")
pctx.StaticVariable("ArmToolchainCflags", strings.Join(armToolchainCflags, " "))
pctx.StaticVariable("ArmCflags", strings.Join(armCflags, " "))
pctx.StaticVariable("ArmLdflags", strings.Join(armLdflags, " "))
pctx.StaticVariable("ArmLldflags", strings.Join(armLldflags, " "))
pctx.StaticVariable("ArmCppflags", strings.Join(armCppflags, " "))
pctx.StaticVariable("ArmIncludeFlags", bionicHeaders("arm"))
// Extended cflags
// ARM vs. Thumb instruction set flags
pctx.StaticVariable("ArmArmCflags", strings.Join(armArmCflags, " "))
pctx.StaticVariable("ArmThumbCflags", strings.Join(armThumbCflags, " "))
// Architecture variant cflags
pctx.StaticVariable("ArmArmv7ACflags", strings.Join(armArchVariantCflags["armv7-a"], " "))
pctx.StaticVariable("ArmArmv7ANeonCflags", strings.Join(armArchVariantCflags["armv7-a-neon"], " "))
pctx.StaticVariable("ArmArmv8ACflags", strings.Join(armArchVariantCflags["armv8-a"], " "))
// Cpu variant cflags
pctx.StaticVariable("ArmGenericCflags", strings.Join(armCpuVariantCflags[""], " "))
pctx.StaticVariable("ArmCortexA7Cflags", strings.Join(armCpuVariantCflags["cortex-a7"], " "))
pctx.StaticVariable("ArmCortexA8Cflags", strings.Join(armCpuVariantCflags["cortex-a8"], " "))
pctx.StaticVariable("ArmCortexA15Cflags", strings.Join(armCpuVariantCflags["cortex-a15"], " "))
pctx.StaticVariable("ArmCortexA53Cflags", strings.Join(armCpuVariantCflags["cortex-a53"], " "))
pctx.StaticVariable("ArmCortexA55Cflags", strings.Join(armCpuVariantCflags["cortex-a55"], " "))
pctx.StaticVariable("ArmKraitCflags", strings.Join(armCpuVariantCflags["krait"], " "))
pctx.StaticVariable("ArmKryoCflags", strings.Join(armCpuVariantCflags["kryo"], " "))
// Clang cflags
pctx.StaticVariable("ArmToolchainClangCflags", strings.Join(ClangFilterUnknownCflags(armToolchainCflags), " "))
pctx.StaticVariable("ArmClangCflags", strings.Join(ClangFilterUnknownCflags(armCflags), " "))
@ -256,30 +219,6 @@ func init() {
}
var (
armArchVariantCflagsVar = map[string]string{
"armv7-a": "${config.ArmArmv7ACflags}",
"armv7-a-neon": "${config.ArmArmv7ANeonCflags}",
"armv8-a": "${config.ArmArmv8ACflags}",
}
armCpuVariantCflagsVar = map[string]string{
"": "${config.ArmGenericCflags}",
"cortex-a7": "${config.ArmCortexA7Cflags}",
"cortex-a8": "${config.ArmCortexA8Cflags}",
"cortex-a15": "${config.ArmCortexA15Cflags}",
"cortex-a53": "${config.ArmCortexA53Cflags}",
"cortex-a53.a57": "${config.ArmCortexA53Cflags}",
"cortex-a55": "${config.ArmCortexA55Cflags}",
"cortex-a72": "${config.ArmCortexA53Cflags}",
"cortex-a73": "${config.ArmCortexA53Cflags}",
"cortex-a75": "${config.ArmCortexA55Cflags}",
"krait": "${config.ArmKraitCflags}",
"kryo": "${config.ArmKryoCflags}",
"exynos-m1": "${config.ArmCortexA53Cflags}",
"exynos-m2": "${config.ArmCortexA53Cflags}",
"denver": "${config.ArmCortexA15Cflags}",
}
armClangArchVariantCflagsVar = map[string]string{
"armv7-a": "${config.ArmClangArmv7ACflags}",
"armv7-a-neon": "${config.ArmClangArmv7ANeonCflags}",
@ -307,9 +246,9 @@ var (
type toolchainArm struct {
toolchain32Bit
ldflags string
lldflags string
toolchainCflags, toolchainClangCflags string
ldflags string
lldflags string
toolchainClangCflags string
}
func (t *toolchainArm) Name() string {
@ -328,22 +267,6 @@ func (t *toolchainArm) GccVersion() string {
return armGccVersion
}
func (t *toolchainArm) ToolchainCflags() string {
return t.toolchainCflags
}
func (t *toolchainArm) Cflags() string {
return "${config.ArmCflags}"
}
func (t *toolchainArm) Cppflags() string {
return "${config.ArmCppflags}"
}
func (t *toolchainArm) Ldflags() string {
return t.ldflags
}
func (t *toolchainArm) IncludeFlags() string {
return "${config.ArmIncludeFlags}"
}
@ -395,16 +318,11 @@ func (toolchainArm) LibclangRuntimeLibraryArch() string {
func armToolchainFactory(arch android.Arch) Toolchain {
var fixCortexA8 string
toolchainCflags := make([]string, 2, 3)
toolchainClangCflags := make([]string, 2, 3)
toolchainCflags[0] = "${config.ArmToolchainCflags}"
toolchainCflags[1] = armArchVariantCflagsVar[arch.ArchVariant]
toolchainClangCflags[0] = "${config.ArmToolchainClangCflags}"
toolchainClangCflags[1] = armClangArchVariantCflagsVar[arch.ArchVariant]
toolchainCflags = append(toolchainCflags,
variantOrDefault(armCpuVariantCflagsVar, arch.CpuVariant))
toolchainClangCflags = append(toolchainClangCflags,
variantOrDefault(armClangCpuVariantCflagsVar, arch.CpuVariant))
@ -426,7 +344,6 @@ func armToolchainFactory(arch android.Arch) Toolchain {
}
return &toolchainArm{
toolchainCflags: strings.Join(toolchainCflags, " "),
ldflags: strings.Join([]string{
"${config.ArmLdflags}",
fixCortexA8,

View File

@ -15,7 +15,6 @@
package config
import (
"fmt"
"runtime"
"strings"
@ -250,10 +249,3 @@ func bionicHeaders(kernelArch string) string {
"-isystem bionic/libc/kernel/android/uapi",
}, " ")
}
func replaceFirst(slice []string, from, to string) {
if slice[0] != from {
panic(fmt.Errorf("Expected %q, found %q", from, to))
}
slice[0] = to
}

View File

@ -69,9 +69,6 @@ func init() {
pctx.SourcePathVariable("Mips64GccRoot",
"prebuilts/gcc/${HostPrebuiltTag}/mips/mips64el-linux-android-${mips64GccVersion}")
pctx.StaticVariable("Mips64Cflags", strings.Join(mips64Cflags, " "))
pctx.StaticVariable("Mips64Ldflags", strings.Join(mips64Ldflags, " "))
pctx.StaticVariable("Mips64Cppflags", strings.Join(mips64Cppflags, " "))
pctx.StaticVariable("Mips64IncludeFlags", bionicHeaders("mips"))
// Clang cflags
@ -83,7 +80,6 @@ func init() {
// Architecture variant cflags
for variant, cflags := range mips64ArchVariantCflags {
pctx.StaticVariable("Mips64"+variant+"VariantCflags", strings.Join(cflags, " "))
pctx.StaticVariable("Mips64"+variant+"VariantClangCflags",
strings.Join(ClangFilterUnknownCflags(cflags), " "))
}
@ -91,8 +87,8 @@ func init() {
type toolchainMips64 struct {
toolchain64Bit
cflags, clangCflags string
toolchainCflags, toolchainClangCflags string
clangCflags string
toolchainClangCflags string
}
func (t *toolchainMips64) Name() string {
@ -111,22 +107,6 @@ func (t *toolchainMips64) GccVersion() string {
return mips64GccVersion
}
func (t *toolchainMips64) ToolchainCflags() string {
return t.toolchainCflags
}
func (t *toolchainMips64) Cflags() string {
return t.cflags
}
func (t *toolchainMips64) Cppflags() string {
return "${config.Mips64Cppflags}"
}
func (t *toolchainMips64) Ldflags() string {
return "${config.Mips64Ldflags}"
}
func (t *toolchainMips64) IncludeFlags() string {
return "${config.Mips64IncludeFlags}"
}
@ -166,9 +146,7 @@ func (toolchainMips64) LibclangRuntimeLibraryArch() string {
func mips64ToolchainFactory(arch android.Arch) Toolchain {
return &toolchainMips64{
cflags: "${config.Mips64Cflags}",
clangCflags: "${config.Mips64ClangCflags}",
toolchainCflags: "${config.Mips64" + arch.ArchVariant + "VariantCflags}",
toolchainClangCflags: "${config.Mips64" + arch.ArchVariant + "VariantClangCflags}",
}
}

View File

@ -111,9 +111,6 @@ func init() {
"prebuilts/gcc/${HostPrebuiltTag}/mips/mips64el-linux-android-${mipsGccVersion}")
pctx.StaticVariable("MipsToolchainLdflags", strings.Join(mipsToolchainLdflags, " "))
pctx.StaticVariable("MipsCflags", strings.Join(mipsCflags, " "))
pctx.StaticVariable("MipsLdflags", strings.Join(mipsLdflags, " "))
pctx.StaticVariable("MipsCppflags", strings.Join(mipsCppflags, " "))
pctx.StaticVariable("MipsIncludeFlags", bionicHeaders("mips"))
// Clang cflags
@ -125,7 +122,6 @@ func init() {
// Architecture variant cflags
for variant, cflags := range mipsArchVariantCflags {
pctx.StaticVariable("Mips"+variant+"VariantCflags", strings.Join(cflags, " "))
pctx.StaticVariable("Mips"+variant+"VariantClangCflags",
strings.Join(ClangFilterUnknownCflags(cflags), " "))
}
@ -133,8 +129,8 @@ func init() {
type toolchainMips struct {
toolchain32Bit
cflags, clangCflags string
toolchainCflags, toolchainClangCflags string
clangCflags string
toolchainClangCflags string
}
func (t *toolchainMips) Name() string {
@ -153,26 +149,6 @@ func (t *toolchainMips) GccVersion() string {
return mipsGccVersion
}
func (t *toolchainMips) ToolchainLdflags() string {
return "${config.MipsToolchainLdflags}"
}
func (t *toolchainMips) ToolchainCflags() string {
return t.toolchainCflags
}
func (t *toolchainMips) Cflags() string {
return t.cflags
}
func (t *toolchainMips) Cppflags() string {
return "${config.MipsCppflags}"
}
func (t *toolchainMips) Ldflags() string {
return "${config.MipsLdflags}"
}
func (t *toolchainMips) IncludeFlags() string {
return "${config.MipsIncludeFlags}"
}
@ -216,9 +192,7 @@ func (toolchainMips) LibclangRuntimeLibraryArch() string {
func mipsToolchainFactory(arch android.Arch) Toolchain {
return &toolchainMips{
cflags: "${config.MipsCflags}",
clangCflags: "${config.MipsClangCflags}",
toolchainCflags: "${config.Mips" + arch.ArchVariant + "VariantCflags}",
toolchainClangCflags: "${config.Mips" + arch.ArchVariant + "VariantClangCflags}",
}
}

View File

@ -162,18 +162,6 @@ func (toolchain32Bit) Is64Bit() bool {
return false
}
func copyVariantFlags(m map[string][]string) map[string][]string {
ret := make(map[string][]string, len(m))
for k, v := range m {
l := make([]string, len(m[k]))
for i := range m[k] {
l[i] = v[i]
}
ret[k] = l
}
return ret
}
func variantOrDefault(variants map[string]string, choice string) string {
if ret, ok := variants[choice]; ok {
return ret

View File

@ -125,10 +125,8 @@ func init() {
pctx.StaticVariable("X86_64ToolchainCflags", "-m64")
pctx.StaticVariable("X86_64ToolchainLdflags", "-m64")
pctx.StaticVariable("X86_64Cflags", strings.Join(x86_64Cflags, " "))
pctx.StaticVariable("X86_64Ldflags", strings.Join(x86_64Ldflags, " "))
pctx.StaticVariable("X86_64Lldflags", strings.Join(x86_64Lldflags, " "))
pctx.StaticVariable("X86_64Cppflags", strings.Join(x86_64Cppflags, " "))
pctx.StaticVariable("X86_64IncludeFlags", bionicHeaders("x86"))
// Clang cflags
@ -144,7 +142,6 @@ func init() {
// Architecture variant cflags
for variant, cflags := range x86_64ArchVariantCflags {
pctx.StaticVariable("X86_64"+variant+"VariantCflags", strings.Join(cflags, " "))
pctx.StaticVariable("X86_64"+variant+"VariantClangCflags",
strings.Join(ClangFilterUnknownCflags(cflags), " "))
}
@ -152,7 +149,7 @@ func init() {
type toolchainX86_64 struct {
toolchain64Bit
toolchainCflags, toolchainClangCflags string
toolchainClangCflags string
}
func (t *toolchainX86_64) Name() string {
@ -171,26 +168,6 @@ func (t *toolchainX86_64) GccVersion() string {
return x86_64GccVersion
}
func (t *toolchainX86_64) ToolchainLdflags() string {
return "${config.X86_64ToolchainLdflags}"
}
func (t *toolchainX86_64) ToolchainCflags() string {
return t.toolchainCflags
}
func (t *toolchainX86_64) Cflags() string {
return "${config.X86_64Cflags}"
}
func (t *toolchainX86_64) Cppflags() string {
return "${config.X86_64Cppflags}"
}
func (t *toolchainX86_64) Ldflags() string {
return "${config.X86_64Ldflags}"
}
func (t *toolchainX86_64) IncludeFlags() string {
return "${config.X86_64IncludeFlags}"
}
@ -232,23 +209,16 @@ func (toolchainX86_64) LibclangRuntimeLibraryArch() string {
}
func x86_64ToolchainFactory(arch android.Arch) Toolchain {
toolchainCflags := []string{
"${config.X86_64ToolchainCflags}",
"${config.X86_64" + arch.ArchVariant + "VariantCflags}",
}
toolchainClangCflags := []string{
"${config.X86_64ToolchainCflags}",
"${config.X86_64" + arch.ArchVariant + "VariantClangCflags}",
}
for _, feature := range arch.ArchFeatures {
toolchainCflags = append(toolchainCflags, x86_64ArchFeatureCflags[feature]...)
toolchainClangCflags = append(toolchainClangCflags, x86_64ArchFeatureCflags[feature]...)
}
return &toolchainX86_64{
toolchainCflags: strings.Join(toolchainCflags, " "),
toolchainClangCflags: strings.Join(toolchainClangCflags, " "),
}
}

View File

@ -117,9 +117,6 @@ func init() {
pctx.StaticVariable("DarwinGccTriple", "i686-apple-darwin11")
pctx.StaticVariable("DarwinCflags", strings.Join(darwinCflags, " "))
pctx.StaticVariable("DarwinLdflags", strings.Join(darwinLdflags, " "))
pctx.StaticVariable("DarwinClangCflags", strings.Join(darwinClangCflags, " "))
pctx.StaticVariable("DarwinClangLdflags", strings.Join(darwinClangLdflags, " "))
pctx.StaticVariable("DarwinClangLldflags", strings.Join(darwinClangLldflags, " "))
@ -182,18 +179,6 @@ func (t *toolchainDarwin) GccVersion() string {
return darwinGccVersion
}
func (t *toolchainDarwin) Cflags() string {
return "${config.DarwinCflags}"
}
func (t *toolchainDarwin) Cppflags() string {
return ""
}
func (t *toolchainDarwin) Ldflags() string {
return "${config.DarwinLdflags}"
}
func (t *toolchainDarwin) IncludeFlags() string {
return ""
}

View File

@ -149,10 +149,8 @@ func init() {
pctx.StaticVariable("X86ToolchainCflags", "-m32")
pctx.StaticVariable("X86ToolchainLdflags", "-m32")
pctx.StaticVariable("X86Cflags", strings.Join(x86Cflags, " "))
pctx.StaticVariable("X86Ldflags", strings.Join(x86Ldflags, " "))
pctx.StaticVariable("X86Lldflags", strings.Join(x86Lldflags, " "))
pctx.StaticVariable("X86Cppflags", strings.Join(x86Cppflags, " "))
pctx.StaticVariable("X86IncludeFlags", bionicHeaders("x86"))
// Clang cflags
@ -168,7 +166,6 @@ func init() {
// Architecture variant cflags
for variant, cflags := range x86ArchVariantCflags {
pctx.StaticVariable("X86"+variant+"VariantCflags", strings.Join(cflags, " "))
pctx.StaticVariable("X86"+variant+"VariantClangCflags",
strings.Join(ClangFilterUnknownCflags(cflags), " "))
}
@ -176,7 +173,7 @@ func init() {
type toolchainX86 struct {
toolchain32Bit
toolchainCflags, toolchainClangCflags string
toolchainClangCflags string
}
func (t *toolchainX86) Name() string {
@ -195,26 +192,6 @@ func (t *toolchainX86) GccVersion() string {
return x86GccVersion
}
func (t *toolchainX86) ToolchainLdflags() string {
return "${config.X86ToolchainLdflags}"
}
func (t *toolchainX86) ToolchainCflags() string {
return t.toolchainCflags
}
func (t *toolchainX86) Cflags() string {
return "${config.X86Cflags}"
}
func (t *toolchainX86) Cppflags() string {
return "${config.X86Cppflags}"
}
func (t *toolchainX86) Ldflags() string {
return "${config.X86Ldflags}"
}
func (t *toolchainX86) IncludeFlags() string {
return "${config.X86IncludeFlags}"
}
@ -256,23 +233,16 @@ func (toolchainX86) LibclangRuntimeLibraryArch() string {
}
func x86ToolchainFactory(arch android.Arch) Toolchain {
toolchainCflags := []string{
"${config.X86ToolchainCflags}",
"${config.X86" + arch.ArchVariant + "VariantCflags}",
}
toolchainClangCflags := []string{
"${config.X86ToolchainCflags}",
"${config.X86" + arch.ArchVariant + "VariantClangCflags}",
}
for _, feature := range arch.ArchFeatures {
toolchainCflags = append(toolchainCflags, x86ArchFeatureCflags[feature]...)
toolchainClangCflags = append(toolchainClangCflags, x86ArchFeatureCflags[feature]...)
}
return &toolchainX86{
toolchainCflags: strings.Join(toolchainCflags, " "),
toolchainClangCflags: strings.Join(toolchainClangCflags, " "),
}
}

View File

@ -96,18 +96,6 @@ func (t *toolchainLinuxBionic) GccVersion() string {
return "4.9"
}
func (t *toolchainLinuxBionic) Cflags() string {
return ""
}
func (t *toolchainLinuxBionic) Cppflags() string {
return ""
}
func (t *toolchainLinuxBionic) Ldflags() string {
return ""
}
func (t *toolchainLinuxBionic) IncludeFlags() string {
return "${config.LinuxBionicIncludeFlags}"
}

View File

@ -122,19 +122,10 @@ func init() {
pctx.StaticVariable("LinuxGccTriple", "x86_64-linux")
pctx.StaticVariable("LinuxCflags", strings.Join(linuxCflags, " "))
pctx.StaticVariable("LinuxLdflags", strings.Join(linuxLdflags, " "))
pctx.StaticVariable("LinuxClangCflags", strings.Join(linuxClangCflags, " "))
pctx.StaticVariable("LinuxClangLdflags", strings.Join(linuxClangLdflags, " "))
pctx.StaticVariable("LinuxClangLldflags", strings.Join(linuxClangLldflags, " "))
// Extended cflags
pctx.StaticVariable("LinuxX86Cflags", strings.Join(linuxX86Cflags, " "))
pctx.StaticVariable("LinuxX8664Cflags", strings.Join(linuxX8664Cflags, " "))
pctx.StaticVariable("LinuxX86Ldflags", strings.Join(linuxX86Ldflags, " "))
pctx.StaticVariable("LinuxX8664Ldflags", strings.Join(linuxX8664Ldflags, " "))
pctx.StaticVariable("LinuxX86ClangCflags",
strings.Join(ClangFilterUnknownCflags(linuxX86Cflags), " "))
pctx.StaticVariable("LinuxX8664ClangCflags",
@ -182,26 +173,6 @@ func (t *toolchainLinux) GccVersion() string {
return linuxGccVersion
}
func (t *toolchainLinuxX86) Cflags() string {
return "${config.LinuxCflags} ${config.LinuxX86Cflags}"
}
func (t *toolchainLinuxX8664) Cflags() string {
return "${config.LinuxCflags} ${config.LinuxX8664Cflags}"
}
func (t *toolchainLinux) Cppflags() string {
return ""
}
func (t *toolchainLinuxX86) Ldflags() string {
return "${config.LinuxLdflags} ${config.LinuxX86Ldflags}"
}
func (t *toolchainLinuxX8664) Ldflags() string {
return "${config.LinuxLdflags} ${config.LinuxX8664Ldflags}"
}
func (t *toolchainLinux) IncludeFlags() string {
return ""
}

View File

@ -137,19 +137,11 @@ func init() {
pctx.StaticVariable("WindowsGccTriple", "x86_64-w64-mingw32")
pctx.StaticVariable("WindowsCflags", strings.Join(windowsCflags, " "))
pctx.StaticVariable("WindowsLdflags", strings.Join(windowsLdflags, " "))
pctx.StaticVariable("WindowsClangCflags", strings.Join(windowsClangCflags, " "))
pctx.StaticVariable("WindowsClangLdflags", strings.Join(windowsClangLdflags, " "))
pctx.StaticVariable("WindowsClangLldflags", strings.Join(windowsClangLldflags, " "))
pctx.StaticVariable("WindowsClangCppflags", strings.Join(windowsClangCppflags, " "))
pctx.StaticVariable("WindowsX86Cflags", strings.Join(windowsX86Cflags, " "))
pctx.StaticVariable("WindowsX8664Cflags", strings.Join(windowsX8664Cflags, " "))
pctx.StaticVariable("WindowsX86Ldflags", strings.Join(windowsX86Ldflags, " "))
pctx.StaticVariable("WindowsX8664Ldflags", strings.Join(windowsX8664Ldflags, " "))
pctx.StaticVariable("WindowsX86ClangCflags",
strings.Join(ClangFilterUnknownCflags(windowsX86Cflags), " "))
pctx.StaticVariable("WindowsX8664ClangCflags",
@ -198,26 +190,6 @@ func (t *toolchainWindows) GccVersion() string {
return windowsGccVersion
}
func (t *toolchainWindowsX86) Cflags() string {
return "${config.WindowsCflags} ${config.WindowsX86Cflags}"
}
func (t *toolchainWindowsX8664) Cflags() string {
return "${config.WindowsCflags} ${config.WindowsX8664Cflags}"
}
func (t *toolchainWindows) Cppflags() string {
return ""
}
func (t *toolchainWindowsX86) Ldflags() string {
return "${config.WindowsLdflags} ${config.WindowsX86Ldflags}"
}
func (t *toolchainWindowsX8664) Ldflags() string {
return "${config.WindowsLdflags} ${config.WindowsX8664Ldflags}"
}
func (t *toolchainWindows) IncludeFlags() string {
return "${config.WindowsIncludeFlags}"
}