qemu-intel64: Fixes the linker 'noexecstack' warning

Fix the linker warning based on these two commits:

 ld: warning: fork.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

commit 36ac812114 ("sim: Fixes the following linker warning:"),
commit b5d640acc5 ("fix Cygwin/MSYS2  ld: unrecognized option '-z'")
This commit is contained in:
Haiyue Wang 2024-10-25 13:56:07 +08:00 committed by Xiang Xiao
parent da1ff4cf77
commit d0f957ae85
2 changed files with 8 additions and 0 deletions

View File

@ -83,6 +83,10 @@ if(CONFIG_DEBUG_SYMBOLS)
add_compile_options(${CONFIG_DEBUG_SYMBOLS_LEVEL})
endif()
if(CONFIG_HOST_LINUX)
add_link_options(-Wl,-z,noexecstack)
endif()
# Architecture flags
add_link_options(-Wl,--entry=__pmode_entry)

View File

@ -106,6 +106,10 @@ ifeq ($(CONFIG_DEBUG_LINK_WHOLE_ARCHIVE),y)
LDFLAGS += --whole-archive
endif
ifeq ($(CONFIG_HOST_LINUX),y)
LDFLAGS += -z noexecstack
endif
ifeq ($(CONFIG_LIBCXX),y)
# Linux C++ ABI seems vary.
# Probably __GLIBCXX__ is the best bet.