From 2eeda9a1cad5b291529995200a49da55b97804a2 Mon Sep 17 00:00:00 2001 From: chrysn Date: Mon, 21 Sep 2020 13:55:45 +0200 Subject: [PATCH] makefiles: Pass explicit float mode to clang The assumption that clang defaults to hard-float on ARM architectures does not hold on Debian systems where [set-correct-float-abi]. As setting the flags that are implied on most systems does no harm, the flags for the selected hard- or soft float behavior are now set independently of the toolchain. [set-correct-float-abi]: https://salsa.debian.org/pkg-llvm-team/llvm-toolchain/-/blob/10/debian/patches/26-set-correct-float-abi.diff Closes: https://github.com/RIOT-OS/RIOT/issues/15026 --- makefiles/arch/cortexm.inc.mk | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/makefiles/arch/cortexm.inc.mk b/makefiles/arch/cortexm.inc.mk index 92c791a3ed..ac20a8e179 100644 --- a/makefiles/arch/cortexm.inc.mk +++ b/makefiles/arch/cortexm.inc.mk @@ -61,18 +61,13 @@ endif # BUILD_IN_DOCKER CFLAGS += -DCPU_MODEL_$(call uppercase_and_underscore,$(CPU_MODEL)) CFLAGS += -DCPU_CORE_$(call uppercase_and_underscore,$(CPU_CORE)) -# Add corresponding FPU CFLAGS -# clang assumes there is an FPU, no CFLAGS necessary -ifneq (llvm, $(TOOLCHAIN)) - ifeq ($(CPU_CORE),cortex-m7) - _CORTEX_HW_FPU_CFLAGS = -mfloat-abi=hard -mfpu=fpv5-sp-d16 - else - _CORTEX_HW_FPU_CFLAGS = -mfloat-abi=hard -mfpu=fpv4-sp-d16 - endif -endif # Add soft or hard FPU CFLAGS depending on the module ifneq (,$(filter cortexm_fpu,$(USEMODULE))) - CFLAGS_FPU ?= $(_CORTEX_HW_FPU_CFLAGS) + ifeq ($(CPU_CORE),cortex-m7) + CFLAGS_FPU ?= -mfloat-abi=hard -mfpu=fpv5-sp-d16 + else + CFLAGS_FPU ?= -mfloat-abi=hard -mfpu=fpv4-sp-d16 + endif else CFLAGS_FPU ?= -mfloat-abi=soft endif