Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/libcore/num/float.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
// HACK(https://github.com/rust-lang/rust/issues/62785): uefi targets need special LLVM support
// unless we emit the _fltused
#[cfg(target_os = "uefi")]
#[no_mangle]
#[used]
static _fltused: i32 = 0;
1 change: 1 addition & 0 deletions src/libcore/num/mod.rs
Original file line number Diff line number Diff line change
@@ -213,6 +213,7 @@ pub mod dec2flt;
pub mod bignum;
pub mod diy_float;

mod float;
mod wrapping;

macro_rules! usize_isize_to_xe_bytes_doc {
25 changes: 25 additions & 0 deletions src/test/ui/uefi-float.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
// build-pass
// https://github.com/rust-lang/rust/issues/62785

#![no_std]
#![no_main]
use core::fmt::{Write,Error};

struct Dummy;

impl Write for Dummy {
fn write_str(&mut self, _s: &str) -> Result<(), Error>{
Ok(())
}
}

#[no_mangle]
pub extern "C" fn efi_main() -> i32 {
write!(Dummy,"Hello, world!").unwrap();
0
}

#[panic_handler]
fn panic(_info: &core::panic::PanicInfo) -> ! {
loop{}
}
3 changes: 3 additions & 0 deletions src/tools/tidy/src/pal.rs
Original file line number Diff line number Diff line change
@@ -44,6 +44,9 @@ const EXCEPTION_PATHS: &[&str] = &[
// target_os to tell targets with different LLVM-versions appart
// (e.g. `wasm32-unknown-emscripten` vs `wasm32-unknown-unknown`):
"src/libcore/hint.rs",
// HACK(https://github.com/rust-lang/rust/issues/62785): uefi targets need special LLVM support
// unless we emit the _fltused
"src/libcore/num/float.rs",
"src/libstd/sys/", // Platform-specific code for std lives here.
// This has the trailing slash so that sys_common is not excepted.
"src/libstd/os", // Platform-specific public interfaces