Difference between revisions of "HOWTO-Debug-Endian-Issues"

Jump to navigation Jump to search
(→‎Build dependencies: mention that the Valgrind package is somewhat big)
(A bit more content in the footnotes)
Line 9: Line 9:
#* Unfortunately, it's a pricey niche system, and there's no guarantee that big-endian OS options will be maintained for long.
#* Unfortunately, it's a pricey niche system, and there's no guarantee that big-endian OS options will be maintained for long.
# Running a native, older big-endian development system:
# Running a native, older big-endian development system:
#* Examples include buying an older G4 or G5 Apple PowerPC system, or an older SPARC64 Sun station<ref>Some MIPS and ARM boards also exist, but their quality can vary a lot, and although the MIPS and ARM architectures are theoretically bi-endian, in practice these development boards often only run in little-endian mode, nowadays. They can be useful for strict-alignment testing, though.</ref>. They can often be bought second hand at very reasonable prices.
#* Examples include buying an older G4 or G5 Apple PowerPC system, or an older SPARC64 Sun station<ref>Some MIPS and ARM boards also exist, but their quality can vary a lot, and although the MIPS and ARM architectures are theoretically bi-endian, in practice these development boards often only run in little-endian mode, nowadays. They can be useful for strict-alignment testing, though (but <code>-fsanitize=alignment -DSCUMM_NEED_ALIGNMENT</code> in UBSan on your regular desktop will also catch a lot of these issues).</ref>. They can often be bought second hand at very reasonable prices.
#* However, running a modern development environment on them in getting harder (but not impossible), because the big-endian desktop ecosystem receives less and less maintenance, so things often tend to break. G5 systems (in particular) also require careful maintenance and can be very power-hungry.
#* However, running a modern development environment on them in getting harder (but not impossible), because the big-endian desktop ecosystem receives less and less maintenance, so things often tend to break. G5 systems (in particular) also require careful maintenance and can be very power-hungry.
# '''Emulating a big-endian development system from your regular development machine''':
# '''Emulating a big-endian development system from your regular development machine''':
Line 19: Line 19:
== Linux big-endian PowerPC emulation with QEMU ==
== Linux big-endian PowerPC emulation with QEMU ==


The current reference VM is a pre-configured Debian 8.11 PowerPC system<ref>Modern versions of Debian are actually still built for big-endian PowerPC, but it's not a ''release'' architecture anymore, which means that it's only available through Debian ''unstable''. Debian unstable is harder to maintain than a stable release, and bugs/reliability issues often appear (e.g. Valgrind has been having PPC SDL compatibility problems for years), especially  on non-mainstream architectures. This is why we're sticking with a Debian 8 VM for now.</ref>. It has been modified to feature an updated C++11 toolchain (GCC 5.5.0).
The current reference VM is a pre-configured Debian 8.11 PowerPC system<ref>Modern versions of Debian are actually still built for big-endian PowerPC, but it's not a ''release'' architecture anymore, which means that it's only available through Debian ''unstable''. Debian unstable is harder to maintain than a stable release, and bugs/reliability issues often appear (e.g. Valgrind has been having PPC SDL compatibility problems for years, GRUB installation being much less reliable than the older Yaboot…), especially  on non-mainstream architectures. This is why we're sticking with a Debian 8 VM for now.</ref>. It has been modified to feature an updated C++11 toolchain (GCC 5.5.0).


Some important notes:
Some important notes: