Commit Graph

356 Commits

Author SHA1 Message Date
YAMAMOTO Takashi
46888aa8e4 toywasm: regen for v38
```
REF=b3e060f308db23e21aaa3004484bf9335e4d3fcc ./regen.sh
```
2024-02-05 03:37:32 -08:00
YAMAMOTO Takashi
aba3e27c6c toywasm: update to v38 2024-02-05 03:37:32 -08:00
YAMAMOTO Takashi
b43340b0aa toywasm: regen
```
REF=15e6585cecd8049a03a901a4ed8a6b2dd3c18e48 ./regen.sh
```
2024-01-30 04:09:27 -08:00
YAMAMOTO Takashi
df573bb024 toywasm: bump the version 2024-01-30 04:09:27 -08:00
Huang Qi
dbcbec363d wamr: Add new option to enable quick aot entry
Enable AOT quick entry to improve performance for call
AOTed function from host side in some cases with simple
signature.

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2024-01-19 01:02:59 -08:00
YAMAMOTO Takashi
70108ae59e wamr: bump the default stack guard size
using 0 by default seems a bit too aggressive to me.

1024 here is what would have been used before this kconfig knob
was introduced by https://github.com/apache/nuttx-apps/pull/1259.
It also matches some expectations in the recent wamrc.
40b430fd24/core/iwasm/compilation/aot_emit_aot_file.c (L2672-L2678)
2024-01-19 09:08:10 +01:00
YAMAMOTO Takashi
8930743831 Wasm.mk: disable by default
Fixes partly: https://github.com/apache/nuttx-apps/issues/2046

Also, this fixes warnings like:
```
spacetanuki% ./tools/configure.sh -E sim:wamr
  Copy files
  Select CONFIG_HOST_MACOS=y
  Refreshing...
/usr/local/bin/bash: line 1: /bin/clang: No such file or directory
/usr/local/bin/bash: line 1: /bin/clang: No such file or directory              /usr/local/bin/bash: line 1: /bin/clang: No such file or directory
/usr/local/bin/bash: line 1: /bin/clang: No such file or directory
/usr/local/bin/bash: line 1: /bin/clang: No such file or directory
/usr/local/bin/bash: line 1: /bin/clang: No such file or directory
/usr/local/bin/bash: line 1: /bin/clang: No such file or directory
/usr/local/bin/bash: line 1: /bin/clang: No such file or directory
/usr/local/bin/bash: line 1: /bin/clang: No such file or directory
CP: arch/dummy/Kconfig to /Users/yamamoto/git/nuttx/nuttx/arch/dummy/dummy_kconf
ig
CP: boards/dummy/Kconfig to /Users/yamamoto/git/nuttx/nuttx/boards/dummy/dummy_k
config
/usr/local/bin/bash: line 1: /bin/clang: No such file or directory
/usr/local/bin/bash: line 1: /bin/clang: No such file or directory
/usr/local/bin/bash: line 1: /bin/clang: No such file or directory
/usr/local/bin/bash: line 1: /bin/clang: No such file or directory
/usr/local/bin/bash: line 1: /bin/clang: No such file or directory
/usr/local/bin/bash: line 1: /bin/clang: No such file or directory

```
2024-01-13 02:16:16 -08:00
Huang Qi
c4e78cd10a wamr: Add new option to enable tail call support
See also:
https://github.com/bytecodealliance/wasm-micro-runtime/pull/2975

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2024-01-06 04:34:50 -08:00
YAMAMOTO Takashi
f12586c51e interpreters/wamr: add INTERPRETERS_WAMR_DEBUG_AOT option
At least it's sometimes useful for nuttx sim.

eg. (modified a bit to avoid github autolinks)
```
spacetanuki% lldb ./nuttx
(lldb) target create "./nuttx"
Current executable set to '/Users/yamamoto/git/nuttx/nuttx/nuttx' (x86_64).
(lldb) settings set plugin.jit-loader.gdb.enable on
(lldb) b foo
Breakpoint 1: no locations (pending).
WARNING:  Unable to resolve breakpoint to any actual locations.
(lldb) r
Process 37011 launched: '/Users/yamamoto/git/nuttx/nuttx/nuttx' (x86_64)

NuttShell (NSH) NuttX-10.4.0
nsh> mount -t hostfs -o fs=/tmp/wasm /mnt
nsh> iwasm /mnt/test.aot
1 location added to breakpoint 1
Process 37011 stopped
* thread #_1, queue = 'com.apple.main-thread', stop reason = breakpoint 1.1
    frame #_0: 0x0000000105800673 JIT(0x1058002d4)`foo(exenv=0x0000000101284280) at test.c:5
   2
   3    __attribute__((noinline))
   4    void foo()
-> 5    {
   6        printf("hello from %s\n", __func__);
   7    }
   8
Target 0: (nuttx) stopped.
(lldb) bt
* thread #_1, queue = 'com.apple.main-thread', stop reason = breakpoint 1.1
  * frame #_0: 0x0000000105800673 JIT(0x1058002d4)`foo(exenv=0x0000000101284280) at test.c:5
    frame #_1: 0x000000010580077a JIT(0x1058002d4)`bar(exenv=0x0000000101284280) at test.c:12:2
    frame #_2: 0x000000010580086a JIT(0x1058002d4)`baz(exenv=0x0000000101284280) at test.c:19:2
    frame #_3: 0x0000000105800972 JIT(0x1058002d4)`__main_argc_argv(exenv=<unavailable>, argc=<unavailable>, argv=<unavailable>) at test.c:26:3
    frame #_4: 0x00000001058061aa JIT(0x1058002d4)`aot_func#14 + 278
    frame #_5: 0x00000001058005cd JIT(0x1058002d4)`aot_func#2 + 153
    frame #_6: 0x00000001000e250f nuttx`push_args_end at invokeNative_em64.s:61
    frame #_7: 0x000000010013851a nuttx`wasm_runtime_invoke_native(exec_env=0x0000000101284280, func_ptr=0x0000000105800534, func_type=0x00000001011e2e20, signature=0x0000000000000000, attachment=0x0000000000000000, argv=0x0000000000000000, argc=0, argv_ret=0x0000000000000000) at wasm_runtime_common.c:4631:9
    frame #_8: 0x00000001000da1ae nuttx`aot_call_function(exec_env=0x0000000101284280, function=0x00000001011e1fb0, argc=0, argv=0x0000000000000000) at aot_runtime.c:1654:15
    frame #_9: 0x0000000100134b56 nuttx`wasm_runtime_call_wasm(exec_env=0x0000000101284280, function=0x00000001011e1fb0, argc=0, argv=0x0000000000000000) at wasm_runtime_common.c:2048:15
    frame #_10: 0x00000001000fbad4 nuttx`execute_main(module_inst=0x00000001011e3890, argc=1, argv=0x00000001011b63f8) at wasm_application.c:112:15
    frame #_11: 0x00000001000fb995 nuttx`wasm_application_execute_main(module_inst=0x00000001011e3890, argc=1, argv=0x00000001011b63f8) at wasm_application.c:238:11
    frame #_12: 0x00000001000ea1a0 nuttx`app_instance_main(module_inst=0x00000001011e3890) at main.c:113:5
    frame #_13: 0x00000001000e9d60 nuttx`iwasm_main(argc=1, argv=0x00000001011b63f8) at main.c:947:21
    frame #_14: 0x0000000100023275 nuttx`nxtask_startup(entrypt=(nuttx`iwasm_main at main.c:545), argc=2, argv=0x00000001011b63f0) at task_startup.c:70:8
    frame #_15: 0x000000010001065a nuttx`nxtask_start at task_start.c:134:7
    frame #_16: 0x000000010003a15f nuttx`pre_start at sim_initialstate.c:52:3
(lldb)

```
2023-12-25 04:47:07 -08:00
Xiang Xiao
f28797cddf interpreters/bas: Fix compiler warning after gcc upgrade to version 12
bas_token.l: In function 'yylex':
Error: bas_token.l:1210:31: error: 'strcpy' writing 1 or more bytes into a region of size 0 overflows the destination [-Werror=stringop-overflow=]
 1210 |                             }
      |                               ^
In file included from bas_auto.h:77,
                 from bas_token.l:16:
bas_token.h:103:8: note: at offset 2 into destination object 'name' of size 2
  103 |   char name[2/* ... */];
      |        ^~~~

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-12-10 06:40:51 -08:00
Huang Qi
f57cd2cf0c tools: Move final wasm module to bin/wasm as elf
And leave all intermediate file in apps/wasm,
such as .map file, entry object etc used in
wasm module build.

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2023-12-06 08:29:00 -08:00
Huang Qi
f55b8face6 wamr: Add support for thumb target triple in Toolchain.defs
Before WAMR 1.3.0, eabihf in wamrc is `gnueabihf`, so without
this patch call wamrc will failed with target abi was `eabihf`,
we should convert the standard llvm target to wamrc required.

Both `eabihf` and `gnueabihf` supported after WAMR 1.3.0.

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2023-12-06 08:29:00 -08:00
YAMAMOTO Takashi
733b6de818 toywasm: regen for v35
```
REF=e2ec1b60e06dbe360ae638970d01906ded5ab497 ./regen.sh
```
2023-12-06 08:17:42 -08:00
YAMAMOTO Takashi
282f9a744c toywasm: update to v35 2023-12-06 08:17:42 -08:00
Huang Qi
097411de49 wamr: Add support for custom section loading
Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2023-11-21 08:11:59 -08:00
Masayuki Ishikawa
79c7962af6 apps: Replace CONFIG_ARCH_HAVE_VFORK with CONFIG_ARCH_HAVE_FORK
Summary:

- Resolves an issue where `vfork_test` was not executed following
  the renaming from CONFIG_ARCH_HAVE_VFORK to CONFIG_ARCH_HAVE_FORK,
  as detailed in https://github.com/apache/nuttx/pull/9755.

Impact:
- Please merge https://github.com/apache/nuttx/pull/11200 before
  merging this PR.

Testing:
- Successfully tested with rv-virt:smp64, spresense:smp, and sim:smp.

Signed-off-by: Masayuki Ishikawa <Masayuki.Ishikawa@jp.sony.com>
2023-11-16 07:58:57 -08:00
raiden00pl
26f1b07955 remove interpreters/xxx/README.md. Migrated to Documentation/applications/interpreters 2023-10-30 10:00:01 +08:00
chao an
929f1009c7 system/readline: correct the readline(3) prototype
Reference:
https://man.openbsd.org/readline.3

Signed-off-by: chao an <anchao@xiaomi.com>
2023-10-16 22:04:18 +08:00
Xiang Xiao
dbdba4c254 interpreters/duktape: Add -Wno-unused-but-set-variable to CLAGS
To fix error: variable 'num_stmts' set but not used [-Werror,-Wunused-but-set-variable]
                duk_int_t num_stmts;

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-09-19 11:27:21 +08:00
Xiang Xiao
17692ffc5f Revert "interpreters/duktape: Fix error: variable 'num_stmts' set but not used"
This reverts commit 801046cd78.
2023-09-19 11:27:21 +08:00
Xiang Xiao
801046cd78 interpreters/duktape: Fix error: variable 'num_stmts' set but not used
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-09-17 22:50:08 +03:00
Daniel Appiagyei
b37e84b05f c++ compatibility: rename usages of reserved c++ keywords 'this' and 'public' 2023-09-16 19:45:52 +08:00
YAMAMOTO Takashi
73f27b7cae toywasm: regen for v33
```
REF=e03d1f61d3f3163da76b33c4c770dbf0d2024324 ./regen.sh
```
2023-08-23 03:02:12 +08:00
YAMAMOTO Takashi
816b499ef8 toywasm: bump to v33 2023-08-23 03:02:12 +08:00
Xiang Xiao
054cf3b1cb Change all sizeof(arr)/sizeof(arr[0]) to nitems
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-08-17 22:51:51 +03:00
Xiang Xiao
2db68e26c4 Fix Error: luv/src/constants.c:674:11: error: implicit declaration of function 'getprotobyname'
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-08-12 15:58:11 +03:00
simbit18
e501f784c3 Fix Kconfig style
Add TABs
Add comments
2023-08-11 22:13:17 +08:00
Xu Xingliang
cd7869001f interpreters/luajit: use section name for custom heap
Signed-off-by: Xu Xingliang <xuxingliang@xiaomi.com>
2023-08-09 09:49:23 +02:00
Xu Xingliang
6bfdddca39 interpreter/luajit: use uppercase LUAJIT_ARCH_ARM
Signed-off-by: Xu Xingliang <xuxingliang@xiaomi.com>
2023-08-09 09:49:23 +02:00
YAMAMOTO Takashi
ee71af840f toywasm: regen for v31
```
REF=6f67aec18ce8f824479e305c17464bd4df1dd7ae ./regen.sh
```
2023-08-07 01:12:58 -07:00
YAMAMOTO Takashi
6fb38bc246 toywasm: bump the version to v31 2023-08-07 01:12:58 -07:00
YAMAMOTO Takashi
5365fc9ffd toywasm: regen for v30.0.0
```
REF=bfcc5be6eb25c9581c6c3b443ac38c1a814f8e18 ./regen.sh
```
2023-07-31 10:26:30 -07:00
YAMAMOTO Takashi
23691fd422 toywasm: bump to v30.0.0 2023-07-31 10:26:30 -07:00
YAMAMOTO Takashi
33987a76a9 regen for toywasm v29.0.0
```
REF=12b9e518cd18c9fee09a521afa96eb15cd11edac ./regen.sh
```
2023-07-23 01:08:45 +08:00
YAMAMOTO Takashi
f41873223c toywasm: bump the version to v29.0.0 2023-07-23 01:08:45 +08:00
YAMAMOTO Takashi
7cacd569e5 Revert "toywasm: disable tail call and explain why"
This reverts commit fcda92ebc7.

because it isn't necessary for the latest versions of toywasm.
2023-07-23 01:08:45 +08:00
chao an
4d79a5cbaf add initial cmake build system
Co-authored-by: Daniel Agar <daniel@agar.ca>
Signed-off-by: chao an <anchao@xiaomi.com>
2023-07-08 13:52:02 +08:00
YAMAMOTO Takashi
c078b2ee7a wamr: add a kconfig to control wasi-threads
cf. https://github.com/bytecodealliance/wasm-micro-runtime/blob/main/doc/pthread_impls.md
2023-07-06 09:25:14 -03:00
Huang Qi
be0e677699 interpreters/wamr: New option for configurable bounds checks
Works with https://github.com/bytecodealliance/wasm-micro-runtime/pull/2289

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2023-07-05 16:25:56 +08:00
Xiang Xiao
7986f66006 build: Replace "$(shell $(INCDIR) $(CC) ...)" with $(INCDIR_PREFIX)
to unify the way to get include directories

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-06-22 23:27:26 +03:00
YAMAMOTO Takashi
3bd106081f toywasm: regen after bumping the version
```
REF=99468253ca11c9b8df444e3e23865b5030f6af69 ./regen.sh
```
2023-06-22 09:52:02 +03:00
YAMAMOTO Takashi
5c9e8d6352 toywasm: bump the version 2023-06-22 09:52:02 +03:00
YAMAMOTO Takashi
3d598fce6c toywasm: regen after a change to the script
```
REF=031ac96574bf95c5ec31e5aeb02787a84e6d4af0 ./regen.sh
```
2023-06-17 22:59:32 +03:00
YAMAMOTO Takashi
fcda92ebc7 toywasm: disable tail call and explain why 2023-06-17 22:59:32 +03:00
YAMAMOTO Takashi
900b32c908 toywasm: regen
```
REF=031ac96574bf95c5ec31e5aeb02787a84e6d4af0 ./regen.sh
```
2023-06-12 13:36:48 +08:00
YAMAMOTO Takashi
2c9939920b toywasm: bump version
this includes SIMD support.
2023-06-12 13:36:48 +08:00
Huang Qi
dec2cd9635 tools/Wasm: Decouple the wasm compilation and runtime specific AOT compilation
Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2023-05-13 10:15:40 -03:00
Huang Qi
e287e4bb9e wamr: Simplify target handling by LLVM style arch info
Depends on: https://github.com/apache/nuttx/pull/8928

Signed-off-by: Huang Qi <huangqi3@xiaomi.com>
2023-05-13 10:15:40 -03:00
Xiang Xiao
f95d60366a Fix the nxstyle warning
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-05-08 21:35:16 +03:00
Xiang Xiao
73701cd7cd Replace all strncpy with strlcpy
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
2023-05-08 21:35:16 +03:00