From 358636045e9b982f7120f5aa439b6a6bc917e07f Mon Sep 17 00:00:00 2001 From: Marian Buschsieweke Date: Sat, 20 May 2023 22:45:37 +0200 Subject: [PATCH] pkg/micro-ecc: blacklist LLVM LLVM was already blacklisted for some specific Cortex-M targets due to register allocation failing. The issue now has spread. Rather than starting a whack-a-mole game, let's disable LLVM altogether for that package. --- pkg/micro-ecc/Makefile | 6 ++++++ pkg/micro-ecc/Makefile.include | 7 ++----- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/pkg/micro-ecc/Makefile b/pkg/micro-ecc/Makefile index 237161a208..7bbf9aeda5 100644 --- a/pkg/micro-ecc/Makefile +++ b/pkg/micro-ecc/Makefile @@ -5,5 +5,11 @@ PKG_LICENSE=BSD-2-Clause include $(RIOTBASE)/pkg/pkg.mk +# With LLVM register allocation fails. We can tell LLVM to spend more time +# on trying to allocate registers using the following snippet: +ifeq (llvm,$(TOOLCHAIN)) + CFLAGS += -mllvm -exhaustive-register-search +endif + all: $(QQ)"$(MAKE)" -C $(PKG_SOURCE_DIR) -f $(RIOTBASE)/Makefile.base diff --git a/pkg/micro-ecc/Makefile.include b/pkg/micro-ecc/Makefile.include index e63b996ddd..4d6987be64 100644 --- a/pkg/micro-ecc/Makefile.include +++ b/pkg/micro-ecc/Makefile.include @@ -4,8 +4,5 @@ CFLAGS += -Wno-unused-parameter CFLAGS += -Wno-unused-function CFLAGS += -Wno-unused-variable -ifneq (,$(filter cortex-m0%,$(CPU_CORE))) - # LLVM/clang can't handle the inline assembler instructions on M0 in this - # package - TOOLCHAINS_BLACKLIST += llvm -endif +# llvm fails to allocate registers for inline assembly :/ +TOOLCHAINS_BLACKLIST += llvm