Skip to content

Conversation

@matthiaskrgr
Copy link
Member

Successful merges:

r? @ghost

Create a similar rollup

tisonkun and others added 24 commits December 14, 2025 14:35
This commit reorders some cases in `export_symbols` in the linker
implementation for wasm to ensure that the `is_like_wasm` case is
handled before the catch-all `CrateType::Executable` case.
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)
Add a rustc intrinsic `amdgpu_dispatch_ptr` to access the kernel
dispatch packet on amdgpu.
The HSA kernel dispatch packet contains important information like the
launch size and workgroup size.

The Rust intrinsic lowers to the `llvm.amdgcn.dispatch.ptr` LLVM
intrinsic, which returns a `ptr addrspace(4)`, plus an addrspacecast to
`addrspace(0)`, so it can be returned as a Rust reference.

The returned pointer/reference is valid for the whole program lifetime,
and is therefore `'static`.

The return type of the intrinsic (`*const ()`) does not mention the
struct so that rustc does not need to know the exact struct type.
An alternative would be to define the struct as lang item or add a
generic argument to the function.

Short version:
```rust
#[cfg(target_arch = "amdgpu")]
pub fn amdgpu_dispatch_ptr() -> *const ();
```
Having two dedicated target maintainers is a prerequisite for promoting
this target to tier 2. I've been in contact with Ulrich and he's agreed
to having me as a co-maintainer in preparation for a MCP to promote it to
tier 2.
This is a safe function, which doesn't take a `ptr` parameter.
Add waker_fn and local_waker_fn to std::task

This refers to rust-lang#149580.
…crum

Update provider API docs

Adds guidance on a specific provider API implementation anti pattern that implementers of the error trait should avoid.

resolves rust-lang#99301 (comment)
`c_variadic`: provide our own `va_arg` implementation for more targets

tracking issue: rust-lang#44930

Provide our own implementations in order to guarantee the behavior of `va_arg`. We will only be able to stabilize `c_variadic` on targets where we know and guarantee the properties of `va_arg`.

r? workingjubilee
…, r=jdonszelmann

rustc: Fix `-Zexport-executable-symbols` on wasm

This commit reorders some cases in `export_symbols` in the linker implementation for wasm to ensure that the `is_like_wasm` case is handled before the catch-all `CrateType::Executable` case.
…r=workingjubilee

Ensure that static initializers are acyclic for NVPTX

NVPTX does not support cycles in static initializers (see rust-lang#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).
…ubilee

Add amdgpu_dispatch_ptr intrinsic

There is an ongoing discussion in rust-lang#150452 about using address spaces from the Rust language in some way.
As that discussion will likely not conclude soon, this PR adds one rustc_intrinsic with an addrspacecast to unblock getting basic information like launch and workgroup size and make it possible to implement something like `core::gpu`.

Add a rustc intrinsic `amdgpu_dispatch_ptr` to access the kernel dispatch packet on amdgpu.
The HSA kernel dispatch packet contains important information like the launch size and workgroup size.

The Rust intrinsic lowers to the `llvm.amdgcn.dispatch.ptr` LLVM intrinsic, which returns a `ptr addrspace(4)`, plus an addrspacecast to `addrspace(0)`, so it can be returned as a Rust reference.
The returned pointer/reference is valid for the whole program lifetime, and is therefore `'static`.
The return type of the intrinsic (`&'static ()`) does not mention the struct so that rustc does not need to know the exact struct type. An alternative would be to define the struct as lang item or add a generic argument to the function.
Is this ok or is there a better way (also, should it return a pointer instead of a reference)?

Short version:
```rust
#[cfg(target_arch = "amdgpu")]
pub fn amdgpu_dispatch_ptr() -> *const ();
```

Tracking issue: rust-lang#135024

r? RalfJung as you are already aware of the background (feel free to re-assign)
./x check miri: enable check_only feature

With this, we should no longer need to turn off the default features, so we can undo rust-lang#149550.

@bjorn3 you seem to have a test setup to check if this works properly in terms of skipping all the work that should not be required -- could you test if this PR works as intended?

FWIW we could now remove `default_features` from `run_tool_check_step`. Not sure if that's worth it.
Thread `--jobs` from `bootstrap` -> `compiletest` -> `run-make-support`

Context is rust-lang#150524 (comment), where we would like to thread the `--jobs` config from bootstrap explicitly through to run-make tests without relying on an "external env var" that bypasses the build/test infra.

Note that this PR currently intentionally couples the jobs configured for *builds*, versus for `TestMode::RunMake` tests. We can further specialize some kind of `run-make-jobs` bootstrap config *if actually needed*; I will keep this configuration naive for now.

r? @Kobzol
…aumeGomez

Deprecated doc intra link

fixes rust-lang#98342
r? @GuillaumeGomez

Renders intra-doc links in the note text of the `#[deprecated]` attribute. It is quite natural to suggest some other function to use there. So e.g.

```rust
#[deprecated(since = "0.0.0", note = "use [`std::mem::size_of`] instead")]
```

renders as

<img width="431" height="74" alt="Screenshot from 2026-01-06 12-08-21" src="https://github.com/user-attachments/assets/8f608f08-13ee-4bbf-a631-6008058a51e2" />
Add myself as co-maintainer for s390x-unknown-linux-musl

Having two dedicated target maintainers is a prerequisite for promoting this target to tier 2. I've been in contact with Ulrich and he's agreed to having me as a co-maintainer in preparation for a MCP to promote it to tier 2.

cc @uweigand
Fix copy-n-paste error in `vtable_for` docs

This is a safe function, which doesn't take a `ptr` parameter.
@rust-bors rust-bors bot added the rollup A PR which is a rollup label Jan 8, 2026
@rustbot rustbot added A-compiletest Area: The compiletest test runner A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. A-run-make Area: port run-make Makefiles to rmake.rs A-test-infra-minicore Area: `minicore` test auxiliary and `//@ add-core-stubs` A-testsuite Area: The testsuite used to check the correctness of rustc labels Jan 8, 2026
@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. T-rustdoc-frontend Relevant to the rustdoc-frontend team, which will review and decide on the web UI/UX output. labels Jan 8, 2026
@matthiaskrgr
Copy link
Member Author

@bors r+ rollup=never p=5

@rust-bors rust-bors bot added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jan 8, 2026
@rust-bors
Copy link
Contributor

rust-bors bot commented Jan 8, 2026

📌 Commit d96b395 has been approved by matthiaskrgr

It is now in the queue for this repository.

@rust-log-analyzer
Copy link
Collaborator

The job aarch64-gnu-llvm-20-2 failed! Check out the build log: (web) (plain enhanced) (plain)

Click to see the possible cause of the failure (guessed by this bot)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-compiletest Area: The compiletest test runner A-LLVM Area: Code generation parts specific to LLVM. Both correctness bugs and optimization-related issues. A-run-make Area: port run-make Makefiles to rmake.rs A-test-infra-minicore Area: `minicore` test auxiliary and `//@ add-core-stubs` A-testsuite Area: The testsuite used to check the correctness of rustc rollup A PR which is a rollup S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-bootstrap Relevant to the bootstrap subteam: Rust's build system (x.py and src/bootstrap) T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. T-libs Relevant to the library team, which will review and decide on the PR/issue. T-rustdoc Relevant to the rustdoc team, which will review and decide on the PR/issue. T-rustdoc-frontend Relevant to the rustdoc-frontend team, which will review and decide on the web UI/UX output.

Projects

None yet

Development

Successfully merging this pull request may close these issues.