From 268939a99a50d7927bce3e343e5d2ed32eb8b30e Mon Sep 17 00:00:00 2001 From: "Jason S. Clary" Date: Wed, 11 Oct 2023 07:14:23 -0500 Subject: [PATCH] Support the x86_64-linux-android build target. (#127) * Initial support for x86_64-linux-android targets. * Improve target selection for clang link phase. * Only add clang target if it differs from the host. --- xbuild/src/cargo/mod.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/xbuild/src/cargo/mod.rs b/xbuild/src/cargo/mod.rs index b82a2896..adb91766 100644 --- a/xbuild/src/cargo/mod.rs +++ b/xbuild/src/cargo/mod.rs @@ -295,7 +295,9 @@ impl CargoBuild { target_sdk_version ); self.use_ld("lld"); - self.add_link_arg("--target=aarch64-linux-android"); + if let Some(triple) = self.triple { + self.add_link_arg(&format!("--target={}", triple)); + } self.add_link_arg(&format!("-B{}", sdk_lib_dir.display())); self.add_link_arg(&format!("-L{}", sdk_lib_dir.display())); self.add_link_arg(&format!("-L{}", lib_dir.display()));