Skip to content

Commit 43a51b7

Browse files
committed
link agains relocatable libstdc++
1 parent ba90248 commit 43a51b7

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

src/librustc_llvm/build.rs

+7-2
Original file line numberDiff line numberDiff line change
@@ -233,16 +233,21 @@ fn main() {
233233
}
234234
}
235235

236-
// OpenBSD has a particular C++ runtime library name
236+
let llvm_static_stdcpp = env::var_os("LLVM_STATIC_STDCPP");
237+
237238
let stdcppname = if target.contains("openbsd") {
239+
// OpenBSD has a particular C++ runtime library name
238240
"estdc++"
241+
} else if target.contains("netbsd") && llvm_static_stdcpp.is_some() {
242+
// NetBSD uses a separate library when relocation is required
243+
"stdc++_pic"
239244
} else {
240245
"stdc++"
241246
};
242247

243248
// C++ runtime library
244249
if !target.contains("msvc") {
245-
if let Some(s) = env::var_os("LLVM_STATIC_STDCPP") {
250+
if let Some(s) = llvm_static_stdcpp {
246251
assert!(!cxxflags.contains("stdlib=libc++"));
247252
let path = PathBuf::from(s);
248253
println!("cargo:rustc-link-search=native={}",

0 commit comments

Comments
 (0)