Revert "chibios: disable RWX segment warning on newer GNU lds (#22007)" (#22469)

This reverts commit de3c42125b.
master
Nick Brassel 2023-11-14 09:41:12 +11:00 committed by GitHub
parent 1efc79063c
commit 4c625d8286
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 12 deletions

View File

@ -15,13 +15,6 @@ VPATH :=
# Helper to return the distinct elements of a list # Helper to return the distinct elements of a list
uniq = $(if $1,$(firstword $1) $(call uniq,$(filter-out $(firstword $1),$1))) uniq = $(if $1,$(firstword $1) $(call uniq,$(filter-out $(firstword $1),$1)))
cc-option = $(shell \
if $(CC) $(1) -shared -o /dev/null -xc /dev/null > /dev/null 2>&1; \
then echo "$(1)"; else echo "$(2)"; fi)
# helper to pass comma character to make functions
, := ,
# Convert all SRC to OBJ # Convert all SRC to OBJ
define OBJ_FROM_SRC define OBJ_FROM_SRC
$(patsubst %.c,$1/%.o,$(patsubst %.cpp,$1/%.o,$(patsubst %.cc,$1/%.o,$(patsubst %.S,$1/%.o,$(patsubst %.clib,$1/%.a,$($1_SRC)))))) $(patsubst %.c,$1/%.o,$(patsubst %.cpp,$1/%.o,$(patsubst %.cc,$1/%.o,$(patsubst %.S,$1/%.o,$(patsubst %.clib,$1/%.a,$($1_SRC))))))
@ -73,7 +66,9 @@ CFLAGS += $(CDEFS)
CFLAGS += -O$(OPT) CFLAGS += -O$(OPT)
# add color # add color
ifeq ($(COLOR),true) ifeq ($(COLOR),true)
CFLAGS+= $(call cc-option, -fdiagnostics-color) ifeq ("$(shell echo "int main(){}" | $(CC) -fdiagnostics-color -x c - -o /dev/null 2>&1)", "")
CFLAGS+= -fdiagnostics-color
endif
endif endif
CFLAGS += -Wall CFLAGS += -Wall
CFLAGS += -Wstrict-prototypes CFLAGS += -Wstrict-prototypes

View File

@ -12,7 +12,9 @@ HEX = $(OBJCOPY) -O $(FORMAT) -R .eeprom -R .fuse -R .lock -R .signature
EEP = $(OBJCOPY) -j .eeprom --set-section-flags=.eeprom="alloc,load" --change-section-lma .eeprom=0 --no-change-warnings -O $(FORMAT) EEP = $(OBJCOPY) -j .eeprom --set-section-flags=.eeprom="alloc,load" --change-section-lma .eeprom=0 --no-change-warnings -O $(FORMAT)
BIN = BIN =
COMPILEFLAGS += $(call cc-option, --param=min-pagesize=0) ifeq ("$(shell echo "int main(){}" | $(CC) --param=min-pagesize=0 -x c - -o /dev/null 2>&1)", "")
COMPILEFLAGS += --param=min-pagesize=0
endif
COMPILEFLAGS += -funsigned-char COMPILEFLAGS += -funsigned-char
COMPILEFLAGS += -funsigned-bitfields COMPILEFLAGS += -funsigned-bitfields

View File

@ -476,9 +476,6 @@ HEX = $(OBJCOPY) -O $(FORMAT)
EEP = EEP =
BIN = $(OBJCOPY) -O binary BIN = $(OBJCOPY) -O binary
# disable warning about RWX triggered by ChibiOS linker scripts
SHARED_LDFLAGS += $(call cc-option, -Wl$(,)--no-warn-rwx-segments)
############################################################################## ##############################################################################
# Make targets # Make targets
# #