| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
[lld][test] Remove unsafe-fp-math uses (NFC) (#164598) | 9 个月前 | |
| 8 个月前 | ||
| 8 个月前 | ||
| 1 年前 | ||
[lld][WebAssembly] Fix visibility of __stack_pointer global (#161284) The stack pointer should be global, not hidden / dso-local. Marking it as global allows it to be exported from the main module and imported into side modules. | 10 个月前 | |
[lld][WebAssembly] Ignore local symbols when parsing lazy object files. (#104876) This was broken back in #78658 when we transitioned away from archive indexes to parsing lazy object files. Fixes: #94077 Fixes: https://github.com/emscripten-core/emscripten/issues/22008 | 1 年前 | |
[lld][WebAsssembly] Convert more tests from IR to assembly. NFC Differential Revision: https://reviews.llvm.org/D130738 | 3 年前 | |
[lld][WebAssembly] Convert some lld tests to assembly When we originally wrote these tests we didn't have a stable and fleshed out assembly format. Now we do so we should prefer that over llvm ir for lld tests to avoid including more part of llvm than necessary in order to run the test. This change converts just 30 out of about 130 test files. More to come when I have some more time. Differential Revision: https://reviews.llvm.org/D80361 | 6 年前 | |
[lld][WebAssembly] Match the ELF linker in transitioning away from archive indexes. (#78658) The ELF linker transitioned away from archive indexes in https://reviews.llvm.org/D117284. This paves the way for supporting --start-lib/--end-lib (See #77960) The ELF linker unified library handling with --start-lib/--end-lib and removed the ArchiveFile class in https://reviews.llvm.org/D119074. | 2 年前 | |
| 9 个月前 | ||
| 8 个月前 | ||
[WebAssembly] Added initial type checker to MC Assembler This to protect against non-sensical instruction sequences being assembled, which would either cause asserts/crashes further down, or a Wasm module being output that doesn't validate. Unlike a validator, this type checker is able to give type-errors as part of the parsing process, which makes the assembler much friendlier to be used by humans writing manual input. Because the MC system is single pass (instructions aren't even stored in MC format, they are directly output) the type checker has to be single pass as well, which means that from now on .globaltype and .functype decls must come before their use. An extra pass is added to Codegen to collect information for this purpose, since AsmPrinter is normally single pass / streaming as well, and would otherwise generate this information on the fly. A -no-type-check flag was added to llvm-mc (and any other tools that take asm input) that surpresses type errors, as a quick escape hatch for tests that were not intended to be type correct. This is a first version of the type checker that ignores control flow, i.e. it checks that types are correct along the linear path, but not the branch path. This will still catch most errors. Branch checking could be added in the future. Differential Revision: https://reviews.llvm.org/D104945 | 4 年前 | |
| 8 个月前 | ||
| 8 个月前 | ||
[WebAssembly] Improved LLD error messages in case of mixed wasm32/wasm64 object files Differential Revision: https://reviews.llvm.org/D90428 | 5 年前 | |
[WebAssembly] Improved LLD error messages in case of mixed wasm32/wasm64 object files Differential Revision: https://reviews.llvm.org/D90428 | 5 年前 | |
[WebAssembly] Added initial type checker to MC Assembler This to protect against non-sensical instruction sequences being assembled, which would either cause asserts/crashes further down, or a Wasm module being output that doesn't validate. Unlike a validator, this type checker is able to give type-errors as part of the parsing process, which makes the assembler much friendlier to be used by humans writing manual input. Because the MC system is single pass (instructions aren't even stored in MC format, they are directly output) the type checker has to be single pass as well, which means that from now on .globaltype and .functype decls must come before their use. An extra pass is added to Codegen to collect information for this purpose, since AsmPrinter is normally single pass / streaming as well, and would otherwise generate this information on the fly. A -no-type-check flag was added to llvm-mc (and any other tools that take asm input) that surpresses type errors, as a quick escape hatch for tests that were not intended to be type correct. This is a first version of the type checker that ignores control flow, i.e. it checks that types are correct along the linear path, but not the branch path. This will still catch most errors. Branch checking could be added in the future. Differential Revision: https://reviews.llvm.org/D104945 | 4 年前 | |
| 8 个月前 | ||
[WebAssembly] New-style command support This adds support for new-style command support. In this mode, all exports are considered command entrypoints, and the linker inserts calls to __wasm_call_ctors and __wasm_call_dtors for all such entrypoints. This enables support for: - Command entrypoints taking arguments other than strings and return values other than int. - Multicall executables without requiring on the use of string-based command-line arguments. This new behavior is disabled when the input has an explicit call to __wasm_call_ctors, indicating code not expecting new-style command support. This change does mean that wasm-ld no longer supports DCE-ing the __wasm_call_ctors function when there are no calls to it. If there are no calls to it, and there are ctors present, we assume it's wasm-ld's job to insert the calls. This seems ok though, because if there are ctors present, the program is expecting them to be called. This change affects the init-fini-gc.ll test. | 5 年前 | |
[WebAssembly] New-style command support This adds support for new-style command support. In this mode, all exports are considered command entrypoints, and the linker inserts calls to __wasm_call_ctors and __wasm_call_dtors for all such entrypoints. This enables support for: - Command entrypoints taking arguments other than strings and return values other than int. - Multicall executables without requiring on the use of string-based command-line arguments. This new behavior is disabled when the input has an explicit call to __wasm_call_ctors, indicating code not expecting new-style command support. This change does mean that wasm-ld no longer supports DCE-ing the __wasm_call_ctors function when there are no calls to it. If there are no calls to it, and there are ctors present, we assume it's wasm-ld's job to insert the calls. This seems ok though, because if there are ctors present, the program is expecting them to be called. This change affects the init-fini-gc.ll test. | 5 年前 | |
| 8 个月前 | ||
| 8 个月前 | ||
[lld][WebAssembly] Convert some lld tests to assembly When we originally wrote these tests we didn't have a stable and fleshed out assembly format. Now we do so we should prefer that over llvm ir for lld tests to avoid including more part of llvm than necessary in order to run the test. This change converts just 30 out of about 130 test files. More to come when I have some more time. Differential Revision: https://reviews.llvm.org/D80361 | 6 年前 | |
[Object][WebAssembly] Update format of error messages Error message should start with lowercase in accordance with https://llvm.org/docs/CodingStandards.html#error-and-warning-messages Differential Revision: https://reviews.llvm.org/D95239 | 5 年前 | |
[WebAssembly] GC constructor functions in otherwise unused archive objects This allows __wasilibc_populate_libpreopen to be GC'd in more cases where it isn't needed, including when linked from Rust's libstd. Differential Revision: https://reviews.llvm.org/D85062 | 5 年前 | |
[lld][WebAssembly] Don't GC library objects under --whole-archive Followup on https://reviews.llvm.org/D85062 which ignores entire library objects when no symbols are used within them. This is shouldn't apply with --whole-archive since this is specified to treat them like direct object inputs. Differential Revision: https://reviews.llvm.org/D89290 | 5 年前 | |
[WebAssembly] GC constructor functions in otherwise unused archive objects This allows __wasilibc_populate_libpreopen to be GC'd in more cases where it isn't needed, including when linked from Rust's libstd. Differential Revision: https://reviews.llvm.org/D85062 | 5 年前 | |
[lld][WebAssembly] Renamed a few tests to conform to naming convention. NFC Differential Revision: https://reviews.llvm.org/D143009 | 3 年前 | |
[Coverage][WebAssembly] Add initial support for WebAssembly/WASI (#111332) Currently, WebAssembly/WASI target does not provide direct support for code coverage. This patch set fixes several issues to unlock the feature. The main changes are: 1. Port compiler-rt/lib/profile to WebAssembly/WASI. 2. Adjust profile metadata sections for Wasm object file format. - [CodeGen] Emit __llvm_covmap and __llvm_covfun as custom sections instead of data segments. - [lld] Align the interval space of custom sections at link time. - [llvm-cov] Copy misaligned custom section data if the start address is not aligned. - [llvm-cov] Read __llvm_prf_names from data segments 3. [clang] Link with profile runtime libraries if requested See each commit message for more details and rationale. This is part of the effort to add code coverage support in Wasm target of Swift toolchain. | 1 年前 | |
| 8 个月前 | ||
[WebAssembly] Stabilize custom section order It currently depends on the StringMap iteration order, which is not guaranteed to be deterministic. Use MapVector to stabilize the order. | 2 年前 | |
| 8 个月前 | ||
| 8 个月前 | ||
| 8 个月前 | ||
[lld][test] Remove unsafe-fp-math uses (NFC) (#164598) | 9 个月前 | |
[WebAssembly] Stabilize custom section order It currently depends on the StringMap iteration order, which is not guaranteed to be deterministic. Use MapVector to stabilize the order. | 2 年前 | |
[lld] Fixed a number of typos I went over the output of the following mess of a command: (ulimit -m 2000000; ulimit -v 2000000; git ls-files -z | parallel --xargs -0 cat | aspell list --mode=none --ignore-case | grep -E '^[A-Za-z][a-z]*$' | sort | uniq -c | sort -n | grep -vE '.{25}' | aspell pipe -W3 | grep : | cut -d' ' -f2 | less) and proceeded to spend a few days looking at it to find probable typos and fixed a few hundred of them in all of the llvm project (note, the ones I found are not anywhere near all of them, but it seems like a good start). Differential Revision: https://reviews.llvm.org/D130982 | 3 年前 | |
| 8 个月前 | ||
[WebAssembly] Added initial type checker to MC Assembler This to protect against non-sensical instruction sequences being assembled, which would either cause asserts/crashes further down, or a Wasm module being output that doesn't validate. Unlike a validator, this type checker is able to give type-errors as part of the parsing process, which makes the assembler much friendlier to be used by humans writing manual input. Because the MC system is single pass (instructions aren't even stored in MC format, they are directly output) the type checker has to be single pass as well, which means that from now on .globaltype and .functype decls must come before their use. An extra pass is added to Codegen to collect information for this purpose, since AsmPrinter is normally single pass / streaming as well, and would otherwise generate this information on the fly. A -no-type-check flag was added to llvm-mc (and any other tools that take asm input) that surpresses type errors, as a quick escape hatch for tests that were not intended to be type correct. This is a first version of the type checker that ignores control flow, i.e. it checks that types are correct along the linear path, but not the branch path. This will still catch most errors. Branch checking could be added in the future. Differential Revision: https://reviews.llvm.org/D104945 | 4 年前 | |
[lld][WebAssemlby] Check for command line flags with missing arguments I'm really not sure how this was overlooked when we first ported lld to Wasm. The upstream code in the ELF backend has these two lines but for some reason they never make it into the Wasm version. Differential Revision: https://reviews.llvm.org/D126497 | 4 年前 | |
Reland: "[WebAssembly] Deduplicate imports of the same module name, field name, and type" When two symbols import the same thing, only one import should be emitted in the Wasm file. Fixes https://bugs.llvm.org/show_bug.cgi?id=50938 Reverted in: 16aac493e59519377071e900d119ba2e7e5b525d. Reviewed By: sbc100 Differential Revision: https://reviews.llvm.org/D105519 | 4 年前 | |
Reland: "[WebAssembly] Deduplicate imports of the same module name, field name, and type" When two symbols import the same thing, only one import should be emitted in the Wasm file. Fixes https://bugs.llvm.org/show_bug.cgi?id=50938 Reverted in: 16aac493e59519377071e900d119ba2e7e5b525d. Reviewed By: sbc100 Differential Revision: https://reviews.llvm.org/D105519 | 4 年前 | |
Reland: "[WebAssembly] Deduplicate imports of the same module name, field name, and type" When two symbols import the same thing, only one import should be emitted in the Wasm file. Fixes https://bugs.llvm.org/show_bug.cgi?id=50938 Reverted in: 16aac493e59519377071e900d119ba2e7e5b525d. Reviewed By: sbc100 Differential Revision: https://reviews.llvm.org/D105519 | 4 年前 | |
| 8 个月前 | ||
[lld][WebAssembly] Work around limited architecture detection for wasm64 shared libraries (#98961) We don't currently have a great way to detect the architecture of shared object files under wasm. The currently method involves checking if the imported or exported memory is 64-bit. However some shared libraries don't use linear memory at all. See https://github.com/llvm/llvm-project/issues/98778 | 2 年前 | |
[WebAssembly] Added initial type checker to MC Assembler This to protect against non-sensical instruction sequences being assembled, which would either cause asserts/crashes further down, or a Wasm module being output that doesn't validate. Unlike a validator, this type checker is able to give type-errors as part of the parsing process, which makes the assembler much friendlier to be used by humans writing manual input. Because the MC system is single pass (instructions aren't even stored in MC format, they are directly output) the type checker has to be single pass as well, which means that from now on .globaltype and .functype decls must come before their use. An extra pass is added to Codegen to collect information for this purpose, since AsmPrinter is normally single pass / streaming as well, and would otherwise generate this information on the fly. A -no-type-check flag was added to llvm-mc (and any other tools that take asm input) that surpresses type errors, as a quick escape hatch for tests that were not intended to be type correct. This is a first version of the type checker that ignores control flow, i.e. it checks that types are correct along the linear path, but not the branch path. This will still catch most errors. Branch checking could be added in the future. Differential Revision: https://reviews.llvm.org/D104945 | 4 年前 | |
[lld][WebAssembly] Error on import/export of mutable global without mutable-globals feature Also add the +mutable-globals features in clang when building with -fPIC since the linker will generate mutable globals imports and exports in that case. Differential Revision: https://reviews.llvm.org/D87537 | 5 年前 | |
| 8 个月前 | ||
[WebAssembly] Added initial type checker to MC Assembler This to protect against non-sensical instruction sequences being assembled, which would either cause asserts/crashes further down, or a Wasm module being output that doesn't validate. Unlike a validator, this type checker is able to give type-errors as part of the parsing process, which makes the assembler much friendlier to be used by humans writing manual input. Because the MC system is single pass (instructions aren't even stored in MC format, they are directly output) the type checker has to be single pass as well, which means that from now on .globaltype and .functype decls must come before their use. An extra pass is added to Codegen to collect information for this purpose, since AsmPrinter is normally single pass / streaming as well, and would otherwise generate this information on the fly. A -no-type-check flag was added to llvm-mc (and any other tools that take asm input) that surpresses type errors, as a quick escape hatch for tests that were not intended to be type correct. This is a first version of the type checker that ignores control flow, i.e. it checks that types are correct along the linear path, but not the branch path. This will still catch most errors. Branch checking could be added in the future. Differential Revision: https://reviews.llvm.org/D104945 | 4 年前 | |
[lld][WebAssembly] Convert a bunch more tests to asm. NFC Differential Revision: https://reviews.llvm.org/D120060 | 4 年前 | |
[WebAssembly] Don't error when --undefined symbols are not found 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 | 7 年前 | |
[wasm-ld] Define a __heap_end symbol marking the end of allocated memory. Define a __heap_end symbol that marks the end of the memory region that starts at __heap_base. This will allow malloc implementations to know how much memory they can use at __heap_base even if someone has done a memory.grow before they can initialize their state. Differential Revision: https://reviews.llvm.org/D136110 | 3 年前 | |
[lld][WebAssembly] Convert some lld tests to assembly When we originally wrote these tests we didn't have a stable and fleshed out assembly format. Now we do so we should prefer that over llvm ir for lld tests to avoid including more part of llvm than necessary in order to run the test. This change converts just 30 out of about 130 test files. More to come when I have some more time. Differential Revision: https://reviews.llvm.org/D80361 | 6 年前 | |
[lld][WebAssembly] Add --export-if-defined Unlike the existing --export option this will not causes errors or warnings if the specified symbol is not defined. See: https://github.com/emscripten-core/emscripten/issues/13736 Differential Revision: https://reviews.llvm.org/D99887 | 5 年前 | |
[WebAssembly] Support wasm exports with zero-length names. Zero-length strings are valid export names in WebAssembly, so allow users to specify them. Differential Revision: https://reviews.llvm.org/D71793 | 6 年前 | |
[lld][WebAssembly] Convert some lld tests to assembly When we originally wrote these tests we didn't have a stable and fleshed out assembly format. Now we do so we should prefer that over llvm ir for lld tests to avoid including more part of llvm than necessary in order to run the test. This change converts just 30 out of about 130 test files. More to come when I have some more time. Differential Revision: https://reviews.llvm.org/D80361 | 6 年前 | |
[WebAssembly] Added initial type checker to MC Assembler This to protect against non-sensical instruction sequences being assembled, which would either cause asserts/crashes further down, or a Wasm module being output that doesn't validate. Unlike a validator, this type checker is able to give type-errors as part of the parsing process, which makes the assembler much friendlier to be used by humans writing manual input. Because the MC system is single pass (instructions aren't even stored in MC format, they are directly output) the type checker has to be single pass as well, which means that from now on .globaltype and .functype decls must come before their use. An extra pass is added to Codegen to collect information for this purpose, since AsmPrinter is normally single pass / streaming as well, and would otherwise generate this information on the fly. A -no-type-check flag was added to llvm-mc (and any other tools that take asm input) that surpresses type errors, as a quick escape hatch for tests that were not intended to be type correct. This is a first version of the type checker that ignores control flow, i.e. it checks that types are correct along the linear path, but not the branch path. This will still catch most errors. Branch checking could be added in the future. Differential Revision: https://reviews.llvm.org/D104945 | 4 年前 | |
[WebAssembly] Rename WasmLimits::Initial to ::Minimum. NFC. This patch renames the "Initial" member of WasmLimits to the name used in the spec, "Minimum". In the core WebAssembly specification, the Limits data type has one required "min" member and one optional "max" member, indicating the minimum required size of the corresponding table or memory, and the maximum size, if any. Although the WebAssembly spec does instantiate locally-defined tables and memories with the initial size being equal to the minimum size, it can't impose such a requirement for imports. It doesn't make sense to require an initial size for a memory import, for example. The compiler can only sensibly express the minimum and maximum sizes. See https://github.com/WebAssembly/js-types/blob/master/proposals/js-types/Overview.md#naming-of-size-limits for a related discussion that agrees that the right name of "initial" is "minimum" when querying the type of a table or memory from JavaScript. (Of course it still makes sense for JS to speak in terms of an initial size when it explicitly instantiates memories and tables.) Differential Revision: https://reviews.llvm.org/D99186 | 5 年前 | |
[WebAssembly] Rename WasmLimits::Initial to ::Minimum. NFC. This patch renames the "Initial" member of WasmLimits to the name used in the spec, "Minimum". In the core WebAssembly specification, the Limits data type has one required "min" member and one optional "max" member, indicating the minimum required size of the corresponding table or memory, and the maximum size, if any. Although the WebAssembly spec does instantiate locally-defined tables and memories with the initial size being equal to the minimum size, it can't impose such a requirement for imports. It doesn't make sense to require an initial size for a memory import, for example. The compiler can only sensibly express the minimum and maximum sizes. See https://github.com/WebAssembly/js-types/blob/master/proposals/js-types/Overview.md#naming-of-size-limits for a related discussion that agrees that the right name of "initial" is "minimum" when querying the type of a table or memory from JavaScript. (Of course it still makes sense for JS to speak in terms of an initial size when it explicitly instantiates memories and tables.) Differential Revision: https://reviews.llvm.org/D99186 | 5 年前 | |
[lld][WebAssembly] Rewrite exports test in assembly. NFC Differential Revision: https://reviews.llvm.org/D99885 | 5 年前 | |
| 8 个月前 | ||
[lld][WebAssembly] Convert a bunch more tests to asm. NFC Differential Revision: https://reviews.llvm.org/D120060 | 4 年前 | |
[WebAssembly] Support annotate clang attributes for marking functions. Annotation attributes may be attached to a function to mark it with custom data that will be contained in the final Wasm file. The annotation causes a custom section named "func_attr.annotate.<name>.<arg0>.<arg1>..." to be created that will contain each function's index value that was marked with the annotation. A new patchable relocation type for function indexes had to be created so the custom section could be updated during linking. Reviewed By: sbc100 Differential Revision: https://reviews.llvm.org/D150803 | 3 年前 | |
[WebAssembly] Support annotate clang attributes for marking functions. Annotation attributes may be attached to a function to mark it with custom data that will be contained in the final Wasm file. The annotation causes a custom section named "func_attr.annotate.<name>.<arg0>.<arg1>..." to be created that will contain each function's index value that was marked with the annotation. A new patchable relocation type for function indexes had to be created so the custom section could be updated during linking. Reviewed By: sbc100 Differential Revision: https://reviews.llvm.org/D150803 | 3 年前 | |
[wasm-ld] Update supported features in the generic CPU configuration Accompanying https://reviews.llvm.org/D125728, this updates LLVM Codegen's "generic" CPU to enable the same new features. Differential Revision: https://reviews.llvm.org/D125729 | 3 年前 | |
[lld][WebAssembly] Convert a bunch more tests to asm. NFC Differential Revision: https://reviews.llvm.org/D120060 | 4 年前 | |
[lld][WebAssembly] Convert some lld tests to assembly When we originally wrote these tests we didn't have a stable and fleshed out assembly format. Now we do so we should prefer that over llvm ir for lld tests to avoid including more part of llvm than necessary in order to run the test. This change converts just 30 out of about 130 test files. More to come when I have some more time. Differential Revision: https://reviews.llvm.org/D80361 | 6 年前 | |
[WebAssembly] Added initial type checker to MC Assembler This to protect against non-sensical instruction sequences being assembled, which would either cause asserts/crashes further down, or a Wasm module being output that doesn't validate. Unlike a validator, this type checker is able to give type-errors as part of the parsing process, which makes the assembler much friendlier to be used by humans writing manual input. Because the MC system is single pass (instructions aren't even stored in MC format, they are directly output) the type checker has to be single pass as well, which means that from now on .globaltype and .functype decls must come before their use. An extra pass is added to Codegen to collect information for this purpose, since AsmPrinter is normally single pass / streaming as well, and would otherwise generate this information on the fly. A -no-type-check flag was added to llvm-mc (and any other tools that take asm input) that surpresses type errors, as a quick escape hatch for tests that were not intended to be type correct. This is a first version of the type checker that ignores control flow, i.e. it checks that types are correct along the linear path, but not the branch path. This will still catch most errors. Branch checking could be added in the future. Differential Revision: https://reviews.llvm.org/D104945 | 4 年前 | |
| 8 个月前 | ||
| 8 个月前 | ||
| 8 个月前 | ||
[WebAssembly] Rename WasmLimits::Initial to ::Minimum. NFC. This patch renames the "Initial" member of WasmLimits to the name used in the spec, "Minimum". In the core WebAssembly specification, the Limits data type has one required "min" member and one optional "max" member, indicating the minimum required size of the corresponding table or memory, and the maximum size, if any. Although the WebAssembly spec does instantiate locally-defined tables and memories with the initial size being equal to the minimum size, it can't impose such a requirement for imports. It doesn't make sense to require an initial size for a memory import, for example. The compiler can only sensibly express the minimum and maximum sizes. See https://github.com/WebAssembly/js-types/blob/master/proposals/js-types/Overview.md#naming-of-size-limits for a related discussion that agrees that the right name of "initial" is "minimum" when querying the type of a table or memory from JavaScript. (Of course it still makes sense for JS to speak in terms of an initial size when it explicitly instantiates memories and tables.) Differential Revision: https://reviews.llvm.org/D99186 | 5 年前 | |
[WebAssembly] Added initial type checker to MC Assembler This to protect against non-sensical instruction sequences being assembled, which would either cause asserts/crashes further down, or a Wasm module being output that doesn't validate. Unlike a validator, this type checker is able to give type-errors as part of the parsing process, which makes the assembler much friendlier to be used by humans writing manual input. Because the MC system is single pass (instructions aren't even stored in MC format, they are directly output) the type checker has to be single pass as well, which means that from now on .globaltype and .functype decls must come before their use. An extra pass is added to Codegen to collect information for this purpose, since AsmPrinter is normally single pass / streaming as well, and would otherwise generate this information on the fly. A -no-type-check flag was added to llvm-mc (and any other tools that take asm input) that surpresses type errors, as a quick escape hatch for tests that were not intended to be type correct. This is a first version of the type checker that ignores control flow, i.e. it checks that types are correct along the linear path, but not the branch path. This will still catch most errors. Branch checking could be added in the future. Differential Revision: https://reviews.llvm.org/D104945 | 4 年前 | |
| 8 个月前 | ||
[lld][WebAssemby] Allow import module names to be empty strings. The component-model [canonical ABI] is currently using import names with empty strings. Remove the special cases for empty strings from WasmObjectFile.cpp so that they can pass through as-is. [canonical ABI]: https://github.com/WebAssembly/component-model/blob/main/design/mvp/CanonicalABI.md Differential Revision: https://reviews.llvm.org/D133037 | 3 年前 | |
[lld][WebAssemby] Allow import module names to be empty strings. The component-model [canonical ABI] is currently using import names with empty strings. Remove the special cases for empty strings from WasmObjectFile.cpp so that they can pass through as-is. [canonical ABI]: https://github.com/WebAssembly/component-model/blob/main/design/mvp/CanonicalABI.md Differential Revision: https://reviews.llvm.org/D133037 | 3 年前 | |
[WebAssembly] Define call-indirect-overlong and bulk-memory-opt features (#117087) This defines some new target features. These are subsets of existing features that reflect implementation concerns: - "call-indirect-overlong" - implied by "reference-types"; just the overlong encoding for the call_indirect immediate, and not the actual reference types. - "bulk-memory-opt" - implied by "bulk-memory": just memory.copy and memory.fill, and not the other instructions in the bulk-memory proposal. This is split out from https://github.com/llvm/llvm-project/pull/112035. --------- Co-authored-by: Heejin Ahn <aheejin@gmail.com> | 1 年前 | |
[lld][WebAssembly] Fix for --import-table when combined with reference types (#97451) When reference types are enabled clang will generate call_indirect instructions that explicitly reference the global __indirect_function_table symbol. In this case the resulting global symbol was not being correctly marked with explicit import name/module, resulting in the linker reporting errors when it was referenced. This issue was reported in https://github.com/WebAssembly/tool-conventions/issues/158 | 2 年前 | |
[LowerGlobalDtors] Skip __cxa_atexit call completely when arg0 is unused (#68758) In emscripten we have a build mode (the default actually) where the runtime never exits and therefore __cxa_atexit is a dummy/stub function that does nothing. In this case we would like to be able completely DCE any otherwise-unused global dtor functions. Fixes: https://github.com/emscripten-core/emscripten/issues/19993 | 2 年前 | |
| 8 个月前 | ||
[lld][WebAssembly] Support for the custom-page-sizes WebAssembly proposal (#128942) This commit adds support for WebAssembly's custom-page-sizes proposal to wasm-ld. An overview of the proposal can be found [here](https://github.com/WebAssembly/custom-page-sizes/blob/main/proposals/custom-page-sizes/Overview.md). In a sentence, it allows customizing a Wasm memory's page size, enabling Wasm to target environments with less than 64KiB of memory (the default Wasm page size) available for Wasm memories. This commit contains the following: * Adds a --page-size=N CLI flag to wasm-ld for configuring the linked Wasm binary's linear memory's page size. * When the page size is configured to a non-default value, then the final Wasm binary will use the encodings defined in the custom-page-sizes proposal to declare the linear memory's page size. * Defines a __wasm_first_page_end symbol, whose address points to the first page in the Wasm linear memory, a.k.a. is the Wasm memory's page size. This allows writing code that is compatible with any page size, and doesn't require re-compiling its object code. At the same time, because it just lowers to a constant rather than a memory access or something, it enables link-time optimization. * Adds tests for these new features. r? @sbc100 cc @sunfishcode | 1 年前 | |
[WebAssembly] Define call-indirect-overlong and bulk-memory-opt features (#117087) This defines some new target features. These are subsets of existing features that reflect implementation concerns: - "call-indirect-overlong" - implied by "reference-types"; just the overlong encoding for the call_indirect immediate, and not the actual reference types. - "bulk-memory-opt" - implied by "bulk-memory": just memory.copy and memory.fill, and not the other instructions in the bulk-memory proposal. This is split out from https://github.com/llvm/llvm-project/pull/112035. --------- Co-authored-by: Heejin Ahn <aheejin@gmail.com> | 1 年前 | |
[lld][WebAssembly] Convert some lld tests to assembly When we originally wrote these tests we didn't have a stable and fleshed out assembly format. Now we do so we should prefer that over llvm ir for lld tests to avoid including more part of llvm than necessary in order to run the test. This change converts just 30 out of about 130 test files. More to come when I have some more time. Differential Revision: https://reviews.llvm.org/D80361 | 6 年前 | |
| 8 个月前 | ||
[lld][WebAssembly] -r: force -Bstatic (#108264) This is a port of a recent ELF linker change: 8cc6a2469. | 11 个月前 | |
[NFC][Py Reformat] Reformat python files in the rest of the dirs This is an ongoing series of commits that are reformatting our Python code. This catches the last of the python files to reformat. Since they where so few I bunched them together. Reformatting is done with black. If you end up having problems merging this commit because you have made changes to a python file, the best way to handle that is to run git checkout --ours <yourfile> and then reformat it with black. If you run into any problems, post to discourse about it and we will try to help. RFC Thread below: https://discourse.llvm.org/t/rfc-document-and-standardize-python-code-style Reviewed By: jhenderson, #libc, Mordante, sivachandra Differential Revision: https://reviews.llvm.org/D150784 | 3 年前 | |
[WebAssembly] Add support for named globals in the object format. Differential Revision: https://reviews.llvm.org/D91769 | 5 年前 | |
| 8 个月前 | ||
| 8 个月前 | ||
Reland "[lib/Support/YAMLTraits] - Don't print leading zeroes when dumping Hex8/Hex16/Hex32 types." (https://reviews.llvm.org/D90930). This reverts reverting commit fc40a03323a4b265ccbed34a07e281b13c5e8367 and fixes LLD (MachO/wasm) tests that failed previously. | 5 年前 | |
| 8 个月前 | ||
| 8 个月前 | ||
[WebAssembly] Support annotate clang attributes for marking functions. Annotation attributes may be attached to a function to mark it with custom data that will be contained in the final Wasm file. The annotation causes a custom section named "func_attr.annotate.<name>.<arg0>.<arg1>..." to be created that will contain each function's index value that was marked with the annotation. A new patchable relocation type for function indexes had to be created so the custom section could be updated during linking. Reviewed By: sbc100 Differential Revision: https://reviews.llvm.org/D150803 | 3 年前 | |
[Object][Wasm] Use file offset for section addresses in linked wasm files (#80529) Wasm has no unified virtual memory space as other object formats and architectures do, so previously WasmObjectFile reported 0 for all section addresses, and until 428cf71ff used section offsets for function symbols. Now we use file offsets for function symbols, and this change switches section addresses to do the same (in linked files). The main result of this is that objdump now reports VMAs in section listings, and also uses file offets rather than section offsets when disassembling linked binaries (matching the behavior of other disassemblers and stack traces produced by browwsers). To make this work, this PR also updates objdump's generation of synthetics fallback symbols to match lib/Object and also correctly plumbs symbol types for regular and dummy symbols through to the backend to avoid needing special knowledge of address 0. This also paves the way for generating symbols from name sections rather than symbol tables or imports (see #76107) by allowing the disassembler's synthetic fallback symbols match the name-section generated symbols (in a followup PR). | 2 年前 | |
| 8 个月前 | ||
| 8 个月前 | ||
[WebAssembly] Added initial type checker to MC Assembler This to protect against non-sensical instruction sequences being assembled, which would either cause asserts/crashes further down, or a Wasm module being output that doesn't validate. Unlike a validator, this type checker is able to give type-errors as part of the parsing process, which makes the assembler much friendlier to be used by humans writing manual input. Because the MC system is single pass (instructions aren't even stored in MC format, they are directly output) the type checker has to be single pass as well, which means that from now on .globaltype and .functype decls must come before their use. An extra pass is added to Codegen to collect information for this purpose, since AsmPrinter is normally single pass / streaming as well, and would otherwise generate this information on the fly. A -no-type-check flag was added to llvm-mc (and any other tools that take asm input) that surpresses type errors, as a quick escape hatch for tests that were not intended to be type correct. This is a first version of the type checker that ignores control flow, i.e. it checks that types are correct along the linear path, but not the branch path. This will still catch most errors. Branch checking could be added in the future. Differential Revision: https://reviews.llvm.org/D104945 | 4 年前 | |
[lld][WebAssembly] Fix check for implicitly exported mutable globals (#160966) This check is designed to avoid exporting mutable globals in the case when mutable globals are not available. However, it was being applied in all cases even when mutable globals was enabled. This error is particularly bad since mutable-globals have been enabled in default CPU for a while now, meaning that this condition should not be firing in the wild very often. | 10 个月前 | |
[WebAssembly] Added initial type checker to MC Assembler This to protect against non-sensical instruction sequences being assembled, which would either cause asserts/crashes further down, or a Wasm module being output that doesn't validate. Unlike a validator, this type checker is able to give type-errors as part of the parsing process, which makes the assembler much friendlier to be used by humans writing manual input. Because the MC system is single pass (instructions aren't even stored in MC format, they are directly output) the type checker has to be single pass as well, which means that from now on .globaltype and .functype decls must come before their use. An extra pass is added to Codegen to collect information for this purpose, since AsmPrinter is normally single pass / streaming as well, and would otherwise generate this information on the fly. A -no-type-check flag was added to llvm-mc (and any other tools that take asm input) that surpresses type errors, as a quick escape hatch for tests that were not intended to be type correct. This is a first version of the type checker that ignores control flow, i.e. it checks that types are correct along the linear path, but not the branch path. This will still catch most errors. Branch checking could be added in the future. Differential Revision: https://reviews.llvm.org/D104945 | 4 年前 | |
[WebAssembly] Added initial type checker to MC Assembler This to protect against non-sensical instruction sequences being assembled, which would either cause asserts/crashes further down, or a Wasm module being output that doesn't validate. Unlike a validator, this type checker is able to give type-errors as part of the parsing process, which makes the assembler much friendlier to be used by humans writing manual input. Because the MC system is single pass (instructions aren't even stored in MC format, they are directly output) the type checker has to be single pass as well, which means that from now on .globaltype and .functype decls must come before their use. An extra pass is added to Codegen to collect information for this purpose, since AsmPrinter is normally single pass / streaming as well, and would otherwise generate this information on the fly. A -no-type-check flag was added to llvm-mc (and any other tools that take asm input) that surpresses type errors, as a quick escape hatch for tests that were not intended to be type correct. This is a first version of the type checker that ignores control flow, i.e. it checks that types are correct along the linear path, but not the branch path. This will still catch most errors. Branch checking could be added in the future. Differential Revision: https://reviews.llvm.org/D104945 | 4 年前 | |
[lld][WebAssembly] Report undefined symbols in -shared/-pie builds (#75242) Previously we would ignore all undefined symbols when using -shared or -pie. All undefined symbols would be treated as imports regardless of whether those symbols we defined in any shared library. With this change we now track symbol in shared libraries and report undefined symbols in the main program by default. The old behavior is still available via the --unresolved-symbols=import-dynamic command line flag. This rationale for allowing this type of breaking change is that -pie and -shared are both still experimental will warn as such, unless --experimental-pic is passed. As part of this change the linker now models shared library symbols via new SharedFunctionSymbol and SharedDataSymbol types. I've also added a new --no-shlib-sigcheck option that bypassed the checking of functions signature in shared libraries. This is specifically required by emscripten the case where the imports/exports of shared libraries have been modified by via JS type legalization (this is only needed when targeting old JS engines where bigint is not yet available See https://github.com/emscripten-core/emscripten/issues/18198 | 2 年前 | |
| 8 个月前 | ||
| 8 个月前 | ||
[lld][WebAssembly] Convert some lld tests to assembly When we originally wrote these tests we didn't have a stable and fleshed out assembly format. Now we do so we should prefer that over llvm ir for lld tests to avoid including more part of llvm than necessary in order to run the test. This change converts just 30 out of about 130 test files. More to come when I have some more time. Differential Revision: https://reviews.llvm.org/D80361 | 6 年前 | |
| 8 个月前 | ||
| 8 个月前 | ||
| 11 个月前 | ||
[MC][WebAssembly] Fix crash when relocation addend underlows U32 For the object file writer we need to allow the underflow (ar write zero), but for the final linker output we should probably generate an error (I've left that as a TODO for now). Fixes: https://github.com/llvm/llvm-project/issues/54012 Differential Revision: https://reviews.llvm.org/D120522 | 4 年前 | |
| 8 个月前 | ||
[WebAssembly] Added initial type checker to MC Assembler This to protect against non-sensical instruction sequences being assembled, which would either cause asserts/crashes further down, or a Wasm module being output that doesn't validate. Unlike a validator, this type checker is able to give type-errors as part of the parsing process, which makes the assembler much friendlier to be used by humans writing manual input. Because the MC system is single pass (instructions aren't even stored in MC format, they are directly output) the type checker has to be single pass as well, which means that from now on .globaltype and .functype decls must come before their use. An extra pass is added to Codegen to collect information for this purpose, since AsmPrinter is normally single pass / streaming as well, and would otherwise generate this information on the fly. A -no-type-check flag was added to llvm-mc (and any other tools that take asm input) that surpresses type errors, as a quick escape hatch for tests that were not intended to be type correct. This is a first version of the type checker that ignores control flow, i.e. it checks that types are correct along the linear path, but not the branch path. This will still catch most errors. Branch checking could be added in the future. Differential Revision: https://reviews.llvm.org/D104945 | 4 年前 | |
[lld][WebAssembly] Fix resolveIndirectFunctionTable for relocatable output For relocatable output that needs the indirect function table, identify the well-known function table. This allows us to properly fix the limits on the imported table, and in a followup will allow the element section to reference the indirect function table even if it's not assigned to table number 0. Adapt tests for import reordering. Differential Revision: https://reviews.llvm.org/D96770 | 5 年前 | |
lld: Convert tests to opaque pointers | 3 年前 | |
[WebAssembly] Use GeneralDynamic TLS for exception handling builtins. These global TLS symbols are shared across all shared libraries and therefor should not be assumed to be local to the current module. Also add new error in the linker when TLS relocations are used against undefined symbols. TLS relocations are offsets into the current modules tls data segment, and don't make sense for undefined symbols which are modeled as global imports. Fixes: https://github.com/emscripten-core/emscripten/issues/13398 Differential Revision: https://reviews.llvm.org/D119630 | 4 年前 | |
[lld] Remove shell requirements from tests These tests all pass inside the lit internal shell. A couple were marked as requiring a shell to exclude them on Windows. Update those tests to explicitly carve out Windows rather than any configuration that does not provide the shell feature. Towards #102700. Reviewers: petrhosek, cmtice, mysterymath, MaskRay, ilovepi Reviewed By: cmtice Pull Request: https://github.com/llvm/llvm-project/pull/156510 | 10 个月前 | |
[WebAssembly] Rename WasmLimits::Initial to ::Minimum. NFC. This patch renames the "Initial" member of WasmLimits to the name used in the spec, "Minimum". In the core WebAssembly specification, the Limits data type has one required "min" member and one optional "max" member, indicating the minimum required size of the corresponding table or memory, and the maximum size, if any. Although the WebAssembly spec does instantiate locally-defined tables and memories with the initial size being equal to the minimum size, it can't impose such a requirement for imports. It doesn't make sense to require an initial size for a memory import, for example. The compiler can only sensibly express the minimum and maximum sizes. See https://github.com/WebAssembly/js-types/blob/master/proposals/js-types/Overview.md#naming-of-size-limits for a related discussion that agrees that the right name of "initial" is "minimum" when querying the type of a table or memory from JavaScript. (Of course it still makes sense for JS to speak in terms of an initial size when it explicitly instantiates memories and tables.) Differential Revision: https://reviews.llvm.org/D99186 | 5 年前 | |
[lld][WebAssembly] Add RUNTIME_PATH support to wasm-ld (#129050) This finishes adding RPATH support for WebAssembly. See my previous PR which added RPATH support to yaml2obj and obj2yaml: https://github.com/llvm/llvm-project/pull/126080 See corresponding update to the WebAssembly/tool-conventions repo on dynamic linking: https://github.com/WebAssembly/tool-conventions/pull/246 | 1 年前 | |
[lld][WebAssembly] Use writePtrConst helper function (#166228) This is especially important for writing i32 values larger than 2gb which need to be encoded as negative SLEB vales in the binary. Without this change offsets over 2gb are wrongly encoded and cause validation errors. Fixes: https://github.com/emscripten-core/emscripten/issues/25706 | 8 个月前 | |
[WebAssembly] Stabilize custom section order It currently depends on the StringMap iteration order, which is not guaranteed to be deterministic. Use MapVector to stabilize the order. | 2 年前 | |
[lld][WebAssembly] Convert more tests to asm format. NFC Two of these are trivial. The third (shared.s) did have some expectations changes but only due to two data symbols being re-ordered. Differential Revision: https://reviews.llvm.org/D101711 | 5 年前 | |
[lld][WebAssembly] Fix for shared library symbols WRT replacing lazy symbols (#124619) The rule here, which I'm copying from the ELF linker, is that shared library symbols should take presence, unless the symbol has already be extracted from the archive. e.g: $ wasm-ld foo.a foo.so ref.o // .so wins $ wasm-ld foo.a ref.o foo.so // .a wins In the first case the shared library takes precedence because the lazy symbol is replaced by the .so symbol before it is extracted from the archive. In the second example the ref.o file causes the archive to be exracted before the .so file is processed, so in that case the archive file wins. Fixes: https://github.com/emscripten-core/emscripten/issues/23501 | 1 年前 | |
[lld][WebAssembly] Initialize bss segments using memory.fill Previously we were relying on the dynamic loader to take care of this but it simple and correct for us to do it here instead. Now we initialize bss segments as part of __wasm_init_memory at the same time we initialize passive segments. In addition we extent the us of __wasm_init_memory outside of shared memory situations. Specifically it is now used to initialize bss segments when the memory is imported. Differential Revision: https://reviews.llvm.org/D112667 | 4 年前 | |
| 8 个月前 | ||
| 8 个月前 | ||
[lld][WebAssembly] Report undefined symbols in -shared/-pie builds (#75242) Previously we would ignore all undefined symbols when using -shared or -pie. All undefined symbols would be treated as imports regardless of whether those symbols we defined in any shared library. With this change we now track symbol in shared libraries and report undefined symbols in the main program by default. The old behavior is still available via the --unresolved-symbols=import-dynamic command line flag. This rationale for allowing this type of breaking change is that -pie and -shared are both still experimental will warn as such, unless --experimental-pic is passed. As part of this change the linker now models shared library symbols via new SharedFunctionSymbol and SharedDataSymbol types. I've also added a new --no-shlib-sigcheck option that bypassed the checking of functions signature in shared libraries. This is specifically required by emscripten the case where the imports/exports of shared libraries have been modified by via JS type legalization (this is only needed when targeting old JS engines where bigint is not yet available See https://github.com/emscripten-core/emscripten/issues/18198 | 2 年前 | |
[lld][WebAssembly] Avoid emitting empty __wasm_apply_data_relocs function (#109249) Instead of always generating __wasm_apply_data_relocs when relevant options like -pie and -shared are specified, generate it only when the relevant relocations are actually necessary. Note: omitting empty __wasm_apply_data_relocs is not a problem because the export is optional in the spec (DynamicLinking.md) and all runtime linker implementations I'm aware of implement it that way. (emscripten, toywasm, wasm-tools) Motivations: * This possibly reduces the module size * This is also a preparation to fix https://github.com/llvm/llvm-project/issues/107387, for which it isn't obvious if we need these relocations at the time of createSyntheticSymbols. (unless we introduce a new explicit option like --non-pie-dynamic-link.) | 1 年前 | |
[lld] Remove usage of %T in lld/test (#126133) %T is not unique and deprecated [[1](https://llvm.org/docs/CommandGuide/lit.html#substitutions)]. This patch replaces all %T in lld/test with %t.dir (mkdir if necessary) --------- Signed-off-by: Peter Rong <PeterRong@meta.com> | 1 年前 | |
[lld][WebAssembly] Report undefined symbols in -shared/-pie builds (#75242) Previously we would ignore all undefined symbols when using -shared or -pie. All undefined symbols would be treated as imports regardless of whether those symbols we defined in any shared library. With this change we now track symbol in shared libraries and report undefined symbols in the main program by default. The old behavior is still available via the --unresolved-symbols=import-dynamic command line flag. This rationale for allowing this type of breaking change is that -pie and -shared are both still experimental will warn as such, unless --experimental-pic is passed. As part of this change the linker now models shared library symbols via new SharedFunctionSymbol and SharedDataSymbol types. I've also added a new --no-shlib-sigcheck option that bypassed the checking of functions signature in shared libraries. This is specifically required by emscripten the case where the imports/exports of shared libraries have been modified by via JS type legalization (this is only needed when targeting old JS engines where bigint is not yet available See https://github.com/emscripten-core/emscripten/issues/18198 | 2 年前 | |
[lld][WebAssembly] Report undefined symbols in -shared/-pie builds (#75242) Previously we would ignore all undefined symbols when using -shared or -pie. All undefined symbols would be treated as imports regardless of whether those symbols we defined in any shared library. With this change we now track symbol in shared libraries and report undefined symbols in the main program by default. The old behavior is still available via the --unresolved-symbols=import-dynamic command line flag. This rationale for allowing this type of breaking change is that -pie and -shared are both still experimental will warn as such, unless --experimental-pic is passed. As part of this change the linker now models shared library symbols via new SharedFunctionSymbol and SharedDataSymbol types. I've also added a new --no-shlib-sigcheck option that bypassed the checking of functions signature in shared libraries. This is specifically required by emscripten the case where the imports/exports of shared libraries have been modified by via JS type legalization (this is only needed when targeting old JS engines where bigint is not yet available See https://github.com/emscripten-core/emscripten/issues/18198 | 2 年前 | |
[lld][WebAssembly] Return 0 for synthetic function offsets (#96134) When two or more functions' signatures differ, one of them is selected and for other signatures unreachable stubs are generated: https://github.com/llvm/llvm-project/blob/57778ec36c9c7e96b76a167f19dccbe00d49c9d4/lld/wasm/SymbolTable.cpp#L975 https://github.com/llvm/llvm-project/blob/57778ec36c9c7e96b76a167f19dccbe00d49c9d4/lld/wasm/SymbolTable.cpp#L852-L870 And when these SyntheticFunctions are generated, this constructor is used, https://github.com/llvm/llvm-project/blob/57778ec36c9c7e96b76a167f19dccbe00d49c9d4/lld/wasm/InputChunks.h#L266-L269 which does not set its function field: https://github.com/llvm/llvm-project/blob/57778ec36c9c7e96b76a167f19dccbe00d49c9d4/lld/wasm/InputChunks.h#L304 As a result, the function field contains a garbage value for these stub functions. InputFunction::getFunctionCodeOffset() is called when relocations are resolved for .debug_info section to get functions' PC locations. But because these stub functions don't have their function field set, this function segfaults: https://github.com/llvm/llvm-project/blob/57778ec36c9c7e96b76a167f19dccbe00d49c9d4/lld/wasm/InputChunks.h#L282 This bug seems to be triggered when these conditions are met: - There is a signature mismatch warning with multiple different definitions (one definition with other declarations is not sufficient) with weak linkage with the same name - The 'stub' function containing unreachable has a callsite, meaning it isn't DCE'd - .debug_info section is generated (i.e., DWARF is used) This PR initializes the field with nullptr, and in InputFunction::getFunctionCodeOffset, checks if function is nullptr, and if so, just returns 0. This function is called only for resolving relocations in the .debug_info section, and addresses of these stub functions, which are not the functions users wrote in the first place, are not really meaningful anyway. | 2 年前 | |
[wasm-ld] Update supported features in the generic CPU configuration Accompanying https://reviews.llvm.org/D125728, this updates LLVM Codegen's "generic" CPU to enable the same new features. Differential Revision: https://reviews.llvm.org/D125729 | 3 年前 | |
[lld][WebAssembly] Renamed a few tests to conform to naming convention. NFC Differential Revision: https://reviews.llvm.org/D143009 | 3 年前 | |
lld: Convert tests to opaque pointers | 3 年前 | |
[lld][WebAssembly] Convert some lld tests to assembly When we originally wrote these tests we didn't have a stable and fleshed out assembly format. Now we do so we should prefer that over llvm ir for lld tests to avoid including more part of llvm than necessary in order to run the test. This change converts just 30 out of about 130 test files. More to come when I have some more time. Differential Revision: https://reviews.llvm.org/D80361 | 6 年前 | |
[lld][WebAssembly] Report undefined symbols in -shared/-pie builds (#75242) Previously we would ignore all undefined symbols when using -shared or -pie. All undefined symbols would be treated as imports regardless of whether those symbols we defined in any shared library. With this change we now track symbol in shared libraries and report undefined symbols in the main program by default. The old behavior is still available via the --unresolved-symbols=import-dynamic command line flag. This rationale for allowing this type of breaking change is that -pie and -shared are both still experimental will warn as such, unless --experimental-pic is passed. As part of this change the linker now models shared library symbols via new SharedFunctionSymbol and SharedDataSymbol types. I've also added a new --no-shlib-sigcheck option that bypassed the checking of functions signature in shared libraries. This is specifically required by emscripten the case where the imports/exports of shared libraries have been modified by via JS type legalization (this is only needed when targeting old JS engines where bigint is not yet available See https://github.com/emscripten-core/emscripten/issues/18198 | 2 年前 | |
| 8 个月前 | ||
[lld][WebAssembly] Convert a bunch more tests to asm. NFC Differential Revision: https://reviews.llvm.org/D120060 | 4 年前 | |
| 2 年前 | ||
| 8 个月前 | ||
[lld][WebAssembly] Reject shared libraries when -static/-Bstatic is used (#108263) This matches the behaviour of GNU ld and the ELF version of lld. | 1 年前 | |
[lld][WebAssembly] Add --keep-section flag This flag causes wasm-ld preserve a section even in the face of --strip-all. This is useful, for example, to preserve the target_features section in the ase of clang (which can run wasm-opt after linking), and emcc (which performs a bunch of post-link work). Fixes: https://github.com/llvm/llvm-project/issues/60613 Fixes: https://github.com/llvm/llvm-project/issues/55781 Differential Revision: https://reviews.llvm.org/D149917 | 2 年前 | |
[lld][WebAssembly] Do not remove name section with --strip-debug Leave the name section in the output when using the --strip-debug flag. This treats it more like ELF symbol tables, as the name section has similar uses at runtime (e.g. wasm engines understand it and it can be used for symbolization at runtime). Fixes https://github.com/emscripten-core/emscripten/issues/14623 Differential Revision: https://reviews.llvm.org/D106728 | 4 年前 | |
[lld][WebAssembly] Handle stub symbol dependencies when an explicit import name is used (#80169) | 2 年前 | |
[lld][WebAssembly] Handle stub symbol dependencies when an explicit import name is used (#80169) | 2 年前 | |
[lld][WebAssembly] Convert some lld tests to assembly When we originally wrote these tests we didn't have a stable and fleshed out assembly format. Now we do so we should prefer that over llvm ir for lld tests to avoid including more part of llvm than necessary in order to run the test. This change converts just 30 out of about 130 test files. More to come when I have some more time. Differential Revision: https://reviews.llvm.org/D80361 | 6 年前 | |
| 8 个月前 | ||
[WebAssembly] Require tags for Wasm EH and Wasm SJLJ to be defined externally (#159143) Rather then defining these tags in each object file that requires them we can can declare them as undefined and require that they defined externally in, for example, compiler-rt or libcxxabi. | 10 个月前 | |
[WebAssembly] Add support for named globals in the object format. Differential Revision: https://reviews.llvm.org/D91769 | 5 年前 | |
[WebAssembly] Add support for named globals in the object format. Differential Revision: https://reviews.llvm.org/D91769 | 5 年前 | |
[WebAssembly] Remove WASM_FEATURE_PREFIX_REQUIRED (NFC) (#113729) This has not been emitted since https://github.com/llvm/llvm-project/commit/3f34e1b883351c7d98426b084386a7aa762aa366. The corresponding proposed tool-conventions change: https://github.com/WebAssembly/tool-conventions/pull/236 | 1 年前 | |
[lld][COFF][ELF][WebAssembly] Replace --[no-]threads /threads[:no] with --threads={1,2,...} /threads:{1,2,...} --no-threads is a name copied from gold. gold has --no-thread, --thread-count and several other --thread-count-*. There are needs to customize the number of threads (running several lld processes concurrently or customizing the number of LTO threads). Having a single --threads=N is a straightforward replacement of gold's --no-threads + --thread-count. --no-threads is used rarely. So just delete --no-threads instead of keeping it for compatibility for a while. If --threads= is specified (ELF,wasm; COFF /threads: is similar), --thinlto-jobs= defaults to --threads=, otherwise all available hardware threads are used. There is currently no way to override a --threads={1,2,...}. It is still a debate whether we should use --threads=all. Reviewed By: rnk, aganea Differential Revision: https://reviews.llvm.org/D76885 | 6 年前 | |
| 8 个月前 | ||
[lld][WebAssembly] Avoid emitting empty __wasm_apply_data_relocs function (#109249) Instead of always generating __wasm_apply_data_relocs when relevant options like -pie and -shared are specified, generate it only when the relevant relocations are actually necessary. Note: omitting empty __wasm_apply_data_relocs is not a problem because the export is optional in the spec (DynamicLinking.md) and all runtime linker implementations I'm aware of implement it that way. (emscripten, toywasm, wasm-tools) Motivations: * This possibly reduces the module size * This is also a preparation to fix https://github.com/llvm/llvm-project/issues/107387, for which it isn't obvious if we need these relocations at the time of createSyntheticSymbols. (unless we introduce a new explicit option like --non-pie-dynamic-link.) | 1 年前 | |
[lld][WebAssembly] Handle TLS symbols in older object file In older versions of llvm (e.g. llvm 13), symbols were not individually flagged as TLS. In this case, the indent was to implicitly mark any symbols defined in TLS segments as TLS. However, we were not performing this implicit conversion if the segment was explicitly marked as TLS As it happens, llvm 13 was branched between the addition of the segment flag and the addition of the symbol flag. See: - segment flag added: https://reviews.llvm.org/D102202 - symbol flag added: https://reviews.llvm.org/D109426 Testing this is tricky because the assembler will imply the TLS status of the symbol based on the segment its declared in, so we are forced to use a yaml file here. Fixes: https://github.com/emscripten-core/emscripten/issues/15891 Differential Revision: https://reviews.llvm.org/D118414 | 4 年前 | |
[lld][WebAssembly] Renamed a few tests to conform to naming convention. NFC Differential Revision: https://reviews.llvm.org/D143009 | 3 年前 | |
| 8 个月前 | ||
| 8 个月前 | ||
[lld][WebAssembly] Avoid emitting empty __wasm_apply_data_relocs function (#109249) Instead of always generating __wasm_apply_data_relocs when relevant options like -pie and -shared are specified, generate it only when the relevant relocations are actually necessary. Note: omitting empty __wasm_apply_data_relocs is not a problem because the export is optional in the spec (DynamicLinking.md) and all runtime linker implementations I'm aware of implement it that way. (emscripten, toywasm, wasm-tools) Motivations: * This possibly reduces the module size * This is also a preparation to fix https://github.com/llvm/llvm-project/issues/107387, for which it isn't obvious if we need these relocations at the time of createSyntheticSymbols. (unless we introduce a new explicit option like --non-pie-dynamic-link.) | 1 年前 | |
| 8 个月前 | ||
[lld][WebAssembly] Convert a bunch more tests to asm. NFC Differential Revision: https://reviews.llvm.org/D120060 | 4 年前 | |
[lld][WebAssembly] Convert some lld tests to assembly When we originally wrote these tests we didn't have a stable and fleshed out assembly format. Now we do so we should prefer that over llvm ir for lld tests to avoid including more part of llvm than necessary in order to run the test. This change converts just 30 out of about 130 test files. More to come when I have some more time. Differential Revision: https://reviews.llvm.org/D80361 | 6 年前 | |
[lld][WebAssembly] Report undefined symbols in -shared/-pie builds (#75242) Previously we would ignore all undefined symbols when using -shared or -pie. All undefined symbols would be treated as imports regardless of whether those symbols we defined in any shared library. With this change we now track symbol in shared libraries and report undefined symbols in the main program by default. The old behavior is still available via the --unresolved-symbols=import-dynamic command line flag. This rationale for allowing this type of breaking change is that -pie and -shared are both still experimental will warn as such, unless --experimental-pic is passed. As part of this change the linker now models shared library symbols via new SharedFunctionSymbol and SharedDataSymbol types. I've also added a new --no-shlib-sigcheck option that bypassed the checking of functions signature in shared libraries. This is specifically required by emscripten the case where the imports/exports of shared libraries have been modified by via JS type legalization (this is only needed when targeting old JS engines where bigint is not yet available See https://github.com/emscripten-core/emscripten/issues/18198 | 2 年前 | |
[lld][WebAssembly] Report undefined symbols in -shared/-pie builds (#75242) Previously we would ignore all undefined symbols when using -shared or -pie. All undefined symbols would be treated as imports regardless of whether those symbols we defined in any shared library. With this change we now track symbol in shared libraries and report undefined symbols in the main program by default. The old behavior is still available via the --unresolved-symbols=import-dynamic command line flag. This rationale for allowing this type of breaking change is that -pie and -shared are both still experimental will warn as such, unless --experimental-pic is passed. As part of this change the linker now models shared library symbols via new SharedFunctionSymbol and SharedDataSymbol types. I've also added a new --no-shlib-sigcheck option that bypassed the checking of functions signature in shared libraries. This is specifically required by emscripten the case where the imports/exports of shared libraries have been modified by via JS type legalization (this is only needed when targeting old JS engines where bigint is not yet available See https://github.com/emscripten-core/emscripten/issues/18198 | 2 年前 | |
[lld][WebAssembly] Convert some lld tests to assembly When we originally wrote these tests we didn't have a stable and fleshed out assembly format. Now we do so we should prefer that over llvm ir for lld tests to avoid including more part of llvm than necessary in order to run the test. This change converts just 30 out of about 130 test files. More to come when I have some more time. Differential Revision: https://reviews.llvm.org/D80361 | 6 年前 | |
| 8 个月前 | ||
lld: Convert tests to opaque pointers | 3 年前 | |
[lld][WebAssembly] Add --unresolved-symbols=import-dynamic This is a new mode for handling unresolved symbols that allows all symbols to be imported in the same that they would be in the case of -fpie or -shared, but generting an otherwise fixed/non-relocatable binary. Code linked in this way should still be compiled with -fPIC so that data symbols can be resolved via imports. This essentially allows the building of static binaries that have dynamic imports. See: https://github.com/emscripten-core/emscripten/issues/12682 As with other uses of the experimental dynamic linking ABI, this behaviour will produce a warning unless run with --experimental-pic. Differential Revision: https://reviews.llvm.org/D91577 | 4 年前 | |
[lld][WebAssembly] Report undefined symbols in -shared/-pie builds (#75242) Previously we would ignore all undefined symbols when using -shared or -pie. All undefined symbols would be treated as imports regardless of whether those symbols we defined in any shared library. With this change we now track symbol in shared libraries and report undefined symbols in the main program by default. The old behavior is still available via the --unresolved-symbols=import-dynamic command line flag. This rationale for allowing this type of breaking change is that -pie and -shared are both still experimental will warn as such, unless --experimental-pic is passed. As part of this change the linker now models shared library symbols via new SharedFunctionSymbol and SharedDataSymbol types. I've also added a new --no-shlib-sigcheck option that bypassed the checking of functions signature in shared libraries. This is specifically required by emscripten the case where the imports/exports of shared libraries have been modified by via JS type legalization (this is only needed when targeting old JS engines where bigint is not yet available See https://github.com/emscripten-core/emscripten/issues/18198 | 2 年前 | |
[lld][WebAssembly] Don't report relocation error when linking with -r/--relocatable (#109822) Followup to #104926. We ran into issues on the emscripten waterfall where relocation against __dso_handle were being reported as errors even though -r/--relocatable was being used to generate object file output rather than executable output. | 1 年前 | |
[lld][WebAssembly] Don't report relocation error when linking with -r/--relocatable (#109822) Followup to #104926. We ran into issues on the emscripten waterfall where relocation against __dso_handle were being reported as errors even though -r/--relocatable was being used to generate object file output rather than executable output. | 1 年前 | |
[lld][WebAssembly] Convert some lld tests to assembly When we originally wrote these tests we didn't have a stable and fleshed out assembly format. Now we do so we should prefer that over llvm ir for lld tests to avoid including more part of llvm than necessary in order to run the test. This change converts just 30 out of about 130 test files. More to come when I have some more time. Differential Revision: https://reviews.llvm.org/D80361 | 6 年前 | |
| 1 年前 | ||
[lld][WebAssembly] Fix visibility of __stack_pointer global (#161284) The stack pointer should be global, not hidden / dso-local. Marking it as global allows it to be exported from the main module and imported into side modules. | 10 个月前 | |
| 8 个月前 | ||
| 8 个月前 | ||
[WebAssembly] Added initial type checker to MC Assembler This to protect against non-sensical instruction sequences being assembled, which would either cause asserts/crashes further down, or a Wasm module being output that doesn't validate. Unlike a validator, this type checker is able to give type-errors as part of the parsing process, which makes the assembler much friendlier to be used by humans writing manual input. Because the MC system is single pass (instructions aren't even stored in MC format, they are directly output) the type checker has to be single pass as well, which means that from now on .globaltype and .functype decls must come before their use. An extra pass is added to Codegen to collect information for this purpose, since AsmPrinter is normally single pass / streaming as well, and would otherwise generate this information on the fly. A -no-type-check flag was added to llvm-mc (and any other tools that take asm input) that surpresses type errors, as a quick escape hatch for tests that were not intended to be type correct. This is a first version of the type checker that ignores control flow, i.e. it checks that types are correct along the linear path, but not the branch path. This will still catch most errors. Branch checking could be added in the future. Differential Revision: https://reviews.llvm.org/D104945 | 4 年前 | |
| 8 个月前 | ||
| 8 个月前 | ||
| 8 个月前 | ||
[lld][WebAssembly] Convert some lld tests to assembly When we originally wrote these tests we didn't have a stable and fleshed out assembly format. Now we do so we should prefer that over llvm ir for lld tests to avoid including more part of llvm than necessary in order to run the test. This change converts just 30 out of about 130 test files. More to come when I have some more time. Differential Revision: https://reviews.llvm.org/D80361 | 6 年前 | |
[lld][WebAssembly] Implement --why-extract flag from the ELF backend See https://reviews.llvm.org/D109572 for the original ELF version. Differential Revision: https://reviews.llvm.org/D145431 | 3 年前 | |
[lld][WebAsssembly] Convert more tests from IR to assembly. NFC Differential Revision: https://reviews.llvm.org/D130738 | 3 年前 |
| 文件 | 最后提交记录 | 最后更新时间 |
|---|---|---|
| 9 个月前 | ||
| 8 个月前 | ||
| 8 个月前 | ||
| 1 年前 | ||
| 10 个月前 | ||
| 1 年前 | ||
| 3 年前 | ||
| 6 年前 | ||
| 2 年前 | ||
| 9 个月前 | ||
| 8 个月前 | ||
| 4 年前 | ||
| 8 个月前 | ||
| 8 个月前 | ||
| 5 年前 | ||
| 5 年前 | ||
| 4 年前 | ||
| 8 个月前 | ||
| 5 年前 | ||
| 5 年前 | ||
| 8 个月前 | ||
| 8 个月前 | ||
| 6 年前 | ||
| 5 年前 | ||
| 5 年前 | ||
| 5 年前 | ||
| 5 年前 | ||
| 3 年前 | ||
| 1 年前 | ||
| 8 个月前 | ||
| 2 年前 | ||
| 8 个月前 | ||
| 8 个月前 | ||
| 8 个月前 | ||
| 9 个月前 | ||
| 2 年前 | ||
| 3 年前 | ||
| 8 个月前 | ||
| 4 年前 | ||
| 4 年前 | ||
| 4 年前 | ||
| 4 年前 | ||
| 4 年前 | ||
| 8 个月前 | ||
| 2 年前 | ||
| 4 年前 | ||
| 5 年前 | ||
| 8 个月前 | ||
| 4 年前 | ||
| 4 年前 | ||
| 7 年前 | ||
| 3 年前 | ||
| 6 年前 | ||
| 5 年前 | ||
| 6 年前 | ||
| 6 年前 | ||
| 4 年前 | ||
| 5 年前 | ||
| 5 年前 | ||
| 5 年前 | ||
| 8 个月前 | ||
| 4 年前 | ||
| 3 年前 | ||
| 3 年前 | ||
| 3 年前 | ||
| 4 年前 | ||
| 6 年前 | ||
| 4 年前 | ||
| 8 个月前 | ||
| 8 个月前 | ||
| 8 个月前 | ||
| 5 年前 | ||
| 4 年前 | ||
| 8 个月前 | ||
| 3 年前 | ||
| 3 年前 | ||
| 1 年前 | ||
| 2 年前 | ||
| 2 年前 | ||
| 8 个月前 | ||
| 1 年前 | ||
| 1 年前 | ||
| 6 年前 | ||
| 8 个月前 | ||
| 11 个月前 | ||
| 3 年前 | ||
| 5 年前 | ||
| 8 个月前 | ||
| 8 个月前 | ||
| 5 年前 | ||
| 8 个月前 | ||
| 8 个月前 | ||
| 3 年前 | ||
| 2 年前 | ||
| 8 个月前 | ||
| 8 个月前 | ||
| 4 年前 | ||
| 10 个月前 | ||
| 4 年前 | ||
| 4 年前 | ||
| 2 年前 | ||
| 8 个月前 | ||
| 8 个月前 | ||
| 6 年前 | ||
| 8 个月前 | ||
| 8 个月前 | ||
| 11 个月前 | ||
| 4 年前 | ||
| 8 个月前 | ||
| 4 年前 | ||
| 5 年前 | ||
| 3 年前 | ||
| 4 年前 | ||
| 10 个月前 | ||
| 5 年前 | ||
| 1 年前 | ||
| 8 个月前 | ||
| 2 年前 | ||
| 5 年前 | ||
| 1 年前 | ||
| 4 年前 | ||
| 8 个月前 | ||
| 8 个月前 | ||
| 2 年前 | ||
| 1 年前 | ||
| 1 年前 | ||
| 2 年前 | ||
| 2 年前 | ||
| 2 年前 | ||
| 3 年前 | ||
| 3 年前 | ||
| 3 年前 | ||
| 6 年前 | ||
| 2 年前 | ||
| 8 个月前 | ||
| 4 年前 | ||
| 2 年前 | ||
| 8 个月前 | ||
| 1 年前 | ||
| 2 年前 | ||
| 4 年前 | ||
| 2 年前 | ||
| 2 年前 | ||
| 6 年前 | ||
| 8 个月前 | ||
| 10 个月前 | ||
| 5 年前 | ||
| 5 年前 | ||
| 1 年前 | ||
| 6 年前 | ||
| 8 个月前 | ||
| 1 年前 | ||
| 4 年前 | ||
| 3 年前 | ||
| 8 个月前 | ||
| 8 个月前 | ||
| 1 年前 | ||
| 8 个月前 | ||
| 4 年前 | ||
| 6 年前 | ||
| 2 年前 | ||
| 2 年前 | ||
| 6 年前 | ||
| 8 个月前 | ||
| 3 年前 | ||
| 4 年前 | ||
| 2 年前 | ||
| 1 年前 | ||
| 1 年前 | ||
| 6 年前 | ||
| 1 年前 | ||
| 10 个月前 | ||
| 8 个月前 | ||
| 8 个月前 | ||
| 4 年前 | ||
| 8 个月前 | ||
| 8 个月前 | ||
| 8 个月前 | ||
| 6 年前 | ||
| 3 年前 | ||
| 3 年前 |