Page 1 of 4

Help with android build

Posted: Tue Feb 05, 2013 5:31 pm
by divingmule
Hi, I've successfully built both S74ck3r/rtmpdump and svnpenn/rtmpdump static version via stream recorder instructions -> http://stream-recorder.com/forum/showpo ... stcount=31

What I'm after is the shared libs (librtmp) from svnpenn/rtmpdump but make fails with 'SHARED=' -

Code: Select all

make[1]: Entering directory `/c/Users/divingmule/Documents/GitHub/rtmpdump/librtmp'
arm-linux-androideabi-gcc   -o librtmp rtmp.o log.o amf.o hashswf.o parseurl.o  -lpolarssl -lz 
c:/mingw/msys/1.0/my-android-toolchain/bin/../lib/gcc/arm-linux-androideabi/4.6/../../../../arm-linux-androideabi/bin/ld.exe: c:/mingw/msys/1.0/my-android-toolchain/bin/../sysroot/usr/lib/crtbegin_dynamic.o: in function _start:crtbrand.c(.text+0x78): error: undefined reference to 'main'
collect2: ld returned 1 exit status
make[1]: *** [librtmp] Error 1
make[1]: Leaving directory `/c/Users/divingmule/Documents/GitHub/rtmpdump/librtmp'
make: *** [librtmp/librtmp.a] Error 2
Any help is appreciated!

Re: Help with android build

Posted: Tue Feb 05, 2013 5:51 pm
by svnpenn
divingmule wrote:Hi, I've successfully built both S74ck3r/rtmpdump and svnpenn/rtmpdump static version via stream recorder instructions -> http://stream-recorder.com/forum/showpo ... stcount=31
What I'm after is the shared libs (librtmp) from svnpenn/rtmpdump but make fails with 'SHARED=' -
If you want shared library, then you must leave off the SHARED=

Re: Help with android build

Posted: Tue Feb 05, 2013 10:10 pm
by divingmule
I'm sorry. That should have read "make fails without "SHARED='"

Re: Help with android build

Posted: Tue Feb 05, 2013 10:31 pm
by svnpenn
divingmule wrote:I'm sorry. That should have read "make fails without "SHARED='"
Try to build with official master and post your findings.

Re: Help with android build

Posted: Tue Feb 05, 2013 11:48 pm
by divingmule
Same as above with the official master, successful with static, fails with the same error if 'SHARED=' is not used.

I can successfully compile S74ck3r/rtmpdump with the shared libs but, it seems that the source doesn't have the same updates/patches. I'm particularly looking for support for the -jtv option in librtmp.

Re: Help with android build

Posted: Wed Feb 06, 2013 7:50 am
by svnpenn
divingmule wrote:Same as above with the official master, successful with static, fails with the same error if 'SHARED=' is not used.
I can successfully compile S74ck3r/rtmpdump with the shared libs but, it seems that the source doesn't have the same updates/patches. I'm particularly looking for support for the -jtv option in librtmp.
Sadly I have no interest in downloading the 312 MB Android NDK. Perhaps "S74ck3r" could shed some light on your issues.

Re: Help with android build

Posted: Wed Feb 06, 2013 8:50 am
by S74ck3r
I'll admit C really isn't my thing so I'm not sure what's wrong. There are a couple of things I can think of, the first being that I'm using version r7 of the NDK and GCC compiler version 4.4.3 whereas you appear to be using GCC 4.6.

Also I had to make a couple of minor changes to the build. I needed to add -lm to the build command using the XLIBS flag as the maths library wasn't linked automatically. Also I needed to change the path to wait.h in parseurl.c from <wait.h> to <sys/wait.h>.

These could just be to do with my setup though.

I can tell you that it does build ok though and there are binaries here https://bitbucket.org/S74ck3r/rtmpdump- ... /downloads

If you're just after the binaries with librtmp.so.0 then grab the archive with svnpenn shared in the filename.
If you want the librtmp.a and other build artefacts so you can link against them in your own project then grab the archive titled local.7z.

hope that helps.
Richard

Re: Help with android build

Posted: Tue Mar 26, 2013 4:38 am
by RedPenguin
Maybe S74ck3r or someone else can help me on this one. I have a weird thing going on.

I am attempting to cross-compile using Cygwin + Android NDK on Win 8, very similar to how I did for iOS and others.

Anyway, my buddy's Nexus 7 is running with XBMC experimental for hardware acceleration.

Everything is working fine out of the box except the common thing that the librtmp shipped with XBMC doesn't do redirects, have mips/uflash/etc fixes.

I noticed the default librtmp.so included is like 1.xMB which is far bigger than any other XBMC one I've seen.

Yet every single librtmp.so that I make either from S74ck3r's git or the official git, it all just crashes XBMC claiming it can't load "libcurl.so" yet I never touched said file. Plus my files generally come to to about 4xx KB not even close to the same file size as the original.

Re: Help with android build

Posted: Tue Mar 26, 2013 5:23 pm
by S74ck3r
I'll have a go at recreating this when I get home. In the mean time is it possible to get a copy of the logcat with the error?

thanks
Richard

Re: Help with android build

Posted: Tue Mar 26, 2013 10:32 pm
by RedPenguin
S74ck3r wrote:I'll have a go at recreating this when I get home. In the mean time is it possible to get a copy of the logcat with the error?

thanks
Richard
No problem on my end but it will be a while until I can get a hold of my friend who actually has the Android to give you the logcat.
EDIT:
Here's the main part of his log:

V/XBMC ( 2079): 19:24:02 T:1665961568 DEBUG: Loading: /data/app-lib/org.xbmc.xbmc-2/libcurl.so
V/XBMC ( 2079): xb_dlopen: Error from dlopen(/data/app-lib/org.xbmc.xbmc-2/librtmp.so): Cannot load library: soinfo_relocate(linker.cpp:975): cannot locate symbol "sqrt" referenced by "librtmp.so"...
V/XBMC ( 2079): xb_dlopen: Error from dlopen(/data/app-lib/org.xbmc.xbmc-2/libcurl.so): Cannot load library: soinfo_link_image(linker.cpp:1635): could not load library "librtmp.so" needed by "libcurl.so"; caused by find_library(linker.cpp:889): "librtmp.so" failed to load previously
V/XBMC ( 2079): 19:24:02 T:1665961568 ERROR: Unable to load /data/app-lib/org.xbmc.xbmc-2/libcurl.so, reason: (null)

At least now I understand the libcurl error but how does one fix this sqrt problem? That seems to indicate some issue in compiling it, to me anyway.