From 656aca0cefd3c5c512109341398451dbcb0d000a Mon Sep 17 00:00:00 2001 From: Jack Arthur Harrhy Date: Sun, 5 Apr 2026 15:47:55 -0400 Subject: [PATCH 1/2] Add macOS aarch64 (Apple Silicon) build support - Add __aarch64__ and __arm__ cases to the macOS architecture block in q_platform.h (the existing aarch64 support was only in the Linux block) - Normalize arm/arm64 to aarch64 in the Makefile since uname -p returns 'arm' on Apple Silicon - Only set HAVE_VM_COMPILED on architectures that have a bytecode compiler (x86, x86_64, ppc, ppc64) so aarch64 falls back to the interpreter - Add -arch arm64 optimization flag for darwin/aarch64 --- Makefile | 14 +++++++++++++- code/qcommon/q_platform.h | 6 ++++++ 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index a26fc79599..fef6878726 100644 --- a/Makefile +++ b/Makefile @@ -80,6 +80,13 @@ ifeq ($(COMPILE_ARCH),axp) COMPILE_ARCH=alpha endif +ifeq ($(COMPILE_ARCH),arm) + COMPILE_ARCH=aarch64 +endif +ifeq ($(COMPILE_ARCH),arm64) + COMPILE_ARCH=aarch64 +endif + ifndef ARCH ARCH=$(COMPILE_ARCH) endif @@ -458,7 +465,9 @@ else # ifeq Linux ############################################################################# ifeq ($(PLATFORM),darwin) - HAVE_VM_COMPILED=true + ifneq ($(findstring $(ARCH),x86 x86_64 ppc ppc64),) + HAVE_VM_COMPILED=true + endif LIBS = -framework Cocoa CLIENT_LIBS= RENDERER_LIBS= @@ -482,6 +491,9 @@ ifeq ($(PLATFORM),darwin) ifeq ($(ARCH),x86_64) OPTIMIZEVM += -arch x86_64 -mfpmath=sse endif + ifeq ($(ARCH),aarch64) + OPTIMIZEVM += -arch arm64 + endif # When compiling on OSX for OSX, we're not cross compiling as far as the # Makefile is concerned, as target architecture is specified as a compiler diff --git a/code/qcommon/q_platform.h b/code/qcommon/q_platform.h index 674b0eff22..6617b4a92e 100644 --- a/code/qcommon/q_platform.h +++ b/code/qcommon/q_platform.h @@ -161,6 +161,12 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA #define idx64 1 #define ARCH_STRING "x86_64" #define Q3_LITTLE_ENDIAN +#elif defined __aarch64__ +#define ARCH_STRING "aarch64" +#define Q3_LITTLE_ENDIAN +#elif defined __arm__ +#define ARCH_STRING "arm" +#define Q3_LITTLE_ENDIAN #endif #define DLL_EXT ".dylib" From b9a28bcddf4d380a6874f7cc922e58ec2fb92c34 Mon Sep 17 00:00:00 2001 From: Jack Arthur Harrhy Date: Sun, 5 Apr 2026 15:48:02 -0400 Subject: [PATCH 2/2] Skip stale PID dialog on macOS The Sys_Dialog call that prompts about safe video settings after an abnormal exit uses NSAlert on macOS, which can block indefinitely when called before the window server connection is fully established. This leaves the process hung with no visible UI. Skip the dialog on macOS while preserving it on other platforms. --- code/qcommon/common.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/qcommon/common.c b/code/qcommon/common.c index e0c0ae06b3..35ab6c77ed 100644 --- a/code/qcommon/common.c +++ b/code/qcommon/common.c @@ -2773,7 +2773,7 @@ void Com_Init( char *commandLine ) { Sys_Init(); if( Sys_WritePIDFile( ) ) { -#ifndef DEDICATED +#if !defined(DEDICATED) && !defined(MACOS_X) const char *message = "The last time " CLIENT_WINDOW_TITLE " ran, " "it didn't exit properly. This may be due to inappropriate video " "settings. Would you like to start with \"safe\" video settings?";