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

Correctly "detect" host endianness on MIPS #802

Merged
merged 1 commit into from Nov 12, 2016

Conversation

Projects
None yet
2 participants
@xen0n
Copy link
Contributor

xen0n commented Nov 6, 2016

Counter-intuitively, Linux on MIPS reports the same machine name in
uname(2) output, regardless of endianness. So the current check is
bogus, and will fail on little-endian boxes. However, because the endianness
is not runtime reconfigurable, binaries are guaranteed to only work on
platforms with the same endianness. Hence, we can rely on compile-time
cfg() checks to provide the correct host triple, despite the kernel
not providing that information.

@xen0n xen0n force-pushed the xen0n:mips-endianness branch from 054c254 to 21dab8f Nov 6, 2016

Correctly "detect" host endianness on MIPS
Counter-intuitively, Linux on MIPS reports the same machine name in
`uname(2)` output, regardless of endianness. So the current check is
bogus, and will fail on little-endian boxes. However, because the
endianness is not runtime reconfigurable, binaries are guaranteed to
only work on platforms with the same endianness. Hence, we can rely on
compile-time `cfg()` checks to provide the correct host triple, despite
the kernel not providing that information.

@brson brson merged commit 4fcdfdc into rust-lang:master Nov 12, 2016

1 of 2 checks passed

continuous-integration/appveyor/pr AppVeyor build failed
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@brson

This comment has been minimized.

Copy link
Contributor

brson commented Nov 12, 2016

Thanks!

@xen0n xen0n deleted the xen0n:mips-endianness branch Nov 16, 2016

@xen0n xen0n referenced this pull request Nov 16, 2016

Closed

Support MIPS/MIPS64 hosts #814

8 of 8 tasks complete
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment