cargo-build-bpf: don't set -C linker on windows (#22314)
* cargo-build-bpf: don't set -C linker on windows
Since we're now linking using rust-lld
(87ba5c61a5
)
which is guaranteed to always be in the sysroot, hardcoding the linker path
shouldn't be needed anymore.
* Update Cargo.lock
This commit is contained in:
parent
f1e2598baa
commit
0459f0a4c0
|
@ -516,17 +516,11 @@ fn build_bpf_package(config: &Config, target_directory: &Path, package: &cargo_m
|
||||||
env::set_var("OBJDUMP", llvm_bin.join("llvm-objdump"));
|
env::set_var("OBJDUMP", llvm_bin.join("llvm-objdump"));
|
||||||
env::set_var("OBJCOPY", llvm_bin.join("llvm-objcopy"));
|
env::set_var("OBJCOPY", llvm_bin.join("llvm-objcopy"));
|
||||||
|
|
||||||
if let Ok(mut rustflags) = env::var("RUSTFLAGS") {
|
if config.verbose {
|
||||||
if cfg!(windows) && !rustflags.contains("-C linker=") {
|
println!(
|
||||||
let ld_path = llvm_bin.join("ld.lld");
|
"RUSTFLAGS={}",
|
||||||
rustflags = format!("{} -C linker={}", rustflags, ld_path.display());
|
env::var("RUSTFLAGS").ok().as_deref().unwrap_or("")
|
||||||
}
|
);
|
||||||
|
|
||||||
if config.verbose {
|
|
||||||
println!("RUSTFLAGS={}", rustflags);
|
|
||||||
}
|
|
||||||
|
|
||||||
env::set_var("RUSTFLAGS", rustflags);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
let cargo_build = PathBuf::from("cargo");
|
let cargo_build = PathBuf::from("cargo");
|
||||||
|
|
Loading…
Reference in New Issue