2017-11-18 02:14:09 +08:00
|
|
|
WebAssembly lld port
|
|
|
|
====================
|
|
|
|
|
2018-09-27 08:42:49 +08:00
|
|
|
Note: The WebAssembly port is still a work in progress and is be lacking
|
|
|
|
certain features.
|
|
|
|
|
2017-11-18 02:14:09 +08:00
|
|
|
The WebAssembly version of lld takes WebAssembly binaries as inputs and produces
|
2018-09-27 08:42:49 +08:00
|
|
|
a WebAssembly binary as its output. For the most part this port tried to mimic
|
|
|
|
the behaviour of traditional ELF linkers and specifically the ELF lld port.
|
|
|
|
Where possible that command line flags and the semantics should be the same.
|
2017-11-18 02:14:09 +08:00
|
|
|
|
|
|
|
|
|
|
|
Object file format
|
|
|
|
------------------
|
|
|
|
|
|
|
|
The format the input object files that lld expects is specified as part of the
|
|
|
|
the WebAssembly tool conventions
|
|
|
|
https://github.com/WebAssembly/tool-conventions/blob/master/Linking.md.
|
|
|
|
|
|
|
|
This is object format that the llvm will produce when run with the
|
2018-05-11 01:59:41 +08:00
|
|
|
``wasm32-unknown-unknown`` target. To build llvm with WebAssembly support
|
2017-11-18 02:14:09 +08:00
|
|
|
currently requires enabling the experimental backed using
|
|
|
|
``-DLLVM_EXPERIMENTAL_TARGETS_TO_BUILD=WebAssembly``.
|
|
|
|
|
|
|
|
|
|
|
|
Missing features
|
|
|
|
----------------
|
|
|
|
|
2018-09-27 08:42:49 +08:00
|
|
|
There are several key features that are not yet implement in the WebAssembly
|
|
|
|
ports:
|
|
|
|
|
2018-11-15 08:37:21 +08:00
|
|
|
- Support for building shared libraries via ``-shared`` is still as work in
|
|
|
|
progress.
|
2018-09-27 08:42:49 +08:00
|
|
|
- COMDAT support. This means that support for C++ is still very limited.
|
|
|
|
- Function stripping. Currently there is no support for ``--gc-sections`` so
|
|
|
|
functions and data from a given object will linked as a unit.
|
|
|
|
- Section start/end symbols. The synthetic symbols that mark the start and
|
|
|
|
of data regions are not yet created in the output file.
|