Skip to content

Rust thinks u64 and f64 have 4 byte alignment on Linux 32bit #43899

Closed
@upsuper

Description

@upsuper

The following code:

use std::mem;
fn main() {
    println!("sizeof u64: {}, alignof u64: {}",
             mem::size_of::<u64>(), mem::align_of::<u64>());
    println!("sizeof f64: {}, alignof f64: {}",
             mem::size_of::<f64>(), mem::align_of::<f64>());
}

with

rustc test.rs --target=i686-unknown-linux-gnu

The generated executable outputs:

sizeof u64: 8, alignof u64: 4
sizeof f64: 8, alignof f64: 4

which matches neither gcc nor clang.

And this issue seems to block linux32-stylo.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions