<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body text="#000000" bgcolor="#FFFFFF">
<p><br>
</p>
<br>
<div class="moz-cite-prefix">On 08/09/2018 06:26 PM, Mark Spieth
wrote:<br>
</div>
<blockquote type="cite"
cite="mid:d5e292f3-b2e9-f4fe-9fbd-70269ab25a79@digivation.com.au">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<div class="moz-cite-prefix">On 8/10/2018 7:27 AM, Peter Bennett
wrote:<br>
</div>
<blockquote type="cite"
cite="mid:bcd6b3a3-a5fb-dd66-bafc-2d4b272b4334@gmail.com">
<meta http-equiv="Content-Type" content="text/html;
charset=utf-8">
<p><br>
</p>
<br>
<div class="moz-cite-prefix">On 08/08/2018 08:14 PM, Mark Spieth
wrote:<br>
</div>
<blockquote type="cite"
cite="mid:25d87838-2afa-731d-f47a-dce47af19077@digivation.com.au">On
09/08/18 08:37, Peter Bennett wrote: <br>
<blockquote type="cite">I am trying to build the libraries for
32bit. <br>
<br>
liblzo fails in the configure "C compiler cannot create
executables" <br>
<br>
makelibs.sh has, for 32bit, CPU="armv7-a" <br>
<br>
The configure runs this <br>
<br>
/home/peter/android/android-ndk/my-android-toolchain/bin/arm-linux-androideabi-gcc
-isysroot
/home/peter/android/android-ndk/my-android-toolchain/sysroot
-mcpu=armv7-a conftest.c <br>
<br>
The error is <br>
<br>
arm-linux-androideabi-gcc: error: unrecognized argument in
option '-mcpu=armv7-a' <br>
arm-linux-androideabi-gcc: note: valid arguments to '-mcpu='
are: arm1020e arm1020t arm1022e arm1026ej-s arm10e arm10tdmi
arm1136j-s arm1136jf-s arm1156t2-s arm1156t2f-s arm1176jz-s
arm1176jzf-s arm2 arm250 arm3 arm6 arm60 arm600 arm610
arm620 arm7 arm70 arm700 arm700i arm710 arm7100 arm710c
arm710t arm720 arm720t arm740t arm7500 arm7500fe arm7d
arm7di arm7dm arm7dmi arm7m arm7tdmi arm7tdmi-s arm8 arm810
arm9 arm920 arm920t arm922t arm926ej-s arm940t arm946e-s
arm966e-s arm968e-s arm9e arm9tdmi cortex-a12 cortex-a15
cortex-a15.cortex-a7 cortex-a5 cortex-a53 cortex-a57
cortex-a57.cortex-a53 cortex-a7 cortex-a8 cortex-a9
cortex-m0 cortex-m0plus cortex-m1 cortex-m3 cortex-m4
cortex-r4 cortex-r4f cortex-r5 cortex-r7 ep9312 fa526
fa606te fa626 fa626te fa726te fmp626 generic-armv7-a iwmmxt
iwmmxt2 marvell-pj4 mpcore mpcorenovfp native strongarm
strongarm110 strongarm1100 strongarm1110 xscale <br>
<br>
I tried changing CPU to use generic-armv7-a which is one of
the "valid" arguments according to above message. That gives
the same error, but this time not even displaying the list
of "valid arguments". <br>
<br>
ndk is android-ndk-r13b <br>
<br>
Any suggestions? <br>
<br>
</blockquote>
try this. <br>
<br>
diff --git a/android/makelibs.sh b/android/makelibs.sh <br>
index 9d737b2..8c54895 100755 <br>
--- a/android/makelibs.sh <br>
+++ b/android/makelibs.sh <br>
@@ -1179,17 +1179,15 @@ OPATH=$PATH <br>
# ;; <br>
# *) <br>
#END <br>
+export PATH="$PATH:$CROSSPATH" <br>
./configure \ <br>
- CFLAGS="-isysroot $SYSROOT -mcpu=$CPU" \ <br>
- CXXFLAGS="-isysroot $SYSROOT -mcpu=$CPU" \ <br>
- CC="$CROSSPATH/$MY_ANDROID_NDK_TOOLS_PREFIX-gcc" \ <br>
- CXX="$CROSSPATH/$MY_ANDROID_NDK_TOOLS_PREFIX-g++" \ <br>
- CPP="$CROSSPATH/$MY_ANDROID_NDK_TOOLS_PREFIX-cpp" \ <br>
- --host=arm-linux-androideabi \ <br>
+ --host=$MY_ANDROID_NDK_TOOLS_PREFIX \ <br>
--prefix=$INSTALLROOT \ <br>
--enable-shared \ <br>
--enable-static && \ <br>
make clean && \ <br>
+CFLAGS="-isysroot $SYSROOT -mcpu=$CPU" \ <br>
+CXXFLAGS="-isysroot $SYSROOT -mcpu=$CPU" \ <br>
make -j$NCPUS src/liblzo2.la && \ <br>
make install-libLTLIBRARIES install-data-am <br>
ERR=$? <br>
<br>
builds for me both 32 and 64 but untested on targets. <br>
<br>
Mark <br>
<br>
<br>
</blockquote>
Thank you, it now builds and installs on my 32-bit tablet.
However it does not run.<br>
<br>
D/dalvikvm( 6836): Trying to load lib
/data/data/org.mythtv.mythfrontend/lib/libQt5Core.so 0x4199b580
<br>
E/dalvikvm( 6836):
dlopen("/data/data/org.mythtv.mythfrontend/lib/libQt5Core.so")
failed: Cannot load library: soinfo_relocate(linker.cpp:976):
cannot locate symbol "srand" referenced by "libQt5Core.so"... <br>
W/System.err( 6836): java.lang.reflect.InvocationTargetException
<br>
...<br>
W/System.err( 6836): Caused by: java.lang.UnsatisfiedLinkError:
Cannot load library: soinfo_relocate(linker.cpp:976): cannot
locate symbol "srand" referenced by "libQt5Core.so"... <br>
<br>
Some internet links about this -<br>
<br>
<i>For those stumbling onto this thread while having trouble
with srand/atof on NDK r10c: Make sure you set your android
target to 19. Your app should then work on Android 5 (21) as
well as all lower versions.</i><i><br>
</i><br>
<i>if i use Android 19 to compile the codes that invoke srand(),
because srand() is a static inline function, so it will invoke
srand48 instead, which means cocos2d-x depends on srand48
instead of srand. srand48 is defined in all Android versions,
so there is not problem.</i><i><br>
</i><i>i using Android 21+ to compiling the codes, srand() is
defined like void srand(unsigned int);, so cocos2d-x depends
on srand. Because srand is not defined below Android 21, so it
will have problem if running on Android version below 21.</i><i><br>
</i><br>
My tablet has android 4.2.2, which should be ok with api version
21, I would think.<br>
</blockquote>
Ah 4.2.2. <br>
<br>
I have a "special" build mode.<br>
<br>
./makelibs.sh --oldarm all<br>
./mythbuild --oldarm<br>
<br>
It did work for me for 4.2.2 and 4.4 like my projector and my TV.
32 bit only build too.<br>
<br>
I just noticed that there may be some inconsistencies between
makelibs and mythbuild for ANDROID_NATIVE_API_LEVEL.<br>
That may (or not) need to be resolved.<br>
<br>
Also this is untested with newer lib additions as yet.<br>
<br>
HTH<br>
Mark<br>
<br>
</blockquote>
Hi Mark<br>
<br>
--oldarm successfully compiled and installed after a couple of
tweaks.<br>
<br>
Now it fails with <br>
<br>
D/dalvikvm( 9979): Trying to load lib
/data/data/org.mythtv.mythfrontend/qt-reserved-files/plugins/platforms/android/libqtforandroid.so
0x4212fc50
<br>
E/dalvikvm( 9979):
dlopen("/data/data/org.mythtv.mythfrontend/qt-reserved-files/plugins/platforms/android/libqtforandroid.so")
failed: Cannot load library: soinfo_link_image(linker.cpp:1636):
could not load library "libfreetype.so" needed by
"libqtforandroid.so"; caused by load_library(linker.cpp:746):
library "libfreetype.so" not found
<br>
<br>
I checked, libfreetype.so does exist in
/data/data/org.mythtv.mythfrontend/lib/<br>
It is the correct file type<br>
peter@andromeda:~$ file
'/home/peter/proj/github.com/MythTV/packaging/android/mythinstallold/libs/armeabi-v7a/libfreetype.so'<br>
/home/peter/proj/github.com/MythTV/packaging/android/mythinstallold/libs/armeabi-v7a/libfreetype.so:
ELF 32-bit LSB shared object, ARM, EABI5 version 1 (SYSV),
dynamically linked, interpreter /system/bin/linker, stripped<br>
<br>
Perhaps it is supposed to be in directory
/data/data/org.mythtv.mythfrontend/qt-reserved-files/plugins/platforms/android/
where that libqtforandroid.so is found.<br>
<br>
Adding to my confusion is the fact that in the apk we do not deploy
a file called
qt-reserved-files/plugins/platforms/android/libqtforandroid.so - we
actually deploy
lib/armeabi-v7a/libplugins_platforms_android_libqtforandroid.so and
by some magic it maybe gets renamed and moved, or possibly just
linked.<br>
<br>
On android the file
/data/data/org.mythtv.mythfrontend/libplugins_platforms_android_libqtforandroid.so
exists and can be listed.<br>
I am unable to list
/data/data/org.mythtv.mythfrontend/qt-reserved-files/plugins/platforms/android/,
I get Permission denied.<br>
<br>
If you don't know what is going on here, no worry this is not
important, just something I am trying for interest and learning.<br>
<br>
Peter<br>
</body>
</html>