Rust generates calls to __truncdfsf2, which it claims not to support?

Viewed 137

I'm writing some Rust code for an Atmega328. I understand that it does not have built in support for floats, so I will need to provide some sort of soft implementation of floating point routines that I want to use, like those found in compiler-builtins. However, even after including compiler-builtins, I get the following:

quaternion.rs:54: undefined reference to `__truncdfsf2'

Looking at the page for compiler-builtins, I see that there are no plans to support __truncdfsf2, since apparently it "involves floating-point types ("f128", "f80" and complex numbers) that are not supported by Rust."

Can anyone help me understand why Rust/LLVM seems to be generating calls that Rust apparently doesn't support? And is there a way to go about solving this?

Here's my target.json for reference.

{
    "arch": "avr",
    "atomic-cas": false,
    "cpu": "atmega328",
    "data-layout": "e-P1-p:16:8-i8:8-i16:8-i32:8-i64:8-f32:8-f64:8-n8-a:8",
    "eh-frame-header": false,
    "exe-suffix": ".elf",
    "executables": true,
    "late-link-args": {
        "gcc": [
            "-lgcc"
        ]
    },
    "linker": "avr-gcc",
    "linker-is-gnu": true,
    "llvm-target": "avr-unknown-unknown",
    "max-atomic-width": 8,
    "no-default-libraries": false,
    "no-compiler-rt": true,
    "target-c-int-width": "16",
    "target-pointer-width": "16",
    "pre-link-args": {
    "gcc": [
      "-mmcu=atmega328",
      "-Wl,--as-needed"
    ]
  },
  "vendor": "unknown",
  "os": "none",
  "target-endian": "little"
}
0 Answers
Related