From 855380ee3a54d0ea6ee499a5fec9e9d7f3810c89 Mon Sep 17 00:00:00 2001 From: Marian Buschsieweke Date: Sat, 20 May 2023 19:53:38 +0200 Subject: [PATCH] pkg/openthread: fix compilation with LLVM --- pkg/openthread/Makefile | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/pkg/openthread/Makefile b/pkg/openthread/Makefile index 0a60a971d3..1bdd7dcbf3 100644 --- a/pkg/openthread/Makefile +++ b/pkg/openthread/Makefile @@ -26,15 +26,26 @@ endif OT_COAP ?= ON OT_C_FLAGS = $(CFLAGS_CPU) -OT_C_FLAGS += -fdata-sections -ffunction-sections -Os -OT_C_FLAGS += -Wno-implicit-fallthrough -Wno-unused-parameter -OT_CXXFLAGS += -Wno-class-memaccess -DOPENTHREAD_TARGET_RIOT +OT_C_FLAGS += -fdata-sections +OT_C_FLAGS += -ffunction-sections -Os +OT_C_FLAGS += -ffunction-sections +OT_C_FLAGS += -fshort-enums +OT_C_FLAGS += -Wno-implicit-fallthrough +OT_C_FLAGS += -Wno-unused-parameter +OT_CXXFLAGS += -Wno-class-memaccess +OT_CXXFLAGS += -DOPENTHREAD_TARGET_RIOT OT_MODULES_ARCHIVES = $(addsuffix .a,$(addprefix $(BINDIR)/,$(OT_MODULES))) OT_CORE_LIB_DIR = $(PKG_BUILD_DIR)/src/core OT_CLI_LIB_DIR = $(PKG_BUILD_DIR)/src/cli OT_MBEDCRYPTO_LIB_DIR = $(PKG_BUILD_DIR)/third_party/mbedtls/repo/library +ifeq (llvm,$(TOOLCHAIN)) + OT_C_FLAGS += -target $(TARGET_ARCH_LLVM) + OT_C_FLAGS += $(GCC_C_INCLUDES) + OT_CXXFLAGS += $(GCC_CXX_INCLUDES) +endif + all: $(OT_MODULES_ARCHIVES) @: