--- build/config/rust.gni.orig 2025-06-16 18:02:10 UTC +++ build/config/rust.gni @@ -69,7 +69,8 @@ declare_args() { # set this to the output of `rustc -V`. Changing this string will cause all # Rust targets to be rebuilt, which allows you to update your toolchain and # not break incremental builds. - rustc_version = "" + rustc_version = exec_script("//build/gn_run_binary.py", + [ "${LOCALBASE}/bin/rustc", "-V" ], "trim string") # If you're using a Rust toolchain as specified by rust_sysroot_absolute, # you can specify whether it supports nacl here. @@ -344,6 +345,10 @@ if (is_linux || is_chromeos) { } else { assert(false, "Architecture not supported") } +} + +if (is_bsd) { + rust_abi_target = string_replace(rust_abi_target, "linux-gnu", current_os) } assert(!toolchain_has_rust || rust_abi_target != "")