Skip to content

macOS: main branch fails to compile with cranelift (unsupported section type mod_init_funcs) #20785

@wyvernbw

Description

@wyvernbw
error: #[link_section = "__mod_init_func"] is not supported: unsupported section type mod_init_funcs

error: could not compile `bevy_reflect` (lib) due to 1 previous error

Bevy version and features

  • main branch commit cbf989c

Relevant system information

running with cargo 1.91.0-nightly (a6c58d430 2025-08-26) on macOS 15.6

Steps to reproduce

create an empty project with bevy set to track the main branch and add cranelift to your .cargo/config.toml

[unstable]
codegen-backend = true

[profile.dev]
codegen-backend = "cranelift"

What went wrong

Project fails to compile bevy_reflect with the error

error: #[link_section = "__mod_init_func"] is not supported: unsupported section type mod_init_funcs

error: could not compile `bevy_reflect` (lib) due to 1 previous error

Related issues

This appears to be an issue in cranelift itself

That being said (i think) downstream crates found workarounds?

im not very knowledgeable on either of these topics however so i cant say for sure.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-Cross-CuttingImpacts the entire engineC-BugAn unexpected or incorrect behaviorO-MacOSSpecific to the MacOS (Apple) desktop operating systemP-Compile-FailureA failure to compile Bevy appsS-BlockedThis cannot move forward until something else changes

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions