Skip to content

Commit

Permalink
Add i686-unknown-openbsd target.
Browse files Browse the repository at this point in the history
  • Loading branch information
semarie committed Nov 30, 2016
1 parent 5de15be commit 7592756
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 0 deletions.
24 changes: 24 additions & 0 deletions mk/cfg/i686-unknown-openbsd.mk
@@ -0,0 +1,24 @@
# i686-unknown-openbsd configuration
CC_i686-unknown-openbsd=$(CC)
CXX_i686-unknown-openbsd=$(CXX)
CPP_i686-unknown-openbsd=$(CPP)
AR_i686-unknown-openbsd=$(AR)
CFG_LIB_NAME_i686-unknown-openbsd=lib$(1).so
CFG_STATIC_LIB_NAME_i686-unknown-openbsd=lib$(1).a
CFG_LIB_GLOB_i686-unknown-openbsd=lib$(1)-*.so
CFG_LIB_DSYM_GLOB_i686-unknown-openbsd=$(1)-*.dylib.dSYM
CFG_JEMALLOC_CFLAGS_i686-unknown-openbsd := -m32 -I/usr/include $(CFLAGS)
CFG_GCCISH_CFLAGS_i686-unknown-openbsd := -g -fPIC -m32 -I/usr/include $(CFLAGS)
CFG_GCCISH_LINK_FLAGS_i686-unknown-openbsd := -shared -fPIC -g -pthread -m32
CFG_GCCISH_DEF_FLAG_i686-unknown-openbsd := -Wl,--export-dynamic,--dynamic-list=
CFG_LLC_FLAGS_i686-unknown-openbsd :=
CFG_INSTALL_NAME_i686-unknown-openbsd =
CFG_EXE_SUFFIX_i686-unknown-openbsd :=
CFG_WINDOWSY_i686-unknown-openbsd :=
CFG_UNIXY_i686-unknown-openbsd := 1
CFG_LDPATH_i686-unknown-openbsd :=
CFG_RUN_i686-unknown-openbsd=$(2)
CFG_RUN_TARG_i686-unknown-openbsd=$(call CFG_RUN_i686-unknown-openbsd,,$(2))
CFG_GNU_TRIPLE_i686-unknown-openbsd := i686-unknown-openbsd
RUSTC_FLAGS_i686-unknown-openbsd=-C linker=$(call FIND_COMPILER,$(CC))
CFG_DISABLE_JEMALLOC_i686-unknown-openbsd := 1
30 changes: 30 additions & 0 deletions src/librustc_back/target/i686_unknown_openbsd.rs
@@ -0,0 +1,30 @@
// Copyright 2016 The Rust Project Developers. See the COPYRIGHT
// file at the top-level directory of this distribution and at
// http://rust-lang.org/COPYRIGHT.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.

use target::{Target, TargetResult};

pub fn target() -> TargetResult {
let mut base = super::openbsd_base::opts();
base.cpu = "pentium4".to_string();
base.max_atomic_width = Some(64);
base.pre_link_args.push("-m32".to_string());

Ok(Target {
llvm_target: "i686-unknown-openbsd".to_string(),
target_endian: "little".to_string(),
target_pointer_width: "32".to_string(),
data_layout: "e-m:e-p:32:32-f64:32:64-f80:32-n8:16:32-S128".to_string(),
arch: "x86".to_string(),
target_os: "openbsd".to_string(),
target_env: "".to_string(),
target_vendor: "unknown".to_string(),
options: base,
})
}
3 changes: 3 additions & 0 deletions src/librustc_back/target/mod.rs
Expand Up @@ -168,7 +168,10 @@ supported_targets! {
("x86_64-unknown-dragonfly", x86_64_unknown_dragonfly),

("x86_64-unknown-bitrig", x86_64_unknown_bitrig),

("i686-unknown-openbsd", i686_unknown_openbsd),
("x86_64-unknown-openbsd", x86_64_unknown_openbsd),

("x86_64-unknown-netbsd", x86_64_unknown_netbsd),
("x86_64-rumprun-netbsd", x86_64_rumprun_netbsd),

Expand Down

0 comments on commit 7592756

Please sign in to comment.