[llvm-dev] Generating exported wasm functions

Jonathan Goodwin via llvm-dev llvm-dev at lists.llvm.org
Sat Nov 17 02:03:53 PST 2018


Using LLVM v5, my Cone compiler (https://github.com/jondgoodwin/cone)
automatically directly generated all functions as named and exported for
both wasm text and binary files (not using clang/lld etc, but using the
API).

Upgrading to LLVM v7, generated wasm object files now fail, exhibiting
markedly different behavior, behavior that varies between the text and
binary files. For example, the binary wasm file (only) now automatically
adds two import directives that were not there before. More importantly,
function names, visible in the wat file, are stripped from the binary wasm
file and are not exported. It seems as if LLVM webassembly codegen has
acted as if the linker were at play and had defaulted to options like:
-fvisibility=hidden, -W1, --import-memory etc.

Is there a way to programmatically (via the LLVM APIs) alter this default
behavior, so that I can make public functions once again visible and
exported?  Also, is there documentation somewhere that describes these and
other breaking changes in the way that LLVM v7  now generates webassembly
object files?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20181117/ab0f10e5/attachment.html>


More information about the llvm-dev mailing list