Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bitfields broken for big-endian machines. #1340

Closed
emilio opened this issue Jun 26, 2018 · 3 comments
Closed

Bitfields broken for big-endian machines. #1340

emilio opened this issue Jun 26, 2018 · 3 comments

Comments

@emilio
Copy link
Contributor

emilio commented Jun 26, 2018

See https://bugzilla.mozilla.org/show_bug.cgi?id=1462623

@psumbera
Copy link
Contributor

Per: https://en.wikipedia.org/wiki/Bit_numbering SPARC uses "LSB 0" bit numbering (the same as Little-endian CPUs).

So the proposed change is probably not needed. But something else is wrong...

I'm confused about:

https://github.com/rust-lang-nursery/rust-bindgen/blob/master/bindgen-integration/src/lib.rs#L223


        _bitfield_1: bindings::bitfields::First::new_bitfield_1(1, 2, 3)
    };
    assert!(unsafe {
first.assert(1, 2, 3)

What does mean value 3? This is 2 bytes row!

@emilio
Copy link
Contributor Author

emilio commented Jun 27, 2018

psumbera added a commit to psumbera/rust-bindgen that referenced this issue Jun 28, 2018
@psumbera
Copy link
Contributor

With following all test passes on both sparc and intel:

#1342

(though I haven't verified Firefox yet)

bors-servo pushed a commit that referenced this issue Jul 1, 2018
Fix bitfields on big-endian machines.

Fixes #1340
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants