-
Notifications
You must be signed in to change notification settings - Fork 27
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
Reverting 'stat.c' to original. #99
Conversation
This looks suspiciously like a llvm-mos bug that got fixed a while back --- certain relocations where being made incorrectly which resulted in the zp static data being copied from the wrong place, so any short string which was being cached in zero page was getting corrupted. Like FWIW, I've just tried it on the Oric in MAME and stat works fine on my system without modification: |
Something's broken in llvm-mos --- asm.com doesn't work any more. It's not at my end; I tried redoing a previously successful build on github, and it now fails: https://github.com/davidgiven/cpm65/actions/runs/7532135164 I wonder if this is related? |
In my latest tests it seams that ASM.COM works. EDIT: I've repeated the test with enabled option
BTW, what is the point to use |
I've just found a nasty LLVM bug: llvm-mos/llvm-mos-sdk#306 It was causing the start of the heap to not be relocated, meaning that if the binary was loaded above 0x0200 (which it usually is) then it would overwrite some of the program. This was causing the garbage out of ASM.COM in the mame tests. Unfortunately it'll take a while before the change reaches the release version of llvm-mos. |
Great news! I have some improvements for Oric and will open PR after I test all on real hardware. |
That bug hasn't gone away. I finally found out what's going on this time: llvm-mos/llvm-mos-sdk#320 The good news is that your suggestion of turning off ZP LTO should work around this for now. I'll send them a PR. |
Could this please be merged? Only LF is not how it's supposed to work. |
Sorry, yes. Merging. This was left open because of the underlying linker issue. (It's not a problem with ZP LTO, but it's provoked by ZP LTO...) |
Removing the 'ugly' hack. 'stat.c' and print() function are OK.
The same issue (with printing strings passed as param) occurs also in 'objdump.c'.
My guess is that virtual registers are messing up with (some) zp variables.
Here: printed lines are overlapped and random wrong strings are displayed (i.e. 'kl' instead 'kB'):
The problem disappears when I comment out '-mlto-zp=32' line in 'mos-cpm65.cfg' file from the llvm-mos-sdk.
As result everything works fine: