Skip to content

Commit 3b56bf1

Browse files
authored
Merge branch 'bytecodealliance:main' into fix/zephyr_product_mini
2 parents 9658fdd + ad21524 commit 3b56bf1

File tree

66 files changed

+441
-132
lines changed

Some content is hidden

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

66 files changed

+441
-132
lines changed

.github/workflows/build_wamr_vscode_ext.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ jobs:
2727
- uses: actions/checkout@v5
2828

2929
- name: Use Node.js 18.x
30-
uses: actions/setup-node@v4
30+
uses: actions/setup-node@v5
3131
with:
3232
node-version: 18.x
3333

.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/init@v3.29.11
56+
uses: github/codeql-action/init@v3.30.1
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/analyze@v3.29.11
73+
uses: github/codeql-action/analyze@v3.30.1
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/upload-sarif@v3.29.11
102+
uses: github/codeql-action/upload-sarif@v3.30.1
103103
with:
104104
sarif_file: ${{ steps.step1.outputs.sarif-output }}
105105
category: "/language:${{matrix.language}}"

.github/workflows/compilation_on_android_ubuntu.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ jobs:
124124
- name: Build wamrc
125125
run: |
126126
mkdir build && cd build
127-
cmake ..
127+
cmake .. -DCMAKE_C_FLAGS="-Werror"
128128
cmake --build . --config Release --parallel 4
129129
working-directory: wamr-compiler
130130

@@ -293,15 +293,15 @@ jobs:
293293
if: matrix.platform == 'linux'
294294
run: |
295295
mkdir build && cd build
296-
cmake .. ${{ matrix.make_options_run_mode }} ${{ matrix.make_options_feature }}
296+
cmake .. -DCMAKE_C_FLAGS="-Werror" ${{ matrix.make_options_run_mode }} ${{ matrix.make_options_feature }}
297297
cmake --build . --config Release --parallel 4
298298
working-directory: product-mini/platforms/${{ matrix.platform }}
299299

300300
- name: Build iwasm for android
301301
if: matrix.platform == 'android'
302302
run: |
303303
mkdir build && cd build
304-
cmake .. ${{ matrix.make_options_run_mode }} ${{ matrix.make_options_feature }} \
304+
cmake .. -DCMAKE_C_FLAGS="-Werror" ${{ matrix.make_options_run_mode }} ${{ matrix.make_options_feature }} \
305305
-DWAMR_BUILD_TARGET=X86_64
306306
cmake --build . --config Release --parallel 4
307307
working-directory: product-mini/platforms/${{ matrix.platform }}

.github/workflows/compilation_on_macos.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ jobs:
107107
- name: Build wamrc
108108
run: |
109109
mkdir build && cd build
110-
cmake ..
110+
cmake .. -DCMAKE_C_FLAGS="-Werror"
111111
cmake --build . --config Release --parallel 4
112112
working-directory: wamr-compiler
113113

@@ -213,7 +213,7 @@ jobs:
213213
- name: Build iwasm
214214
run: |
215215
mkdir build && cd build
216-
cmake .. ${{ matrix.make_options_run_mode }} ${{ matrix.make_options_feature }}
216+
cmake .. -DCMAKE_C_FLAGS="-Werror" ${{ matrix.make_options_run_mode }} ${{ matrix.make_options_feature }}
217217
cmake --build . --config Release --parallel 4
218218
working-directory: product-mini/platforms/${{ matrix.platform }}
219219

.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@5b49155c7f37b5ec074ffd26b428e6b64b1bf412
63+
uses: github/codeql-action/upload-sarif@144880b6f0c9977178ab4000985a49023783178f
6464
with:
6565
sarif_file: results.sarif

CMakeLists.txt

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -126,11 +126,9 @@ include (${WAMR_ROOT_DIR}/build-scripts/runtime_lib.cmake)
126126
if (NOT WIN32)
127127
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -Wformat -Wformat-security \
128128
-ffunction-sections -fdata-sections \
129-
-Wno-unused-parameter -Wno-pedantic \
130129
-fvisibility=hidden")
131130
# Remove the extra spaces for better make log
132131
string (REGEX REPLACE " *" " " CMAKE_C_FLAGS ${CMAKE_C_FLAGS})
133-
set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wextra -Wformat -Wformat-security -Wno-unused")
134132
endif()
135133

136134
if (WAMR_BUILD_TARGET MATCHES "X86_.*" OR WAMR_BUILD_TARGET STREQUAL "AMD_64")

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: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,8 @@ elseif (WAMR_BUILD_TARGET MATCHES "THUMB.*")
8181
set (CMAKE_ASM_FLAGS "${CMAKE_ASM_FLAGS} -Wa,-mthumb")
8282
endif ()
8383

84+
include (${CMAKE_CURRENT_LIST_DIR}/warnings.cmake)
85+
8486
if (NOT WAMR_BUILD_INTERP EQUAL 1)
8587
if (NOT WAMR_BUILD_AOT EQUAL 1)
8688
message (FATAL_ERROR "-- WAMR Interpreter and AOT must be enabled at least one")
@@ -737,6 +739,7 @@ message (
737739
" \"Non-trapping float-to-int Conversions\"\n"
738740
" \"Sign-extension Operators\"\n"
739741
" \"WebAssembly C and C++ API\"\n"
742+
" \"Branch Hinting\"\n"
740743
" Configurable. 0 is OFF. 1 is ON:\n"
741744
" \"Bulk Memory Operation\" via WAMR_BUILD_BULK_MEMORY: ${WAMR_BUILD_BULK_MEMORY}\n"
742745
" \"Extended Constant Expressions\" via WAMR_BUILD_EXTENDED_CONST_EXPR: ${WAMR_BUILD_EXTENDED_CONST_EXPR}\n"
@@ -751,7 +754,6 @@ message (
751754
" \"Threads\" via WAMR_BUILD_SHARED_MEMORY: ${WAMR_BUILD_SHARED_MEMORY}\n"
752755
" \"Typed Function References\" via WAMR_BUILD_GC: ${WAMR_BUILD_GC}\n"
753756
" Unsupported (>= Phase4):\n"
754-
" \"Branch Hinting\"\n"
755757
" \"Custom Annotation Syntax in the Text Format\"\n"
756758
" \"Exception Handling\"\n"
757759
" \"JS String Builtins\"\n"

build-scripts/runtime_lib.cmake

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -162,8 +162,7 @@ endif ()
162162

163163
####################### Common sources #######################
164164
if (NOT MSVC)
165-
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu99 -ffunction-sections -fdata-sections \
166-
-Wall -Wno-unused-parameter -Wno-pedantic")
165+
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu99 -ffunction-sections -fdata-sections")
167166
endif ()
168167

169168
# include the build config template file

build-scripts/warnings.cmake

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
# Copyright (C) 2019 Intel Corporation. All rights reserved.
2+
# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
3+
4+
# global additional warnings.
5+
if (MSVC)
6+
# warning level 4
7+
add_compile_options(/W4)
8+
else ()
9+
# refer to https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html
10+
add_compile_options(
11+
-Wall -Wextra -Wformat -Wformat-security
12+
$<$<COMPILE_LANGUAGE:C>:-Wshadow>
13+
)
14+
# -pedantic causes warnings like "ISO C forbids initialization between function pointer and ‘void *’" which
15+
# is widely used in the codebase.
16+
#
17+
# -fpermissive causes warnings like "-fpermissive is valid for C++/ObjC++ but not for C"
18+
#
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
22+
add_compile_options (
23+
$<$<COMPILE_LANGUAGE:C>:-Wimplicit-function-declaration>
24+
)
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+
41+
# waivers
42+
add_compile_options (
43+
-Wno-unused
44+
-Wno-unused-parameter
45+
)
46+
endif ()

0 commit comments

Comments
 (0)