Repository navigation
no_std_test: declare the personality routine as the lang item (fixes NoStdBuild on current nightly) - #1191
Merged
schungx merged 1 commit intoOct 17, 2026
Conversation
Since rust-lang/rust#148413 (in nightly 2026-10-16) the compiler mangles the personality symbol like the other std-internal symbols, so the pre-built `core`/`alloc` now reference `__rustc::rust_eh_personality` and the `#[no_mangle] extern "C" fn rust_eh_personality()` in no_std_test no longer satisfies the linker: error: linking with `cc` failed = note: Undefined symbols for architecture arm64: "__RNvCs6EUDi8WbMwz_7___rustc19rust_eh_personality" Every NoStdBuild job has failed with this since that nightly, on every branch. Declare the function as `#[lang = "eh_personality"]` instead (with `#![feature(lang_items)]`), the shape rust-lang/rust's own no_std binary fixture (tests/run-make/no-alloc-shim/foo.rs) moved to in that PR. The compiler then emits the symbol under whatever name it expects, so this builds on the nightlies before and after the change. The routine is still never called: every profile sets `panic = "abort"`. Built with nightly 2026-10-16 (fails without this change) and nightly 2026-10-09 (builds either way), `--profile unix` and `--profile macos`.
This was referenced Oct 17, 2026
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.
Fixes the
NoStdBuildjobs, which have been red on every branch since the nightly of 2026-10-16 (seen on #1189 and #1190, which touch nothingno_std-specific;main's run of 2026-10-13 was still green).rust-lang/rust#148413 (merged 2026-10-15) mangles the personality symbol like the other std-internal symbols, so the pre-built
core/allocnow reference__rustc::rust_eh_personality, and the#[no_mangle] extern "C" fn rust_eh_personality()inno_std/no_std_test/src/main.rsno longer satisfies the linker:The change declares the function as
#[lang = "eh_personality"](with#![feature(lang_items)]), which is what rust-lang/rust's ownno_stdbinary fixture (tests/run-make/no-alloc-shim/foo.rs) moved to in that PR. The compiler then emits the symbol under whatever name it expects, so the harness builds on nightlies before and after the change. The routine is still never called, since every profile setspanic = "abort"; the other shims are untouched.Verified locally on aarch64-apple-darwin: with
nightly-2026-10-16the harness fails to link without this change and builds with it, for--profile unixand--profile macos; withnightly-2026-10-09it builds either way.🤖 Generated with Claude Code