From 14edf1385c3e59b99f7ecc8577465138a26d5b57 Mon Sep 17 00:00:00 2001 From: YAMAMOTO Takashi Date: Mon, 16 Dec 2024 21:05:57 +0900 Subject: [PATCH] sim: Fix build errors on macOS macOS 15.2 x86-64 Xcode 16.1 ``` ld: warning: disabling chained fixups because of unaligned pointers ld: illegal text-relocation in '_main'+0x1F (/Users/yamamoto/git/nuttx/nuttx/arc h/sim/src/nuttx.rel) to '_g_argc' ``` --- boards/sim/sim/sim/scripts/Make.defs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/boards/sim/sim/sim/scripts/Make.defs b/boards/sim/sim/sim/scripts/Make.defs index 90d3827424..4260f093dd 100644 --- a/boards/sim/sim/sim/scripts/Make.defs +++ b/boards/sim/sim/sim/scripts/Make.defs @@ -149,8 +149,13 @@ ifeq ($(CONFIG_SIM_M32),y) ARCHCFLAGS += -m32 ARCHCXXFLAGS += -m32 else - ARCHCFLAGS += -fno-pic -mcmodel=medium - ARCHCXXFLAGS += -fno-pic -mcmodel=medium + ifeq ($(CONFIG_HOST_MACOS),y) + ARCHCFLAGS += -fno-pic + ARCHCXXFLAGS += -fno-pic + else + ARCHCFLAGS += -fno-pic -mcmodel=medium + ARCHCXXFLAGS += -fno-pic -mcmodel=medium + endif endif # LLVM style architecture flags