diff --git a/config.toml.example b/config.toml.example index 466a3a29c4c78..6e53d9b442f16 100644 --- a/config.toml.example +++ b/config.toml.example @@ -89,7 +89,7 @@ changelog-seen = 2 # Link libstdc++ statically into the rustc_llvm instead of relying on a # dynamic version to be available. -#static-libstdcpp = false +#static-libstdcpp = true # Whether to use Ninja to build LLVM. This runs much faster than make. #ninja = true diff --git a/src/bootstrap/config.rs b/src/bootstrap/config.rs index 73a855ae4d72a..9b5cd2d259b43 100644 --- a/src/bootstrap/config.rs +++ b/src/bootstrap/config.rs @@ -591,6 +591,7 @@ impl Config { config.llvm_optimize = true; config.ninja_in_file = true; config.llvm_version_check = true; + config.llvm_static_stdcpp = true; config.backtrace = true; config.rust_optimize = true; config.rust_optimize_tests = true; diff --git a/src/bootstrap/native.rs b/src/bootstrap/native.rs index 0fe39defae85d..a810a57feb7bb 100644 --- a/src/bootstrap/native.rs +++ b/src/bootstrap/native.rs @@ -566,7 +566,7 @@ fn configure_cmake( // For distribution we want the LLVM tools to be *statically* linked to libstdc++. // We also do this if the user explicitly requested static libstdc++. - if builder.config.llvm_tools_enabled || builder.config.llvm_static_stdcpp { + if builder.config.llvm_static_stdcpp { if !target.contains("msvc") && !target.contains("netbsd") { if target.contains("apple") { ldflags.push_all("-static-libstdc++");