0
0
mirror of https://github.com/termux/termux-packages.git synced 2025-06-03 15:25:17 +00:00
Files
termux-packages/x11-packages/chromium-host-tools/cr-patches/0005-compiler-custom-rust-abi-target-triple.patch
2025-04-22 18:31:06 +08:00

43 lines
1.5 KiB
Diff

--- a/build/config/rust.gni
+++ b/build/config/rust.gni
@@ -7,6 +7,8 @@
import("//build/config/sanitizers/sanitizers.gni")
import("//build/toolchain/toolchain.gni")
+import("//v8/gni/snapshot_toolchain.gni")
+
if (is_android) {
import("//build/config/android/config.gni")
}
@@ -98,6 +100,8 @@
# a platform. Mostly applicable to Windows, where new versions can handle ANSI
# escape sequences but it's not reliable in general.
force_rustc_color_output = false
+
+ custom_target_rust_abi_target = ""
}
# Use a separate declare_args so these variables' defaults can depend on the
@@ -165,7 +169,7 @@
# TODO(crbug.com/1278030): To build unit tests for Android we need to build
# them as a dylib and put them into an APK. We should reuse all the same logic
# for gtests from the `//testing/test:test` template.
-can_build_rust_unit_tests = toolchain_has_rust && !is_android
+can_build_rust_unit_tests = toolchain_has_rust && !is_android && false
# We want to store rust_sysroot as a source-relative variable for ninja
# portability. In practice if an external toolchain was specified, it might
@@ -280,6 +284,12 @@
}
}
+if (!toolchain_for_rust_host_build_tools && current_toolchain != v8_snapshot_toolchain && current_toolchain != host_toolchain) {
+ if (custom_target_rust_abi_target != "") {
+ rust_abi_target = custom_target_rust_abi_target
+ }
+}
+
assert(!toolchain_has_rust || rust_abi_target != "")
# This variable is passed to the Rust libstd build.