Skip to content

Conversation

@folkertdev
Copy link
Contributor

tracking issue: #75835
fixes #132142

An extern "cmse-nonsecure-entry" function cannot be c-variadic (or, in any case, clang/LLVM does not support it, see https://godbolt.org/z/MaPjzGcE1). So just stop looking at the type if we know it'll be invalid anyway.

I'm not entirely sure how to test this. The ICE is only possible on the thumbv8m.main-none-eabi and some related targets. I think using minicore is the most convenient, but use of async requires quite a long list of lang items to be present. Maybe we want that anyway though? On the other hand, it's extra minicore surface that might go out of date.

An alternative is run-make, that should work, but is much less convenient. See also #t-compiler/help > `async fn` and `minicore`.

r? @ghost

@rustbot rustbot added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue. labels Sep 14, 2025
@folkertdev folkertdev added F-c_variadic `#![feature(c_variadic)]` F-cmse_nonsecure_entry `#![feature(cmse_nonsecure_entry)]` labels Sep 14, 2025
@workingjubilee
Copy link
Member

Nightly seems to already not produce this ICE.

@workingjubilee
Copy link
Member

workingjubilee commented Sep 14, 2025

Wait, ignore me, I forgot to update a detail. Does repro.

@folkertdev
Copy link
Contributor Author

Yeah you need to get a bunch of details right (that was less true when the issue was originally found)

@rust-log-analyzer

This comment has been minimized.

@folkertdev folkertdev force-pushed the cmse-entry-c-variadic branch 2 times, most recently from 8fc9af3 to dd68e26 Compare September 15, 2025 19:04
@rust-log-analyzer

This comment has been minimized.

@folkertdev folkertdev force-pushed the cmse-entry-c-variadic branch from dd68e26 to 8b752cb Compare September 16, 2025 08:23
@folkertdev
Copy link
Contributor Author

I've added some comments to clarify why all of the lang items are there. Over in https://rust-lang.zulipchat.com/#narrow/channel/182449-t-compiler.2Fhelp/topic/.60async.20fn.60.20and.20.60minicore.60/with/539427262 including the lang items here for now seemed like the best approach.

r? @workingjubilee because c-variadics and these calling conventions

@folkertdev folkertdev marked this pull request as ready for review September 20, 2025 15:02
@rustbot
Copy link
Collaborator

rustbot commented Sep 20, 2025

workingjubilee is currently at their maximum review capacity.
They may take a while to respond.

@rustbot
Copy link
Collaborator

rustbot commented Sep 20, 2025

This PR changes a file inside tests/crashes. If a crash was fixed, please move into the corresponding ui subdir and add 'Fixes #' to the PR description to autoclose the issue upon merge.

HIR ty lowering was modified

cc @fmease

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Sep 20, 2025
@workingjubilee
Copy link
Member

@bors r+ rollup

@bors
Copy link
Collaborator

bors commented Sep 20, 2025

📌 Commit 8b752cb has been approved by workingjubilee

It is now in the queue for this repository.

@bors bors 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 Sep 20, 2025
bors added a commit that referenced this pull request Sep 21, 2025
Rollup of 8 pull requests

Successful merges:

 - #140983 (Improve doc of some methods that take ranges)
 - #144091 (Stabilize `new_zeroed_alloc`)
 - #145664 (Stabilize `std::panic::Location::file_as_c_str`)
 - #146551 (fix issue with `cmse-nonsecure-entry` ABI being both async and c-variadic)
 - #146744 (Deref related cleanups in ref_prop)
 - #146793 (naked_asm: emit a label starting with `func_end`)
 - #146820 (Add unstable attribute to BTreeMap-related allocator generics)
 - #146822 (Fix old typo in lang_start_internal comment)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 6333a8b into rust-lang:master Sep 21, 2025
10 checks passed
@rustbot rustbot added this to the 1.92.0 milestone Sep 21, 2025
rust-timer added a commit that referenced this pull request Sep 21, 2025
Rollup merge of #146551 - folkertdev:cmse-entry-c-variadic, r=workingjubilee

fix issue with `cmse-nonsecure-entry` ABI being both async and c-variadic

tracking issue: #75835
fixes #132142

An `extern "cmse-nonsecure-entry"` function cannot be c-variadic (or, in any case, clang/LLVM does not support it, see  https://godbolt.org/z/MaPjzGcE1). So just stop looking at the type if we know it'll be invalid anyway.

I'm not entirely sure how to test this. The ICE is only possible on the `thumbv8m.main-none-eabi` and some related targets. I think using `minicore` is the most convenient, but use of `async` requires quite a long list of lang items to be present. Maybe we want that anyway though? On the other hand, it's extra `minicore` surface that might go out of date.

An alternative is `run-make`, that should work, but is much less convenient. See also [#t-compiler/help > `async fn` and `minicore`](https://rust-lang.zulipchat.com/#narrow/channel/182449-t-compiler.2Fhelp/topic/.60async.20fn.60.20and.20.60minicore.60/with/539427262).

r? `@ghost`
Muscraft pushed a commit to Muscraft/rust that referenced this pull request Sep 24, 2025
…r=workingjubilee

fix issue with `cmse-nonsecure-entry` ABI being both async and c-variadic

tracking issue: rust-lang#75835
fixes rust-lang#132142

An `extern "cmse-nonsecure-entry"` function cannot be c-variadic (or, in any case, clang/LLVM does not support it, see  https://godbolt.org/z/MaPjzGcE1). So just stop looking at the type if we know it'll be invalid anyway.

I'm not entirely sure how to test this. The ICE is only possible on the `thumbv8m.main-none-eabi` and some related targets. I think using `minicore` is the most convenient, but use of `async` requires quite a long list of lang items to be present. Maybe we want that anyway though? On the other hand, it's extra `minicore` surface that might go out of date.

An alternative is `run-make`, that should work, but is much less convenient. See also [#t-compiler/help > &rust-lang#96;async fn&rust-lang#96; and &rust-lang#96;minicore&rust-lang#96;](https://rust-lang.zulipchat.com/#narrow/channel/182449-t-compiler.2Fhelp/topic/.60async.20fn.60.20and.20.60minicore.60/with/539427262).

r? `@ghost`
Muscraft pushed a commit to Muscraft/rust that referenced this pull request Sep 24, 2025
Rollup of 8 pull requests

Successful merges:

 - rust-lang#140983 (Improve doc of some methods that take ranges)
 - rust-lang#144091 (Stabilize `new_zeroed_alloc`)
 - rust-lang#145664 (Stabilize `std::panic::Location::file_as_c_str`)
 - rust-lang#146551 (fix issue with `cmse-nonsecure-entry` ABI being both async and c-variadic)
 - rust-lang#146744 (Deref related cleanups in ref_prop)
 - rust-lang#146793 (naked_asm: emit a label starting with `func_end`)
 - rust-lang#146820 (Add unstable attribute to BTreeMap-related allocator generics)
 - rust-lang#146822 (Fix old typo in lang_start_internal comment)

r? `@ghost`
`@rustbot` modify labels: rollup
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

F-c_variadic `#![feature(c_variadic)]` F-cmse_nonsecure_entry `#![feature(cmse_nonsecure_entry)]` S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ICE: missing binding mode

5 participants