Skip to content

Commit

Permalink
Include Envoy's v8 macOS build patch
Browse files Browse the repository at this point in the history
This addresses a `getsectdatafromheader_64` build error

Signed-off-by: Martijn Stevenson <[email protected]>
  • Loading branch information
martijneken committed Aug 10, 2024
1 parent 07e9a86 commit c68032e
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions bazel/external/v8.patch
Original file line number Diff line number Diff line change
@@ -1,6 +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.
# 4. Allow compiling v8 on macOS 10.15 to 13.0. TODO(dio): Will remove this patch when https://bugs.chromium.org/p/v8/issues/detail?id=13428 is fixed.

diff --git a/BUILD.bazel b/BUILD.bazel
index 4e89f90e7e..3fcb38b3f3 100644
Expand All @@ -27,6 +28,25 @@ index e957c0fad3..063627b72b 100644
# Use GNU dialect, because GCC doesn't allow using
# ##__VA_ARGS__ when in standards-conforming mode.
"-std=gnu++17",
@@ -151,6 +152,18 @@ def _default_args():
"-fno-integrated-as",
],
"//conditions:default": [],
+ }) + select({
+ "@v8//bazel/config:is_macos": [
+ # The clang available on macOS catalina has a warning that isn't clean on v8 code.
+ "-Wno-range-loop-analysis",
+
+ # To supress warning on deprecated declaration on v8 code. For example:
+ # external/v8/src/base/platform/platform-darwin.cc:56:22: 'getsectdatafromheader_64'
+ # is deprecated: first deprecated in macOS 13.0.
+ # https://bugs.chromium.org/p/v8/issues/detail?id=13428.
+ "-Wno-deprecated-declarations",
+ ],
+ "//conditions:default": [],
}),
includes = ["include"],
linkopts = select({
diff --git a/src/wasm/c-api.cc b/src/wasm/c-api.cc
index 4473e205c0..65a6ec7e1d 100644
--- a/src/wasm/c-api.cc
Expand Down

0 comments on commit c68032e

Please sign in to comment.