More changes to support my OS
This commit is contained in:
parent
ce66368009
commit
606b8f634b
22 changed files with 43 additions and 1 deletions
|
@ -21,6 +21,7 @@ pub(crate) mod msvc;
|
|||
pub(crate) mod netbsd;
|
||||
pub(crate) mod nto_qnx;
|
||||
pub(crate) mod openbsd;
|
||||
pub(crate) mod os;
|
||||
pub(crate) mod redox;
|
||||
pub(crate) mod solaris;
|
||||
pub(crate) mod solid;
|
||||
|
|
11
compiler/rustc_target/src/spec/base/os.rs
Normal file
11
compiler/rustc_target/src/spec/base/os.rs
Normal file
|
@ -0,0 +1,11 @@
|
|||
use crate::spec::{PanicStrategy, RelocModel, TargetOptions, crt_objects};
|
||||
|
||||
pub(crate) fn opts() -> TargetOptions {
|
||||
TargetOptions {
|
||||
os: "os".into(),
|
||||
relocation_model: RelocModel::Static,
|
||||
panic_strategy: PanicStrategy::Abort,
|
||||
pre_link_objects: crt_objects::pre_os(),
|
||||
..Default::default()
|
||||
}
|
||||
}
|
|
@ -122,3 +122,7 @@ pub(super) fn pre_wasi_self_contained() -> CrtObjects {
|
|||
pub(super) fn post_wasi_self_contained() -> CrtObjects {
|
||||
new(&[])
|
||||
}
|
||||
|
||||
pub(super) fn pre_os() -> CrtObjects {
|
||||
all("crt0.o")
|
||||
}
|
||||
|
|
|
@ -1946,6 +1946,7 @@ supported_targets! {
|
|||
("riscv32imafc-unknown-nuttx-elf", riscv32imafc_unknown_nuttx_elf),
|
||||
("riscv64imac-unknown-nuttx-elf", riscv64imac_unknown_nuttx_elf),
|
||||
("riscv64gc-unknown-nuttx-elf", riscv64gc_unknown_nuttx_elf),
|
||||
("x86_64-unknown-os", x86_64_unknown_os),
|
||||
|
||||
}
|
||||
|
||||
|
|
20
compiler/rustc_target/src/spec/targets/x86_64_unknown_os.rs
Normal file
20
compiler/rustc_target/src/spec/targets/x86_64_unknown_os.rs
Normal file
|
@ -0,0 +1,20 @@
|
|||
use crate::spec::{Target, TargetMetadata, base};
|
||||
|
||||
pub(crate) fn target() -> Target {
|
||||
let mut base = base::os::opts();
|
||||
base.cpu = "x86-64".into();
|
||||
Target {
|
||||
llvm_target: "x86_64-unknown-none".into(),
|
||||
metadata: TargetMetadata {
|
||||
description: None,
|
||||
tier: None,
|
||||
host_tools: Some(false),
|
||||
std: Some(true),
|
||||
},
|
||||
pointer_width: 64,
|
||||
arch: "x86_64".into(),
|
||||
data_layout:
|
||||
"e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128".into(),
|
||||
options: base,
|
||||
}
|
||||
}
|
|
@ -151,5 +151,5 @@ check-cfg = [
|
|||
# of declared features, we therefor expect any feature cfg
|
||||
'cfg(feature, values(any()))',
|
||||
# #[cfg(bootstrap)] rtems
|
||||
'cfg(target_os, values("rtems"))',
|
||||
'cfg(target_os, values("rtems", "os"))',
|
||||
]
|
||||
|
|
|
@ -56,6 +56,7 @@ fn main() {
|
|||
|| target_os == "zkvm"
|
||||
|| target_os == "rtems"
|
||||
|| target_os == "nuttx"
|
||||
|| target_os == "os"
|
||||
|
||||
// See src/bootstrap/src/core/build_steps/synthetic_targets.rs
|
||||
|| env::var("RUSTC_BOOTSTRAP_SYNTHETIC_TARGET").is_ok()
|
||||
|
|
|
@ -61,6 +61,9 @@ cfg_if::cfg_if! {
|
|||
} else if #[cfg(target_os = "zkvm")] {
|
||||
mod zkvm;
|
||||
pub use self::zkvm::*;
|
||||
} else if #[cfg(target_os = "os")] {
|
||||
mod osstd;
|
||||
pub use self::osstd::*;
|
||||
} else {
|
||||
mod unsupported;
|
||||
pub use self::unsupported::*;
|
||||
|
|
|
@ -28,6 +28,7 @@ cfg_if::cfg_if! {
|
|||
all(target_family = "wasm", not(target_feature = "atomics")),
|
||||
target_os = "uefi",
|
||||
target_os = "zkvm",
|
||||
target_os = "os",
|
||||
))] {
|
||||
mod statik;
|
||||
pub use statik::{EagerStorage, LazyStorage, thread_local_inner};
|
||||
|
|
Loading…
Add table
Reference in a new issue