Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cranelift fails to build Bevy 0.13.2 on macOS #1504

Closed
Tracked by #1523
janhohenheim opened this issue Jul 4, 2024 · 7 comments
Closed
Tracked by #1523

cranelift fails to build Bevy 0.13.2 on macOS #1504

janhohenheim opened this issue Jul 4, 2024 · 7 comments
Labels
C-bug Category: This is a bug. O-macos Operating system: MacOS

Comments

@janhohenheim
Copy link

janhohenheim commented Jul 4, 2024

cargo --version: cargo 1.81.0-nightly (b1feb75d0 2024-06-07)

Cargo.toml
[package]
name = "cranelift-test"
version = "0.1.0"
edition = "2021"

[dependencies]
bevy = "0.13.2"
main.rs
fn main() {
    println!("Hello, world!");
}
~/.cargo/config.toml
[unstable]
codegen-backend = true

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

System:
image

Running cargo build results in the following:

error: error writing object file: section name `__cstring,cstring_literals` is too long

error: could not compile `objc2` (lib) due to 1 previous error
@bjorn3 bjorn3 added C-bug Category: This is a bug. O-macos Operating system: MacOS labels Jul 4, 2024
@bjorn3
Copy link
Member

bjorn3 commented Jul 4, 2024

I'm currently splitting a #[link_section = "__TEXT,__cstring,cstring_literals"] at the first comma into segment name "__TEXT" and section name "__cstring,cstring_literals". Looks like I have to split additional commas to separate the section name, section type, (+ separated) attributes and stub size: https://github.com/llvm/llvm-project/blob/main/llvm/lib/MC/MCSectionMachO.cpp

@bjorn3
Copy link
Member

bjorn3 commented Jul 4, 2024

I can reproduce this with Bevy 0.13.2 (both x86_64 and arm64) but not Bevy 0.14.0. I'm still going to fix it though.

@janhohenheim janhohenheim changed the title cranelift fails to build Bevy on (Intel) macOS cranelift fails to build Bevy 0.13.2 on macOS Jul 4, 2024
@bjorn3 bjorn3 closed this as completed in 253436c Jul 4, 2024
@bjorn3
Copy link
Member

bjorn3 commented Jul 4, 2024

In particular objc2 version v0.3.0-beta.3.patch-leaks.3 gives the error. Mostly fixed in 253436c. bytecodealliance/wasmtime#8901 is necessary for the being more technically correct.

@bjorn3
Copy link
Member

bjorn3 commented Jul 4, 2024

I just tried actually running the breakout example and it crashes...

@bjorn3 bjorn3 reopened this Jul 4, 2024
@bjorn3
Copy link
Member

bjorn3 commented Jul 4, 2024

I've force pushed the previous commit away. I don't have time to investigate the crash right now.

@janhohenheim
Copy link
Author

janhohenheim commented Jul 4, 2024

I think if it works on Bevy 0.14, it's good enough to at least not block recommending cranelift to new users :)
The crash does not happen on Bevy 0.14, right?

@bjorn3
Copy link
Member

bjorn3 commented Jul 4, 2024

The crash happens with Bevy 0.14 too. That means the commit I force-pushed away is not at fault for this crash at least. I've pushed it again. Let's open a new issue for the crash though.

@bjorn3 bjorn3 closed this as completed Jul 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug. O-macos Operating system: MacOS
Projects
None yet
Development

No branches or pull requests

2 participants