diff --git a/.cargo/config b/.cargo/config deleted file mode 100644 index 20ee1ec977f55c6c891e0f3cb99feab3f36deb81..0000000000000000000000000000000000000000 --- a/.cargo/config +++ /dev/null @@ -1,9 +0,0 @@ -[build] -rustflags = [ - # Kernel should preserve floating-point registers - "-Csoft-float", -] - -[unstable] -build-std = ["core", "alloc", "compiler_builtins"] -build-std-features = ["panic-unwind"] diff --git a/mk/aarch64-unknown-uefi.mk b/mk/aarch64-unknown-uefi.mk index aa36a9f40c2d3da9eb952015ea95989dbb3e44fd..9a98e2b903681c96a92ea4a01658953433a8ed43 100644 --- a/mk/aarch64-unknown-uefi.mk +++ b/mk/aarch64-unknown-uefi.mk @@ -5,6 +5,7 @@ all: $(BUILD)/bootloader.efi $(BUILD)/bootloader.efi: Cargo.lock Cargo.toml $(shell find src -type f) mkdir -p $(BUILD) + env RUSTFLAGS="-C soft-float" \ cargo rustc \ -Z build-std=core,alloc \ -Z build-std-features=compiler-builtins-mem \ @@ -12,11 +13,11 @@ $(BUILD)/bootloader.efi: Cargo.lock Cargo.toml $(shell find src -type f) --bin bootloader \ --release \ -- \ - -C soft-float \ --emit link=$@ $(BUILD)/bootloader-live.efi: Cargo.lock Cargo.toml $(shell find src -type f) mkdir -p $(BUILD) + env RUSTFLAGS="-C soft-float" \ cargo rustc \ -Z build-std=core,alloc \ -Z build-std-features=compiler-builtins-mem \ @@ -25,7 +26,6 @@ $(BUILD)/bootloader-live.efi: Cargo.lock Cargo.toml $(shell find src -type f) --release \ --features live \ -- \ - -C soft-float \ --emit link=$@ $(BUILD)/esp.bin: $(BUILD)/bootloader.efi diff --git a/mk/x86-unknown-none.mk b/mk/x86-unknown-none.mk index 790d2747e08066286e8d32ec7036ae2dc74cb8dd..c44a34ba494159f38c949f7b8b2950dc58586c41 100644 --- a/mk/x86-unknown-none.mk +++ b/mk/x86-unknown-none.mk @@ -7,7 +7,16 @@ all: $(BUILD)/bootloader.bin $(BUILD)/libbootloader.a: Cargo.lock Cargo.toml $(shell find src -type f) mkdir -p $(BUILD) - cargo rustc --lib --target $(TARGET) --release -- -C soft-float -C debuginfo=2 --emit link=$@ + env RUSTFLAGS="-C soft-float" \ + cargo rustc \ + -Z build-std=core,alloc \ + -Z build-std-features=compiler-builtins-mem \ + --target $(TARGET) \ + --lib \ + --release \ + -- \ + -C debuginfo=2 \ + --emit link=$@ $(BUILD)/bootloader.elf: linkers/$(TARGET).ld $(BUILD)/libbootloader.a mkdir -p $(BUILD) @@ -21,7 +30,17 @@ $(BUILD)/bootloader.bin: $(BUILD)/bootloader.elf $(shell find asm/$(TARGET) -typ $(BUILD)/libbootloader-live.a: Cargo.lock Cargo.toml $(shell find src -type f) mkdir -p $(BUILD) - cargo rustc --lib --target $(TARGET) --release --features live -- -C soft-float -C debuginfo=2 --emit link=$@ + env RUSTFLAGS="-C soft-float" \ + cargo rustc \ + -Z build-std=core,alloc \ + -Z build-std-features=compiler-builtins-mem \ + --target $(TARGET) \ + --lib \ + --release \ + --features live \ + -- \ + -C debuginfo=2 \ + --emit link=$@ $(BUILD)/bootloader-live.elf: linkers/$(TARGET).ld $(BUILD)/libbootloader-live.a mkdir -p $(BUILD) diff --git a/mk/x86_64-unknown-uefi.mk b/mk/x86_64-unknown-uefi.mk index 49332e47d602a7aa5533b4b525904b07588c93ae..640ba1a117479ced97fa15115e288f43bdaaacf2 100644 --- a/mk/x86_64-unknown-uefi.mk +++ b/mk/x86_64-unknown-uefi.mk @@ -5,6 +5,7 @@ all: $(BUILD)/bootloader.efi $(BUILD)/bootloader.efi: Cargo.lock Cargo.toml $(shell find src -type f) mkdir -p $(BUILD) + env RUSTFLAGS="-C soft-float" \ cargo rustc \ -Z build-std=core,alloc \ -Z build-std-features=compiler-builtins-mem \ @@ -12,11 +13,11 @@ $(BUILD)/bootloader.efi: Cargo.lock Cargo.toml $(shell find src -type f) --bin bootloader \ --release \ -- \ - -C soft-float \ --emit link=$@ $(BUILD)/bootloader-live.efi: Cargo.lock Cargo.toml $(shell find src -type f) mkdir -p $(BUILD) + env RUSTFLAGS="-C soft-float" \ cargo rustc \ -Z build-std=core,alloc \ -Z build-std-features=compiler-builtins-mem \ @@ -25,7 +26,6 @@ $(BUILD)/bootloader-live.efi: Cargo.lock Cargo.toml $(shell find src -type f) --release \ --features live \ -- \ - -C soft-float \ --emit link=$@ $(BUILD)/esp.bin: $(BUILD)/bootloader.efi