From 89d7e2ec338791dd6cb633324813077a884742eb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ga=C3=ABtan=20Harter?= Date: Thu, 15 Nov 2018 17:04:17 +0100 Subject: [PATCH] cortexm.inc.mk: detect 'arm-none-eabi-gcc' from ubuntu bionic arm-gcc version from ubuntu bionic repository is not supported in RIOT. Both when building with `gnu` and `llvm`. arm-none-eabi-gcc --version arm-none-eabi-gcc (15:6.3.1+svn253039-1build1) 6.3.1 20170620 So detect this version and print an error if found. The check is done on the building machine and not on the host when building in docker. The error can be disabled when building with WERROR=0. --- makefiles/arch/cortexm.inc.mk | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/makefiles/arch/cortexm.inc.mk b/makefiles/arch/cortexm.inc.mk index 617afc5ad2..41320039d5 100644 --- a/makefiles/arch/cortexm.inc.mk +++ b/makefiles/arch/cortexm.inc.mk @@ -43,6 +43,32 @@ export USEMODULE += newlib # set default for CPU_MODEL export CPU_MODEL ?= $(CPU) + +# extract version inside the first parentheses +ARM_GCC_VERSION = $(shell $(TARGET_ARCH)-gcc --version | sed -n '1 s/[^(]*(\([^\)]*\)).*/\1/p') + +# Ubuntu bionic gcc-arm-none-eabi compiler is not supported +# Both when using gnu and llvm toolchains +# +# /usr/bin/arm-none-eabi-gcc --version | head -n 1 +# arm-none-eabi-gcc (15:6.3.1+svn253039-1build1) 6.3.1 20170620 +# +ARM_GCC_UNSUPPORTED += 15:6.3.1% # ubuntu bionic, ignore 'svn' build part + +# Should not raise an error on the host system version when building in docker +ifneq (1,$(BUILD_IN_DOCKER)) + ifneq (,$(filter $(ARM_GCC_UNSUPPORTED),$(ARM_GCC_VERSION))) + $(warning $(TARGET_ARCH)-gcc version not supported) + $(warning $(shell $(TARGET_ARCH)-gcc --version | head -n 1)) + $(warning The currently recommanded version is the one installed in the riotdocker image) + $(warning https://github.com/RIOT-OS/riotdocker/blob/master/Dockerfile) + ifeq (1,$(WERROR)) + $(error This check can be ignored by building with 'WERROR=0') + endif # WERROR + endif # ARM_GCC_UNSUPPORTED +endif # BUILD_IN_DOCKER + + # Temporary LLVM/Clang Workaround: # report cortex-m0 instead of cortex-m0plus if llvm/clang (<= 3.6.2) is used # llvm/clang version 3.6.2 still does not support the cortex-m0plus mcpu type