Build on i686 hosts

i386 aligns 64-bit integers to 4 bytes, so Symbol and NameRecord are
smaller there than on other hosts, and the assertions that they are
exactly 48 and 16 bytes failed to compile. Assert upper bounds instead,
which still catch growth on 64-bit hosts, and check the i686 build in
CI.
This commit is contained in:
Rui Ueyama committed 2026-09-29 13:30:46 +09:00
1 parent 0ea3c18bc1
commit f9828086ad
3 files changed
+8 -3

No files matched your search

+4 -1
View File
@@ -22,8 +22,11 @@ jobs:
- run: cargo build --locked
- name: check the build for 32-bit hosts
run: |
rustup target add armv7-unknown-linux-gnueabihf powerpc-unknown-linux-gnu
rustup target add armv7-unknown-linux-gnueabihf i686-unknown-linux-gnu \
powerpc-unknown-linux-gnu
cargo check --locked --workspace --all-targets --target armv7-unknown-linux-gnueabihf
# i386 aligns 64-bit integers to 4 bytes
cargo check --locked --workspace --all-targets --target i686-unknown-linux-gnu
# 32-bit PowerPC has no 64-bit atomics
cargo check --locked --workspace --all-targets --target powerpc-unknown-linux-gnu
- name: verify all target toolchains are available
+2 -1
View File
@@ -156,7 +156,8 @@ impl NameRecord {
}
}
const _: () = assert!(size_of::<NameRecord>() == 16);
// It can be smaller on 32-bit hosts.
const _: () = assert!(size_of::<NameRecord>() <= 16);
/// CU metadata carried from input parsing through final index serialization.
/// CUs own address ranges; both CUs and TUs below may own public names.
+2 -1
View File
@@ -286,7 +286,8 @@ pub struct Symbol {
bits: u16,
}
const _: () = assert!(size_of::<Symbol>() == 48);
// It can be smaller on 32-bit hosts.
const _: () = assert!(size_of::<Symbol>() <= 48);
const SYMBOL_LOCKED: u8 = 1 << 0;