compat.wamr
WebAssembly Micro Runtime — small-footprint WebAssembly interpreter from the Bytecode Alliance
mcpp add compat.wamr@2.4.5
用法
來自本倉庫自己的測試專案 —— CI 真的編譯並執行過,不是為了網站寫的。
// Feature test for compat.wamr: assert that the two optional guest-libc layers
// are actually linked in when requested.
//
// The discriminator is a CALL, not instantiation. WAMR does not reject a
// module whose import is unresolved — the loader logs "failed to link import
// function" and carries on, so instantiation succeeds either way. The refusal
// only appears when the guest calls the import, as an exception naming it
// "unlinked". tests/examples/wamr asserts exactly that for env.putchar against
// the base package; here the same call must go through.
#ifdef __linux__
#include <wasm_export.h>
#include <cstdio>
#include <cstdlib>
#include <cstring>
namespace {
// (module (import "env" "putchar" (func (param i32) (result i32)))
// (func (export "emit") (param i32) (result i32) local.get 0 call 0))
const unsigned char kNeedsLibcBuiltin[] = {
// …
tests/examples/wamr-features/tests/libc_features.cpp · 專案 tests/examples/wamr-features
建置
- targets
wamr (lib)- language
c++23- C standard
c11- import std
- no
- include dirs
*/core/iwasm/include, */core/shared/platform/include, */core, */core/iwasm/common, */core/iwasm/interpreter, */core/shared/include, */core/shared/platform/linux, */core/shared/mem-alloc, */core/shared/utils, */core/iwasm/common/arch, */core/iwasm/libraries/libc-builtin, */core/iwasm/libraries/libc-wasi, */core/iwasm/libraries/libc-wasi/sandboxed-system-primitives/include, */core/iwasm/libraries/libc-wasi/sandboxed-system-primitives/src, */core/shared/platform/common/libc-util, mcpp_generated/include
功能
| 功能 | 宣告了 |
|---|---|
| libc-wasi | sources, defines |
| libc-builtin | sources, defines |
原始檔 (11)
*/core/iwasm/common/*.cmcpp_generated/mcpp_wamr_invoke_native.S*/core/iwasm/interpreter/wasm_loader.c*/core/iwasm/interpreter/wasm_runtime.c*/core/iwasm/interpreter/wasm_interp_fast.c*/core/shared/platform/linux/*.c*/core/shared/platform/common/posix/*.c*/core/shared/platform/common/libc-util/*.c*/core/shared/mem-alloc/mem_alloc.c*/core/shared/mem-alloc/ems/*.c*/core/shared/utils/*.c
產生的檔案
mcpp_generated/include/mcpp_wamr_config.hmcpp_generated/mcpp_wamr_invoke_native.S
版本
| 版本 | 平台 | 鏡像 | sha256 |
|---|---|---|---|
2.4.5 最新 |
Linux | 來源 | 1ab09d51099f… |