Android: use the librnp built for the sysroot instead of rebuilding it inline - #375
Open
jolavillette wants to merge 1 commit into
Open
Android: use the librnp built for the sysroot instead of rebuilding it inline#375jolavillette wants to merge 1 commit into
jolavillette wants to merge 1 commit into
Conversation
…t inline
prepare-toolchain-clang.sh builds librnp and installs it in the Android
sysroot, but our own configure ignores it and builds librnp a second time,
inline, whenever ../supportlibs/librnp exists -- which is the case as soon as
libretroshare is checked out inside the RetroShare super-project instead of
standalone.
That inline build cannot work: librnp's CMake compiles findopensslfeatures
and runs it to enumerate the OpenSSL features, and that binary is an Android
executable the build host cannot execute. Where binfmt/qemu picks it up, as
on WSL, it fails on the missing Android dynamic linker:
CMake Error at supportlibs/librnp/cmake/Modules/FindOpenSSLFeatures.cmake:151:
Error getting supported OpenSSL hashes: 255
qemu-aarch64: Could not open '/system/bin/linker64': No such file or directory
Prefer the pre-built library on Android, falling back to the previous
behaviour when none is installed. Desktop builds are untouched: RS_ANDROID is
OFF there, so the local librnp source is still used exactly as before.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This was referenced Aug 17, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Supersedes #374, which fixed only the first symptom.
prepare-toolchain-clang.shbuilds librnp with the openssl backend and installs it in the Android sysroot, but our own configure ignores it and builds librnp a second time, inline:add_subdirectory()is taken whenever../supportlibs/librnp/CMakeLists.txtexists, i.e. as soon as libretroshare is checked out inside the RetroShare super-project rather than standalone.That inline build cannot work on Android, for a reason that has nothing to do with the crypto backend: librnp's
FindOpenSSLFeatures.cmakecompilesfindopensslfeaturesand runs it to enumerate the OpenSSL features. The binary it just built is an Android executable, which the build host cannot execute. Where binfmt/qemu picks it up — WSL, typically — it gets as far as the ELF interpreter and stops there:Note the path: that is the super-project's pinned librnp submodule, not the copy the toolchain script clones and patches, so none of the script's cross-compilation workarounds apply to it.
This prefers the pre-built library when
RS_ANDROIDis set, falling back to the previous behaviour when none is installed. Desktop builds are untouched (RS_ANDROIDis OFF, the local librnp source is used exactly as today).Why CI never saw it: the GitLab AAR jobs build from this repository standalone, so
../supportlibs/librnpdoes not exist andfind_library(NAMES rnp)already picked up the sysroot copy. The bug only shows up in a super-project checkout.Verified by exercising the three paths of the edited block: desktop + librnp submodule present → inline, unchanged; Android + pre-built librnp → pre-built; Android + nothing installed → inline, as before.
Reported on IRC by defnax, building the AAR for rs-mobile under WSL.