This commit is contained in:
liang.he 2025-08-27 13:57:52 +08:00 committed by GitHub
commit 86b5e3d50e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 36 additions and 17 deletions

View File

@ -37,6 +37,14 @@ permissions:
jobs:
build:
runs-on: ${{ inputs.runner }}
strategy:
matrix:
include:
- build_options: ""
suffix: "-gc"
- build_options: "-DWAMR_BUILD_GC=0"
suffix: ""
permissions:
contents: write # for uploading release artifacts
@ -58,7 +66,7 @@ jobs:
- name: generate wamrc binary release
run: |
cmake -S . -B build
cmake -S . -B build ${{ matrix.build_options }}
cmake --build build --config Release --parallel 4
working-directory: wamr-compiler
@ -89,17 +97,17 @@ jobs:
- name: Compress the binary on Windows
if: inputs.runner == 'windows-latest' && inputs.release
run: |
tar -czf wamrc-${{ inputs.ver_num }}-${{ inputs.runner }}.tar.gz wamrc.exe
Compress-Archive -Path wamrc.exe -DestinationPath wamrc-${{ inputs.ver_num }}-${{ inputs.runner }}.zip
mv wamrc-${{ inputs.ver_num }}-${{ inputs.runner }}.* ../
tar -czf wamrc${{ matrix.suffix }}-${{ inputs.ver_num }}-${{ inputs.runner }}.tar.gz wamrc.exe
Compress-Archive -Path wamrc.exe -DestinationPath wamrc${{ matrix.suffix }}-${{ inputs.ver_num }}-${{ inputs.runner }}.zip
mv wamrc${{ matrix.suffix }}-${{ inputs.ver_num }}-${{ inputs.runner }}.* ../
working-directory: wamr-compiler/build/Release
- name: compress the binary on non-Windows
if: inputs.runner != 'windows-latest' && inputs.release
run: |
# Follow the symlink to the actual binary file
tar --dereference -czf wamrc-${{ inputs.ver_num }}-${{ inputs.runner }}.tar.gz wamrc
zip wamrc-${{ inputs.ver_num }}-${{ inputs.runner }}.zip wamrc
tar --dereference -czf wamrc${{ matrix.suffix }}-${{ inputs.ver_num }}-${{ inputs.runner }}.tar.gz wamrc
zip wamrc${{ matrix.suffix }}-${{ inputs.ver_num }}-${{ inputs.runner }}.zip wamrc
working-directory: wamr-compiler/build
- name: upload release tar.gz
@ -109,8 +117,8 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ inputs.upload_url }}
asset_path: wamr-compiler/build/wamrc-${{ inputs.ver_num }}-${{ inputs.runner }}.tar.gz
asset_name: wamrc-${{ inputs.ver_num }}-${{ inputs.arch }}-${{ inputs.runner }}.tar.gz
asset_path: wamr-compiler/build/wamrc${{ matrix.suffix }}-${{ inputs.ver_num }}-${{ inputs.runner }}.tar.gz
asset_name: wamrc${{ matrix.suffix }}-${{ inputs.ver_num }}-${{ inputs.arch }}-${{ inputs.runner }}.tar.gz
asset_content_type: application/x-gzip
- name: upload release zip
@ -120,6 +128,6 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ inputs.upload_url }}
asset_path: wamr-compiler/build/wamrc-${{ inputs.ver_num }}-${{ inputs.runner }}.zip
asset_name: wamrc-${{ inputs.ver_num }}-${{ inputs.arch }}-${{ inputs.runner }}.zip
asset_path: wamr-compiler/build/wamrc${{ matrix.suffix }}-${{ inputs.ver_num }}-${{ inputs.runner }}.zip
asset_name: wamrc${{ matrix.suffix }}-${{ inputs.ver_num }}-${{ inputs.arch }}-${{ inputs.runner }}.zip
asset_content_type: application/zip

View File

@ -55,7 +55,15 @@ add_definitions(-DWASM_ENABLE_MODULE_INST_CONTEXT=1)
add_definitions(-DWASM_ENABLE_MEMORY64=1)
add_definitions(-DWASM_ENABLE_EXTENDED_CONST_EXPR=1)
add_definitions(-DWASM_ENABLE_GC=1)
# Sync with iwasm in config_common.cmake. Turn off GC by default.
# can be turned on by setting WAMR_BUILD_GC to 1
if (NOT DEFINED WAMR_BUILD_GC)
set(WAMR_BUILD_GC 0)
add_definitions(-DWASM_ENABLE_GC=0)
else ()
set(WAMR_BUILD_GC 1)
add_definitions(-DWASM_ENABLE_GC=${WAMR_BUILD_GC})
endif ()
set (WAMR_BUILD_STRINGREF 1)
set (WAMR_STRINGREF_IMPL_SOURCE "STUB")
@ -285,7 +293,11 @@ include (${SHARED_DIR}/utils/shared_utils.cmake)
include (${SHARED_DIR}/utils/uncommon/shared_uncommon.cmake)
include (${IWASM_DIR}/libraries/thread-mgr/thread_mgr.cmake)
include (${IWASM_DIR}/common/iwasm_common.cmake)
include (${IWASM_DIR}/common/gc/iwasm_gc.cmake)
if (WAMR_BUILD_GC EQUAL 1)
include (${IWASM_DIR}/common/gc/iwasm_gc.cmake)
else ()
message (STATUS "WAMR GC is disabled")
endif ()
include (${IWASM_DIR}/interpreter/iwasm_interp.cmake)
include (${IWASM_DIR}/aot/iwasm_aot.cmake)
include (${IWASM_DIR}/compilation/iwasm_compl.cmake)

View File

@ -179,7 +179,6 @@ print_help()
printf(" --enable-memory-profiling Enable memory usage profiling\n");
printf(" --xip A shorthand of --enable-indirect-mode --disable-llvm-intrinsics\n");
printf(" --enable-indirect-mode Enable call function through symbol table but not direct call\n");
printf(" --enable-gc Enable GC (Garbage Collection) feature\n");
printf(" --disable-llvm-intrinsics Disable the LLVM built-in intrinsics\n");
printf(" --enable-builtin-intrinsics=<flags>\n");
printf(" Enable the specified built-in intrinsics, it will override the default\n");
@ -424,7 +423,11 @@ main(int argc, char *argv[])
option.enable_aux_stack_check = true;
option.enable_bulk_memory = true;
option.enable_ref_types = true;
#if WASM_ENABLE_GC != 0
option.enable_gc = true;
#else
option.enable_gc = false;
#endif
option.enable_extended_const = false;
aot_call_stack_features_init_default(&option.call_stack_features);
@ -573,10 +576,6 @@ main(int argc, char *argv[])
else if (!strcmp(argv[0], "--enable-indirect-mode")) {
option.is_indirect_mode = true;
}
else if (!strcmp(argv[0], "--enable-gc")) {
option.aux_stack_frame_type = AOT_STACK_FRAME_TYPE_STANDARD;
option.enable_gc = true;
}
else if (!strcmp(argv[0], "--disable-llvm-intrinsics")) {
option.disable_llvm_intrinsics = true;
}