-
Notifications
You must be signed in to change notification settings - Fork 238
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
esp32c3 floating-point related linking error #881
Comments
It seems to be LLVM thing - llvm/llvm-project#64206 |
How old is your compiler? These intrinsics should be emitted by a recent version of rustc in compiler-builtins: https://github.com/rust-lang/compiler-builtins/blob/d1d785a538d51d0082c3e6209a28c9fb1a90ec3c/src/math.rs#L142-L157 |
I created a docker container just to show the reproduction on saturday 28th.
So it is not outdated for sure |
Ah, looks like a bug in compile-builtins, the math module isn't enabled for riscv without floating point: https://github.com/rust-lang/compiler-builtins/blob/d1d785a538d51d0082c3e6209a28c9fb1a90ec3c/src/lib.rs#L46-L56 |
does this mean that the fix is as simple as diff --git a/src/lib.rs b/src/lib.rs
index d1195a4..dd4ede7 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -48,6 +48,7 @@ pub mod int;
all(target_arch = "x86_64", target_os = "none"),
all(target_arch = "x86_64", target_os = "uefi"),
all(target_arch = "arm", target_os = "none"),
+ all(target_arch = "riscv32", target_os = "none"),
all(target_arch = "xtensa", target_os = "none"),
all(target_arch = "mips", target_os = "none"),
target_os = "xous", or there's a reason for this not being enabled? |
Given that this has nothing to do with the HAL itself, going to close it. Thanks for reporting the issue, regardless. |
sure, thanks! it was very helpful |
Hi,
I noticed that making some operations on for example f32 can refer to symbols that are not existing for the target and outcome is a linking error.
more or less minimal example:
results in
Since this target does not have FPU, I tried to add
-C soft-float
to rustflags but no change in behavior.I have no idea where this issue belongs, but since I stumbled on it working on esp32c3 no_std project, I guess it can be a good starting point.
example is available here: https://gitlab.com/mchodzikiewicz/reproduce-esp32-c3-fminf
and here you can see a reproduction: https://gitlab.com/mchodzikiewicz/reproduce-esp32-c3-fminf/-/jobs/5407620084
The text was updated successfully, but these errors were encountered: