summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDamien George <damien@micropython.org>2025-07-22 14:32:01 +1000
committerDamien George <damien@micropython.org>2025-07-24 14:01:45 +1000
commitbba15e0a0bf72d03b74610e9a37ac79ffbdacd1a (patch)
tree78b97de0abee9c1839c35d2aaf01de58ac5b7d1d
parentcbc6aed8facf8fea2eceb59b0e801f33038f1897 (diff)
examples/natmod: Use LINK_RUNTIME=1 when building for armv6m.
To get division helper functions, eg `__aeabi_uidiv`, `__aeabi_idiv` and `__aeabi_uidivmod`. Signed-off-by: Damien George <damien@micropython.org>
-rw-r--r--examples/natmod/btree/Makefile5
-rw-r--r--examples/natmod/deflate/Makefile5
-rw-r--r--examples/natmod/framebuf/Makefile5
-rw-r--r--examples/natmod/re/Makefile5
4 files changed, 20 insertions, 0 deletions
diff --git a/examples/natmod/btree/Makefile b/examples/natmod/btree/Makefile
index bcaa7a93d..1910c67c1 100644
--- a/examples/natmod/btree/Makefile
+++ b/examples/natmod/btree/Makefile
@@ -39,6 +39,11 @@ endif
# Use our own errno implementation if Picolibc is used
CFLAGS += -D__PICOLIBC_ERRNO_FUNCTION=__errno
+ifeq ($(ARCH),armv6m)
+# Link with libgcc.a for division helper functions
+LINK_RUNTIME = 1
+endif
+
include $(MPY_DIR)/py/dynruntime.mk
# btree needs gnu99 defined
diff --git a/examples/natmod/deflate/Makefile b/examples/natmod/deflate/Makefile
index 1f63de20d..5823aa4d4 100644
--- a/examples/natmod/deflate/Makefile
+++ b/examples/natmod/deflate/Makefile
@@ -10,6 +10,11 @@ SRC = deflate.c
# Architecture to build for (x86, x64, armv7m, xtensa, xtensawin, rv32imc)
ARCH ?= x64
+ifeq ($(ARCH),armv6m)
+# Link with libgcc.a for division helper functions
+LINK_RUNTIME = 1
+endif
+
ifeq ($(ARCH),xtensa)
# Link with libm.a and libgcc.a from the toolchain
LINK_RUNTIME = 1
diff --git a/examples/natmod/framebuf/Makefile b/examples/natmod/framebuf/Makefile
index cb821736e..35453c0bb 100644
--- a/examples/natmod/framebuf/Makefile
+++ b/examples/natmod/framebuf/Makefile
@@ -10,6 +10,11 @@ SRC = framebuf.c
# Architecture to build for (x86, x64, armv7m, xtensa, xtensawin)
ARCH ?= x64
+ifeq ($(ARCH),armv6m)
+# Link with libgcc.a for division helper functions
+LINK_RUNTIME = 1
+endif
+
ifeq ($(ARCH),xtensa)
MPY_EXTERN_SYM_FILE=$(MPY_DIR)/ports/esp8266/boards/eagle.rom.addr.v6.ld
endif
diff --git a/examples/natmod/re/Makefile b/examples/natmod/re/Makefile
index 56b08b988..6535693dc 100644
--- a/examples/natmod/re/Makefile
+++ b/examples/natmod/re/Makefile
@@ -10,4 +10,9 @@ SRC = re.c
# Architecture to build for (x86, x64, armv7m, xtensa, xtensawin, rv32imc)
ARCH = x64
+ifeq ($(ARCH),armv6m)
+# Link with libgcc.a for division helper functions
+LINK_RUNTIME = 1
+endif
+
include $(MPY_DIR)/py/dynruntime.mk