make OpenBSD to use libc++ instead of (e)stdc++

This commit is contained in:
Sébastien Marie
2017-11-26 10:08:25 +01:00
parent 2f84fb5cc1
commit 3ef39d3cb6
4 changed files with 5 additions and 4 deletions

View File

@@ -34,6 +34,7 @@ pub fn opts() -> TargetOptions {
is_like_openbsd: true, is_like_openbsd: true,
pre_link_args: args, pre_link_args: args,
position_independent_executables: true, position_independent_executables: true,
eliminate_frame_pointer: false, // FIXME 43575
relro_level: RelroLevel::Full, relro_level: RelroLevel::Full,
.. Default::default() .. Default::default()
} }

View File

@@ -252,8 +252,8 @@ fn main() {
let llvm_static_stdcpp = env::var_os("LLVM_STATIC_STDCPP"); let llvm_static_stdcpp = env::var_os("LLVM_STATIC_STDCPP");
let stdcppname = if target.contains("openbsd") { let stdcppname = if target.contains("openbsd") {
// OpenBSD has a particular C++ runtime library name // llvm-config on OpenBSD doesn't mention stdlib=libc++
"estdc++" "c++"
} else if target.contains("netbsd") && llvm_static_stdcpp.is_some() { } else if target.contains("netbsd") && llvm_static_stdcpp.is_some() {
// NetBSD uses a separate library when relocation is required // NetBSD uses a separate library when relocation is required
"stdc++_pic" "stdc++_pic"

View File

@@ -27,7 +27,7 @@ fn main() {
} else if target.contains("netbsd") { } else if target.contains("netbsd") {
println!("cargo:rustc-link-lib=gcc_s"); println!("cargo:rustc-link-lib=gcc_s");
} else if target.contains("openbsd") { } else if target.contains("openbsd") {
println!("cargo:rustc-link-lib=gcc"); println!("cargo:rustc-link-lib=c++abi");
} else if target.contains("solaris") { } else if target.contains("solaris") {
println!("cargo:rustc-link-lib=gcc_s"); println!("cargo:rustc-link-lib=gcc_s");
} else if target.contains("bitrig") { } else if target.contains("bitrig") {

View File

@@ -92,7 +92,7 @@ ifeq ($(UNAME),SunOS)
EXTRACFLAGS := -lm -lpthread -lposix4 -lsocket -lresolv EXTRACFLAGS := -lm -lpthread -lposix4 -lsocket -lresolv
else else
ifeq ($(UNAME),OpenBSD) ifeq ($(UNAME),OpenBSD)
EXTRACFLAGS := -lm -lpthread EXTRACFLAGS := -lm -lpthread -lc++abi
RUSTC := $(RUSTC) -C linker="$(word 1,$(CC:ccache=))" RUSTC := $(RUSTC) -C linker="$(word 1,$(CC:ccache=))"
else else
EXTRACFLAGS := -lm -lrt -ldl -lpthread EXTRACFLAGS := -lm -lrt -ldl -lpthread