Skip to content

Projects making floating-point operations fail building during linking after toolchain version bump #650

@davidpolverari

Description

@davidpolverari

After the the update of Rust toolchain to nightly-2025-03-03 (9e96d0e), projects that perform floating-point operations are failing, due to undefined references to GCC soft float library routines (eg: __divsf3, __gesf2 and __gtsf2) during the linking process.

For instance, this line:

// duration is a u32
let distance = duration_us as f32 / 58.0;

Generates the following error:

src/main.rs:230: undefined reference to `__divsf3'

While these lines:

// dist is the same value as the `distance` above
tdd.write(dist as u8);
src/main.rs:280: undefined reference to `__gesf2'
src/main.rs:280: undefined reference to `__gtsf2'

Those errors didn't happen when using the previous Rust nightly version, along with using the JSON spec files.

Metadata

Metadata

Assignees

No one assigned

    Labels

    compiler-bugNot a bug in avr-hal, but a bug in the rust compiler/LLVM

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions