Don't include math for unix and wasi targets#680
Merged
tgross35 merged 1 commit intorust-lang:masterfrom Aug 28, 2024
Merged
Conversation
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>
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? |
Contributor
|
Oh nevermind, I read that backwards. I'll take a closer look at this in a bit. |
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
tgross35
added a commit
that referenced
this pull request
Jan 31, 2026
Don't include `math` for `unix` and `wasi` targets
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This fixes issues such as (rust-lang/rust#128386) where, our implementation is being used on systems where there is already
mathlibrary 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.
@tgross35 @Amanieu