Skip to content

Undefined symbol errors on __aeabi_uread* and __aeabi_uwrite* functions with opt-level = "z" and build-std #162259

Description

@nikvoid

Code

On more recent Rust versions (after update to LLVM 23, I assume), I no longer can build some bare-metal projects.
There are errors such as

 = note: rust-lld: error: undefined symbol: __aeabi_uread4
          >>> referenced by mod.rs:1758 (src\ptr\mod.rs:1758)

Also mentioning __aeabi_uread8, __aeabi_uwrite4, __aeabi_uread8.
This only happens with option opt-level = "z" AND build-std enabled.

.cargo/cargo.toml:

[target.'cfg(all(target_arch = "arm", target_os = "none"))']
# replace STM32G0B1RETx with your chip as listed in `probe-rs chip list`
runner = "probe-rs run --chip STM32G0B1RETx"

[build]
target = "thumbv6m-none-eabi"

[env]
DEFMT_LOG = "trace"

[unstable]
build-std = ["core"]

Problem can be easily reproduced on embassy project examples
e.g. (https://github.com/embassy-rs/embassy/blob/main/examples/stm32g0/src/bin/blinky.rs)
This example's target is thumbv6m-none-eabi.

Version it worked on

It most recently worked on: Rust 1.95

Version with regression

rustc --version --verbose:

rustc 1.100.0-nightly (2e2b193f8 2026-09-02)

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-compiler-builtinsArea: compiler-builtins (https://github.com/rust-lang/compiler-builtins)C-bugCategory: This is a bug.T-libsRelevant to the library team, which will review and decide on the PR/issue.regression-untriagedUntriaged performance or correctness regression.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions