[all-commits] [llvm/llvm-project] 601893: [lld][WebAssembly] Support for the custom-page-siz...
Nick Fitzgerald via All-commits
all-commits at lists.llvm.org
Tue Mar 4 09:39:53 PST 2025
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: 6018930ef1fa62315c3e02b8b8b775056bd5224d
https://github.com/llvm/llvm-project/commit/6018930ef1fa62315c3e02b8b8b775056bd5224d
Author: Nick Fitzgerald <fitzgen at gmail.com>
Date: 2025-03-04 (Tue, 04 Mar 2025)
Changed paths:
M lld/test/wasm/initial-heap.test
M lld/test/wasm/mutable-global-exports.s
A lld/test/wasm/page-size.s
M lld/test/wasm/shared-memory.yaml
M lld/wasm/Config.h
M lld/wasm/Driver.cpp
M lld/wasm/Options.td
M lld/wasm/SymbolTable.cpp
M lld/wasm/Symbols.cpp
M lld/wasm/Symbols.h
M lld/wasm/SyntheticSections.cpp
M lld/wasm/Writer.cpp
M lld/wasm/WriterUtils.cpp
M llvm/include/llvm/BinaryFormat/Wasm.h
M llvm/include/llvm/BinaryFormat/WasmTraits.h
M llvm/include/llvm/MC/MCSymbolWasm.h
M llvm/include/llvm/ObjectYAML/WasmYAML.h
M llvm/lib/MC/WasmObjectWriter.cpp
M llvm/lib/Object/WasmObjectFile.cpp
M llvm/lib/ObjectYAML/WasmYAML.cpp
M llvm/lib/Target/WebAssembly/AsmParser/WebAssemblyAsmParser.cpp
M llvm/lib/Target/WebAssembly/WebAssemblyUtilities.cpp
M llvm/tools/obj2yaml/wasm2yaml.cpp
Log Message:
-----------
[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
To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications
More information about the All-commits
mailing list