From 4ab86b8d50e2c5852f6e2a702a3af98ad01b521a Mon Sep 17 00:00:00 2001 From: zhuzeitou Date: Thu, 11 Jul 2024 10:31:21 +0800 Subject: [PATCH] fix cross compile from darwin arm64 to x86_64 (#3716) --- build/platform-darwin.mk | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/build/platform-darwin.mk b/build/platform-darwin.mk index 4c7dac616..fd8cd203c 100644 --- a/build/platform-darwin.mk +++ b/build/platform-darwin.mk @@ -23,8 +23,12 @@ endif ifeq ($(ASM_ARCH), x86) ASMFLAGS += -DPREFIX ifeq ($(ARCH), x86_64) +CFLAGS += -arch x86_64 +LDFLAGS += -arch x86_64 ASMFLAGS += -f macho64 else +CFLAGS += -arch i386 +LDFLAGS += -arch i386 ASMFLAGS += -f macho LDFLAGS += -read_only_relocs suppress endif