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

mustang doesn't work with lto #72

Closed
sunfishcode opened this issue Dec 1, 2021 · 6 comments
Closed

mustang doesn't work with lto #72

sunfishcode opened this issue Dec 1, 2021 · 6 comments

Comments

@sunfishcode
Copy link
Owner

This reproduces with just adding

[profile.release]
lto = true

to the top-level Cargo.toml in the mustang repo, and running the hello example. It gets lots of undefined references to things like core::panicking::assert_failed_inner. See also #22 (comment).

@HookedBehemoth
Copy link
Contributor

This also happens with profile.dev for me. The error output is a different one though.
Similar to #138 I get this a bunch of times

inlinable function call in a function with debug info must have a !dbg location
  call void @_Unwind_Resume(ptr %393) #42

Release is as you described. Tried gcc, ld.lld and mold.

@whentze
Copy link

whentze commented Apr 22, 2023

Is this still an issue? I tried to reproduce it on current main (38b4c91) using rustc 1.69.0-nightly (75a0be98f 2023-02-05) and it just works. Maybe this got solved accidentally?

@sunfishcode
Copy link
Owner Author

sunfishcode commented Apr 22, 2023

It still reproduces for me with the latest nightly. Mustang currently depends on nightly, so if you're using stable it's likely you're using a non-mustang target. Are you perhaps not using a release build?

@whentze
Copy link

whentze commented Apr 22, 2023

I am using a nightly, just not the latest one, because that fails with unknown feature `atomic_mut_ptr` - looks like that API was superseded by a newer, now stable one.

I can now reproduce the issue - I was using a mustang target but had forgotten to add --release 🤦🏼

@sunfishcode
Copy link
Owner Author

Mustang still doesn't support LTO, however origin has now moved out to its own repo and become a standalone usable project, and it does support LTO. And origin-studio provides a tiny std-like API for it. So if you want the Rust program startup and shutdown parts of mustang and don't need a full std or libc ABI compatibility, check out origin and/or origin-studio!

@sunfishcode
Copy link
Owner Author

This is now fixed in #239, which is now released in mustang 0.14.4. Mustang now supports LTO!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants