Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
892af84
Update sample workload wasm-av1 and add workload XNNPACK (#443)
wenyongh Nov 13, 2020
f4770ae
Add more llvm optimization passes (#445)
wenyongh Nov 23, 2020
74be7a0
Add more checks to enhance security (#446)
wenyongh Nov 24, 2020
0359805
Import FreeRTOS platform experiment codes for further development (#451)
wenyongh Nov 26, 2020
7d8b79a
Addapt to RIOT changes (#452)
kfessel Nov 27, 2020
282831e
Fix some compilation warnings and add esp-idf platform for experiment…
wenyongh Nov 30, 2020
0700dc9
Fix wasi ctx memory free issue when app heap is corrupted (#455)
wenyongh Nov 30, 2020
591e4ce
Refine aot exception throw, remove unnecessary labels (#456)
wenyongh Nov 30, 2020
c8b0a1c
Fix some issues for Arm platform. (#457)
sophy228 Dec 2, 2020
2f530e6
Fix app manager install atomics app issue and optimize workload scrip…
wenyongh Dec 4, 2020
5176fe2
Fix timer setTimeout issue and some coding style issues (#459)
wenyongh Dec 4, 2020
a84d512
Support AssemblyScript's new/retain/release APIs (#460)
xujuntwt95329 Dec 7, 2020
388530c
Modify os_cond_reltimedwait to support long time wait (#461)
wenyongh Dec 7, 2020
b75224c
Using posix thread implementation for NuttX (#462)
no1wudi Dec 7, 2020
35acc7f
platform/NuttX: Add support for lib pthread (#463)
no1wudi Dec 8, 2020
7f4e519
product-mini/nuttx: Add support for repl mode (#466)
no1wudi Dec 9, 2020
619c2b3
product-mini/nuttx: Use readline for repl mode (#469)
no1wudi Dec 11, 2020
16e6f41
Fix wamr compiler issues and refine some error messages (#470)
wenyongh Dec 15, 2020
ad35c3c
Implement SIMD float ceil/floor/trunc/nearest opcodes (#472)
wenyongh Dec 16, 2020
a229487
Fix struct stat fields for darwin (#473)
kateinoigakukun Dec 21, 2020
adb05ea
Enable SIMD support for Linux SGX platform (#474)
wenyongh Dec 21, 2020
cb0e593
Remove debris tlsf in git repo (#475)
kateinoigakukun Dec 21, 2020
50f9a3e
NFC: fix typo in invokeNative_aarch64.s comment (#479)
MaxDesiatov Dec 26, 2020
13f0b24
Update darwin CMakeLists.txt to support Apple Silicon on macOS (#480)
MaxDesiatov Dec 27, 2020
724858c
Update wasm app build scripts for wasi-sdk-12 and refine interpreter …
wenyongh Dec 28, 2020
365ec63
Update build scripts and documents of workload samples for wasi-sdk-1…
wenyongh Dec 29, 2020
6c967b7
Fix two issues for wasm-c-api (#487)
qinxk-inter Dec 30, 2020
f2a63d8
Fix aot bh_assert failed issue on darwin platform x86_64 target (#476…
JavanZhu Dec 30, 2020
788cbf2
Refine aot call_indirect opcode translation (#492)
wenyongh Jan 5, 2021
8a47778
Remove unused block_addr_cache buffer in wasm loader (#493)
wenyongh Jan 8, 2021
8ec03a5
add porting codes of rt-thread (#494)
alvkeke Jan 14, 2021
794028a
1. fix error while building project with RT-Thread Studio. (#497)
alvkeke Jan 14, 2021
240ca2e
Implement performance profiler and call stack dump, and update toolch…
wenyongh Jan 18, 2021
6847e15
Fix failed in loading wasm byte-code if return NULL while size == 0 i…
alvkeke Jan 18, 2021
ee217d5
Add some missing intrinsic symbols for thumb ISA (#503)
no1wudi Jan 21, 2021
4c9cb30
Auto detect host platform for wamr-compiler (#504)
no1wudi Jan 22, 2021
da8c879
Implement riscv support for interpreter (#505)
wustwn Jan 25, 2021
efd6489
Update README.md
wenyongh Jan 25, 2021
a5188f5
Add checks to avoid wasm_runtime_malloc memory with size 0 (#507)
wenyongh Jan 28, 2021
5947ea4
Update invokeNative_em64.asm (#511)
xujuntwt95329 Feb 4, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .clang-format
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ BinPackParameters: false
BreakBeforeBinaryOperators: NonAssignment
BreakBeforeBraces: Custom
BraceWrapping:
AfterCaseLabel: false
AfterCaseLabel: true
AfterClass: true
AfterControlStatement: false
AfterEnum: false
Expand Down Expand Up @@ -76,6 +76,7 @@ KeepEmptyLinesAtTheStartOfBlocks: false
NamespaceIndentation: None
PointerAlignment: Right
ReflowComments: false
SortIncludes: false
Standard: Auto
StatementMacros:
- Q_UNUSED
Expand Down
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,12 @@ The iwasm supports the following architectures:
- AArch64 (Cortex-A57 and Cortex-A53 are tested)
- MIPS
- XTENSA
- RISCV64, RISCV32 (interpreter only)

Following platforms are supported. Refer to [WAMR porting guide](./doc/port_wamr.md) for how to port WAMR to a new platform.

- [Linux](./doc/build_wamr.md#linux), [Linux SGX (Intel Software Guard Extension)](./doc/linux_sgx.md), [MacOS](./doc/build_wamr.md#macos), [Android](./doc/build_wamr.md#android), [Windows](./doc/build_wamr.md#windows)
- [Zephyr](./doc/build_wamr.md#zephyr), [AliOS-Things](./doc/build_wamr.md#alios-things), [VxWorks](./doc/build_wamr.md#vxworks), [NuttX](./doc/build_wamr.md#nuttx)
- [Zephyr](./doc/build_wamr.md#zephyr), [AliOS-Things](./doc/build_wamr.md#alios-things), [VxWorks](./doc/build_wamr.md#vxworks), [NuttX](./doc/build_wamr.md#nuttx), [RT-Thread](./doc/build_wamr.md#RT-Thread)

### Build iwasm VM core (mini product)

Expand Down Expand Up @@ -115,6 +116,7 @@ The WAMR [samples](./samples) integrate the iwasm VM core, application manager a
- **[spawn-thread](./samples/spawn-thread)**: Demonstrating how to execute wasm functions of the same wasm application concurrently, in threads created by host embedder or runtime, but not the wasm application itself.
- **[multi-module](./samples/multi-module)**: Demonstrating the [multiple modules as dependencies](./doc/multi_module.md) feature which implements the [load-time dynamic linking](https://webassembly.org/docs/dynamic-linking/).
- **[wasm-c-api](./samples/wasm-c-api/README.md)**: Demonstrating how to run some samples from [wasm-c-api proposal](https://github.com/WebAssembly/wasm-c-api) and showing the supported API's.
- **[workload](./samples/workload/README.md)**: Demonstrating how to build and run some complex workloads, e.g. tensorflow-lite, XNNPACK, wasm-av1, meshoptimizer and bwa.


License
Expand Down
33 changes: 33 additions & 0 deletions SConscript
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
#
# Copyright (c) 2021, RT-Thread Development Team
#
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
#

# for module compiling
import os

from building import *

objs = []
cwd = GetCurrentDir()
list = os.listdir(cwd)

if GetDepend(['PKG_USING_WAMR']):
wamr_entry_sconscript = os.path.join(cwd, "product-mini", "platforms", "rt-thread", 'SConscript')

if os.path.isfile(wamr_entry_sconscript):
objs = objs + SConscript(wamr_entry_sconscript)
else:
print("[WAMR] entry script wrong:", wamr_entry_sconscript)
Return('objs')

wamr_runlib_sconsript = os.path.join(cwd, "build-scripts", 'SConscript')

if os.path.isfile(wamr_runlib_sconsript):
objs = objs + SConscript(wamr_runlib_sconsript)
else:
print("[WAMR] runtime lib script wrong:", wamr_runlib_sconsript)

Return('objs')

16 changes: 8 additions & 8 deletions assembly-script/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 6 additions & 6 deletions assembly-script/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,16 @@
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"build:request_handler": "asc samples/request_handler.ts -b build/request_handler.wasm -t build/request_handler.wat --sourceMap --validate --optimize --use abort=",
"build:request_sender": "asc samples/request_sender.ts -b build/request_sender.wasm -t build/request_sender.wat --sourceMap --validate --optimize --use abort=",
"build:timer": "asc samples/timer.ts -b build/timer.wasm -t build/timer.wat --sourceMap --validate --optimize --use abort=",
"build:publisher": "asc samples/event_publisher.ts -b build/event_publisher.wasm -t build/event_publisher.wat --sourceMap --validate --optimize --use abort=",
"build:subscriber": "asc samples/event_subscriber.ts -b build/event_subscriber.wasm -t build/event_subscriber.wat --sourceMap --validate --optimize --use abort=",
"build:request_handler": "asc samples/request_handler.ts -b build/request_handler.wasm -t build/request_handler.wat --sourceMap --optimize --use abort=",
"build:request_sender": "asc samples/request_sender.ts -b build/request_sender.wasm -t build/request_sender.wat --sourceMap --optimize --use abort=",
"build:timer": "asc samples/timer.ts -b build/timer.wasm -t build/timer.wat --sourceMap --optimize --use abort=",
"build:publisher": "asc samples/event_publisher.ts -b build/event_publisher.wasm -t build/event_publisher.wat --sourceMap --optimize --use abort=",
"build:subscriber": "asc samples/event_subscriber.ts -b build/event_subscriber.wasm -t build/event_subscriber.wat --sourceMap --optimize --use abort=",
"build:all": "npm run build:request_handler; npm run build:request_sender; npm run build:timer; npm run build:subscriber; npm run build:publisher"
},
"author": "",
"license": "ISC",
"devDependencies": {
"assemblyscript": "^0.8.1"
"assemblyscript": "^0.17.4"
}
}
88 changes: 88 additions & 0 deletions build-scripts/SConscript
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
#
# Copyright (c) 2021, RT-Thread Development Team
#
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
#

import os
from building import *

cwd = GetCurrentDir()
objs = []

WAMR_ROOT_DIR = os.path.join(cwd, "..")


SHARED_DIR = os.path.join(WAMR_ROOT_DIR, 'core', 'shared')

IWASM_DIR = os.path.join(WAMR_ROOT_DIR, 'core', 'iwasm')

APP_MGR_DIR = os.path.join(WAMR_ROOT_DIR, 'core', 'app-mgr')

APP_FRAMEWORK_DIR = os.path.join(WAMR_ROOT_DIR, 'core', 'app-framework')

DEPS_DIR = os.path.join(WAMR_ROOT_DIR, 'core', 'deps')

if GetDepend(['WAMR_BUILD_INTERP']):
script_path = os.path.join(IWASM_DIR, 'interpreter', 'SConscript')
objs += SConscript(script_path)


if GetDepend(['WAMR_BUILD_AOT']):
script_path = os.path.join(IWASM_DIR, 'aot', 'SConscript')
objs += SConscript(script_path)
if GetDepend(['WAMR_BUILD_JIT']):
script_path = os.path.join(IWASM_DIR, 'compilation', 'SConscript')
objs += SConscript(script_path)


if GetDepend(['WAMR_BUILD_APP_FRAMEWORK']):
objs += SConscript(os.path.join(APP_FRAMEWORK_DIR, 'SConscript'))
objs += SConscript(os.path.join(SHARED_DIR, 'coap', 'SConscript'))
objs += SConscript(os.path.join(APP_MGR_DIR, 'app-manager', 'SConscript'))
objs += SConscript(os.path.join(APP_MGR_DIR, 'app-mgr-shared', 'SConscript'))



if GetDepend(['WAMR_BUILD_LIBC_BUILTIN']):
objs += SConscript(os.path.join(IWASM_DIR, 'libraries', 'libc-builtin', 'SConscript'))



if GetDepend(['WAMR_BUILD_LIBC_WASI']):
objs += SConscript(os.path.join(IWASM_DIR, 'libraries', 'libc-wasi', 'SConscript'))


if GetDepend(['WAMR_BUILD_LIB_PTHREAD']):
objs += SConscript(os.path.join(IWASM_DIR, 'libraries', 'libc-pthread', 'SConscript'))
# TODO: 这里加一下



# if (WAMR_BUILD_THREAD_MGR EQUAL 1)
# include (${IWASM_DIR}/libraries/thread-mgr/thread_mgr.cmake)
# endif ()

if GetDepend(['WAMR_BUILD_THREAD_MGR']):
objs += SConscript(os.path.join(IWASM_DIR, 'libraries', 'thread-mgr', 'SConscript'))



# if (WAMR_BUILD_LIBC_EMCC EQUAL 1)
# include (${IWASM_DIR}/libraries/libc-emcc/libc_emcc.cmake)
# endif()

if GetDepend(['WAMR_BUILD_LIBC_EMCC']):
objs += SConscript(os.path.join(IWASM_DIR, 'libraries', 'libc-emmc', 'SConscript'))

objs += SConscript(os.path.join(cwd, 'SConscript_config'));


objs += SConscript(os.path.join(SHARED_DIR, 'platform', 'rt-thread', 'SConscript'))
objs += SConscript(os.path.join(SHARED_DIR, 'mem-alloc', 'SConscript'))
objs += SConscript(os.path.join(IWASM_DIR, 'common', 'SConscript'))
objs += SConscript(os.path.join(SHARED_DIR, 'utils', 'SConscript'))



Return('objs')
121 changes: 121 additions & 0 deletions build-scripts/SConscript_config
Original file line number Diff line number Diff line change
@@ -0,0 +1,121 @@
#
# Copyright (c) 2021, RT-Thread Development Team
#
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
#

import os
import re

from building import *

Import('rtconfig')

src = Split('''
''')
objs = []
cwd = GetCurrentDir()

IWASM_INC_DIR = os.path.join(cwd, '..', 'core', 'iwasm', 'include')

# include_directories (${IWASM_DIR}/include)

CPPPATH = [IWASM_INC_DIR]

if rtconfig.BUILD == 'debug':
CPPDEFINES = ['BH_DEBUG=1']
else:
CPPDEFINES = ['BH_DEBUG=0']

if rtconfig.ARCH == 'arm':
if re.match('^cortex-m.*', rtconfig.CPU):
print('[WAMR] using thumbv4t')
CPPDEFINES += ['BUILD_TARGET_THUMB']
CPPDEFINES += ['RTT_WAMR_BUILD_TARGET_THUMB']
elif re.match('^cortex-a.*', rtconfig.CPU):
print('[WAMR] using armv7')
CPPDEFINES += ['BUILD_TARGET_ARM']
CPPDEFINES += ['RTT_WAMR_BUILD_TARGET_ARMV7']
elif re.match('^cortex-r.*', rtconfig.CPU):
print('[WAMR] using armv7')
CPPDEFINES += ['BUILD_TARGET_ARM']
CPPDEFINES += ['RTT_WAMR_BUILD_TARGET_ARMV7']
elif rtconfig.CPU == 'armv6':
print('[WAMR] using armv6')
CPPDEFINES += ['BUILD_TARGET_ARM']
CPPDEFINES += ['RTT_WAMR_BUILD_TARGET_ARMV6']
elif re.match('^arm9*', rtconfig.CPU):
print('[WAMR] using armv4')
CPPDEFINES += ['BUILD_TARGET_ARM']
CPPDEFINES += ['RTT_WAMR_BUILD_TARGET_ARMV4']
else:
print("[WAMR] unknown arch", rtconfig.ARCH)


LIBS = ['m']

if GetDepend(['WAMR_BUILD_INTERP']):
CPPDEFINES += ['WASM_ENABLE_INTERP=1']
if GetDepend(['WAMR_BUILD_FAST_INTERP']):
CPPDEFINES += ['WASM_ENABLE_FAST_INTERP=1']
print("[WAMR] fast interpreter was enabled")
else:
CPPDEFINES += ['WASM_ENABLE_FAST_INTERP=0']
print("[WAMR] fast interpreter was disabled")
else:
CPPDEFINES += ['WASM_ENABLE_INTERP=0']

CPPDEFINES += ['WASM_ENABLE_JIT=0']

if GetDepend(['WAMR_BUILD_MULTI_MODULE']):
CPPDEFINES += ['WASM_ENABLE_MULTI_MODULE=1']
else:
CPPDEFINES += ['WASM_ENABLE_MULTI_MODULE=0']

if GetDepend(['WAMR_BUILD_SPEC_TEST']):
CPPDEFINES += ['WASM_ENABLE_SPEC_TEST=1']
print("[WAMR] spec test compatible mode was enabled")

if GetDepend(['WAMR_BUILD_BULK_MEMORY']):
CPPDEFINES += ['WASM_ENABLE_BULK_MEMORY=1']
print("[WAMR] Bulk memory feature was enabled")
else:
CPPDEFINES += ['WASM_ENABLE_BULK_MEMORY=0']

if GetDepend(['WAMR_BUILD_SHARED_MEMORY']):
CPPDEFINES += ['WASM_ENABLE_SHARED_MEMORY=1']
print("[WAMR] Shared memory enabled")
else:
CPPDEFINES += ['WASM_ENABLE_SHARED_MEMORY=0']

if GetDepend(['WAMR_BUILD_MINI_LOADER']):
CPPDEFINES += ['WASM_ENABLE_MINI_LOADER=1']
print("[WAMR] mini loader enabled")
else:
CPPDEFINES += ['WASM_ENABLE_MINI_LOADER=0']

if GetDepend(['WAMR_DISABLE_HW_BOUND_CHECK']):
CPPDEFINES += ['WASM_DISABLE_HW_BOUND_CHECK=1']
print("[WAMR] Hardware boundary check disabled")

if GetDepend(['WAMR_BUILD_SIMD']):
CPPDEFINES += ['WASM_ENABLE_SIMD=1']
print('[WAMR] SIMD enabled')

if GetDepend(['WAMR_BUILD_MEMORY_PROFILING']):
CPPDEFINES += ['WASM_ENABLE_MEMORY_PROFILING=1']
print('[WAMR] Memory profiling enabled')

if GetDepend(['WAMR_BUILD_CUSTOM_NAME_SECTION']):
CPPDEFINES += ['WASM_ENABLE_CUSTOM_NAME_SECTION=1']
print('[WAMR] Custom name section enabled')

if GetDepend(['WAMR_BUILD_TAIL_CALL']):
CPPDEFINES += ['WASM_ENABLE_TAIL_CALL=1']
print('[WAMR] Tail call enabledd')


group = DefineGroup('wamr_config_common', src, depend = ['PKG_USING_WAMR'], CPPPATH = CPPPATH, CPPDEFINES = CPPDEFINES, LIBS = LIBS)

Return('group')

Loading