Skip to content

Commit 887125f

Browse files
agattidpgeorge
authored andcommitted
examples/natmod/deflate: Fix build for Xtensa.
This commit provides the appropriate external symbol addresses to let the "deflate" example natmod build for the Xtensa platform. Unlike other natmods that require an external symbol list to build without bringing in the whole runtime libraries set, this natmod is referencing the `__modsi3` symbol which was removed from the ESP8266's SDK but not present in ROM. The latter only has a `__umodsi3` implementation that only operates on unsigned values, and thus unable to handle this natmod. Thus, the extended library resolution process is enabled for this natmod as a `__modsi3` implementation is made available that way (still using ROM symbols whenever possible). This also means that symbols that appear in both ROM and external libraries sort of co-exist in the final MPY file, with ROM symbols being used by natmod code but the implementation from the library still exists in the final MPY file, unused. Signed-off-by: Alessandro Gatti <a.gatti@frob.it>
1 parent 462ee12 commit 887125f

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

examples/natmod/deflate/Makefile

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,12 @@ MOD = deflate_$(ARCH)
88
SRC = deflate.c
99

1010
# Architecture to build for (x86, x64, armv7m, xtensa, xtensawin, rv32imc)
11-
ARCH = x64
11+
ARCH ?= x64
12+
13+
ifeq ($(ARCH),xtensa)
14+
# Link with libm.a and libgcc.a from the toolchain
15+
LINK_RUNTIME = 1
16+
MPY_EXTERN_SYM_FILE=$(MPY_DIR)/ports/esp8266/boards/eagle.rom.addr.v6.ld
17+
endif
1218

1319
include $(MPY_DIR)/py/dynruntime.mk

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy