Cube 2: Sauerbraten port for EmuELEC?

I noticed EmuELEC has a port of SuperTuxKart, which looks to be an aarch64 native game.

Since I have SuperTuxKart on my PC, I was wondering if there could also be a port of Cube 2 Sauerbraten, a first person shooter game that I also have on my PC.

The game itself is quite old so I suspect my Amlogic processor could run it reasonably well.

There are prebuilt binaries (for client and server) for linux on x86 and x86_64 architectures but not aarch64, so I went and built them using qemu and a debian stable chroot environment.

Would it be enough to copy over the game, the newly built aarch64 binaries, and game data over to a fresh EmuELEC install?

There are several dependency libraries which I’m not sure if EmuELEC has them, perhaps I can just copy over the required libraries as well? I do see there’s a folder inside the storage partition that contains ‘put_user_libs_here’.

I can also include how I built the aarch64 binaries if necessary.

Here is the output of file on the generated client binary to confirm that it was built for aarch64:

$ file linux_aarch64_client

linux_aarch64_client: ELF 64-bit LSB pie executable, ARM aarch64, version 1 (GNU/Linux), dynamically linked, interpreter /lib/, BuildID[sha1]=c12084bca365641af6cc13942c077fef74f4229e, for GNU/Linux 3.7.0, stripped

And here is ldd to show what libraries it would need:

$ ldd linux_aarch64_client => /usr/lib/aarch64-linux-gnu/ (0x0000005502bb7000) => /usr/lib/aarch64-linux-gnu/ (0x0000005502d06000) => /usr/lib/aarch64-linux-gnu/ (0x0000005502e98000) => /usr/lib/aarch64-linux-gnu/ (0x0000005502ec7000) => /lib/aarch64-linux-gnu/ (0x0000005502efb000) => /usr/lib/aarch64-linux-gnu/ (0x0000005502f25000) => /lib/aarch64-linux-gnu/ (0x000000550301c000) => /usr/lib/aarch64-linux-gnu/ (0x0000005503036000) => /lib/aarch64-linux-gnu/ (0x000000550320e000) => /lib/aarch64-linux-gnu/ (0x00000055032b9000) => /usr/lib/aarch64-linux-gnu/ (0x000000550342e000) => /lib/aarch64-linux-gnu/ (0x0000005503466000)
	/lib/ (0x0000005500000000) => /usr/lib/aarch64-linux-gnu/ (0x000000550347a000) => /usr/lib/aarch64-linux-gnu/ (0x0000005503589000) => /usr/lib/aarch64-linux-gnu/ (0x00000055035e6000) => /usr/lib/aarch64-linux-gnu/ (0x000000550360a000) => /usr/lib/aarch64-linux-gnu/ (0x0000005503625000) => /usr/lib/aarch64-linux-gnu/ (0x0000005503638000) => /usr/lib/aarch64-linux-gnu/ (0x0000005503658000) => /usr/lib/aarch64-linux-gnu/ (0x0000005503674000) => /usr/lib/aarch64-linux-gnu/ (0x0000005503688000) => /usr/lib/aarch64-linux-gnu/ (0x000000550369d000) => /usr/lib/aarch64-linux-gnu/ (0x00000055036c0000) => /usr/lib/aarch64-linux-gnu/ (0x00000055036de000) => /usr/lib/aarch64-linux-gnu/ (0x00000055036f0000) => /usr/lib/aarch64-linux-gnu/ (0x0000005503711000) => /usr/lib/aarch64-linux-gnu/ (0x0000005503729000) => /lib/aarch64-linux-gnu/ (0x000000550377a000) => /usr/lib/aarch64-linux-gnu/ (0x00000055037ab000) => /usr/lib/aarch64-linux-gnu/ (0x00000055037f2000) => /usr/lib/aarch64-linux-gnu/ (0x0000005503844000) => /usr/lib/aarch64-linux-gnu/ (0x00000055038d3000) => /usr/lib/aarch64-linux-gnu/ (0x0000005503935000) => /usr/lib/aarch64-linux-gnu/ (0x0000005503acf000) => /usr/lib/aarch64-linux-gnu/ (0x0000005503baf000) => /usr/lib/aarch64-linux-gnu/ (0x0000005503bc8000) => /usr/lib/aarch64-linux-gnu/ (0x0000005503c0e000) => /usr/lib/ (0x0000005503c6f000) => /usr/lib/aarch64-linux-gnu/ (0x0000005503c8b000) => /usr/lib/aarch64-linux-gnu/ (0x0000005503e16000) => /lib/aarch64-linux-gnu/ (0x0000005503e59000) => /usr/lib/aarch64-linux-gnu/ (0x0000005503e7f000) => /usr/lib/aarch64-linux-gnu/ (0x0000005503e93000) => /usr/lib/aarch64-linux-gnu/pulseaudio/ (0x0000005503ea9000) => /lib/aarch64-linux-gnu/ (0x0000005503f34000) => /usr/lib/aarch64-linux-gnu/ (0x0000005503f9a000) => /usr/lib/aarch64-linux-gnu/ (0x0000005503fb5000) => /usr/lib/aarch64-linux-gnu/ (0x0000005503fcb000) => /lib/aarch64-linux-gnu/ (0x0000005503fef000) => /usr/lib/aarch64-linux-gnu/ (0x0000005504027000) => /usr/lib/aarch64-linux-gnu/ (0x0000005504040000) => /lib/aarch64-linux-gnu/ (0x000000550410e000) => /usr/lib/aarch64-linux-gnu/ (0x0000005504144000) => /usr/lib/aarch64-linux-gnu/ (0x0000005504161000) => /usr/lib/aarch64-linux-gnu/ (0x0000005504185000) => /usr/lib/aarch64-linux-gnu/ (0x00000055042c8000) => /usr/lib/aarch64-linux-gnu/ (0x00000055042de000) => /usr/lib/aarch64-linux-gnu/ (0x0000005504342000) => /usr/lib/aarch64-linux-gnu/ (0x0000005504357000) => /lib/aarch64-linux-gnu/ (0x00000055043e8000) => /usr/lib/aarch64-linux-gnu/ (0x0000005504451000) => /usr/lib/aarch64-linux-gnu/ (0x000000550452a000) => /usr/lib/aarch64-linux-gnu/ (0x0000005504599000) => /usr/lib/aarch64-linux-gnu/ (0x00000055045d2000) => /usr/lib/aarch64-linux-gnu/ (0x00000055045ec000) => /usr/lib/aarch64-linux-gnu/ (0x000000550464a000) => /usr/lib/aarch64-linux-gnu/ (0x000000550466f000) => /usr/lib/aarch64-linux-gnu/ (0x0000005504737000) => /usr/lib/aarch64-linux-gnu/ (0x0000005504751000) => /lib/aarch64-linux-gnu/ (0x0000005504767000) => /usr/lib/aarch64-linux-gnu/ (0x00000055047d9000) => /lib/aarch64-linux-gnu/ (0x000000550488b000) => /usr/lib/aarch64-linux-gnu/ (0x00000055048c9000) => /usr/lib/aarch64-linux-gnu/ (0x00000055048e5000) => /usr/lib/aarch64-linux-gnu/ (0x0000005504914000) => /usr/lib/aarch64-linux-gnu/ (0x00000055049e4000) => /lib/aarch64-linux-gnu/ (0x0000005504a0e000) => /lib/aarch64-linux-gnu/ (0x0000005504a35000) => /lib/aarch64-linux-gnu/ (0x0000005504a68000) => /usr/lib/aarch64-linux-gnu/ (0x0000005504aa7000) => /usr/lib/aarch64-linux-gnu/ (0x0000005504b05000) => /usr/lib/aarch64-linux-gnu/ (0x0000005504bf0000) => /lib/aarch64-linux-gnu/ (0x0000005504c2e000) => /usr/lib/aarch64-linux-gnu/ (0x0000005504c42000) => /lib/aarch64-linux-gnu/ (0x0000005504c5f000)

My apologies, the above two commands were run inside of the debian chroot I used to build for aarch64, you can disregard that.

This time I tried running both the client and server from within EmuELEC 4.5 via a terminal, server seems to work, client was missing only 1 (!) library.

Here are the commands from within EmuELEC this time:

linux_aarch64_client: ELF 64-bit LSB pie executable, ARM aarch64, version 1 (GNU/Linux), dynamically linked, interpreter /lib/, BuildID[sha1]=c12084bca365641af6cc13942c077fef74f4229e, for GNU/Linux 3.7.0, stripped (0x0000007f9820f000) => not found => /usr/lib/ (0x0000007f97d0c000) => /usr/lib/ (0x0000007f97c93000) => /usr/lib/ (0x0000007f97add000) => /usr/lib/ (0x0000007f97aac000) => /usr/lib/ (0x0000007f97905000) => /usr/lib/ (0x0000007f978ee000) => /usr/lib/ (0x0000007f97716000) => /usr/lib/ (0x0000007f9766d000) => /usr/lib/ (0x0000007f97510000) => /usr/lib/ (0x0000007f974fc000) => /usr/lib/ (0x0000007f974cf000)
	/lib/ => /usr/lib/ (0x0000007f981e1000) => /usr/lib/ (0x0000007f974ab000)

It appears that the only missing library is libX11.

Now for the server:

linux_aarch64_server: ELF 64-bit LSB pie executable, ARM aarch64, version 1 (GNU/Linux), dynamically linked, interpreter /lib/, BuildID[sha1]=bdc9c7672b7cb49a438c267d0d214a72fe921a28, for GNU/Linux 3.7.0, stripped (0x0000007f8c807000) => /usr/lib/ (0x0000007f8c71a000) => /usr/lib/ (0x0000007f8c542000) => /usr/lib/ (0x0000007f8c499000) => /usr/lib/ (0x0000007f8c33c000) => /usr/lib/ (0x0000007f8c318000)
	/lib/ => /usr/lib/ (0x0000007f8c7d9000)

Any tips from here to get the client to run? Can I just copy the libX11 library into the user libs directory? Or maybe the newest EmuELEC release has the library?

Also one crucial detail I forgot here, this game wants working mouse functionality for navigation, not sure if mouse is functional on EmuELEC? The wireless keyboard I use with my box comes with a touchpad which doesn’t seem to do anything.

One more detail, this game does seem to depend on X11 in some way as seen by the above missing library, but EmuELEC does not appear to run X11, how is that? I assumed SuperTuxKart also needed X11 at least when I ran it on my PC.

EmuELEC does not use X11, it uses SDL2/FBDEV

You could try following these steps to download a working toolchain that you could use to compile the program: DEV: How to compile toolchain only · EmuELEC/EmuELEC Wiki (

If the program requires X11 it won’t work.

If you have a link to the source I can give it a go.

I built the toolchain as per those instructions inside of a debian bullseye container made with debootstrap. I also had to install the gawk zstd packages for the toolchain to build and I used “Amlogic-ce” instead of “Amlogic-ng” for the project name since the latter was invalid.

The game shouldn’t require X11 since it can run inside a tty framebuffer, and the build instructions don’t have X11 as a dependency.

Now that I familiarized myself a bit with EmuELEC packaging, I wrote a script for building the game from source.

# SPDX-License-Identifier: GPL-2.0
# Copyright (C) 2018-present Team LibreELEC (

PKG_DEPENDS_TARGET="toolchain SDL2 SDL2_image SDL2_mixer libpng libjpeg-turbo zlib" # libGL (OpenGL) is also needed
PKG_SHORTDESC="3D first-person shooter game - EmuELEC port"
PKG_LONGDESC="Sauerbraten is a networked 3D first-person shooter game. It supports modern graphic effects and conveys a sense of fast-paced oldschool gameplay."

# A simple make install builds the game client and server

make_target() {
	cd src
	make install

makeinstall_target() {
	# Copy game client and server
	cp ../bin_unix/native_client $INSTALL/usr/bin/sauerbraten-client
	cp ../bin_unix/native_server $INSTALL/usr/bin/sauerbraten-server
	# data, packages folders go in here
	#mkdir -p $INSTALL/usr/share/games/sauerbraten
	#cp -r ../data $INSTALL/usr/share/games/sauerbraten
	#cp -r ../packages $INSTALL/usr/share/games/sauerbraten
	# docs folder goes in here
	#mkdir -p $INSTALL/usr/share/doc/sauerbraten
	#cp -r ../docs $INSTALL/usr/share/games/sauerbraten

The make install function needs some work. As for compiling the game itself I get this “CROSS COMPILE Badness” error and don’t know how to proceed:

e[1;33mBUILDe[0m      sauerbraten e[1;37m(target)e[0m
    e[1;35mTOOLCHAINe[0m      make
/home/emuelec/EmuELEC/build.EmuELEC-Amlogic-ng.aarch64-4/toolchain/bin/aarch64-libreelec-linux-gnueabi-g++ -O3 -fomit-frame-pointer -ffast-math -Wall -fsigned-char -fno-exceptions -fno-rtti -Ishared -Iengine -Ifpsgame -Ienet/include -I/usr/X11R6/include `sdl2-config --cflags` -x c++-header -o shared/cube.h.gch.tmp shared/cube.h
/home/emuelec/EmuELEC/build.EmuELEC-Amlogic-ng.aarch64-4/toolchain/bin/aarch64-libreelec-linux-gnueabi-g++ -O3 -fomit-frame-pointer -ffast-math -Wall -fsigned-char -fno-exceptions -fno-rtti -DSTANDALONE -Ishared -Iengine -Ifpsgame -Ienet/include -c -o engine/worldio-standalone.o engine/worldio.cpp
/home/emuelec/EmuELEC/build.EmuELEC-Amlogic-ng.aarch64-4/toolchain/bin/aarch64-libreelec-linux-gnueabi-g++ -O3 -fomit-frame-pointer -ffast-math -Wall -fsigned-char -fno-exceptions -fno-rtti -DSTANDALONE -Ishared -Iengine -Ifpsgame -Ienet/include -c -o fpsgame/entities-standalone.o fpsgame/entities.cpp
/home/emuelec/EmuELEC/build.EmuELEC-Amlogic-ng.aarch64-4/toolchain/bin/aarch64-libreelec-linux-gnueabi-g++ -O3 -fomit-frame-pointer -ffast-math -Wall -fsigned-char -fno-exceptions -fno-rtti -DSTANDALONE -Ishared -Iengine -Ifpsgame -Ienet/include -c -o fpsgame/server-standalone.o fpsgame/server.cpp
CROSS COMPILE Badness: /usr/include in INCLUDEPATH: /usr/include/SDL2
cc1plus: internal compiler error: in add_path, at
0x194fb68 diagnostic_impl(rich_location*, diagnostic_metadata const*, int, char const*, __va_list_tag (*) [1], diagnostic_t)
0x19508af internal_error(char const*, ...)
0x6ea289 fancy_abort(char const*, int, char const*)
0x8de827 add_path(char*, incpath_kind, int, bool)
0x92667c c_common_handle_option(unsigned long, char const*, long, int, unsigned int, cl_option_handlers const*)
0x19418b3 handle_option(gcc_options*, gcc_options*, cl_decoded_option const*, unsigned int, int, unsigned int, cl_option_handlers const*, bool, diagnostic_context*)
0x19419fa read_cmdline_option(gcc_options*, gcc_options*, cl_decoded_option*, unsigned int, unsigned int, cl_option_handlers const*, diagnostic_context*)
0xcfd732 decode_options(gcc_options*, gcc_options*, cl_decoded_option*, unsigned int, unsigned int, diagnostic_context*, void (*)())
Please submit a full bug report, with preprocessed source (by using -freport-bug).
Please include the complete backtrace with any bug report.
See <> for instructions.
make: *** [Makefile:176: shared/cube.h.gch] Error 1
make: *** Waiting for unfinished jobs....
e[1;31mFAILURE: ./scripts/build sauerbraten during make_target ([0m
*********** FAILED COMMAND ***********
make install

This usually means that the makefile is using absolute paths, so its trying to use your local libraries and applications, a makefile needs to be patched to use the toolchain path.

There were 3 Makefiles in the source, 2 of them use the sdl2-config executable from my debian container host rather than the one in the toolchain path, this causes it to use the host libraries.

It seems there is no /home/emuelec/EmuELEC/build.EmuELEC-Amlogic-ng.aarch64-4/toolchain/bin/sdl2-config available so it uses the one in /usr/bin/sdl2-config

I tried patching the Makefiles to call it by using ${SYSROOT_PREFIX}/usr/bin/sdl2-config instead and I verified that the Makefiles were indeed patched but I kept getting the same error (maybe I didn’t pass the SYSROOT_PREFIX correctly).

What I did instead that seemed to work is I removed the patches and added export PATH="${SYSROOT_PREFIX}/usr/bin:$PATH" before the make install, but then I get this error:

I patched the makefiles to use ${SYSROOT_PREFIX}/usr/bin/sdl2-config for flags and it worked.

Also the Makefiles did want the X11 library, since I know the game can run inside a framebuffer I patched the makefiles to remove X11.

e[1;33mBUILDe[0m      sauerbraten e[1;37m(target)e[0m
    e[1;35mTOOLCHAINe[0m      make
/home/emuelec/EmuELEC/build.EmuELEC-Amlogic-ng.aarch64-4/toolchain/bin/aarch64-libreelec-linux-gnueabi-g++ -O3 -fomit-frame-pointer -ffast-math -Wall -fsigned-char -fno-exceptions -fno-rtti -o sauer_client shared/crypto.o shared/geom.o shared/glemu.o shared/stream.o shared/tools.o shared/zip.o engine/3dgui.o engine/bih.o engine/blend.o engine/blob.o engine/client.o engine/command.o engine/console.o engine/cubeloader.o engine/decal.o engine/dynlight.o engine/glare.o engine/grass.o engine/lightmap.o engine/main.o engine/material.o engine/menus.o engine/movie.o engine/normal.o engine/octa.o engine/octaedit.o engine/octarender.o engine/physics.o engine/pvs.o engine/rendergl.o engine/rendermodel.o engine/renderparticles.o engine/rendersky.o engine/rendertext.o engine/renderva.o engine/server.o engine/serverbrowser.o engine/shader.o engine/shadowmap.o engine/sound.o engine/texture.o engine/water.o engine/world.o engine/worldio.o fpsgame/ai.o fpsgame/client.o fpsgame/entities.o fpsgame/fps.o fpsgame/monster.o fpsgame/movable.o fpsgame/render.o fpsgame/scoreboard.o fpsgame/server.o fpsgame/waypoint.o fpsgame/weapon.o -Lenet -lenet -L/home/emuelec/EmuELEC/build.EmuELEC-Amlogic-ng.aarch64-4/toolchain/aarch64-libreelec-linux-gnueabi/sysroot/usr/lib -lSDL2 -lSDL2_image -lSDL2_mixer -lz -lGL -lrt
/home/emuelec/EmuELEC/build.EmuELEC-Amlogic-ng.aarch64-4/toolchain/bin/aarch64-libreelec-linux-gnueabi-g++ -O3 -fomit-frame-pointer -ffast-math -Wall -fsigned-char -fno-exceptions -fno-rtti -o sauer_server shared/crypto-standalone.o shared/stream-standalone.o shared/tools-standalone.o engine/command-standalone.o engine/server-standalone.o engine/worldio-standalone.o fpsgame/entities-standalone.o fpsgame/server-standalone.o -Lenet -lenet -lz
/home/emuelec/EmuELEC/build.EmuELEC-Amlogic-ng.aarch64-4/toolchain/lib/gcc/aarch64-libreelec-linux-gnueabi/12.2.0/../../../../aarch64-libreelec-linux-gnueabi/bin/ld: cannot find -lGL: No such file or directory
collect2: error: ld returned 1 exit status
make: *** [Makefile:206: client] Error 1
make: *** Waiting for unfinished jobs....
e[1;31mFAILURE: scripts/build sauerbraten during make_target ([0m
*********** FAILED COMMAND ***********

It seems like the OpenGL library was not found? I didn’t add it to the dependencies in the file since I didn’t find a package that provides it, not sure where/which it is, gl4es didn’t seem to work.