From 71b1689407e1821c68d46b685cf84f22603eda09 Mon Sep 17 00:00:00 2001 From: Benjamin Valentin Date: Tue, 15 Nov 2022 15:28:54 +0100 Subject: [PATCH 1/2] makefiles/cflags.inc.mk: don't include absolute path in __FILE__ macro --- makefiles/arch/avr8.inc.mk | 1 + makefiles/cflags.inc.mk | 3 +++ 2 files changed, 4 insertions(+) diff --git a/makefiles/arch/avr8.inc.mk b/makefiles/arch/avr8.inc.mk index ef55b40af316..c51c07610058 100644 --- a/makefiles/arch/avr8.inc.mk +++ b/makefiles/arch/avr8.inc.mk @@ -38,6 +38,7 @@ 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 diff --git a/makefiles/cflags.inc.mk b/makefiles/cflags.inc.mk index 55a0e0cf1573..33d48d026dc0 100644 --- a/makefiles/cflags.inc.mk +++ b/makefiles/cflags.inc.mk @@ -95,6 +95,9 @@ OPTIONAL_CFLAGS += -Wformat=2 OPTIONAL_CFLAGS += -Wformat-overflow OPTIONAL_CFLAGS += -Wformat-truncation +# Don't include absolute path in __FILE__ macro +OPTIONAL_CFLAGS += -fmacro-prefix-map=$(RIOTBASE)/= + # Warn about casts that increase alignment requirements OPTIONAL_CFLAGS += -Wcast-align From 5b359108f74922d7fb492b358c4eed33fa35cc5d Mon Sep 17 00:00:00 2001 From: Benjamin Valentin Date: Tue, 15 Nov 2022 20:39:49 +0100 Subject: [PATCH 2/2] cpu/esp8266: blacklist -fmacro-prefix-map This requires at least GCC 8 --- cpu/esp8266/Makefile.include | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cpu/esp8266/Makefile.include b/cpu/esp8266/Makefile.include index daa32a61cd6d..e700943bddad 100644 --- a/cpu/esp8266/Makefile.include +++ b/cpu/esp8266/Makefile.include @@ -52,3 +52,5 @@ LINKFLAGS += -Tesp8266.peripherals.ld LINKFLAGS += -Wl,-wrap=pp_attach LINKFLAGS += -Wl,-wrap=pm_attach + +OPTIONAL_CFLAGS_BLACKLIST += -fmacro-prefix-map=$(RIOTBASE)/=