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 + [