From e5ac1c620e493e9d5533f2824576e0a5760759cb Mon Sep 17 00:00:00 2001 From: YAMAMOTO Takashi Date: Mon, 16 Dec 2024 22:26:31 +0900 Subject: [PATCH] sim: Disable chained fixups for sim_macho_init.c This is a workaround for https://github.com/apache/nuttx/issues/15208 Tested with: macOS 15.2 x86-64 Xcode 16.2 --- arch/sim/src/Makefile | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/arch/sim/src/Makefile b/arch/sim/src/Makefile index a0fd93e1b5..280bb45cae 100644 --- a/arch/sim/src/Makefile +++ b/arch/sim/src/Makefile @@ -133,6 +133,13 @@ ifeq ($(CONFIG_HAVE_CXXINITIALIZE),y) # the place in the object list for linking. Namely, its constructor # should be the first one in the executable. HEADSRC = sim_macho_init.c + + # sim_macho_init.c is not compatible with chained fixups. + # cf. https://github.com/apache/nuttx/issues/15208 + ifeq ($(shell $(LD) -ld_classic -no_fixup_chains 2>&1 | grep "unknown option"),) + LDLINKFLAGS += -ld_classic -no_fixup_chains + LDFLAGS += -Wl,-ld_classic,-no_fixup_chains + endif endif else STDLIBS += -lrt