summaryrefslogtreecommitdiffstats
path: root/lld/wasm
Commit message (Collapse)AuthorAgeFilesLines
...
* [WebAssembly] Add "needed" list to dylink sectionSam Clegg2018-12-121-0/+1
| | | | | | Differential Revision: https://reviews.llvm.org/D55613 llvm-svn: 348990
* [WebAssembly] Add support for the event sectionHeejin Ahn2018-12-0815-30/+345
| | | | | | | | | | | | | | | | | Summary: This adds support for the 'event section' specified in the exception handling proposal. Wasm exception handling binary model spec: https://github.com/WebAssembly/exception-handling/blob/master/proposals/Exceptions.md#changes-to-the-binary-model Reviewers: sbc100, ruiu Subscribers: dschuff, jgravelle-google, sunfish, llvm-commits Differential Revision: https://reviews.llvm.org/D54875 llvm-svn: 348703
* [WebAssembly] Don't set a maximum size when importing the tableSam Clegg2018-12-031-1/+1
| | | | | | | | | We shouldn't be setting setting a max size for a table that is being imported. Differential Revision: https://reviews.llvm.org/D55231 llvm-svn: 348204
* [WebAssembly] Allow undefined symbols when building shared librariesSam Clegg2018-11-291-7/+9
| | | | | | Differential Revision: https://reviews.llvm.org/D55043 llvm-svn: 347909
* [WebAssembly] Remove `using` statements from header files. NFC.Sam Clegg2018-11-279-45/+14
| | | | | | Differential Revision: https://reviews.llvm.org/D54758 llvm-svn: 347621
* [WebAssembly] Delete unused using statements (NFC)Heejin Ahn2018-11-216-11/+0
| | | | | | | | | | Reviewers: sbc100, dschuff Subscribers: mehdi_amini, jgravelle-google, sunfish, steven_wu, dexonsmith, llvm-commits Differential Revision: https://reviews.llvm.org/D54683 llvm-svn: 347370
* [WebAssembly] Fix inaccurate comments / assertion messagesHeejin Ahn2018-11-193-6/+4
| | | | | | | | | | Reviewers: sbc100 Subscribers: dschuff, jgravelle-google, sunfish, llvm-commits Differential Revision: https://reviews.llvm.org/D54688 llvm-svn: 347273
* [WebAssembly] Make starting indices calcaulation simpler (NFC)Heejin Ahn2018-11-191-2/+4
| | | | | | | | | | | | | | | | | Summary: At the beginning of `assignIndexes() function, when `FunctionIndex` and `GlobalIndex` variables are created, `InputFunctions` and `InputGlobals` vectors are guaranteed to be empty, because those vectors are only populated in `assignIndexes()` function. Current code looks like they are nonempty, so this patch deletes them for better readability. Reviewers: sbc100 Subscribers: dschuff, jgravelle-google, sunfish, llvm-commits Differential Revision: https://reviews.llvm.org/D54687 llvm-svn: 347272
* [WebAssembly] Import the stack pointer when building shared librariesSam Clegg2018-11-155-64/+83
| | | | | | Differential Revision: https://reviews.llvm.org/D54558 llvm-svn: 346974
* [WebAssembly] Refactor config setting and checking. NFC.Sam Clegg2018-11-151-51/+64
| | | | | | | | This matches the way the ELF backend does it. Differential Revision: https://reviews.llvm.org/D54559 llvm-svn: 346972
* [WebAssembly] Initial support for shared objects (-shared)Sam Clegg2018-11-158-17/+132
| | | | | | | | | | | | Based on the initial spec proposal: https://github.com/WebAssembly/tool-conventions/blob/master/DynamicLinking.md The llvm/codegen side of this is still missing but I believe this change is still worth landing as an incremental step Differential Revision: https://reviews.llvm.org/D54249 llvm-svn: 346918
* [WebAssembly] Respect `--no-mangle` in more locationsSam Clegg2018-11-094-10/+11
| | | | | | | | | | | | | `--no-demangle` now also applies to the name section. This change was motivated by the rust team that have a slightly different name mangling scheme to the standard C++ itanium one and prefer to do their de-mangling as a post-link setp. Patch by Alex Crichton! Differential Revision: https://reviews.llvm.org/D54279 llvm-svn: 346516
* [WebAssembly] Address review comments from r346248 [NFC]Derek Schuff2018-11-061-3/+4
| | | | llvm-svn: 346249
* [WebAssembly] Support creation and import of shared memoriesDerek Schuff2018-11-064-2/+12
| | | | | | | | | Used for WebAssembly threads proposal. Add a flag --shared-memory which sets the IS_SHARED bit in WasmLimits Differential Revision: https://reviews.llvm.org/D54130 llvm-svn: 346248
* Set MAttrs in LTO modeFangrui Song2018-11-011-0/+1
| | | | | | | | | | | | | | | | Summary: Without this patch, MAttrs are not set. Patch by Yin Ma Reviewers: espindola, MaskRay, ruiu, pcc Reviewed By: MaskRay, pcc Subscribers: pcc, emaste, sbc100, inglorion, arichardson, aheejin, steven_wu, llvm-commits Differential Revision: https://reviews.llvm.org/D53446 llvm-svn: 345884
* [WebAssembly] Remove duplicate function. NFC.Sam Clegg2018-11-011-21/+6
| | | | | | Differential Revision: https://reviews.llvm.org/D53963 llvm-svn: 345806
* [WedAssembly] Add -s and -S alias for --strip-all and --strip-debugSam Clegg2018-10-311-0/+2
| | | | llvm-svn: 345767
* Use llvm::arrayRefFromStringRefSam Clegg2018-10-221-1/+1
| | | | | | Differential Revision: https://reviews.llvm.org/D53432 llvm-svn: 344888
* [WebAssembly] Simplify --help messageSam Clegg2018-10-221-9/+7
| | | | | | | | Update wasm to match ELF changes made rL333596. Differential Revision: https://reviews.llvm.org/D53421 llvm-svn: 344887
* Eliminate dependency to formatv(). NFC.Rui Ueyama2018-10-101-3/+3
| | | | llvm-svn: 344177
* Adapt OptTable::PrintHelp change in D51009Fangrui Song2018-10-101-1/+3
| | | | | | | | | | | | | | Summary: Before, OptTable::PrintHelp append "[options] <inputs>" to its parameter `Help`. It is more flexible to change its semantic to `Usage` and let user customize the usage line. Reviewers: rupprecht, ruiu, espindola Reviewed By: rupprecht Subscribers: emaste, sbc100, arichardson, aheejin, llvm-commits Differential Revision: https://reviews.llvm.org/D53054 llvm-svn: 344099
* [WebAssembly] Refactor use of signaturesDerek Schuff2018-10-034-22/+23
| | | | | | | | Update use of WebAssemblySignature to go along with D52580 Differential Revision: https://reviews.llvm.org/D52622 llvm-svn: 343734
* [WebAssembly] Preserve function signatures during LTOSam Clegg2018-09-282-7/+19
| | | | | | | | | | | | | | | | | | | With LTO when and undefined function (with a known signature) in replaced by a defined bitcode function we were loosing the signature information (since bitcode functions don't have signatures). With this change we preserve the original signature from the undefined function and verify that the post LTO compiled function has the correct signature. This change improves the error handling in the case where there is a signature mismatch with a function defined in a bitcode file. Differential Revision: https://reviews.llvm.org/D50721 llvm-svn: 343340
* [WebAssembly] Add --[no]-export-dynamic to replace --export-defaultSam Clegg2018-09-274-16/+24
| | | | | | | | | | | | | | | | | | | | | | | | In a very recent change I introduced a --no-export-default flag but after conferring with others it seems that this feature already exists in gnu GNU ld and lld in the form the --export-dynamic flag which is off by default. This change replaces export-default with export-dynamic and also changes the default to match the traditional linker behaviour. Now, by default, only the entry point is exported. If other symbols are required by the embedder then --export-dynamic or --export can be used to export all visibility hidden symbols or individual symbols respectively. This change touches a lot of tests that were relying on symbols being exported by default. I imagine it will also effect many users but do think the change is worth it match of the traditional behaviour and flag names. Differential Revision: https://reviews.llvm.org/D52587 llvm-svn: 343265
* [WebAssembly] Update Config member to match command line optionSam Clegg2018-09-274-8/+8
| | | | | | | | Subscribers: dschuff, jgravelle-google, aheejin, sunfish, llvm-commits Differential Revision: https://reviews.llvm.org/D50976 llvm-svn: 343157
* [WebAssembly] Add --export-default/--no-export-default optionsSam Clegg2018-09-254-0/+10
| | | | | | | | | | | | | These option control weather or not symbols marked as visibility default are exported in the output binary. By default this is true, but emscripten prefers to control the exported symbol list explicitly at link time and ignore the symbol attributes. Differential Revision: https://reviews.llvm.org/D52003 llvm-svn: 343034
* [WebAssembly] Move .debug_line section address of dead function outside ↵Yury Delendik2018-09-241-2/+3
| | | | | | | | | | | | | | | | | | | | | | section range Summary: Currently we are pointing all debug information that refer removed function code to the beginning of the code section (offset = 0). A debugger may want to resolve code offset to the debug information, which will collide with offsets of the live functions. Moving offsets of dead functions outside code section range. Reviewers: sbc100 Reviewed By: sbc100 Subscribers: dblaikie, ruiu, alexcrichton, dschuff, aprantl, jgravelle-google, aheejin, sunfish, JDevlieghere, llvm-commits Differential Revision: https://reviews.llvm.org/D49446 llvm-svn: 342930
* [WebAssembly] Add v128 value typeThomas Lively2018-09-201-0/+2
| | | | | | | | | | Reviewers: sbc100, aheejin, dschuff Subscribers: jgravelle-google, sunfish, llvm-commits Differential Revision: https://reviews.llvm.org/D52106 llvm-svn: 342690
* [WebAssembly] clang-format (NFC)Heejin Ahn2018-08-295-25/+27
| | | | | | | | | | | | Summary: This patch runs clang-format on all wasm-only files. Reviewers: sbc100 Subscribers: dschuff, jgravelle-google, sunfish, llvm-commits Differential Revision: https://reviews.llvm.org/D51449 llvm-svn: 340970
* Rename a function to follow the LLVM coding style.Rui Ueyama2018-08-271-1/+1
| | | | llvm-svn: 340716
* win: Omit ".exe" from lld warning and error messages.Nico Weber2018-08-221-1/+1
| | | | | | | | | | | This is a minor follow-up to https://reviews.llvm.org/D49189. On Windows, lld used to print "lld-link.exe: error: ...". Now it just prints "lld-link: error: ...". This matches what link.exe does (it prints "LINK : ...") and makes lld's output less dependent on the host system. https://reviews.llvm.org/D51133 llvm-svn: 340487
* [WebAssembly] Optimise relocation processing. NFC.Sam Clegg2018-08-223-37/+52
| | | | | | | | | | | | | | | | | This is a rebased version https://reviews.llvm.org/D42176 which is patch by Nicolas Wilson. Addresses issue: https://github.com/WebAssembly/tool-conventions/issues/32, and https://bugs.llvm.org/show_bug.cgi?id=38650 Previously, for each function/segment we iterated over every relocation to find the relevant ones, which is an n^2 operation. Now, we just make a single pass. Differential Revision: https://reviews.llvm.org/D51063 llvm-svn: 340428
* [WebAssembly] Don't compress LEBs by defaultSam Clegg2018-08-172-1/+9
| | | | | | | | | LEB compression breaks debug info so we don't want to enable it by default, even at high optimization levels. Differential Revision: https://reviews.llvm.org/D50729 llvm-svn: 340073
* [WebAssembly] Group rodata into a single output segmentSam Clegg2018-08-081-0/+2
| | | | | | Differential Revision: https://reviews.llvm.org/D50424 llvm-svn: 339279
* [WebAssembly] --export should fetch lazy symbolsSam Clegg2018-08-061-10/+11
| | | | | | | | | | | --export now implies --undefined This is really a requirement from emscripten but I think it makes sense in general too. Differential Revision: https://reviews.llvm.org/D50287 llvm-svn: 339047
* [WebAssembly] Don't error when --undefined symbols are not foundSam Clegg2018-08-042-50/+31
| | | | | | | | | | | | | | | This matches the behavior of the ELF linker where -u/--undefined means symbols will get pulled in from archives but won't result in link error if they are missing. Also, don't actually great symbol table entries for the undefined symbols, again matching more closely the ELF linker. This also results in simplification of the code. Differential Revision: https://reviews.llvm.org/D50279 llvm-svn: 338938
* Set IsUsedInRegularObj in a consistent manor between COFF, ELF and wasm. NFCSam Clegg2018-08-022-38/+25
| | | | | | Differential Revision: https://reviews.llvm.org/D49147 llvm-svn: 338767
* [WebAssembly] Add support for --whole-archive.Sam Clegg2018-07-234-14/+71
| | | | | | | | Subscribers: dschuff, jgravelle-google, aheejin, sunfish, llvm-commits Differential Revision: https://reviews.llvm.org/D49706 llvm-svn: 337777
* Omit path to lld binary from lld's error, warning, and log output.Nico Weber2018-07-201-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | lld currently prepends the absolute path to itself to every diagnostic it emits. This path can be longer than the diagnostic, and makes the actual error message hard to read. There isn't a good reason for printing this path: if you want to know which lld you're running, pass -v to clang – chances are that if you're unsure of this, you're not only unsure when it errors out. Some people want an indication that the diagnostic is from the linker though, so instead print just the basename of the linker's path. Before: ``` $ out/bin/clang -target x86_64-unknown-linux -x c++ /dev/null -fuse-ld=lld /Users/thakis/src/llvm-mono/out/bin/ld.lld: error: cannot open crt1.o: No such file or directory /Users/thakis/src/llvm-mono/out/bin/ld.lld: error: cannot open crti.o: No such file or directory /Users/thakis/src/llvm-mono/out/bin/ld.lld: error: cannot open crtbegin.o: No such file or directory /Users/thakis/src/llvm-mono/out/bin/ld.lld: error: unable to find library -lgcc /Users/thakis/src/llvm-mono/out/bin/ld.lld: error: unable to find library -lgcc_s /Users/thakis/src/llvm-mono/out/bin/ld.lld: error: unable to find library -lc /Users/thakis/src/llvm-mono/out/bin/ld.lld: error: unable to find library -lgcc /Users/thakis/src/llvm-mono/out/bin/ld.lld: error: unable to find library -lgcc_s /Users/thakis/src/llvm-mono/out/bin/ld.lld: error: cannot open crtend.o: No such file or directory /Users/thakis/src/llvm-mono/out/bin/ld.lld: error: cannot open crtn.o: No such file or directory clang: error: linker command failed with exit code 1 (use -v to see invocation) ``` After: ``` $ out/bin/clang -target x86_64-unknown-linux -x c++ /dev/null -fuse-ld=lld ld.lld: error: cannot open crt1.o: No such file or directory ld.lld: error: cannot open crti.o: No such file or directory ld.lld: error: cannot open crtbegin.o: No such file or directory ld.lld: error: unable to find library -lgcc ld.lld: error: unable to find library -lgcc_s ld.lld: error: unable to find library -lc ld.lld: error: unable to find library -lgcc ld.lld: error: unable to find library -lgcc_s ld.lld: error: cannot open crtend.o: No such file or directory ld.lld: error: cannot open crtn.o: No such file or directory clang: error: linker command failed with exit code 1 (use -v to see invocation) ``` https://reviews.llvm.org/D49189 llvm-svn: 337634
* [WebAssembly] Fix archive member display in error messagesSam Clegg2018-07-182-5/+5
| | | | | | | | | Add a test for this by causing a symbol collision between archive members. Differential Revision: https://reviews.llvm.org/D49343 llvm-svn: 337426
* [WebAssemlby] Set IsUsedInRegularObj correctly for undefined data symbolsSam Clegg2018-07-171-0/+3
| | | | | | Differential Revision: https://reviews.llvm.org/D49113 llvm-svn: 337314
* [WebAssembly] Set threadmodel during LTOSam Clegg2018-07-021-1/+4
| | | | | | | | Subscribers: dschuff, mehdi_amini, inglorion, jgravelle-google, aheejin, sunfish, steven_wu, llvm-commits Differential Revision: https://reviews.llvm.org/D48689 llvm-svn: 336118
* [WebAssembly] Fix --export of LTO symbolsSam Clegg2018-06-283-13/+15
| | | | | | Differential Revision: https://reviews.llvm.org/D48697 llvm-svn: 335881
* [WebAssembly] Add support for bitcode archive membersSam Clegg2018-06-286-10/+24
| | | | | | | | | | This change effects the behavior of --export-all. Previously --export-all would only effect symbols that survived GC. Now --export-all will prevent any non-local symbols from being GCed. Differential Revision: https://reviews.llvm.org/D48673 llvm-svn: 335878
* [WebAssembly] LTO: Fix signatures of undefined functions in bitcodeSam Clegg2018-06-284-14/+20
| | | | | | | | | | | Function symbols that come from bitcode have not signatures. After LTO when the real symbols are read in we need to make sure that we set the signature on the existing symbol. the signature-less undefined functions. Differential Revision: https://reviews.llvm.org/D48693 llvm-svn: 335875
* Revert "[WebAssembly] Error on mismatched function signature in final output"Sam Clegg2018-06-224-28/+11
| | | | | | | | | | This caused a lot of issues on the WebAssembly waterfall. In particular, until with the signature of `main`. We probably want a better solution for main before we re-land. Reverts rL335192 llvm-svn: 335355
* [WebAssembly] Only mark non-hidden symbols as live if they are also definedSam Clegg2018-06-212-3/+4
| | | | | | | | | Previously we were also marking undefined symbols (i.e. imports) as live. Differential Revision: https://reviews.llvm.org/D48299 llvm-svn: 335243
* [WebAssembly] Error on mismatched function signature in final outputSam Clegg2018-06-214-11/+28
| | | | | | | | | | | | | During symbol resolution, emit warnings for function signature mismatches. During GC, if any mismatched symbol is marked as live then generate an error. This means that we only error out if the mismatch is written to the final output. i.e. if we would generate an invalid wasm file. Differential Revision: https://reviews.llvm.org/D48394 llvm-svn: 335192
* [WebAssembly] Update function signature mismatch error message. NFC.Sam Clegg2018-06-201-1/+1
| | | | | | | | | | We don't start our error messages with capital letters. Split out from https://reviews.llvm.org/D48394 Differential Revision: https://reviews.llvm.org/D48400 llvm-svn: 335186
* [WebAssembly] Fix broken build due to missing attributes.incAaron Smith2018-06-131-1/+9
| | | | | | | | | | WebAssembly depends on attributes.h which includes attributes.inc. Unless cmake explicitly specifies this dependency, the .inc file is sometimes generated after the build tries to use it. Patch by Stella Stamenova llvm-svn: 334581
OpenPOWER on IntegriCloud