Skip to content

Commit

Permalink
build, macOS: Allow compiling v8 on macOS 10.15 to 13.0 (envoyproxy#2…
Browse files Browse the repository at this point in the history
…3707)

Signed-off-by: Dhi Aurrahman <dio@rockybars.com>
  • Loading branch information
dio authored Oct 31, 2022
1 parent c854b59 commit 362e415
Showing 1 changed file with 17 additions and 4 deletions.
21 changes: 17 additions & 4 deletions bazel/v8.patch
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
# 1. Use already imported python dependencies
# 2. Disable pointer compression (limits the maximum number of WasmVMs).
# 3. Add support for --define=no_debug_info=1.
# 4. Don't expose Wasm C API (only Wasm C++ API).
# 3. Add support for --define=no_debug_info=1.
# 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.
# 5. Don't expose Wasm C API (only Wasm C++ API).

diff --git a/BUILD.bazel b/BUILD.bazel
index 4e89f90e7e..ced403d5aa 100644
Expand Down Expand Up @@ -30,7 +31,7 @@ index 4e89f90e7e..3fcb38b3f3 100644

# Default setting for v8_enable_pointer_compression.
diff --git a/bazel/defs.bzl b/bazel/defs.bzl
index e957c0fad3..eee285ab60 100644
index e957c0fad3..5870a914aa 100644
--- a/bazel/defs.bzl
+++ b/bazel/defs.bzl
@@ -116,6 +116,7 @@ def _default_args():
Expand All @@ -41,14 +42,26 @@ index e957c0fad3..eee285ab60 100644
"-std=c++17",
],
"@v8//bazel/config:is_gcc": [
@@ -151,6 +152,11 @@ def _default_args():
@@ -151,6 +152,23 @@ def _default_args():
"-fno-integrated-as",
],
"//conditions:default": [],
+ }) + select({
+ "@envoy//bazel:no_debug_info": [
+ "-g0",
+ ],
+ "//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"],
Expand Down

0 comments on commit 362e415

Please sign in to comment.