Skip to content

Commit 267379c

Browse files
author
Georgii Rylov
committed
Merge branch 'main' into godjan/iterate_callstack
2 parents f7204bd + 171d356 commit 267379c

39 files changed

+460
-105
lines changed

.github/workflows/check_version_h.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Copyright (C) 2019 Intel Corporation. All rights reserved.
2+
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
3+
name: confirm version.h stay in sync
4+
5+
on:
6+
workflow_call:
7+
8+
permissions:
9+
contents: read
10+
11+
jobs:
12+
confirm_version:
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- name: checkout
17+
uses: actions/checkout@v4
18+
19+
- name: cmake execute to generate version.h
20+
run: cmake -B build_version -S .
21+
22+
- name: confirm version.h
23+
run: |
24+
if [ -z "$(git status --porcelain | grep version.h)" ]; then
25+
echo "version.h is in sync"
26+
else
27+
echo "version.h is not in sync"
28+
exit 1
29+
fi

.github/workflows/codeql.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ jobs:
5353

5454
# Initializes the CodeQL tools for scanning.
5555
- name: Initialize CodeQL
56-
uses: github/codeql-action/[email protected].1
56+
uses: github/codeql-action/[email protected].8
5757
with:
5858
languages: ${{ matrix.language }}
5959

@@ -70,7 +70,7 @@ jobs:
7070
- run: |
7171
./.github/scripts/codeql_buildscript.sh
7272
- name: Perform CodeQL Analysis
73-
uses: github/codeql-action/[email protected].1
73+
uses: github/codeql-action/[email protected].8
7474
with:
7575
category: "/language:${{matrix.language}}"
7676
upload: false
@@ -99,7 +99,7 @@ jobs:
9999
output: ${{ steps.step1.outputs.sarif-output }}/cpp.sarif
100100

101101
- name: Upload CodeQL results to code scanning
102-
uses: github/codeql-action/[email protected].1
102+
uses: github/codeql-action/[email protected].8
103103
with:
104104
sarif_file: ${{ steps.step1.outputs.sarif-output }}
105105
category: "/language:${{matrix.language}}"

.github/workflows/compilation_on_android_ubuntu.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,12 @@ permissions:
7474
contents: read
7575

7676
jobs:
77+
check_version_h:
78+
permissions:
79+
contents: read
80+
actions: write
81+
uses: ./.github/workflows/check_version_h.yml
82+
7783
build_llvm_libraries_on_ubuntu_2204:
7884
permissions:
7985
contents: read
@@ -675,7 +681,7 @@ jobs:
675681
test_option: $MEMORY64_TEST_OPTIONS
676682
- running_mode: "multi-tier-jit"
677683
test_option: $MEMORY64_TEST_OPTIONS
678-
# aot, fast-interp, fast-jit, llvm-jit, multi-tier-jit don't support Multi Memory
684+
# aot, fast-interp, fast-jit, llvm-jit, multi-tier-jit don't support Multi Memory
679685
- running_mode: "aot"
680686
test_option: $MULTI_MEMORY_TEST_OPTIONS
681687
- running_mode: "fast-interp"
@@ -817,7 +823,7 @@ jobs:
817823

818824
- name: install dependencies
819825
run: |
820-
rustup target add wasm32-wasi
826+
rustup target add wasm32-wasip1
821827
sudo apt update && sudo apt-get install -y lld ninja-build
822828
npm install
823829
working-directory: test-tools/wamr-ide/VSCode-Extension

.github/workflows/supply_chain.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,6 @@ jobs:
6060

6161
# Upload the results to GitHub's code scanning dashboard.
6262
- name: "Upload to code-scanning"
63-
uses: github/codeql-action/upload-sarif@db7177a1c66bea89f5e7ce32d0ea48bea4a0d460 # v2.2.4
63+
uses: github/codeql-action/upload-sarif@0701025a8b1600e416be4f3bb5a830b1aa6af01e # v2.2.4
6464
with:
6565
sarif_file: results.sarif

CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,7 @@ if (WAMR_BUILD_STATIC)
174174
target_link_libraries(iwasm_static PRIVATE ntdll)
175175
endif()
176176

177+
set_version_info (iwasm_static)
177178
install (TARGETS iwasm_static ARCHIVE DESTINATION lib)
178179
endif ()
179180

@@ -196,6 +197,7 @@ if (WAMR_BUILD_SHARED)
196197
target_link_libraries(iwasm_shared PRIVATE ntdll)
197198
endif()
198199

200+
set_version_info (iwasm_shared)
199201
install (TARGETS iwasm_shared LIBRARY DESTINATION lib)
200202
endif ()
201203

@@ -204,4 +206,5 @@ install (FILES
204206
${WAMR_ROOT_DIR}/core/iwasm/include/wasm_c_api.h
205207
${WAMR_ROOT_DIR}/core/iwasm/include/wasm_export.h
206208
${WAMR_ROOT_DIR}/core/iwasm/include/lib_export.h
209+
${WAMR_ROOT_DIR}/core/version.h
207210
DESTINATION include)

build-scripts/config_common.cmake

Lines changed: 113 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,9 @@ else ()
131131
unset (LLVM_AVAILABLE_LIBS)
132132
endif ()
133133

134+
# Version
135+
include (${WAMR_ROOT_DIR}/build-scripts/version.cmake)
136+
134137
# Sanitizers
135138

136139
if (NOT DEFINED WAMR_BUILD_SANITIZER)
@@ -167,16 +170,61 @@ if (NOT DEFINED WAMR_BUILD_SHRUNK_MEMORY)
167170
set (WAMR_BUILD_SHRUNK_MEMORY 1)
168171
endif ()
169172

173+
########################################
174+
# Default values
175+
########################################
176+
if (NOT DEFINED WAMR_BUILD_BULK_MEMORY)
177+
set (WAMR_BUILD_BULK_MEMORY 1)
178+
endif ()
179+
180+
if (NOT DEFINED WAMR_BUILD_EXCE_HANDLING)
181+
set (WAMR_BUILD_EXCE_HANDLING 0)
182+
endif ()
183+
184+
if (NOT DEFINED WAMR_BUILD_GC)
185+
set (WAMR_BUILD_GC 0)
186+
endif ()
187+
188+
if (NOT DEFINED WAMR_BUILD_MEMORY64)
189+
set (WAMR_BUILD_MEMORY64 0)
190+
endif ()
191+
192+
if (NOT DEFINED WAMR_BUILD_MULTI_MEMORY)
193+
set (WAMR_BUILD_MULTI_MEMORY 0)
194+
endif ()
195+
196+
if (NOT DEFINED WAMR_BUILD_SHARED_MEMORY)
197+
set(WAMR_BUILD_SHARED_MEMORY 0)
198+
endif ()
199+
200+
if (NOT DEFINED WAMR_BUILD_STRINGREF)
201+
set(WAMR_BUILD_STRINGREF 0)
202+
endif ()
203+
204+
if (NOT DEFINED WAMR_BUILD_TAIL_CALL)
205+
set (WAMR_BUILD_TAIL_CALL 0)
206+
endif ()
207+
208+
########################################
209+
# Compilation options to marco
170210
########################################
171211

172212
message ("-- Build Configurations:")
173213
message (" Build as target ${WAMR_BUILD_TARGET}")
174214
message (" CMAKE_BUILD_TYPE " ${CMAKE_BUILD_TYPE})
215+
################## running mode ##################
175216
if (WAMR_BUILD_INTERP EQUAL 1)
176217
message (" WAMR Interpreter enabled")
177218
else ()
178219
message (" WAMR Interpreter disabled")
179220
endif ()
221+
if ((WAMR_BUILD_FAST_INTERP EQUAL 1) AND (WAMR_BUILD_INTERP EQUAL 1))
222+
add_definitions (-DWASM_ENABLE_FAST_INTERP=1)
223+
message (" Fast interpreter enabled")
224+
else ()
225+
add_definitions (-DWASM_ENABLE_FAST_INTERP=0)
226+
message (" Fast interpreter disabled")
227+
endif ()
180228
if (WAMR_BUILD_AOT EQUAL 1)
181229
message (" WAMR AOT enabled")
182230
else ()
@@ -207,6 +255,16 @@ if (WAMR_BUILD_FAST_JIT EQUAL 1 AND WAMR_BUILD_JIT EQUAL 1
207255
AND WAMR_BUILD_LAZY_JIT EQUAL 1)
208256
message (" Multi-tier JIT enabled")
209257
endif ()
258+
################## test modes ##################
259+
if (WAMR_BUILD_SPEC_TEST EQUAL 1)
260+
add_definitions (-DWASM_ENABLE_SPEC_TEST=1)
261+
message (" spec test compatible mode is on")
262+
endif ()
263+
if (WAMR_BUILD_WASI_TEST EQUAL 1)
264+
add_definitions (-DWASM_ENABLE_WASI_TEST=1)
265+
message (" wasi test compatible mode is on")
266+
endif ()
267+
################## native ##################
210268
if (WAMR_BUILD_LIBC_BUILTIN EQUAL 1)
211269
message (" Libc builtin enabled")
212270
else ()
@@ -219,38 +277,36 @@ elseif (WAMR_BUILD_LIBC_WASI EQUAL 1)
219277
else ()
220278
message (" Libc WASI disabled")
221279
endif ()
222-
if ((WAMR_BUILD_FAST_INTERP EQUAL 1) AND (WAMR_BUILD_INTERP EQUAL 1))
223-
add_definitions (-DWASM_ENABLE_FAST_INTERP=1)
224-
message (" Fast interpreter enabled")
225-
else ()
226-
add_definitions (-DWASM_ENABLE_FAST_INTERP=0)
227-
message (" Fast interpreter disabled")
280+
if (WAMR_BUILD_THREAD_MGR EQUAL 1)
281+
message (" Thread manager enabled")
282+
endif ()
283+
if (WAMR_BUILD_LIB_PTHREAD EQUAL 1)
284+
message (" Lib pthread enabled")
228285
endif ()
286+
if (WAMR_BUILD_LIB_PTHREAD_SEMAPHORE EQUAL 1)
287+
message (" Lib pthread semaphore enabled")
288+
endif ()
289+
if (WAMR_BUILD_LIB_WASI_THREADS EQUAL 1)
290+
message (" Lib wasi-threads enabled")
291+
endif ()
292+
if (WAMR_BUILD_LIBC_EMCC EQUAL 1)
293+
message (" Libc emcc enabled")
294+
endif ()
295+
if (WAMR_BUILD_LIB_RATS EQUAL 1)
296+
message (" Lib rats enabled")
297+
endif()
298+
################## WAMR features ##################
229299
if (WAMR_BUILD_MULTI_MODULE EQUAL 1)
230300
add_definitions (-DWASM_ENABLE_MULTI_MODULE=1)
231301
message (" Multiple modules enabled")
232302
else ()
233303
add_definitions (-DWASM_ENABLE_MULTI_MODULE=0)
234304
message (" Multiple modules disabled")
235305
endif ()
236-
if (WAMR_BUILD_SPEC_TEST EQUAL 1)
237-
add_definitions (-DWASM_ENABLE_SPEC_TEST=1)
238-
message (" spec test compatible mode is on")
239-
endif ()
240-
if (WAMR_BUILD_WASI_TEST EQUAL 1)
241-
add_definitions (-DWASM_ENABLE_WASI_TEST=1)
242-
message (" wasi test compatible mode is on")
243-
endif ()
244-
if (NOT DEFINED WAMR_BUILD_BULK_MEMORY)
245-
# Enable bulk memory by default
246-
set (WAMR_BUILD_BULK_MEMORY 1)
247-
endif ()
248306
if (WAMR_BUILD_BULK_MEMORY EQUAL 1)
249307
add_definitions (-DWASM_ENABLE_BULK_MEMORY=1)
250-
message (" Bulk memory feature enabled")
251308
else ()
252309
add_definitions (-DWASM_ENABLE_BULK_MEMORY=0)
253-
message (" Bulk memory feature disabled")
254310
endif ()
255311
if (WAMR_BUILD_SHARED_MEMORY EQUAL 1)
256312
add_definitions (-DWASM_ENABLE_SHARED_MEMORY=1)
@@ -270,31 +326,11 @@ if (WAMR_BUILD_MEMORY64 EQUAL 1)
270326
endif()
271327
add_definitions (-DWASM_ENABLE_MEMORY64=1)
272328
set (WAMR_DISABLE_HW_BOUND_CHECK 1)
273-
message (" Memory64 memory enabled")
274329
endif ()
275330
if (WAMR_BUILD_MULTI_MEMORY EQUAL 1)
276331
add_definitions (-DWASM_ENABLE_MULTI_MEMORY=1)
277-
message (" Multi memory enabled")
278332
set (WAMR_BUILD_DEBUG_INTERP 0)
279333
endif ()
280-
if (WAMR_BUILD_THREAD_MGR EQUAL 1)
281-
message (" Thread manager enabled")
282-
endif ()
283-
if (WAMR_BUILD_LIB_PTHREAD EQUAL 1)
284-
message (" Lib pthread enabled")
285-
endif ()
286-
if (WAMR_BUILD_LIB_PTHREAD_SEMAPHORE EQUAL 1)
287-
message (" Lib pthread semaphore enabled")
288-
endif ()
289-
if (WAMR_BUILD_LIB_WASI_THREADS EQUAL 1)
290-
message (" Lib wasi-threads enabled")
291-
endif ()
292-
if (WAMR_BUILD_LIBC_EMCC EQUAL 1)
293-
message (" Libc emcc enabled")
294-
endif ()
295-
if (WAMR_BUILD_LIB_RATS EQUAL 1)
296-
message (" Lib rats enabled")
297-
endif()
298334
if (WAMR_BUILD_MINI_LOADER EQUAL 1)
299335
add_definitions (-DWASM_ENABLE_MINI_LOADER=1)
300336
message (" WASM mini loader enabled")
@@ -324,7 +360,6 @@ endif ()
324360
if (WAMR_BUILD_SIMD EQUAL 1)
325361
if (NOT WAMR_BUILD_TARGET MATCHES "RISCV64.*")
326362
add_definitions (-DWASM_ENABLE_SIMD=1)
327-
message (" SIMD enabled")
328363
else ()
329364
message (" SIMD disabled due to not supported on target RISCV64")
330365
endif ()
@@ -354,16 +389,11 @@ if (WAMR_BUILD_DUMP_CALL_STACK EQUAL 1)
354389
endif ()
355390
if (WAMR_BUILD_TAIL_CALL EQUAL 1)
356391
add_definitions (-DWASM_ENABLE_TAIL_CALL=1)
357-
message (" Tail call enabled")
358392
endif ()
359393
if (WAMR_BUILD_REF_TYPES EQUAL 1)
360394
add_definitions (-DWASM_ENABLE_REF_TYPES=1)
361-
message (" Reference types enabled")
362-
else ()
363-
message (" Reference types disabled")
364395
endif ()
365396
if (WAMR_BUILD_GC EQUAL 1)
366-
message (" GC enabled")
367397
if (WAMR_TEST_GC EQUAL 1)
368398
message(" GC testing enabled")
369399
endif()
@@ -375,7 +405,6 @@ else ()
375405
message (" GC performance profiling disabled")
376406
endif ()
377407
if (WAMR_BUILD_STRINGREF EQUAL 1)
378-
message (" Stringref enabled")
379408
if (NOT DEFINED WAMR_STRINGREF_IMPL_SOURCE)
380409
message (" Using WAMR builtin implementation for stringref")
381410
else ()
@@ -610,4 +639,41 @@ if (WAMR_BUILD_SHRUNK_MEMORY EQUAL 1)
610639
else ()
611640
add_definitions (-DWASM_ENABLE_SHRUNK_MEMORY=0)
612641
message (" Shrunk memory disabled")
642+
endif()
643+
if (WAMR_BUILD_AOT_VALIDATOR EQUAL 1)
644+
message (" AOT validator enabled")
645+
add_definitions (-DWASM_ENABLE_AOT_VALIDATOR=1)
613646
endif ()
647+
648+
########################################
649+
# Show Phase4 Wasm proposals status.
650+
########################################
651+
652+
message (
653+
"-- About Wasm Proposals:\n"
654+
" Always-on:\n"
655+
" \"Extended Constant Expressions\"\n"
656+
" \"Multi-value\"\n"
657+
" \"Non-trapping float-to-int conversions\"\n"
658+
" \"Sign-extension operators\"\n"
659+
" \"WebAssembly C and C++ API\"\n"
660+
" Configurable. 0 is OFF. 1 is ON:\n"
661+
" \"Bulk Memory Operation\" via WAMR_BUILD_BULK_MEMORY: ${WAMR_BUILD_BULK_MEMORY}\n"
662+
" \"Fixed-width SIMD\" via WAMR_BUILD_SIMD: ${WAMR_BUILD_SIMD}\n"
663+
" \"Garbage collection\" via WAMR_BUILD_GC: ${WAMR_BUILD_GC}\n"
664+
" \"Legacy Exception handling\" via WAMR_BUILD_EXCE_HANDLING: ${WAMR_BUILD_EXCE_HANDLING}\n"
665+
" \"Memory64\" via WAMR_BUILD_MEMORY64: ${WAMR_BUILD_MEMORY64}\n"
666+
" \"Multiple memories\" via WAMR_BUILD_MULTI_MEMORY: ${WAMR_BUILD_MULTI_MEMORY}\n"
667+
" \"Reference Types\" via WAMR_BUILD_REF_TYPES: ${WAMR_BUILD_REF_TYPES}\n"
668+
" \"Reference-Typed Strings\" via WAMR_BUILD_STRINGREF: ${WAMR_BUILD_STRINGREF}\n"
669+
" \"Tail call\" via WAMR_BUILD_TAIL_CALL: ${WAMR_BUILD_TAIL_CALL}\n"
670+
" \"Threads\" via WAMR_BUILD_SHARED_MEMORY: ${WAMR_BUILD_SHARED_MEMORY}\n"
671+
" \"Typed Function References\" via WAMR_BUILD_GC: ${WAMR_BUILD_GC}\n"
672+
" Unsupported (>= Phase4):\n"
673+
" \"Branch Hinting\"\n"
674+
" \"Custom Annotation Syntax in the Text Format\"\n"
675+
" \"Exception handling\"\n"
676+
" \"Import/Export of Mutable Globals\"\n"
677+
" \"JS String Builtins\"\n"
678+
" \"Relaxed SIMD\"\n"
679+
)

build-scripts/version.cmake

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
# Copyright (C) 2019 Intel Corporation. All rights reserved.
2+
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
3+
4+
if(NOT WAMR_ROOT_DIR)
5+
# if from wamr-compiler
6+
set(WAMR_ROOT_DIR ${CMAKE_CURRENT_SOURCE_DIR}/..)
7+
endif()
8+
9+
set(WAMR_VERSION_MAJOR 2)
10+
set(WAMR_VERSION_MINOR 2)
11+
set(WAMR_VERSION_PATCH 0)
12+
13+
message("-- WAMR version: ${WAMR_VERSION_MAJOR}.${WAMR_VERSION_MINOR}.${WAMR_VERSION_PATCH}")
14+
15+
# Configure the version header file
16+
configure_file(
17+
${WAMR_ROOT_DIR}/core/version.h.in
18+
${WAMR_ROOT_DIR}/core/version.h
19+
)
20+
21+
# Set the library version and SOVERSION
22+
function(set_version_info target)
23+
set_target_properties(${target}
24+
PROPERTIES
25+
VERSION ${WAMR_VERSION_MAJOR}.${WAMR_VERSION_MINOR}.${WAMR_VERSION_PATCH}
26+
SOVERSION ${WAMR_VERSION_MAJOR}
27+
)
28+
endfunction()

0 commit comments

Comments
 (0)