[PATCH] D62443: [WebAssembly] Move Emscripten-specific behavior under a --emscripten flag

Dan Gohman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri May 24 21:59:34 PDT 2019


sunfish created this revision.
sunfish added reviewers: sbc100, dschuff, aheejin.
Herald added subscribers: dexonsmith, steven_wu, jgravelle-google, mehdi_amini.
Herald added a project: LLVM.

This adds a --emscripten command-line option to lld, for use by Emscripten.

Issue an error if -shared or -export-dynamic are used without --emscripten, as the current infrastructure for dynamic linking is specific to Emscripten. We've had reports of users attempting to use these options outside of Emscripten, so it's desirable to diagnose this.

And, don't default to exporting __heap_base or __data_end without --emscripten. Exporting these exposes implementation details. Embeddings which need them exported can use `-Wl,--export=__heap_base` and `-Wl,--export=__data_end` as needed to request this explicitly. With this change, statically-linked WASI executables only export "memory" and "_start".


Repository:
  rLLD LLVM Linker

https://reviews.llvm.org/D62443

Files:
  docs/ReleaseNotes.rst
  test/wasm/alias.ll
  test/wasm/cxx-mangling.ll
  test/wasm/data-layout.ll
  test/wasm/entry.ll
  test/wasm/export.ll
  test/wasm/lto/export.ll
  test/wasm/shared-needed.ll
  test/wasm/shared.ll
  test/wasm/stack-first.test
  test/wasm/undefined-data.ll
  test/wasm/undefined-weak-call.ll
  test/wasm/visibility-hidden.ll
  test/wasm/weak-undefined.ll
  wasm/Config.h
  wasm/Driver.cpp
  wasm/Options.td

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D62443.201389.patch
Type: text/x-patch
Size: 26214 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20190525/10b014a0/attachment.bin>


More information about the llvm-commits mailing list