|
Revision tags: dev, v36.0.9, v44.0.1, v43.0.2, v36.0.8, v24.0.8, v44.0.0, v43.0.1, v42.0.2, v36.0.7, v24.0.7 |
|
| #
f6dfc89a |
| 24-Mar-2026 |
Liam Eckert <[email protected]> |
Implement Aarch64AdrPrelPgHi21 and Aarch64AddAbsLo12Nc relocations in cranelift-object (#12824)
On aarch64 in non-PIC mode, colocated symbols (non-preemptible linkage) generate adrp+add instruction
Implement Aarch64AdrPrelPgHi21 and Aarch64AddAbsLo12Nc relocations in cranelift-object (#12824)
On aarch64 in non-PIC mode, colocated symbols (non-preemptible linkage) generate adrp+add instruction pairs with Aarch64AdrPrelPgHi21 and Aarch64AddAbsLo12Nc relocations. These relocations were not handled in cranelift-object's process_reloc, causing an unimplemented!() panic.
Fixes #12818
Co-authored-by: Claude Opus 4.6 (1M context) <[email protected]>
show more ...
|
|
Revision tags: v43.0.0, v42.0.1, v41.0.4, v42.0.0, v40.0.4, v36.0.6, v24.0.6, v41.0.3, v41.0.2, v41.0.1, v36.0.5, v40.0.3, v41.0.0, v36.0.4, v39.0.2, v40.0.2, v40.0.1, v40.0.0, v39.0.1, v39.0.0, v38.0.4, v37.0.3, v36.0.3, v24.0.5, v38.0.3, v38.0.2, v38.0.1 |
|
| #
557cc2d6 |
| 10-Oct-2025 |
Alex Crichton <[email protected]> |
Another batch of dependency updates (#11832)
* Another batch of dependency updates
Bringing some deps in `Cargo.toml` up-to-date with their latest versions along the same lines as #11820 to avoid d
Another batch of dependency updates (#11832)
* Another batch of dependency updates
Bringing some deps in `Cargo.toml` up-to-date with their latest versions along the same lines as #11820 to avoid deps getting too stale/old.
Code-wise this updates `anyhow` which enables preexisting Clippy warnings to check more code, so those warnings are fixed here as well.
prtest:full
* Run rustfmt
show more ...
|
|
Revision tags: v37.0.2 |
|
| #
329aaf78 |
| 24-Sep-2025 |
bjorn3 <[email protected]> |
Check that symbols that needs to be defined are defined in cranelift-object (#11740)
They aren't defined, you get weird errors and crashes at link time.
|
|
Revision tags: v37.0.1, v37.0.0, v36.0.2, v36.0.1, v36.0.0 |
|
| #
0e7876a0 |
| 13-Aug-2025 |
bjorn3 <[email protected]> |
Use the new section/symbol_flags_mut helpers in cranelift-object (#11425)
* Use the new section/symbol_flags_mut helpers in cranelift-object
This ensures that the correct default flags are used.
*
Use the new section/symbol_flags_mut helpers in cranelift-object (#11425)
* Use the new section/symbol_flags_mut helpers in cranelift-object
This ensures that the correct default flags are used.
* Add vets
---------
Co-authored-by: Alex Crichton <[email protected]>
show more ...
|
|
Revision tags: v35.0.0, v24.0.4, v33.0.2, v34.0.2 |
|
| #
909c02f4 |
| 11-Jul-2025 |
bjorn3 <[email protected]> |
Fix section/symbol flags when setting the used flag (#11217)
|
| #
9c3d1028 |
| 10-Jul-2025 |
bjorn3 <[email protected]> |
Allow marking data objects as used for the linker (#11206)
|
| #
2bac6574 |
| 07-Jul-2025 |
Alex Crichton <[email protected]> |
Update the `log` dependency (#11197)
* Update the `log` dependency
This enables getting warnings about formatting strings in the `log` crate directives which are then additionally fixed here as wel
Update the `log` dependency (#11197)
* Update the `log` dependency
This enables getting warnings about formatting strings in the `log` crate directives which are then additionally fixed here as well.
* Update dependency directive in `Cargo.toml`
show more ...
|
|
Revision tags: v34.0.1, v33.0.1, v24.0.3, v32.0.1, v34.0.0, v33.0.0 |
|
| #
90ac295e |
| 19-May-2025 |
Alex Crichton <[email protected]> |
Update Wasmtime to the 2024 Rust Edition (#10806)
* Update Wasmtime to the 2024 Rust Edition
Now that our MSRV supports the 2024 edition it's possible to make this switch. This commit moves Wasmtim
Update Wasmtime to the 2024 Rust Edition (#10806)
* Update Wasmtime to the 2024 Rust Edition
Now that our MSRV supports the 2024 edition it's possible to make this switch. This commit moves Wasmtime to the 2024 Edition to keep up-to-date with Rust idioms and access many of the edition features exclusive to the 2024 edition.
prtest:full
* Reformat with the 2024 edition
show more ...
|
|
Revision tags: v32.0.0, v31.0.0 |
|
| #
2af0a1f7 |
| 13-Mar-2025 |
bjorn3 <[email protected]> |
Introduce log2_min_function_alignment flag (#10391)
* Remove function_alignment handling from cranelift-object and cranelift-jit
It is already handled by MachBuffer. The symbol_alignment could also
Introduce log2_min_function_alignment flag (#10391)
* Remove function_alignment handling from cranelift-object and cranelift-jit
It is already handled by MachBuffer. The symbol_alignment could also be removed as no current backend has a symbol alignment bigger than the function alignment, but keeping it around is a bit safer when new backends are introduced.
* Introduce log2_min_function_alignment flag
This is required for cg_clif to implement -Zmin-function-alignment.
show more ...
|
| #
716ebcea |
| 06-Mar-2025 |
bjorn3 <[email protected]> |
Remove Function argument from define_function_bytes (#10346)
* Remove Function argument from define_function_bytes
define_function_bytes is supposed to be used when the code was not compiled by Cra
Remove Function argument from define_function_bytes (#10346)
* Remove Function argument from define_function_bytes
define_function_bytes is supposed to be used when the code was not compiled by Cranelift and thus wouldn't have any associated Function.
* Avoid collecting the relocations into a Vec twice
show more ...
|
|
Revision tags: v30.0.2, v30.0.1, v30.0.0, v29.0.1, v29.0.0, v28.0.1, v28.0.0 |
|
| #
ee818682 |
| 05-Dec-2024 |
bjorn3 <[email protected]> |
Improvements to the subsection support in cranelift-object (#9742)
* Use a single section name for all subsections
This reduces the size of the object file as identical section names get deduplicat
Improvements to the subsection support in cranelift-object (#9742)
* Use a single section name for all subsections
This reduces the size of the object file as identical section names get deduplicated.
* Add a per_function_section equivalent for data objects
On cg_clif's simple-raytracer benchmark this reduces the executable's size by 1MB from ~10MB to ~9MB. It does make lld slower though seemingly unlike per_function_sections, so keeping this as separate flag is beneficial for cg_clif.
* Add link to PR
show more ...
|
|
Revision tags: v27.0.0, v26.0.1, v25.0.3, v24.0.2, v26.0.0, v21.0.2, v22.0.1, v23.0.3, v25.0.2, v24.0.1, v25.0.1, v25.0.0 |
|
| #
f96aac79 |
| 19-Sep-2024 |
bjorn3 <[email protected]> |
Deprecate Context::compile_and_emit (#9281)
The only thing it does over Context::compile is writing the machine code to a Vec specified by the user. Every user of Context::compile_and_emit in Cranel
Deprecate Context::compile_and_emit (#9281)
The only thing it does over Context::compile is writing the machine code to a Vec specified by the user. Every user of Context::compile_and_emit in Cranelift didn't actually need ownership over the machine code bytes and thus would have been able to use Context::compile instead to avoid an unnecessary allocation. This commit moves all in-tree users of compile_and_emit to compile and additionally to avoid other users adding an unnecessary allocation as they though it to be necessary, this commit additionally deprecates compile_and_emit.
show more ...
|
|
Revision tags: v24.0.0, v23.0.2, v23.0.1, v23.0.0, v22.0.0 |
|
| #
44cd0026 |
| 03-Jun-2024 |
Philip Craig <[email protected]> |
Update object to 0.36 (#8733)
* Update object to 0.36
* Update exemptions for the `object` crate
---------
Co-authored-by: Alex Crichton <[email protected]>
|
|
Revision tags: v21.0.1, v21.0.0, v20.0.2, v20.0.1 |
|
| #
b363a866 |
| 25-Apr-2024 |
Caleb Robson <[email protected]> |
Fix `ObjectBuilder` doc links (#8468)
|
|
Revision tags: v20.0.0, v17.0.3, v19.0.2, v18.0.4, v19.0.1 |
|
| #
d3689c2d |
| 01-Apr-2024 |
bjorn3 <[email protected]> |
Remove workaround for fixed object bug (#8276)
It causes TLS relocations to be incorrect on Mach-O since the object crate has been updated.
|
|
Revision tags: v19.0.0, v18.0.3 |
|
| #
a8b2801b |
| 05-Mar-2024 |
Philip Craig <[email protected]> |
Update object to 0.33.0 (#8047)
* Update object to 0.33.0
* Add vet for object and update cargo-deny
---------
Co-authored-by: Alex Crichton <[email protected]>
|
|
Revision tags: v18.0.2, v17.0.2 |
|
| #
9ce3ffe1 |
| 22-Feb-2024 |
Alex Crichton <[email protected]> |
Update some CI dependencies (#7983)
* Update some CI dependencies
* Update to the latest nightly toolchain * Update mdbook * Update QEMU for cross-compiled testing * Update `cargo nextest` for usag
Update some CI dependencies (#7983)
* Update some CI dependencies
* Update to the latest nightly toolchain * Update mdbook * Update QEMU for cross-compiled testing * Update `cargo nextest` for usage with MIRI
prtest:full
* Remove lots of unnecessary imports
* Downgrade qemu as 8.2.1 seems to segfault
* Remove more imports
* Remove unused winch trait method
* Fix warnings about unused trait methods
* More unused imports
* More unused imports
show more ...
|
|
Revision tags: v18.0.1, v18.0.0, v17.0.1, v17.0.0, v16.0.0, v15.0.1, v15.0.0, v14.0.4, v14.0.3, v14.0.2, v13.0.1, v14.0.1, v14.0.0 |
|
| #
ccaf2bfa |
| 10-Oct-2023 |
Afonso Bordado <[email protected]> |
aarch64: Implement TLSDESC for TLS GD accesses (#7201)
* aarch64: Implement TLSDESC for TLS GD accesses
* aarch64: Box ExternalName to avoid growing the `Inst` enum
|
| #
ecc1b794 |
| 09-Oct-2023 |
Afonso Bordado <[email protected]> |
riscv64: Add GOT relocations for PIC code (#7184)
* riscv64: Use `CALL_PLT` relocation for all calls
* riscv64: Set the ELF RVC flag only when the C extension is enabled
* riscv64: Use PC Relative
riscv64: Add GOT relocations for PIC code (#7184)
* riscv64: Use `CALL_PLT` relocation for all calls
* riscv64: Set the ELF RVC flag only when the C extension is enabled
* riscv64: Use PC Relative Relocations for all Calls
* riscv64: Add support for PIC symbols
show more ...
|
| #
9fc4a710 |
| 09-Oct-2023 |
Afonso Bordado <[email protected]> |
cranelift: Group labels by FuncId instead of Name (#7183)
This prevents confusing label locations when there are multiple functions with the same Name.
|
|
Revision tags: minimum-viable-wasi-proxy-serve, v13.0.0 |
|
| #
b23f534c |
| 18-Sep-2023 |
Afonso Bordado <[email protected]> |
riscv64: Implement ELF TLS GD Relocations (#7003)
* cranelift: Add support for public labels
* cranelift: Allow targeting labels with relocations
* cranelift: Emit label related relocations in mo
riscv64: Implement ELF TLS GD Relocations (#7003)
* cranelift: Add support for public labels
* cranelift: Allow targeting labels with relocations
* cranelift: Emit label related relocations in module
* riscv64: Implement TLS GD
* cranelift: Rename `label_is_public` field
* cranelift: Avoid making MachLabel part of the exposed API
show more ...
|
|
Revision tags: v12.0.2, v11.0.2, v10.0.2, v12.0.1, v12.0.0, v11.0.1, v11.0.0, v10.0.1, v10.0.0, v9.0.4, v9.0.3, v9.0.2, v9.0.1, v9.0.0 |
|
| #
49dd8fd7 |
| 16-May-2023 |
Alex Crichton <[email protected]> |
aarch64: Fix Ldr19 relocations being unresolvable (#6384)
* Add a cranelift setting for padding between basic blocks
Various relocations, jumps, and such require special handling in `MachBuffer` w
aarch64: Fix Ldr19 relocations being unresolvable (#6384)
* Add a cranelift setting for padding between basic blocks
Various relocations, jumps, and such require special handling in `MachBuffer` with respect to islands to ensure that everything gets emitted correctly. This commit adds a setting to synthetically insert padding at the end of every basic block to help stress this logic with more minimal test cases. The setting is disabled by default but is something that we should be able to turn on during fuzzing, for example.
* aarch64: Fix out-of-range `Ldr19` relocations
This commit fixes a bug in the AArch64 backend, and possibly others, where constants were unconditionally forced to be at the end of the function when they sometimes couldn't be. For example the `Ldr19` relocation has a 512k range meaning that if an instruction near the beginning of a function accesses a constant at the end of a function and the function is >1M, then the relocation cannot be resolved. This is all handled internally with `MachBuffer`'s handling of islands but the problem with constants is that the labels (and the constant values) weren't defined until the end of the function.
The first attempt at fixing this was to move the calls to `defer_constant` to the beginning of emission. This would enable the constants to get deferred as necessary. This was problematic, however, because it only solved the forwards case (aka your constant was forced to the end of the function which is too far away). The backwards case, aka your constant is way too far behind you, was a new problem that arose.
To fix all of these issues constants are now handled differently inside of the `MachBuffer`. Previously constants were all pre-assigned a label-per-constant and all references to the constant would use that single label. Instead a new heuristic has been added where constants record their size/alignment at the start of emission and labels are lazily deferred. When a label for a constant is requested then a label is lazily allocated or a previously-allocated label for this constant is returned. When an island is emitted then all emitted constants get their labels cleared. This intends to balance the previous functionality of multiple uses of a constant only emit the constant once with fixing this issue with simplicity as well. This means that constants may get emitted multiple times, since each reference to a constant after an island is generated will be guaranteed to generate a new label, even if it's in-range to access. This can perhaps be fixed in the future with a more clever API where the `LabelUse` is passed into the function which converts a constant to a label, but that's left as a refactoring for a future date.
This commit also moves an `alignment: u32` field into the `MachBufferFinalized` itself since that's now a function of whatever constants actually got emitted. Additionally note that constant emission in the middle of a function doesn't actually emit anything, instead recording markers of where constants need to go. Then when a buffer is finalized the constants are passed in to get access to the data which fills in everything as it's referenced.
* Fuzz the `bb_padding_log2` setting
This commit hooks up the previously-added setting to Cranelift to Wasmtime's fuzzing infrastructure. This will automatically configure the setting based on the fuzz input to add a bit of "chaos" to the emitted code. This should hopefully help expose the issue fixed previously via fuzzing which otherwise won't generate massive functions.
* Realign back to an instruction boundary
Otherwise misaligned instructions were getting emitted and tripping various asserts.
* Fix riscv64 testing
* Rename codegen setting to bb_padding_log2_minus_one
Allow for inserting one byte of padding.
* Doc updates
* Thread through shared flags differently
Don't use `EmitInfo`, instead pass in to vcode emission
* Fix s390x tests
* Combine island calculations during vcode emission
Fixes an off-by-just-a-few error if the two island checks are done separately after a basic block.
show more ...
|
| #
fd6cc9a1 |
| 28-Apr-2023 |
Alex Crichton <[email protected]> |
Slightly shrink compiled wasm modules (#6302)
* Slightly shrink compiled wasm modules
This commit shuffles trampolines to the end of a compiled ELF file instead of interspersed throughout. Addition
Slightly shrink compiled wasm modules (#6302)
* Slightly shrink compiled wasm modules
This commit shuffles trampolines to the end of a compiled ELF file instead of interspersed throughout. Additionally trampolines are no longer given a higher alignment requirement than is required by the ISA as is given to functions since they're not perf critical.
The savings here are quite minor, only 0.3% locally on spidermonkey.wasm.
* Fix winch compile
* Return a more descriptive `FunctionAlignment` from `TargetIsa`
* Push alignment further into Cranelift
Remove the need for taking a function's alignment and an ISA's alignment and combining them, instead only using the function's alignment as the source of truth.
* Review comments
show more ...
|
|
Revision tags: v6.0.2, v7.0.1, v8.0.1 |
|
| #
91d1d246 |
| 21-Apr-2023 |
bjorn3 <[email protected]> |
Allow serializing all cranelift-module data structures (#6172)
* Remove ModuleCompiledFunction
The same information can be retrieved using
ctx.compiled_code().unwrap().code_info().total_size
In a
Allow serializing all cranelift-module data structures (#6172)
* Remove ModuleCompiledFunction
The same information can be retrieved using
ctx.compiled_code().unwrap().code_info().total_size
In addition for Module implementations that don't immediately compile the given function there is no correct value that can be returned.
* Don't give anonymous functions and data objects an internal name
This internal name can conflict if a module is serialized and then deserialized into another module. It also wasn't used by any of the Module implementations anyway.
* Allow serializing all cranelift-module data structures
This allows a Module implementation to serialize it's internal state and deserialize it in another compilation session. For example to implement LTO or to load the module into cranelift-interpreter.
* Use expect
show more ...
|
|
Revision tags: v8.0.0 |
|
| #
67c85b88 |
| 06-Apr-2023 |
bjorn3 <[email protected]> |
Remove the DataContext wrapper around DataDescription (#6170)
* Remove the DataContext wrapper around DataDescription
It doesn't have much of a purpose while making it harder to for example rewrite
Remove the DataContext wrapper around DataDescription (#6170)
* Remove the DataContext wrapper around DataDescription
It doesn't have much of a purpose while making it harder to for example rewrite the function and data object declarations within it as is necessary for deserializing a serialized module.
* Derive Debug for DataDescription
show more ...
|