Merge "Rename ninja variables with Clang in the name"
This commit is contained in:
commit
51736b82fc
18 changed files with 163 additions and 164 deletions
|
@ -500,10 +500,10 @@ func transformSourceToObj(ctx android.ModuleContext, subdir string, srcFiles and
|
|||
sAbiDumpFiles = make(android.Paths, 0, len(srcFiles))
|
||||
}
|
||||
|
||||
cflags += " ${config.NoOverrideClangGlobalCflags}"
|
||||
toolingCflags += " ${config.NoOverrideClangGlobalCflags}"
|
||||
cppflags += " ${config.NoOverrideClangGlobalCflags}"
|
||||
toolingCppflags += " ${config.NoOverrideClangGlobalCflags}"
|
||||
cflags += " ${config.NoOverrideGlobalCflags}"
|
||||
toolingCflags += " ${config.NoOverrideGlobalCflags}"
|
||||
cppflags += " ${config.NoOverrideGlobalCflags}"
|
||||
toolingCppflags += " ${config.NoOverrideGlobalCflags}"
|
||||
|
||||
for i, srcFile := range srcFiles {
|
||||
objFile := android.ObjPathWithExt(ctx, subdir, srcFile, "o")
|
||||
|
|
|
@ -4038,14 +4038,14 @@ func TestIncludeDirectoryOrdering(t *testing.T) {
|
|||
}
|
||||
|
||||
want := []string{
|
||||
"${config.ArmClangThumbCflags}",
|
||||
"${config.ArmClangCflags}",
|
||||
"${config.CommonClangGlobalCflags}",
|
||||
"${config.DeviceClangGlobalCflags}",
|
||||
"${config.ClangExternalCflags}",
|
||||
"${config.ArmToolchainClangCflags}",
|
||||
"${config.ArmClangArmv7ANeonCflags}",
|
||||
"${config.ArmClangGenericCflags}",
|
||||
"${config.ArmThumbCflags}",
|
||||
"${config.ArmCflags}",
|
||||
"${config.CommonGlobalCflags}",
|
||||
"${config.DeviceGlobalCflags}",
|
||||
"${config.ExternalCflags}",
|
||||
"${config.ArmToolchainCflags}",
|
||||
"${config.ArmArmv7ANeonCflags}",
|
||||
"${config.ArmGenericCflags}",
|
||||
"android_arm_export_include_dirs",
|
||||
"lib32_export_include_dirs",
|
||||
"arm_export_include_dirs",
|
||||
|
@ -4076,7 +4076,7 @@ func TestIncludeDirectoryOrdering(t *testing.T) {
|
|||
"defaults/cc/common/ndk_libandroid_support",
|
||||
"out/soong/ndk/sysroot/usr/include",
|
||||
"out/soong/ndk/sysroot/usr/include/arm-linux-androideabi",
|
||||
"${config.NoOverrideClangGlobalCflags}",
|
||||
"${config.NoOverrideGlobalCflags}",
|
||||
}
|
||||
|
||||
android.AssertArrayString(t, "includes", want, includes)
|
||||
|
|
|
@ -438,14 +438,14 @@ func (compiler *baseCompiler) compilerFlags(ctx ModuleContext, flags Flags, deps
|
|||
flags.Global.CppFlags = append([]string{fmt.Sprintf("${config.%sGlobalCppflags}", hod)}, flags.Global.CppFlags...)
|
||||
|
||||
flags.Global.AsFlags = append(flags.Global.AsFlags, tc.Asflags())
|
||||
flags.Global.CppFlags = append([]string{"${config.CommonClangGlobalCppflags}"}, flags.Global.CppFlags...)
|
||||
flags.Global.CppFlags = append([]string{"${config.CommonGlobalCppflags}"}, flags.Global.CppFlags...)
|
||||
flags.Global.CommonFlags = append(flags.Global.CommonFlags,
|
||||
tc.Cflags(),
|
||||
"${config.CommonClangGlobalCflags}",
|
||||
fmt.Sprintf("${config.%sClangGlobalCflags}", hod))
|
||||
"${config.CommonGlobalCflags}",
|
||||
fmt.Sprintf("${config.%sGlobalCflags}", hod))
|
||||
|
||||
if isThirdParty(modulePath) {
|
||||
flags.Global.CommonFlags = append(flags.Global.CommonFlags, "${config.ClangExternalCflags}")
|
||||
flags.Global.CommonFlags = append(flags.Global.CommonFlags, "${config.ExternalCflags}")
|
||||
}
|
||||
|
||||
if tc.Bionic() {
|
||||
|
|
|
@ -99,50 +99,50 @@ func init() {
|
|||
pctx.StaticVariable("Arm64Ldflags", strings.Join(arm64Ldflags, " "))
|
||||
pctx.StaticVariable("Arm64Lldflags", strings.Join(arm64Lldflags, " "))
|
||||
|
||||
pctx.StaticVariable("Arm64ClangCflags", strings.Join(arm64Cflags, " "))
|
||||
pctx.StaticVariable("Arm64ClangCppflags", strings.Join(arm64Cppflags, " "))
|
||||
pctx.StaticVariable("Arm64Cflags", strings.Join(arm64Cflags, " "))
|
||||
pctx.StaticVariable("Arm64Cppflags", strings.Join(arm64Cppflags, " "))
|
||||
|
||||
pctx.StaticVariable("Arm64ClangArmv8ACflags", strings.Join(arm64ArchVariantCflags["armv8-a"], " "))
|
||||
pctx.StaticVariable("Arm64ClangArmv8ABranchProtCflags", strings.Join(arm64ArchVariantCflags["armv8-a-branchprot"], " "))
|
||||
pctx.StaticVariable("Arm64ClangArmv82ACflags", strings.Join(arm64ArchVariantCflags["armv8-2a"], " "))
|
||||
pctx.StaticVariable("Arm64ClangArmv82ADotprodCflags", strings.Join(arm64ArchVariantCflags["armv8-2a-dotprod"], " "))
|
||||
pctx.StaticVariable("Arm64Armv8ACflags", strings.Join(arm64ArchVariantCflags["armv8-a"], " "))
|
||||
pctx.StaticVariable("Arm64Armv8ABranchProtCflags", strings.Join(arm64ArchVariantCflags["armv8-a-branchprot"], " "))
|
||||
pctx.StaticVariable("Arm64Armv82ACflags", strings.Join(arm64ArchVariantCflags["armv8-2a"], " "))
|
||||
pctx.StaticVariable("Arm64Armv82ADotprodCflags", strings.Join(arm64ArchVariantCflags["armv8-2a-dotprod"], " "))
|
||||
|
||||
pctx.StaticVariable("Arm64ClangCortexA53Cflags",
|
||||
pctx.StaticVariable("Arm64CortexA53Cflags",
|
||||
strings.Join(arm64CpuVariantCflags["cortex-a53"], " "))
|
||||
|
||||
pctx.StaticVariable("Arm64ClangCortexA55Cflags",
|
||||
pctx.StaticVariable("Arm64CortexA55Cflags",
|
||||
strings.Join(arm64CpuVariantCflags["cortex-a55"], " "))
|
||||
|
||||
pctx.StaticVariable("Arm64ClangKryoCflags",
|
||||
pctx.StaticVariable("Arm64KryoCflags",
|
||||
strings.Join(arm64CpuVariantCflags["kryo"], " "))
|
||||
|
||||
pctx.StaticVariable("Arm64ClangExynosM1Cflags",
|
||||
pctx.StaticVariable("Arm64ExynosM1Cflags",
|
||||
strings.Join(arm64CpuVariantCflags["exynos-m1"], " "))
|
||||
|
||||
pctx.StaticVariable("Arm64ClangExynosM2Cflags",
|
||||
pctx.StaticVariable("Arm64ExynosM2Cflags",
|
||||
strings.Join(arm64CpuVariantCflags["exynos-m2"], " "))
|
||||
}
|
||||
|
||||
var (
|
||||
arm64ArchVariantCflagsVar = map[string]string{
|
||||
"armv8-a": "${config.Arm64ClangArmv8ACflags}",
|
||||
"armv8-a-branchprot": "${config.Arm64ClangArmv8ABranchProtCflags}",
|
||||
"armv8-2a": "${config.Arm64ClangArmv82ACflags}",
|
||||
"armv8-2a-dotprod": "${config.Arm64ClangArmv82ADotprodCflags}",
|
||||
"armv8-a": "${config.Arm64Armv8ACflags}",
|
||||
"armv8-a-branchprot": "${config.Arm64Armv8ABranchProtCflags}",
|
||||
"armv8-2a": "${config.Arm64Armv82ACflags}",
|
||||
"armv8-2a-dotprod": "${config.Arm64Armv82ADotprodCflags}",
|
||||
}
|
||||
|
||||
arm64CpuVariantCflagsVar = map[string]string{
|
||||
"": "",
|
||||
"cortex-a53": "${config.Arm64ClangCortexA53Cflags}",
|
||||
"cortex-a55": "${config.Arm64ClangCortexA55Cflags}",
|
||||
"cortex-a72": "${config.Arm64ClangCortexA53Cflags}",
|
||||
"cortex-a73": "${config.Arm64ClangCortexA53Cflags}",
|
||||
"cortex-a75": "${config.Arm64ClangCortexA55Cflags}",
|
||||
"cortex-a76": "${config.Arm64ClangCortexA55Cflags}",
|
||||
"kryo": "${config.Arm64ClangKryoCflags}",
|
||||
"kryo385": "${config.Arm64ClangCortexA53Cflags}",
|
||||
"exynos-m1": "${config.Arm64ClangExynosM1Cflags}",
|
||||
"exynos-m2": "${config.Arm64ClangExynosM2Cflags}",
|
||||
"cortex-a53": "${config.Arm64CortexA53Cflags}",
|
||||
"cortex-a55": "${config.Arm64CortexA55Cflags}",
|
||||
"cortex-a72": "${config.Arm64CortexA53Cflags}",
|
||||
"cortex-a73": "${config.Arm64CortexA53Cflags}",
|
||||
"cortex-a75": "${config.Arm64CortexA55Cflags}",
|
||||
"cortex-a76": "${config.Arm64CortexA55Cflags}",
|
||||
"kryo": "${config.Arm64KryoCflags}",
|
||||
"kryo385": "${config.Arm64CortexA53Cflags}",
|
||||
"exynos-m1": "${config.Arm64ExynosM1Cflags}",
|
||||
"exynos-m2": "${config.Arm64ExynosM2Cflags}",
|
||||
}
|
||||
)
|
||||
|
||||
|
@ -180,11 +180,11 @@ func (t *toolchainArm64) ClangTriple() string {
|
|||
}
|
||||
|
||||
func (t *toolchainArm64) Cflags() string {
|
||||
return "${config.Arm64ClangCflags}"
|
||||
return "${config.Arm64Cflags}"
|
||||
}
|
||||
|
||||
func (t *toolchainArm64) Cppflags() string {
|
||||
return "${config.Arm64ClangCppflags}"
|
||||
return "${config.Arm64Cppflags}"
|
||||
}
|
||||
|
||||
func (t *toolchainArm64) Ldflags() string {
|
||||
|
|
|
@ -76,7 +76,7 @@ func (toolchainLinuxArm64) ClangTriple() string {
|
|||
|
||||
func (toolchainLinuxArm64) Cflags() string {
|
||||
// The inherited flags + extra flags
|
||||
return "${config.Arm64ClangCflags} ${config.LinuxBionicArm64Cflags}"
|
||||
return "${config.Arm64Cflags} ${config.LinuxBionicArm64Cflags}"
|
||||
}
|
||||
|
||||
func (toolchainLinuxArm64) CrtBeginSharedBinary() []string {
|
||||
|
|
|
@ -180,56 +180,56 @@ func init() {
|
|||
exportStringListStaticVariable("ArmLldflags", armLldflags)
|
||||
|
||||
// Clang cflags
|
||||
exportStringListStaticVariable("ArmToolchainClangCflags", armToolchainCflags)
|
||||
exportStringListStaticVariable("ArmClangCflags", armCflags)
|
||||
exportStringListStaticVariable("ArmClangCppflags", armCppflags)
|
||||
exportStringListStaticVariable("ArmToolchainCflags", armToolchainCflags)
|
||||
exportStringListStaticVariable("ArmCflags", armCflags)
|
||||
exportStringListStaticVariable("ArmCppflags", armCppflags)
|
||||
|
||||
// Clang ARM vs. Thumb instruction set cflags
|
||||
exportStringListStaticVariable("ArmClangArmCflags", armArmCflags)
|
||||
exportStringListStaticVariable("ArmClangThumbCflags", armThumbCflags)
|
||||
exportStringListStaticVariable("ArmArmCflags", armArmCflags)
|
||||
exportStringListStaticVariable("ArmThumbCflags", armThumbCflags)
|
||||
|
||||
// Clang arch variant cflags
|
||||
exportStringListStaticVariable("ArmClangArmv7ACflags", armArchVariantCflags["armv7-a"])
|
||||
exportStringListStaticVariable("ArmClangArmv7ANeonCflags", armArchVariantCflags["armv7-a-neon"])
|
||||
exportStringListStaticVariable("ArmClangArmv8ACflags", armArchVariantCflags["armv8-a"])
|
||||
exportStringListStaticVariable("ArmClangArmv82ACflags", armArchVariantCflags["armv8-2a"])
|
||||
exportStringListStaticVariable("ArmArmv7ACflags", armArchVariantCflags["armv7-a"])
|
||||
exportStringListStaticVariable("ArmArmv7ANeonCflags", armArchVariantCflags["armv7-a-neon"])
|
||||
exportStringListStaticVariable("ArmArmv8ACflags", armArchVariantCflags["armv8-a"])
|
||||
exportStringListStaticVariable("ArmArmv82ACflags", armArchVariantCflags["armv8-2a"])
|
||||
|
||||
// Clang cpu variant cflags
|
||||
exportStringListStaticVariable("ArmClangGenericCflags", armCpuVariantCflags[""])
|
||||
exportStringListStaticVariable("ArmClangCortexA7Cflags", armCpuVariantCflags["cortex-a7"])
|
||||
exportStringListStaticVariable("ArmClangCortexA8Cflags", armCpuVariantCflags["cortex-a8"])
|
||||
exportStringListStaticVariable("ArmClangCortexA15Cflags", armCpuVariantCflags["cortex-a15"])
|
||||
exportStringListStaticVariable("ArmClangCortexA53Cflags", armCpuVariantCflags["cortex-a53"])
|
||||
exportStringListStaticVariable("ArmClangCortexA55Cflags", armCpuVariantCflags["cortex-a55"])
|
||||
exportStringListStaticVariable("ArmClangKraitCflags", armCpuVariantCflags["krait"])
|
||||
exportStringListStaticVariable("ArmClangKryoCflags", armCpuVariantCflags["kryo"])
|
||||
exportStringListStaticVariable("ArmGenericCflags", armCpuVariantCflags[""])
|
||||
exportStringListStaticVariable("ArmCortexA7Cflags", armCpuVariantCflags["cortex-a7"])
|
||||
exportStringListStaticVariable("ArmCortexA8Cflags", armCpuVariantCflags["cortex-a8"])
|
||||
exportStringListStaticVariable("ArmCortexA15Cflags", armCpuVariantCflags["cortex-a15"])
|
||||
exportStringListStaticVariable("ArmCortexA53Cflags", armCpuVariantCflags["cortex-a53"])
|
||||
exportStringListStaticVariable("ArmCortexA55Cflags", armCpuVariantCflags["cortex-a55"])
|
||||
exportStringListStaticVariable("ArmKraitCflags", armCpuVariantCflags["krait"])
|
||||
exportStringListStaticVariable("ArmKryoCflags", armCpuVariantCflags["kryo"])
|
||||
}
|
||||
|
||||
var (
|
||||
armArchVariantCflagsVar = map[string]string{
|
||||
"armv7-a": "${config.ArmClangArmv7ACflags}",
|
||||
"armv7-a-neon": "${config.ArmClangArmv7ANeonCflags}",
|
||||
"armv8-a": "${config.ArmClangArmv8ACflags}",
|
||||
"armv8-2a": "${config.ArmClangArmv82ACflags}",
|
||||
"armv7-a": "${config.ArmArmv7ACflags}",
|
||||
"armv7-a-neon": "${config.ArmArmv7ANeonCflags}",
|
||||
"armv8-a": "${config.ArmArmv8ACflags}",
|
||||
"armv8-2a": "${config.ArmArmv82ACflags}",
|
||||
}
|
||||
|
||||
armCpuVariantCflagsVar = map[string]string{
|
||||
"": "${config.ArmClangGenericCflags}",
|
||||
"cortex-a7": "${config.ArmClangCortexA7Cflags}",
|
||||
"cortex-a8": "${config.ArmClangCortexA8Cflags}",
|
||||
"cortex-a15": "${config.ArmClangCortexA15Cflags}",
|
||||
"cortex-a53": "${config.ArmClangCortexA53Cflags}",
|
||||
"cortex-a53.a57": "${config.ArmClangCortexA53Cflags}",
|
||||
"cortex-a55": "${config.ArmClangCortexA55Cflags}",
|
||||
"cortex-a72": "${config.ArmClangCortexA53Cflags}",
|
||||
"cortex-a73": "${config.ArmClangCortexA53Cflags}",
|
||||
"cortex-a75": "${config.ArmClangCortexA55Cflags}",
|
||||
"cortex-a76": "${config.ArmClangCortexA55Cflags}",
|
||||
"krait": "${config.ArmClangKraitCflags}",
|
||||
"kryo": "${config.ArmClangKryoCflags}",
|
||||
"kryo385": "${config.ArmClangCortexA53Cflags}",
|
||||
"exynos-m1": "${config.ArmClangCortexA53Cflags}",
|
||||
"exynos-m2": "${config.ArmClangCortexA53Cflags}",
|
||||
"": "${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}",
|
||||
"cortex-a76": "${config.ArmCortexA55Cflags}",
|
||||
"krait": "${config.ArmKraitCflags}",
|
||||
"kryo": "${config.ArmKryoCflags}",
|
||||
"kryo385": "${config.ArmCortexA53Cflags}",
|
||||
"exynos-m1": "${config.ArmCortexA53Cflags}",
|
||||
"exynos-m2": "${config.ArmCortexA53Cflags}",
|
||||
}
|
||||
)
|
||||
|
||||
|
@ -276,11 +276,11 @@ func (t *toolchainArm) ToolchainCflags() string {
|
|||
}
|
||||
|
||||
func (t *toolchainArm) Cflags() string {
|
||||
return "${config.ArmClangCflags}"
|
||||
return "${config.ArmCflags}"
|
||||
}
|
||||
|
||||
func (t *toolchainArm) Cppflags() string {
|
||||
return "${config.ArmClangCppflags}"
|
||||
return "${config.ArmCppflags}"
|
||||
}
|
||||
|
||||
func (t *toolchainArm) Ldflags() string {
|
||||
|
@ -294,9 +294,9 @@ func (t *toolchainArm) Lldflags() string {
|
|||
func (t *toolchainArm) InstructionSetFlags(isa string) (string, error) {
|
||||
switch isa {
|
||||
case "arm":
|
||||
return "${config.ArmClangArmCflags}", nil
|
||||
return "${config.ArmArmCflags}", nil
|
||||
case "thumb", "":
|
||||
return "${config.ArmClangThumbCflags}", nil
|
||||
return "${config.ArmThumbCflags}", nil
|
||||
default:
|
||||
return t.toolchainBase.InstructionSetFlags(isa)
|
||||
}
|
||||
|
@ -310,7 +310,7 @@ func armToolchainFactory(arch android.Arch) Toolchain {
|
|||
var fixCortexA8 string
|
||||
toolchainCflags := make([]string, 2, 3)
|
||||
|
||||
toolchainCflags[0] = "${config.ArmToolchainClangCflags}"
|
||||
toolchainCflags[0] = "${config.ArmToolchainCflags}"
|
||||
toolchainCflags[1] = armArchVariantCflagsVar[arch.ArchVariant]
|
||||
|
||||
toolchainCflags = append(toolchainCflags,
|
||||
|
|
|
@ -118,7 +118,7 @@ func BazelCcToolchainVars() string {
|
|||
// quite complex to track depth-first interpolations. It's also unlikely the
|
||||
// interpolation stacks are deep (n > 1).
|
||||
func expandVar(toExpand string, stringScope exportedStringVariables, stringListScope exportedStringListVariables) []string {
|
||||
// e.g. "${ClangExternalCflags}"
|
||||
// e.g. "${ExternalCflags}"
|
||||
r := regexp.MustCompile(`\${([a-zA-Z0-9_]+)}`)
|
||||
|
||||
// Internal recursive function.
|
||||
|
|
|
@ -241,9 +241,9 @@ func init() {
|
|||
exportStringListStaticVariable("HostGlobalLdflags", hostGlobalLdflags)
|
||||
exportStringListStaticVariable("HostGlobalLldflags", hostGlobalLldflags)
|
||||
|
||||
// Export the static default CommonClangGlobalCflags to Bazel.
|
||||
// Export the static default CommonGlobalCflags to Bazel.
|
||||
// TODO(187086342): handle cflags that are set in VariableFuncs.
|
||||
commonClangGlobalCFlags := append(
|
||||
bazelCommonGlobalCflags := append(
|
||||
commonGlobalCflags,
|
||||
[]string{
|
||||
"${ClangExtraCflags}",
|
||||
|
@ -251,9 +251,9 @@ func init() {
|
|||
"-ftrivial-auto-var-init=zero",
|
||||
"-enable-trivial-auto-var-init-zero-knowing-it-will-be-removed-from-clang",
|
||||
}...)
|
||||
exportedStringListVars.Set("CommonClangGlobalCflags", commonClangGlobalCFlags)
|
||||
exportedStringListVars.Set("CommonGlobalCflags", bazelCommonGlobalCflags)
|
||||
|
||||
pctx.VariableFunc("CommonClangGlobalCflags", func(ctx android.PackageVarContext) string {
|
||||
pctx.VariableFunc("CommonGlobalCflags", func(ctx android.PackageVarContext) string {
|
||||
flags := commonGlobalCflags
|
||||
flags = append(flags, "${ClangExtraCflags}")
|
||||
|
||||
|
@ -273,18 +273,18 @@ func init() {
|
|||
return strings.Join(flags, " ")
|
||||
})
|
||||
|
||||
// Export the static default DeviceClangGlobalCflags to Bazel.
|
||||
// Export the static default DeviceGlobalCflags to Bazel.
|
||||
// TODO(187086342): handle cflags that are set in VariableFuncs.
|
||||
exportedStringListVars.Set("DeviceClangGlobalCflags", deviceGlobalCflags)
|
||||
exportedStringListVars.Set("DeviceGlobalCflags", deviceGlobalCflags)
|
||||
|
||||
pctx.VariableFunc("DeviceClangGlobalCflags", func(ctx android.PackageVarContext) string {
|
||||
pctx.VariableFunc("DeviceGlobalCflags", func(ctx android.PackageVarContext) string {
|
||||
return strings.Join(deviceGlobalCflags, " ")
|
||||
})
|
||||
|
||||
exportStringListStaticVariable("HostClangGlobalCflags", hostGlobalCflags)
|
||||
exportStringListStaticVariable("NoOverrideClangGlobalCflags", noOverrideGlobalCflags)
|
||||
exportStringListStaticVariable("CommonClangGlobalCppflags", commonGlobalCppflags)
|
||||
exportStringListStaticVariable("ClangExternalCflags", extraExternalCflags)
|
||||
exportStringListStaticVariable("HostGlobalCflags", hostGlobalCflags)
|
||||
exportStringListStaticVariable("NoOverrideGlobalCflags", noOverrideGlobalCflags)
|
||||
exportStringListStaticVariable("CommonGlobalCppflags", commonGlobalCppflags)
|
||||
exportStringListStaticVariable("ExternalCflags", extraExternalCflags)
|
||||
|
||||
// Everything in these lists is a crime against abstraction and dependency tracking.
|
||||
// Do not add anything to this list.
|
||||
|
|
|
@ -103,8 +103,8 @@ func init() {
|
|||
pctx.StaticVariable("X86_64Lldflags", strings.Join(x86_64Ldflags, " "))
|
||||
|
||||
// Clang cflags
|
||||
pctx.StaticVariable("X86_64ClangCflags", strings.Join(x86_64Cflags, " "))
|
||||
pctx.StaticVariable("X86_64ClangCppflags", strings.Join(x86_64Cppflags, " "))
|
||||
pctx.StaticVariable("X86_64Cflags", strings.Join(x86_64Cflags, " "))
|
||||
pctx.StaticVariable("X86_64Cppflags", strings.Join(x86_64Cppflags, " "))
|
||||
|
||||
// Yasm flags
|
||||
pctx.StaticVariable("X86_64YasmFlags", "-f elf64 -m amd64")
|
||||
|
@ -113,7 +113,7 @@ func init() {
|
|||
|
||||
// Architecture variant cflags
|
||||
for variant, cflags := range x86_64ArchVariantCflags {
|
||||
pctx.StaticVariable("X86_64"+variant+"VariantClangCflags",
|
||||
pctx.StaticVariable("X86_64"+variant+"VariantCflags",
|
||||
strings.Join(cflags, " "))
|
||||
}
|
||||
}
|
||||
|
@ -157,11 +157,11 @@ func (t *toolchainX86_64) ToolchainCflags() string {
|
|||
}
|
||||
|
||||
func (t *toolchainX86_64) Cflags() string {
|
||||
return "${config.X86_64ClangCflags}"
|
||||
return "${config.X86_64Cflags}"
|
||||
}
|
||||
|
||||
func (t *toolchainX86_64) Cppflags() string {
|
||||
return "${config.X86_64ClangCppflags}"
|
||||
return "${config.X86_64Cppflags}"
|
||||
}
|
||||
|
||||
func (t *toolchainX86_64) Ldflags() string {
|
||||
|
@ -183,7 +183,7 @@ func (toolchainX86_64) LibclangRuntimeLibraryArch() string {
|
|||
func x86_64ToolchainFactory(arch android.Arch) Toolchain {
|
||||
toolchainCflags := []string{
|
||||
"${config.X86_64ToolchainCflags}",
|
||||
"${config.X86_64" + arch.ArchVariant + "VariantClangCflags}",
|
||||
"${config.X86_64" + arch.ArchVariant + "VariantCflags}",
|
||||
}
|
||||
|
||||
for _, feature := range arch.ArchFeatures {
|
||||
|
|
|
@ -107,9 +107,9 @@ func init() {
|
|||
|
||||
pctx.StaticVariable("DarwinGccTriple", "i686-apple-darwin11")
|
||||
|
||||
pctx.StaticVariable("DarwinClangCflags", strings.Join(darwinCflags, " "))
|
||||
pctx.StaticVariable("DarwinClangLdflags", strings.Join(darwinLdflags, " "))
|
||||
pctx.StaticVariable("DarwinClangLldflags", strings.Join(darwinLdflags, " "))
|
||||
pctx.StaticVariable("DarwinCflags", strings.Join(darwinCflags, " "))
|
||||
pctx.StaticVariable("DarwinLdflags", strings.Join(darwinLdflags, " "))
|
||||
pctx.StaticVariable("DarwinLldflags", strings.Join(darwinLdflags, " "))
|
||||
|
||||
pctx.StaticVariable("DarwinYasmFlags", "-f macho -m amd64")
|
||||
}
|
||||
|
@ -206,7 +206,7 @@ func (t *toolchainDarwin) ClangTriple() string {
|
|||
}
|
||||
|
||||
func (t *toolchainDarwin) Cflags() string {
|
||||
return "${config.DarwinClangCflags}"
|
||||
return "${config.DarwinCflags}"
|
||||
}
|
||||
|
||||
func (t *toolchainDarwin) Cppflags() string {
|
||||
|
@ -214,11 +214,11 @@ func (t *toolchainDarwin) Cppflags() string {
|
|||
}
|
||||
|
||||
func (t *toolchainDarwin) Ldflags() string {
|
||||
return "${config.DarwinClangLdflags}"
|
||||
return "${config.DarwinLdflags}"
|
||||
}
|
||||
|
||||
func (t *toolchainDarwin) Lldflags() string {
|
||||
return "${config.DarwinClangLldflags}"
|
||||
return "${config.DarwinLldflags}"
|
||||
}
|
||||
|
||||
func (t *toolchainDarwin) YasmFlags() string {
|
||||
|
|
|
@ -104,9 +104,8 @@ func init() {
|
|||
pctx.StaticVariable("X86Lldflags", strings.Join(x86Ldflags, " "))
|
||||
|
||||
// Clang cflags
|
||||
pctx.StaticVariable("X86ClangLldflags", strings.Join(x86Ldflags, " "))
|
||||
pctx.StaticVariable("X86ClangCflags", strings.Join(x86Cflags, " "))
|
||||
pctx.StaticVariable("X86ClangCppflags", strings.Join(x86Cppflags, " "))
|
||||
pctx.StaticVariable("X86Cflags", strings.Join(x86Cflags, " "))
|
||||
pctx.StaticVariable("X86Cppflags", strings.Join(x86Cppflags, " "))
|
||||
|
||||
// Yasm flags
|
||||
pctx.StaticVariable("X86YasmFlags", "-f elf32 -m x86")
|
||||
|
@ -115,7 +114,7 @@ func init() {
|
|||
|
||||
// Architecture variant cflags
|
||||
for variant, cflags := range x86ArchVariantCflags {
|
||||
pctx.StaticVariable("X86"+variant+"VariantClangCflags",
|
||||
pctx.StaticVariable("X86"+variant+"VariantCflags",
|
||||
strings.Join(cflags, " "))
|
||||
}
|
||||
}
|
||||
|
@ -159,11 +158,11 @@ func (t *toolchainX86) ToolchainCflags() string {
|
|||
}
|
||||
|
||||
func (t *toolchainX86) Cflags() string {
|
||||
return "${config.X86ClangCflags}"
|
||||
return "${config.X86Cflags}"
|
||||
}
|
||||
|
||||
func (t *toolchainX86) Cppflags() string {
|
||||
return "${config.X86ClangCppflags}"
|
||||
return "${config.X86Cppflags}"
|
||||
}
|
||||
|
||||
func (t *toolchainX86) Ldflags() string {
|
||||
|
@ -185,7 +184,7 @@ func (toolchainX86) LibclangRuntimeLibraryArch() string {
|
|||
func x86ToolchainFactory(arch android.Arch) Toolchain {
|
||||
toolchainCflags := []string{
|
||||
"${config.X86ToolchainCflags}",
|
||||
"${config.X86" + arch.ArchVariant + "VariantClangCflags}",
|
||||
"${config.X86" + arch.ArchVariant + "VariantCflags}",
|
||||
}
|
||||
|
||||
for _, feature := range arch.ArchFeatures {
|
||||
|
|
|
@ -111,16 +111,16 @@ func init() {
|
|||
|
||||
pctx.StaticVariable("LinuxGccTriple", "x86_64-linux")
|
||||
|
||||
pctx.StaticVariable("LinuxClangCflags", strings.Join(linuxCflags, " "))
|
||||
pctx.StaticVariable("LinuxClangLdflags", strings.Join(linuxLdflags, " "))
|
||||
pctx.StaticVariable("LinuxClangLldflags", strings.Join(linuxLdflags, " "))
|
||||
pctx.StaticVariable("LinuxCflags", strings.Join(linuxCflags, " "))
|
||||
pctx.StaticVariable("LinuxLdflags", strings.Join(linuxLdflags, " "))
|
||||
pctx.StaticVariable("LinuxLldflags", strings.Join(linuxLdflags, " "))
|
||||
|
||||
pctx.StaticVariable("LinuxX86ClangCflags", strings.Join(linuxX86Cflags, " "))
|
||||
pctx.StaticVariable("LinuxX8664ClangCflags", strings.Join(linuxX8664Cflags, " "))
|
||||
pctx.StaticVariable("LinuxX86ClangLdflags", strings.Join(linuxX86Ldflags, " "))
|
||||
pctx.StaticVariable("LinuxX86ClangLldflags", strings.Join(linuxX86Ldflags, " "))
|
||||
pctx.StaticVariable("LinuxX8664ClangLdflags", strings.Join(linuxX8664Ldflags, " "))
|
||||
pctx.StaticVariable("LinuxX8664ClangLldflags", strings.Join(linuxX8664Ldflags, " "))
|
||||
pctx.StaticVariable("LinuxX86Cflags", strings.Join(linuxX86Cflags, " "))
|
||||
pctx.StaticVariable("LinuxX8664Cflags", strings.Join(linuxX8664Cflags, " "))
|
||||
pctx.StaticVariable("LinuxX86Ldflags", strings.Join(linuxX86Ldflags, " "))
|
||||
pctx.StaticVariable("LinuxX86Lldflags", strings.Join(linuxX86Ldflags, " "))
|
||||
pctx.StaticVariable("LinuxX8664Ldflags", strings.Join(linuxX8664Ldflags, " "))
|
||||
pctx.StaticVariable("LinuxX8664Lldflags", strings.Join(linuxX8664Ldflags, " "))
|
||||
// Yasm flags
|
||||
pctx.StaticVariable("LinuxX86YasmFlags", "-f elf32 -m x86")
|
||||
pctx.StaticVariable("LinuxX8664YasmFlags", "-f elf64 -m amd64")
|
||||
|
@ -169,7 +169,7 @@ func (t *toolchainLinuxX86) ClangTriple() string {
|
|||
}
|
||||
|
||||
func (t *toolchainLinuxX86) Cflags() string {
|
||||
return "${config.LinuxClangCflags} ${config.LinuxX86ClangCflags}"
|
||||
return "${config.LinuxCflags} ${config.LinuxX86Cflags}"
|
||||
}
|
||||
|
||||
func (t *toolchainLinuxX86) Cppflags() string {
|
||||
|
@ -181,7 +181,7 @@ func (t *toolchainLinuxX8664) ClangTriple() string {
|
|||
}
|
||||
|
||||
func (t *toolchainLinuxX8664) Cflags() string {
|
||||
return "${config.LinuxClangCflags} ${config.LinuxX8664ClangCflags}"
|
||||
return "${config.LinuxCflags} ${config.LinuxX8664Cflags}"
|
||||
}
|
||||
|
||||
func (t *toolchainLinuxX8664) Cppflags() string {
|
||||
|
@ -189,19 +189,19 @@ func (t *toolchainLinuxX8664) Cppflags() string {
|
|||
}
|
||||
|
||||
func (t *toolchainLinuxX86) Ldflags() string {
|
||||
return "${config.LinuxClangLdflags} ${config.LinuxX86ClangLdflags}"
|
||||
return "${config.LinuxLdflags} ${config.LinuxX86Ldflags}"
|
||||
}
|
||||
|
||||
func (t *toolchainLinuxX86) Lldflags() string {
|
||||
return "${config.LinuxClangLldflags} ${config.LinuxX86ClangLldflags}"
|
||||
return "${config.LinuxLldflags} ${config.LinuxX86Lldflags}"
|
||||
}
|
||||
|
||||
func (t *toolchainLinuxX8664) Ldflags() string {
|
||||
return "${config.LinuxClangLdflags} ${config.LinuxX8664ClangLdflags}"
|
||||
return "${config.LinuxLdflags} ${config.LinuxX8664Ldflags}"
|
||||
}
|
||||
|
||||
func (t *toolchainLinuxX8664) Lldflags() string {
|
||||
return "${config.LinuxClangLldflags} ${config.LinuxX8664ClangLldflags}"
|
||||
return "${config.LinuxLldflags} ${config.LinuxX8664Lldflags}"
|
||||
}
|
||||
|
||||
func (t *toolchainLinuxX86) YasmFlags() string {
|
||||
|
|
|
@ -130,19 +130,19 @@ func init() {
|
|||
|
||||
pctx.StaticVariable("WindowsGccTriple", "x86_64-w64-mingw32")
|
||||
|
||||
pctx.StaticVariable("WindowsClangCflags", strings.Join(windowsCflags, " "))
|
||||
pctx.StaticVariable("WindowsClangLdflags", strings.Join(windowsLdflags, " "))
|
||||
pctx.StaticVariable("WindowsClangLldflags", strings.Join(windowsLldflags, " "))
|
||||
pctx.StaticVariable("WindowsClangCppflags", strings.Join(windowsCppflags, " "))
|
||||
pctx.StaticVariable("WindowsCflags", strings.Join(windowsCflags, " "))
|
||||
pctx.StaticVariable("WindowsLdflags", strings.Join(windowsLdflags, " "))
|
||||
pctx.StaticVariable("WindowsLldflags", strings.Join(windowsLldflags, " "))
|
||||
pctx.StaticVariable("WindowsCppflags", strings.Join(windowsCppflags, " "))
|
||||
|
||||
pctx.StaticVariable("WindowsX86ClangCflags", strings.Join(windowsX86Cflags, " "))
|
||||
pctx.StaticVariable("WindowsX8664ClangCflags", strings.Join(windowsX8664Cflags, " "))
|
||||
pctx.StaticVariable("WindowsX86ClangLdflags", strings.Join(windowsX86Ldflags, " "))
|
||||
pctx.StaticVariable("WindowsX86ClangLldflags", strings.Join(windowsX86Ldflags, " "))
|
||||
pctx.StaticVariable("WindowsX8664ClangLdflags", strings.Join(windowsX8664Ldflags, " "))
|
||||
pctx.StaticVariable("WindowsX8664ClangLldflags", strings.Join(windowsX8664Ldflags, " "))
|
||||
pctx.StaticVariable("WindowsX86ClangCppflags", strings.Join(windowsX86Cppflags, " "))
|
||||
pctx.StaticVariable("WindowsX8664ClangCppflags", strings.Join(windowsX8664Cppflags, " "))
|
||||
pctx.StaticVariable("WindowsX86Cflags", strings.Join(windowsX86Cflags, " "))
|
||||
pctx.StaticVariable("WindowsX8664Cflags", strings.Join(windowsX8664Cflags, " "))
|
||||
pctx.StaticVariable("WindowsX86Ldflags", strings.Join(windowsX86Ldflags, " "))
|
||||
pctx.StaticVariable("WindowsX86Lldflags", strings.Join(windowsX86Ldflags, " "))
|
||||
pctx.StaticVariable("WindowsX8664Ldflags", strings.Join(windowsX8664Ldflags, " "))
|
||||
pctx.StaticVariable("WindowsX8664Lldflags", strings.Join(windowsX8664Ldflags, " "))
|
||||
pctx.StaticVariable("WindowsX86Cppflags", strings.Join(windowsX86Cppflags, " "))
|
||||
pctx.StaticVariable("WindowsX8664Cppflags", strings.Join(windowsX8664Cppflags, " "))
|
||||
|
||||
pctx.StaticVariable("WindowsIncludeFlags", strings.Join(windowsIncludeFlags, " "))
|
||||
// Yasm flags
|
||||
|
@ -205,35 +205,35 @@ func (t *toolchainWindowsX8664) ClangTriple() string {
|
|||
}
|
||||
|
||||
func (t *toolchainWindowsX86) Cflags() string {
|
||||
return "${config.WindowsClangCflags} ${config.WindowsX86ClangCflags}"
|
||||
return "${config.WindowsCflags} ${config.WindowsX86Cflags}"
|
||||
}
|
||||
|
||||
func (t *toolchainWindowsX8664) Cflags() string {
|
||||
return "${config.WindowsClangCflags} ${config.WindowsX8664ClangCflags}"
|
||||
return "${config.WindowsCflags} ${config.WindowsX8664Cflags}"
|
||||
}
|
||||
|
||||
func (t *toolchainWindowsX86) Cppflags() string {
|
||||
return "${config.WindowsClangCppflags} ${config.WindowsX86ClangCppflags}"
|
||||
return "${config.WindowsCppflags} ${config.WindowsX86Cppflags}"
|
||||
}
|
||||
|
||||
func (t *toolchainWindowsX8664) Cppflags() string {
|
||||
return "${config.WindowsClangCppflags} ${config.WindowsX8664ClangCppflags}"
|
||||
return "${config.WindowsCppflags} ${config.WindowsX8664Cppflags}"
|
||||
}
|
||||
|
||||
func (t *toolchainWindowsX86) Ldflags() string {
|
||||
return "${config.WindowsClangLdflags} ${config.WindowsX86ClangLdflags}"
|
||||
return "${config.WindowsLdflags} ${config.WindowsX86Ldflags}"
|
||||
}
|
||||
|
||||
func (t *toolchainWindowsX86) Lldflags() string {
|
||||
return "${config.WindowsClangLldflags} ${config.WindowsX86ClangLldflags}"
|
||||
return "${config.WindowsLldflags} ${config.WindowsX86Lldflags}"
|
||||
}
|
||||
|
||||
func (t *toolchainWindowsX8664) Ldflags() string {
|
||||
return "${config.WindowsClangLdflags} ${config.WindowsX8664ClangLdflags}"
|
||||
return "${config.WindowsLdflags} ${config.WindowsX8664Ldflags}"
|
||||
}
|
||||
|
||||
func (t *toolchainWindowsX8664) Lldflags() string {
|
||||
return "${config.WindowsClangLldflags} ${config.WindowsX8664ClangLldflags}"
|
||||
return "${config.WindowsLldflags} ${config.WindowsX8664Lldflags}"
|
||||
}
|
||||
|
||||
func (t *toolchainWindowsX86) YasmFlags() string {
|
||||
|
|
|
@ -92,8 +92,8 @@ func makeVarsProvider(ctx android.MakeVarsContext) {
|
|||
ctx.Strict("RS_LLVM_AS", "${config.RSLLVMPrebuiltsPath}/llvm-as")
|
||||
ctx.Strict("RS_LLVM_LINK", "${config.RSLLVMPrebuiltsPath}/llvm-link")
|
||||
|
||||
ctx.Strict("CLANG_EXTERNAL_CFLAGS", "${config.ClangExternalCflags}")
|
||||
ctx.Strict("GLOBAL_CLANG_CFLAGS_NO_OVERRIDE", "${config.NoOverrideClangGlobalCflags}")
|
||||
ctx.Strict("CLANG_EXTERNAL_CFLAGS", "${config.ExternalCflags}")
|
||||
ctx.Strict("GLOBAL_CLANG_CFLAGS_NO_OVERRIDE", "${config.NoOverrideGlobalCflags}")
|
||||
ctx.Strict("GLOBAL_CLANG_CPPFLAGS_NO_OVERRIDE", "")
|
||||
|
||||
ctx.Strict("BOARD_VNDK_VERSION", ctx.DeviceConfig().VndkVersion())
|
||||
|
@ -231,14 +231,14 @@ func makeVarsToolchain(ctx android.MakeVarsContext, secondPrefix string,
|
|||
ctx.Strict(clangPrefix+"TRIPLE", toolchain.ClangTriple())
|
||||
ctx.Strict(clangPrefix+"GLOBAL_CFLAGS", strings.Join([]string{
|
||||
toolchain.Cflags(),
|
||||
"${config.CommonClangGlobalCflags}",
|
||||
fmt.Sprintf("${config.%sClangGlobalCflags}", hod),
|
||||
"${config.CommonGlobalCflags}",
|
||||
fmt.Sprintf("${config.%sGlobalCflags}", hod),
|
||||
toolchain.ToolchainCflags(),
|
||||
clangExtras,
|
||||
productExtraCflags,
|
||||
}, " "))
|
||||
ctx.Strict(clangPrefix+"GLOBAL_CPPFLAGS", strings.Join([]string{
|
||||
"${config.CommonClangGlobalCppflags}",
|
||||
"${config.CommonGlobalCppflags}",
|
||||
fmt.Sprintf("${config.%sGlobalCppflags}", hod),
|
||||
toolchain.Cppflags(),
|
||||
}, " "))
|
||||
|
|
|
@ -137,9 +137,9 @@ func (b *bindgenDecorator) GenerateSource(ctx ModuleContext, deps PathDeps) andr
|
|||
implicits = append(implicits, deps.depGeneratedHeaders...)
|
||||
|
||||
// Default clang flags
|
||||
cflags = append(cflags, "${cc_config.CommonClangGlobalCflags}")
|
||||
cflags = append(cflags, "${cc_config.CommonGlobalCflags}")
|
||||
if ctx.Device() {
|
||||
cflags = append(cflags, "${cc_config.DeviceClangGlobalCflags}")
|
||||
cflags = append(cflags, "${cc_config.DeviceGlobalCflags}")
|
||||
}
|
||||
|
||||
// Toolchain clang flags
|
||||
|
|
|
@ -78,7 +78,7 @@ func (t *toolchainDarwin) ProcMacroSuffix() string {
|
|||
|
||||
func (t *toolchainDarwinX8664) ToolchainLinkFlags() string {
|
||||
// Prepend the lld flags from cc_config so we stay in sync with cc
|
||||
return "${cc_config.DarwinClangLldflags} ${config.DarwinToolchainLinkFlags} ${config.DarwinToolchainX8664LinkFlags}"
|
||||
return "${cc_config.DarwinLldflags} ${config.DarwinToolchainLinkFlags} ${config.DarwinToolchainX8664LinkFlags}"
|
||||
}
|
||||
|
||||
func (t *toolchainDarwinX8664) ToolchainRustFlags() string {
|
||||
|
|
|
@ -65,7 +65,7 @@ func (t *toolchainX86) RustTriple() string {
|
|||
|
||||
func (t *toolchainX86) ToolchainLinkFlags() string {
|
||||
// Prepend the lld flags from cc_config so we stay in sync with cc
|
||||
return "${config.DeviceGlobalLinkFlags} ${cc_config.X86ClangLldflags} ${config.X86ToolchainLinkFlags}"
|
||||
return "${config.DeviceGlobalLinkFlags} ${cc_config.X86Lldflags} ${config.X86ToolchainLinkFlags}"
|
||||
}
|
||||
|
||||
func (t *toolchainX86) ToolchainRustFlags() string {
|
||||
|
|
|
@ -79,7 +79,7 @@ func (t *toolchainLinuxX8664) RustTriple() string {
|
|||
|
||||
func (t *toolchainLinuxX8664) ToolchainLinkFlags() string {
|
||||
// Prepend the lld flags from cc_config so we stay in sync with cc
|
||||
return "${cc_config.LinuxClangLldflags} ${cc_config.LinuxX8664ClangLldflags} " +
|
||||
return "${cc_config.LinuxLldflags} ${cc_config.LinuxX8664Lldflags} " +
|
||||
"${config.LinuxToolchainLinkFlags} ${config.LinuxToolchainX8664LinkFlags}"
|
||||
}
|
||||
|
||||
|
@ -117,7 +117,7 @@ func (t *toolchainLinuxX86) RustTriple() string {
|
|||
|
||||
func (t *toolchainLinuxX86) ToolchainLinkFlags() string {
|
||||
// Prepend the lld flags from cc_config so we stay in sync with cc
|
||||
return "${cc_config.LinuxClangLldflags} ${cc_config.LinuxX86ClangLldflags} " +
|
||||
return "${cc_config.LinuxLldflags} ${cc_config.LinuxX86Lldflags} " +
|
||||
"${config.LinuxToolchainLinkFlags} ${config.LinuxToolchainX86LinkFlags}"
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue