Skip to content

Commit 49533a0

Browse files
authored
Merge branch 'bytecodealliance:main' into main
2 parents 3bdf3c3 + 3f4145e commit 49533a0

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+839
-195
lines changed

.github/workflows/build_iwasm_release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -151,15 +151,15 @@ jobs:
151151
working-directory: ${{ inputs.cwd }}
152152

153153
- name: Compress the binary on Windows
154-
if: inputs.runner == 'windows-latest'
154+
if: inputs.runner == 'windows-2022'
155155
run: |
156156
tar -czf iwasm${{ matrix.suffix }}-${{ inputs.ver_num }}-${{ inputs.runner }}.tar.gz iwasm.exe
157157
Compress-Archive -Path iwasm.exe -DestinationPath iwasm${{ matrix.suffix }}-${{ inputs.ver_num }}-${{ inputs.runner }}.zip
158158
mv iwasm${{ matrix.suffix }}-${{ inputs.ver_num }}-${{ inputs.runner }}.* ../
159159
working-directory: ${{ inputs.cwd }}/build/Release
160160

161161
- name: compress the binary on non-Windows
162-
if: inputs.runner != 'windows-latest'
162+
if: inputs.runner != 'windows-2022'
163163
run: |
164164
# Follow the symlink to the actual binary file
165165
tar --dereference -czf iwasm${{ matrix.suffix }}-${{ inputs.ver_num }}-${{ inputs.runner }}.tar.gz iwasm

.github/workflows/build_llvm_libraries.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,11 +118,11 @@ jobs:
118118
key: 0-ccache-${{ inputs.os }}-${{ steps.get_last_commit.outputs.last_commit }}
119119
restore-keys: |
120120
0-ccache-${{ inputs.os }}
121-
if: steps.retrieve_llvm_libs.outputs.cache-hit != 'true' && inputs.os == 'windows-latest'
121+
if: steps.retrieve_llvm_libs.outputs.cache-hit != 'true' && inputs.os == 'windows-2022'
122122

123123
# Install tools on Windows
124124
- run: choco install -y ccache ninja
125-
if: steps.retrieve_llvm_libs.outputs.cache-hit != 'true' && inputs.os == 'windows-latest'
125+
if: steps.retrieve_llvm_libs.outputs.cache-hit != 'true' && inputs.os == 'windows-2022'
126126

127127
- name: Build LLVM libraries
128128
if: steps.retrieve_llvm_libs.outputs.cache-hit != 'true'

.github/workflows/build_wamrc.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,15 +87,15 @@ jobs:
8787
working-directory: wamr-compiler
8888

8989
- name: Compress the binary on Windows
90-
if: inputs.runner == 'windows-latest' && inputs.release
90+
if: inputs.runner == 'windows-2022' && inputs.release
9191
run: |
9292
tar -czf wamrc-${{ inputs.ver_num }}-${{ inputs.runner }}.tar.gz wamrc.exe
9393
Compress-Archive -Path wamrc.exe -DestinationPath wamrc-${{ inputs.ver_num }}-${{ inputs.runner }}.zip
9494
mv wamrc-${{ inputs.ver_num }}-${{ inputs.runner }}.* ../
9595
working-directory: wamr-compiler/build/Release
9696

9797
- name: compress the binary on non-Windows
98-
if: inputs.runner != 'windows-latest' && inputs.release
98+
if: inputs.runner != 'windows-2022' && inputs.release
9999
run: |
100100
# Follow the symlink to the actual binary file
101101
tar --dereference -czf wamrc-${{ inputs.ver_num }}-${{ inputs.runner }}.tar.gz wamrc

.github/workflows/compilation_on_android_ubuntu.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,7 @@ jobs:
166166
"-DWAMR_BUILD_MULTI_MEMORY=1",
167167
"-DWAMR_BUILD_SHARED=1",
168168
"-DWAMR_BUILD_EXTENDED_CONST_EXPR=1",
169+
"-DWAMR_BUILD_LIME1=1 -DWAMR_BUILD_BULK_MEMORY=0 -DWAMR_BUILD_REF_TYPES=0 -DWAMR_BUILD_SIMD=0",
169170
]
170171
os: [ubuntu-22.04]
171172
platform: [android, linux]

.github/workflows/compilation_on_windows.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Copyright (C) 2019 Intel Corporation. All rights reserved.
22
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
33

4-
name: compilation on windows-latest
4+
name: compilation on windows-2022
55

66
on:
77
# will be triggered on PR events
@@ -63,11 +63,11 @@ jobs:
6363
actions: write
6464
uses: ./.github/workflows/build_llvm_libraries.yml
6565
with:
66-
os: "windows-latest"
66+
os: "windows-2022"
6767
arch: "AArch64 ARM Mips RISCV X86"
6868

6969
build_iwasm:
70-
runs-on: windows-latest
70+
runs-on: windows-2022
7171
strategy:
7272
matrix:
7373
build_options:
@@ -105,7 +105,7 @@ jobs:
105105
strategy:
106106
matrix:
107107
include:
108-
- os: windows-latest
108+
- os: windows-2022
109109
llvm_cache_key: ${{ needs.build_llvm_libraries_on_windows.outputs.cache_key }}
110110
steps:
111111
- name: checkout
@@ -136,7 +136,7 @@ jobs:
136136
working-directory: wamr-compiler
137137

138138
test:
139-
runs-on: windows-latest
139+
runs-on: windows-2022
140140
needs: [build_iwasm, build_wamrc]
141141
strategy:
142142
fail-fast: false

.github/workflows/release_process.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ jobs:
105105
needs: [create_tag, create_release]
106106
uses: ./.github/workflows/build_llvm_libraries.yml
107107
with:
108-
os: "windows-latest"
108+
os: "windows-2022"
109109
arch: "AArch64 ARM Mips RISCV X86"
110110

111111
#
@@ -142,7 +142,7 @@ jobs:
142142
with:
143143
llvm_cache_key: ${{ needs.build_llvm_libraries_on_windows.outputs.cache_key }}
144144
release: true
145-
runner: windows-latest
145+
runner: windows-2022
146146
upload_url: ${{ needs.create_release.outputs.upload_url }}
147147
ver_num: ${{ needs.create_tag.outputs.new_ver }}
148148

@@ -180,7 +180,7 @@ jobs:
180180
with:
181181
cwd: product-mini/platforms/windows
182182
llvm_cache_key: ${{ needs.build_llvm_libraries_on_windows.outputs.cache_key }}
183-
runner: windows-latest
183+
runner: windows-2022
184184
upload_url: ${{ needs.create_release.outputs.upload_url }}
185185
ver_num: ${{ needs.create_tag.outputs.new_ver}}
186186

README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ WebAssembly Micro Runtime (WAMR) is a lightweight standalone WebAssembly (Wasm)
4747
- [128-bit SIMD](https://github.com/WebAssembly/simd), ref to [samples/workload](samples/workload)
4848
- [Reference Types](https://github.com/WebAssembly/reference-types), ref to [document](doc/ref_types.md) and [sample](samples/ref-types)
4949
- [Bulk memory operations](https://github.com/WebAssembly/bulk-memory-operations), [Shared memory](https://github.com/WebAssembly/threads/blob/main/proposals/threads/Overview.md#shared-linear-memory), [Memory64](https://github.com/WebAssembly/memory64)
50-
- [Tail-call](https://github.com/WebAssembly/tail-call), [Garbage Collection](https://github.com/WebAssembly/gc), [Exception Handling](https://github.com/WebAssembly/exception-handling)
50+
- [Tail-call](https://github.com/WebAssembly/tail-call), [Garbage Collection](https://github.com/WebAssembly/gc), [Exception Handling](https://github.com/WebAssembly/exception-handling), [Branch Hinting](https://github.com/WebAssembly/branch-hinting)
5151
- [Extended Constant Expressions](https://github.com/WebAssembly/extended-const)
5252

5353
### Supported architectures and platforms
@@ -117,4 +117,3 @@ Any contributions you make will be under the same license.
117117
- [WAMR Blogs](https://bytecodealliance.github.io/wamr.dev/blog/)
118118
- [Community news and events](https://bytecodealliance.github.io/wamr.dev/events/)
119119
- [WAMR TSC meetings](https://github.com/bytecodealliance/wasm-micro-runtime/wiki/TSC-meeting-notes)
120-

build-scripts/config_common.cmake

Lines changed: 41 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,14 @@ if (NOT DEFINED WAMR_BUILD_BULK_MEMORY)
221221
set (WAMR_BUILD_BULK_MEMORY 1)
222222
endif ()
223223

224+
if (NOT DEFINED WAMR_BUILD_BULK_MEMORY_OPT)
225+
set (WAMR_BUILD_BULK_MEMORY_OPT 0)
226+
endif ()
227+
228+
if (NOT DEFINED WAMR_BUILD_CALL_INDIRECT_OVERLONG)
229+
set (WAMR_BUILD_CALL_INDIRECT_OVERLONG 0)
230+
endif ()
231+
224232
if (NOT DEFINED WAMR_BUILD_EXCE_HANDLING)
225233
set (WAMR_BUILD_EXCE_HANDLING 0)
226234
endif ()
@@ -253,10 +261,27 @@ if (NOT DEFINED WAMR_BUILD_EXTENDED_CONST_EXPR)
253261
set (WAMR_BUILD_EXTENDED_CONST_EXPR 0)
254262
endif ()
255263

264+
if (NOT DEFINED WAMR_BUILD_LIME1)
265+
set (WAMR_BUILD_LIME1 0)
266+
endif ()
267+
256268
########################################
257269
# Compilation options to marco
258270
########################################
259271

272+
if (WAMR_BUILD_LIME1 EQUAL 1)
273+
set (WAMR_BUILD_BULK_MEMORY_OPT 1)
274+
set (WAMR_BUILD_CALL_INDIRECT_OVERLONG 1)
275+
set (WAMR_BUILD_EXTENDED_CONST_EXPR 1)
276+
endif ()
277+
278+
if (WAMR_BUILD_BULK_MEMORY EQUAL 1)
279+
set (WAMR_BUILD_BULK_MEMORY_OPT 1)
280+
endif ()
281+
if (WAMR_BUILD_REF_TYPES EQUAL 1)
282+
set (WAMR_BUILD_CALL_INDIRECT_OVERLONG 1)
283+
endif ()
284+
260285
message ("-- Build Configurations:")
261286
message (" Build as target ${WAMR_BUILD_TARGET}")
262287
message (" Build for platform ${WAMR_BUILD_PLATFORM}")
@@ -366,6 +391,11 @@ if (WAMR_BUILD_BULK_MEMORY EQUAL 1)
366391
else ()
367392
add_definitions (-DWASM_ENABLE_BULK_MEMORY=0)
368393
endif ()
394+
if (WAMR_BUILD_BULK_MEMORY_OPT EQUAL 1)
395+
add_definitions (-DWASM_ENABLE_BULK_MEMORY_OPT=1)
396+
else()
397+
add_definitions (-DWASM_ENABLE_BULK_MEMORY_OPT=0)
398+
endif ()
369399
if (WAMR_BUILD_SHARED_MEMORY EQUAL 1)
370400
add_definitions (-DWASM_ENABLE_SHARED_MEMORY=1)
371401
message (" Shared memory enabled")
@@ -457,6 +487,11 @@ endif ()
457487
if (WAMR_BUILD_REF_TYPES EQUAL 1)
458488
add_definitions (-DWASM_ENABLE_REF_TYPES=1)
459489
endif ()
490+
if (WAMR_BUILD_CALL_INDIRECT_OVERLONG EQUAL 1)
491+
add_definitions (-DWASM_ENABLE_CALL_INDIRECT_OVERLONG=1)
492+
else ()
493+
add_definitions(-DWASM_ENABLE_CALL_INDIRECT_OVERLONG=0)
494+
endif ()
460495
if (WAMR_BUILD_GC EQUAL 1)
461496
if (WAMR_TEST_GC EQUAL 1)
462497
message(" GC testing enabled")
@@ -727,6 +762,9 @@ else()
727762
message (" Extended constant expression disabled")
728763
add_definitions(-DWASM_ENABLE_EXTENDED_CONST_EXPR=0)
729764
endif ()
765+
if (WAMR_BUILD_LIME1 EQUAL 1)
766+
message (" Lime1 enabled")
767+
endif ()
730768
########################################
731769
# Show Phase4 Wasm proposals status.
732770
########################################
@@ -739,8 +777,11 @@ message (
739777
" \"Non-trapping float-to-int Conversions\"\n"
740778
" \"Sign-extension Operators\"\n"
741779
" \"WebAssembly C and C++ API\"\n"
780+
" \"Branch Hinting\"\n"
742781
" Configurable. 0 is OFF. 1 is ON:\n"
743782
" \"Bulk Memory Operation\" via WAMR_BUILD_BULK_MEMORY: ${WAMR_BUILD_BULK_MEMORY}\n"
783+
" \"Bulk-memory-opt\" via WAMR_BUILD_BULK_MEMORY_OPT: ${WAMR_BUILD_BULK_MEMORY_OPT}\n"
784+
" \"Call-indirect-overlong\" via WAMR_BUILD_CALL_INDIRECT_OVERLONG: ${WAMR_BUILD_CALL_INDIRECT_OVERLONG}\n"
744785
" \"Extended Constant Expressions\" via WAMR_BUILD_EXTENDED_CONST_EXPR: ${WAMR_BUILD_EXTENDED_CONST_EXPR}\n"
745786
" \"Fixed-width SIMD\" via WAMR_BUILD_SIMD: ${WAMR_BUILD_SIMD}\n"
746787
" \"Garbage Collection\" via WAMR_BUILD_GC: ${WAMR_BUILD_GC}\n"
@@ -753,7 +794,6 @@ message (
753794
" \"Threads\" via WAMR_BUILD_SHARED_MEMORY: ${WAMR_BUILD_SHARED_MEMORY}\n"
754795
" \"Typed Function References\" via WAMR_BUILD_GC: ${WAMR_BUILD_GC}\n"
755796
" Unsupported (>= Phase4):\n"
756-
" \"Branch Hinting\"\n"
757797
" \"Custom Annotation Syntax in the Text Format\"\n"
758798
" \"Exception Handling\"\n"
759799
" \"JS String Builtins\"\n"

build-scripts/warnings.cmake

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,28 @@ else ()
1616
#
1717
# -fpermissive causes warnings like "-fpermissive is valid for C++/ObjC++ but not for C"
1818
#
19+
# Reference:
20+
# - gcc-4.8 https://gcc.gnu.org/onlinedocs/gcc-4.8.4/gcc/Warning-Options.html
21+
# - gcc-11.5 https://gcc.gnu.org/onlinedocs/gcc-11.5.0/gcc/Warning-Options.html
1922
add_compile_options (
20-
$<$<COMPILE_LANGUAGE:C>:-Wincompatible-pointer-types>
2123
$<$<COMPILE_LANGUAGE:C>:-Wimplicit-function-declaration>
2224
)
25+
26+
# https://gcc.gnu.org/gcc-5/changes.html introduces incompatible-pointer-types
27+
# https://releases.llvm.org/7.0.0/tools/clang/docs/DiagnosticsReference.html#wincompatible-pointer-types
28+
# is the earliest version that supports this option I can found.
29+
# Assume AppClang versioning is compatible with Clang.
30+
if ((CMAKE_C_COMPILER_ID STREQUAL "GNU" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL "5.1")
31+
OR (CMAKE_C_COMPILER_ID STREQUAL "Clang" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL "7.0.0")
32+
OR (CMAKE_C_COMPILER_ID STREQUAL "AppClang" AND CMAKE_C_COMPILER_VERSION VERSION_GREATER_EQUAL "7.0.0"))
33+
add_compile_options($<$<COMPILE_LANGUAGE:C>:-Wincompatible-pointer-types>)
34+
endif()
35+
36+
# options benefit embedded system.
37+
add_compile_options (
38+
-Wdouble-promotion
39+
)
40+
2341
# waivers
2442
add_compile_options (
2543
-Wno-unused

core/config.h

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,10 @@
214214
#define WASM_ENABLE_BULK_MEMORY 0
215215
#endif
216216

217+
#ifndef WASM_ENABLE_BULK_MEMORY_OPT
218+
#define WASM_ENABLE_BULK_MEMORY_OPT 0
219+
#endif
220+
217221
/* Shared memory */
218222
#ifndef WASM_ENABLE_SHARED_MEMORY
219223
#define WASM_ENABLE_SHARED_MEMORY 0
@@ -579,6 +583,14 @@ unless used elsewhere */
579583
#define WASM_ENABLE_REF_TYPES 0
580584
#endif
581585

586+
#ifndef WASM_ENABLE_CALL_INDIRECT_OVERLONG
587+
#define WASM_ENABLE_CALL_INDIRECT_OVERLONG 0
588+
#endif
589+
590+
#ifndef WASM_ENABLE_BRANCH_HINTS
591+
#define WASM_ENABLE_BRANCH_HINTS 0
592+
#endif
593+
582594
#ifndef WASM_ENABLE_GC
583595
#define WASM_ENABLE_GC 0
584596
#endif

0 commit comments

Comments
 (0)