diff options
| author | Alex Crichton <alex@alexcrichton.com> | 2019-01-07 13:47:35 -0800 |
|---|---|---|
| committer | Alex Crichton <alex@alexcrichton.com> | 2019-01-07 19:48:16 -0800 |
| commit | d58555323ff5b6aaf7b95876f256a6f1d2fe0e03 (patch) | |
| tree | 5629105d5e2c2fc609b9e91e9b08b2c59a9a3dfd | |
| parent | 59e70f27756a57b16a48bd7262e67fda01744701 (diff) | |
| download | rust-d58555323ff5b6aaf7b95876f256a6f1d2fe0e03.tar.gz rust-d58555323ff5b6aaf7b95876f256a6f1d2fe0e03.zip | |
Build LLVM with -static-libstdc++ on dist builds
This commit is intended on fixing a regression from #57286 where the distributed LLVM shared library unfortunately depends on a dynamic copy of libstdc++, meaning we're no longer as binary compatible as we thought! This tweaks the build of LLVM as out distribution is slightly different now, and is hoped to fix the issue. Closes #57426
| -rw-r--r-- | src/bootstrap/native.rs | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/bootstrap/native.rs b/src/bootstrap/native.rs index c548d7f6948..7ddfc385fc0 100644 --- a/src/bootstrap/native.rs +++ b/src/bootstrap/native.rs @@ -235,7 +235,7 @@ impl Step for Llvm { cfg.define("PYTHON_EXECUTABLE", python); } - configure_cmake(builder, target, &mut cfg, false); + configure_cmake(builder, target, &mut cfg); // FIXME: we don't actually need to build all LLVM tools and all LLVM // libraries here, e.g., we just want a few components and a few @@ -277,8 +277,7 @@ fn check_llvm_version(builder: &Builder, llvm_config: &Path) { fn configure_cmake(builder: &Builder, target: Interned<String>, - cfg: &mut cmake::Config, - building_dist_binaries: bool) { + cfg: &mut cmake::Config) { if builder.config.ninja { cfg.generator("Ninja"); } @@ -363,10 +362,11 @@ fn configure_cmake(builder: &Builder, cfg.build_arg("-j").build_arg(builder.jobs().to_string()); cfg.define("CMAKE_C_FLAGS", builder.cflags(target, GitRepo::Llvm).join(" ")); let mut cxxflags = builder.cflags(target, GitRepo::Llvm).join(" "); - if building_dist_binaries { - if builder.config.llvm_static_stdcpp && !target.contains("windows") { - cxxflags.push_str(" -static-libstdc++"); - } + if builder.config.llvm_static_stdcpp && + !target.contains("windows") && + !target.contains("netbsd") + { + cxxflags.push_str(" -static-libstdc++"); } cfg.define("CMAKE_CXX_FLAGS", cxxflags); if let Some(ar) = builder.ar(target) { @@ -431,7 +431,7 @@ impl Step for Lld { t!(fs::create_dir_all(&out_dir)); let mut cfg = cmake::Config::new(builder.src.join("src/tools/lld")); - configure_cmake(builder, target, &mut cfg, true); + configure_cmake(builder, target, &mut cfg); // This is an awful, awful hack. Discovered when we migrated to using // clang-cl to compile LLVM/LLD it turns out that LLD, when built out of |
