From 8e673073f349f9b7cadaf809f8b88a2bfd296769 Mon Sep 17 00:00:00 2001 From: Jorge Aparicio Date: Tue, 1 May 2018 06:34:24 +0200 Subject: [PATCH] statically link the tools to libstdc++ --- src/bootstrap/native.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/bootstrap/native.rs b/src/bootstrap/native.rs index 2f6af1e0640..74083360aca 100644 --- a/src/bootstrap/native.rs +++ b/src/bootstrap/native.rs @@ -174,6 +174,11 @@ impl Step for Llvm { cfg.define("LLVM_LINK_LLVM_DYLIB", "ON"); } + // For distribution we want the LLVM tools to be *statically* linked to libstdc++ + if builder.config.ship_llvm_tools { + cfg.define("CMAKE_EXE_LINKER_FLAGS", "-Wl,-Bsymbolic -static-libstdc++"); + } + if target.contains("msvc") { cfg.define("LLVM_USE_CRT_DEBUG", "MT"); cfg.define("LLVM_USE_CRT_RELEASE", "MT");