From 43a51b78b8c24f2bd40b20d1a082db1443075c19 Mon Sep 17 00:00:00 2001 From: Tim Neumann Date: Sun, 19 Mar 2017 19:31:49 +0100 Subject: [PATCH] link agains relocatable libstdc++ --- src/librustc_llvm/build.rs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/librustc_llvm/build.rs b/src/librustc_llvm/build.rs index 7f53e21675c..42717ec289c 100644 --- a/src/librustc_llvm/build.rs +++ b/src/librustc_llvm/build.rs @@ -233,16 +233,21 @@ fn main() { } } - // OpenBSD has a particular C++ runtime library name + let llvm_static_stdcpp = env::var_os("LLVM_STATIC_STDCPP"); + let stdcppname = if target.contains("openbsd") { + // OpenBSD has a particular C++ runtime library name "estdc++" + } else if target.contains("netbsd") && llvm_static_stdcpp.is_some() { + // NetBSD uses a separate library when relocation is required + "stdc++_pic" } else { "stdc++" }; // C++ runtime library if !target.contains("msvc") { - if let Some(s) = env::var_os("LLVM_STATIC_STDCPP") { + if let Some(s) = llvm_static_stdcpp { assert!(!cxxflags.contains("stdlib=libc++")); let path = PathBuf::from(s); println!("cargo:rustc-link-search=native={}",