Sam Clegg | c94d393 | 2017-11-17 18:14:09 +0000 | [diff] [blame] | 1 | WebAssembly lld port |
| 2 | ==================== |
| 3 | |
Sam Clegg | bd37e09 | 2018-09-27 00:42:49 +0000 | [diff] [blame] | 4 | Note: The WebAssembly port is still a work in progress and is be lacking |
| 5 | certain features. |
| 6 | |
Sam Clegg | c94d393 | 2017-11-17 18:14:09 +0000 | [diff] [blame] | 7 | The WebAssembly version of lld takes WebAssembly binaries as inputs and produces |
Sam Clegg | bd37e09 | 2018-09-27 00:42:49 +0000 | [diff] [blame] | 8 | a WebAssembly binary as its output. For the most part this port tried to mimic |
| 9 | the behaviour of traditional ELF linkers and specifically the ELF lld port. |
| 10 | Where possible that command line flags and the semantics should be the same. |
Sam Clegg | c94d393 | 2017-11-17 18:14:09 +0000 | [diff] [blame] | 11 | |
| 12 | |
| 13 | Object file format |
| 14 | ------------------ |
| 15 | |
| 16 | The format the input object files that lld expects is specified as part of the |
| 17 | the WebAssembly tool conventions |
| 18 | https://github.com/WebAssembly/tool-conventions/blob/master/Linking.md. |
| 19 | |
| 20 | This is object format that the llvm will produce when run with the |
Sam Clegg | 262e090 | 2018-05-10 17:59:41 +0000 | [diff] [blame] | 21 | ``wasm32-unknown-unknown`` target. To build llvm with WebAssembly support |
Sam Clegg | c94d393 | 2017-11-17 18:14:09 +0000 | [diff] [blame] | 22 | currently requires enabling the experimental backed using |
| 23 | ``-DLLVM_EXPERIMENTAL_TARGETS_TO_BUILD=WebAssembly``. |
| 24 | |
| 25 | |
| 26 | Missing features |
| 27 | ---------------- |
| 28 | |
Sam Clegg | bd37e09 | 2018-09-27 00:42:49 +0000 | [diff] [blame] | 29 | There are several key features that are not yet implement in the WebAssembly |
| 30 | ports: |
| 31 | |
| 32 | - COMDAT support. This means that support for C++ is still very limited. |
| 33 | - Function stripping. Currently there is no support for ``--gc-sections`` so |
| 34 | functions and data from a given object will linked as a unit. |
| 35 | - Section start/end symbols. The synthetic symbols that mark the start and |
| 36 | of data regions are not yet created in the output file. |