I'm trying to build libreelec for the Bananapi M2 Zero, an Allwinner H2-plus device with 512 MB RAM and mali-400 gpu. I know, unsupported. I managed to get the device booting by downgrading to older u-boot, and with some firmware changes wifi and bluetooth seem fine too. I think I have enough kernel patches for the device tree to get kodi supported with mesa. However, mesa / limadriver appears to be too slow, so I changed my build to use libmali instead. Here's where I run into problems. Kodi never starts. If I log into my device over ssh and start kodi from there, it complains that libgbm.so.1 is missing. So I linked /usr/lib/libgbm.so to /storage/libgbm.so.1 and started kodi with LD_LIBRARY_PATH=/storage. It complained of a missing symbol: gbm_surface_create_with_modifiers.
Now, when I look through the libmali sources in the libreelec git repo, it appears that they include sources for a libgbm.so that wraps the binary libmali blobs and adds a couple of recent gbm symbols, such as gbm_surface_create_with_modifiers. However, the build just includes /usr/lib/libgbm.so as a symlink to the binary libmali, without the wrapper. I don't know how to work cmake and ninja to make them build that libgbm.so.1 wrapper library. Does anyone here have any suggestions?