Skip to content
This repository was archived by the owner on Dec 16, 2020. It is now read-only.
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 0 additions & 27 deletions bazel/external/wee8.BUILD

This file was deleted.

24 changes: 0 additions & 24 deletions bazel/external/wee8.genrule_cmd

This file was deleted.

19 changes: 19 additions & 0 deletions bazel/foreign_cc/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -290,3 +290,22 @@ envoy_cmake_external(
"//conditions:default": ["libz.a"],
}),
)

configure_make(
name = "wee8",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: sort alphabetically.

configure_command = "third_party/depot_tools/gn",
configure_in_place = True,
configure_options = [
"gen",
"out/wee8",
"""--args='v8_use_external_startup_data=false v8_enable_i18n_support=false v8_enable_gdbjit=false v8_expose_symbols=true is_component_build=false is_debug=false clang_use_chrome_plugins=false use_sysroot=false use_custom_libcxx=false use_glib=false custom_toolchain="//build/toolchain/linux/unbundle:default"'""",
],
lib_source = "@com_googlesource_chromium_v8//:all",
make_commands = [
"third_party/depot_tools/ninja -C out/wee8 wee8",
"mkdir -p $$INSTALL_PREFIX$$/include",
"cp -L -r --no-target-directory third_party/wasm-api $$INSTALL_PREFIX$$/include/wasm-api",
"cp -L -r --no-target-directory out/wee8/obj $$INSTALL_PREFIX$$/lib",
],
static_libraries = ["libwee8.a"],
)
42 changes: 34 additions & 8 deletions bazel/external/wee8.patch → bazel/foreign_cc/wee8.patch
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@
# 3. Fix for VMs with overlapping lifetimes (https://crrev.com/c/1698387).
# 4. Fix linking with unbundled toolchain on macOS.
# 5. Increase VSZ limit to 4TiB (allows us to start up to 370 VMs).
--- a/wee8/build/toolchain/gcc_toolchain.gni
+++ b/wee8/build/toolchain/gcc_toolchain.gni
# 6. Remove Bazel added -fuse-ld=gold if gn chose -fuse-ld=lld

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add: # 7. Disable :compiler_deterministic, because ... (or 6., really).

--- a/build/toolchain/gcc_toolchain.gni
+++ b/build/toolchain/gcc_toolchain.gni
@@ -355,6 +355,8 @@ template("gcc_toolchain") {
# AIX does not support either -D (deterministic output) or response
# files.
Expand All @@ -23,8 +24,8 @@
# the "--start-group .. --end-group" feature isn't available on the aix ld.
start_group_flag = "-Wl,--start-group"
end_group_flag = "-Wl,--end-group "
--- a/wee8/src/wasm/c-api.cc
+++ b/wee8/src/wasm/c-api.cc
--- a/src/wasm/c-api.cc
+++ b/src/wasm/c-api.cc
@@ -633,7 +633,7 @@ auto seal(const typename implement<C>::type* x) -> const C* {
return reinterpret_cast<const C*>(x);
}
Expand Down Expand Up @@ -70,8 +71,8 @@
store->context()->Enter();
isolate->SetData(0, store.get());

--- a/wee8/src/wasm/wasm-memory.cc
+++ b/wee8/src/wasm/wasm-memory.cc
--- a/src/wasm/wasm-memory.cc
+++ b/src/wasm/wasm-memory.cc
@@ -139,7 +139,7 @@ void* TryAllocateBackingStore(WasmMemoryTracker* memory_tracker, Heap* heap,
// address space limits needs to be smaller.
constexpr size_t kAddressSpaceLimit = 0x8000000000L; // 512 GiB
Expand All @@ -81,8 +82,8 @@
#else
constexpr size_t kAddressSpaceLimit = 0xC0000000; // 3 GiB
#endif
--- a/wee8/third_party/wasm-api/wasm.hh
+++ b/wee8/third_party/wasm-api/wasm.hh
--- a/third_party/wasm-api/wasm.hh
+++ b/third_party/wasm-api/wasm.hh
@@ -111,7 +111,7 @@ class vec {
size_t size_;
std::unique_ptr<T[]> data_;
Expand All @@ -92,3 +93,28 @@
void make_data();
void free_data();
#else


Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: extra empty lines between patches.

--- a/build/config/compiler/BUILD.gn
+++ b/build/config/compiler/BUILD.gn
@@ -233,7 +233,6 @@ config("compiler") {
":clang_revision",
":compiler_cpu_abi",
":compiler_codegen",
- ":compiler_deterministic",
]

# In general, Windows is totally different, but all the other builds share
--- a/build/toolchain/wrapper_utils.py
+++ b/build/toolchain/wrapper_utils.py
@@ -63,6 +63,10 @@ def RunLinkWithOptionalMapFile(command, env=None, map_file=None):
Returns:
The exit code of running |command|.
"""
+
+ if "-fuse-ld=lld" in command and "-fuse-ld=gold" in command:
+ command.remove("-fuse-ld=gold")
+
tmp_map_path = None
if map_file and map_file.endswith('.gz'):
tmp_map_path = map_file + '.tmp'
12 changes: 5 additions & 7 deletions bazel/repositories.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -725,17 +725,15 @@ def _com_github_wavm_wavm():
)

def _com_googlesource_chromium_v8():
location = REPOSITORY_LOCATIONS["com_googlesource_chromium_v8"]
genrule_repository(
_repository_impl(
name = "com_googlesource_chromium_v8",
genrule_cmd_file = "@envoy//bazel/external:wee8.genrule_cmd",
build_file = "@envoy//bazel/external:wee8.BUILD",
patches = ["@envoy//bazel/external:wee8.patch"],
**location
build_file_content = BUILD_ALL_CONTENT,
patch_args = ["-p1"],
patches = ["@envoy//bazel/foreign_cc:wee8.patch"],
)
native.bind(
name = "wee8",
actual = "@com_googlesource_chromium_v8//:wee8",
actual = "@envoy//bazel/foreign_cc:wee8",
)

def _foreign_cc_dependencies():
Expand Down
1 change: 1 addition & 0 deletions bazel/repository_locations.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,7 @@ REPOSITORY_LOCATIONS = dict(
# This archive was created using https://storage.googleapis.com/envoyproxy-wee8/wee8-archive.sh
# and contains complete checkout of v8 with all dependencies necessary to build wee8.
sha256 = "690ca8e3460362fba8e95d94c9325211ad477a4d71a392461f899ec91afd1292",
strip_prefix = "wee8",
urls = ["https://storage.googleapis.com/envoyproxy-wee8/wee8-7.6.303.20.tar.gz"],
),
io_opencensus_cpp = dict(
Expand Down