The LLVM backend cannot generate a module on macOS (Apple Silicon, arm64) at 1bec355. Generation dies partway through chunk emission:
LLVM ERROR: Global variable 'fix_pair_nan_f64' has an invalid section specifier
'.text.unlikely.fix_pair_nan_f64': mach-o section specifier requires a segment and
section separated by a comma.
Reproduced building Luigi's Mansion (GLME01); it failed at chunk 57 of 4164.
markColdFixup() in src/backend/llvm/fp_fixups.cpp:21 sets an ELF-style section name unconditionally. Mach-O requires __SEGMENT,__section form, so any .text.unlikely.* name is rejected outright by the Mach-O writer.
Skipping the cold-section hint when the target object format is Mach-O let all 4164 chunks generate successfully, and the resulting module ran clean (Luigi's Mansion, foyer.sav, median 81.2 fps against 79.1 for the C backend on the same machine). Gating the hint on the target format, or emitting a Mach-O-shaped section name instead, would both work; I did not send a patch because the choice between those is yours.
Toolchain: clang/LLVM 20 (llvm@20 from Homebrew), Release, Ninja, DOLRECOMP_ENABLE_LLVM=ON, host aarch64-apple-darwin.
Separately, and probably worth its own look: the C backend at this commit emits calls to ppc_fp_available_inline, which does not exist in the ModernGekko GXRuntime checkout we build against (vendor/dolphin/GXRuntime/include/core/cpu.h declares only ppc_fp_available), so a same-commit C module could not be built there to compare against.
The LLVM backend cannot generate a module on macOS (Apple Silicon, arm64) at
1bec355. Generation dies partway through chunk emission:Reproduced building Luigi's Mansion (GLME01); it failed at chunk 57 of 4164.
markColdFixup()insrc/backend/llvm/fp_fixups.cpp:21sets an ELF-style section name unconditionally. Mach-O requires__SEGMENT,__sectionform, so any.text.unlikely.*name is rejected outright by the Mach-O writer.Skipping the cold-section hint when the target object format is Mach-O let all 4164 chunks generate successfully, and the resulting module ran clean (Luigi's Mansion,
foyer.sav, median 81.2 fps against 79.1 for the C backend on the same machine). Gating the hint on the target format, or emitting a Mach-O-shaped section name instead, would both work; I did not send a patch because the choice between those is yours.Toolchain: clang/LLVM 20 (
llvm@20from Homebrew), Release, Ninja,DOLRECOMP_ENABLE_LLVM=ON, hostaarch64-apple-darwin.Separately, and probably worth its own look: the C backend at this commit emits calls to
ppc_fp_available_inline, which does not exist in the ModernGekko GXRuntime checkout we build against (vendor/dolphin/GXRuntime/include/core/cpu.hdeclares onlyppc_fp_available), so a same-commit C module could not be built there to compare against.