diff options
| author | bors <bors@rust-lang.org> | 2017-10-16 00:32:21 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2017-10-16 00:32:21 +0000 |
| commit | 9223c39dc53ad97ae95fd9cec86503a083b8e966 (patch) | |
| tree | 0260e0115d326e3a030bc19e448c0e69e7e18ea5 /src/liballoc_jemalloc | |
| parent | 29ed49fb0aeab444adcfe16ef3d04e5e910fb08d (diff) | |
| parent | 0577b60832627e774337456ecbb9bfc9dbb0b0fc (diff) | |
| download | rust-9223c39dc53ad97ae95fd9cec86503a083b8e966.tar.gz rust-9223c39dc53ad97ae95fd9cec86503a083b8e966.zip | |
Auto merge of #45191 - petrochenkov:yesar, r=Mark-Simulacrum
rustbuild: Support specifying archiver and linker explicitly With this patch `x.py test` passes without toolchain being in `PATH` if `cc`, `cxx`, `ar`, `linker` and `gdb` are specified in `config.toml` (except for a few `run-make` tests using `nm`). Fixes https://github.com/rust-lang/rust/issues/41821 r? @Mark-Simulacrum
Diffstat (limited to 'src/liballoc_jemalloc')
| -rw-r--r-- | src/liballoc_jemalloc/build.rs | 15 |
1 files changed, 1 insertions, 14 deletions
diff --git a/src/liballoc_jemalloc/build.rs b/src/liballoc_jemalloc/build.rs index 7dd85ddcc79..65e035d4ffd 100644 --- a/src/liballoc_jemalloc/build.rs +++ b/src/liballoc_jemalloc/build.rs @@ -63,15 +63,6 @@ fn main() { _ => return, }; - let compiler = cc::Build::new().get_compiler(); - // only msvc returns None for ar so unwrap is okay - let ar = build_helper::cc2ar(compiler.path(), &target).unwrap(); - let cflags = compiler.args() - .iter() - .map(|s| s.to_str().unwrap()) - .collect::<Vec<_>>() - .join(" "); - let mut cmd = Command::new("sh"); cmd.arg(native.src_dir.join("configure") .to_str() @@ -79,8 +70,6 @@ fn main() { .replace("C:\\", "/c/") .replace("\\", "/")) .current_dir(&native.out_dir) - .env("CC", compiler.path()) - .env("EXTRA_CFLAGS", cflags.clone()) // jemalloc generates Makefile deps using GCC's "-MM" flag. This means // that GCC will run the preprocessor, and only the preprocessor, over // jemalloc's source files. If we don't specify CPPFLAGS, then at least @@ -89,9 +78,7 @@ fn main() { // passed to GCC, and then GCC won't define the // "__GCC_HAVE_SYNC_COMPARE_AND_SWAP_4" macro that jemalloc needs to // select an atomic operation implementation. - .env("CPPFLAGS", cflags.clone()) - .env("AR", &ar) - .env("RANLIB", format!("{} s", ar.display())); + .env("CPPFLAGS", env::var_os("CFLAGS").unwrap_or_default()); if target.contains("ios") { cmd.arg("--disable-tls"); |
