mirror of https://github.com/rust-lang/rust.git
Auto merge of #57953 - mati865:cc-fix, r=alexcrichton
Do not set CC, CFLAGS, CXX, CXXFLAGS, AR, RANLIB in bootstrap, it breaks cross compilation Fixes https://github.com/rust-lang/rust/issues/57812 I tested it in AArch64 Ubuntu container with several days old tree to have all the tools buildable. I did **not** test native builds (amd64 -> amd64), leaving it to CI. r? @alexcrichton
This commit is contained in:
commit
40e6a0bd76
|
@ -1051,29 +1051,24 @@ impl<'a> Builder<'a> {
|
|||
}
|
||||
};
|
||||
let cc = ccacheify(&self.cc(target));
|
||||
cargo.env(format!("CC_{}", target), &cc).env("CC", &cc);
|
||||
cargo.env(format!("CC_{}", target), &cc);
|
||||
|
||||
let cflags = self.cflags(target, GitRepo::Rustc).join(" ");
|
||||
cargo
|
||||
.env(format!("CFLAGS_{}", target), cflags.clone())
|
||||
.env("CFLAGS", cflags.clone());
|
||||
.env(format!("CFLAGS_{}", target), cflags.clone());
|
||||
|
||||
if let Some(ar) = self.ar(target) {
|
||||
let ranlib = format!("{} s", ar.display());
|
||||
cargo
|
||||
.env(format!("AR_{}", target), ar)
|
||||
.env("AR", ar)
|
||||
.env(format!("RANLIB_{}", target), ranlib.clone())
|
||||
.env("RANLIB", ranlib);
|
||||
.env(format!("RANLIB_{}", target), ranlib);
|
||||
}
|
||||
|
||||
if let Ok(cxx) = self.cxx(target) {
|
||||
let cxx = ccacheify(&cxx);
|
||||
cargo
|
||||
.env(format!("CXX_{}", target), &cxx)
|
||||
.env("CXX", &cxx)
|
||||
.env(format!("CXXFLAGS_{}", target), cflags.clone())
|
||||
.env("CXXFLAGS", cflags);
|
||||
.env(format!("CXXFLAGS_{}", target), cflags);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue