Skip to content

Commit bba15e0

Browse files
committed
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 <[email protected]>
1 parent cbc6aed commit bba15e0

File tree

4 files changed

+20
-0
lines changed

4 files changed

+20
-0
lines changed

examples/natmod/btree/Makefile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,11 @@ endif
3939
# Use our own errno implementation if Picolibc is used
4040
CFLAGS += -D__PICOLIBC_ERRNO_FUNCTION=__errno
4141

42+
ifeq ($(ARCH),armv6m)
43+
# Link with libgcc.a for division helper functions
44+
LINK_RUNTIME = 1
45+
endif
46+
4247
include $(MPY_DIR)/py/dynruntime.mk
4348

4449
# btree needs gnu99 defined

examples/natmod/deflate/Makefile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@ SRC = deflate.c
1010
# Architecture to build for (x86, x64, armv7m, xtensa, xtensawin, rv32imc)
1111
ARCH ?= x64
1212

13+
ifeq ($(ARCH),armv6m)
14+
# Link with libgcc.a for division helper functions
15+
LINK_RUNTIME = 1
16+
endif
17+
1318
ifeq ($(ARCH),xtensa)
1419
# Link with libm.a and libgcc.a from the toolchain
1520
LINK_RUNTIME = 1

examples/natmod/framebuf/Makefile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@ SRC = framebuf.c
1010
# Architecture to build for (x86, x64, armv7m, xtensa, xtensawin)
1111
ARCH ?= x64
1212

13+
ifeq ($(ARCH),armv6m)
14+
# Link with libgcc.a for division helper functions
15+
LINK_RUNTIME = 1
16+
endif
17+
1318
ifeq ($(ARCH),xtensa)
1419
MPY_EXTERN_SYM_FILE=$(MPY_DIR)/ports/esp8266/boards/eagle.rom.addr.v6.ld
1520
endif

examples/natmod/re/Makefile

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,9 @@ SRC = re.c
1010
# Architecture to build for (x86, x64, armv7m, xtensa, xtensawin, rv32imc)
1111
ARCH = x64
1212

13+
ifeq ($(ARCH),armv6m)
14+
# Link with libgcc.a for division helper functions
15+
LINK_RUNTIME = 1
16+
endif
17+
1318
include $(MPY_DIR)/py/dynruntime.mk

0 commit comments

Comments
 (0)