From 39d02c178d56ca58ea3cab73a6203a4011303407 Mon Sep 17 00:00:00 2001 From: Zack Middleton Date: Sun, 24 Oct 2021 04:38:34 -0400 Subject: [PATCH] Fix compiling on older macOS ranlib errors on older macOS because of arm64 arch in code/libs/macosx/- libSDL2main.a. Use lipo to extract the library for the specific arch that is being linked. --- Makefile | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Makefile b/Makefile index f54ebe8d2..8be991c97 100644 --- a/Makefile +++ b/Makefile @@ -375,6 +375,7 @@ ifeq ($(PLATFORM),darwin) CC=$(MACOSX_ARCH)-apple-darwin$(DARWIN)-cc RANLIB=$(MACOSX_ARCH)-apple-darwin$(DARWIN)-ranlib + LIPO=$(MACOSX_ARCH)-apple-darwin$(DARWIN)-lipo ifeq ($(call bin_path, $(CC)),) $(error Unable to find osxcross $(CC)) @@ -382,6 +383,10 @@ ifeq ($(PLATFORM),darwin) endif endif + ifndef LIPO + LIPO=lipo + endif + BASE_CFLAGS += -fno-strict-aliasing -fno-common -pipe BASE_CFLAGS += -D_THREAD_SAFE=1