Compare commits
16 Commits
main
...
387e586086
| Author | SHA1 | Date | |
|---|---|---|---|
| 387e586086 | |||
| a134536d2f | |||
| 48a75485b6 | |||
| 3121c0b68b | |||
| 45d23efe77 | |||
| fc3a04a20e | |||
| 9b8afd2c5c | |||
| a087bdd523 | |||
| 51780b3a78 | |||
| 9413fba265 | |||
| fd0770f813 | |||
| 10be5b301c | |||
| 72989d86a8 | |||
| 9958b23c89 | |||
| 56ad115e58 | |||
| 56a00d0403 |
@@ -3,10 +3,9 @@ target = "riscv64.json"
|
|||||||
|
|
||||||
[unstable]
|
[unstable]
|
||||||
json-target-spec = true
|
json-target-spec = true
|
||||||
build-std = ["core", "compiler_builtins", "alloc"]
|
|
||||||
build-std-features = ["compiler-builtins-mem"]
|
|
||||||
|
|
||||||
[target.riscv64]
|
[target.riscv64]
|
||||||
rustflags = [
|
rustflags = [
|
||||||
"-C", "link-arg=-Tilm.ld",
|
"-C", "link-arg=-Tilm.ld",
|
||||||
|
"--sysroot", "sysroot"
|
||||||
]
|
]
|
||||||
|
|||||||
2
.gitignore
vendored
2
.gitignore
vendored
@@ -7,3 +7,5 @@
|
|||||||
disk.img
|
disk.img
|
||||||
**/*.mem
|
**/*.mem
|
||||||
mnt
|
mnt
|
||||||
|
|
||||||
|
sysroot/lib/rustlib/riscv64
|
||||||
|
|||||||
3
.gitmodules
vendored
Normal file
3
.gitmodules
vendored
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
[submodule "library/backtrace"]
|
||||||
|
path = library/backtrace
|
||||||
|
url = https://github.com/rust-lang/backtrace-rs.git
|
||||||
@@ -1,6 +1,7 @@
|
|||||||
[workspace]
|
[workspace]
|
||||||
resolver = "3"
|
resolver = "3"
|
||||||
members = ["crates/bytes-struct","crates/io","crates/os-std", "crates/shared", "user/*"]
|
members = [ "user/*"]
|
||||||
|
exclude = ["library"]
|
||||||
|
|
||||||
[package]
|
[package]
|
||||||
name = "kernel-rust"
|
name = "kernel-rust"
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
#![feature(iterator_try_collect, iter_order_by)]
|
#![feature(iterator_try_collect, iter_order_by)]
|
||||||
|
#![allow(unused_features)]
|
||||||
#![cfg_attr(any(not(feature = "std"), target_arch = "riscv64"), no_std)]
|
#![cfg_attr(any(not(feature = "std"), target_arch = "riscv64"), no_std)]
|
||||||
|
|
||||||
use core::cell::RefCell;
|
use core::cell::RefCell;
|
||||||
|
|||||||
@@ -7,6 +7,6 @@ edition = "2024"
|
|||||||
proc-macro = true
|
proc-macro = true
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
image = "0.25"
|
image = { version = "0.25", default-features = false, features = ["png"] }
|
||||||
syn = { version = "2", features = ["full"] }
|
syn = { version = "2", features = ["full"] }
|
||||||
zyn = "0.5"
|
zyn = "0.5"
|
||||||
|
|||||||
@@ -1,12 +0,0 @@
|
|||||||
[package]
|
|
||||||
name = "os-std-macros"
|
|
||||||
version = "0.1.0"
|
|
||||||
edition = "2024"
|
|
||||||
|
|
||||||
[lib]
|
|
||||||
proc-macro = true
|
|
||||||
|
|
||||||
[dependencies]
|
|
||||||
proc-macro2 = "1"
|
|
||||||
quote = "1"
|
|
||||||
syn = { version = "2", features = ["full"] }
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
[package]
|
|
||||||
name = "os-std"
|
|
||||||
version = "0.1.0"
|
|
||||||
edition = "2024"
|
|
||||||
|
|
||||||
[dependencies]
|
|
||||||
os-std-macros = { path = "../os-std-macros" }
|
|
||||||
shared = { path = "../shared", features = ["user"] }
|
|
||||||
io = { path = "../io", features = ["alloc"] }
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
pub use io::SeekFrom;
|
|
||||||
@@ -1,62 +0,0 @@
|
|||||||
#![no_std]
|
|
||||||
|
|
||||||
extern crate alloc;
|
|
||||||
|
|
||||||
pub mod io;
|
|
||||||
pub mod prelude;
|
|
||||||
|
|
||||||
pub use shared::fs;
|
|
||||||
pub use shared::syscall;
|
|
||||||
|
|
||||||
#[macro_export]
|
|
||||||
macro_rules! custom_std_setup {
|
|
||||||
() => {
|
|
||||||
use $crate::prelude::*;
|
|
||||||
|
|
||||||
extern crate alloc;
|
|
||||||
|
|
||||||
struct GlobalAllocator;
|
|
||||||
|
|
||||||
#[global_allocator]
|
|
||||||
static GLOBAL_ALLOCATOR: GlobalAllocator = GlobalAllocator;
|
|
||||||
|
|
||||||
unsafe impl core::alloc::GlobalAlloc for GlobalAllocator {
|
|
||||||
unsafe fn alloc(&self, layout: core::alloc::Layout) -> *mut u8 {
|
|
||||||
$crate::syscall::alloc(layout)
|
|
||||||
}
|
|
||||||
|
|
||||||
unsafe fn dealloc(&self, ptr: *mut u8, layout: core::alloc::Layout) {
|
|
||||||
$crate::syscall::dealloc(ptr, layout)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#[panic_handler]
|
|
||||||
fn panic(_panic_info: &core::panic::PanicInfo) -> ! {
|
|
||||||
// TODO print
|
|
||||||
loop {}
|
|
||||||
}
|
|
||||||
|
|
||||||
#[unsafe(no_mangle)]
|
|
||||||
pub extern "C" fn _start() {
|
|
||||||
main()
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
|
||||||
#[macro_export]
|
|
||||||
macro_rules! print {
|
|
||||||
($($args:expr),*) => {
|
|
||||||
$crate::syscall::write_string_temp(&format!($($args),*))
|
|
||||||
};
|
|
||||||
}
|
|
||||||
#[macro_export]
|
|
||||||
macro_rules! println {
|
|
||||||
() => {
|
|
||||||
$crate::print!("");
|
|
||||||
// $crate::print!("\n\r");
|
|
||||||
};
|
|
||||||
($($args:expr),*) => {
|
|
||||||
$crate::print!($($args),*);
|
|
||||||
// $crate::println!();
|
|
||||||
};
|
|
||||||
}
|
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
pub use crate::print;
|
|
||||||
pub use crate::println;
|
|
||||||
pub use alloc::format;
|
|
||||||
pub use alloc::string::String;
|
|
||||||
pub use alloc::vec;
|
|
||||||
@@ -1,3 +1,7 @@
|
|||||||
|
use io::{IoBase, Read, Write};
|
||||||
|
|
||||||
|
use crate::syscall;
|
||||||
|
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
pub struct File {
|
pub struct File {
|
||||||
fd: u64,
|
fd: u64,
|
||||||
@@ -6,7 +10,7 @@ pub struct File {
|
|||||||
impl File {
|
impl File {
|
||||||
/// # Safety
|
/// # Safety
|
||||||
/// The file descriptor must be valid
|
/// The file descriptor must be valid
|
||||||
pub unsafe fn new(fd: u64) -> Self {
|
pub unsafe fn from_raw_fd(fd: u64) -> Self {
|
||||||
Self { fd }
|
Self { fd }
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -14,3 +18,23 @@ impl File {
|
|||||||
self.fd
|
self.fd
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl IoBase for File {
|
||||||
|
type Error = ();
|
||||||
|
}
|
||||||
|
|
||||||
|
impl Read for File {
|
||||||
|
fn read(&mut self, buf: &mut [u8]) -> Result<usize, Self::Error> {
|
||||||
|
Ok(syscall::read(self.as_fd(), buf) as usize)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
impl Write for File {
|
||||||
|
fn write(&mut self, buf: &[u8]) -> Result<usize, Self::Error> {
|
||||||
|
Ok(syscall::write(self.as_fd(), buf) as usize)
|
||||||
|
}
|
||||||
|
|
||||||
|
fn flush(&mut self) -> Result<(), Self::Error> {
|
||||||
|
todo!()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|||||||
@@ -10,9 +10,12 @@ pub enum SysCall {
|
|||||||
Read = 0,
|
Read = 0,
|
||||||
Write = 1,
|
Write = 1,
|
||||||
Open = 2,
|
Open = 2,
|
||||||
|
Close = 3,
|
||||||
Seek = 8,
|
Seek = 8,
|
||||||
Alloc = 40,
|
Alloc = 40,
|
||||||
Dealloc = 41,
|
Dealloc = 41,
|
||||||
|
Spawn = 58,
|
||||||
|
ExecVE = 59,
|
||||||
Exit = 60,
|
Exit = 60,
|
||||||
NanoSleep = 101,
|
NanoSleep = 101,
|
||||||
WriteIntTemp = 998,
|
WriteIntTemp = 998,
|
||||||
@@ -26,9 +29,12 @@ impl From<u64> for SysCall {
|
|||||||
0 => SysCall::Read,
|
0 => SysCall::Read,
|
||||||
1 => SysCall::Write,
|
1 => SysCall::Write,
|
||||||
2 => SysCall::Open,
|
2 => SysCall::Open,
|
||||||
|
3 => SysCall::Close,
|
||||||
8 => SysCall::Seek,
|
8 => SysCall::Seek,
|
||||||
40 => SysCall::Alloc,
|
40 => SysCall::Alloc,
|
||||||
41 => SysCall::Dealloc,
|
41 => SysCall::Dealloc,
|
||||||
|
58 => SysCall::Spawn,
|
||||||
|
59 => SysCall::ExecVE,
|
||||||
60 => SysCall::Exit,
|
60 => SysCall::Exit,
|
||||||
101 => SysCall::NanoSleep,
|
101 => SysCall::NanoSleep,
|
||||||
998 => SysCall::WriteIntTemp,
|
998 => SysCall::WriteIntTemp,
|
||||||
@@ -143,30 +149,53 @@ pub fn open<P: AsRef<Path>>(path: P) -> File {
|
|||||||
let ptr = path_str.as_ptr();
|
let ptr = path_str.as_ptr();
|
||||||
let size = path_str.len();
|
let size = path_str.len();
|
||||||
let (fd, ..) = syscall!(SysCall::Open, ptr as u64, size as u64);
|
let (fd, ..) = syscall!(SysCall::Open, ptr as u64, size as u64);
|
||||||
File::new(fd)
|
File::from_raw_fd(fd)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
pub fn write(file: &mut File, buf: &[u8]) {
|
pub fn close(file_descriptor: u64) {
|
||||||
|
unsafe {
|
||||||
|
syscall!(SysCall::Close, file_descriptor);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
pub fn write(file_descriptor: u64, buf: &[u8]) -> u64 {
|
||||||
unsafe {
|
unsafe {
|
||||||
let ptr = buf.as_ptr();
|
let ptr = buf.as_ptr();
|
||||||
let size = buf.len();
|
let size = buf.len();
|
||||||
syscall!(SysCall::Write, file.as_fd(), ptr as u64, size as u64);
|
let (len, ..) = syscall!(SysCall::Write, file_descriptor, ptr as u64, size as u64);
|
||||||
|
len
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
pub fn read(file: &mut File, buf: &mut [u8]) {
|
pub fn read(file_descriptor: u64, buf: &mut [u8]) -> u64 {
|
||||||
unsafe {
|
unsafe {
|
||||||
let ptr = buf.as_ptr();
|
let ptr = buf.as_ptr();
|
||||||
let size = buf.len();
|
let size = buf.len();
|
||||||
syscall!(SysCall::Read, file.as_fd(), ptr as u64, size as u64);
|
let (len, ..) = syscall!(SysCall::Read, file_descriptor, ptr as u64, size as u64);
|
||||||
|
len
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
pub fn seek(file: &mut File, seek: SeekFrom) {
|
pub fn seek(file_descriptor: u64, seek: SeekFrom) {
|
||||||
unsafe {
|
unsafe {
|
||||||
let (discriminant, value) = match seek {
|
let (discriminant, value) = match seek {
|
||||||
SeekFrom::Start(v) => (0, v),
|
SeekFrom::Start(v) => (0, v),
|
||||||
SeekFrom::End(v) => (1, v as u64),
|
SeekFrom::End(v) => (1, v as u64),
|
||||||
SeekFrom::Current(v) => (2, v as u64),
|
SeekFrom::Current(v) => (2, v as u64),
|
||||||
};
|
};
|
||||||
syscall!(SysCall::Seek, file.as_fd(), discriminant, value);
|
syscall!(SysCall::Seek, file_descriptor, discriminant, value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
pub fn spawn<P: AsRef<Path>>(path: P) {
|
||||||
|
unsafe {
|
||||||
|
let path_str = path.as_ref().as_str();
|
||||||
|
let ptr = path_str.as_ptr();
|
||||||
|
let size = path_str.len();
|
||||||
|
syscall!(SysCall::Spawn, ptr as u64, size as u64);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
pub fn execve<P: AsRef<Path>>(path: P) {
|
||||||
|
unsafe {
|
||||||
|
let path_str = path.as_ref().as_str();
|
||||||
|
let ptr = path_str.as_ptr();
|
||||||
|
let size = path_str.len();
|
||||||
|
syscall!(SysCall::ExecVE, ptr as u64, size as u64);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
2
ilm.ld
2
ilm.ld
@@ -5,7 +5,7 @@ OUTPUT_ARCH(riscv)
|
|||||||
ENTRY(_start)
|
ENTRY(_start)
|
||||||
|
|
||||||
MEMORY {
|
MEMORY {
|
||||||
RAM (wxa) : ORIGIN = 0x80000000, LENGTH = 128M
|
RAM (wxa) : ORIGIN = 0x80000000, LENGTH = 512M
|
||||||
}
|
}
|
||||||
|
|
||||||
SECTIONS {
|
SECTIONS {
|
||||||
|
|||||||
15
justfile
15
justfile
@@ -12,13 +12,19 @@ mount_filesystem:
|
|||||||
sync_filesystem:
|
sync_filesystem:
|
||||||
sync
|
sync
|
||||||
|
|
||||||
|
update-std:
|
||||||
|
@cd library/std && just update-std
|
||||||
|
|
||||||
|
build-sysroot:
|
||||||
|
@cd library/std && just build-sysroot
|
||||||
|
|
||||||
build_user_prog prog:
|
build_user_prog prog:
|
||||||
RUSTFLAGS="-C relocation-model=pic -C link-arg=-Tuser.ld -C link-arg=-pie" cargo b {{ cargo_flags }} --package {{ prog }}
|
RUSTFLAGS="-C relocation-model=pic -C link-arg=-pie --sysroot {{ justfile_directory() / "sysroot" }}" cargo b {{ cargo_flags }} --package {{ prog }}
|
||||||
riscv64-elf-strip {{ bin_path / prog }}
|
riscv64-elf-strip {{ bin_path / prog }}
|
||||||
cp {{ bin_path / prog }} {{ "mnt/usr/bin" / prog }}
|
cp {{ bin_path / prog }} {{ "mnt/usr/bin" / prog }}
|
||||||
|
|
||||||
build: mount_filesystem (map_dir "user" f"just release=\"{{release}}\" cargo_flags=\"{{cargo_flags}}\" build_user_prog")
|
build: mount_filesystem (map_dir "user" f"just release=\"{{release}}\" cargo_flags=\"{{cargo_flags}}\" build_user_prog")
|
||||||
cargo b {{ cargo_flags }}
|
RUSTFLAGS="-Clink-arg=-Tilm.ld --sysroot {{ justfile_directory() / "sysroot" }}" cargo b {{ cargo_flags }}
|
||||||
just sync_filesystem
|
just sync_filesystem
|
||||||
|
|
||||||
run: build (runner f"{{bin_path / "kernel-rust"}}")
|
run: build (runner f"{{bin_path / "kernel-rust"}}")
|
||||||
@@ -34,8 +40,8 @@ qemu := f"qemu-system-riscv64 \
|
|||||||
-device bochs-display \
|
-device bochs-display \
|
||||||
-device virtio-keyboard-pci \
|
-device virtio-keyboard-pci \
|
||||||
-device virtio-mouse-pci \
|
-device virtio-mouse-pci \
|
||||||
-device loader,file=disk.img,addr=0x90000000 \
|
-device loader,file=disk.img,addr=0xA0000000 \
|
||||||
-bios none -m 512M {{qemu_flags}}"
|
-bios none -m 1024M {{qemu_flags}}"
|
||||||
|
|
||||||
# -trace \"virtio*\"
|
# -trace \"virtio*\"
|
||||||
# -d guest_errors,unimp,int"
|
# -d guest_errors,unimp,int"
|
||||||
@@ -53,4 +59,5 @@ runner args:
|
|||||||
{{ qemu }} -kernel {{ args }}
|
{{ qemu }} -kernel {{ args }}
|
||||||
|
|
||||||
clean:
|
clean:
|
||||||
|
cd library && just clean
|
||||||
cargo clean
|
cargo clean
|
||||||
|
|||||||
17
library/.gitignore
vendored
Normal file
17
library/.gitignore
vendored
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
portable-simd
|
||||||
|
core_arch
|
||||||
|
core
|
||||||
|
compiler-builtins
|
||||||
|
alloc
|
||||||
|
stdarch
|
||||||
|
unwind
|
||||||
|
std_detect
|
||||||
|
panic_abort
|
||||||
|
panic_unwind
|
||||||
|
rustc-std-workspace-alloc
|
||||||
|
rustc-std-workspace-core
|
||||||
|
rustc-std-workspace-std
|
||||||
|
windows_link
|
||||||
|
profiler_builtins
|
||||||
|
test
|
||||||
|
proc_macro
|
||||||
88
library/Cargo.toml
Normal file
88
library/Cargo.toml
Normal file
@@ -0,0 +1,88 @@
|
|||||||
|
|
||||||
|
cargo-features = ["profile-rustflags"]
|
||||||
|
|
||||||
|
[workspace]
|
||||||
|
resolver = "1"
|
||||||
|
members = [
|
||||||
|
"std",
|
||||||
|
# "sysroot",
|
||||||
|
# "coretests",
|
||||||
|
# "alloctests",
|
||||||
|
]
|
||||||
|
|
||||||
|
exclude = [
|
||||||
|
# stdarch has its own Cargo workspace
|
||||||
|
"stdarch",
|
||||||
|
"windows_link"
|
||||||
|
]
|
||||||
|
|
||||||
|
[profile.release.package.compiler_builtins]
|
||||||
|
# For compiler-builtins we always use a high number of codegen units.
|
||||||
|
# The goal here is to place every single intrinsic into its own object
|
||||||
|
# file to avoid symbol clashes with the system libgcc if possible. Note
|
||||||
|
# that this number doesn't actually produce this many object files, we
|
||||||
|
# just don't create more than this number of object files.
|
||||||
|
#
|
||||||
|
# It's a bit of a bummer that we have to pass this here, unfortunately.
|
||||||
|
# Ideally this would be specified through an env var to Cargo so Cargo
|
||||||
|
# knows how many CGUs are for this specific crate, but for now
|
||||||
|
# per-crate configuration isn't specifiable in the environment.
|
||||||
|
codegen-units = 10000
|
||||||
|
|
||||||
|
# These dependencies of the standard library implement symbolication for
|
||||||
|
# backtraces on most platforms. Their debuginfo causes both linking to be slower
|
||||||
|
# (more data to chew through) and binaries to be larger without really all that
|
||||||
|
# much benefit. This section turns them all to down to have no debuginfo which
|
||||||
|
# helps to improve link times a little bit.
|
||||||
|
[profile.release.package]
|
||||||
|
addr2line.debug = 0
|
||||||
|
addr2line.opt-level = "s"
|
||||||
|
adler2.debug = 0
|
||||||
|
gimli.debug = 0
|
||||||
|
gimli.opt-level = "s"
|
||||||
|
miniz_oxide.debug = 0
|
||||||
|
miniz_oxide.opt-level = "s"
|
||||||
|
# `opt-level = "s"` for `object` led to a size regression when tried previously
|
||||||
|
object.debug = 0
|
||||||
|
rustc-demangle.debug = 0
|
||||||
|
rustc-demangle.opt-level = "s"
|
||||||
|
|
||||||
|
# panic_abort must always be compiled with panic=abort, even when the rest of the
|
||||||
|
# sysroot is panic=unwind.
|
||||||
|
[profile.dev.package.panic_abort]
|
||||||
|
rustflags = ["-Cpanic=abort"]
|
||||||
|
|
||||||
|
[profile.release.package.panic_abort]
|
||||||
|
rustflags = ["-Cpanic=abort"]
|
||||||
|
|
||||||
|
# The "dist" profile is used by bootstrap for prebuilt libstd artifacts
|
||||||
|
# These settings ensure that the prebuilt artifacts support a variety of features
|
||||||
|
# in the user's profile.
|
||||||
|
[profile.dist]
|
||||||
|
inherits = "release"
|
||||||
|
codegen-units = 1
|
||||||
|
debug = 1 # "limited"
|
||||||
|
rustflags = [
|
||||||
|
# `profile.lto=off` implies `-Cembed-bitcode=no`, but unconditionally embedding
|
||||||
|
# bitcode is necessary for when users enable LTO.
|
||||||
|
# Required until Cargo can re-build the standard library based on the value
|
||||||
|
# of `profile.lto` in the user's profile.
|
||||||
|
"-Cembed-bitcode=yes",
|
||||||
|
# Enable frame pointers
|
||||||
|
"-Zunstable-options",
|
||||||
|
"-Cforce-frame-pointers=non-leaf",
|
||||||
|
]
|
||||||
|
|
||||||
|
[profile.dist.package.panic_abort]
|
||||||
|
rustflags = [
|
||||||
|
"-Cpanic=abort",
|
||||||
|
"-Cembed-bitcode=yes",
|
||||||
|
"-Zunstable-options",
|
||||||
|
"-Cforce-frame-pointers=non-leaf",
|
||||||
|
]
|
||||||
|
|
||||||
|
[patch.crates-io]
|
||||||
|
# See comments in `library/rustc-std-workspace-core/README.md` for what's going on here
|
||||||
|
rustc-std-workspace-core = { path = 'rustc-std-workspace-core' }
|
||||||
|
rustc-std-workspace-alloc = { path = 'rustc-std-workspace-alloc' }
|
||||||
|
# rustc-std-workspace-std = { path = 'rustc-std-workspace-std' }
|
||||||
1
library/backtrace
Submodule
1
library/backtrace
Submodule
Submodule library/backtrace added at 28ec93b503
319
library/justfile
Normal file
319
library/justfile
Normal file
@@ -0,0 +1,319 @@
|
|||||||
|
SRC_DIR := "std/src"
|
||||||
|
PATCH_DIR := "std/patches"
|
||||||
|
RUST_SRC := `rustc --print sysroot` / "lib/rustlib/src/rust/library"
|
||||||
|
|
||||||
|
patch-std:
|
||||||
|
@echo "Start patching the std..."
|
||||||
|
@find {{ PATCH_DIR }} -type f | while read -r patch_file; do \
|
||||||
|
relative_path="${patch_file#{{ PATCH_DIR }}/}"; \
|
||||||
|
target_file="${relative_path%.sed}.rs"; \
|
||||||
|
if [ -f "{{ SRC_DIR }}/$target_file" ]; then \
|
||||||
|
echo " [SED] $target_file"; \
|
||||||
|
sed -i -f "$patch_file" "{{ SRC_DIR }}/$target_file"; \
|
||||||
|
else \
|
||||||
|
echo "⚠ [WARN] target doesn't exist: $target_file"; \
|
||||||
|
fi; \
|
||||||
|
done
|
||||||
|
@echo "✅ Patching done."
|
||||||
|
|
||||||
|
update-std:
|
||||||
|
@just setup-std
|
||||||
|
@just patch-std
|
||||||
|
|
||||||
|
cp_std path:
|
||||||
|
@echo "Linking {{ path }}"
|
||||||
|
@mkdir {{ "std/src" / parent_directory(path) }} -p
|
||||||
|
@ln -fs {{ RUST_SRC / "std/src" / path }} {{ "std/src" / parent_directory(path) }}
|
||||||
|
|
||||||
|
real_cp_std path:
|
||||||
|
@echo "Copying {{ path }}"
|
||||||
|
@mkdir {{ "std/src" / parent_directory(path) }} -p
|
||||||
|
@cp {{ RUST_SRC / "std/src" / path }} {{ "std/src" / path }}
|
||||||
|
|
||||||
|
setup-std:
|
||||||
|
ln -fs {{ RUST_SRC / "std_detect" }} "."
|
||||||
|
ln -fs {{ RUST_SRC / "panic_abort" }} "."
|
||||||
|
ln -fs {{ RUST_SRC / "panic_unwind" }} "."
|
||||||
|
ln -fs {{ RUST_SRC / "windows_link" }} "."
|
||||||
|
ln -fs {{ RUST_SRC / "unwind" }} "."
|
||||||
|
ln -fs {{ RUST_SRC / "alloc" }} "."
|
||||||
|
ln -fs {{ RUST_SRC / "rustc-std-workspace-alloc" }} "."
|
||||||
|
ln -fs {{ RUST_SRC / "rustc-std-workspace-core" }} "."
|
||||||
|
ln -fs {{ RUST_SRC / "rustc-std-workspace-std" }} "."
|
||||||
|
ln -fs {{ RUST_SRC / "compiler-builtins" }} "."
|
||||||
|
ln -fs {{ RUST_SRC / "core" }} "."
|
||||||
|
ln -fs {{ RUST_SRC / "stdarch" }} "."
|
||||||
|
ln -fs {{ RUST_SRC / "portable-simd" }} "."
|
||||||
|
ln -fs {{ RUST_SRC / "proc_macro" }} "."
|
||||||
|
ln -fs {{ RUST_SRC / "profiler_builtins" }} "."
|
||||||
|
ln -fs {{ RUST_SRC / "test" }} "."
|
||||||
|
|
||||||
|
@just cp_std "../build.rs"
|
||||||
|
@sed -i "59a\ || target_os == \"survos\"" std/build.rs
|
||||||
|
|
||||||
|
@just cp_std "alloc.rs"
|
||||||
|
@just cp_std "ascii.rs"
|
||||||
|
@just cp_std "backtrace.rs"
|
||||||
|
@just cp_std "bstr.rs"
|
||||||
|
@just cp_std "env.rs"
|
||||||
|
@just cp_std "error.rs"
|
||||||
|
@just cp_std "fs.rs"
|
||||||
|
@just cp_std "keyword_docs.rs"
|
||||||
|
@just cp_std "lib.rs"
|
||||||
|
@just cp_std "macros.rs"
|
||||||
|
@just cp_std "panic.rs"
|
||||||
|
@just cp_std "panicking.rs"
|
||||||
|
@just cp_std "pat.rs"
|
||||||
|
@just cp_std "path.rs"
|
||||||
|
@just cp_std "process.rs"
|
||||||
|
@just cp_std "random.rs"
|
||||||
|
@just cp_std "rt.rs"
|
||||||
|
@just cp_std "tests_helpers.rs"
|
||||||
|
@just cp_std "time.rs"
|
||||||
|
|
||||||
|
@just cp_std "backtrace"
|
||||||
|
|
||||||
|
@just cp_std "collections"
|
||||||
|
|
||||||
|
@just cp_std "ffi"
|
||||||
|
|
||||||
|
@just cp_std "fs"
|
||||||
|
|
||||||
|
@just cp_std "hash"
|
||||||
|
|
||||||
|
@just cp_std "io"
|
||||||
|
|
||||||
|
@just cp_std "net"
|
||||||
|
|
||||||
|
@just cp_std "num"
|
||||||
|
|
||||||
|
@just cp_std "os/raw/mod.rs"
|
||||||
|
@just cp_std "os/raw/tests.rs"
|
||||||
|
@just cp_std "os/mod.rs"
|
||||||
|
|
||||||
|
@just cp_std "prelude"
|
||||||
|
|
||||||
|
@just cp_std "process"
|
||||||
|
|
||||||
|
@just cp_std "sync"
|
||||||
|
|
||||||
|
@just cp_std "sys/alloc/mod.rs"
|
||||||
|
|
||||||
|
@just real_cp_std "sys/args/mod.rs"
|
||||||
|
@just cp_std "sys/args/unsupported.rs"
|
||||||
|
|
||||||
|
@just cp_std "sys/env/mod.rs"
|
||||||
|
@just cp_std "sys/env/common.rs"
|
||||||
|
@just cp_std "sys/env/unsupported.rs"
|
||||||
|
|
||||||
|
@just cp_std "sys/fd/mod.rs"
|
||||||
|
|
||||||
|
@just cp_std "sys/fs/mod.rs"
|
||||||
|
@just cp_std "sys/fs/common.rs"
|
||||||
|
@just cp_std "sys/fs/unsupported.rs"
|
||||||
|
|
||||||
|
@just cp_std "sys/helpers/mod.rs"
|
||||||
|
@just cp_std "sys/helpers/small_c_string.rs"
|
||||||
|
@just cp_std "sys/helpers/tests.rs"
|
||||||
|
@just cp_std "sys/helpers/wstr.rs"
|
||||||
|
|
||||||
|
@just cp_std "sys/io/error/generic.rs"
|
||||||
|
@just real_cp_std "sys/io/error/mod.rs"
|
||||||
|
@just cp_std "sys/io/io_slice/unsupported.rs"
|
||||||
|
@just cp_std "sys/io/is_terminal/unsupported.rs"
|
||||||
|
@just cp_std "sys/io/kernel_copy/mod.rs"
|
||||||
|
@just cp_std "sys/io/mod.rs"
|
||||||
|
|
||||||
|
@just cp_std "sys/net/connection/mod.rs"
|
||||||
|
@just cp_std "sys/net/connection/unsupported.rs"
|
||||||
|
@just cp_std "sys/net/hostname/mod.rs"
|
||||||
|
@just cp_std "sys/net/hostname/unsupported.rs"
|
||||||
|
@just cp_std "sys/net/mod.rs"
|
||||||
|
|
||||||
|
@just cp_std "sys/os_str/bytes/tests.rs"
|
||||||
|
@just cp_std "sys/os_str/bytes.rs"
|
||||||
|
@just cp_std "sys/os_str/mod.rs"
|
||||||
|
|
||||||
|
@just real_cp_std "sys/pal/mod.rs"
|
||||||
|
@just cp_std "sys/pal/unsupported/mod.rs"
|
||||||
|
@just cp_std "sys/pal/unsupported/common.rs"
|
||||||
|
@just cp_std "sys/pal/unsupported/os.rs"
|
||||||
|
|
||||||
|
@just cp_std "sys/path/mod.rs"
|
||||||
|
@just cp_std "sys/path/unix.rs"
|
||||||
|
|
||||||
|
@just cp_std "sys/personality/dwarf/eh.rs"
|
||||||
|
@just cp_std "sys/personality/dwarf/mod.rs"
|
||||||
|
@just cp_std "sys/personality/dwarf/tests.rs"
|
||||||
|
@just cp_std "sys/personality/mod.rs"
|
||||||
|
|
||||||
|
@just cp_std "sys/pipe/mod.rs"
|
||||||
|
@just cp_std "sys/pipe/unsupported.rs"
|
||||||
|
|
||||||
|
@just cp_std "sys/platform_version/mod.rs"
|
||||||
|
|
||||||
|
@just cp_std "sys/process/mod.rs"
|
||||||
|
@just cp_std "sys/process/env.rs"
|
||||||
|
@just cp_std "sys/process/unsupported.rs"
|
||||||
|
|
||||||
|
@just real_cp_std "sys/random/mod.rs"
|
||||||
|
@just cp_std "sys/random/unsupported.rs"
|
||||||
|
|
||||||
|
@just cp_std "sys/stdio/mod.rs"
|
||||||
|
@just cp_std "sys/stdio/unsupported.rs"
|
||||||
|
|
||||||
|
@just cp_std "sys/sync/condvar/mod.rs"
|
||||||
|
@just cp_std "sys/sync/condvar/no_threads.rs"
|
||||||
|
@just cp_std "sys/sync/mutex/mod.rs"
|
||||||
|
@just cp_std "sys/sync/mutex/no_threads.rs"
|
||||||
|
@just cp_std "sys/sync/once/mod.rs"
|
||||||
|
@just cp_std "sys/sync/once/no_threads.rs"
|
||||||
|
@just cp_std "sys/sync/rwlock/mod.rs"
|
||||||
|
@just cp_std "sys/sync/rwlock/no_threads.rs"
|
||||||
|
@just cp_std "sys/sync/thread_parking/mod.rs"
|
||||||
|
@just cp_std "sys/sync/thread_parking/unsupported.rs"
|
||||||
|
@just cp_std "sys/sync/mod.rs"
|
||||||
|
@just cp_std "sys/sync/once_box.rs"
|
||||||
|
|
||||||
|
@just cp_std "sys/thread/mod.rs"
|
||||||
|
@just cp_std "sys/thread/unsupported.rs"
|
||||||
|
|
||||||
|
@just real_cp_std "sys/thread_local/mod.rs"
|
||||||
|
@just cp_std "sys/thread_local/no_threads.rs"
|
||||||
|
@just cp_std "sys/thread_local/os.rs"
|
||||||
|
|
||||||
|
@just cp_std "sys/time/mod.rs"
|
||||||
|
@just cp_std "sys/time/unsupported.rs"
|
||||||
|
|
||||||
|
@just cp_std "sys/backtrace.rs"
|
||||||
|
@just cp_std "sys/cmath.rs"
|
||||||
|
@just cp_std "sys/configure_builtins.rs"
|
||||||
|
@just cp_std "sys/env_consts.rs"
|
||||||
|
@just cp_std "sys/exit.rs"
|
||||||
|
@just cp_std "sys/mod.rs"
|
||||||
|
|
||||||
|
@just cp_std "thread"
|
||||||
|
|
||||||
|
STD_FILES := "alloc.rs \
|
||||||
|
ascii.rs \
|
||||||
|
backtrace.rs \
|
||||||
|
bstr.rs \
|
||||||
|
env.rs \
|
||||||
|
error.rs \
|
||||||
|
fs.rs \
|
||||||
|
keyword_docs.rs \
|
||||||
|
lib.rs \
|
||||||
|
macros.rs \
|
||||||
|
panic.rs \
|
||||||
|
panicking.rs \
|
||||||
|
pat.rs \
|
||||||
|
path.rs \
|
||||||
|
process.rs \
|
||||||
|
random.rs \
|
||||||
|
rt.rs \
|
||||||
|
tests_helpers.rs \
|
||||||
|
time.rs \
|
||||||
|
backtrace \
|
||||||
|
collections \
|
||||||
|
ffi \
|
||||||
|
fs \
|
||||||
|
hash \
|
||||||
|
io \
|
||||||
|
net \
|
||||||
|
num \
|
||||||
|
os/raw/mod.rs \
|
||||||
|
os/raw/tests.rs \
|
||||||
|
os/mod.rs \
|
||||||
|
prelude \
|
||||||
|
process \
|
||||||
|
sync \
|
||||||
|
sys/alloc/mod.rs \
|
||||||
|
sys/args/mod.rs \
|
||||||
|
sys/args/unsupported.rs \
|
||||||
|
sys/env/mod.rs \
|
||||||
|
sys/env/common.rs \
|
||||||
|
sys/env/unsupported.rs \
|
||||||
|
sys/fd/mod.rs \
|
||||||
|
sys/fs/mod.rs \
|
||||||
|
sys/fs/common.rs \
|
||||||
|
sys/fs/unsupported.rs \
|
||||||
|
sys/helpers/mod.rs \
|
||||||
|
sys/helpers/small_c_string.rs \
|
||||||
|
sys/helpers/tests.rs \
|
||||||
|
sys/helpers/wstr.rs \
|
||||||
|
sys/io/error/generic.rs \
|
||||||
|
sys/io/error/mod.rs \
|
||||||
|
sys/io/io_slice/unsupported.rs \
|
||||||
|
sys/io/is_terminal/unsupported.rs \
|
||||||
|
sys/io/kernel_copy/mod.rs \
|
||||||
|
sys/io/mod.rs \
|
||||||
|
sys/net/connection/mod.rs \
|
||||||
|
sys/net/connection/unsupported.rs \
|
||||||
|
sys/net/hostname/mod.rs \
|
||||||
|
sys/net/hostname/unsupported.rs \
|
||||||
|
sys/net/mod.rs \
|
||||||
|
sys/os_str/bytes/tests.rs \
|
||||||
|
sys/os_str/bytes.rs \
|
||||||
|
sys/os_str/mod.rs \
|
||||||
|
sys/pal/mod.rs \
|
||||||
|
sys/pal/unsupported/mod.rs \
|
||||||
|
sys/pal/unsupported/common.rs \
|
||||||
|
sys/pal/unsupported/os.rs \
|
||||||
|
sys/path/mod.rs \
|
||||||
|
sys/path/unix.rs \
|
||||||
|
sys/personality/dwarf/eh.rs \
|
||||||
|
sys/personality/dwarf/mod.rs \
|
||||||
|
sys/personality/dwarf/tests.rs \
|
||||||
|
sys/personality/mod.rs \
|
||||||
|
sys/pipe/mod.rs \
|
||||||
|
sys/pipe/unsupported.rs \
|
||||||
|
sys/platform_version/mod.rs \
|
||||||
|
sys/process/mod.rs \
|
||||||
|
sys/process/env.rs \
|
||||||
|
sys/process/unsupported.rs \
|
||||||
|
sys/random/mod.rs \
|
||||||
|
sys/random/unsupported.rs \
|
||||||
|
sys/stdio/mod.rs \
|
||||||
|
sys/stdio/unsupported.rs \
|
||||||
|
sys/sync/condvar/mod.rs \
|
||||||
|
sys/sync/condvar/no_threads.rs \
|
||||||
|
sys/sync/mutex/mod.rs \
|
||||||
|
sys/sync/mutex/no_threads.rs \
|
||||||
|
sys/sync/once/mod.rs \
|
||||||
|
sys/sync/once/no_threads.rs \
|
||||||
|
sys/sync/rwlock/mod.rs \
|
||||||
|
sys/sync/rwlock/no_threads.rs \
|
||||||
|
sys/sync/thread_parking/mod.rs \
|
||||||
|
sys/sync/thread_parking/unsupported.rs \
|
||||||
|
sys/sync/mod.rs \
|
||||||
|
sys/sync/once_box.rs \
|
||||||
|
sys/thread/mod.rs \
|
||||||
|
sys/thread/unsupported.rs \
|
||||||
|
sys/thread_local/mod.rs \
|
||||||
|
sys/thread_local/no_threads.rs \
|
||||||
|
sys/thread_local/os.rs \
|
||||||
|
sys/time/mod.rs \
|
||||||
|
sys/time/unsupported.rs \
|
||||||
|
sys/backtrace.rs \
|
||||||
|
sys/cmath.rs \
|
||||||
|
sys/configure_builtins.rs \
|
||||||
|
sys/env_consts.rs \
|
||||||
|
sys/exit.rs \
|
||||||
|
sys/mod.rs \
|
||||||
|
thread"
|
||||||
|
|
||||||
|
build-sysroot: update-std
|
||||||
|
RUSTFLAGS="-Zforce-unstable-if-unmarked -C relocation-model=pic -C link-arg=-pie" cargo build --target ../riscv64.json
|
||||||
|
mkdir ../sysroot/lib/rustlib/riscv64/lib -p
|
||||||
|
rm ../sysroot/lib/rustlib/riscv64/lib/* -rf
|
||||||
|
cp target/riscv64/debug/deps/*.rlib ../sysroot/lib/rustlib/riscv64/lib
|
||||||
|
|
||||||
|
clean:
|
||||||
|
# cargo clean
|
||||||
|
rm ../sysroot/lib/rustlib/riscv64/lib/* -rf
|
||||||
|
|
||||||
|
for file in {{ STD_FILES }}; do \
|
||||||
|
rm -rf std/src/$file; \
|
||||||
|
done
|
||||||
|
|
||||||
|
rm -rf std/build.rs
|
||||||
1
library/proc_macro
Symbolic link
1
library/proc_macro
Symbolic link
@@ -0,0 +1 @@
|
|||||||
|
/home/julien/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/proc_macro
|
||||||
1
library/profiler_builtins
Symbolic link
1
library/profiler_builtins
Symbolic link
@@ -0,0 +1 @@
|
|||||||
|
/home/julien/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/profiler_builtins
|
||||||
109
library/std/.gitignore
vendored
Normal file
109
library/std/.gitignore
vendored
Normal file
@@ -0,0 +1,109 @@
|
|||||||
|
build.rs
|
||||||
|
|
||||||
|
src/alloc.rs
|
||||||
|
src/ascii.rs
|
||||||
|
src/backtrace.rs
|
||||||
|
src/bstr.rs
|
||||||
|
src/env.rs
|
||||||
|
src/error.rs
|
||||||
|
src/fs.rs
|
||||||
|
src/keyword_docs.rs
|
||||||
|
src/lib.rs
|
||||||
|
src/macros.rs
|
||||||
|
src/panic.rs
|
||||||
|
src/panicking.rs
|
||||||
|
src/pat.rs
|
||||||
|
src/path.rs
|
||||||
|
src/process.rs
|
||||||
|
src/random.rs
|
||||||
|
src/rt.rs
|
||||||
|
src/tests_helpers.rs
|
||||||
|
src/time.rs
|
||||||
|
src/backtrace
|
||||||
|
src/collections
|
||||||
|
src/ffi
|
||||||
|
src/fs
|
||||||
|
src/hash
|
||||||
|
src/io
|
||||||
|
src/net
|
||||||
|
src/num
|
||||||
|
src/os/raw/mod.rs
|
||||||
|
src/os/raw/tests.rs
|
||||||
|
src/os/mod.rs
|
||||||
|
src/prelude
|
||||||
|
src/process
|
||||||
|
src/sync
|
||||||
|
src/sys/alloc/mod.rs
|
||||||
|
src/sys/args/mod.rs
|
||||||
|
src/sys/args/unsupported.rs
|
||||||
|
src/sys/env/mod.rs
|
||||||
|
src/sys/env/common.rs
|
||||||
|
src/sys/env/unsupported.rs
|
||||||
|
src/sys/fd/mod.rs
|
||||||
|
src/sys/fs/mod.rs
|
||||||
|
src/sys/fs/common.rs
|
||||||
|
src/sys/fs/unsupported.rs
|
||||||
|
src/sys/helpers/mod.rs
|
||||||
|
src/sys/helpers/small_c_string.rs
|
||||||
|
src/sys/helpers/tests.rs
|
||||||
|
src/sys/helpers/wstr.rs
|
||||||
|
src/sys/io/error/generic.rs
|
||||||
|
src/sys/io/error/mod.rs
|
||||||
|
src/sys/io/io_slice/unsupported.rs
|
||||||
|
src/sys/io/is_terminal/unsupported.rs
|
||||||
|
src/sys/io/kernel_copy/mod.rs
|
||||||
|
src/sys/io/mod.rs
|
||||||
|
src/sys/net/connection/mod.rs
|
||||||
|
src/sys/net/connection/unsupported.rs
|
||||||
|
src/sys/net/hostname/mod.rs
|
||||||
|
src/sys/net/hostname/unsupported.rs
|
||||||
|
src/sys/net/mod.rs
|
||||||
|
src/sys/os_str/bytes/tests.rs
|
||||||
|
src/sys/os_str/bytes.rs
|
||||||
|
src/sys/os_str/mod.rs
|
||||||
|
src/sys/pal/mod.rs
|
||||||
|
src/sys/pal/unsupported/mod.rs
|
||||||
|
src/sys/pal/unsupported/common.rs
|
||||||
|
src/sys/pal/unsupported/os.rs
|
||||||
|
src/sys/path/mod.rs
|
||||||
|
src/sys/path/unix.rs
|
||||||
|
src/sys/personality/dwarf/eh.rs
|
||||||
|
src/sys/personality/dwarf/mod.rs
|
||||||
|
src/sys/personality/dwarf/tests.rs
|
||||||
|
src/sys/personality/mod.rs
|
||||||
|
src/sys/pipe/mod.rs
|
||||||
|
src/sys/pipe/unsupported.rs
|
||||||
|
src/sys/platform_version/mod.rs
|
||||||
|
src/sys/process/mod.rs
|
||||||
|
src/sys/process/env.rs
|
||||||
|
src/sys/process/unsupported.rs
|
||||||
|
src/sys/random/mod.rs
|
||||||
|
src/sys/random/unsupported.rs
|
||||||
|
src/sys/stdio/mod.rs
|
||||||
|
src/sys/stdio/unsupported.rs
|
||||||
|
src/sys/sync/condvar/mod.rs
|
||||||
|
src/sys/sync/condvar/no_threads.rs
|
||||||
|
src/sys/sync/mutex/mod.rs
|
||||||
|
src/sys/sync/mutex/no_threads.rs
|
||||||
|
src/sys/sync/once/mod.rs
|
||||||
|
src/sys/sync/once/no_threads.rs
|
||||||
|
src/sys/sync/rwlock/mod.rs
|
||||||
|
src/sys/sync/rwlock/no_threads.rs
|
||||||
|
src/sys/sync/thread_parking/mod.rs
|
||||||
|
src/sys/sync/thread_parking/unsupported.rs
|
||||||
|
src/sys/sync/mod.rs
|
||||||
|
src/sys/sync/once_box.rs
|
||||||
|
src/sys/thread/mod.rs
|
||||||
|
src/sys/thread/unsupported.rs
|
||||||
|
src/sys/thread_local/mod.rs
|
||||||
|
src/sys/thread_local/no_threads.rs
|
||||||
|
src/sys/thread_local/os.rs
|
||||||
|
src/sys/time/mod.rs
|
||||||
|
src/sys/time/unsupported.rs
|
||||||
|
src/sys/backtrace.rs
|
||||||
|
src/sys/cmath.rs
|
||||||
|
src/sys/configure_builtins.rs
|
||||||
|
src/sys/env_consts.rs
|
||||||
|
src/sys/exit.rs
|
||||||
|
src/sys/mod.rs
|
||||||
|
src/thread
|
||||||
177
library/std/Cargo.toml
Normal file
177
library/std/Cargo.toml
Normal file
@@ -0,0 +1,177 @@
|
|||||||
|
cargo-features = ["public-dependency"]
|
||||||
|
|
||||||
|
[package]
|
||||||
|
name = "std"
|
||||||
|
version = "0.0.0"
|
||||||
|
license = "MIT OR Apache-2.0"
|
||||||
|
repository = "https://github.com/rust-lang/rust.git"
|
||||||
|
description = "The Rust Standard Library"
|
||||||
|
edition = "2024"
|
||||||
|
autobenches = false
|
||||||
|
|
||||||
|
[lib]
|
||||||
|
crate-type = ["dylib", "rlib"]
|
||||||
|
|
||||||
|
[dependencies]
|
||||||
|
alloc = { path = "../alloc", public = true }
|
||||||
|
# std no longer uses cfg-if directly, but the included copy of backtrace does.
|
||||||
|
cfg-if = { version = "1.0", features = ['rustc-dep-of-std'] }
|
||||||
|
panic_unwind = { path = "../panic_unwind", optional = true }
|
||||||
|
panic_abort = { path = "../panic_abort" }
|
||||||
|
core = { path = "../core", public = true }
|
||||||
|
unwind = { path = "../unwind" }
|
||||||
|
hashbrown = { version = "0.16.1", default-features = false, features = [
|
||||||
|
'rustc-dep-of-std',
|
||||||
|
] }
|
||||||
|
std_detect = { path = "../std_detect", public = true }
|
||||||
|
|
||||||
|
# Dependencies of the `backtrace` crate
|
||||||
|
rustc-demangle = { version = "0.1.27", features = ['rustc-dep-of-std'] }
|
||||||
|
|
||||||
|
[target.'cfg(not(all(windows, target_env = "msvc", not(target_vendor = "uwp"))))'.dependencies]
|
||||||
|
miniz_oxide = { version = "0.8.0", optional = true, default-features = false }
|
||||||
|
addr2line = { version = "0.25.0", optional = true, default-features = false }
|
||||||
|
|
||||||
|
[target.'cfg(not(all(windows, target_env = "msvc")))'.dependencies]
|
||||||
|
libc = { version = "0.2.178", default-features = false, features = [
|
||||||
|
'rustc-dep-of-std',
|
||||||
|
], public = true }
|
||||||
|
|
||||||
|
[target.'cfg(all(not(target_os = "aix"), not(all(windows, target_env = "msvc", not(target_vendor = "uwp")))))'.dependencies]
|
||||||
|
object = { version = "0.37.1", default-features = false, optional = true, features = [
|
||||||
|
'read_core',
|
||||||
|
'elf',
|
||||||
|
'macho',
|
||||||
|
'pe',
|
||||||
|
'unaligned',
|
||||||
|
'archive',
|
||||||
|
] }
|
||||||
|
|
||||||
|
[target.'cfg(target_os = "aix")'.dependencies]
|
||||||
|
object = { version = "0.37.1", default-features = false, optional = true, features = [
|
||||||
|
'read_core',
|
||||||
|
'xcoff',
|
||||||
|
'unaligned',
|
||||||
|
'archive',
|
||||||
|
] }
|
||||||
|
|
||||||
|
[target.'cfg(any(windows, target_os = "cygwin"))'.dependencies.windows-link]
|
||||||
|
path = "../windows_link"
|
||||||
|
|
||||||
|
[dev-dependencies]
|
||||||
|
rand = { version = "0.9.0", default-features = false, features = ["alloc"] }
|
||||||
|
rand_xorshift = "0.4.0"
|
||||||
|
|
||||||
|
[target.'cfg(any(all(target_family = "wasm", target_os = "unknown"), target_os = "xous", target_os = "vexos", all(target_vendor = "fortanix", target_env = "sgx")))'.dependencies]
|
||||||
|
dlmalloc = { version = "0.2.10", features = ['rustc-dep-of-std'] }
|
||||||
|
|
||||||
|
[target.x86_64-fortanix-unknown-sgx.dependencies]
|
||||||
|
fortanix-sgx-abi = { version = "0.6.1", features = [
|
||||||
|
'rustc-dep-of-std',
|
||||||
|
], public = true }
|
||||||
|
|
||||||
|
[target.'cfg(target_os = "motor")'.dependencies]
|
||||||
|
moto-rt = { version = "0.16", features = ['rustc-dep-of-std'], public = true }
|
||||||
|
|
||||||
|
[target.'cfg(target_os = "hermit")'.dependencies]
|
||||||
|
hermit-abi = { version = "0.5.0", features = [
|
||||||
|
'rustc-dep-of-std',
|
||||||
|
], public = true }
|
||||||
|
|
||||||
|
[target.'cfg(all(target_os = "wasi", target_env = "p1"))'.dependencies]
|
||||||
|
wasi = { version = "0.11.0", features = [
|
||||||
|
'rustc-dep-of-std',
|
||||||
|
], default-features = false }
|
||||||
|
|
||||||
|
[target.'cfg(all(target_os = "wasi", target_env = "p2"))'.dependencies]
|
||||||
|
wasip2 = { version = '0.14.4', features = [
|
||||||
|
'rustc-dep-of-std',
|
||||||
|
], default-features = false, package = 'wasi' }
|
||||||
|
|
||||||
|
[target.'cfg(all(target_os = "wasi", target_env = "p3"))'.dependencies]
|
||||||
|
wasip2 = { version = '0.14.4', features = [
|
||||||
|
'rustc-dep-of-std',
|
||||||
|
], default-features = false, package = 'wasi' }
|
||||||
|
|
||||||
|
[target.'cfg(target_os = "uefi")'.dependencies]
|
||||||
|
r-efi = { version = "5.2.0", features = ['rustc-dep-of-std'] }
|
||||||
|
r-efi-alloc = { version = "2.0.0", features = ['rustc-dep-of-std'] }
|
||||||
|
|
||||||
|
[target.'cfg(target_os = "vexos")'.dependencies]
|
||||||
|
vex-sdk = { version = "0.27.0", features = [
|
||||||
|
'rustc-dep-of-std',
|
||||||
|
], default-features = false }
|
||||||
|
|
||||||
|
[features]
|
||||||
|
default = ["compiler-builtins-mem"]
|
||||||
|
backtrace = [
|
||||||
|
'addr2line/rustc-dep-of-std',
|
||||||
|
'object/rustc-dep-of-std',
|
||||||
|
'miniz_oxide/rustc-dep-of-std',
|
||||||
|
]
|
||||||
|
# Disable symbolization in backtraces. For use with -Zbuild-std.
|
||||||
|
# FIXME: Ideally this should be an additive backtrace-symbolization feature
|
||||||
|
backtrace-trace-only = []
|
||||||
|
|
||||||
|
panic-unwind = ["dep:panic_unwind"]
|
||||||
|
compiler-builtins-c = ["alloc/compiler-builtins-c"]
|
||||||
|
compiler-builtins-mem = ["alloc/compiler-builtins-mem"]
|
||||||
|
llvm-libunwind = ["unwind/llvm-libunwind"]
|
||||||
|
system-llvm-libunwind = ["unwind/system-llvm-libunwind"]
|
||||||
|
|
||||||
|
# Choose algorithms that are optimized for binary size instead of runtime performance
|
||||||
|
optimize_for_size = ["core/optimize_for_size", "alloc/optimize_for_size"]
|
||||||
|
|
||||||
|
# Make `RefCell` store additional debugging information, which is printed out when
|
||||||
|
# a borrow error occurs
|
||||||
|
debug_refcell = ["core/debug_refcell"]
|
||||||
|
|
||||||
|
llvm_enzyme = ["core/llvm_enzyme"]
|
||||||
|
|
||||||
|
# Enable using raw-dylib for Windows imports.
|
||||||
|
# This will eventually be the default.
|
||||||
|
windows_raw_dylib = ["windows-link/windows_raw_dylib"]
|
||||||
|
|
||||||
|
[package.metadata.fortanix-sgx]
|
||||||
|
# Maximum possible number of threads when testing
|
||||||
|
threads = 125
|
||||||
|
# Maximum heap size
|
||||||
|
heap_size = 0x8000000
|
||||||
|
|
||||||
|
[[test]]
|
||||||
|
name = "pipe-subprocess"
|
||||||
|
path = "tests/pipe_subprocess.rs"
|
||||||
|
harness = false
|
||||||
|
|
||||||
|
[[test]]
|
||||||
|
name = "sync"
|
||||||
|
path = "tests/sync/lib.rs"
|
||||||
|
|
||||||
|
[[test]]
|
||||||
|
name = "thread_local"
|
||||||
|
path = "tests/thread_local/lib.rs"
|
||||||
|
|
||||||
|
[[bench]]
|
||||||
|
name = "stdbenches"
|
||||||
|
path = "benches/lib.rs"
|
||||||
|
test = true
|
||||||
|
|
||||||
|
[lints.rust.unexpected_cfgs]
|
||||||
|
level = "warn"
|
||||||
|
check-cfg = [
|
||||||
|
# std use #[path] imports to portable-simd `std_float` crate
|
||||||
|
# and to the `backtrace` crate which messes-up with Cargo list
|
||||||
|
# of declared features, we therefor expect any feature cfg
|
||||||
|
'cfg(feature, values(any()))',
|
||||||
|
# Internal features aren't marked known config by default, we use these to
|
||||||
|
# gate tests.
|
||||||
|
'cfg(target_has_reliable_f16)',
|
||||||
|
'cfg(target_has_reliable_f16_math)',
|
||||||
|
'cfg(target_has_reliable_f128)',
|
||||||
|
'cfg(target_has_reliable_f128_math)',
|
||||||
|
]
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# shared = { path = "../shared", features = ["user"] }
|
||||||
|
# io_crate = { package = "io", path = "../io", features = ["alloc_crate"] }
|
||||||
107
library/std/build.rs
Normal file
107
library/std/build.rs
Normal file
@@ -0,0 +1,107 @@
|
|||||||
|
use std::env;
|
||||||
|
|
||||||
|
fn main() {
|
||||||
|
println!("cargo:rerun-if-changed=build.rs");
|
||||||
|
let target_arch = env::var("CARGO_CFG_TARGET_ARCH").expect("CARGO_CFG_TARGET_ARCH was not set");
|
||||||
|
let target_os = env::var("CARGO_CFG_TARGET_OS").expect("CARGO_CFG_TARGET_OS was not set");
|
||||||
|
let target_vendor =
|
||||||
|
env::var("CARGO_CFG_TARGET_VENDOR").expect("CARGO_CFG_TARGET_VENDOR was not set");
|
||||||
|
let target_env = env::var("CARGO_CFG_TARGET_ENV").expect("CARGO_CFG_TARGET_ENV was not set");
|
||||||
|
|
||||||
|
println!("cargo:rustc-check-cfg=cfg(netbsd10)");
|
||||||
|
if target_os == "netbsd" && env::var("RUSTC_STD_NETBSD10").is_ok() {
|
||||||
|
println!("cargo:rustc-cfg=netbsd10");
|
||||||
|
}
|
||||||
|
|
||||||
|
// Needed for `#![doc(auto_cfg(hide(no_global_oom_handling)))]` attribute.
|
||||||
|
println!("cargo::rustc-check-cfg=cfg(no_global_oom_handling)");
|
||||||
|
|
||||||
|
println!("cargo:rustc-check-cfg=cfg(restricted_std)");
|
||||||
|
if target_os == "linux"
|
||||||
|
|| target_os == "android"
|
||||||
|
|| target_os == "netbsd"
|
||||||
|
|| target_os == "dragonfly"
|
||||||
|
|| target_os == "openbsd"
|
||||||
|
|| target_os == "freebsd"
|
||||||
|
|| target_os == "solaris"
|
||||||
|
|| target_os == "illumos"
|
||||||
|
|| target_os == "macos"
|
||||||
|
|| target_os == "ios"
|
||||||
|
|| target_os == "tvos"
|
||||||
|
|| target_os == "watchos"
|
||||||
|
|| target_os == "visionos"
|
||||||
|
|| target_os == "windows"
|
||||||
|
|| target_os == "fuchsia"
|
||||||
|
|| (target_vendor == "fortanix" && target_env == "sgx")
|
||||||
|
|| target_os == "motor"
|
||||||
|
|| target_os == "hermit"
|
||||||
|
|| target_os == "trusty"
|
||||||
|
|| target_os == "l4re"
|
||||||
|
|| target_os == "redox"
|
||||||
|
|| target_os == "haiku"
|
||||||
|
|| target_os == "vxworks"
|
||||||
|
|| target_arch == "wasm32"
|
||||||
|
|| target_arch == "wasm64"
|
||||||
|
|| target_os == "espidf"
|
||||||
|
|| target_os.starts_with("solid")
|
||||||
|
|| (target_vendor == "nintendo" && target_env == "newlib")
|
||||||
|
|| target_os == "vita"
|
||||||
|
|| target_os == "aix"
|
||||||
|
|| target_os == "nto"
|
||||||
|
|| target_os == "xous"
|
||||||
|
|| target_os == "hurd"
|
||||||
|
|| target_os == "uefi"
|
||||||
|
|| target_os == "teeos"
|
||||||
|
|| target_os == "zkvm"
|
||||||
|
|| target_os == "rtems"
|
||||||
|
|| target_os == "nuttx"
|
||||||
|
|| target_os == "cygwin"
|
||||||
|
|| target_os == "vexos"
|
||||||
|
|| target_os == "survos"
|
||||||
|
|
||||||
|
// See src/bootstrap/src/core/build_steps/synthetic_targets.rs
|
||||||
|
|| env::var("RUSTC_BOOTSTRAP_SYNTHETIC_TARGET").is_ok()
|
||||||
|
{
|
||||||
|
// These platforms don't have any special requirements.
|
||||||
|
} else {
|
||||||
|
// This is for Cargo's build-std support, to mark std as unstable for
|
||||||
|
// typically no_std platforms.
|
||||||
|
// This covers:
|
||||||
|
// - os=none ("bare metal" targets)
|
||||||
|
// - mipsel-sony-psp
|
||||||
|
// - nvptx64-nvidia-cuda
|
||||||
|
// - arch=avr
|
||||||
|
// - JSON targets
|
||||||
|
// - Any new targets that have not been explicitly added above.
|
||||||
|
println!("cargo:rustc-cfg=restricted_std");
|
||||||
|
}
|
||||||
|
|
||||||
|
println!("cargo:rustc-check-cfg=cfg(backtrace_in_libstd)");
|
||||||
|
println!("cargo:rustc-cfg=backtrace_in_libstd");
|
||||||
|
|
||||||
|
println!("cargo:rustc-env=STD_ENV_ARCH={}", env::var("CARGO_CFG_TARGET_ARCH").unwrap());
|
||||||
|
|
||||||
|
println!("cargo:rustc-check-cfg=cfg(vxworks_lt_25_09)");
|
||||||
|
|
||||||
|
if target_os == "vxworks" {
|
||||||
|
match vxworks_version_code() {
|
||||||
|
Some((major, minor)) if (major, minor) < (25, 9) => {
|
||||||
|
println!("cargo:rustc-cfg=vxworks_lt_25_09");
|
||||||
|
}
|
||||||
|
_ => {}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Retrieve the VxWorks release version from the environment variable set by the VxWorks build
|
||||||
|
/// environment, in `(minor, patch)` form.
|
||||||
|
fn vxworks_version_code() -> Option<(u32, u32)> {
|
||||||
|
let version = env::var("WIND_RELEASE_ID").ok()?;
|
||||||
|
|
||||||
|
let mut pieces = version.trim().split(['.']);
|
||||||
|
|
||||||
|
let major: u32 = pieces.next().and_then(|x| x.parse().ok()).unwrap_or(0);
|
||||||
|
let minor: u32 = pieces.next().and_then(|x| x.parse().ok()).unwrap_or(0);
|
||||||
|
|
||||||
|
Some((major, minor))
|
||||||
|
}
|
||||||
4
library/std/patches/sys/args/mod.sed
Normal file
4
library/std/patches/sys/args/mod.sed
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
# 55a \ target_os = "survos" => { \
|
||||||
|
# mod survos; \
|
||||||
|
# pub use survos::*; \
|
||||||
|
# }
|
||||||
1
library/std/patches/sys/io/error/mod.sed
Normal file
1
library/std/patches/sys/io/error/mod.sed
Normal file
@@ -0,0 +1 @@
|
|||||||
|
45a \ target_os = "survos",
|
||||||
6
library/std/patches/sys/pal/mod.sed
Normal file
6
library/std/patches/sys/pal/mod.sed
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
62a \ target_os = "survos" => { \
|
||||||
|
mod unsupported; \
|
||||||
|
pub use self::unsupported::*; \
|
||||||
|
mod survos; \
|
||||||
|
pub use self::survos::*; \
|
||||||
|
}
|
||||||
2
library/std/patches/sys/random/mod.sed
Normal file
2
library/std/patches/sys/random/mod.sed
Normal file
@@ -0,0 +1,2 @@
|
|||||||
|
108a \target_os = "survos",
|
||||||
|
124a \target_os = "survos",
|
||||||
6
library/std/patches/sys/thread_local/mod.sed
Normal file
6
library/std/patches/sys/thread_local/mod.sed
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
32a \ target_os = "survos",
|
||||||
|
|
||||||
|
129a \ target_os = "survos" => { \
|
||||||
|
// todo \
|
||||||
|
pub(crate) fn enable() {} \
|
||||||
|
}
|
||||||
22
library/std/riscv64.json
Normal file
22
library/std/riscv64.json
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
{
|
||||||
|
"llvm-target": "riscv64",
|
||||||
|
"llvm-abiname": "lp64",
|
||||||
|
"abi": "lp64",
|
||||||
|
"data-layout": "e-m:e-p:64:64-i64:64-i128:128-n32:64-S128",
|
||||||
|
"target-endian": "little",
|
||||||
|
"target-pointer-width": 64,
|
||||||
|
"arch": "riscv64",
|
||||||
|
"os": "survos",
|
||||||
|
"vendor": "unknown",
|
||||||
|
"env": "",
|
||||||
|
"features": "+i,+m,+a,+zicsr",
|
||||||
|
"linker": "ld.lld",
|
||||||
|
"linker-flavor": "ld",
|
||||||
|
"executables": true,
|
||||||
|
"panic-strategy": "abort",
|
||||||
|
"relocation-model": "static",
|
||||||
|
"disable-redzone": true,
|
||||||
|
"emit-debug-gdb-scripts": false,
|
||||||
|
"eh-frame-header": false,
|
||||||
|
"code-model": "medium"
|
||||||
|
}
|
||||||
1
library/std/src/alloc.rs
Symbolic link
1
library/std/src/alloc.rs
Symbolic link
@@ -0,0 +1 @@
|
|||||||
|
/home/julien/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/alloc.rs
|
||||||
1
library/std/src/ascii.rs
Symbolic link
1
library/std/src/ascii.rs
Symbolic link
@@ -0,0 +1 @@
|
|||||||
|
/home/julien/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/ascii.rs
|
||||||
1
library/std/src/backtrace
Symbolic link
1
library/std/src/backtrace
Symbolic link
@@ -0,0 +1 @@
|
|||||||
|
/home/julien/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/backtrace
|
||||||
1
library/std/src/backtrace.rs
Symbolic link
1
library/std/src/backtrace.rs
Symbolic link
@@ -0,0 +1 @@
|
|||||||
|
/home/julien/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/backtrace.rs
|
||||||
1
library/std/src/bstr.rs
Symbolic link
1
library/std/src/bstr.rs
Symbolic link
@@ -0,0 +1 @@
|
|||||||
|
/home/julien/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/bstr.rs
|
||||||
1
library/std/src/collections
Symbolic link
1
library/std/src/collections
Symbolic link
@@ -0,0 +1 @@
|
|||||||
|
/home/julien/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/collections
|
||||||
1
library/std/src/env.rs
Symbolic link
1
library/std/src/env.rs
Symbolic link
@@ -0,0 +1 @@
|
|||||||
|
/home/julien/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/env.rs
|
||||||
1
library/std/src/error.rs
Symbolic link
1
library/std/src/error.rs
Symbolic link
@@ -0,0 +1 @@
|
|||||||
|
/home/julien/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/error.rs
|
||||||
1
library/std/src/ffi
Symbolic link
1
library/std/src/ffi
Symbolic link
@@ -0,0 +1 @@
|
|||||||
|
/home/julien/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/ffi
|
||||||
1
library/std/src/fs
Symbolic link
1
library/std/src/fs
Symbolic link
@@ -0,0 +1 @@
|
|||||||
|
/home/julien/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/fs
|
||||||
1
library/std/src/fs.rs
Symbolic link
1
library/std/src/fs.rs
Symbolic link
@@ -0,0 +1 @@
|
|||||||
|
/home/julien/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/fs.rs
|
||||||
1
library/std/src/hash
Symbolic link
1
library/std/src/hash
Symbolic link
@@ -0,0 +1 @@
|
|||||||
|
/home/julien/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/hash
|
||||||
1
library/std/src/io
Symbolic link
1
library/std/src/io
Symbolic link
@@ -0,0 +1 @@
|
|||||||
|
/home/julien/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/io
|
||||||
1
library/std/src/keyword_docs.rs
Symbolic link
1
library/std/src/keyword_docs.rs
Symbolic link
@@ -0,0 +1 @@
|
|||||||
|
/home/julien/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/keyword_docs.rs
|
||||||
1
library/std/src/lib.rs
Symbolic link
1
library/std/src/lib.rs
Symbolic link
@@ -0,0 +1 @@
|
|||||||
|
/home/julien/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/lib.rs
|
||||||
1
library/std/src/macros.rs
Symbolic link
1
library/std/src/macros.rs
Symbolic link
@@ -0,0 +1 @@
|
|||||||
|
/home/julien/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/macros.rs
|
||||||
1
library/std/src/net
Symbolic link
1
library/std/src/net
Symbolic link
@@ -0,0 +1 @@
|
|||||||
|
/home/julien/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/net
|
||||||
1
library/std/src/num
Symbolic link
1
library/std/src/num
Symbolic link
@@ -0,0 +1 @@
|
|||||||
|
/home/julien/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/num
|
||||||
1
library/std/src/os/mod.rs
Symbolic link
1
library/std/src/os/mod.rs
Symbolic link
@@ -0,0 +1 @@
|
|||||||
|
/home/julien/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/os/mod.rs
|
||||||
1
library/std/src/os/raw/mod.rs
Symbolic link
1
library/std/src/os/raw/mod.rs
Symbolic link
@@ -0,0 +1 @@
|
|||||||
|
/home/julien/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/os/raw/mod.rs
|
||||||
1
library/std/src/os/raw/tests.rs
Symbolic link
1
library/std/src/os/raw/tests.rs
Symbolic link
@@ -0,0 +1 @@
|
|||||||
|
/home/julien/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/os/raw/tests.rs
|
||||||
1
library/std/src/panic.rs
Symbolic link
1
library/std/src/panic.rs
Symbolic link
@@ -0,0 +1 @@
|
|||||||
|
/home/julien/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/panic.rs
|
||||||
1
library/std/src/panicking.rs
Symbolic link
1
library/std/src/panicking.rs
Symbolic link
@@ -0,0 +1 @@
|
|||||||
|
/home/julien/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/panicking.rs
|
||||||
1
library/std/src/pat.rs
Symbolic link
1
library/std/src/pat.rs
Symbolic link
@@ -0,0 +1 @@
|
|||||||
|
/home/julien/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/pat.rs
|
||||||
1
library/std/src/path.rs
Symbolic link
1
library/std/src/path.rs
Symbolic link
@@ -0,0 +1 @@
|
|||||||
|
/home/julien/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/path.rs
|
||||||
1
library/std/src/prelude
Symbolic link
1
library/std/src/prelude
Symbolic link
@@ -0,0 +1 @@
|
|||||||
|
/home/julien/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/prelude
|
||||||
1
library/std/src/process
Symbolic link
1
library/std/src/process
Symbolic link
@@ -0,0 +1 @@
|
|||||||
|
/home/julien/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/process
|
||||||
1
library/std/src/process.rs
Symbolic link
1
library/std/src/process.rs
Symbolic link
@@ -0,0 +1 @@
|
|||||||
|
/home/julien/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/process.rs
|
||||||
1
library/std/src/random.rs
Symbolic link
1
library/std/src/random.rs
Symbolic link
@@ -0,0 +1 @@
|
|||||||
|
/home/julien/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/random.rs
|
||||||
1
library/std/src/rt.rs
Symbolic link
1
library/std/src/rt.rs
Symbolic link
@@ -0,0 +1 @@
|
|||||||
|
/home/julien/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/rt.rs
|
||||||
1
library/std/src/sync
Symbolic link
1
library/std/src/sync
Symbolic link
@@ -0,0 +1 @@
|
|||||||
|
/home/julien/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/sync
|
||||||
60
library/std/src/sys/args/mod.rs
Normal file
60
library/std/src/sys/args/mod.rs
Normal file
@@ -0,0 +1,60 @@
|
|||||||
|
//! Platform-dependent command line arguments abstraction.
|
||||||
|
|
||||||
|
#![forbid(unsafe_op_in_unsafe_fn)]
|
||||||
|
|
||||||
|
#[cfg(any(
|
||||||
|
all(target_family = "unix", not(any(target_os = "espidf", target_os = "vita"))),
|
||||||
|
target_family = "windows",
|
||||||
|
target_os = "hermit",
|
||||||
|
target_os = "motor",
|
||||||
|
target_os = "uefi",
|
||||||
|
target_os = "wasi",
|
||||||
|
target_os = "xous",
|
||||||
|
))]
|
||||||
|
mod common;
|
||||||
|
|
||||||
|
cfg_select! {
|
||||||
|
any(
|
||||||
|
all(target_family = "unix", not(any(target_os = "espidf", target_os = "vita"))),
|
||||||
|
target_os = "hermit",
|
||||||
|
) => {
|
||||||
|
mod unix;
|
||||||
|
pub use unix::*;
|
||||||
|
}
|
||||||
|
target_family = "windows" => {
|
||||||
|
mod windows;
|
||||||
|
pub use windows::*;
|
||||||
|
}
|
||||||
|
all(target_vendor = "fortanix", target_env = "sgx") => {
|
||||||
|
mod sgx;
|
||||||
|
pub use sgx::*;
|
||||||
|
}
|
||||||
|
target_os = "motor" => {
|
||||||
|
mod motor;
|
||||||
|
pub use motor::*;
|
||||||
|
}
|
||||||
|
target_os = "uefi" => {
|
||||||
|
mod uefi;
|
||||||
|
pub use uefi::*;
|
||||||
|
}
|
||||||
|
all(target_os = "wasi", target_env = "p1") => {
|
||||||
|
mod wasip1;
|
||||||
|
pub use wasip1::*;
|
||||||
|
}
|
||||||
|
all(target_os = "wasi", any(target_env = "p2", target_env = "p3")) => {
|
||||||
|
mod wasip2;
|
||||||
|
pub use wasip2::*;
|
||||||
|
}
|
||||||
|
target_os = "xous" => {
|
||||||
|
mod xous;
|
||||||
|
pub use xous::*;
|
||||||
|
}
|
||||||
|
target_os = "zkvm" => {
|
||||||
|
mod zkvm;
|
||||||
|
pub use zkvm::*;
|
||||||
|
}
|
||||||
|
_ => {
|
||||||
|
mod unsupported;
|
||||||
|
pub use unsupported::*;
|
||||||
|
}
|
||||||
|
}
|
||||||
1
library/std/src/sys/args/unsupported.rs
Symbolic link
1
library/std/src/sys/args/unsupported.rs
Symbolic link
@@ -0,0 +1 @@
|
|||||||
|
/home/julien/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/sys/args/unsupported.rs
|
||||||
1
library/std/src/sys/backtrace.rs
Symbolic link
1
library/std/src/sys/backtrace.rs
Symbolic link
@@ -0,0 +1 @@
|
|||||||
|
/home/julien/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/sys/backtrace.rs
|
||||||
1
library/std/src/sys/cmath.rs
Symbolic link
1
library/std/src/sys/cmath.rs
Symbolic link
@@ -0,0 +1 @@
|
|||||||
|
/home/julien/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/sys/cmath.rs
|
||||||
1
library/std/src/sys/configure_builtins.rs
Symbolic link
1
library/std/src/sys/configure_builtins.rs
Symbolic link
@@ -0,0 +1 @@
|
|||||||
|
/home/julien/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/sys/configure_builtins.rs
|
||||||
1
library/std/src/sys/env/common.rs
vendored
Symbolic link
1
library/std/src/sys/env/common.rs
vendored
Symbolic link
@@ -0,0 +1 @@
|
|||||||
|
/home/julien/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/sys/env/common.rs
|
||||||
1
library/std/src/sys/env/mod.rs
vendored
Symbolic link
1
library/std/src/sys/env/mod.rs
vendored
Symbolic link
@@ -0,0 +1 @@
|
|||||||
|
/home/julien/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/sys/env/mod.rs
|
||||||
1
library/std/src/sys/env/unsupported.rs
vendored
Symbolic link
1
library/std/src/sys/env/unsupported.rs
vendored
Symbolic link
@@ -0,0 +1 @@
|
|||||||
|
/home/julien/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/sys/env/unsupported.rs
|
||||||
1
library/std/src/sys/env_consts.rs
Symbolic link
1
library/std/src/sys/env_consts.rs
Symbolic link
@@ -0,0 +1 @@
|
|||||||
|
/home/julien/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/sys/env_consts.rs
|
||||||
1
library/std/src/sys/exit.rs
Symbolic link
1
library/std/src/sys/exit.rs
Symbolic link
@@ -0,0 +1 @@
|
|||||||
|
/home/julien/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/sys/exit.rs
|
||||||
1
library/std/src/sys/fd/mod.rs
Symbolic link
1
library/std/src/sys/fd/mod.rs
Symbolic link
@@ -0,0 +1 @@
|
|||||||
|
/home/julien/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/sys/fd/mod.rs
|
||||||
1
library/std/src/sys/fs/common.rs
Symbolic link
1
library/std/src/sys/fs/common.rs
Symbolic link
@@ -0,0 +1 @@
|
|||||||
|
/home/julien/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/sys/fs/common.rs
|
||||||
1
library/std/src/sys/fs/mod.rs
Symbolic link
1
library/std/src/sys/fs/mod.rs
Symbolic link
@@ -0,0 +1 @@
|
|||||||
|
/home/julien/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/sys/fs/mod.rs
|
||||||
1
library/std/src/sys/fs/unsupported.rs
Symbolic link
1
library/std/src/sys/fs/unsupported.rs
Symbolic link
@@ -0,0 +1 @@
|
|||||||
|
/home/julien/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/sys/fs/unsupported.rs
|
||||||
1
library/std/src/sys/helpers/mod.rs
Symbolic link
1
library/std/src/sys/helpers/mod.rs
Symbolic link
@@ -0,0 +1 @@
|
|||||||
|
/home/julien/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/sys/helpers/mod.rs
|
||||||
1
library/std/src/sys/helpers/small_c_string.rs
Symbolic link
1
library/std/src/sys/helpers/small_c_string.rs
Symbolic link
@@ -0,0 +1 @@
|
|||||||
|
/home/julien/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/sys/helpers/small_c_string.rs
|
||||||
1
library/std/src/sys/helpers/tests.rs
Symbolic link
1
library/std/src/sys/helpers/tests.rs
Symbolic link
@@ -0,0 +1 @@
|
|||||||
|
/home/julien/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/sys/helpers/tests.rs
|
||||||
1
library/std/src/sys/helpers/wstr.rs
Symbolic link
1
library/std/src/sys/helpers/wstr.rs
Symbolic link
@@ -0,0 +1 @@
|
|||||||
|
/home/julien/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/sys/helpers/wstr.rs
|
||||||
1
library/std/src/sys/io/error/generic.rs
Symbolic link
1
library/std/src/sys/io/error/generic.rs
Symbolic link
@@ -0,0 +1 @@
|
|||||||
|
/home/julien/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/sys/io/error/generic.rs
|
||||||
56
library/std/src/sys/io/error/mod.rs
Normal file
56
library/std/src/sys/io/error/mod.rs
Normal file
@@ -0,0 +1,56 @@
|
|||||||
|
cfg_select! {
|
||||||
|
target_os = "hermit" => {
|
||||||
|
mod hermit;
|
||||||
|
pub use hermit::*;
|
||||||
|
}
|
||||||
|
target_os = "motor" => {
|
||||||
|
mod motor;
|
||||||
|
pub use motor::*;
|
||||||
|
}
|
||||||
|
all(target_vendor = "fortanix", target_env = "sgx") => {
|
||||||
|
mod sgx;
|
||||||
|
pub use sgx::*;
|
||||||
|
}
|
||||||
|
target_os = "solid_asp3" => {
|
||||||
|
mod solid;
|
||||||
|
pub use solid::*;
|
||||||
|
}
|
||||||
|
target_os = "teeos" => {
|
||||||
|
mod teeos;
|
||||||
|
pub use teeos::*;
|
||||||
|
}
|
||||||
|
target_os = "uefi" => {
|
||||||
|
mod uefi;
|
||||||
|
pub use uefi::*;
|
||||||
|
}
|
||||||
|
target_family = "unix" => {
|
||||||
|
mod unix;
|
||||||
|
pub use unix::*;
|
||||||
|
}
|
||||||
|
target_os = "wasi" => {
|
||||||
|
mod wasi;
|
||||||
|
pub use wasi::*;
|
||||||
|
}
|
||||||
|
target_os = "windows" => {
|
||||||
|
mod windows;
|
||||||
|
pub use windows::*;
|
||||||
|
}
|
||||||
|
target_os = "xous" => {
|
||||||
|
mod xous;
|
||||||
|
pub use xous::*;
|
||||||
|
}
|
||||||
|
any(
|
||||||
|
target_os = "vexos",
|
||||||
|
target_family = "wasm",
|
||||||
|
target_os = "zkvm",
|
||||||
|
target_os = "survos",
|
||||||
|
) => {
|
||||||
|
mod generic;
|
||||||
|
pub use generic::*;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pub type RawOsError = cfg_select! {
|
||||||
|
target_os = "uefi" => usize,
|
||||||
|
_ => i32,
|
||||||
|
};
|
||||||
1
library/std/src/sys/io/io_slice/unsupported.rs
Symbolic link
1
library/std/src/sys/io/io_slice/unsupported.rs
Symbolic link
@@ -0,0 +1 @@
|
|||||||
|
/home/julien/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/sys/io/io_slice/unsupported.rs
|
||||||
1
library/std/src/sys/io/is_terminal/unsupported.rs
Symbolic link
1
library/std/src/sys/io/is_terminal/unsupported.rs
Symbolic link
@@ -0,0 +1 @@
|
|||||||
|
/home/julien/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/sys/io/is_terminal/unsupported.rs
|
||||||
1
library/std/src/sys/io/kernel_copy/mod.rs
Symbolic link
1
library/std/src/sys/io/kernel_copy/mod.rs
Symbolic link
@@ -0,0 +1 @@
|
|||||||
|
/home/julien/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/sys/io/kernel_copy/mod.rs
|
||||||
1
library/std/src/sys/io/mod.rs
Symbolic link
1
library/std/src/sys/io/mod.rs
Symbolic link
@@ -0,0 +1 @@
|
|||||||
|
/home/julien/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/sys/io/mod.rs
|
||||||
1
library/std/src/sys/mod.rs
Symbolic link
1
library/std/src/sys/mod.rs
Symbolic link
@@ -0,0 +1 @@
|
|||||||
|
/home/julien/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/sys/mod.rs
|
||||||
1
library/std/src/sys/net/connection/mod.rs
Symbolic link
1
library/std/src/sys/net/connection/mod.rs
Symbolic link
@@ -0,0 +1 @@
|
|||||||
|
/home/julien/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/sys/net/connection/mod.rs
|
||||||
1
library/std/src/sys/net/connection/unsupported.rs
Symbolic link
1
library/std/src/sys/net/connection/unsupported.rs
Symbolic link
@@ -0,0 +1 @@
|
|||||||
|
/home/julien/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/sys/net/connection/unsupported.rs
|
||||||
1
library/std/src/sys/net/hostname/mod.rs
Symbolic link
1
library/std/src/sys/net/hostname/mod.rs
Symbolic link
@@ -0,0 +1 @@
|
|||||||
|
/home/julien/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/sys/net/hostname/mod.rs
|
||||||
1
library/std/src/sys/net/hostname/unsupported.rs
Symbolic link
1
library/std/src/sys/net/hostname/unsupported.rs
Symbolic link
@@ -0,0 +1 @@
|
|||||||
|
/home/julien/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/sys/net/hostname/unsupported.rs
|
||||||
1
library/std/src/sys/net/mod.rs
Symbolic link
1
library/std/src/sys/net/mod.rs
Symbolic link
@@ -0,0 +1 @@
|
|||||||
|
/home/julien/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/sys/net/mod.rs
|
||||||
1
library/std/src/sys/os_str/bytes.rs
Symbolic link
1
library/std/src/sys/os_str/bytes.rs
Symbolic link
@@ -0,0 +1 @@
|
|||||||
|
/home/julien/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/sys/os_str/bytes.rs
|
||||||
1
library/std/src/sys/os_str/bytes/tests.rs
Symbolic link
1
library/std/src/sys/os_str/bytes/tests.rs
Symbolic link
@@ -0,0 +1 @@
|
|||||||
|
/home/julien/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/sys/os_str/bytes/tests.rs
|
||||||
1
library/std/src/sys/os_str/mod.rs
Symbolic link
1
library/std/src/sys/os_str/mod.rs
Symbolic link
@@ -0,0 +1 @@
|
|||||||
|
/home/julien/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/sys/os_str/mod.rs
|
||||||
73
library/std/src/sys/pal/mod.rs
Normal file
73
library/std/src/sys/pal/mod.rs
Normal file
@@ -0,0 +1,73 @@
|
|||||||
|
//! The PAL (platform abstraction layer) contains platform-specific abstractions
|
||||||
|
//! for implementing the features in the other submodules, such as e.g. bindings.
|
||||||
|
|
||||||
|
#![allow(missing_debug_implementations)]
|
||||||
|
|
||||||
|
cfg_select! {
|
||||||
|
unix => {
|
||||||
|
mod unix;
|
||||||
|
pub use self::unix::*;
|
||||||
|
}
|
||||||
|
windows => {
|
||||||
|
mod windows;
|
||||||
|
pub use self::windows::*;
|
||||||
|
}
|
||||||
|
target_os = "solid_asp3" => {
|
||||||
|
mod solid;
|
||||||
|
pub use self::solid::*;
|
||||||
|
}
|
||||||
|
target_os = "hermit" => {
|
||||||
|
mod hermit;
|
||||||
|
pub use self::hermit::*;
|
||||||
|
}
|
||||||
|
target_os = "motor" => {
|
||||||
|
mod motor;
|
||||||
|
pub use self::motor::*;
|
||||||
|
}
|
||||||
|
target_os = "trusty" => {
|
||||||
|
mod trusty;
|
||||||
|
pub use self::trusty::*;
|
||||||
|
}
|
||||||
|
target_os = "vexos" => {
|
||||||
|
mod vexos;
|
||||||
|
pub use self::vexos::*;
|
||||||
|
}
|
||||||
|
target_os = "wasi" => {
|
||||||
|
mod wasi;
|
||||||
|
pub use self::wasi::*;
|
||||||
|
}
|
||||||
|
target_family = "wasm" => {
|
||||||
|
mod wasm;
|
||||||
|
pub use self::wasm::*;
|
||||||
|
}
|
||||||
|
target_os = "xous" => {
|
||||||
|
mod xous;
|
||||||
|
pub use self::xous::*;
|
||||||
|
}
|
||||||
|
target_os = "uefi" => {
|
||||||
|
mod uefi;
|
||||||
|
pub use self::uefi::*;
|
||||||
|
}
|
||||||
|
all(target_vendor = "fortanix", target_env = "sgx") => {
|
||||||
|
mod sgx;
|
||||||
|
pub use self::sgx::*;
|
||||||
|
}
|
||||||
|
target_os = "teeos" => {
|
||||||
|
mod teeos;
|
||||||
|
pub use self::teeos::*;
|
||||||
|
}
|
||||||
|
target_os = "zkvm" => {
|
||||||
|
mod zkvm;
|
||||||
|
pub use self::zkvm::*;
|
||||||
|
}
|
||||||
|
target_os = "survos" => {
|
||||||
|
mod unsupported;
|
||||||
|
pub use self::unsupported::*;
|
||||||
|
mod survos;
|
||||||
|
pub use self::survos::*;
|
||||||
|
}
|
||||||
|
_ => {
|
||||||
|
mod unsupported;
|
||||||
|
pub use self::unsupported::*;
|
||||||
|
}
|
||||||
|
}
|
||||||
11
library/std/src/sys/pal/survos.rs
Normal file
11
library/std/src/sys/pal/survos.rs
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
/// # Safety
|
||||||
|
/// `argc` and `argv` are passed by the kernel
|
||||||
|
#[unsafe(no_mangle)]
|
||||||
|
#[stable(feature = "rust1", since = "1.0.0")]
|
||||||
|
pub unsafe extern "C" fn _start(argc: isize, argv: *const *const u8) -> isize {
|
||||||
|
unsafe extern "C" {
|
||||||
|
fn main(argc: isize, argv: *const *const u8) -> isize;
|
||||||
|
}
|
||||||
|
|
||||||
|
unsafe { main(argc, argv) }
|
||||||
|
}
|
||||||
1
library/std/src/sys/pal/unsupported/common.rs
Symbolic link
1
library/std/src/sys/pal/unsupported/common.rs
Symbolic link
@@ -0,0 +1 @@
|
|||||||
|
/home/julien/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/sys/pal/unsupported/common.rs
|
||||||
1
library/std/src/sys/pal/unsupported/mod.rs
Symbolic link
1
library/std/src/sys/pal/unsupported/mod.rs
Symbolic link
@@ -0,0 +1 @@
|
|||||||
|
/home/julien/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/sys/pal/unsupported/mod.rs
|
||||||
1
library/std/src/sys/pal/unsupported/os.rs
Symbolic link
1
library/std/src/sys/pal/unsupported/os.rs
Symbolic link
@@ -0,0 +1 @@
|
|||||||
|
/home/julien/.rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/std/src/sys/pal/unsupported/os.rs
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user