From b8a2b468a104bb642403eae3054995b724a45734 Mon Sep 17 00:00:00 2001 From: Evie Viau Date: Tue, 1 Jul 2025 22:18:03 -0700 Subject: [PATCH] Use forked rust --- .cargo/config.toml | 5 +-- build.rs | 4 -- linkers/x86_64.ld | 72 ----------------------------------- rust-toolchain.toml | 2 +- x86_64-unknown-hypericum.json | 32 ---------------- 5 files changed, 2 insertions(+), 113 deletions(-) delete mode 100644 build.rs delete mode 100644 linkers/x86_64.ld delete mode 100644 x86_64-unknown-hypericum.json diff --git a/.cargo/config.toml b/.cargo/config.toml index 379267c..8f308f7 100644 --- a/.cargo/config.toml +++ b/.cargo/config.toml @@ -1,5 +1,2 @@ [build] -target = "./x86_64-unknown-hypericum.json" - -[unstable] -build-std = ["core", "alloc"] \ No newline at end of file +target = "x86_64-unknown-hypericum" \ No newline at end of file diff --git a/build.rs b/build.rs deleted file mode 100644 index dd9d377..0000000 --- a/build.rs +++ /dev/null @@ -1,4 +0,0 @@ -fn main() { - println!("cargo:rustc-link-arg=-Tlinkers/x86_64.ld"); - println!("cargo:rerun-if-changed=linkers/x86_64.ld"); -} \ No newline at end of file diff --git a/linkers/x86_64.ld b/linkers/x86_64.ld deleted file mode 100644 index 3d50b2c..0000000 --- a/linkers/x86_64.ld +++ /dev/null @@ -1,72 +0,0 @@ -/* Tell the linker that we want an x86_64 ELF64 output file */ -OUTPUT_FORMAT(elf64-x86-64) -OUTPUT_ARCH(i386:x86-64) - -/* We want the symbol _kmain to be our entry point */ -ENTRY(_kmain) - -/* Define the program headers we want so the bootloader gives us the right */ -/* MMU permissions */ -PHDRS -{ - text PT_LOAD FLAGS(0x05); /* Execute + Read */ - rodata PT_LOAD FLAGS(0x04); /* Read only */ - data PT_LOAD FLAGS(0x06); /* Write + Read */ - dynamic PT_DYNAMIC FLAGS(0x06); /* Dynamic PHDR for relocations */ -} - -SECTIONS -{ - /* We wanna be placed in the topmost 2GiB of the address space, for optimisations */ - /* Any address in this region will do, but often 0xffffffff80000000 is chosen as */ - /* that is the beginning of the region. */ - . = 0xffffffff80000000; - - .text : { - *(.text .text.*) - } :text - - /* Move to the next memory page for .rodata */ - . = ALIGN(CONSTANT(MAXPAGESIZE)); - - .rodata : { - *(.rodata .rodata.*) - } :rodata - - /* Move to the next memory page for .data */ - . = ALIGN(CONSTANT(MAXPAGESIZE)); - - .data : { - *(.data .data.*) - - /* Place the sections that contain the requests as part of the .data */ - /* output section. */ - KEEP(*(.requests_start_marker)) - KEEP(*(.requests)) - KEEP(*(.requests_end_marker)) - } :data - - /* Dynamic section for relocations, both in its own PHDR and inside data PHDR */ - .dynamic : { - *(.dynamic) - } :data :dynamic - - /* NOTE: .bss needs to be the last thing mapped to :data, otherwise lots of */ - /* unnecessary zeros will be written to the binary. */ - /* If you need, for example, .init_array and .fini_array, those should be placed */ - /* above this. */ - .bss : { - *(.bss .bss.*) - *(COMMON) - } :data - - /* Discard .note.* and .eh_frame* since they may cause issues on some hosts. */ - /* Also discard the program interpreter section since we do not need one. This is */ - /* more or less equivalent to the --no-dynamic-linker linker flag, except that it */ - /* works with ld.gold. */ - /DISCARD/ : { - *(.eh_frame*) - *(.note .note.*) - *(.interp) - } -} diff --git a/rust-toolchain.toml b/rust-toolchain.toml index 271800c..93f7d2d 100644 --- a/rust-toolchain.toml +++ b/rust-toolchain.toml @@ -1,2 +1,2 @@ [toolchain] -channel = "nightly" \ No newline at end of file +channel = "x86_64-unknown-hypericum" \ No newline at end of file diff --git a/x86_64-unknown-hypericum.json b/x86_64-unknown-hypericum.json deleted file mode 100644 index f77865a..0000000 --- a/x86_64-unknown-hypericum.json +++ /dev/null @@ -1,32 +0,0 @@ -{ - "arch": "x86_64", - "cpu": "x86-64", - "crt-objects-fallback": "false", - "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", - "disable-redzone": true, - "features": "-mmx,-sse,-sse2,-sse3,-ssse3,-sse4.1,-sse4.2,-avx,-avx2,+soft-float", - "linker": "rust-lld", - "linker-flavor": "gnu-lld", - "llvm-target": "x86_64-unknown-none-elf", - "max-atomic-width": 64, - "metadata": { - "description": "Hypericum", - "host_tools": false, - "std": false - }, - "os": "hypericum", - "panic-strategy": "abort", - "plt-by-default": false, - "position-independent-executables": false, - "relro-level": "off", - "rustc-abi": "x86-softfloat", - "stack-probes": { - "kind": "inline" - }, - "static-position-independent-executables": true, - "supported-sanitizers": [ - "kcfi", - "kernel-address" - ], - "target-pointer-width": "64" -} \ No newline at end of file