-
Notifications
You must be signed in to change notification settings - Fork 102
floor(), floorf(), ceil() and ceilf() Don't actually work on no-std (linker error) #258
Comments
What makes it questionable is that LLVM optimizes float ops as if there's no FP environmental flags anyway, so... it shouldn't actually affect anything to just remove all uses of the macro. |
Aren't Can you provide example code to reproduce this issue? |
@Amanieu yes, but they aren't |
|
I also had this problem when compiling to target |
We have also experienced this issue on custom x86_64-based targets for quite a long time. My workaround has just been to write |
Just a heads up - I ran into this message myself quite some time before and went ahead to export all functions in this crate with |
I think this issue should be resolved; feel free to open an issue at https://github.com/rust-lang/compiler-builtins if there is any follow up. |
The linker prints out:
undefined symbol: fmodf
andundefined symbol: fmod
. I noticed that if I don't use any of these functions the linker error goes away. I've been trying to figure out why this is happening all day, and finally tracked it down to these functions. I believe the code that generates the code looking for this external symbol is caused by theforce_eval!()
macro invocation. To me it looks like maybe LLVM is trying to optimize based on that and attempting to use the actual libm.It would also be nice if there was some documentation on what
force_eval()!
is for because I can't figure it out.I'm running rustc 1.59.0-nightly (0b42deacc 2021-12-09) cross compiling from Linux (x86) to aarch64.
The text was updated successfully, but these errors were encountered: