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>
This commit is contained in:
Damien George
2025-07-22 14:32:01 +10:00
parent cbc6aed8fa
commit bba15e0a0b
4 changed files with 20 additions and 0 deletions

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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