This repository was archived by the owner on Apr 28, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 102
Conversation
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
The commit 5e0eca7 removed the `checked` feature and replaced it by using `debug_assertions`. There were some places that were not modified, this commit fixes them
Since `std` dependencies cannot use `core` manually, it has to include it manually as a dependencies from the package `rustc-std-workspace-core`. This allow us to use `libm` to compile a dependency of `std`. This fixes the issue rust-lang/compiler-builtins#576
The compilation fails because of usage of internal feature |
I think a better approach would be to have compiler-builtins always create the necessary symbols on all targets, but define them as weak symbols. There is already functionality for this in compiler-builtins, we just need to make sure it is disabled for targets that don't properly support weak symbols (Apple & Windows). The reasoning behind this is to allow using platform-provided optimized versions of the math functions when they are available since they can be faster than our implementation in libm. |
Ah I didn't know about weak symbols, I'll look into it and add it there then, I'll close this then. Thanks |
Amjad50
added a commit
to Amjad50/compiler-builtins
that referenced
this pull request
Feb 19, 2024
This is a replacement for rust-lang/libm#290 This fixes crashes during compilations for targets that don't have math symbols by default. So, we will provide them libm symbols, but mark it as `weak` (if its supported), so that the linker will choose the system builtin functions, since those are sometimes more optimized. If the linker couldn't find those, it will go with `libm` implementation.
Amjad50
added a commit
to Amjad50/Emerald
that referenced
this pull request
Feb 23, 2024
This adds the missing functions `rust/std` require that are normally available in `libc` We will update `rust` as well to use these new functions. We have modified `libm` in the PR: rust-lang/libm#290 to enable building `std`.
Amjad50
added a commit
to Amjad50/compiler-builtins
that referenced
this pull request
Mar 28, 2024
This is a replacement for rust-lang/libm#290 This fixes crashes during compilations for targets that don't have math symbols by default. So, we will provide them libm symbols, but mark it as `weak` (if its supported), so that the linker will choose the system builtin functions, since those are sometimes more optimized. If the linker couldn't find those, it will go with `libm` implementation.
Amjad50
added a commit
to Amjad50/compiler-builtins
that referenced
this pull request
Mar 28, 2024
This is a replacement for rust-lang/libm#290 This fixes crashes during compilations for targets that don't have math symbols by default. So, we will provide them libm symbols, but mark it as `weak` (if its supported), so that the linker will choose the system builtin functions, since those are sometimes more optimized. If the linker couldn't find those, it will go with `libm` implementation.
Amjad50
added a commit
to Amjad50/compiler-builtins
that referenced
this pull request
Mar 30, 2024
This is a replacement for rust-lang/libm#290 This fixes crashes during compilations for targets that don't have math symbols by default. So, we will provide them libm symbols, but mark it as `weak` (if its supported), so that the linker will choose the system builtin functions, since those are sometimes more optimized. If the linker couldn't find those, it will go with `libm` implementation.
Amanieu
pushed a commit
to Amjad50/compiler-builtins
that referenced
this pull request
Apr 10, 2024
This is a replacement for rust-lang/libm#290 This fixes crashes during compilations for targets that don't have math symbols by default. So, we will provide them libm symbols, but mark it as `weak` (if its supported), so that the linker will choose the system builtin functions, since those are sometimes more optimized. If the linker couldn't find those, it will go with `libm` implementation.
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Added the ability to compile
libm
as a child dependency ofstd
.This will allow fixing the issue where some targets that don't have
libc
linked can have math functions without linking errors.This fixes the issue originating in rust-lang/compiler-builtins#576
This also replaces #289 as its included in this one.