You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by xi...@apache.org on 2022/11/10 03:19:49 UTC

[incubator-nuttx-apps] 01/02: interpreter/toywasm: update toywasm version

This is an automated email from the ASF dual-hosted git repository.

xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx-apps.git

commit f1e8e933c5f114a87ef4a3cd08f77bb587dcbe36
Author: YAMAMOTO Takashi <ya...@midokura.com>
AuthorDate: Wed Nov 9 21:18:38 2022 +0900

    interpreter/toywasm: update toywasm version
---
 interpreters/toywasm/Makefile                 | 18 ++++++++----------
 interpreters/toywasm/include/toywasm_config.h | 17 +++++++++++++++++
 2 files changed, 25 insertions(+), 10 deletions(-)

diff --git a/interpreters/toywasm/Makefile b/interpreters/toywasm/Makefile
index 758bce9e2..d4852ae6b 100644
--- a/interpreters/toywasm/Makefile
+++ b/interpreters/toywasm/Makefile
@@ -25,8 +25,11 @@ PRIORITY  = $(CONFIG_INTERPRETERS_TOYWASM_PRIORITY)
 STACKSIZE = $(CONFIG_INTERPRETERS_TOYWASM_STACKSIZE)
 MODULE    = $(CONFIG_INTERPRETERS_TOYWASM)
 
+# cli
 MAINSRC = main.c
+CSRCS += repl.c
 
+# lib
 CSRCS += bitmap.c
 CSRCS += cell.c
 CSRCS += context.c
@@ -42,7 +45,6 @@ CSRCS += instance.c
 CSRCS += leb128.c
 CSRCS += module.c
 CSRCS += module_writer.c
-CSRCS += repl.c
 CSRCS += report.c
 CSRCS += type.c
 CSRCS += util.c
@@ -51,21 +53,17 @@ CSRCS += vec.c
 CSRCS += wasi.c
 CSRCS += xlog.c
 
-CFLAGS += -DTOYWASM_USE_SEPARATE_EXECUTE
-CFLAGS += -DTOYWASM_USE_TAILCALL
-CFLAGS += -DTOYWASM_USE_JUMP_BINARY_SEARCH
-CFLAGS += -DTOYWASM_JUMP_CACHE2_SIZE=4
-CFLAGS += -DTOYWASM_USE_SEPARATE_LOCALS
-CFLAGS += -DTOYWASM_USE_SMALL_CELLS
-CFLAGS += -DTOYWASM_ENABLE_WRITER
+CFLAGS += ${shell $(INCDIR) "$(CC)" $(APPDIR)/interpreters/toywasm/include}
+CFLAGS += ${shell $(INCDIR) "$(CC)" $(APPDIR)/interpreters/toywasm/toywasm/lib}
 
-TOYWASM_VERSION  = de70389cd98ad6e4ce9098197b86f249a56d7053
+TOYWASM_VERSION  = 89465d57a8ad07a2e159711c92d3625bf66c41c7
 TOYWASM_UNPACK   = toywasm
 TOYWASM_TARBALL  = $(TOYWASM_VERSION).zip
 TOYWASM_URL_BASE = https://github.com/yamt/toywasm/archive/
 TOYWASM_URL      = $(TOYWASM_URL_BASE)/$(TOYWASM_TARBALL)
 
-VPATH += $(TOYWASM_UNPACK)
+VPATH += $(TOYWASM_UNPACK)/cli
+VPATH += $(TOYWASM_UNPACK)/lib
 
 $(TOYWASM_TARBALL):
 	$(Q) echo "Downloading $(TOYWASM_TARBALL)"
diff --git a/interpreters/toywasm/include/toywasm_config.h b/interpreters/toywasm/include/toywasm_config.h
new file mode 100644
index 000000000..6b553b518
--- /dev/null
+++ b/interpreters/toywasm/include/toywasm_config.h
@@ -0,0 +1,17 @@
+#if !defined(_TOYWASM_CONFIG_H)
+#define _TOYWASM_CONFIG_H
+
+#define TOYWASM_USE_SEPARATE_EXECUTE
+#define TOYWASM_USE_TAILCALL
+/* #undef TOYWASM_ENABLE_TRACING */
+#define TOYWASM_USE_JUMP_BINARY_SEARCH
+/* #undef TOYWASM_USE_JUMP_CACHE */
+#define TOYWASM_JUMP_CACHE2_SIZE 4
+#define TOYWASM_USE_LOCALS_CACHE
+#define TOYWASM_USE_SEPARATE_LOCALS
+#define TOYWASM_USE_SMALL_CELLS
+#define TOYWASM_USE_RESULTTYPE_CELLIDX
+#define TOYWASM_USE_LOCALTYPE_CELLIDX
+#define TOYWASM_ENABLE_WRITER
+
+#endif /* !defined(_TOYWASM_CONFIG_H) */