[all-commits] [llvm/llvm-project] db4ef1: [WebAssembly] Default export tables with `--cooper...

Alex Crichton via All-commits all-commits at lists.llvm.org
Thu Aug 6 15:26:17 PDT 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: db4ef1160ebd5e8fc1a222f16e6688992ce1c596
      https://github.com/llvm/llvm-project/commit/db4ef1160ebd5e8fc1a222f16e6688992ce1c596
  Author: Alex Crichton <alex at alexcrichton.com>
  Date:   2026-08-06 (Thu, 06 Aug 2026)

  Changed paths:
    M lld/test/wasm/cooperative-threading.s
    M lld/wasm/Driver.cpp

  Log Message:
  -----------
  [WebAssembly] Default export tables with `--cooperative-threading` (#208263)

This commit is a change to `wasm-ld`'s behavior when the
`--cooperative-threading` flag is passed to the linker. The change here
is to by default work as if `--export-table` was passed as well. This is
required conventionally on this target because the table is where
function pointers are read from in the component model
`thread.new-indirect` intrinsic. If the table is not exported then
there's no way to turn the core module into a component so it's
effectively required. This behavior only applies to when the table isn't
otherwise imported, for example in shared libraries.

The other motivation behind this change is that it'll avoid the need to
manually specify `-Wl,--export-table` when compiling for the
`wasm32-wasip3` target. This additionally avoids the need for the Clang
driver to figure out if flags like `--import-table` were otherwise
passed. Basically it seemed best to put this in `wasm-ld` itself to
avoid as little juggling of pieces as necessary.

cc WebAssembly/wasi-libc#808



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list