diff options
| author | Tim Neumann <mail@timnn.me> | 2017-03-19 19:31:49 +0100 |
|---|---|---|
| committer | Tim Neumann <mail@timnn.me> | 2017-03-21 20:37:50 +0100 |
| commit | 43a51b78b8c24f2bd40b20d1a082db1443075c19 (patch) | |
| tree | 62c479cc57868fcdd04260ed88df58febf0ade15 | |
| parent | ba90248dac1f3ee124623209b3eaa3e310679298 (diff) | |
| download | rust-43a51b78b8c24f2bd40b20d1a082db1443075c19.tar.gz rust-43a51b78b8c24f2bd40b20d1a082db1443075c19.zip | |
link agains relocatable libstdc++
| -rw-r--r-- | src/librustc_llvm/build.rs | 9 |
1 files 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={}", |
