From 13c4b03308586cf13d0cbefb2780a0f11455e88a Mon Sep 17 00:00:00 2001 From: Niklas Sombert Date: Mon, 25 Nov 2024 19:02:30 +0100 Subject: [PATCH] Remove hacks module (again) This basically reverts 581eb55d0cf1027f3c2a29740a3ebb0ede32005f and b4d2f7a9b0490bbd408a8ee509a01444dcda4e39, because current rustc provides these symbols again. --- Cargo.lock | 7 ------- README.md | 2 +- towboot/Cargo.toml | 4 ---- towboot/src/hacks.rs | 22 ---------------------- towboot/src/main.rs | 2 -- 5 files changed, 1 insertion(+), 36 deletions(-) delete mode 100644 towboot/src/hacks.rs diff --git a/Cargo.lock b/Cargo.lock index ad35d03..398b1f4 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1016,12 +1016,6 @@ dependencies = [ "pkg-config", ] -[[package]] -name = "libm" -version = "0.2.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ec2a862134d2a7d32d7983ddcdd1c4923530833c9f2ea1a44fc5fa473989058" - [[package]] name = "libredox" version = "0.1.3" @@ -1984,7 +1978,6 @@ dependencies = [ "acpi", "built", "goblin", - "libm", "log", "multiboot12", "scroll", diff --git a/README.md b/README.md index 42d7aac..766e4be 100644 --- a/README.md +++ b/README.md @@ -98,7 +98,7 @@ If you want to compile towboot yourself, here are the instructions: You'll need a nightly Rust compiler. The version doesn't really matter, -though `1.83.0-nightly (52fd99839 2024-10-10)` definitely works. +though `1.85.0-nightly (28fc2ba71 2024-11-24)` definitely works. If you don't know how to install one, please take a look at [rustup.rs](https://rustup.rs/). diff --git a/towboot/Cargo.toml b/towboot/Cargo.toml index 7b6a2e7..85f2082 100644 --- a/towboot/Cargo.toml +++ b/towboot/Cargo.toml @@ -26,9 +26,5 @@ scroll = { version = "0.12", default-features = false } towboot_config = { path = "../towboot_config" } -# i686-unknown-uefi currently lacks float functions, see hacks.rs -[target.'cfg(target_arch = "x86")'.dependencies] -libm = "0.2" - [build-dependencies] built = { version = "0.7", features = ["git2"] } diff --git a/towboot/src/hacks.rs b/towboot/src/hacks.rs deleted file mode 100644 index 2f6619d..0000000 --- a/towboot/src/hacks.rs +++ /dev/null @@ -1,22 +0,0 @@ -//! "This place is not a place of honor. -//! No highly esteemed deed is commemorated here. -//! Nothing valued is here." -//! -//! This module contains missing symbols. -//! -//! The fmod and fmodf functions are [currently missing](https://github.com/rust-lang/rust/issues/128533) -//! on i686-unknown-uefi, so let's use the ones of libm. -//! In the long run, this should be fixed in `compiler_builtins`. -//! For now, this monkeypatching seems to be enough. -//! -//! see https://github.com/rust-lang/compiler-builtins/blob/master/src/math.rs -#[cfg(target_arch = "x86")] -#[no_mangle] -pub extern "C" fn fmod(x: f64, y: f64) -> f64 { - libm::fmod(x, y) -} -#[cfg(target_arch = "x86")] -#[no_mangle] -pub extern "C" fn fmodf(x: f32, y: f32) -> f32 { - libm::fmodf(x, y) -} diff --git a/towboot/src/main.rs b/towboot/src/main.rs index f85029e..bf524d7 100644 --- a/towboot/src/main.rs +++ b/towboot/src/main.rs @@ -19,8 +19,6 @@ use uefi::proto::loaded_image::{LoadedImage, LoadOptionsError}; use log::{debug, info, warn, error}; mod boot; -// contains several workarounds for bugs in the Rust UEFI targets -mod hacks; mod config; mod file; mod mem;