1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

Merge pull request #18935 from benpicco/makefiles/gnu-version

makefiles/gnu.inc.mk: set flags based on compiler version
This commit is contained in:
Marian Buschsieweke 2022-11-20 08:11:57 +01:00 committed by GitHub
commit 6b759c2a7d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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