From 6d9f3590c5d7d93d3ba02728e7d4f16f0148812d Mon Sep 17 00:00:00 2001 From: "Jonathan A. Kollasch" Date: Mon, 23 Jan 2017 10:21:14 -0600 Subject: [PATCH 1/2] Add i686-unknown-netbsdelf target --- mk/cfg/i686-unknown-netbsdelf.mk | 1 + .../target/i686_unknown_netbsdelf.rs | 30 +++++++++++++++++++ src/librustc_back/target/mod.rs | 1 + 3 files changed, 32 insertions(+) create mode 100644 mk/cfg/i686-unknown-netbsdelf.mk create mode 100644 src/librustc_back/target/i686_unknown_netbsdelf.rs diff --git a/mk/cfg/i686-unknown-netbsdelf.mk b/mk/cfg/i686-unknown-netbsdelf.mk new file mode 100644 index 0000000000000..34aee77ae2107 --- /dev/null +++ b/mk/cfg/i686-unknown-netbsdelf.mk @@ -0,0 +1 @@ +# rustbuild-only target diff --git a/src/librustc_back/target/i686_unknown_netbsdelf.rs b/src/librustc_back/target/i686_unknown_netbsdelf.rs new file mode 100644 index 0000000000000..e7e2ee3f9056a --- /dev/null +++ b/src/librustc_back/target/i686_unknown_netbsdelf.rs @@ -0,0 +1,30 @@ +// Copyright 2017 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 or the MIT license +// , 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::netbsd_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-netbsdelf".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: "netbsd".to_string(), + target_env: "".to_string(), + target_vendor: "unknown".to_string(), + options: base, + }) +} diff --git a/src/librustc_back/target/mod.rs b/src/librustc_back/target/mod.rs index 5afa85d155279..2cfa75475a295 100644 --- a/src/librustc_back/target/mod.rs +++ b/src/librustc_back/target/mod.rs @@ -176,6 +176,7 @@ supported_targets! { ("i686-unknown-openbsd", i686_unknown_openbsd), ("x86_64-unknown-openbsd", x86_64_unknown_openbsd), + ("i686-unknown-netbsdelf", i686_unknown_netbsdelf), ("sparc64-unknown-netbsd", sparc64_unknown_netbsd), ("x86_64-unknown-netbsd", x86_64_unknown_netbsd), ("x86_64-rumprun-netbsd", x86_64_rumprun_netbsd), From 78f542b78a1095f71f8c0edf0638a1873346f91e Mon Sep 17 00:00:00 2001 From: "Jonathan A. Kollasch" Date: Mon, 6 Feb 2017 08:49:16 -0600 Subject: [PATCH 2/2] Rename i686-unknown-netbsdelf target to i686-unknown-netbsd --- mk/cfg/{i686-unknown-netbsdelf.mk => i686-unknown-netbsd.mk} | 0 .../{i686_unknown_netbsdelf.rs => i686_unknown_netbsd.rs} | 0 src/librustc_back/target/mod.rs | 2 +- 3 files changed, 1 insertion(+), 1 deletion(-) rename mk/cfg/{i686-unknown-netbsdelf.mk => i686-unknown-netbsd.mk} (100%) rename src/librustc_back/target/{i686_unknown_netbsdelf.rs => i686_unknown_netbsd.rs} (100%) diff --git a/mk/cfg/i686-unknown-netbsdelf.mk b/mk/cfg/i686-unknown-netbsd.mk similarity index 100% rename from mk/cfg/i686-unknown-netbsdelf.mk rename to mk/cfg/i686-unknown-netbsd.mk diff --git a/src/librustc_back/target/i686_unknown_netbsdelf.rs b/src/librustc_back/target/i686_unknown_netbsd.rs similarity index 100% rename from src/librustc_back/target/i686_unknown_netbsdelf.rs rename to src/librustc_back/target/i686_unknown_netbsd.rs diff --git a/src/librustc_back/target/mod.rs b/src/librustc_back/target/mod.rs index 2cfa75475a295..638ca6dcd60c0 100644 --- a/src/librustc_back/target/mod.rs +++ b/src/librustc_back/target/mod.rs @@ -176,7 +176,7 @@ supported_targets! { ("i686-unknown-openbsd", i686_unknown_openbsd), ("x86_64-unknown-openbsd", x86_64_unknown_openbsd), - ("i686-unknown-netbsdelf", i686_unknown_netbsdelf), + ("i686-unknown-netbsd", i686_unknown_netbsd), ("sparc64-unknown-netbsd", sparc64_unknown_netbsd), ("x86_64-unknown-netbsd", x86_64_unknown_netbsd), ("x86_64-rumprun-netbsd", x86_64_rumprun_netbsd),