Commit graph

2192 commits

Author SHA1 Message Date
Folkert de Vries
6f12b86e9c
s390x: support f16 and f16x8 in inline assembly 2026-01-09 18:42:46 +01:00
Matthias Krüger
36d0f35d3d
Rollup merge of #150802 - fn_abi_cleanup, r=lqd
Minor cleanups to fn_abi_new_uncached
2026-01-08 22:21:19 +01:00
Matthias Krüger
3481c0d3cb
Rollup merge of #150569 - check_static_initializer_acyclic, r=workingjubilee
Ensure that static initializers are acyclic for NVPTX

NVPTX does not support cycles in static initializers (see rust-lang/rust#146787). LLVM produces an error when attempting to generate code for such constructs, like self-referential structs.

To avoid LLVM UB, we emit a post-monomorphization error on the Rust side before reaching codegen.

This is achieved by analyzing a subgraph of the "mono item graph" that only contains statics.
1. Calculate the strongly connected components (SCCs) of the graph.
2. Check for cycles (more than one node in an SCC or one node that references itself).
2026-01-08 16:25:30 +01:00
bjorn3
aec8b69878 Minor cleanups to fn_abi_new_uncached 2026-01-08 10:49:44 +00:00
kulst
630c7596e9 Ensure that static initializers are acyclic for NVPTX
NVPTX does not support cycles in static initializers. LLVM produces an error when attempting to codegen such constructs (like self referential structs).

To not produce LLVM UB we instead emit a post-monomorphization error on
Rust side before reaching codegen.

This is achieved by analysing a subgraph of the "mono item graph" that
only contains statics:
1. Calculate the strongly connected components (SCCs) of the graph
2. Check for cycles (more than one node in a SCC or exactly one node
   which references itself)
2026-01-06 17:00:21 +01:00
Augie Fackler
accfc34e43 rustc_codegen_llvm: update alignment for double on AIX
This was recently fixed upstream in LLVM, so we update our default
layout to match.

@rustbot label: +llvm-main
2026-01-05 14:08:51 -05:00
bors
00f49d2204 Auto merge of #145948 - a4lg:riscv-stabilize-target-features-v2, r=Amanieu
Stabilize 29 RISC-V target features (`riscv_ratified_v2`)

This commit stabilizes RISC-V target features with following constraints:

*   Describes a ratified extension.
*   Implemented on Rust 1.88.0 or before.
    Waiting for four+ version cycles seems sufficient.
*   Does not disrupt current rustc's target feature (cf. rust-lang/rust#140570) + ABI (cf. rust-lang/rust#132618) handling.
    It excludes `E` and all floating point-arithmetic extensions.  The `Zfinx` family does not involve floating point registers but not stabilizing for now to avoid possible confusion between the `F` extension family.
*   Not vector-related (floating point and integer).
    While integer vector subsets should not cause any ABI issues (as they don't use ABI-dependent floating point registers), we need to discuss before stabilizing them.
*   Supported by the lowest LLVM version supported by rustc (LLVM 20).

List of target features to be stabilized:

1.  `b`
2.  `za64rs` (no-RT)
3.  `za128rs` (no-RT)
4.  `zaamo`
5.  `zabha`
6.  `zacas`
7.  `zalrsc`
8.  `zama16b` (no-RT)
9.  `zawrs`
10.  `zca`
11. `zcb`
12. `zcmop`
13. `zic64b` (no-RT)
14. `zicbom`
15. `zicbop` (no-RT)
16. `zicboz`
17. `ziccamoa` (no-RT)
18. `ziccif` (no-RT)
19. `zicclsm` (no-RT)
20. `ziccrse` (no-RT)
21. `zicntr`
22. `zicond`
23. `zicsr`
24. `zifencei`
25. `zihintntl`
26. `zihintpause`
27. `zihpm`
28. `zimop`
29. `ztso`

Of which, 20 of them (29 minus 9 "no-RT" target features) support runtime detection through `std::arch::is_riscv_feature_detected!()`.

Corresponding PR for the Reference: rust-lang/reference#1987
2026-01-03 07:26:35 +00:00
Jonathan Brouwer
767e7dae25
Rollup merge of #150555 - adamgreig:armv7-thumb-interwork, r=chenyukang
Enable thumb interworking on ARMv7A/R and ARMv8R bare-metal targets

This flag enables the `#[instruction_set(arm::t32)]` for the armv7a/armv7r/armv8r targets, which all support Thumb interwork but were missing this flag.

Target maintainers are `@chrisnc,` `@rust-lang/arm-maintainers,` `@rust-embedded/arm` (including me).
2026-01-01 02:47:21 +01:00
Jonathan Brouwer
dc103c4cd9
Rollup merge of #146798 - a4lg:riscv-intrinsics-zkne_or_zknd, r=Amanieu
RISC-V: Implement (Zkne or Zknd) intrinsics correctly

On rust-lang/stdarch#1765, it has been pointed out that two RISC-V (64-bit only) intrinsics to perform AES key scheduling have wrong target feature.
`aes64ks1i` and `aes64ks2` instructions require *either* Zkne (scalar cryptography: AES encryption) or Zknd (scalar cryptography: AES decryption) extension (or both) but corresponding Rust intrinsics (in `core::arch::riscv64`) required *both* Zkne and Zknd extensions.

An excerpt from the original intrinsics:

```rust
#[target_feature(enable = "zkne", enable = "zknd")]
```

To fix that, we need to:

1.  Represent a condition where *either* Zkne or Zknd is available and
2.  Workaround an issue: `llvm.riscv.aes64ks1i` / `llvm.riscv.aes64ks2` LLVM intrinsics require either Zkne or Zknd extension.

This PR attempts to resolve them by:

1.  Adding a perma-unstable RISC-V target feature: `zkne_or_zknd` (implied from both `zkne` and `zknd`) and
2.  Using inline assembly to construct machine code directly (because `zkne_or_zknd` alone cannot imply neither Zkne nor Zknd, we cannot use LLVM intrinsics).

The author confirmed that we can construct an AES key scheduling function with decent performance using fixed `aes64ks1i` and `aes64ks2` intrinsics (with optimization enabled).
2025-12-31 17:32:04 +01:00
Adam Greig
59a3ad3e13
Enable thumb interworking on ARMv7A/R and ARMv8R bare-metal targets 2025-12-31 05:53:50 +00:00
Jonathan Brouwer
d63068b3b4
Rollup merge of #150405 - estebank:matches-could-be-equals, r=Kivooeo
Don't use `matches!` when `==` suffices

In the codebase we sometimes use `matches!` for values that can actually just be compared. Replace them with `==`.

Subset of rust-lang/rust#149933.
2025-12-27 13:42:01 +01:00
Esteban Küber
9f566f2463 Don't use matches! when == suffices
In the codebase we sometimes use `matches!` for values that can actually just be compared. Replace them with `==`.
2025-12-26 20:28:19 +00:00
Daniel Scherzer
f289ccf207
target_features::Stability: tweak docs of requires_nightly()
* No method named `allow_toggle()` exists on the type, but based on the
documentation of both `requires_nightly()` and `toggle_allowed()` it seems that
`toggle_allowed()` is the intended method to mention.

* Add `()` to the mention of `in_cfg()` to make it clear that a method is being
referred to, and to match the presence of `()` in the mention of
`toggle_allowed()`.
2025-12-22 23:49:11 -08:00
Jonathan Brouwer
81b81faac1
Rollup merge of #149512 - adamgemmell:dev/adagem01/armv7-d32-fix, r=Amanieu
Fix d32 usage in Arm target specs

Fixes https://github.com/rust-lang/rust/issues/149399 - after checking with an LLVM engineer Rust's feature implications do correctly map to LLVM's. The target specs originally had +vfp3,+d16, but were mistakenly fixed to +vfp3,-d32 which disables vfp3 again.

Some targets specify +vfp2,-d32, and since vfp2 shouldn't imply d32 the -d32 is unneeded.

The list of Arm features is quite old and since Arm is now a target maintainer of many of them we'll go in and update them. We should probably add vfp3d16 and similar as rust has no way to express these right now after d16 was removed.

The LLVM features expand like this:

```
vfp4 -> vfp3 + fp16 + vfp4d16 + vfp4sp
vfp4d16 -> vfp3d16 + fp16 + fp64 + vfp4d16sp
vfp4sp -> vfp3sp + fp16 + d32 + vfp4d16sp
vfp4d16sp -> vfp3d16sp + fp16
vfp3 -> vfp2 + vfp3d16 + vfp3sp
vfp3d16 -> vfp2 + fp64 + vfp3d16sp
vfp3sp -> vfp2 + d32 + vfp3d16sp
vfp3d16sp -> vfp2sp
vfp2 -> vfp2sp + fp64
vfp2sp -> fpregs
```

`-neon` might be unnecessary too in many of these cases, but some default CPUs that Rust specifies will turn Neon on so that needs a bit more care. I can't see any LLVM cpus that enable D32.

Old description:

> Fixes https://github.com/rust-lang/rust/issues/149399 - this implication was likely a mistake and isn't enforced by LLVM. This is is a breaking change and any users specifying `vfp2/3/4` via `-Ctarget-features` or the `target_feature` attribute will need to add `d32` in to get the same behaviour. The target features are unstable so this is ok for Rust, and this is necessary as otherwise there's no way to specify a `vfp2-d16` configuration, for example.
>
> I expect these targets would have been broken by https://github.com/rust-lang/rust/pull/149173 as `-d32` would have disabled any `+vfpX` feature before it. With the removal of the implication the `-d32` went back to being unnecessary, but I've removed it anyway.
>
> As ``@RalfJung`` pointed out, thumbv7a-nuttx-eabihf looks to have been relying on this implication so I've added `+d32` to it's target spec.
2025-12-21 21:16:33 +01:00
Matthias Krüger
5a875b8580
Rollup merge of #148499 - kjetilkjeka:nvptx_default_linker_llbc, r=madsmtm
Nvptx: Use llbc as default linker

The implementation of [MCP: Use `llvm-bitcode-linker` as the default linker for `nvptx64-nvidia-cuda`](https://github.com/rust-lang/compiler-team/issues/927)
2025-12-20 13:46:00 +01:00
bors
838a912ced Auto merge of #150177 - matthiaskrgr:rollup-4cw3gdw, r=matthiaskrgr
Rollup of 6 pull requests

Successful merges:

 - rust-lang/rust#149633 (Enable `outline-atomics` by default on AArch64 FreeBSD)
 - rust-lang/rust#149788 (Move shared offload globals and define per-kernel globals once)
 - rust-lang/rust#149989 (Improve filenames encoding and misc)
 - rust-lang/rust#150012 (rustc_target: Add `efiapi` ABI support for LoongArch)
 - rust-lang/rust#150116 (layout: Store inverse memory index in `FieldsShape::Arbitrary`)
 - rust-lang/rust#150159 (Split eii macro expansion code)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-12-20 05:17:27 +00:00
bors
f51d1bcdc6 Auto merge of #149831 - BoxyUwU:boostrap_bump, r=Mark-Simulacrum,cuviper
bump bootstrap compiler to 1.93 beta

r? release
2025-12-20 02:06:29 +00:00
Boxy Uwu
2ffb1d55ef Handle bootstrap cfgs 2025-12-19 15:04:30 -08:00
Matthias Krüger
fdae594a74
Rollup merge of #150012 - heiher:loong-efiapi, r=davidtwco
rustc_target: Add `efiapi` ABI support for LoongArch

This commit adds basic `efiapi` ABI support for LoongArch by recognizing `extern "efiapi"` in the ABI map and inline asm clobber handling, and mapping it to the C calling convention.

This change is intentionally submitted ahead of the full LoongArch UEFI target support. While UEFI binaries are ultimately produced as PE images, LoongArch UEFI applications can already be developed by building ELF objects, applying relocation fixups, and converting them to PE in a later step. For such workflows, having `efiapi` properly recognized by the compiler is a prerequisite, even without a dedicated UEFI target.

Landing this ABI support early helps unblock LoongArch UEFI application and driver development, and allows the remaining UEFI-specific pieces to be introduced incrementally in follow-up patches.

MCP: https://github.com/rust-lang/compiler-team/issues/953
2025-12-19 23:38:59 +01:00
Kjetil Kjeka
746acc47a1 Nvptx: Use llbc as default linker 2025-12-19 21:39:48 +01:00
daxpedda
4ee01c4e4c
Add target_feature = "gc" for Wasm 2025-12-19 20:22:43 +01:00
David Wood
6c4c4384e8
destabilise target-spec-json 2025-12-19 11:57:34 +00:00
Tsukasa OI
e337275d06 RISC-V: Add virtual target feature: zkne_or_zknd
Because some AES key scheduling instructions require *either* Zkne or
Zknd extension, we must have a target feature to represent
`(Zkne || Zknd)`.

This commit adds (perma-unstable) target feature to the RISC-V
architecture: `zkne_or_zknd` for this purpose.

Helped-by: sayantn <sayantn05@gmail.com>
2025-12-18 15:26:50 +00:00
Trevor Gross
383053e016 Enable outline-atomics by default on AArch64 FreeBSD
Many aarch64 targets without LSE in the baseline enable the
`outline-atomics` feature, which uses runtime detection of LSE for its
faster atomic ops. This provides nontrivial performance improvements on
most hardware from the past decade, at a small cost to anything pre-LSE.

This matches what Clang does [1].

[1]: e24f90190c
2025-12-16 16:06:43 -06:00
David Wood
f0dfeab43d
abi: Display bound on TyAbiInterface
The `fmt::Debug` impl for `TyAndLayout<'a, Ty>'` requires `fmt::Display`
on the `Ty` parameter. In `ArgAbi`, `TyAndLayout`'s Ty` is instantiated
with a parameter that implements `TyAbiInterface`. `TyAbiInterface`
only required `fmt::Debug` be implemented on `Self`, not `fmt::Display`,
which meant that it wasn't actually possible to debug print `ArgAbi`.
2025-12-16 11:01:26 +00:00
David Wood
5f27abdbc8
mono: require target feature for scalable vectors
Scalable vector types only work with the relevant target features
enabled, so require this for any function with the types in its
signature.
2025-12-16 11:01:26 +00:00
David Wood
a56b1b9283
codegen: implement repr(scalable)
Introduces `BackendRepr::ScalableVector` corresponding to scalable
vector types annotated with `repr(scalable)` which lowers to a scalable
vector type in LLVM.

Co-authored-by: Jamie Cunliffe <Jamie.Cunliffe@arm.com>
2025-12-16 11:00:12 +00:00
Stuart Cook
0ea7d0b956
Rollup merge of #148790 - kevaundray:kw/rv64im-unknown-elf, r=davidtwco,JonathanBrouwer
Add new Tier-3 target: riscv64im-unknown-none-elf

This PR proposes to add riscv64im-unknown-none-elf, a subset of the already supported riscv64imac-unknown-none-elf.

The motivation behind this PR is that we want to standardize (most) zkVMs on riscv64im-none and riscv64ima-none. Having different variants of riscv extensions, also seems to be within expectation, atleast with respects to riscv32.

Note: This does not mean that we will be able to remove [riscv32im-risc0-zkvm-elf](https://doc.rust-lang.org/rustc/platform-support/riscv32im-risc0-zkvm-elf.html) -- I am not aware of all of the dependents for this

**Tier-3 Policy**

> A tier 3 target must have a designated developer or developers (the "target maintainers") on record to be CCed when issues arise regarding the target. (The mechanism to track and CC such developers may evolve over time.)

I assigned  Rust Embedded Working Group, since they are already maintaining riscv64IMAC, though I am happy to assign myself.

> Targets must use naming consistent with any existing targets; for instance, a target for the same CPU or OS as an existing Rust target should use the same name for that CPU or OS. Targets should normally use the same names and naming conventions as used elsewhere in the broader ecosystem beyond Rust (such as in other toolchains), unless they have a very good reason to diverge. Changing the name of a target can be highly disruptive, especially once the target reaches a higher tier, so getting the name right is important even for a tier 3 target.

It follows the naming convention of the other bare metal riscv targets

> Tier 3 targets may have unusual requirements to build or use, but must not create legal issues or impose onerous legal terms for the Rust project or for Rust developers or users.

This has the same requirements as riscv{32, 64}imac

> Neither this policy nor any decisions made regarding targets shall create any binding agreement or estoppel by any party. If any member of an approving Rust team serves as one of the maintainers of a target, or has any legal or employment requirement (explicit or implicit) that might affect their decisions regarding a target, they must recuse themselves from any approval decisions regarding the target's tier status, though they may otherwise participate in discussions.

> Tier 3 targets should attempt to implement as much of the standard libraries as possible and appropriate (core for most targets, alloc for targets that can support dynamic memory allocation, std for targets with an operating system or equivalent layer of system-provided functionality), but may leave some code unimplemented (either unavailable or stubbed out as appropriate), whether because the target makes it impossible to implement or challenging to implement. The authors of pull requests are not obligated to avoid calling any portions of the standard library on the basis of a tier 3 target not implementing those portions.

> The target must provide documentation for the Rust community explaining how to build for the target, using cross-compilation if possible. If the target supports running binaries, or running tests (even if they do not pass), the documentation must explain how to run such binaries or tests for the target, using emulation if possible or dedicated hardware if necessary.

> Tier 3 targets must not impose burden on the authors of pull requests, or other developers in the community, to maintain the target. In particular, do not post comments (automated or manual) on a PR that derail or suggest a block on the PR based on a tier 3 target. Do not send automated messages or notifications (via any medium, including via ````@)```` to a PR author or others involved with a PR regarding a tier 3 target, unless they have opted into such messages.

> Patches adding or updating tier 3 targets must not break any existing tier 2 or tier 1 target, and must not knowingly break another tier 3 target without approval of either the compiler team or the maintainers of the other tier 3 target.

> Tier 3 targets must be able to produce assembly using at least one of rustc's supported backends from any host target. (Having support in a fork of the backend is not sufficient, it must be upstream.)

Acknowledging the above.
2025-12-16 14:40:41 +11:00
Kevaundray Wedderburn
1fe0a85df7 Add rv64IM 2025-12-15 12:17:55 +00:00
WANG Rui
a07bd236bd rustc_target: Add efiapi ABI support for LoongArch
This commit adds basic `efiapi` ABI support for LoongArch by recognizing
`extern "efiapi"` in the ABI map and inline asm clobber handling, and
mapping it to the C calling convention.

This change is intentionally submitted ahead of the full LoongArch UEFI
target support. While UEFI binaries are ultimately produced as PE images,
LoongArch UEFI applications can already be developed by building ELF
objects, applying relocation fixups, and converting them to PE in a
later step. For such workflows, having `efiapi` properly recognized by
the compiler is a prerequisite, even without a dedicated UEFI target.

Landing this ABI support early helps unblock LoongArch UEFI application
and driver development, and allows the remaining UEFI-specific pieces to
be introduced incrementally in follow-up patches.

MCP: https://github.com/rust-lang/compiler-team/issues/953
2025-12-15 14:37:25 +08:00
Flakebi
a9b147259b
Allow vector types for amdgpu
The amdgpu target uses vector types in various places. The vector types
can be used on all architectures, there is no associated target feature
that needs to be enabled.

The largest vector type found in LLVM intrinsics is `v32i32`
(`[32 x i32]`) for mfma intrinsics. Note that while this intrinsic is
only supported on some architectures, the vector type itself is
supported on all architectures.
2025-12-14 17:03:51 +01:00
Jens Reidel
624135bd79
Promote powerpc64-unknown-linux-musl to tier 2 with host tools
Signed-off-by: Jens Reidel <adrian@travitia.xyz>
2025-12-13 21:53:42 +01:00
Matthias Krüger
b3948e5f10
Rollup merge of #149679 - pmur:murp/ppc-inline-improvements, r=Amanieu
Restrict spe_acc to PowerPC SPE targets

Update the tests, add powerpc-*-gnuspe testing, and create a distinct clobber_abi list for PowerPC SPE targets.

Note, the SPE target does not have vector, vector-scalar, or floating-point specific registers.

r? ```@Amanieu```
2025-12-10 07:54:20 +01:00
Matthias Krüger
397de87965
Rollup merge of #148294 - chenx97:mips64-padding-aggregate-args, r=workingjubilee
callconv: fix mips64 aggregate argument passing for C FFI

MIPS64 needs to put a padding argument before an aggregate argument when
this argument is in an odd-number position, starting from 0, and has an
alignment of 16 bytes or higher, e.g.
`void foo(int a, max_align_t b);` is the same as
`void foo(int a, long _padding, max_align_t b);`
2025-12-10 07:54:18 +01:00
Matthias Krüger
76370238b0
Rollup merge of #144938 - tgross35:more-outline-atomics, r=davidtwco
Enable `outline-atomics` by default on more AArch64 platforms

The baseline Armv8.0 ISA doesn't have atomics instructions, but in
practice most hardware is at least Armv8.1-A (2014), which includes
single-instruction atomics as part of the LSE feature. As a performance
optimization for these cases, GCC and LLVM have the `-moutline-atomics` flag
to turn atomic operations into calls to symbols like `__aarch64_cas1_acq`.
These can do runtime feature detection and use the LSE instructions if
available, falling back to more portable load-exclusive/store-exclusive
loops.

Since the recent 3b50253b57 ("compiler-builtins: plumb LSE support
for aarch64 on linux") our builtins support this LSE optimization, and
since 6936bb975a ("Dynamically enable LSE for aarch64 rust provided
intrinsics"), std will set the flag as part of its startup code. The first
commit in this PR configures this to work on all platforms built with
`outline-atomics`, not just Linux.

Thus, enable `outline-atomics` by default on Android, OpenBSD, Windows,
and Fuchsia platforms that don't have LSE in the baseline. The feature is
already enabled on Linux. Platform-specific details are included in each
commit message.

The current implementation can still be accessed by setting
`-Ctarget-feature=-outline-atomics`. Setting `-Ctarget-feature=+lse` or
a relevant CPU will use the single-instruction atomics without the call
overhead. https://rust.godbolt.org/z/dsdrzszoe

Link: https://learn.arm.com/learning-paths/servers-and-cloud-computing/lse/intro/
Original Clang outline-atomics benchmarks: https://reviews.llvm.org/D91157#2435844

try-job: aarch64-msvc-*
try-job: arm-android
try-job: dist-android
try-job: dist-aarch64-llvm-mingw
try-job: dist-aarch64-msvc
try-job: dist-various-*
try-job: test-various
2025-12-09 17:36:47 +01:00
Jana Dönszelmann
f8bbf2ca06
split out blob decode trait 2025-12-08 00:24:28 +01:00
Paul Murphy
a1f4caf467 Restrict spe_acc to PowerPC SPE targets
Update the tests, add powerpc-*-gnuspe testing, and create a distinct
clobber_abi list for PowerPC SPE targets.

Note, the SPE target does not have vector, vector-scalar, or
floating-point specific registers.
2025-12-05 08:37:22 -06:00
bors
29e035e172 Auto merge of #149632 - matthiaskrgr:rollup-c5iqgtn, r=matthiaskrgr
Rollup of 10 pull requests

Successful merges:

 - rust-lang/rust#149521 (Improve `io::Error::downcast`)
 - rust-lang/rust#149544 (Only apply `no_mangle_const_items`'s suggestion to plain const items)
 - rust-lang/rust#149545 (fix the check for which expressions read never type)
 - rust-lang/rust#149570 (rename cortex-ar references to unified aarch32)
 - rust-lang/rust#149574 (Batched compiletest Config fixups)
 - rust-lang/rust#149579 (Motor OS: fix compile error)
 - rust-lang/rust#149595 (Tidying up `tests/ui/issues` tests [2/N])
 - rust-lang/rust#149597 (Revert "implement and test `Iterator::{exactly_one, collect_array}`")
 - rust-lang/rust#149608 (Allow PowerPC spe_acc as clobber-only register)
 - rust-lang/rust#149610 (Implement benchmarks for uN::{gather,scatter}_bits)

r? `@ghost`
`@rustbot` modify labels: rollup
2025-12-04 14:38:19 +00:00
Trevor Gross
66c150c1fa Enable outline-atomics by default on AArch64 OpenBSD
Clang has recently started doing this, as of LLVM commit 5d774ec8d183
("[Driver] Enable outline atomics for OpenBSD/aarch64") [1]. Thus, do
the same here.

[1]: 5d774ec8d1
2025-12-04 03:36:22 -05:00
Trevor Gross
21525f862d Enable outline-atomics by default on AArch64 Fuchsia
Clang has done this by default since LLVM commit 1a963d3278c2 ("[Driver]
Make -moutline-atomics default for aarch64-fuchsia targets"), [1], so do
the same here.

[1]: 1a963d3278
2025-12-04 03:36:22 -05:00
Trevor Gross
c455903978 Enable outline-atomics by default on AArch64 Android
Per LLVM commit c5e7e649d537 ("[AArch64][Clang][Linux] Enable
out-of-line atomics by default.") [1], Clang enables these on Android.
Thus, do the same in Rust.

[1]: c5e7e649d5
2025-12-04 03:36:22 -05:00
Trevor Gross
1ed1b6e267 Enable outline-atomics by default on AArch64 Windows platforms
Windows has a similar flag `/forceInterlockedFunctions`, which uses
names such as `_InterlockedAdd64_rel`.
2025-12-04 03:36:22 -05:00
Matthias Krüger
62a42e8a31
Rollup merge of #149557 - folkertdev:c-variadic-not-supported, r=workingjubilee
c-variadic: bpf and spirv do not support c-variadic definitions

tracking issue: https://github.com/rust-lang/rust/issues/44930

Emit a nice error message on bpf and spirv targets when a c-variadic function is defined. Spirv also does not support c-variadic calls, bpf appears to allow them.

r? ```@workingjubilee```
2025-12-04 08:46:24 +01:00
Paul Murphy
b54b288518 Allow PowerPC spe_acc as clobber-only register
This register is only supported on the *powerpc*spe targets. It is
only recognized by LLVM. gcc does not accept this as a clobber, nor
does it support these targets.

This is a volatile register, thus it is included with clobber_abi.
2025-12-03 12:37:22 -06:00
Adam Gemmell
4ed68f01dc Remove redundant -d32 in target specs 2025-12-03 12:04:41 +00:00
Adam Gemmell
7d0300b8a5 Fix +vfp3,-d32 target configuration 2025-12-03 12:03:13 +00:00
Folkert de Vries
fc017dd176
c-variadic: bpf and spirv do not support c-variadic definitions 2025-12-03 11:33:00 +01:00
Bart Massey
48002fc0b2 added default_uwtables=true to aarch64_unknown_none targets 2025-12-02 09:58:45 -08:00
Stuart Cook
c539f3ffe1
Rollup merge of #149241 - thejpster:fix-armv4t-armv5te-bare-metal, r=davidtwco
Fix armv4t- and armv5te- bare metal targets

These two targets currently force on the LLVM feature `+atomics-32`. LLVM doesn't appear to actually be able to emit 32-bit load/store atomics for these targets despite this feature, and emits calls to a shim function called `__sync_lock_test_and_set_4`, which nothing in the Rust standard library supplies.

See [#t-compiler/arm > __sync_lock_test_and_set_4 on Armv5TE](https://rust-lang.zulipchat.com/#narrow/channel/242906-t-compiler.2Farm/topic/__sync_lock_test_and_set_4.20on.20Armv5TE/with/553724827) for more details.

Experimenting with clang and gcc (as logged in that zulip thread) shows that C code cannot do atomic load/stores on that architecture either (at least, not without a library call inserted).

So, the safest thing to do is probably turn off `+atomics-32` for these two Tier 3 targets.

I asked `@Lokathor` and he said he didn't even use atomics on the `armv4t-none-eabi`/`thumbv4t-none-eabi` target he maintains.

I was unable to reach `@QuinnPainter` for comment for `armv5te-none-eabi`/`thumbv5te-none-eabi`.

The second commit renames the base target spec `spec::base::thumb` to `spec::base::arm_none` and changes `armv4t-none-eabi`/`thumbv4t-none-eabi` and `armv5te-none-eabi`/`thumbv5te-none-eabi` to use it. This harmonises the frame-pointer and linker options across the bare-metal Arm EABI and EABIHF targets.

You could make an argument for harmonising `armv7a-none-*`, `armv7r-none*` and `armv8r-none-*` as well, but that can be another PR.
2025-12-02 13:56:30 +11:00
Stuart Cook
3d404d0e9e
Rollup merge of #149312 - mati865:push-uxlynzmxzswo, r=wesleywiser
Mark riscv64gc-unknown-linux-musl as tier 2 target

According to cdb4236e65/src/doc/rustc/src/platform-support/riscv64gc-unknown-linux-musl.md (L3) it's tier 2 target.

In case you are wondering how I noticed it:
Dockerfiles at Wild linker repo started to fail building recently due to missing `riscv64gc-unknown-linux-musl` std. I had hoped the problem would go away by itself, but it did not (it never does...).
https://github.com/rust-lang/rust/pull/148983 happened recently, so I checked https://rust-lang.github.io/rustup-components-history/riscv64gc-unknown-linux-musl.html and yeah, the date matches.
Given this condition: cdb4236e65/src/tools/build-manifest/build.rs (L35) I'm certain PR will fix the problem.
2025-11-26 23:32:09 +11:00