-
Notifications
You must be signed in to change notification settings - Fork 7
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
Some examples in mos-hardware are miscompiled or mislinked #16
Comments
I just tried to compile using the latest Docker image, cargo build --release --example c64-raster-interrupt --target mos-c64-none |
yes, that's what I do as well. Using the following commits for my build: mos-hardware 041e678404dd8a32ec81f8e7c70560d42a383bf9 |
I still haven't managed to build rust-mos and use only the docker image above which would have slightly older revisions. Did you try with that? I understand from other issues here, that later llvm-mos could be problematic. |
Building the idiomatic plasma example in release mode also causes a miscompilation, even with the Building in debug mode works fine, though! |
I cannot reproduce the issue for the idiomatic plasma example; do you compile directly from the crate? I have only had issues with compilation in projects that use mos-hardware as a dependency (I suspect it has to do with LTO). |
@mlund, this was compiled from a separate crate (based on I tried turning off LTO (so
Turning on LTO again caused compilation to succeed, but the generated binary to fail. I put up the project here along with the resulting (failing) |
Thanks, @sagacity, I have similar issues when using mos-hardware as a dependency. |
@mlund can we close it? Can you verify that all examples in mos-hardware work now? |
Everything ok! |
Great! |
When compiling https://github.com/mlund/mos-hardware/blob/main/examples/c64-raster-interrupt.rs the resulting binary does not call main. See attached file. I don't think this is a bug in rustc, but possibly in LLVM or llvm-mos-sdk?
If I binary patch the jump at 0x837 to jump to 0x971 instead of 0x857, the program works.
output.txt
The text was updated successfully, but these errors were encountered: