mirror of
https://github.com/rui314/mold.git
synced 2026-11-09 13:01:26 -10:00
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:
1 parent
0ea3c18bc1
commit
f9828086ad
3 files changed
+8
-3
No files matched your search
@@ -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
@@ -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
@@ -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;
|
||||
|
||||
|
||||
Reference in new issue
Block a user