[PATCH] D41922: [WebAssembly] When loading libraries look for companion `.imports` file

Nicholas Wilson via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Jan 29 05:52:26 PST 2018


ncw added a comment.

I've been having further thoughts about this `libc.imports` business.

What I'm doing in my "minscripten" minimal Wasm toolchain turns the problem the other way up: it's //not// the business of a library file like `libc.a` to declare what symbols it "imports". Instead, at the point when you link, the linker should have all the JavaScript files and so on all available - so as a pre-link step, CMake should be //generating// the `--allow-undefined-symbols` file based on the JavaScript symbols. Emscripten definitely knows that JS symbols are available at the point when in invokes LLD via Clang, so it should be telling LLD which symbols are allowed to be imported.


Repository:
  rLLD LLVM Linker

https://reviews.llvm.org/D41922





More information about the llvm-commits mailing list