From 36ac81211454abd4a97c139c45a16f5156fd02cb Mon Sep 17 00:00:00 2001 From: Fotis Panagiotopoulos Date: Thu, 11 May 2023 14:21:23 +0300 Subject: [PATCH] sim: Fixes the following linker warning: ld: warning: arch_setjmp_x86_64.o: missing .note.GNU-stack section implies executable stack ld: NOTE: This behaviour is deprecated and will be removed in a future version of the linker /usr/bin/ld: warning: nuttx.rel: requires executable stack (because the .note.GNU-stack section is executable) The linker is instructed to make the stack non-executable with the switch: `-z noexecstack`. More information can be found here: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=ffcf9c5700e49c0aee42dcba9a12ba21338e8136 --- boards/sim/sim/sim/scripts/Make.defs | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/boards/sim/sim/sim/scripts/Make.defs b/boards/sim/sim/sim/scripts/Make.defs index 53b54048e67..e530684c69a 100644 --- a/boards/sim/sim/sim/scripts/Make.defs +++ b/boards/sim/sim/sim/scripts/Make.defs @@ -181,6 +181,10 @@ CXXFLAGS := $(ARCHOPTIMIZATION) $(ARCHCXXFLAGS) $(ARCHXXINCLUDES) $(ARCHDEFINES) CPPFLAGS := $(ARCHINCLUDES) $(ARCHDEFINES) $(EXTRAFLAGS) AFLAGS := $(CFLAGS) -D__ASSEMBLY__ +ifneq ($(CONFIG_HOST_MACOS),y) + LDLINKFLAGS += -z noexecstack +endif + ifeq ($(CONFIG_LIBCXX),y) ifeq ($(CONFIG_HOST_MACOS),y) # macOS uses libc++abi