Skip to content

Latest libm 0.2.13 is failing during LTO #205

@jorge-ortega

Description

@jorge-ortega

As of a few days ago, our kernel crates fail to build in CI with the following error (plus some additional logging I added)

error: failed to parse bitcode for LTO module libm.9303cbbb082352b3-cgu.09: Invalid cast (Producer: 'LLVM7.0.1' Reader: 'LLVM 7.0.1')

Turns out there was a new release for libm on April 22. I originally wasn't able to repro this, as the Cargo.lock file I had was set to libm 0.2.11. After regenerating my lock file, which updates to libm 0.2.13, I'm able to repro this in on windows and ubuntu 24.

I have yet to figure out what changed in libm that's causing the codegen to fail during LTO. In the meantime, the best work around seems to be lock libm to 0.2.11:

[[package]]
name = "libm"
version = "0.2.11"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8355be11b20d696c8f18f6cc018c4e372165b1fa8126cef092399c9951984ffa"

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions