mcpp index

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-wasisources, defines
libc-builtinsources, defines

源文件 (11)

  • */core/iwasm/common/*.c
  • mcpp_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.h
  • mcpp_generated/mcpp_wamr_invoke_native.S

版本

版本平台 镜像sha256
2.4.5 最新 Linux 源站 1ab09d51099f…