Apply weak attributes to all intrinsics#598
Merged
Merged
Conversation
weak attributes to all* intrinsicsweak attributes to most intrinsics
weak attributes to most intrinsicsweak attributes to most intrinsics by default
Amanieu
reviewed
Apr 29, 2024
Amjad50
force-pushed
the
remove_weak-intrinsics
branch
from
April 30, 2024 03:33
9040acc to
7a0f662
Compare
weak attributes to most intrinsics by defaultweak attributes to all intrinsics
Amjad50
force-pushed
the
remove_weak-intrinsics
branch
from
April 30, 2024 03:34
7a0f662 to
7b56c74
Compare
Amjad50
marked this pull request as draft
May 1, 2024 04:18
Amjad50
force-pushed
the
remove_weak-intrinsics
branch
from
May 1, 2024 04:19
7b56c74 to
93b722d
Compare
Amjad50
marked this pull request as ready for review
May 1, 2024 11:27
Amanieu
reviewed
May 1, 2024
Amanieu
left a comment
Member
There was a problem hiding this comment.
This may also be a good opportunity to cleanup the mod wrappers around the no_mangle version of each intrinsic. Specifically:
- There is no need for these modules to be
pub. Same with the function inside them.#[no_mangle]will ensure the symbol is exported. - The whole module should be
#[cfg(not(feature = "mangled-names")]. The functions themselves can then be#[no_mangle]unconditionally.
Amjad50
force-pushed
the
remove_weak-intrinsics
branch
from
May 2, 2024 14:30
657629d to
e8e6722
Compare
Removed the `weak-intrinsics` feature, so that all functions will have the `weak` linkage attribute. Also this fixed the bug in rust-lang/rust#124042. Before this commit, generated code will be ```rust pub extern "C" fn <name>(...) -> ... { // code... } pub mod <name> { #[linkage = "weak"] #[no_mangle] pub extern "C" fn <name>(...) -> ... { super::<name>(...) } } ``` The issue is that there is 2 `weak` linkage, the first one is not required. Along refactoring `weak` attributes, this was fixed.
`weak` is only used with `no_mangle`
Don't generate the whole function if we are not going to use `no_mangle`, there is no point
Amanieu
force-pushed
the
remove_weak-intrinsics
branch
from
May 3, 2024 11:27
e8e6722 to
8a7ba9a
Compare
Amanieu
enabled auto-merge
May 3, 2024 11:27
Contributor
Author
|
Thanks @Amanieu , can a new version be released? |
Member
|
Done |
nicholasbishop
added a commit
to nicholasbishop/rust
that referenced
this pull request
May 11, 2024
The `weak-intrinsics` feature was removed from compiler_builtins in rust-lang/compiler-builtins#598, so dropped the `compiler-builtins-weak-intrinsics` feature from alloc/std/sysroot. In rust-lang/compiler-builtins#593, some builtins for f16/f128 were added. These cause a compilation error (reproduce with `ENABLE_GCC_CODEGEN=1 src/ci/docker/run.sh x86_64-gnu-llvm-17`), so enable `no-f16-f128` for now.
nicholasbishop
added a commit
to nicholasbishop/rust
that referenced
this pull request
May 12, 2024
The `weak-intrinsics` feature was removed from compiler_builtins in rust-lang/compiler-builtins#598, so dropped the `compiler-builtins-weak-intrinsics` feature from alloc/std/sysroot. In rust-lang/compiler-builtins#593, some builtins for f16/f128 were added. These don't work for all compiler backends, so add a `compiler-builtins-no-f16-f128` feature and disable it for cranelift and gcc.
Patryk27
added a commit
to Patryk27/rust
that referenced
this pull request
May 12, 2024
nicholasbishop
added a commit
to nicholasbishop/rust
that referenced
this pull request
May 16, 2024
The `weak-intrinsics` feature was removed from compiler_builtins in rust-lang/compiler-builtins#598, so dropped the `compiler-builtins-weak-intrinsics` feature from alloc/std/sysroot. In rust-lang/compiler-builtins#593, some builtins for f16/f128 were added. These don't work for all compiler backends, so add a `compiler-builtins-no-f16-f128` feature and disable it for cranelift and gcc.
nicholasbishop
added a commit
to nicholasbishop/rust
that referenced
this pull request
May 27, 2024
The `weak-intrinsics` feature was removed from compiler_builtins in rust-lang/compiler-builtins#598, so dropped the `compiler-builtins-weak-intrinsics` feature from alloc/std/sysroot. In rust-lang/compiler-builtins#593, some builtins for f16/f128 were added. These don't work for all compiler backends, so add a `compiler-builtins-no-f16-f128` feature and disable it for cranelift and gcc.
nicholasbishop
added a commit
to nicholasbishop/rust
that referenced
this pull request
May 30, 2024
The `weak-intrinsics` feature was removed from compiler_builtins in rust-lang/compiler-builtins#598, so dropped the `compiler-builtins-weak-intrinsics` feature from alloc/std/sysroot. In rust-lang/compiler-builtins#593, some builtins for f16/f128 were added. These don't work for all compiler backends, so add a `compiler-builtins-no-f16-f128` feature and disable it for cranelift and gcc.
nicholasbishop
added a commit
to nicholasbishop/rust
that referenced
this pull request
May 30, 2024
The `weak-intrinsics` feature was removed from compiler_builtins in rust-lang/compiler-builtins#598, so dropped the `compiler-builtins-weak-intrinsics` feature from alloc/std/sysroot. In rust-lang/compiler-builtins#593, some builtins for f16/f128 were added. These don't work for all compiler backends, so add a `compiler-builtins-no-f16-f128` feature and disable it for cranelift and gcc.
bors
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Jun 26, 2024
Update compiler_builtins to 0.1.112 The `weak-intrinsics` feature was removed from compiler_builtins in rust-lang/compiler-builtins#598, so dropped the `compiler-builtins-weak-intrinsics` feature from alloc/std/sysroot. In rust-lang/compiler-builtins#593, some builtins for f16/f128 were added. These don't work for all compiler backends, so add a `compiler-builtins-no-f16-f128` feature and disable it for cranelift and gcc.
matthiaskrgr
added a commit
to matthiaskrgr/rust
that referenced
this pull request
Jun 26, 2024
…anieu Update compiler_builtins to 0.1.113 The `weak-intrinsics` feature was removed from compiler_builtins in rust-lang/compiler-builtins#598, so dropped the `compiler-builtins-weak-intrinsics` feature from alloc/std/sysroot. In rust-lang/compiler-builtins#593, some builtins for f16/f128 were added. These don't work for all compiler backends, so add a `compiler-builtins-no-f16-f128` feature and disable it for cranelift and gcc.
matthiaskrgr
added a commit
to matthiaskrgr/rust
that referenced
this pull request
Jun 26, 2024
…anieu Update compiler_builtins to 0.1.113 The `weak-intrinsics` feature was removed from compiler_builtins in rust-lang/compiler-builtins#598, so dropped the `compiler-builtins-weak-intrinsics` feature from alloc/std/sysroot. In rust-lang/compiler-builtins#593, some builtins for f16/f128 were added. These don't work for all compiler backends, so add a `compiler-builtins-no-f16-f128` feature and disable it for cranelift and gcc.
tgross35
pushed a commit
to tgross35/rust
that referenced
this pull request
Jul 10, 2024
The `weak-intrinsics` feature was removed from compiler_builtins in rust-lang/compiler-builtins#598, so dropped the `compiler-builtins-weak-intrinsics` feature from alloc/std/sysroot. In rust-lang/compiler-builtins#593, some builtins for f16/f128 were added. These don't work for all compiler backends, so add a `compiler-builtins-no-f16-f128` feature and disable it for cranelift and gcc. Also disable it for LLVM targets that don't support it.
tgross35
pushed a commit
to tgross35/rust
that referenced
this pull request
Jul 18, 2024
The `weak-intrinsics` feature was removed from compiler_builtins in rust-lang/compiler-builtins#598, so dropped the `compiler-builtins-weak-intrinsics` feature from alloc/std/sysroot. In rust-lang/compiler-builtins#593, some builtins for f16/f128 were added. These don't work for all compiler backends, so add a `compiler-builtins-no-f16-f128` feature and disable it for cranelift and gcc. Also disable it for LLVM targets that don't support it.
tgross35
added a commit
to tgross35/compiler-builtins
that referenced
this pull request
Jul 18, 2024
After <rust-lang#598>, arm-android was failing to complete in CI because it was hanging on some tests. This issue appears to have been caused by symbols related to atomics, e.g. `__sync_val_compare_and_swap_4`, to have become weak. It turns out that these symbols were always strong before, even though Android was always setting the `weak-intrinsics` feature. So, making them weak presumably caused the system implementation to get linked, which appears buggy. Resolve this by making `__sync_*` symbols weak on Android. (this includes a recursion limit increase, our macros are getting big). Link: rust-lang#641
nicholasbishop
added a commit
to nicholasbishop/rust
that referenced
this pull request
Jul 29, 2024
The `weak-intrinsics` feature was removed from compiler_builtins in rust-lang/compiler-builtins#598, so dropped the `compiler-builtins-weak-intrinsics` feature from alloc/std/sysroot. In rust-lang/compiler-builtins#593, some builtins for f16/f128 were added. These don't work for all compiler backends, so add a `compiler-builtins-no-f16-f128` feature and disable it for cranelift and gcc. Also disable it for LLVM targets that don't support it.
bors
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Jul 29, 2024
…ss35 Update compiler_builtins to 0.1.114 The `weak-intrinsics` feature was removed from compiler_builtins in rust-lang/compiler-builtins#598, so dropped the `compiler-builtins-weak-intrinsics` feature from alloc/std/sysroot. In rust-lang/compiler-builtins#593, some builtins for f16/f128 were added. These don't work for all compiler backends, so add a `compiler-builtins-no-f16-f128` feature and disable it for cranelift and gcc.
Mrmaxmeier
pushed a commit
to Mrmaxmeier/rust
that referenced
this pull request
Jul 29, 2024
The `weak-intrinsics` feature was removed from compiler_builtins in rust-lang/compiler-builtins#598, so dropped the `compiler-builtins-weak-intrinsics` feature from alloc/std/sysroot. In rust-lang/compiler-builtins#593, some builtins for f16/f128 were added. These don't work for all compiler backends, so add a `compiler-builtins-no-f16-f128` feature and disable it for cranelift and gcc. Also disable it for LLVM targets that don't support it.
github-actions Bot
pushed a commit
to rust-lang/miri
that referenced
this pull request
Jul 30, 2024
Update compiler_builtins to 0.1.114 The `weak-intrinsics` feature was removed from compiler_builtins in rust-lang/compiler-builtins#598, so dropped the `compiler-builtins-weak-intrinsics` feature from alloc/std/sysroot. In rust-lang/compiler-builtins#593, some builtins for f16/f128 were added. These don't work for all compiler backends, so add a `compiler-builtins-no-f16-f128` feature and disable it for cranelift and gcc.
bjorn3
pushed a commit
to rust-lang/rustc_codegen_cranelift
that referenced
this pull request
Aug 2, 2024
The `weak-intrinsics` feature was removed from compiler_builtins in rust-lang/compiler-builtins#598, so dropped the `compiler-builtins-weak-intrinsics` feature from alloc/std/sysroot. In rust-lang/compiler-builtins#593, some builtins for f16/f128 were added. These don't work for all compiler backends, so add a `compiler-builtins-no-f16-f128` feature and disable it for cranelift and gcc. Also disable it for LLVM targets that don't support it.
bjorn3
pushed a commit
to rust-lang/rustc_codegen_cranelift
that referenced
this pull request
Aug 2, 2024
Update compiler_builtins to 0.1.114 The `weak-intrinsics` feature was removed from compiler_builtins in rust-lang/compiler-builtins#598, so dropped the `compiler-builtins-weak-intrinsics` feature from alloc/std/sysroot. In rust-lang/compiler-builtins#593, some builtins for f16/f128 were added. These don't work for all compiler backends, so add a `compiler-builtins-no-f16-f128` feature and disable it for cranelift and gcc.
GuillaumeGomez
pushed a commit
to GuillaumeGomez/rustc_codegen_gcc
that referenced
this pull request
Aug 6, 2024
The `weak-intrinsics` feature was removed from compiler_builtins in rust-lang/compiler-builtins#598, so dropped the `compiler-builtins-weak-intrinsics` feature from alloc/std/sysroot. In rust-lang/compiler-builtins#593, some builtins for f16/f128 were added. These don't work for all compiler backends, so add a `compiler-builtins-no-f16-f128` feature and disable it for cranelift and gcc. Also disable it for LLVM targets that don't support it.
GuillaumeGomez
pushed a commit
to GuillaumeGomez/rustc_codegen_gcc
that referenced
this pull request
Aug 6, 2024
Update compiler_builtins to 0.1.114 The `weak-intrinsics` feature was removed from compiler_builtins in rust-lang/compiler-builtins#598, so dropped the `compiler-builtins-weak-intrinsics` feature from alloc/std/sysroot. In rust-lang/compiler-builtins#593, some builtins for f16/f128 were added. These don't work for all compiler backends, so add a `compiler-builtins-no-f16-f128` feature and disable it for cranelift and gcc.
GuillaumeGomez
pushed a commit
to GuillaumeGomez/rustc_codegen_gcc
that referenced
this pull request
Aug 12, 2024
The `weak-intrinsics` feature was removed from compiler_builtins in rust-lang/compiler-builtins#598, so dropped the `compiler-builtins-weak-intrinsics` feature from alloc/std/sysroot. In rust-lang/compiler-builtins#593, some builtins for f16/f128 were added. These don't work for all compiler backends, so add a `compiler-builtins-no-f16-f128` feature and disable it for cranelift and gcc. Also disable it for LLVM targets that don't support it.
lnicola
pushed a commit
to lnicola/rust-analyzer
that referenced
this pull request
Aug 13, 2024
Update compiler_builtins to 0.1.114 The `weak-intrinsics` feature was removed from compiler_builtins in rust-lang/compiler-builtins#598, so dropped the `compiler-builtins-weak-intrinsics` feature from alloc/std/sysroot. In rust-lang/compiler-builtins#593, some builtins for f16/f128 were added. These don't work for all compiler backends, so add a `compiler-builtins-no-f16-f128` feature and disable it for cranelift and gcc.
This was referenced Aug 22, 2024
This was referenced May 29, 2025
christian-schilling
pushed a commit
to christian-schilling/rustc_codegen_cranelift
that referenced
this pull request
Jan 27, 2026
The `weak-intrinsics` feature was removed from compiler_builtins in rust-lang/compiler-builtins#598, so dropped the `compiler-builtins-weak-intrinsics` feature from alloc/std/sysroot. In rust-lang/compiler-builtins#593, some builtins for f16/f128 were added. These don't work for all compiler backends, so add a `compiler-builtins-no-f16-f128` feature and disable it for cranelift and gcc. Also disable it for LLVM targets that don't support it.
christian-schilling
pushed a commit
to christian-schilling/rustc_codegen_cranelift
that referenced
this pull request
Jan 27, 2026
Update compiler_builtins to 0.1.114 The `weak-intrinsics` feature was removed from compiler_builtins in rust-lang/compiler-builtins#598, so dropped the `compiler-builtins-weak-intrinsics` feature from alloc/std/sysroot. In rust-lang/compiler-builtins#593, some builtins for f16/f128 were added. These don't work for all compiler backends, so add a `compiler-builtins-no-f16-f128` feature and disable it for cranelift and gcc.
christian-schilling
pushed a commit
to christian-schilling/rustc_codegen_cranelift
that referenced
this pull request
Jan 27, 2026
The `weak-intrinsics` feature was removed from compiler_builtins in rust-lang/compiler-builtins#598, so dropped the `compiler-builtins-weak-intrinsics` feature from alloc/std/sysroot. In rust-lang/compiler-builtins#593, some builtins for f16/f128 were added. These don't work for all compiler backends, so add a `compiler-builtins-no-f16-f128` feature and disable it for cranelift and gcc. Also disable it for LLVM targets that don't support it.
christian-schilling
pushed a commit
to christian-schilling/rustc_codegen_cranelift
that referenced
this pull request
Jan 27, 2026
Update compiler_builtins to 0.1.114 The `weak-intrinsics` feature was removed from compiler_builtins in rust-lang/compiler-builtins#598, so dropped the `compiler-builtins-weak-intrinsics` feature from alloc/std/sysroot. In rust-lang/compiler-builtins#593, some builtins for f16/f128 were added. These don't work for all compiler backends, so add a `compiler-builtins-no-f16-f128` feature and disable it for cranelift and gcc.
tgross35
pushed a commit
that referenced
this pull request
Jan 31, 2026
Apply `weak` attributes to all intrinsics
Kobzol
pushed a commit
to Kobzol/portable-simd
that referenced
this pull request
Feb 3, 2026
Update compiler_builtins to 0.1.114 The `weak-intrinsics` feature was removed from compiler_builtins in rust-lang/compiler-builtins#598, so dropped the `compiler-builtins-weak-intrinsics` feature from alloc/std/sysroot. In rust-lang/compiler-builtins#593, some builtins for f16/f128 were added. These don't work for all compiler backends, so add a `compiler-builtins-no-f16-f128` feature and disable it for cranelift and gcc.
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.
Removed the
weak-intrinsicsfeature, so that all functions will have theweaklinkage attribute.But this caused issues for
memset(maybe other mem functions are related), so added a special feature for thosemem-weak-intrinsics.memfunctions won't have theweakattribute unless this feature is enabled.This also fixed the bug in rust-lang/rust#124042.
Before this commit, generated code will be
The issue is that there is 2
weaklinkage, the first one is not required. Along refactoringweakattributes, this was fixed.