Skip to content
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

rust-lld: error: undefined symbol: fmodf #95

Open
gshep opened this issue Sep 17, 2021 · 4 comments
Open

rust-lld: error: undefined symbol: fmodf #95

gshep opened this issue Sep 17, 2021 · 4 comments

Comments

@gshep
Copy link

gshep commented Sep 17, 2021

Hello! Tried to build for UEFI and got the following error:

$ cargo +nightly build -Z build-std=std,panic_abort --target x86_64-unknown-uefi
// ...
error: linking with `rust-lld` failed: exit status: 1
  |
  = note: rust-lld: error: undefined symbol: fmodf
          >>> referenced by /home/user/.cargo/registry/src/gitpro.ttaallkk.top-1ecc6299db9ec823/micromath-2.0.0/src/float.rs:489
          >>>               libmicromath-70d91a162d5a686d.rlib(micromath-70d91a162d5a686d.micromath.3zoex4n7-cgu.12.rcgu.o):(_$LT$micromath..float..F32$u20$as$u20$core..ops..arith..Rem$GT$::rem::h2c54b78270aa0a20)
          

error: aborting due to previous error; 7 warnings emitted

error: could not compile `uefi-app1`

To learn more, run the command again with --verbose.

I hacked the sources, removed Rem/RemAssign and built my sample but would like to wonder if this ok in common. Thanks in advance!

@tarcieri
Copy link
Owner

tarcieri commented Sep 17, 2021

This looks like a missing intrinsic for UEFI targets.

I'd suggest opening an issue about it upstream requesting for it to be added, similar to this one:

rust-lang/compiler-builtins#354

Short-term we can gate Rem/RemAssign on #[cfg(not(...))] UEFI targets, however I'd need your help determining what the ... looks like and validating that it compiles correctly.

Can you tell me the "target triple" for UEFI that you're using? x86_64-unknown-uefi perhaps?

@gshep
Copy link
Author

gshep commented Sep 20, 2021

Ok, I post request in upstream.

Yes, you're correct - it is x86_64-unknown-uefi.

@tarcieri
Copy link
Owner

Where is the upstream issue? We can link it in some comments to eventually remove the gating for the intrinsic.

@TDHolmes
Copy link

Looks like it's all merged into compiler builtins

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants