Build on 32-bit hosts

Two struct-size assertions hold only with 8-byte pointers: SymbolAux ends
in a Vec and PendingComdatSignature starts with a fat pointer, so they
are 48 and 16 bytes on a 32-bit host and rustc rejected the crate for
armv7. Gate them on target_pointer_width = "64"; the other five size
assertions have no pointer-sized fields and pass on both widths.

CI now runs cargo check for armv7-unknown-linux-gnueabihf over the whole
workspace so this cannot regress unnoticed.

Tests: cargo check --release --target armv7-unknown-linux-gnueabihf --workspace --all-targets
Tests: cargo test --release (pass=5681 skip=654 fail=0)

Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_0141irCwtPmPMZa9s7pCN3Cz
This commit is contained in:
Rui UeyamaandClaude Fable 5.1 committed 2026-09-17 22:26:49 +09:00
1 parent 8fe0ffb586
commit 011e194896
3 files changed
+6

No files matched your search

+4
View File
@@ -20,6 +20,10 @@ jobs:
sudo ./install-test-deps.sh
sudo .github/workflows/install-extras.sh
- run: cargo build --locked
- name: check the build for a 32-bit host
run: |
rustup target add armv7-unknown-linux-gnueabihf
cargo check --locked --workspace --all-targets --target armv7-unknown-linux-gnueabihf
- name: verify all target toolchains are available
run: |
cargo test --locked -p mold-cli --test integration -- --list |
+1
View File
@@ -679,6 +679,7 @@ pub(crate) struct PendingComdatSignature {
pub name_len: u32,
}
#[cfg(target_pointer_width = "64")]
const _: () = assert!(std::mem::size_of::<PendingComdatSignature>() == 24);
/// RISC-V attributes read from `.riscv.attributes`.
+1
View File
@@ -163,6 +163,7 @@ pub struct SymbolAux {
pub thunk_addrs: Vec<u64>,
}
#[cfg(target_pointer_width = "64")]
const _: () = assert!(std::mem::size_of::<SymbolAux>() == 64);
impl Default for SymbolAux {