Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Native Development

Reply
Highlighted
Developer
Posts: 368
Registered: ‎06-30-2012
My Device: Playbook, Z10LE, DevAlpha C
My Carrier: Telenor, Mobitel
Accepted Solution

FFMpeg compile

Hello 

I'm trying to compile FFMpeg for playbook (tried both on bbndk 2.0 and 2.1)

but with no success.

Here is my configuration command:

./configure --enable-cross-compile --cross-prefix=arm-unknown-nto-qnx6.5.0eabi --arch=armv7 --prefix=/opt/local/cross/bbndk-2.0/arm-qnx6.5.0eabi/sys-root --enable-debug --disable-optimizations --disable-asm --disable-static --enable-shared --target-os=qnx --disable-ffplay

 

and returned message is:

arm-unknown-nto-qnx6.5.0eabigcc is unable to create an executable file.
C compiler test failed.

I'm using Ubuntu 11.10.

Does anyone succeded to compile FFmpeg for Playbook?

If someone succeded pls attach compiled libraries, so all BB community can use it.

 

 

 

Developer
Posts: 368
Registered: ‎06-30-2012
My Device: Playbook, Z10LE, DevAlpha C
My Carrier: Telenor, Mobitel

Re: FFMpeg compile

This path dont exist on my comp:

prefix=/opt/local/cross/bbndk-2.0/arm-qnx6.5.0eabi/sys-root

 

How to set proper prefix on Ubuntu 11.10 and bb ndk 2.1?

Developer
Posts: 1,041
Registered: ‎07-16-2008
My Device: ಠ_ಠ

Re: FFMpeg compile

[ Edited ]

Hey, I don't have a solution for you for FFMpeg, but I recently ran into a very similar cross-compile issue when compiling the ICU libraries for the Android NDK. Here's my script for it. Basically armv6-google-linux was key for ICU, you can't just use anything. I'm not sure where arm-unknown-nto-qnx6.5.0eabi came from, but maybe you want to look at the configure script to see what it expects, or how it handles what it takes in.

 

#!/bin/sh

NDK_ROOT=/tools/android/android-ndk-r6b
NDK_TOOLCHAIN_BIN=$NDK_ROOT/toolchains/arm-linux-androideabi-4.4.3/prebuilt/darwin-x86/bin
SDK_ROOT=$NDK_ROOT/platforms/android-8/arch-arm
ICU_PATH=/Users/mreed/Desktop/icu
ICU_FLAGS="-I$ICU_PATH/source/common/ -I$ICU_PATH/source/tools/tzcode/"

export CPPFLAGS="--sysroot=$SDK_ROOT -D__STDC_INT64__ $ICU_FLAGS -I$SDK_ROOT/usr/include/ -I$NDK_ROOT/sources/cxx-stl/gnu-libstdc++/include/ -I$NDK_ROOT/sources/cxx-stl/gnu-libstdc++/libs/armeabi/include/"
export LDFLAGS="--sysroot=$SDK_ROOT -L$NDK_ROOT/sources/cxx-stl/gnu-libstdc++/libs/armeabi/"

export CC=$NDK_TOOLCHAIN_BIN/arm-linux-androideabi-gcc-4.4.3
export CXX=$NDK_TOOLCHAIN_BIN/arm-linux-androideabi-g++
export RANLIB=$NDK_TOOLCHAIN_BIN/arm-linux-androideabi-ranlib
export AR=$NDK_TOOLCHAIN_BIN/arm-linux-androideabi-ar

sh $ICU_PATH/source/configure --host=armv6-google-linux --enable-static --disable-shared -with-cross-build=$ICU_PATH/hostbuild

 

Developer
Posts: 368
Registered: ‎06-30-2012
My Device: Playbook, Z10LE, DevAlpha C
My Carrier: Telenor, Mobitel

Re: FFMpeg compile

Thank you for your response mreed, believe me i tried everything, invluding analyzing configure file to see what is expected. I'm not novice programmer, but right now i'm clueless. 

Developer
Posts: 1,041
Registered: ‎07-16-2008
My Device: ಠ_ಠ

Re: FFMpeg compile

[ Edited ]

Okay, well, from just a quick glance at the ffmpeg configure script, "cross-prefix" is used as the toolchain name prefix. So where the normal tools are g++ and gcc, with your prefix it is looking for arm-unknown-nto-qnx6.5.0eabig++ and arm-unknown-nto-qnx6.5.0eabigcc... which don't look right to me. I don't have the NDK installed on this machine, so I can't confirm that.

 

This is how it is used:

cxx_default="g++"

cxx_default="${cross_prefix}${cxx_default}"

 

The "prefix" argument is where to install the built library. So you probably don't need that.

 

Maybe you want to look at the configure script again.

 

http://git.videolan.org/?p=ffmpeg.git;a=blob;f=configure;h=956e3a147f60919daab5259a4fc497e1c6da9343;...

Developer
Posts: 1,041
Registered: ‎07-16-2008
My Device: ಠ_ಠ

Re: FFMpeg compile

I just installed the 10.0.04 NDK and it is arm-unknown-nto-qnx8.0.0eabi-gcc... so you need to add a "-" to your cross-prefix.

Developer
Posts: 368
Registered: ‎06-30-2012
My Device: Playbook, Z10LE, DevAlpha C
My Carrier: Telenor, Mobitel

Re: FFMpeg compile

Hello mreed, you was right about prefix flag, i dont need that, but i dont understand what have you installed, what is 10.0.0 NDK? I'm using bb NDK 2.0.1 , and where to put that "-" sign, i dont follow you. Thx

Developer
Posts: 368
Registered: ‎06-30-2012
My Device: Playbook, Z10LE, DevAlpha C
My Carrier: Telenor, Mobitel

Re: FFMpeg compile

Ok, so i found this

http://supportforums.blackberry.com/t5/Native-Development/SIGABRT-corrupt-stack-after-linking-with-S... post and amongst other things i saw ffmpeg compilation, and author claims that is succesfully compiled, i see now where is that "-" sign, but again, i cant compile it.

 

I get from log:

WARNING: arm-unknown-nto-qnx6.5.0eabi-pkg-config not found, library detection may fail.
mktemp -u XXXXXX
u4XLN4
WARNING: Unknown C compiler arm-unknown-nto-qnx6.5.0eabi-gcc, unable to select optimal CFLAGS
check_ld cc
check_cc
BEGIN /tmp/ffconf.9Wx4vwnS.c
1 int main(void){ return 0; }
END /tmp/ffconf.9Wx4vwnS.c
arm-unknown-nto-qnx6.5.0eabi-gcc -c -o /tmp/ffconf.AVItNbkB.o /tmp/ffconf.9Wx4vwnS.c
./configure: 2654: arm-unknown-nto-qnx6.5.0eabi-gcc: not found
C compiler test failed.

Developer
Posts: 1,041
Registered: ‎07-16-2008
My Device: ಠ_ಠ

Re: FFMpeg compile

The 10.0.04 NDK is for BlackBerry 10.

 

For the cross-prefix you have "arm-unknown-nto-qnx6.5.0eabi" so when the configure script appends "gcc" you get "arm-unknown-nto-qnx6.5.0eabigcc", which is incorrect (unless the 2.0.1 NDK is doing it different). So you need to append "-" to cross-prefix to have "arm-unknown-nto-qnx6.5.0eabi-", which will produce "arm-unknown-nto-qnx6.5.0eabi-gcc".

Developer
Posts: 1,041
Registered: ‎07-16-2008
My Device: ಠ_ಠ

Re: FFMpeg compile

"./configure: 2654: arm-unknown-nto-qnx6.5.0eabi-gcc: not found"

 

Do you have the path to the bin directory (the one holding arm-unknown-nto-qnx6.5.0eabi-gcc) in your PATH environment variable?