Skip to content

build: replace Wasmtime symbol-prefixing patch with privately_linked_cc_library - #568

Open
leonm1 wants to merge 2 commits into
proxy-wasm:mainfrom
leonm1:remove_wasmtime_symbol_prefixing
Open

leonm1 wants to merge 2 commits into
proxy-wasm:mainfrom
leonm1:remove_wasmtime_symbol_prefixing

Conversation

@leonm1

@leonm1 leonm1 commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

Partially link wasmtime using symbol localization via privately_linked_cc_library bazel macro. Permits multiple runtimes to be compiled into the same binary without symbol renaming.

Wasmtime exposes wasm_c_api headers and symbols that collide with other wasm_c_api runtimes (such as V8/wee8) when multiple engines are linked into the same binary (--define engine=multi). Previously, we patched Wasmtime's headers and rewrote its compiled library to redefine symbols to wasmtime_wasm_*. Now, we:

  • Compile library sources against unpatched private_deps headers with linkstatic = True.
  • Partially links compiled sources and static archives from private_deps into a single relocatable object file and localizes all symbols outside public_symbols ("proxy_wasm"):
  • Wraps wasmtime-c-api-impl directly via rust_static_library in wasmtime.BUILD instead of patching out the main.rs.

TAG=agy

Signed-off-by: Matt Leon mattleon@google.com

@leonm1
leonm1 force-pushed the remove_wasmtime_symbol_prefixing branch from 08ddcb3 to 21d4363 Compare November 20, 2026 21:13
…tic-llvm

Newer host glibc headers (C23 const-preserving generic macros in <string.h>,
such as strchr/memchr) return const-qualified pointers when given const inputs,
triggering -Wincompatible-pointer-types-discards-qualifiers (promoted to an
error by -Werror) when compiling C dependencies like @boringssl//:crypto under
--config=hermetic-llvm.

TAG=agy

Signed-off-by: Matt Leon <mattleon@google.com>
…cc_library

Partially link wasmtime using symbol localization via
privately_linked_cc_library bazel macro. Permits multiple runtimes to be
compiled into the same binary without symbol renaming.

Wasmtime exposes wasm_c_api headers and symbols that collide with other
wasm_c_api runtimes (such as V8/wee8) when multiple engines are linked
into the same binary (--define engine=multi). Previously, we patched
Wasmtime's headers and rewrote its compiled library to redefine symbols
to wasmtime_wasm_*. Now, we:

- Compile library sources against unpatched private_deps headers with
  linkstatic = True.
- Partially links compiled sources and static archives from private_deps
  into a single relocatable object file and localizes all symbols
  outside public_symbols ("*proxy_wasm*"):
- Wraps wasmtime-c-api-impl directly via rust_static_library in
  wasmtime.BUILD instead of patching out the main.rs.

TAG=agy

Signed-off-by: Matt Leon <mattleon@google.com>
@leonm1
leonm1 force-pushed the remove_wasmtime_symbol_prefixing branch from 21d4363 to b8fbb96 Compare November 20, 2026 21:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant