Opened 8 weeks ago

Last modified 3 weeks ago

#10695 new defect

ppc64le incorrectly detected as big endian

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

Description

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 (2)

comment:1 Changed 3 weeks ago by digitall

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:
https://github.com/scummvm/scummvm/blob/master/configure#L2198

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

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 Changed 3 weeks ago by digitall

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
        _endian=little
 fi
 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.

Note: See TracTickets for help on using tickets.