Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge branch main into dev/dynamic_linking #3740

Merged
merged 15 commits into from
Aug 21, 2024
Merged

Merge branch main into dev/dynamic_linking #3740

merged 15 commits into from
Aug 21, 2024

Conversation

wenyongh
Copy link
Contributor

No description provided.

sjamesr and others added 15 commits August 16, 2024 06:56
Any use of a table index that isn't exactly a null byte (`0x00`) means that
the module makes use of the reference types proposal. This is important
to track because `aot_compiler.c` will blindly assume that all table indices
are a single byte long otherwise.

This fixes a crash in WAMR for modules that contain multi-byte encodings
of table indices in `call_indirect` but make no other use of reference types
features.
…3721)

If the value of a float constant is an NaN, the aot compiler creates an alloca,
stores the converted i32 const into it and then loads f32 from it again, which
may introduce a relocation in the AOT file and is not allowed for XIP mode.
The table index in the call_indirect/return_call_indirect opcode should be
one byte 0x00 when ref-types/GC isn't enabled, and should be treated as
leb u32 when ref-types/GC is enabled.

And make aot compiler bail out if ref-types/GC is disabled by command line
argument while ref-types instructions are used.
For JIT, we naturally use mach-o on macOS, where the section name
we currently use is not valid and ends up with the errors like:

```
LLVM ERROR: Global variable '__orc_lcl.aot_stack_sizes.0' has an invalid section specifier '.aot_stack_sizes': mach-o section specifier requires a segment and section separated by a comma.
```

Because the dedicated section is not necessary for JIT,
this commit simply stops using it.

Fixes: #3730
When AOT isn't enabled and the input is a wasm file, wasm_runtime_load doesn't
report error. Same when interpreter isn't enabled and the input is AOT file.

This PR makes wasm_runtime_load report error "magic header not detected" for
such situations.
Implement multi-memory for classic-interpreter. Support core spec (and bulk memory) opcodes now,
and will support atomic opcodes, and add multi-memory export APIs in the future. 

PS: Multi-memory spec test patched a lot for linking test to adapt for multi-module implementation.
Enable merged os_mmap for aot data sections first, and try enabling merged
os_mmap for them and aot text except on platform nuttx and esp-idf.

This fixes the issue that aarch64 AOT module fails to load on android:
#2274

And also refine os_mmap related code.
@wenyongh wenyongh merged commit cfc6f4b into dev/dynamic_linking Aug 21, 2024
2422 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants