Skip to content

Add ARM64 (Apple Silicon) support and fix FPU bugs#21

Closed
kkeker wants to merge 1 commit into
pruten:masterfrom
kkeker:upstream-arm64-fixes
Closed

Add ARM64 (Apple Silicon) support and fix FPU bugs#21
kkeker wants to merge 1 commit into
pruten:masterfrom
kkeker:upstream-arm64-fixes

Conversation

@kkeker

@kkeker kkeker commented Mar 21, 2026

Copy link
Copy Markdown

Summary

  • Add arm64 architecture to core/Makefile, replacing i386 (no longer supported on modern macOS). Builds a universal libshoebill_core.a (arm64 + x86_64).
  • Update Xcode project: MACOSX_DEPLOYMENT_TARGET=14.0, SDKROOT=macosx, VALID_ARCHS="x86_64 arm64", enable CLANG_ENABLE_OBJC_WEAK.
  • Fix memset() argument swap in fpu_initialize() — the size and value arguments were transposed (fixes incorrect memset() in fpu.c #20, reported by @mitchblank).
  • Fix K&R-style function declaration _native_tentox(a)_native_tentox(double a) which causes build errors on modern compilers (fixes Error trying to build under Fedora 31 with lin.build.sh #15).
  • Rename HACKY_MATH_X86 to HACKY_MATH_NATIVE since the double + math.h code path works identically on ARM64.
  • Bump version to 0.1.0.

This incorporates the build changes from #19 by @calmsacibis995, plus the two bug fixes identified by @mitchblank in #15 and #20. Verified to build cleanly (zero warnings) on macOS with Apple Silicon, producing a valid universal binary.

Test plan

  • make core produces intermediates/libshoebill_core.a with both arm64 and x86_64 slices
  • Zero compiler warnings during build
  • Boot A/UX on Apple Silicon Mac (requires ROM + disk image)

Made with Cursor

- Add arm64 architecture to core/Makefile, replacing i386 (dead on modern macOS)
- Update Xcode project: MACOSX_DEPLOYMENT_TARGET=14.0, SDKROOT=macosx,
  VALID_ARCHS="x86_64 arm64", enable CLANG_ENABLE_OBJC_WEAK
- Fix memset() argument swap in fpu_initialize() (issue pruten#20, reported by @mitchblank)
- Fix K&R-style _native_tentox(a) -> _native_tentox(double a) (issue pruten#15)
- Rename HACKY_MATH_X86 to HACKY_MATH_NATIVE since double+math.h works on all archs
- Bump version to 0.1.0

Based on ARM64 build work from PR pruten#19 by @calmsacibis995.
Tested: libshoebill_core.a builds clean (zero warnings) as universal arm64+x86_64.

Made-with: Cursor
@calmsacibis995

calmsacibis995 commented Mar 21, 2026

Copy link
Copy Markdown

I can confirm that it does work, but the debugger does not build under arm64, as it complains about ch_reset not being resolved.

EDIT: I just made a commit in my own fork to fix the compiler linkage error.

@kkeker

kkeker commented Mar 22, 2026

Copy link
Copy Markdown
Author

Superseded by a comprehensive modernization PR that includes all ARM64 fixes plus extensive optimizations and a modern SwiftUI interface.

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

Successfully merging this pull request may close these issues.

incorrect memset() in fpu.c Error trying to build under Fedora 31 with lin.build.sh

2 participants