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:
Alessandro Decina 2022-01-07 07:41:13 +11:00 committed by GitHub
parent f1e2598baa
commit 0459f0a4c0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 11 deletions

View File

@ -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");