From cf82fb7919ba9013517aeedd93b3abf30fc65f6b Mon Sep 17 00:00:00 2001 From: Martijn Stevenson Date: Thu, 10 Oct 2024 05:15:30 +0000 Subject: [PATCH] Fix Abseil + RE2 support Depends on Emscripten update in #172. Signed-off-by: Martijn Stevenson --- bazel/defs.bzl | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/bazel/defs.bzl b/bazel/defs.bzl index 2e20a86..62bac57 100644 --- a/bazel/defs.bzl +++ b/bazel/defs.bzl @@ -18,8 +18,12 @@ load("@rules_cc//cc:defs.bzl", "cc_binary") def _optimized_wasm_cc_binary_transition_impl(settings, attr): # TODO(PiotrSikora): Add -flto to copts/linkopts when fixed in emsdk. # See: https://github.com/emscripten-core/emsdk/issues/971 + # + # Define STANDALONE_WASM at compile time as well as link time (below). + # This fixes Abseil by not including Emscripten JS stacktraces + symbolization. + # TODO(martijneken): Remove after Abseil stops using this define. return { - "//command_line_option:copt": ["-O3"], + "//command_line_option:copt": ["-O3", "-DSTANDALONE_WASM"], "//command_line_option:cxxopt": [], "//command_line_option:linkopt": [], "//command_line_option:collect_code_coverage": False, @@ -102,6 +106,8 @@ def proxy_wasm_cc_binary( ) wasm_cc_binary( + standalone = True, + threads = "off", name = "wasm_" + name, cc_target = ":proxy_wasm_" + name.rstrip(".wasm"), tags = tags + [