summaryrefslogtreecommitdiff
path: root/core/cortex-m0/build.mk
diff options
context:
space:
mode:
Diffstat (limited to 'core/cortex-m0/build.mk')
-rw-r--r--core/cortex-m0/build.mk14
1 files changed, 10 insertions, 4 deletions
diff --git a/core/cortex-m0/build.mk b/core/cortex-m0/build.mk
index 7de8956a4d..f3cce27eea 100644
--- a/core/cortex-m0/build.mk
+++ b/core/cortex-m0/build.mk
@@ -6,6 +6,14 @@
# Cortex-M0 core OS files build
#
+# When set to 1, exclusively use builtins from compiler-rt.
+# When set to 0, use EC's builtins.
+USE_LLVM_COMPILER_RT:=0
+
+ifeq ($(USE_LLVM_COMPILER_RT),1)
+CFLAGS_CPU+=-DUSE_LLVM_COMPILER_RT
+endif
+
# CPU specific compilation flags
CFLAGS_CPU+=-mthumb
ifeq ($(cc-name),clang)
@@ -24,14 +32,12 @@ LDFLAGS_EXTRA+=-flto
endif
core-y=cpu.o debug.o init.o thumb_case.o mula.o
-# When using clang, we get these as builtins from compiler-rt.
-ifneq ($(cc-name),clang)
+ifeq ($(USE_LLVM_COMPILER_RT),0)
core-y+=div.o lmul.o ldivmod.o uldivmod.o
endif
core-y+=vecttable.o
-# When using clang, we get these as builtins from compiler-rt.
-ifneq ($(cc-name),clang)
+ifeq ($(USE_LLVM_COMPILER_RT),0)
core-y+=__builtin.o
endif
core-$(CONFIG_COMMON_PANIC_OUTPUT)+=panic.o