Skip to content

Commit 7c22bde

Browse files
authored
CI: Enable testing AOT multi-module feature (#2621)
And refine some code pieces.
1 parent b115b7b commit 7c22bde

File tree

9 files changed

+19
-31
lines changed

9 files changed

+19
-31
lines changed

.github/workflows/compilation_on_android_ubuntu.yml

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -151,9 +151,7 @@ jobs:
151151
exclude:
152152
# uncompatiable feature and platform
153153
# uncompatiable mode and feature
154-
# MULTI_MODULE only on INTERP mode
155-
- make_options_run_mode: $AOT_BUILD_OPTIONS
156-
make_options_feature: "-DWAMR_BUILD_MULTI_MODULE=1"
154+
# MULTI_MODULE only on INTERP mode and AOT mode
157155
- make_options_run_mode: $FAST_JIT_BUILD_OPTIONS
158156
make_options_feature: "-DWAMR_BUILD_MULTI_MODULE=1"
159157
- make_options_run_mode: $LLVM_LAZY_JIT_BUILD_OPTIONS
@@ -494,9 +492,7 @@ jobs:
494492
test_option: $SIMD_TEST_OPTIONS
495493
- running_mode: "fast-interp"
496494
test_option: $SIMD_TEST_OPTIONS
497-
# aot and jit don't support multi module
498-
- running_mode: "aot"
499-
test_option: $MULTI_MODULES_TEST_OPTIONS
495+
# llvm jit doesn't support multi module
500496
- running_mode: "jit"
501497
test_option: $MULTI_MODULES_TEST_OPTIONS
502498
# fast-jit doesn't support multi module, simd

.github/workflows/compilation_on_macos.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -133,13 +133,11 @@ jobs:
133133
exclude:
134134
# uncompatiable feature and platform
135135
# uncompatiable mode and feature
136-
# MULTI_MODULE only on INTERP mode
136+
# MULTI_MODULE only on INTERP mode and AOT mode
137137
- make_options_run_mode: $LLVM_LAZY_JIT_BUILD_OPTIONS
138138
make_options_feature: "-DWAMR_BUILD_MULTI_MODULE=1"
139139
- make_options_run_mode: $LLVM_EAGER_JIT_BUILD_OPTIONS
140140
make_options_feature: "-DWAMR_BUILD_MULTI_MODULE=1"
141-
- make_options_run_mode: $AOT_BUILD_OPTIONS
142-
make_options_feature: "-DWAMR_BUILD_MULTI_MODULE=1"
143141
# SIMD only on JIT/AOT mode
144142
- make_options_run_mode: $CLASSIC_INTERP_BUILD_OPTIONS
145143
make_options_feature: "-DWAMR_BUILD_SIMD=1"

.github/workflows/compilation_on_sgx.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -101,9 +101,6 @@ jobs:
101101
platform: [linux-sgx]
102102
exclude:
103103
# uncompatiable mode and feature
104-
# MULTI_MODULE only on INTERP mode
105-
- make_options_run_mode: $AOT_BUILD_OPTIONS
106-
make_options_feature: "-DWAMR_BUILD_MULTI_MODULE=1"
107104
# MINI_LOADER only on INTERP mode
108105
- make_options_run_mode: $AOT_BUILD_OPTIONS
109106
make_options_feature: "-DWAMR_BUILD_MINI_LOADER=1"

.github/workflows/nightly_run.yml

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -127,9 +127,7 @@ jobs:
127127
exclude:
128128
# uncompatiable feature and platform
129129
# uncompatiable mode and feature
130-
# MULTI_MODULE only on INTERP mode
131-
- make_options_run_mode: $AOT_BUILD_OPTIONS
132-
make_options_feature: "-DWAMR_BUILD_MULTI_MODULE=1"
130+
# MULTI_MODULE only on INTERP mode and AOT mode
133131
- make_options_run_mode: $FAST_JIT_BUILD_OPTIONS
134132
make_options_feature: "-DWAMR_BUILD_MULTI_MODULE=1"
135133
- make_options_run_mode: $LLVM_LAZY_JIT_BUILD_OPTIONS
@@ -252,7 +250,7 @@ jobs:
252250
exclude:
253251
# uncompatiable feature and platform
254252
# uncompatiable mode and feature
255-
# MULTI_MODULE only on INTERP mode
253+
# MULTI_MODULE only on INTERP mode and AOT mode
256254
- make_options_run_mode: $FAST_JIT_BUILD_OPTIONS
257255
make_options_feature: "-DWAMR_BUILD_MULTI_MODULE=1"
258256
# SIMD only on JIT/AOT mode
@@ -553,9 +551,7 @@ jobs:
553551
test_option: $SIMD_TEST_OPTIONS
554552
- running_mode: "fast-interp"
555553
test_option: $SIMD_TEST_OPTIONS
556-
# aot and jit don't support multi module
557-
- running_mode: "aot"
558-
test_option: $MULTI_MODULES_TEST_OPTIONS
554+
# llvm jit doesn't support multi module
559555
- running_mode: "jit"
560556
test_option: $MULTI_MODULES_TEST_OPTIONS
561557
# fast-jit doesn't support multi module, simd
@@ -660,4 +656,4 @@ jobs:
660656
timeout-minutes: 40
661657
if: env.TEST_ON_X86_32 == 'true'
662658
run: ./test_wamr.sh ${{ env.X86_32_TARGET_TEST_OPTIONS }} ${{ matrix.test_option }} -t ${{ matrix.running_mode }}
663-
working-directory: ./tests/wamr-test-suites
659+
working-directory: ./tests/wamr-test-suites

core/iwasm/aot/aot_loader.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2955,18 +2955,21 @@ create_module(char *error_buf, uint32 error_buf_size)
29552955
{
29562956
AOTModule *module =
29572957
loader_malloc(sizeof(AOTModule), error_buf, error_buf_size);
2958-
29592958
bh_list_status ret;
2959+
29602960
if (!module) {
29612961
return NULL;
29622962
}
2963+
29632964
module->module_type = Wasm_Module_AoT;
2965+
29642966
#if WASM_ENABLE_MULTI_MODULE != 0
29652967
module->import_module_list = &module->import_module_list_head;
29662968
ret = bh_list_init(module->import_module_list);
29672969
bh_assert(ret == BH_LIST_SUCCESS);
29682970
#endif
29692971
(void)ret;
2972+
29702973
return module;
29712974
}
29722975

core/iwasm/common/wasm_runtime_common.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -126,13 +126,11 @@ runtime_malloc(uint64 size, WASMModuleInstanceCommon *module_inst,
126126
}
127127

128128
#if WASM_ENABLE_MULTI_MODULE != 0
129-
/*
130-
TODO:
131-
Let loader_malloc be a general API both for AOT and WASM.
132-
*/
129+
/* TODO: Let loader_malloc be a general API both for AOT and WASM. */
133130

134131
#define loader_malloc(size, error_buf, error_buf_size) \
135132
runtime_malloc(size, NULL, error_buf, error_buf_size)
133+
136134
static void
137135
set_error_buf_v(const WASMModuleCommon *module, char *error_buf,
138136
uint32 error_buf_size, const char *format, ...)

core/iwasm/libraries/libc-wasi/sandboxed-system-primitives/src/posix.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -710,8 +710,8 @@ fd_object_release(wasm_exec_env_t env, struct fd_object *fo)
710710
bool
711711
fd_table_insert_existing(struct fd_table *ft, __wasi_fd_t in, int out)
712712
{
713-
__wasi_filetype_t type;
714-
__wasi_rights_t rights_base, rights_inheriting;
713+
__wasi_filetype_t type = __WASI_FILETYPE_UNKNOWN;
714+
__wasi_rights_t rights_base = 0, rights_inheriting = 0;
715715
struct fd_object *fo;
716716
__wasi_errno_t error;
717717

product-mini/platforms/posix/main.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -422,16 +422,16 @@ static bool
422422
module_reader_callback(package_type_t module_type, const char *module_name,
423423
uint8 **p_buffer, uint32 *p_size)
424424
{
425-
char *file_format;
425+
char *file_format = NULL;
426426
#if WASM_ENABLE_INTERP != 0
427427
if (module_type == Wasm_Module_Bytecode)
428428
file_format = ".wasm";
429429
#endif
430430
#if WASM_ENABLE_AOT != 0
431431
if (module_type == Wasm_Module_AoT)
432432
file_format = ".aot";
433-
434433
#endif
434+
bh_assert(file_format);
435435
const char *format = "%s/%s%s";
436436
int sz = strlen(module_search_path) + strlen("/") + strlen(module_name)
437437
+ strlen(file_format) + 1;

product-mini/platforms/windows/main.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -206,16 +206,16 @@ static bool
206206
module_reader_callback(package_type_t module_type, const char *module_name,
207207
uint8 **p_buffer, uint32 *p_size)
208208
{
209-
char *file_format;
209+
char *file_format = NULL;
210210
#if WASM_ENABLE_INTERP != 0
211211
if (module_type == Wasm_Module_Bytecode)
212212
file_format = ".wasm";
213213
#endif
214214
#if WASM_ENABLE_AOT != 0
215215
if (module_type == Wasm_Module_AoT)
216216
file_format = ".aot";
217-
218217
#endif
218+
bh_assert(file_format);
219219
const char *format = "%s/%s%s";
220220
int sz = strlen(module_search_path) + strlen("/") + strlen(module_name)
221221
+ strlen(file_format) + 1;

0 commit comments

Comments
 (0)