diff --git a/bootstrap/.cargo/config.toml b/bootstrap/.cargo/config.toml new file mode 100644 index 0000000000..b69619dd83 --- /dev/null +++ b/bootstrap/.cargo/config.toml @@ -0,0 +1,3 @@ +[unstable] +build-std = ["core", "alloc", "compiler_builtins"] +build-std-features = ["compiler-builtins-mem"] diff --git a/bootstrap/Cargo.toml b/bootstrap/Cargo.toml index 82e5870b6a..a9f2864422 100644 --- a/bootstrap/Cargo.toml +++ b/bootstrap/Cargo.toml @@ -6,10 +6,6 @@ authors = ["4lDO2 <4lDO2@protonmail.com>"] edition = "2024" license = "MIT" -[lib] -name = "bootstrap" -crate-type = ["staticlib"] - [dependencies] hashbrown = { version = "0.15", default-features = false, features = [ "inline-more", @@ -32,6 +28,8 @@ redox-rt = { git = "https://gitlab.redox-os.org/redox-os/relibc.git", default-fe [profile.release] panic = "abort" lto = "fat" +opt-level = "s" [profile.dev] panic = "abort" +opt-level = "s" diff --git a/bootstrap/build.rs b/bootstrap/build.rs new file mode 100644 index 0000000000..1e21a8d0f5 --- /dev/null +++ b/bootstrap/build.rs @@ -0,0 +1,11 @@ +use std::env; + +fn main() { + let manifest_dir = env::var("CARGO_MANIFEST_DIR").unwrap(); + let arch = env::var("CARGO_CFG_TARGET_ARCH").unwrap(); + + println!("cargo::rustc-link-arg=-z"); + println!("cargo::rustc-link-arg=max-page-size=4096"); + println!("cargo::rustc-link-arg=-T"); + println!("cargo::rustc-link-arg={manifest_dir}/src/{arch}.ld"); +} diff --git a/bootstrap/src/lib.rs b/bootstrap/src/main.rs similarity index 99% rename from bootstrap/src/lib.rs rename to bootstrap/src/main.rs index c99076ce8a..f7dcd537cc 100644 --- a/bootstrap/src/lib.rs +++ b/bootstrap/src/main.rs @@ -1,4 +1,5 @@ #![no_std] +#![no_main] #![allow(internal_features)] #![feature(core_intrinsics, str_from_raw_parts, never_type)]