Found an easier way, though i'd still need someone to compile (please? -insert puppy image here-

)
cross-compile RetroArch 1.9.0 (armv7hf, static, fbdev ---
https://github.com/libretro/RetroArch/releases?page=4) plus the mGBA libtertro core (
https://github.com/FunKey-Project/mgba-libretro).
Then drop the 'retroarch' ELF and the 'mgba_libretro.so' in koreader (retroarch at /mnt/us/koreader/custom/bin
-------------------------------------------------------------------------------------------------
1) Prepare your Ubuntu/Debian host
sudo dpkg --add-architecture armhf
sudo apt update
sudo apt install \
gcc-arm-linux-gnueabihf g++-arm-linux-gnueabihf \
libudev-dev:armhf libasound2-dev:armhf \
pkg-config git build-essential
-----------------------------------------------------------------
2) Grab RetroArch 1.9.0
git clone --branch v1.9.0 --depth 1
https://github.com/libretro/RetroArch.git
cd RetroArch
mkdir build && cd build
------------------------------------------------------------------------
3) Set up your cross-env
export PREFIX=/usr/arm-linux-gnueabihf
export CC=arm-linux-gnueabihf-gcc
export CXX=arm-linux-gnueabihf-g++
export AR=arm-linux-gnueabihf-ar
export RANLIB=arm-linux-gnueabihf-ranlib
export LD=arm-linux-gnueabihf-ld
export PKG_CONFIG_PATH=$PREFIX/lib/pkgconfig
------------------------------------------------------------------
4) Configure for static fbdev-only
../configure \
--host=arm-linux-gnueabihf \
--disable-shared \ # no .so libs
--enable-static \ # bake everything into retroarch
--enable-fbdev \ # use the Linux framebuffer
--disable-sdl \ # skip SDL drivers
--disable-wayland \
--disable-x \
--disable-opengl \
--disable-pulse \
--disable-alsa \
--disable-udev \
--disable-usb \
--disable-dynamic
5) Build & strip
make -j$(nproc)
$AR cru libretro-common.a libretro-common/*.o # ensure core code is in static lib
$RANLIB libretro-common.a
$CC -O2 -static -march=armv7-a -mfpu=neon -mfloat-abi=hard \
-o retroarch retroarch.o libretro-common.a ... # this is done by make
arm-linux-gnueabihf-strip retroarch
You should now have a single 'build/retroarch' binary.
-------------------------------------------------------------------------------------
6) Cross-compile the mGBA libretro core
cd ~/RetroArch
git clone --depth 1
https://github.com/libretro/libretro-mgba.git
cd libretro-mgba
make clean
make -j$(nproc) \
CROSS_PREFIX=arm-linux-gnueabihf- \
HOST_CC=gcc \
HOST_CFLAGS="-O2" \
CORE=mgba \
STATIC=1
arm-linux-gnueabihf-strip mgba_libretro.so
----------------------------------------------------
7) Install on your Kindle
Mount your PW5 over USB (e.g. '/mnt/us'):
mkdir -p /mnt/us/koreader/custom/{bin,libretro}
cp build/retroarch /mnt/us/koreader/custom/bin/
cp libretro-mgba/mgba_libretro.so /mnt/us/koreader/custom/libretro/
chmod +x /mnt/us/koreader/custom/bin/retroarch
---------------------------------------------------------
8) Configure & launch in KOReader
#1. Create '/mnt/us/koreader/custom/bin/retroarch.cfg' with:
video_driver = "fbdev"
libretro_directory = "/mnt/us/koreader/custom/libretro"
input_analog_dpad_mode = "1"
#2. In KOReader → Tools → More tools → External apps → retroarch
- Load Core → mGBA
- Load Content → pick your '.gba' rom.
mGBA should now be running (but I'm not sure about the FPS...)
If it works, please send the retroarch + mgba files so that everyone can use it.
If it doesn't, please post back so that I can try to fix it. (And in the meantime, install gambatte-K2, that works perfectly (and probably better thatn gpSP/mGBA will))