Skip to content

Commit 73df30d

Browse files
committed
Auto merge of #46273 - semarie:openbsd-libc++, r=alexcrichton
make OpenBSD to use libc++ instead of (e)stdc++
2 parents 9015b14 + 3ef39d3 commit 73df30d

File tree

4 files changed

+5
-4
lines changed

4 files changed

+5
-4
lines changed

src/librustc_back/target/openbsd_base.rs

+1
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ pub fn opts() -> TargetOptions {
3434
is_like_openbsd: true,
3535
pre_link_args: args,
3636
position_independent_executables: true,
37+
eliminate_frame_pointer: false, // FIXME 43575
3738
relro_level: RelroLevel::Full,
3839
.. Default::default()
3940
}

src/librustc_llvm/build.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -252,8 +252,8 @@ fn main() {
252252
let llvm_static_stdcpp = env::var_os("LLVM_STATIC_STDCPP");
253253

254254
let stdcppname = if target.contains("openbsd") {
255-
// OpenBSD has a particular C++ runtime library name
256-
"estdc++"
255+
// llvm-config on OpenBSD doesn't mention stdlib=libc++
256+
"c++"
257257
} else if target.contains("netbsd") && llvm_static_stdcpp.is_some() {
258258
// NetBSD uses a separate library when relocation is required
259259
"stdc++_pic"

src/libunwind/build.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ fn main() {
2727
} else if target.contains("netbsd") {
2828
println!("cargo:rustc-link-lib=gcc_s");
2929
} else if target.contains("openbsd") {
30-
println!("cargo:rustc-link-lib=gcc");
30+
println!("cargo:rustc-link-lib=c++abi");
3131
} else if target.contains("solaris") {
3232
println!("cargo:rustc-link-lib=gcc_s");
3333
} else if target.contains("bitrig") {

src/test/run-make/tools.mk

+1-1
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ ifeq ($(UNAME),SunOS)
9292
EXTRACFLAGS := -lm -lpthread -lposix4 -lsocket -lresolv
9393
else
9494
ifeq ($(UNAME),OpenBSD)
95-
EXTRACFLAGS := -lm -lpthread
95+
EXTRACFLAGS := -lm -lpthread -lc++abi
9696
RUSTC := $(RUSTC) -C linker="$(word 1,$(CC:ccache=))"
9797
else
9898
EXTRACFLAGS := -lm -lrt -ldl -lpthread

0 commit comments

Comments
 (0)