1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-01-17 04:52:59 +01:00

makefiles/gnu.inc.mk: set flags based on compiler version

This commit is contained in:
Benjamin Valentin 2022-11-18 23:29:12 +01:00
parent e1aa925c35
commit b30efeeb65
3 changed files with 8 additions and 3 deletions

View File

@ -52,5 +52,3 @@ LINKFLAGS += -Tesp8266.peripherals.ld
LINKFLAGS += -Wl,-wrap=pp_attach
LINKFLAGS += -Wl,-wrap=pm_attach
OPTIONAL_CFLAGS_BLACKLIST += -fmacro-prefix-map=$(RIOTBASE)/=

View File

@ -38,7 +38,6 @@ endif
OPTIONAL_CFLAGS_BLACKLIST += -Wformat-overflow
OPTIONAL_CFLAGS_BLACKLIST += -Wformat-truncation
OPTIONAL_CFLAGS_BLACKLIST += -gz
OPTIONAL_CFLAGS_BLACKLIST += -fmacro-prefix-map=$(RIOTBASE)/=
ifeq ($(TOOLCHAIN),gnu)
# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105523

View File

@ -22,5 +22,13 @@ endif
# Default to the native (g)objdump, helps when using toolchain from docker
_OBJDUMP := $(or $(shell command -v $(PREFIX)objdump || command -v gobjdump),objdump)
OBJDUMP ?= $(_OBJDUMP)
GCC_VERSION := $(shell $(CC) -dumpversion | cut -d . -f 1)
# -fmacro-prefix-map requires GCC 8
ifneq (8, $(firstword $(shell echo 8 $(GCC_VERSION) | tr ' ' '\n' | sort -n))))
OPTIONAL_CFLAGS_BLACKLIST += -fmacro-prefix-map=$(RIOTBASE)/=
endif
# We use GDB for debugging
include $(RIOTMAKE)/tools/gdb.inc.mk