Opened 14 months ago

Last modified 7 months ago

#10695 new defect

ppc64le incorrectly detected as big endian

Reported by: classilla Owned by:
Priority: normal Component: Ports
Keywords: Cc:


Later Power processors such as the Talos II's POWER9 CPUs can run in little-endian mode, but this doesn't seem to be detected by ScummVM, which still thinks it's big-endian and causes graphic corruption.

These are usually listed as ppc64le or ppc64el (uname -m on this Fedora system is "ppc64le").

Change History (3)

comment:1 by digitall, 13 months ago

classilla: Since the Talos II workstation is not that common, I can't replicate your issue directly as I don't have access to the hardware.

However, assuming that you are compiling ScummVM natively with GCC (or similar), Endian is detected by the configure script which does this by testing the output of a compiled test program. See:

The normal output on my x86_64 Linux box which is little endian is:
Running ScummVM configure...
Looking for C++ compiler... g++
Checking for whether C++ compiler accepts -Wno-pragma-pack... no
Checking endianness... little

Can you confirm whether the configure script when run on your machine reports as big or little endian? Or is it reporting some kind of error to stderr?

Apart from that, you could try extracting that C++ program and manually compiling to compare the output...

comment:2 by digitall, 13 months ago

You could also try the following patch to the configure script:

diff --git a/configure b/configure
index 2f846010ac..0466a48359 100755
--- a/configure
+++ b/configure
@@ -2215,6 +2215,8 @@ elif $_strings $TMPO.o | grep LiTTleEnDian >/dev/null; then
 echo $_endian;
+cp tmp_endianness_check.cpp tmp_endianness_check.cpp.bak
+cp $TMPO.o tmp_endianness_check.o.bak
 cc_check_clean tmp_endianness_check.cpp
 case $_endian in

This will copy the relevant source code and object file for this test to files ending in .bak so you can zip them and attach to this bug for analysis.

comment:3 by bonki, 7 months ago

@classilla Have you had a chance to test digitall's suggestions?

Note: See TracTickets for help on using tickets.