Adds support for Linux ARM GLESv2 - #2912
Conversation
[Gemini] 1. **Resolved Nintendo Switch Build**: The issue was that `PREFER_SYSTEM_SDL2` was defined before the Switch platform block could override the library preference. I moved all flag definitions in CMakeLists.txt to the end of the platform detection block. This ensures the Switch correctly identifies that it should use the system SDL2, fixing the "Threads are needed" error. 2. **Fixed GLES/EGL on Native ARM64 runners**: The previous logic forced GLES on any Linux ARM system, which broke standard Linux ARM runners that expect desktop OpenGL. I've updated the logic to only auto-enable `USE_GLES2` and `USE_EGL` when `CMAKE_CROSSCOMPILING` is `ON`. * **Handhelds**: Since your Docker builds cross-compile, they will still have GLES enabled automatically. * **Native CI**: Standard native Linux runners will now default to desktop OpenGL, fixing the `/usr/bin/ld: cannot find -lGLESv2` error. 3. **Resolved `INTERFACE_SDL2_SHARED` conflict**: In sdl.cmake, the `sdlgpu` target was sometimes linking to both `SDL2` and `SDL2-static` aliases. When those both pointed to the same system shared library, CMake crashed due to property conflicts. I've consolidated the linking logic to ensure only one of them is linked, prioritizing the generic `SDL2` target when using system libraries.
|
I plan to add the There is also some other things I need to test and review. |
tic80: error while loading shared libraries: /usr/lib/aarch64-linux-gnu/libSDL2.so: cannot open shared object file: No such file or directory The issue stems from the way the stub libraries are generated in the Github workflow. When the loop creates libSDL2.so using sudo gcc -shared -o ..., it outputs the custom shared object directly into the host runner's absolute path /usr/lib/aarch64-linux-gnu/libSDL2.so. Since we did not provide an explicit SONAME (which is typically built into standard shared objects to tell the linker their "short name"), when ld resolves the links dynamically, it bakes the absolute path /usr/lib/aarch64-linux-gnu/libSDL2.so directly into the final tic80 binary's DT_NEEDED dependencies. Now, the resulting executable will only encode the canonical library name (libSDL2.so) rather than the absolute build-time path, restoring the expected runtime linking behavior on the device!
|
The failed Ubuntu build is likely due to some instability on the Ubuntu servers—they’ve been targeted by DDoS attacks lately.
Anyway, this GitHub workflow build works nicely on my TrimUI under the Knulli firmware. There are a few points that need to be addressed:
Aside from this, I got Gemini to write a library stub linker that prevents errors from version-specific glibc issues, so I think I’ll later try to unify the two linux-x86_64 versions ( |
| -DBUILD_SDLGPU=ON \ | ||
| -DUSE_GLES2=ON \ | ||
| -DUSE_EGL=ON \ | ||
| -DBUILD_EDITORS=OFF \ |
There was a problem hiding this comment.
-DBUILD_EDITORS=OFF, I think this is a bit of an assumption here. Just because they're on arm64 linux doesn't mean the user only intends to play the games.
I'm doing edits on my armhf board.
There was a problem hiding this comment.
True, it's a bit opinionated. I'm sending new PRs to enable a easier integration with gamepads without requiring to disable the editor tools. I also wonder how much BUILD_EDITORS affects performance, EMUUROM is the one that has a bit of slow down in some sections. I will test the difference sometime later.
Ideally we could make many builds, but then it takes forever the Github CI, maybe if we enable caching the compilation of the vendor src would help quite a bit.
There was a problem hiding this comment.
Similar to my suggestion on the other PR, this sounds like something better suited for a configuration file, rather than a parallel build.
If this shipped with the editor, desktop linux arm64 users would be able to grab a prebuilt binary, and if it were a config, that would also make for a great feature for those handhelds.
|
Left a comment about editors, but just wanted to say I built this on my armhf board and it worked great 👍 (I didn't realize my build was using glx/gl swrast via mesa, tic80 is hitting 60fps no problem now on my old board) |

This basically adds supports to many devices of Linux handhelds firmwares, like Rocknix, Knulli and others.