<feed xmlns='http://www.w3.org/2005/Atom'>
<title>llvm-project.git/llvm/lib/Object/WasmObjectFile.cpp, branch main</title>
<subtitle>Unnamed repository; edit this file 'description' to name the repository.
</subtitle>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/'/>
<entry>
<title>[lld][WebAssembly] Support for the custom-page-sizes WebAssembly proposal (#128942)</title>
<updated>2025-03-04T17:39:30+00:00</updated>
<author>
<name>Nick Fitzgerald</name>
<email>fitzgen@gmail.com</email>
</author>
<published>2025-03-04T17:39:30+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=6018930ef1fa62315c3e02b8b8b775056bd5224d'/>
<id>6018930ef1fa62315c3e02b8b8b775056bd5224d</id>
<content type='text'>
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</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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</pre>
</div>
</content>
</entry>
<entry>
<title>[object][WebAssembly] Add support for RUNTIME_PATH to yaml2obj and obj2yaml (#126080)</title>
<updated>2025-02-24T17:15:41+00:00</updated>
<author>
<name>Hood Chatham</name>
<email>roberthoodchatham@gmail.com</email>
</author>
<published>2025-02-24T17:15:41+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=cc7f22ee6ccb2c1ad79834e06d5b18d8f014d140'/>
<id>cc7f22ee6ccb2c1ad79834e06d5b18d8f014d140</id>
<content type='text'>
This is the first step of adding RPATH support for wasm. 

See corresponding update to the WebAssembly/tool-conventions repo on dynamic
linking: https://github.com/WebAssembly/tool-conventions/pull/246</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This is the first step of adding RPATH support for wasm. 

See corresponding update to the WebAssembly/tool-conventions repo on dynamic
linking: https://github.com/WebAssembly/tool-conventions/pull/246</pre>
</div>
</content>
</entry>
<entry>
<title>Revert "[Object][WebAssembly] Fix data segment offsets higher than 2^31 (#125739)" (#125786)</title>
<updated>2025-02-05T00:16:17+00:00</updated>
<author>
<name>Sam Clegg</name>
<email>sbc@chromium.org</email>
</author>
<published>2025-02-05T00:16:17+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=48415777ea6a0367800b3b37493263ff613f57f6'/>
<id>48415777ea6a0367800b3b37493263ff613f57f6</id>
<content type='text'>
This reverts commit c798a5c4d5c3c8cb21e6001f505d8f44217c2244.

This broke bunch of test the emscripten side. Reverting while we
investigate.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This reverts commit c798a5c4d5c3c8cb21e6001f505d8f44217c2244.

This broke bunch of test the emscripten side. Reverting while we
investigate.</pre>
</div>
</content>
</entry>
<entry>
<title>[Object][WebAssembly] Fix data segment offsets higher than 2^31 (#125739)</title>
<updated>2025-02-04T22:06:07+00:00</updated>
<author>
<name>Sam Clegg</name>
<email>sbc@chromium.org</email>
</author>
<published>2025-02-04T22:06:07+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=c798a5c4d5c3c8cb21e6001f505d8f44217c2244'/>
<id>c798a5c4d5c3c8cb21e6001f505d8f44217c2244</id>
<content type='text'>
Fixes: #58555</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Fixes: #58555</pre>
</div>
</content>
</entry>
<entry>
<title>[WebAssembly][Object] Support more elem segment flags (#123427)</title>
<updated>2025-01-18T01:26:44+00:00</updated>
<author>
<name>Derek Schuff</name>
<email>dschuff@chromium.org</email>
</author>
<published>2025-01-18T01:26:44+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=9fdc38c81c7d1b61cb0750e5f5b273d6d1877513'/>
<id>9fdc38c81c7d1b61cb0750e5f5b273d6d1877513</id>
<content type='text'>
Some tools (e.g. Rust tooling) produce element segment descriptors with
neither
elemkind or element type descriptors, but with init exprs instead of
func indices
(this is with the flags value of 4 in

https://webassembly.github.io/spec/core/binary/modules.html#element-section).
LLVM doesn't fully model reference types or the various ways to
initialize element
segments, but we do want to correctly parse and skip over all type
sections, so
this change updates the object parser to handle that case, and refactors
for more
clarity.

The test file is updated to include one additional elem segment with a
flags value
of 4, an initializer value of (32.const 0) and an empty vector. 

Also support parsing files that export imported (undefined) functions.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Some tools (e.g. Rust tooling) produce element segment descriptors with
neither
elemkind or element type descriptors, but with init exprs instead of
func indices
(this is with the flags value of 4 in

https://webassembly.github.io/spec/core/binary/modules.html#element-section).
LLVM doesn't fully model reference types or the various ways to
initialize element
segments, but we do want to correctly parse and skip over all type
sections, so
this change updates the object parser to handle that case, and refactors
for more
clarity.

The test file is updated to include one additional elem segment with a
flags value
of 4, an initializer value of (32.const 0) and an empty vector. 

Also support parsing files that export imported (undefined) functions.</pre>
</div>
</content>
</entry>
<entry>
<title>[Support][Error] Add ErrorAsOutParameter constructor that takes an Error by ref.</title>
<updated>2024-11-29T04:57:53+00:00</updated>
<author>
<name>Lang Hames</name>
<email>lhames@gmail.com</email>
</author>
<published>2024-11-29T04:14:18+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=d02c1676d75a6bab1252b48da9a955fc7dc1251f'/>
<id>d02c1676d75a6bab1252b48da9a955fc7dc1251f</id>
<content type='text'>
ErrorAsOutParameter's Error* constructor supports cases where an Error might not
be passed in (because in the calling context it's known that this call won't
fail). Most clients always have an Error present however, and for them an Error&amp;
overload is more convenient.
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
ErrorAsOutParameter's Error* constructor supports cases where an Error might not
be passed in (because in the calling context it's known that this call won't
fail). Most clients always have an Error present however, and for them an Error&amp;
overload is more convenient.
</pre>
</div>
</content>
</entry>
<entry>
<title>[Object] Remove unused includes (NFC) (#116750)</title>
<updated>2024-11-20T03:42:09+00:00</updated>
<author>
<name>Kazu Hirata</name>
<email>kazu@google.com</email>
</author>
<published>2024-11-20T03:42:09+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=e9c8106a90d49e75bac87341ade57c6049357a97'/>
<id>e9c8106a90d49e75bac87341ade57c6049357a97</id>
<content type='text'>
Identified with misc-include-cleaner.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Identified with misc-include-cleaner.</pre>
</div>
</content>
</entry>
<entry>
<title>[llvm] Remove redundant control flow statements (NFC) (#115831)</title>
<updated>2024-11-12T18:09:42+00:00</updated>
<author>
<name>Kazu Hirata</name>
<email>kazu@google.com</email>
</author>
<published>2024-11-12T18:09:42+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=4048c64306e23b622443bbe7293057a9b07a13bb'/>
<id>4048c64306e23b622443bbe7293057a9b07a13bb</id>
<content type='text'>
Identified with readability-redundant-control-flow.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Identified with readability-redundant-control-flow.</pre>
</div>
</content>
</entry>
<entry>
<title>[WebAssembly] Remove WASM_FEATURE_PREFIX_REQUIRED (NFC) (#113729)</title>
<updated>2024-11-05T00:12:57+00:00</updated>
<author>
<name>Heejin Ahn</name>
<email>aheejin@gmail.com</email>
</author>
<published>2024-11-05T00:12:57+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=be64ca912371ae62002aee3429de058052451d72'/>
<id>be64ca912371ae62002aee3429de058052451d72</id>
<content type='text'>
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</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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</pre>
</div>
</content>
</entry>
<entry>
<title>[lld][WebAssembly] Report undefined symbols in -shared/-pie builds (#75242)</title>
<updated>2024-07-12T20:26:52+00:00</updated>
<author>
<name>Sam Clegg</name>
<email>sbc@chromium.org</email>
</author>
<published>2024-07-12T20:26:52+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=22b7b84860d39da71964c9b329937f2ee1d875ba'/>
<id>22b7b84860d39da71964c9b329937f2ee1d875ba</id>
<content type='text'>
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</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
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</pre>
</div>
</content>
</entry>
</feed>
