From 6da9ee70dd45667c3e96cc538bf453c1b228d4f4 Mon Sep 17 00:00:00 2001 From: Martijn Stevenson Date: Wed, 26 Apr 2023 16:23:56 +0000 Subject: [PATCH 1/4] Fix v8 gcc Bazel build using -Wno-nonnull. Fixes #340. Signed-off-by: Martijn Stevenson --- bazel/external/v8.patch | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/bazel/external/v8.patch b/bazel/external/v8.patch index 52af7b6ad..bb10f0021 100644 --- a/bazel/external/v8.patch +++ b/bazel/external/v8.patch @@ -1,11 +1,8 @@ -# 1. Disable pointer compression (limits the maximum number of WasmVMs). -# 2. Don't expose Wasm C API (only Wasm C++ API). - diff --git a/BUILD.bazel b/BUILD.bazel -index 5fb10d3940..a19930d36e 100644 +index 4e89f90e7e..3fcb38b3f3 100644 --- a/BUILD.bazel +++ b/BUILD.bazel -@@ -161,7 +161,7 @@ v8_int( +@@ -157,7 +157,7 @@ v8_int( # If no explicit value for v8_enable_pointer_compression, we set it to 'none'. v8_string( name = "v8_enable_pointer_compression", @@ -14,11 +11,23 @@ index 5fb10d3940..a19930d36e 100644 ) # Default setting for v8_enable_pointer_compression. +diff --git a/bazel/defs.bzl b/bazel/defs.bzl +index e957c0fad3..063627b72b 100644 +--- a/bazel/defs.bzl ++++ b/bazel/defs.bzl +@@ -131,6 +131,7 @@ def _default_args(): + "-Wno-redundant-move", + "-Wno-return-type", + "-Wno-stringop-overflow", ++ "-Wno-nonnull", + # Use GNU dialect, because GCC doesn't allow using + # ##__VA_ARGS__ when in standards-conforming mode. + "-std=gnu++17", diff --git a/src/wasm/c-api.cc b/src/wasm/c-api.cc -index ce3f569fd5..dc8a4c4f6a 100644 +index 4473e205c0..65a6ec7e1d 100644 --- a/src/wasm/c-api.cc +++ b/src/wasm/c-api.cc -@@ -2238,6 +2238,8 @@ auto Instance::exports() const -> ownvec { +@@ -2247,6 +2247,8 @@ auto Instance::exports() const -> ownvec { } // namespace wasm @@ -27,7 +36,7 @@ index ce3f569fd5..dc8a4c4f6a 100644 // BEGIN FILE wasm-c.cc extern "C" { -@@ -3257,3 +3259,5 @@ wasm_instance_t* wasm_frame_instance(const wasm_frame_t* frame) { +@@ -3274,3 +3276,5 @@ wasm_instance_t* wasm_frame_instance(const wasm_frame_t* frame) { #undef WASM_DEFINE_SHARABLE_REF } // extern "C" From e3e00774ce753ecd73c8ad66bee87769fc994995 Mon Sep 17 00:00:00 2001 From: Martijn Stevenson Date: Wed, 26 Apr 2023 17:00:38 +0000 Subject: [PATCH 2/4] Restore and expand v8 patch comment Signed-off-by: Martijn Stevenson --- bazel/external/v8.patch | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/bazel/external/v8.patch b/bazel/external/v8.patch index bb10f0021..90b1de013 100644 --- a/bazel/external/v8.patch +++ b/bazel/external/v8.patch @@ -1,3 +1,7 @@ +# 1. Disable pointer compression (limits the maximum number of WasmVMs). +# 2. Don't expose Wasm C API (only Wasm C++ API). +# 3. Fix gcc build error by disabling nonnull warning. + diff --git a/BUILD.bazel b/BUILD.bazel index 4e89f90e7e..3fcb38b3f3 100644 --- a/BUILD.bazel From 8fd9a93f8b150013eb402c3faae6dcc88e372cb1 Mon Sep 17 00:00:00 2001 From: Martijn Stevenson Date: Wed, 26 Apr 2023 21:53:54 +0000 Subject: [PATCH 3/4] Add GCC Linux/x86_64 v8 builds to CI suite Signed-off-by: Martijn Stevenson --- .github/workflows/test.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index eba4f62ad..848fa21bc 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -150,6 +150,14 @@ jobs: action: test flags: --config=clang-tsan cache: true + - name: 'V8 on Linux/x86_64 with GCC' + engine: 'v8' + repo: 'v8' + os: ubuntu-20.04 + arch: x86_64 + action: test + flags: --config=clang --config=gcc + cache: true - name: 'V8 on Linux/aarch64' engine: 'v8' repo: 'v8' From 1209368f69660e3699a1778e1cb945dac8c17e9a Mon Sep 17 00:00:00 2001 From: Martijn Stevenson Date: Fri, 28 Apr 2023 02:20:41 +0000 Subject: [PATCH 4/4] Fix CI test for v8 with GCC Signed-off-by: Martijn Stevenson --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 848fa21bc..ed4a1b72d 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -156,7 +156,7 @@ jobs: os: ubuntu-20.04 arch: x86_64 action: test - flags: --config=clang --config=gcc + flags: --config=gcc cache: true - name: 'V8 on Linux/aarch64' engine: 'v8'