From 7545a321b0043c682cb196a6dbe592e363925b38 Mon Sep 17 00:00:00 2001 From: Karl Palsson Date: Tue, 16 Feb 2016 09:47:17 +0000 Subject: [PATCH] cortex-m7: improve compiler detection Recent debian testing and ubuntu 15.10 releases contain a gcc-arm-none-eabi toolchain that returns 0 for the test with -mcpu and -fsyntax-only, despite not actually supporting cortex-m7. They then failed hard on actual compilation steps. Use the --help=target output instead. tested with old g-a-e 4.7 and newer releases. --- lib/stm32/f7/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/stm32/f7/Makefile b/lib/stm32/f7/Makefile index a543d3e7..db0d8886 100644 --- a/lib/stm32/f7/Makefile +++ b/lib/stm32/f7/Makefile @@ -56,7 +56,7 @@ Your toolchain doesn't support -mcpu=cortex-m7. Please use gcc-arm-embedded 4.8 2014q3 or newer. Skipping this sub-library. endef -ifneq ($(shell $(CC) -fsyntax-only -mcpu=cortex-m7 -mthumb -xc /dev/null 2>&1; echo $$?),0) +ifneq ($($(CC) --help=target | grep -q '\'; echo $$?),0) $(warning $(MISSING_CPU)) all clean: