Big-Endian Testing with QEMU
by jandeboevrie on 4/3/2026, 1:28:58 PM
https://www.hanshq.net/big-endian-qemu.html
Comments
by: AKSF_Ackermann
> When programming, it is still important to write code that runs correctly on systems with either byte order<p>What you should do instead is write all your code so it is little-endian only, as the only relevant big-endian architecture is s390x, and if someone wants to run your code on s390x, they can afford a support contract.
4/3/2026, 2:46:06 PM
by: electroly
> When programming, it is still important to write code that runs correctly on systems with either byte order<p>I contend it's almost never important and almost nobody writing user software should bother with this. Certainly, people who didn't already know they needed big-endian should not start caring now because they read an article online. There are countless rare machines that your code doesn't run on--what's so special about big endian? The world is little endian now. Big endian chips aren't coming back. You are spending your own time on an effort that will never pay off. If big endian is really needed, IBM will pay you to write the s390x port and they will provide the machine.
4/3/2026, 2:48:06 PM
by: bluGill
What I really want is memory order emulation. X86 as strong memory order guarantees, ARM has much weaker guarantees. Which means the multi-threaded queue I'm working on works all the time on development x86 machine even if I forget to put in the correct memory-order schematics, but it might or might not work on ARM (which is what my of my users have). (I am in the habit of running all my stress tests 1000 times before I'm willing to send them out, but that doesn't mean the code is correct, it means it works on x86 and passed my review which might miss something)
4/3/2026, 3:59:08 PM
by: bluGill
For most code it doesn't matter. It matters when you are writing files to be read by something else, or when sending data over a network. So make sure the places where those happen are thin shims that are easy to fix if it doesn't work. (that is done write data from everywhere, put a layer in place for this).
4/3/2026, 3:55:32 PM
by: eisbaw
I did that many years back, but with MIPS and MIPSel: <a href="https://youtu.be/BGzJp1ybpHo?si=eY_Br8BalYzKPJMG&t=1130" rel="nofollow">https://youtu.be/BGzJp1ybpHo?si=eY_Br8BalYzKPJMG&t=1130</a><p>presented at Embedded Linux Conf
4/3/2026, 2:49:13 PM
by: throwaway2027
Is there any benefit in edge cases to using big-endian these days?
4/3/2026, 3:08:42 PM
by: pragmaticviber
It's all fun and games until you have to figure out if the endianness bug is in your code or in QEMU's s390x emulation.
4/3/2026, 2:21:26 PM