-
Notifications
You must be signed in to change notification settings - Fork 13k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto merge of #28593 - gandro:rumprun, r=alexcrichton
This adds a new target, `x86_64-rumprun-netbsd`, and related changes to `std`. Rumprun is a unikernel platform that provides a POSIX-y interface. For the most part, rumprun uses NetBSD's libc and drivers, therefore `target_os` is `netbsd`. However, being a unikernel, rumprun does not support process management, signals or virtual memory, so related functions might fail at runtime. For this reason, stack guards are disabled in `std`. To support conditional compilation, `target_env` is set to `rumprun`. Maybe `target_vendor` would be technically more fitting, but it doesn't seem to be worth the hassle. Code for rumprun is always cross-compiled, it uses always static linking and needs a custom linker. The target makes use of the newly introduced `no_default_libs` flag, as the rumprun linker will otherwise not use the correct search path.
- Loading branch information
Showing
9 changed files
with
85 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# x86_64-rumprun-netbsd configuration | ||
CROSS_PREFIX_x86_64-rumprun-netbsd=x86_64-rumprun-netbsd- | ||
CC_x86_64-rumprun-netbsd=gcc | ||
CXX_x86_64-rumprun-netbsd=g++ | ||
CPP_x86_64-rumprun-netbsd=gcc -E | ||
AR_x86_64-rumprun-netbsd=ar | ||
CFG_INSTALL_ONLY_RLIB_x86_64-rumprun-netbsd = 1 | ||
CFG_LIB_NAME_x86_64-rumprun-netbsd=lib$(1).so | ||
CFG_STATIC_LIB_NAME_x86_64-rumprun-netbsd=lib$(1).a | ||
CFG_LIB_GLOB_x86_64-rumprun-netbsd=lib$(1)-*.so | ||
CFG_JEMALLOC_CFLAGS_x86_64-rumprun-netbsd := -m64 | ||
CFG_GCCISH_CFLAGS_x86_64-rumprun-netbsd := -Wall -Werror -g -fPIC -m64 | ||
CFG_GCCISH_CXXFLAGS_x86_64-rumprun-netbsd := | ||
CFG_GCCISH_LINK_FLAGS_x86_64-rumprun-netbsd := | ||
CFG_GCCISH_DEF_FLAG_x86_64-rumprun-netbsd := | ||
CFG_LLC_FLAGS_x86_64-rumprun-netbsd := | ||
CFG_INSTALL_NAME_x86_64-rumprun-netbsd = | ||
CFG_EXE_SUFFIX_x86_64-rumprun-netbsd = | ||
CFG_WINDOWSY_x86_64-rumprun-netbsd := | ||
CFG_UNIXY_x86_64-rumprun-netbsd := 1 | ||
CFG_LDPATH_x86_64-rumprun-netbsd := | ||
CFG_RUN_x86_64-rumprun-netbsd=$(2) | ||
CFG_RUN_TARG_x86_64-rumprun-netbsd=$(call CFG_RUN_x86_64-rumprun-netbsd,,$(2)) | ||
CFG_GNU_TRIPLE_x86_64-rumprun-netbsd := x86_64-rumprun-netbsd |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
// Copyright 2014-2015 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; | ||
|
||
pub fn target() -> Target { | ||
let mut base = super::netbsd_base::opts(); | ||
base.pre_link_args.push("-m64".to_string()); | ||
base.linker = "x86_64-rumprun-netbsd-gcc".to_string(); | ||
base.ar = "x86_64-rumprun-netbsd-ar".to_string(); | ||
|
||
base.dynamic_linking = false; | ||
base.has_rpath = false; | ||
base.position_independent_executables = false; | ||
base.disable_redzone = true; | ||
base.no_default_libraries = false; | ||
|
||
Target { | ||
llvm_target: "x86_64-rumprun-netbsd".to_string(), | ||
target_endian: "little".to_string(), | ||
target_pointer_width: "64".to_string(), | ||
arch: "x86_64".to_string(), | ||
target_os: "netbsd".to_string(), | ||
target_env: "".to_string(), | ||
target_vendor: "rumprun".to_string(), | ||
options: base, | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters