Two macOS build fixes: EUC-JP encoding and tool building - #772
Open
quarrel07 wants to merge 2 commits into
Open
Conversation
This was referenced Jul 31, 2026
MegaMech
previously approved these changes
Aug 2, 2026
macOS iconv converts a backslash that follows Japanese text into the fullwidth reverse solidus (0xA1C0) rather than leaving it as 0x5C. In src/cpu_vehicles_camera_path.c that turns a "\n" escape inside a string literal into a literal two-byte character, adding 26 bytes, which grows .main and shifts the whole ROM. No version can byte-match on macOS as a result. Python's euc_jp codec produces the bytes the cartridge actually has, and is identical to GNU iconv's output for the other two EUC-JP sources. PYTHON is already a required build dependency.
macOS still ships GNU make 3.81 as `make`, and tools/Makefile generates its per-tool rules with `define COMPILE =`, which is 3.82 syntax. Under 3.81 those rules do not take effect and make falls back to its built-in %: %.c rule, so each tool is linked from its first source file alone. n64graphics is built from n64graphics.c and utils.c, so it fails with an undefined _g_verbosity rather than anything that points at the cause. The docs already tell macOS users to build with gmake, but this line then calls bare make and undoes that. This makefile needs 4.0+ for != in the first place, so $(MAKE) is always a new enough make.
quarrel07
force-pushed
the
macos-ido-binaries
branch
from
August 3, 2026 05:01
a840cc8 to
d3b6f4a
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
macOS cannot currently build mk64. There are three independent causes. Two of them are here, kept as separate commits so they can be taken separately if you prefer.
The third is the truncated IDO binaries under
tools/ido-recomp/macos/. Those were in this PR originally and have been taken out, so this no longer touches any binary. queueRAM's suggestion of building IDO from source viaido-static-recomplooks like the better answer there and is worth doing on its own.1. macOS iconv corrupts the EUC-JP sources, so no version can byte-match.
macOS
iconvconverts a backslash that follows Japanese text into the fullwidth reverse solidus (0xA1C0) instead of leaving it as0x5C. GNU iconv leaves it alone, which is why this has never shown up on Linux. It bites insrc/cpu_vehicles_camera_path.c:219:The trailing
\nbecomes a literal two-byte character rather than an escape. 26 of the file's 199 backslashes are converted (0x5C: 199 -> 173,0xA1C0: 0 -> 26), the generated file grows by exactly 26 bytes,.maingrows with it, and the ROM shifts:Python's
euc_jpcodec produces the bytes the cartridge actually has, andPYTHONis already a required build dependency. For the other two EUC-JP sources macOS iconv and Python output are byte-identical, so this only changes behaviour where iconv was wrong. Should be a no-op on Linux.2. The tools are built with bare
make, which on macOS is 3.81.tools/Makefile:51generates its per-tool rules withdefine COMPILE =, which is 3.82 syntax. Under 3.81 those rules never take effect, so make falls back to its built-in%: %.crule and links each tool from its first source file alone.n64graphics_SOURCES := n64graphics.c utils.c, soutils.cis dropped:Nothing there suggests the make version is at fault.
docs/basics/compiling.mdalready tells macOS users to build withgmake, butMakefile:201then calls baremakeand undoes it. The root makefile uses!=, which needs make 4.0, so$(MAKE)is always new enough.Verification. macOS 26.6, Apple Silicon. With these two, and IDO built from source with
decompals/ido-static-recompinstead of the checked-in binaries,makereportsmk64.us: OK(579c48e2...),make VERSION=eu.v10reportsmk64.eu.v10: OK(a72903945...), andeu.v11matches too. Before these two fixes the US ROM came out asd2eaf74b99f3f2bc78fa5acc610fcb5e0ce39610.