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 998c4e9
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 $(shell echo "8\n$(GCC_VERSION)" | sort -V))))
OPTIONAL_CFLAGS_BLACKLIST += -fmacro-prefix-map=$(RIOTBASE)/=
endif

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

0 comments on commit 998c4e9

Please sign in to comment.