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

Don't include math for unix and wasi targets #680

Merged
merged 1 commit into from
Aug 28, 2024

Conversation

Amjad50
Copy link
Contributor

@Amjad50 Amjad50 commented Aug 27, 2024

This fixes issues such as (rust-lang/rust#128386) where, our implementation is being used on systems where there is already math library and its more performant and accurate.

So with this change, linux will go back to the previous behavior and not include these functions, windows and apple were generally not affected.

Looking at the targets we have builtin now in rust, everything else is probably good to have the math symbols.

A note on the above, the hermit os uses libm directly for itself, but I think its Ok to keep providing math in compiler_builtin for it, its technically the same implementation either from compiler_builtin or hermit-builtins.

@tgross35 @Amanieu

This fixes such as (rust-lang/rust#128386)
where, our implementation is being used on systems where there is
already `math` library and its more performant and accurate.

So with this change, linux will go back to the previous behavior and not
include these functions, windows and apple were generally not affected.

Looking at the targets we have builtin now in rust, everything else is
probably good to have the math symbols.

> A note on the above, the `hermit` os uses `libm` directly for itself,
> but I think its Ok to keep providing math in `compiler_builtin` for it,
> its technically the same implementation either from `compiler_builtin`
> or `hermit-builtins`.

Signed-off-by: Amjad Alsharafi <26300843+Amjad50@users.noreply.github.com>
@tgross35
Copy link
Contributor

Thanks for posting this. Should this keep the same config as before https://github.com/rust-lang/compiler-builtins/pull/594/files#diff-b1a35a68f14e696205874893c07fd24fdb88882b47c23cc0e0c80a30c7d53759? uefi, xous, etc

@tgross35
Copy link
Contributor

tgross35 commented Aug 27, 2024

Oh nevermind, I read that backwards. I'll take a closer look at this in a bit.

@tgross35 tgross35 merged commit 9c1fe0e into rust-lang:master Aug 28, 2024
24 checks passed
@tgross35
Copy link
Contributor

Thanks for this, seems reasonable to me. Once #681 merges could you create a PR to rust-lang/rust updating builtins to 0.1.123?

workingjubilee added a commit to workingjubilee/rustc that referenced this pull request Aug 29, 2024
…r=tgross35

Update `compiler_builtins` to `0.1.123`

Includes rust-lang/compiler-builtins#680 and fixes rust-lang#128386.

Fixed by not including math symbols of `compiler_builtins` into any `unix` target or `wasi`, old behavior is restored

r? tgross35
workingjubilee added a commit to workingjubilee/rustc that referenced this pull request Aug 29, 2024
…r=tgross35

Update `compiler_builtins` to `0.1.123`

Includes rust-lang/compiler-builtins#680 and fixes rust-lang#128386.

Fixed by not including math symbols of `compiler_builtins` into any `unix` target or `wasi`, old behavior is restored

r? tgross35
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request Aug 29, 2024
Rollup merge of rust-lang#129715 - Amjad50:update-compiler-builtins, r=tgross35

Update `compiler_builtins` to `0.1.123`

Includes rust-lang/compiler-builtins#680 and fixes rust-lang#128386.

Fixed by not including math symbols of `compiler_builtins` into any `unix` target or `wasi`, old behavior is restored

r? tgross35
github-actions bot pushed a commit to rust-lang/miri that referenced this pull request Aug 30, 2024
Update `compiler_builtins` to `0.1.123`

Includes rust-lang/compiler-builtins#680 and fixes rust-lang/rust#128386.

Fixed by not including math symbols of `compiler_builtins` into any `unix` target or `wasi`, old behavior is restored

r? tgross35
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.

2 participants