Repository navigation
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) |
The one conflict was in build.yml: this branch adds the arm64 GLES2 job right where main has since changed the gcc-14 job's cmake line (ccache, Ninja, PRO). Kept the new job, and main's line.
|
Merged |
The merge resolution took main's cmake line for it (ccache, Ninja, PRO), but this job is the branch's own addition and installs no ccache, while every job that uses that line installs it itself. Back to the line the branch shipped, the one its June run built with.
|
Correction on my merge: the conflict resolution gave the new |
The earlier merge resolution tangled the gcc14 job with main's export-stub steps and left it calling ccache without installing it. The file is rebuilt from main, with only what this branch introduces added back: the arm64 GLES2 job and the gcc14 job, each with its own steps. Co-Authored-By: Claude Code <noreply@anthropic.com>
|
Rebuilt |
nesbox
left a comment
There was a problem hiding this comment.
Read the flag wiring: GLES2 and EGL are opt-in at the CMake level with the defaults off, and the new job is a self-contained arm64 GLES2/EGL build for a target like a handheld. The conflict was CI only, and the rebuilt build.yml is main's plus this branch's two jobs, additions only.
Why: the option adds the SURF entry of the main menu to a build that has no editors, and it is meant to be asked for by hand. #2912 turned it on in the job it added, which is the only place in CI that names the option, and every artifact the pipeline produces is what somebody gets: a browser arriving that way is a decision taken for the default build, not one taken by whoever wants it on their device. The job is editorless again, and what it builds is what an editorless build without the option has always been: no console and no browser, carts by argument only. The CMake comment now records that no CI job asks for the option, so the next build that wants the browser on a handheld passes -DBUILD_SURF=ON itself. Refs #3015 Co-Authored-By: Claude Code <noreply@anthropic.com>

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