sim: Disable stack protector for CMODULEFLAGS

On Linux, we (ab)use the host compiler to compile binaries for NuttX.
Explicitly disable features which might be default on the host while
not available on NuttX.

On macOS, this is not necessary because we use a cross compiler,
which has safer defaults for our purpose, to build binaries to
run on NuttX. But this doesn't hurt either.
This commit is contained in:
YAMAMOTO Takashi 2020-07-01 13:44:42 +09:00 committed by Xiang Xiao
parent b8b2ac4f2c
commit 028d0c0d15
2 changed files with 8 additions and 0 deletions

View File

@ -88,6 +88,10 @@ CMODULEFLAGS += -fno-pic
# Even on Linux, NuttX modules are loaded into the NuttX heap, which
# can be out of range with -mcmodel=small.
CMODULEFLAGS += -mcmodel=large
# On Linux, we (ab)use the host compiler to compile binaries for NuttX.
# Explicitly disable features which might be default on the host while
# not available on NuttX.
CMODULEFLAGS += -fno-stack-protector
LDMODULEFLAGS = -r -e module_initialize
ifeq ($(CONFIG_CYGWIN_WINTOOL),y)

View File

@ -83,6 +83,10 @@ CMODULEFLAGS += -fno-pic
# Even on Linux, NuttX modules are loaded into the NuttX heap, which
# can be out of range with -mcmodel=small.
CMODULEFLAGS += -mcmodel=large
# On Linux, we (ab)use the host compiler to compile binaries for NuttX.
# Explicitly disable features which might be default on the host while
# not available on NuttX.
CMODULEFLAGS += -fno-stack-protector
LDMODULEFLAGS = -r -e module_initialize
ifeq ($(CONFIG_CYGWIN_WINTOOL),y)