dynablaster_revenge
dynablaster_revenge copied to clipboard
Build fails on aarch64
gcc version 8.3.0 (Debian 8.3.0-26) aarch64
src/game/gamefontmap.cpp:99:1: error: narrowing conversion of ‘-1’ from ‘int’ to ‘char’ inside { } [-Wnarrowing] };
{'}', 12,810, 52,106, -2,1, 54, },
{'~', 220,941, 79,42, -6,66, 89, },
{ -1, 0, 0, 0, 0, 0, 0, 0 }
Is there a missing char in single quotes before -1?
[EDIT] Adding -Wno-narrowing to CXXFLAGS and CFLAGS in Makefile allows build to next error:
src/tools/profiling.cpp:21:5: error: impossible constraint in ‘asm’
Pulling out the asm (temporarily) and setting t=1; gets me an executeable:
dynablaster: ELF 64-bit LSB pie executable, ARM aarch64, version 1 (GNU/Linux), dynamically linked, interpreter /lib/ld-linux-aarch64.so.1
But running I get segfault after title screen.
SoundManager::SoundManager: sound device initialized failed!
extensions:
max texture units: 4
vertex texture units: 32
combined texture units: 192
max texture size: 16384
backtracing in gdb yields:
Reading symbols from ./dynablaster...
(gdb) run
Starting program: /big/pcbak/Projects/games/dynablaster_revenge/client/dynablaster
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/aarch64-linux-gnu/libthread_db.so.1".
[New Thread 0x7fb2ecd110 (LWP 4346)]
qt5ct: using qt5ct plugin
libpng warning: iCCP: known incorrect sRGB profile
[New Thread 0x7faab14110 (LWP 4349)]
extensions:
max texture units: 4
vertex texture units: 32
combined texture units: 192
max texture size: 16384
Thread 1 "dynablaster" received signal SIGSEGV, Segmentation fault.
PSD::Layer::loadChannels (this=0x55569d6cf8, stream=stream@entry=0x7fffffe470) at src/image/psd.cpp:310
310 dst[x] = (a << 24) | (r << 16) | (g << 8) | b;
(gdb) bt
#0 0x000000555567822c in PSD::Layer::loadChannels(Stream*) (this=0x55569d6cf8, stream=stream@entry=0x7fffffe470)
at src/image/psd.cpp:310
#1 0x0000005555678a2c in PSD::loadLayerInformation(Stream*)
(this=this@entry=0x55566d7878, stream=stream@entry=0x7fffffe470) at src/image/psd.cpp:585
#2 0x0000005555678b10 in PSD::load(Stream*) (this=this@entry=0x55566d7878, stream=stream@entry=0x7fffffe470)
at src/image/psd.cpp:618
#3 0x0000005555678b90 in PSD::load(char const*)
(this=this@entry=0x55566d7878, filename=0x55569d78c8 "data/game/messaging_bar.psd") at src/image/psd.cpp:598
#4 0x000000555562fb54 in GameMessagingDrawable::initializeLayers() (this=this@entry=0x55566d7850)
at /usr/include/aarch64-linux-gnu/qt5/QtCore/qarraydata.h:61
#5 0x000000555562ff14 in GameMessagingDrawable::initializeGL() (this=0x55566d7850)
at src/game/gamemessagingdrawable.cpp:350
#6 0x0000005555617d14 in GameView::initializeGL() (this=0x5555892aa0) at src/game/bombermanview.cpp:282
#7 0x0000007fb7cf6b78 in QGLWidget::glInit() () at /usr/lib/aarch64-linux-gnu/libQt5OpenGL.so.5
#8 0x0000007fb7cfa424 in QGLWidget::resizeEvent(QResizeEvent*) () at /usr/lib/aarch64-linux-gnu/libQt5OpenGL.so.5
#9 0x0000007fb77e92f8 in QWidget::event(QEvent*) () at /usr/lib/aarch64-linux-gnu/libQt5Widgets.so.5
#10 0x0000007fb77a71d4 in QApplicationPrivate::notify_helper(QObject*, QEvent*) ()
at /usr/lib/aarch64-linux-gnu/libQt5Widgets.so.5
#11 0x0000007fb77b0670 in QApplication::notify(QObject*, QEvent*) () at /usr/lib/aarch64-linux-gnu/libQt5Widgets.so.5
#12 0x0000007fb6bc4a68 in QCoreApplication::notifyInternal2(QObject*, QEvent*) ()
at /usr/lib/aarch64-linux-gnu/libQt5Core.so.5
#13 0x0000007fb77e2018 in QWidgetPrivate::sendPendingMoveAndResizeEvents(bool, bool) ()
at /usr/lib/aarch64-linux-gnu/libQt5Widgets.so.5
#14 0x0000007fb77e5918 in QWidgetPrivate::show_helper() () at /usr/lib/aarch64-linux-gnu/libQt5Widgets.so.5
#15 0x0000007fb77e87c8 in QWidgetPrivate::setVisible(bool) () at /usr/lib/aarch64-linux-gnu/libQt5Widgets.so.5
#16 0x0000005555613008 in BombermanClientGui::initGameView() (this=this@entry=0x7fffffec30)
at src/game/bombermanclientgui.cpp:928
#17 0x0000005555614abc in BombermanClientGui::initialize() (this=0x7fffffec30) at src/game/bombermanclientgui.cpp:953
#18 0x000000555558baf0 in main(int, char**) (argc=<optimized out>, argv=0x7fffffee28) at src/dynamain.cpp:40
(gdb)
(gdb) print {a,r,g,b}
$7 = {3 '\003', <optimized out>, <optimized out>, <optimized out>}
Unsigned int on arm is 32-bit, so dst[x] = (a << 24) | (r << 16) | (g << 8) | b should be fine.
The "optimized out" comes from -O2, compiling with -O0 yields
Thread 1 "dynablaster" received signal SIGSEGV, Segmentation fault.
PSD::Layer::loadChannels (this=0x5556b6baa8, stream=0x7fffffe468) at src/image/psd.cpp:300
300 r= red[x];
(gdb) p r
$2 = 0 '\000'
(gdb) p x
$6 = 1
(gdb) p red[1]
Cannot access memory at address 0x1
. This might be of some use for profiling later. Leaving here for notes. http://zhiyisun.github.io/2016/03/02/How-to-Use-Performance-Monitor-Unit-(PMU)-of-64-bit-ARMv8-A-in-Linux.html
Is the last problem something as simple as file not found? It doesn't look like your working directory is the game's root directory.