From 1878da228d3e96f86f7130d942801e98e03ddc84 Mon Sep 17 00:00:00 2001 From: Kevin O'Connor Date: Sun, 23 Apr 2017 19:42:38 -0400 Subject: [PATCH] build: Add workaround to suppress broken avr-gcc "misspelled" warnings Detect avr gcc v4.8.1 and then disable warnings during the klipper.o linking to suppress bogus "misspelled signal handler" warnings. Signed-off-by: Kevin O'Connor --- Makefile | 2 +- docs/Installation.md | 3 --- src/avr/Makefile | 3 +++ 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 14b0c20e..9533e85a 100644 --- a/Makefile +++ b/Makefile @@ -83,7 +83,7 @@ $(OUT)declfunc.lds: src/declfunc.lds.S $(OUT)klipper.o: $(patsubst %.c, $(OUT)src/%.o,$(src-y)) $(OUT)declfunc.lds @echo " Linking $@" - $(Q)$(CC) $(CFLAGS) -Wl,-r -Wl,-T,$(OUT)declfunc.lds -nostdlib $(patsubst %.c, $(OUT)src/%.o,$(src-y)) -o $@ + $(Q)$(CC) $(CFLAGS) $(CFLAGS_klipper.o) -Wl,-r -Wl,-T,$(OUT)declfunc.lds -nostdlib $(patsubst %.c, $(OUT)src/%.o,$(src-y)) -o $@ $(OUT)compile_time_request.o: $(OUT)klipper.o ./scripts/buildcommands.py @echo " Building $@" diff --git a/docs/Installation.md b/docs/Installation.md index b16ca436..41174c3c 100644 --- a/docs/Installation.md +++ b/docs/Installation.md @@ -49,9 +49,6 @@ configured, run: make ``` -Ignore any warnings you may see about "misspelled signal handler" (it -is due to a bug fixed in gcc v4.8.3). - Installing Klipper on an AVR micro-controller --------------------------------------------- diff --git a/src/avr/Makefile b/src/avr/Makefile index 4e6631b5..ee3da1b5 100644 --- a/src/avr/Makefile +++ b/src/avr/Makefile @@ -13,6 +13,9 @@ src-$(CONFIG_AVR_WATCHDOG) += avr/watchdog.c src-$(CONFIG_AVR_USBSERIAL) += avr/usbserial.c ../lib/pjrc_usb_serial/usb_serial.c src-$(CONFIG_AVR_SERIAL) += avr/serial.c +# Suppress broken "misspelled signal handler" warnings on gcc 4.8.1 +CFLAGS_klipper.o := $(if $(filter 4.8.1, $(shell $(CC) -dumpversion)), -w) + # Build the additional hex output file target-y += $(OUT)klipper.elf.hex