Cannot compile examples on ARM Mac (M2, Sequoia)
I'm wanting to delve into 3DS homebrew, and I recently had the interesting idea of trying to use Swift Embedded to build against devkitARM. However, I can't even get the base C examples to compile as provided, let alone get Swift Embedded to build with the bridging header.
Running make from /opt/devkitpro/examples/3DS/graphics/printing/hello-world outputs this:
Code: Select all
main.c
In file included from /opt/devkitpro/libctru/include/3ds.h:25,
from /opt/devkitpro/examples/3ds/graphics/printing/hello-world/source/main.c:6:
/opt/devkitpro/libctru/include/3ds/synchronization.h:10:9: error: unknown type name '_LOCK_T'
10 | typedef _LOCK_T LightLock;
| ^~~~~~~
/opt/devkitpro/libctru/include/3ds/synchronization.h:13:9: error: unknown type name '_LOCK_RECURSIVE_T'
13 | typedef _LOCK_RECURSIVE_T RecursiveLock;
| ^~~~~~~~~~~~~~~~~
make[1]: *** [main.o] Error 1
Is there something I'm missing? I also tried running make via arch -x86_64 make just to see if it was an ARM vs AMD64 thing by running make through Rosetta 2, but it still fails the same way. How do I go about fixing this?
-
To note, trying to compile a Swift project reports errors like unknown argument: '-mword-relocations', which is interesting; -mword-relocations is one of the C compiler flags of the stock makefile, so it's strange it'd say the argument is unknown. Being said, this is mostly irrelevant as even the base C project will not compile on its own so any errors I get from Swift are likely erroneous in themselves.
I made sure to follow the instructions for installing dkp-pacman and the 3DS sdk & examples. I also made sure $DEVKITPRO & $DEVKITARM are properly set in my .zprofile for zsh.