Skip to content

Commit fcb30a0

Browse files
committed
openbsd support
1 parent f1f9cb7 commit fcb30a0

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+1066
-102
lines changed

configure

+4
Original file line numberDiff line numberDiff line change
@@ -374,6 +374,10 @@ case $CFG_OSTYPE in
374374
CFG_OSTYPE=unknown-dragonfly
375375
;;
376376

377+
OpenBSD)
378+
CFG_OSTYPE=unknown-openbsd
379+
;;
380+
377381
Darwin)
378382
CFG_OSTYPE=apple-darwin
379383
;;

mk/cfg/x86_64-unknown-openbsd.mk

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# x86_64-pc-openbsd-elf configuration
2+
CC_x86_64-unknown-openbsd=$(CC)
3+
CXX_x86_64-unknown-openbsd=$(CXX)
4+
CPP_x86_64-unknown-openbsd=$(CPP)
5+
AR_x86_64-unknown-openbsd=$(AR)
6+
CFG_LIB_NAME_x86_64-unknown-openbsd=lib$(1).so
7+
CFG_STATIC_LIB_NAME_x86_64-unknown-openbsd=lib$(1).a
8+
CFG_LIB_GLOB_x86_64-unknown-openbsd=lib$(1)-*.so
9+
CFG_LIB_DSYM_GLOB_x86_64-unknown-openbsd=$(1)-*.dylib.dSYM
10+
CFG_JEMALLOC_CFLAGS_x86_64-unknown-openbsd := -m64 -I/usr/include $(CFLAGS)
11+
CFG_GCCISH_CFLAGS_x86_64-unknown-openbsd := -Wall -Werror -g -fPIC -m64 -I/usr/include $(CFLAGS)
12+
CFG_GCCISH_LINK_FLAGS_x86_64-unknown-openbsd := -shared -fPIC -g -pthread -m64
13+
CFG_GCCISH_DEF_FLAG_x86_64-unknown-openbsd := -Wl,--export-dynamic,--dynamic-list=
14+
CFG_GCCISH_PRE_LIB_FLAGS_x86_64-unknown-openbsd := -Wl,-whole-archive
15+
CFG_GCCISH_POST_LIB_FLAGS_x86_64-unknown-openbsd := -Wl,-no-whole-archive
16+
CFG_DEF_SUFFIX_x86_64-unknown-openbsd := .bsd.def
17+
CFG_LLC_FLAGS_x86_64-unknown-openbsd :=
18+
CFG_INSTALL_NAME_x86_64-unknown-openbsd =
19+
CFG_EXE_SUFFIX_x86_64-unknown-openbsd :=
20+
CFG_WINDOWSY_x86_64-unknown-openbsd :=
21+
CFG_UNIXY_x86_64-unknown-openbsd := 1
22+
CFG_PATH_MUNGE_x86_64-unknown-openbsd :=
23+
CFG_LDPATH_x86_64-unknown-openbsd :=
24+
CFG_RUN_x86_64-unknown-openbsd=$(2)
25+
CFG_RUN_TARG_x86_64-unknown-openbsd=$(call CFG_RUN_x86_64-unknown-openbsd,,$(2))
26+
CFG_GNU_TRIPLE_x86_64-unknown-openbsd := x86_64-unknown-openbsd

src/compiletest/util.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2012 The Rust Project Developers. See the COPYRIGHT
1+
// Copyright 2012-2015 The Rust Project Developers. See the COPYRIGHT
22
// file at the top-level directory of this distribution and at
33
// http://rust-lang.org/COPYRIGHT.
44
//
@@ -23,6 +23,7 @@ static OS_TABLE: &'static [(&'static str, &'static str)] = &[
2323
("linux", "linux"),
2424
("freebsd", "freebsd"),
2525
("dragonfly", "dragonfly"),
26+
("openbsd", "openbsd"),
2627
];
2728

2829
pub fn get_os(triple: &str) -> &'static str {

src/doc/reference.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -2195,7 +2195,8 @@ The following configurations must be defined by the implementation:
21952195
`"unix"` or `"windows"`. The value of this configuration option is defined
21962196
as a configuration itself, like `unix` or `windows`.
21972197
* `target_os = "..."`. Operating system of the target, examples include
2198-
`"win32"`, `"macos"`, `"linux"`, `"android"`, `"freebsd"` or `"dragonfly"`.
2198+
`"win32"`, `"macos"`, `"linux"`, `"android"`, `"freebsd"`, `"dragonfly"` or
2199+
`"openbsd"`.
21992200
* `target_word_size = "..."`. Target word size in bits. This is set to `"32"`
22002201
for targets with 32-bit pointers, and likewise set to `"64"` for 64-bit
22012202
pointers.

src/etc/local_stage0.sh

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/bin/sh
2-
# Copyright 2014 The Rust Project Developers. See the COPYRIGHT
2+
# Copyright 2014-2015 The Rust Project Developers. See the COPYRIGHT
33
# file at the top-level directory of this distribution and at
44
# http://rust-lang.org/COPYRIGHT.
55
#
@@ -18,7 +18,7 @@ LIB_PREFIX=lib
1818

1919
OS=`uname -s`
2020
case $OS in
21-
("Linux"|"FreeBSD"|"DragonFly")
21+
("Linux"|"FreeBSD"|"DragonFly"|"OpenBSD")
2222
BIN_SUF=
2323
LIB_SUF=.so
2424
;;

src/etc/snapshot.py

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2011-2014 The Rust Project Developers. See the COPYRIGHT
1+
# Copyright 2011-2015 The Rust Project Developers. See the COPYRIGHT
22
# file at the top-level directory of this distribution and at
33
# http://rust-lang.org/COPYRIGHT.
44
#
@@ -46,6 +46,7 @@ def scrub(b):
4646
"winnt": ["bin/rustc.exe"],
4747
"freebsd": ["bin/rustc"],
4848
"dragonfly": ["bin/rustc"],
49+
"openbsd": ["bin/rustc"],
4950
}
5051

5152
winnt_runtime_deps_32 = ["libgcc_s_dw2-1.dll", "libstdc++-6.dll"]
@@ -100,6 +101,8 @@ def get_kernel(triple):
100101
return "freebsd"
101102
if os_name == "dragonfly":
102103
return "dragonfly"
104+
if os_name == "openbsd":
105+
return "openbsd"
103106
return "linux"
104107

105108

src/libbacktrace/configure

+1-1
Original file line numberDiff line numberDiff line change
@@ -9332,7 +9332,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
93329332
;;
93339333
93349334
# FreeBSD 3 and greater uses gcc -shared to do shared libraries.
9335-
freebsd* | dragonfly*)
9335+
freebsd* | dragonfly* | openbsd*)
93369336
archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
93379337
hardcode_libdir_flag_spec='-R$libdir'
93389338
hardcode_direct=yes

0 commit comments

Comments
 (0)