summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlessandro Gatti <a.gatti@frob.it>2025-06-01 11:24:48 +0200
committerDamien George <damien@micropython.org>2025-06-04 22:35:39 +1000
commit4227654d4294b778b2bbba8a3b735882786b1d2d (patch)
tree015a697363f5d36cd8df50853ce5aed2dd3f1582
parent887125fc589de9ada0bc532d9bdc29a3806694c3 (diff)
examples/natmod/btree: Fix build for Xtensa.
This commit provides the appropriate external symbol addresses to let the "btree" example natmod build for the Xtensa platform. On the ESP8266, unsigned integer division code isn't provided as part of libgcc.a, libm.a, or libc.a, but it is instead provided by the ROM. Regular builds inject the appropriate symbol addresses as part of the linking process (see eagle.rom.addr.v6.ld), but natmods need this information brought in from somewhere else. Signed-off-by: Alessandro Gatti <a.gatti@frob.it>
-rw-r--r--examples/natmod/btree/Makefile6
1 files changed, 5 insertions, 1 deletions
diff --git a/examples/natmod/btree/Makefile b/examples/natmod/btree/Makefile
index ff130d61b..6273ccc65 100644
--- a/examples/natmod/btree/Makefile
+++ b/examples/natmod/btree/Makefile
@@ -8,7 +8,7 @@ MOD = btree_$(ARCH)
SRC = btree_c.c
# Architecture to build for (x86, x64, armv7m, xtensa, xtensawin, rv32imc)
-ARCH = x64
+ARCH ?= x64
BTREE_DIR = $(MPY_DIR)/lib/berkeley-db-1.xx
BERKELEY_DB_CONFIG_FILE ?= \"extmod/berkeley-db/berkeley_db_config_port.h\"
@@ -32,6 +32,10 @@ SRC += $(addprefix $(realpath $(BTREE_DIR))/,\
mpool/mpool.c \
)
+ifeq ($(ARCH),xtensa)
+MPY_EXTERN_SYM_FILE=$(MPY_DIR)/ports/esp8266/boards/eagle.rom.addr.v6.ld
+endif
+
include $(MPY_DIR)/py/dynruntime.mk
# btree needs gnu99 defined