Skip to content

Commit

Permalink
makefiles/gnu.inc.mk: set flags based on compiler version
Browse files Browse the repository at this point in the history
  • Loading branch information
benpicco committed Nov 18, 2022
1 parent e1aa925 commit ca5269c
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
2 changes: 0 additions & 2 deletions cpu/esp8266/Makefile.include
Original file line number Diff line number Diff line change
Expand Up @@ -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)/=
1 change: 0 additions & 1 deletion makefiles/arch/avr8.inc.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 8 additions & 0 deletions makefiles/toolchain/gnu.inc.mk
Original file line number Diff line number Diff line change
Expand Up @@ -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)

# -fmacro-prefix-map requires GCC 8
ifneq (8, $(firstword $(sort $(GCC_VERSION), 8)))
OPTIONAL_CFLAGS_BLACKLIST += -fmacro-prefix-map=$(RIOTBASE)/=
endif

# We use GDB for debugging
include $(RIOTMAKE)/tools/gdb.inc.mk

0 comments on commit ca5269c

Please sign in to comment.