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

building on ARM host fails to match compiled US rom #207

Closed
Alto1772 opened this issue Mar 11, 2021 · 12 comments
Closed

building on ARM host fails to match compiled US rom #207

Alto1772 opened this issue Mar 11, 2021 · 12 comments

Comments

@Alto1772
Copy link
Contributor

build fails after verifying built US rom on aarch64 (raspberry pi) host. (does not affect x86 hosts)
I suggest that this may have cause of the arm64 built c compiler tools/arm/cc1 or some matched snippets of code, probably...

@bates64
Copy link
Member

bates64 commented Mar 11, 2021

@ethteck I thought Jenkins was partially using rpis to build?

@ethteck
Copy link
Member

ethteck commented Mar 12, 2021

I haven't used it in a while, so I can test it again soon. @Alto1772 could you provide more details on what failed? Did the build succeed but the checksum failed? Or does the build not finish?

@Alto1772
Copy link
Contributor Author

here's my first ninja -v output from the last 12 lines:

[6636/6639] mips-linux-gnu-ld -r -b binary ver/us/build/assets.bin -o ver/us/build/assets.o
[6637/6639] mips-linux-gnu-ld -T ver/us/undefined_syms.txt -T ver/us/undefined_syms_auto.txt -T ver/us/undefined_funcs_auto.txt  -T ver/us/dead_syms.txt -Map ver/us/build/papermario.map --no-check-sections -T ver/us/build/papermario.ld -o ver/us/build/papermario.elf
[6638/6639] mips-linux-gnu-objcopy ver/us/build/papermario.elf ver/us/build/papermario.z64 -O binary && tools/n64crc ver/us/build/papermario.z64
BootChip: CIC-NUS-6103
CRC 1: 0x65EEE53A  Calculated: 0x65EEE69A (Bad, fixed)
CRC 2: 0xED7D733C  Calculated: 0x119C8F53 (Bad, fixed)
[6639/6639] sha1sum -c ver/us/checksum.sha1 && touch ver/us/build/ok
FAILED: ver/us/build/ok 
sha1sum -c ver/us/checksum.sha1 && touch ver/us/build/ok
ver/us/build/papermario.z64: FAILED
sha1sum: WARNING: 1 computed checksum did NOT match
ninja: build stopped: subcommand failed.

running ninja again gives the clearer result:

[1/6] link ver/jp/build/papermario.elf
[2/6] rom ver/jp/build/papermario.elf
BootChip: CIC-NUS-6103
CRC 1: 0x3BA7CDDC  Calculated: 0x3BA7CDDC (Good)
CRC 2: 0x464E52A0  Calculated: 0x464E52A0 (Good)
[3/6] compare
ver/jp/build/papermario.z64: OK
[4/6] link ver/us/build/papermario.elf
[5/6] rom ver/us/build/papermario.elf
BootChip: CIC-NUS-6103
CRC 1: 0x65EEE53A  Calculated: 0x65EEE69A (Bad, fixed)
CRC 2: 0xED7D733C  Calculated: 0x119C8F53 (Bad, fixed)
[6/6] compare
FAILED: ver/us/build/ok 
sha1sum -c ver/us/checksum.sha1 && touch ver/us/build/ok
ver/us/build/papermario.z64: FAILED
sha1sum: WARNING: 1 computed checksum did NOT match
ninja: build stopped: subcommand failed.

only the us version fails the checksum during this build.

@ethteck
Copy link
Member

ethteck commented Mar 12, 2021

Okay, so the checksum is just failing. Could you try ./first_diff.py to see where the first difference occurs? Or vbindiff?

@Alto1772
Copy link
Contributor Author

./first_diff.py output:

First difference at ROM addr 0x3BDA4, osSetIntMask (RAM 0x80060940, ROM 0x3BD40, ver/us/build/asm/os/osSetIntMask.s.o)
Bytes: 95:4A:9A:9C vs 95:4A:9A:A0
Instruction difference at ROM addr 0x74E9C, D_80099AA0 (RAM 0x80099A9C, ROM 0x74E9C, ver/us/build/asm/os/osSetIntMask.s.o)
Bytes: 05:55:05:56 vs 00:00:00:00
Instruction difference at ROM addr 0x74F1C, jtbl_80099B20 (RAM 0x80099B1C, ROM 0x74F1C, ver/us/build/src/os/code_3c490_len_3c0.c.o)
Bytes: 80:06:13:D4 vs 0A:A9:0A:AA
Instruction difference at ROM addr 0x74F3C, D_80099B40 (RAM 0x80099B3C, ROM 0x74F3C, ver/us/build/src/os/code_3c940_len_140.c.o)
Bytes: 41:F0:00:00 vs 00:00:00:00
Instruction difference at ROM addr 0x74F4C, D_80099B50 (RAM 0x80099B4C, ROM 0x74F4C, ver/us/build/src/os/guLookAt.c.o)
Bytes: BF:F0:00:00 vs 00:00:00:00
Instruction difference at ROM addr 0x74F54, D_80099B58 (RAM 0x80099B54, ROM 0x74F54, ver/us/build/src/os/guLookAt.c.o)
Bytes: 3F:F0:00:00 vs 00:00:00:00

487 differing word(s).
To find ROM shifts, copy a clean .map file to ver/current/expected/build/papermario.map and rerun this script.

@ethteck
Copy link
Member

ethteck commented Mar 12, 2021

Thanks. I'll try to reproduce in a bit and see what's going on. I suspect it has to do with the recent support for addu in libultra

@ethteck
Copy link
Member

ethteck commented Mar 12, 2021

By the way, your old github bio was so good and we reference it from time to time lol

@Alto1772
Copy link
Contributor Author

after that, i tested the unmatched compiled rom in the n64 emulator, and it crashes (sound still running) at the demo screen where mario ground pounds the sealed wooden platform at the windmill (after it fades to black).

@ethteck
Copy link
Member

ethteck commented Mar 14, 2021

I can confirm this issue is present on the mac build as well. Something is up with the rodata in world.c

@ethteck
Copy link
Member

ethteck commented Mar 14, 2021

I believe I fixed this, or at least I fixed the part of it that was also failing the osx build. Could you test the latest master commit @Alto1772 ?

@Alto1772
Copy link
Contributor Author

yup, checksum is OK, no errors or interruptions during the build.
that's all i have to say.

@ethteck
Copy link
Member

ethteck commented Mar 14, 2021

Awesome! I'll close this one then. Thanks for the report :)

@ethteck ethteck closed this as completed Mar 14, 2021
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