Enable x86_64 device support
Now that we have sysroots built in Soong, we can enable these devices
and they just work.
Bug: 141251907
Bug: 141381044
Change-Id: I562256fee372d331db883f7c1b46405945295c24
diff --git a/rust/config/x86_64_device.go b/rust/config/x86_64_device.go
index 2aca56a..9a6c00b 100644
--- a/rust/config/x86_64_device.go
+++ b/rust/config/x86_64_device.go
@@ -41,8 +41,8 @@
func init() {
registerToolchainFactory(android.Android, android.X86_64, x86_64ToolchainFactory)
- pctx.StaticVariable("x86_64ToolchainRustFlags", strings.Join(x86_64RustFlags, " "))
- pctx.StaticVariable("x86_64ToolchainLinkFlags", strings.Join(x86_64LinkFlags, " "))
+ pctx.StaticVariable("X86_64ToolchainRustFlags", strings.Join(x86_64RustFlags, " "))
+ pctx.StaticVariable("X86_64ToolchainLinkFlags", strings.Join(x86_64LinkFlags, " "))
for variant, rustFlags := range x86_64ArchVariantRustFlags {
pctx.StaticVariable("X86_64"+variant+"VariantRustFlags",
@@ -57,11 +57,11 @@
}
func (t *toolchainX86_64) RustTriple() string {
- return "x86_64-unknown-linux-gnu"
+ return "x86_64-linux-android"
}
func (t *toolchainX86_64) ToolchainLinkFlags() string {
- return "${config.x86_64ToolchainLinkFlags}"
+ return "${config.DeviceGlobalLinkFlags} ${config.X86_64ToolchainLinkFlags}"
}
func (t *toolchainX86_64) ToolchainRustFlags() string {
@@ -69,15 +69,21 @@
}
func (t *toolchainX86_64) RustFlags() string {
- return "${config.x86_64ToolchainRustFlags}"
+ return "${config.X86_64ToolchainRustFlags}"
+}
+
+func (t *toolchainX86_64) Supported() bool {
+ return true
}
func x86_64ToolchainFactory(arch android.Arch) Toolchain {
toolchainRustFlags := []string{
- "${config.x86_64ToolchainRustFlags}",
+ "${config.X86_64ToolchainRustFlags}",
"${config.X86_64" + arch.ArchVariant + "VariantRustFlags}",
}
+ toolchainRustFlags = append(toolchainRustFlags, deviceGlobalRustFlags...)
+
for _, feature := range arch.ArchFeatures {
toolchainRustFlags = append(toolchainRustFlags, x86_64ArchFeatureRustFlags[feature]...)
}