RetroAchievements / RALibretro

RALibretro is a multi-emulator used to develop RetroAchievements.
https://retroachievements.org
GNU General Public License v3.0
177 stars 35 forks source link

Building for Arm64? Suggestions of editing Makefile #369

Closed retropieuser closed 1 year ago

retropieuser commented 1 year ago

I can see the Makefile was edited to run arm64 so I can run this on my Apple Silicon Mac. Has anyone got any ideas what I'd need to change the flags to? I'm guessing it's only the CC,CXX and RC flags?

Jamiras commented 1 year ago

I'm not sure where you saw anything related to arm64. The only references I find with a recursive grep are in the lzma submodule of the libchdr submodule:

$ grep -rnI arm64 *
src/libchdr/deps/lzma-19.00/include/CpuArch.h:47:  #define MY_CPU_NAME "arm64"
src/libchdr/deps/lzma-19.00/lzma-history.txt:21:   - the makefiles now use "PLATFORM" macroname with values (x64, x86, arm64)
src/libchdr/deps/lzma-22.01/include/CpuArch.h:54:  #define MY_CPU_NAME "arm64"
src/libchdr/deps/lzma-22.01/lzma-history.txt:43:- The speed for LZMA and LZMA2 decompression in arm64 versions for macOS and Linux
src/libchdr/deps/lzma-22.01/lzma-history.txt:95:   - the makefiles now use "PLATFORM" macroname with values (x64, x86, arm64)
src/libchdr/deps/lzma-22.01/lzma-sdk.txt:79:2) arm64: GNU assembler for ARM64 with preprocessor.
src/libchdr/deps/lzma-22.01/lzma-sdk.txt:80:   That systax of that arm64 assembler code in 7-Zip is supported by GCC and CLANG for ARM64.
src/libchdr/deps/lzma-22.01/lzma-sdk.txt:108:To compile 7-Zip for arm64 with assembler:
src/libchdr/deps/lzma-22.01/lzma-sdk.txt:109:  make -j -f ../../cmpl_gcc_arm64.mak
src/libchdr/deps/lzma-22.01/lzma-sdk.txt:111:To compile 7-Zip for arm64 for macOS:
src/libchdr/deps/lzma-22.01/lzma-sdk.txt:112:  make -j -f ../../cmpl_mac_arm64.mak
src/libchdr/deps/lzma-22.01/src/Asm/arm64/7zAsm.S:1:// 7zAsm.S -- ASM macros for arm64
src/libchdr/deps/lzma-22.01/src/Asm/arm64/7zAsm.S:103:arm64 and arm use reverted c flag after subs/cmp instructions:
src/libchdr/deps/lzma-22.01/src/Asm/arm64/7zAsm.S:104:  arm64-arm   :     x86
src/libchdr/deps/lzma-22.01/src/LzFind.c:546:    #include <arm64_neon.h>
src/libchdr/deps/lzma-22.01/src/var_clang_arm64.mak:1:PLATFORM=arm64
src/libchdr/deps/lzma-22.01/src/var_gcc_arm64.mak:1:PLATFORM=arm64
src/libchdr/deps/lzma-22.01/src/var_mac_arm64.mak:1:PLATFORM=arm64
src/libchdr/deps/lzma-22.01/src/var_mac_arm64.mak:7:MY_ARCH=-arch arm64

You should be able to build RAHasher on your Mac using make -f Makefile.RAHasher, but RALibretro itself is still Windows only because the tool DLL is Windows only.

retropieuser commented 1 year ago

Ahh so the Linux build is strictly to run the program through wine or something similar even if it does build as such? Guess makes sense why there isn't much worth building it on Mac if I'm just building the windows version anway