buggins / coolreader

Official site of CoolReader project. Sourceforge repository is obsolete.
GNU General Public License v2.0
374 stars 100 forks source link

Android: latest build failed for armeabi #324

Open Tolsi opened 2 years ago

Tolsi commented 2 years ago

Looks like after release 3.1.2-33 there was an update to the Android NDK, which in version 17+ lost support for the armeabi architecture. I am the owner of Nook Simple Touch (armeabi, Android 2.1) and I wanted to try and build the latest version of Coolreader for this platform and wanted to ask for help with this. I work on this here

So far I've run into two problems:

  1. Last <17 NDK version (16.1.3379499) contains zlib 1.2.3, but third-party libpng 1.6.37 requires zlib 1.2.7. Most likely I can't use a newer version of NDK/zlib, but should I rollback libpng?
In file included from coolreader/thirdparty/libpng-1.6.37/pngwio.c:21:
../../../../../../thirdparty/libpng-1.6.37/pngpriv.h:920:4: error: ZLIB_VERNUM != PNG_ZLIB_VERNUM       "-I (include path) error: see the notes in pngpriv.h"

#define ZLIB_VERNUM 0x1230 from .../ndk/16.1.3379499/sysroot/usr/include/zlib.h and #define PNG_ZLIB_VERNUM 0x1270 from app/thirdparty_libs/libpng/lib/pnglibconf.h. What can I do?

  1. If I comment the first zlib version check then I got some libpng PIC Level error:
C/C++: /home/tolsi/android/sdk/ndk/16.1.4479499/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/bin/ld: fatal error: Failed to link module thirdparty_libs/libpng/liblocal_png.a.llvm.9556.png.c: linking module flags 'PIC Level': IDs have conflicting values

I have no idea how to fix it. Perhaps this is a consequence of the first problem

virxkane commented 2 years ago

Theoretically there is a complicated workaround:

I've never done this, so I can't say more.