Commit Graph

40 Commits

Author SHA1 Message Date
Gioacchino Mazzurco
96d44bcbc7
Merge pull request #377 from jolavillette/fix/android-tiff-find-libm
Android: tell libtiff where libm is
2026-08-30 10:52:38 +02:00
Gioacchino Mazzurco
c4c2374d73
Merge pull request #376 from jolavillette/fix/android-rnp-probe-libdl
Android: link libdl into rnp's OpenSSL feature probe
2026-08-30 10:50:52 +02:00
jolavillette
2be2034bf6 Android: reword the libdl comment and point at the upstream rnp PR
The ordering claim only holds for linkers that resolve archives in a single
pass; the NDK's lld picks libdl.a up either way. Reference rnpgp/rnp#2473 so
the sed can be dropped once it lands.
2026-08-30 10:38:05 +02:00
jolavillette
7bbeb8bd69 Android: tell libtiff where libm is
tiff cmake/FindCMath.cmake probes pow(3) twice, first with no extra
library then with the result of find_library(NAMES m). On Android pow is
in libm, and the NDK keeps libm.so under the API level directory of the
sysroot, sysroot/usr/lib/<triple>/<api>/, which andro_cmake does not add
to CMAKE_LIBRARY_PATH. find_library returns NOTFOUND, the second probe
links exactly like the first one and both fail with

  ld.lld: error: undefined symbol: pow

so configure aborts on

  Could NOT find CMath (missing: CMath_pow)

taking build_cimg and build_phash down with it.

Pass CMath_LIBRARY explicitly rather than adding the API level directory
to the search path of every dependency, which would change how the other
ten already working ones resolve their libraries.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-17 09:39:38 +02:00
jolavillette
bd4485e6b8 Android: link libdl into rnp's OpenSSL feature probe
rnp builds a findopensslfeatures helper and runs it to enumerate the
OpenSSL features. When cross-compiling it links that helper statically so
it does not need the Android dynamic linker, but OpenSSL 1.1.1
libcrypto.a pulls in dso_dlfcn.o, which references the dl* API, and
CMake's FindOpenSSL does not add ${CMAKE_DL_LIBS} to the OpenSSL::Crypto
interface here. Nothing provides those symbols and build_librnp dies at

  ld.lld: error: undefined symbol: dlopen
  >>> referenced by dso_dlfcn.c
  >>>               dso_dlfcn.o:(dlfcn_load) in archive
  >>>               .../sysroot/usr/lib/libcrypto.a

  CMake Error at cmake/Modules/FindOpenSSLFeatures.cmake:149 (message):
    Error building findopensslfeatures

The NDK ships a static libdl.a defining dlopen/dlsym/dlclose/dlerror, so
link it explicitly. It is added as a linked library, not through
CMAKE_EXE_LINKER_FLAGS, because it must appear after libcrypto.a on the
link line for the static linker to resolve from it.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-17 09:33:14 +02:00
jolavillette
40d487caba Android: skip the rnp cross-compile patch when upstream already has it
rnp merged the CMAKE_CROSSCOMPILING_EMULATOR support that this script adds
by hand (rnpgp/rnp 0a0672af, merged 2026-07-31), and LIBRNP_SOURCE_VERSION
tracks origin/main, so the sed patches now land on top of the upstream code:
the emulator is prepended to FOF twice and the OpenSSL feature probe runs
"qemu-aarch64 /usr/bin/qemu-aarch64 build/findopensslfeatures", which dies
with

  CMake Error at cmake/Modules/FindOpenSSLFeatures.cmake:184 (message):
    Error getting supported OpenSSL hashes: 255
    qemu-aarch64: /usr/bin/qemu-aarch64: Invalid ELF image for this architecture

Guard the patch on the checkout not handling the emulator itself, so both
current main and an older pinned rnp still configure.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-16 21:24:45 +02:00
Gioacchino Mazzurco
5b016f916b
Fix G10h4ck copyright attribution treewide 2026-06-14 12:13:43 +02:00
Gioacchino Mazzurco
ba90b27199
Fix Android build for ndk r29 on ubuntu 26.04
Drop armeabi-v7a and minapi16 (EOL), build arm64-v8a at API 21/24 only.

Toolchain:
- Replace make_standalone_toolchain.py with direct NDK toolchain copy
- Use NDK r29 compiler triple naming and llvm-ar/llvm-ranlib
- Add gentoo_disturl() for hash-based Gentoo mirror URLs

Dependencies:
- Add librnp (openssl backend) with json-c and sexpp support
- Add qemu-user for librnp cross-compilation feature detection
- Replace sqlcipher with plain sqlite (RS_SQLCIPHER=OFF)
- Switch rapidjson to git source for C++17 compatibility
- Bump bzip2, zlib, libpng, xapian, tiff, cimg, sqlite versions

CMake:
- Remove Android C++14 workaround (NDK r29 std::filesystem works)
- Refactor RS_RNPLIB to support inline, pre-built, and FetchContent
- Add CMAKE_POLICY_VERSION_MINIMUM for CMake 4.x compatibility

Dockerfile:
- Move to Ubuntu 26.04, python-is-python3
- Split COPY for layer caching of SDK and toolchain builds
2026-06-14 11:44:03 +02:00
Gioacchino Mazzurco
78739f1eb5
Do not use mirrors which may be out of sync 2023-11-27 00:03:37 +01:00
Gioacchino Mazzurco
4c2de247a5
Improve CMake 2023-11-20 11:22:46 +01:00
Gioacchino Mazzurco
c3fca43265
Android toolchain enable split debug in release build 2022-11-03 11:37:36 -03:00
Gioacchino Mazzurco
8458c2242a
Android toolchain OpenSSL 1.1.1n version bump 2022-04-11 19:16:15 +02:00
Gioacchino Mazzurco
c6a7c53005
Android prepare toolchain fail early on error 2022-04-11 18:43:34 +02:00
Gioacchino Mazzurco
893137b262
Merge branch 'android_release_optimization' 2022-04-08 17:02:24 +02:00
Gioacchino Mazzurco
dc0821e69e
Add script to prepare GitalbCI Android base images 2022-04-08 16:50:09 +02:00
Gioacchino Mazzurco
eac86ae3f9
Initial support for Android CI on shared runners 2022-04-08 16:50:08 +02:00
Gioacchino Mazzurco
e2b188b5e9
Android pass build type Gradle > Toolchain > CMake 2022-04-08 16:50:08 +02:00
Gioacchino Mazzurco
5ffb7330a1
Add documentation to openssl Android toolchain
Add a link of possible interest for future updates
2022-04-08 16:50:07 +02:00
Gioacchino Mazzurco
51da6f86fd
More configurability for Docker image script generator 2022-04-08 16:48:54 +02:00
Gioacchino Mazzurco
3fb8f44bd2
Android specify float-abi for ARMv7 2022-04-08 13:27:36 +02:00
Gioacchino Mazzurco
3479ec6ba4
Fix erratic Docker image script generator 2022-04-08 11:35:35 +02:00
Gioacchino Mazzurco
56b469a15f
Initial optimizations for Android release build 2022-04-07 13:53:37 +02:00
Gioacchino Mazzurco
116b3045c0
Add script to prepare GitalbCI Android base images 2022-04-07 11:00:27 +02:00
Gioacchino Mazzurco
f0a88b3d4d
Initial support for Android CI on shared runners 2022-04-05 10:31:42 +02:00
Gioacchino Mazzurco
bcc4f087e2
Android pass build type Gradle > Toolchain > CMake 2022-04-03 19:08:12 +02:00
Gioacchino Mazzurco
92b422ed00
Add documentation to openssl Android toolchain
Add a link of possible interest for future updates
2022-04-01 22:04:20 +02:00
Gioacchino Mazzurco
047872d3c8
Android toolchain preparations improvements
Early detection of errors
Remove dead code
Update broken dopendencies
2022-03-31 17:22:20 +02:00
Gioacchino Mazzurco
8f77944880
Fix outdated documentation comment in Dockerfile 2022-03-31 17:21:37 +02:00
Gioacchino Mazzurco
d01acbf6b3
Add missing default in Android toolchain script 2022-03-23 13:33:30 +01:00
Gioacchino Mazzurco
8df6ef0971
Removed old Dockerfile 2022-02-25 16:32:58 +01:00
Gioacchino Mazzurco
fcafb66b26
More parametrizable Android build 2022-02-18 10:43:40 +01:00
Gioacchino Mazzurco
6733885330
Parametrize gradle build
Make API level parameter and get rid of flavours so build take less time
  and require less disk space, and builder can configure it at the API
  level needed
Add Dockerfile to produce AAR
Attempt to use the generated doker images for gitlab.com CI
2022-02-15 08:32:40 +01:00
Gioacchino Mazzurco
47626b7106
Updated how to install Android SDK and NDK
the old sdkmanager has been deprecated since a lot of time and doesn't
  work with openjdk 11
2022-02-08 18:08:06 +01:00
Gioacchino Mazzurco
c8672c6ad0
Set proguard rules to avoid missing Java classes
When apps that uses libretroshare are compied and proguard is run, Java
  classes coming from libretroshare and that are used only by
  libretroshare C++ code were errouneously stripped by proguard.
  Bundle proper proguard rules in the AAR to avoid runtime errors such
  as
java.lang.ClassNotFoundException: Didn't find class "org.retroshare.service.AssetHelper" on path: DexPathList[[zip file "/data/app/com.example.retroshare_aar
2022-02-07 14:08:17 +01:00
Gioacchino Mazzurco
b79ce23ef7
Android toolchain workaround Xapian static linking 2022-02-07 13:52:27 +01:00
Gioacchino Mazzurco
f7b4d01d1b
Keep using toolchain script for restbed on Android 2022-02-07 13:50:53 +01:00
Gioacchino Mazzurco
c5070bc6cf
Update Android trick to avoid debug build strip 2022-01-18 16:57:49 +01:00
Gioacchino Mazzurco
359752b3f3
Fix build with Android API < 18
getline is not available on lesser API, build anyway but terminate at
  runtime printing proper debug message if the function is used.
A better solution might be implemented in the future.
2022-01-18 16:57:48 +01:00
Gioacchino Mazzurco
ec704ac3de
Remove overridden path remnant for Android toolchain
Fix Android build
2022-01-18 01:00:03 +01:00
Gioacchino Mazzurco
32a889c543 More work to ship libretroshare as standalone lib
Improved CMake support
Initial work on packaging libretroshare as an Android library AAR
Deal properly with Android API level which miss largefile support
  instead of relying on build system trickery
2022-01-10 15:40:22 +01:00