Previous Thread
Next Thread
Print Thread
#111367 - 11/25/17 02:42 PM MAME ppc64 / gcc 7.2.1  
Joined: May 2008
Posts: 4,858
qmc2 Offline
qmc2  Offline

Very Senior Member

Joined: May 2008
Posts: 4,858
Germany
I resurrected my old Power 5 (52A) and installed openSUSE Tumbleweed ppc64 on it... gladly there's a fairly current big-endian ppc64 build of openSUSE Tumbleweed now wink! Most current distros only build for Power8+ LE.

Anyway, here's a little info about the system:

Code
ppclinux:~ # uname -a
Linux ppclinux 4.13.3-1-default #1 SMP Wed Sep 20 06:43:24 UTC 2017 (76ecbd3) ppc64 ppc64 ppc64 GNU/Linux

ppclinux:~ # lscpu
Architecture:        ppc64
CPU op-mode(s):      32-bit, 64-bit
Byte Order:          Big Endian
CPU(s):              4
On-line CPU(s) list: 0-3
Thread(s) per core:  2
Core(s) per socket:  2
Socket(s):           1
NUMA node(s):        1
Model:               2.0 (pvr 003b 0200)
Model name:          POWER5+ (gs)
L1d cache:           32K
L1i cache:           64K
L2 cache:            1920K
L3 cache:            36864K
NUMA node0 CPU(s):   0-3

ppclinux:~ # cat /proc/cpuinfo 
processor       : 0
cpu             : POWER5+ (gs)
clock           : 1648.350000MHz
revision        : 2.0 (pvr 003b 0200)

processor       : 1
cpu             : POWER5+ (gs)
clock           : 1648.350000MHz
revision        : 2.0 (pvr 003b 0200)

processor       : 2
cpu             : POWER5+ (gs)
clock           : 1648.350000MHz
revision        : 2.0 (pvr 003b 0200)

processor       : 3
cpu             : POWER5+ (gs)
clock           : 1648.350000MHz
revision        : 2.0 (pvr 003b 0200)

timebase        : 206401000
platform        : pSeries
model           : IBM,9131-52A
machine         : CHRP IBM,9131-52A
MMU             : Hash

ppclinux:~ # gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib64/gcc/powerpc64-suse-linux/7/lto-wrapper
Target: powerpc64-suse-linux
Configured with: ../configure --prefix=/usr --infodir=/usr/share/info --mandir=/usr/share/man --libdir=/usr/lib64 --libexecdir=/usr/lib64 --enable-languages=c,c++,objc,fortran,obj-c++,ada,go --enable-checking=release --disable-werror --with-gxx-include-dir=/usr/include/c++/7 --enable-ssp --disable-libssp --disable-libvtv --disable-libmpx --disable-libcc1 --enable-plugin --with-bugurl=http://bugs.opensuse.org/ --with-pkgversion='SUSE Linux' --with-slibdir=/lib64 --with-system-zlib --enable-__cxa_atexit --enable-libstdcxx-allocator=new --disable-libstdcxx-pch --enable-version-specific-runtime-libs --with-gcc-major-version-only --enable-linker-build-id --enable-linux-futex --enable-gnu-indirect-function --program-suffix=-7 --without-system-libunwind --with-cpu-64=power4 --enable-secureplt --with-long-double-128 --build=powerpc64-suse-linux --host=powerpc64-suse-linux
Thread model: posix
gcc version 7.2.1 20170901 [gcc-7-branch revision 251580] (SUSE Linux)

Just for fun I'm building MAME on it at the moment... the first issue I got is that gcc 7.2.1 spits a number of "implicit fallthrough" warnings for some switch statements in GENie, but I could work around this by passing "-Wno-implicit" to gcc.

The next issue I got was this warning:

Code
Compiling src/mame/machine/dec_lk201.cpp...
In file included from ../../../../../src/emu/profiler.h:29:0,
                 from ../../../../../src/emu/emu.h:31,
                 from ../../../../../src/mame/machine/dec_lk201.cpp:107:
../../../../../src/emu/attotime.h: In member function ‘virtual void lk201_device::device_reset()’:
../../../../../src/emu/attotime.h:133:82: error: ‘frequency’ is used uninitialized in this function [-Werror=uninitialized]
  static attotime from_hz(double frequency) { assert(frequency > 0); double d = 1 / frequency; return attotime(floor(d), modf(d, &d) * ATTOSECONDS_PER_SECOND); }
                                                                                ~~^~~~~~~~~~~
../../../../../src/emu/attotime.h:133:18: note: ‘frequency’ was declared here
  static attotime from_hz(double frequency) { assert(frequency > 0); double d = 1 / frequency; return attotime(floor(d), modf(d, &d) * ATTOSECONDS_PER_SECOND); }
                  ^~~~~~~
../../../../../src/emu/attotime.h:133:82: error: ‘frequency’ is used uninitialized in this function [-Werror=uninitialized]
  static attotime from_hz(double frequency) { assert(frequency > 0); double d = 1 / frequency; return attotime(floor(d), modf(d, &d) * ATTOSECONDS_PER_SECOND); }
                                                                                ~~^~~~~~~~~~~
../../../../../src/emu/attotime.h:133:18: note: ‘frequency’ was declared here
  static attotime from_hz(double frequency) { assert(frequency > 0); double d = 1 / frequency; return attotime(floor(d), modf(d, &d) * ATTOSECONDS_PER_SECOND); }
                  ^~~~~~~
cc1plus: all warnings being treated as errors
make[2]: *** [dec.make:412: ../../../../linux_gcc/obj/x64/Release/src/mame/machine/dec_lk201.o] Error 1
make[1]: *** [Makefile:532: dec] Error 2

I actually can't see the reason for that warning because ‘frequency’ is passed by value... so I think it's a compiler bug, but MAME devs may correct me smile. Not sure if it's a general gcc 7.x or a ppc64 specific bug (or problem).

To workaround this I passed "-Wno-uninitialized" to g++. Let's see how it goes for the rest...

Last edited by qmc2; 11/25/17 03:13 PM.

A mind is like a parachute. It doesn't work unless it's open. [Frank Zappa]

We're searching for QMC2 translators and support for existing translations. Interested? See here!
#111368 - 11/25/17 04:50 PM Re: MAME ppc64 / gcc 7.2.1 [Re: qmc2]  
Joined: May 2008
Posts: 4,858
qmc2 Offline
qmc2  Offline

Very Senior Member

Joined: May 2008
Posts: 4,858
Germany
Originally Posted by qmc2
To workaround this I passed "-Wno-uninitialized" to g++.

Funnily, it later on complained about the same thing as "maybe uninitialized" when compiling src/mame/video/pcd.cpp. So I added "-Wno-maybe-uninitialized" to the g++ command. The fact that it first was "sure", then "not so sure" about the same piece of code just supports the assumption that it's a compiler bug wink.


A mind is like a parachute. It doesn't work unless it's open. [Frank Zappa]

We're searching for QMC2 translators and support for existing translations. Interested? See here!
#111372 - 11/25/17 07:17 PM Re: MAME ppc64 / gcc 7.2.1 [Re: qmc2]  
Joined: May 2008
Posts: 4,858
qmc2 Offline
qmc2  Offline

Very Senior Member

Joined: May 2008
Posts: 4,858
Germany
After a few more of these and other strange warnings I switched to using "NOWERROR=1" as RB suggested. This finally succeeded (all tools built as well):

Code
...
Archiving liboptional.a...
Compiling src/mame/mame.cpp...
Building driver list...
34751 driver(s) found
Compiling generated/mame/mame/drivlist.cpp...
Linking mame64...

rene@ppclinux:~/src/mame> file mame64
mame64: ELF 64-bit MSB executable, 64-bit PowerPC or cisco 7500, version 1 (GNU/Linux), dynamically linked, interpreter /lib64/ld64.so.1, for GNU/Linux 3.2.0, BuildID[sha1]=f4d2cb4256447cc35fb58470e6fb826d2ea4b194, with debug_info, not stripped

rene@ppclinux:~/src/mame> ./mame64 -help
MAME v0.191 (mame0191-785-g8c594736a9)
Copyright Nicola Salmoria and the MAME team

This software reproduces, more or less faithfully, the behaviour of a wide range
of machines. But hardware is useless without software, so images of the ROMs and
other media which run on that hardware are also required.

Usage:  mame64 [machine] [media] [software] [options]

        mame64 -showusage    for a brief list of options
        mame64 -showconfig   for a list of configuration options
        mame64 -listmedia    for a full list of supported media
        mame64 -createconfig to create a mame.ini

For usage instructions, please consult the files config.txt and windows.txt.

I will later do some tests with games. The system has no display, so I have to use X redirection or VNC...


A mind is like a parachute. It doesn't work unless it's open. [Frank Zappa]

We're searching for QMC2 translators and support for existing translations. Interested? See here!
#111378 - 11/25/17 10:48 PM Re: MAME ppc64 / gcc 7.2.1 [Re: qmc2]  
Joined: May 2008
Posts: 4,858
qmc2 Offline
qmc2  Offline

Very Senior Member

Joined: May 2008
Posts: 4,858
Germany
It basically works, but the displayed colors are weird / byte-swapped... screenshots taken with F12 look good, though

I tried with galaga and pooyan using this command line:

Code
rene@ppclinux:~/src/mame> ./mame64 -rp /mame/mame/roms -video soft -videodriver x11 -renderdriver software -window -nomaximize -verbose pooyan

@hap:

Originally Posted by hap via shout-box
Please let us know if you find any bugs caused by BE. One thing I'm curious about is 16-bit eeprom, for example toaplan2 fixeight is a simple test (won't boot if eeprom endian is flipped).

No, fixeight doesn't work at all.


A mind is like a parachute. It doesn't work unless it's open. [Frank Zappa]

We're searching for QMC2 translators and support for existing translations. Interested? See here!

Moderated by  R. Belmont 

Who's Online Now
6 registered members (box, ted, F1ReB4LL, Cpt. Pugwash, r09, 1 invisible), 19 guests, and 2 spiders.
Key: Admin, Global Mod, Mod
Shout Box
Forum Statistics
Forums9
Topics8,456
Posts109,747
Members4,768
Most Online225
May 26th, 2014
Powered by UBB.threads™ PHP Forum Software 7.6.0
Page Time: 0.043s Queries: 14 (0.022s) Memory: 4.9563 MB (Peak: 5.1599 MB) Zlib enabled. Server Time: 2017-12-15 21:21:47 UTC