mirror of
https://github.com/RIOT-OS/RIOT.git
synced 2025-12-29 08:21:18 +01:00
Merge pull request #20381 from maribu/build-system/no-warn-rwx
build sytem: add `--no-warn-rwx-segments` to linker
This commit is contained in:
commit
f0d29068f5
@ -506,6 +506,15 @@ TOOLCHAINS_SUPPORTED ?= gnu
|
||||
# Import all toolchain settings
|
||||
include $(RIOTMAKE)/toolchain/$(TOOLCHAIN).inc.mk
|
||||
|
||||
# Other than on native, RWX segments in ROM are not actually RWX, as regular
|
||||
# store instructions won't write to flash.
|
||||
ifeq (,$(filter native native64,$(BOARD)))
|
||||
LINKER_SUPPORTS_NOWARNRWX ?= $(shell LC_ALL=C $(LINK) $(RIOTTOOLS)/testprogs/minimal_linkable.c -o /dev/null -lc -Wall -Wextra -pedantic -Wl,--no-warn-rwx-segments 2> /dev/null && echo 1 || echo 0)
|
||||
ifeq (1,$(LINKER_SUPPORTS_NOWARNRWX))
|
||||
LINKFLAGS += -Wl,--no-warn-rwx-segments
|
||||
endif
|
||||
endif
|
||||
|
||||
# Append ldscript path after importing CPU and board makefiles to allow
|
||||
# overriding the core ldscripts
|
||||
LINKFLAGS += -L$(RIOTBASE)/core/ldscripts
|
||||
|
||||
@ -27,14 +27,6 @@ ifeq (1,$(USE_PICOLIBC))
|
||||
CFLAGS += -DPICOLIBC_INTEGER_PRINTF_SCANF
|
||||
LINKFLAGS += -DPICOLIBC_INTEGER_PRINTF_SCANF
|
||||
endif
|
||||
# For some reason segments with RWX permissions will be created with
|
||||
# picolibc. But since (as of now) RIOT only supports disabling the execute of
|
||||
# all RAM via the `mpu_noexec_ram` module, permissions of the segments are
|
||||
# ignored anyway. So for now, we just simply disable the warning.
|
||||
LINKER_SUPPORTS_NOWARNRWX ?= $(shell LC_ALL=C $(LINK) $(RIOTTOOLS)/testprogs/minimal_linkable.c -o /dev/null -lc -Wall -Wextra -pedantic -Wl,--no-warn-rwx-segments 2> /dev/null && echo 1 || echo 0)
|
||||
ifeq (1,$(LINKER_SUPPORTS_NOWARNRWX))
|
||||
LINKFLAGS += -Wl,--no-warn-rwx-segments
|
||||
endif
|
||||
endif
|
||||
|
||||
LINKFLAGS += -lc
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user