Skip to content

Support Building on macOS#11

Open
LiruMouse wants to merge 2 commits intoMonstatek:mainfrom
LiruMouse:feature/mac_build
Open

Support Building on macOS#11
LiruMouse wants to merge 2 commits intoMonstatek:mainfrom
LiruMouse:feature/mac_build

Conversation

@LiruMouse
Copy link
Copy Markdown

@LiruMouse LiruMouse commented Mar 11, 2026

Description

Added support for building on macOS.

The macOS version of ARM's toolchain appears to be using a different version of newlib, which may account for the slightly larger sized binary than what Arch is producing.

Changes Made:

  • build.sh: Support using sysctl to get the cpu count
  • Makefile & setup_macos.sh: Gather dependencies from brew for Mac
  • cmake/gcc-arm-none-eabi.cmake:
    • Allow setting TOOLCHAIN_PREFIX for all platforms
    • When TOOLCHAIN_PREFIX is unset on macos, try where brew puts it by default
  • documentation/mbt.md & README: Document build
    • README: Split platform Build Steps via markdown headings

Type of Change

  • New feature (non-breaking change which adds functionality)
  • Documentation update

Testing Environment

  • IDE: N/A (command-line build)
  • Version: N/A
  • Compiler Hardware: M4 Max running 15.7.2
  • Compiler: arm-none-eabi-gcc (GCC) 15.2.0
    • Also built/tested with 14.2, but that made the setup overly complicated since brew's cask uses 15.2 now.
  • Debugger: N/A

How Has This Been Tested?

  • Build completes successfully with make
  • ELF file validated as ARMv8-M architecture
  • Binary/HEX files generated in artifacts directory
  • Memory usage within device limits (RAM: 26.88%, FLASH: 44.72%)
  • Moved the artifacts onto an SD card and went through
    • Settings->Firmware update->Image File
    • Selected the correct image from the SD card
    • Checked that the versions displayed looked correct
    • Selected Firmware update and watched until it said the update was successful
    • Checked out that my M1 wasn't bricked.

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings

Support building on mac
- build.sh: Support using sysctl to get the cpu count
- Makefile & setup_macos.sh: Gather dependencies from brew for Mac
- cmake/gcc-arm-none-eabi.cmake:
  - Allow setting TOOLCHAIN_PREFIX for all platforms
  - When TOOLCHAIN_PREFIX is unset on macos, try where brew puts it
- documentation/mbt.md & README: Document build
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.

1 participant