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

expose some math to UEFI envs #435

Merged
merged 1 commit into from
Oct 15, 2021
Merged

expose some math to UEFI envs #435

merged 1 commit into from
Oct 15, 2021

Conversation

gshep
Copy link
Contributor

@gshep gshep commented Sep 29, 2021

issue #434

this was a bit tricky cause I had to use this workaround #388 (comment) for testing (also rename __fltused in my sources since it doesn't get mangled). Tested on a sample with math for UEFI and on a project for WASM; seems to be working =).

So the diff is simple: just expose several math-functions for x86_64/uefi environments. The remaining functions produces undefined reference to truncdfsf2 (#327).

@bjorn3
Copy link
Member

bjorn3 commented Sep 29, 2021

I think it should be easy to port truncdfsf2 to rust. It directly forwards to this function: https://github.com/rust-lang/llvm-project/blob/cba558df777a045b5657d56c29944e9e8fd3a776/compiler-rt/lib/builtins/fp_trunc_impl.inc#L41-L132

@gshep
Copy link
Contributor Author

gshep commented Sep 29, 2021

there already was an attempt to do it - #262 , but unfortunately it was reverted. So maybe later =)

@Amanieu
Copy link
Member

Amanieu commented Oct 15, 2021

Can you rebase on the latest master to fix the CI failure (fixed in #437)?

@gshep
Copy link
Contributor Author

gshep commented Oct 15, 2021

ok

@Amanieu Amanieu merged commit 4151e03 into rust-lang:master Oct 15, 2021
jackpot51 pushed a commit to redox-os/uefi that referenced this pull request Apr 9, 2022
Some math functions are exposed through compiler-builtins on newer
releases.

Fixes building system76/firmware-setup with new toolchain.

Ref: rust-lang/compiler-builtins#435
Signed-off-by: Tim Crawford <tcrawford@system76.com>
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

Successfully merging this pull request may close these issues.

3 participants