[FFmpeg-user] compiling for android

Patrick Shirkey pshirkey at boosthardware.com
Wed Jul 9 14:16:57 CEST 2014


On Wed, July 9, 2014 8:38 pm, Carl Eugen Hoyos wrote:
> Patrick Shirkey <pshirkey <at> boosthardware.com> writes:
>
>> -DCNU_SOURCE is an ifdef in math.h included in the NDK.
>> #ifdef _GNU_SOURCE
>
> Now please remove it from your configure line, as said
> it is not just wrong but also unneeded: If it turns out
> that it is needed, it would be a serious bug in FFmpeg,
> please report it (in that case)!
>
>> > The following compiles fine here (no cross-compiling) with
>> > gcc -lm. If it doesn't work for your cross-compiler, I
>> > suspect you have to fix it before you can compile FFmpeg.
>> >

IIUC, the error comes about because the compiler tries to optimise when
sin and cos are used within one line of each other.

If it is the compiler that is making the decision to use the sincos
functions I would have to recompile the compiler to support
-fno-builtin-sincos in order to turn it off.

However I don't know why -fno-builtin-sincos does not kick in during the
build. Is there a location in  configure where I can force it?



>> > #define _GNU_SOURCE
>> > #include <math.h>
>> > int main(void)
>> > {
>> > double a, b, c;
>> > sincos(a, &b, &c);
>> > return b*c;
>> > }
>
>> - I have tried several options for trying to bypass
>> the problem
>
> Did you try to compile the code I posted?
> Without any options?
> With -fno-builtin-sincos?
>

I might have screwed up the command but both with and without 
-fno-builtin-sincos  return the following:

/4.4/prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.7/bin/arm-linux-androideabi-gcc
\
-I/4.4/prebuilts/ndk/current/platforms/android-18/arch-arm/usr/include \
-L/4.4/prebuilts/ndk/current/platforms/android-18/arch-arm/usr/lib
../testlm.c

../testlm.c: In function 'main':
../testlm.c:6:2: warning: incompatible implicit declaration of built-in
function 'sincos' [enabled by default]
/4.4/prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.7/bin/../lib/gcc/arm-linux-androideabi/4.7/../../../../arm-linux-androideabi/bin/ld:
error: cannot open crtbegin_dynamic.o: No such file or directory
/4.4/prebuilts/gcc/linux-x86/arm/arm-linux-androideabi-4.7/bin/../lib/gcc/arm-linux-androideabi/4.7/../../../../arm-linux-androideabi/bin/ld:
error: cannot open crtend_android.o: No such file or directory
/tmp/ccsomEJz.o:testlm.c:function main: error: undefined reference to
'sincos'
collect2: error: ld returned 1 exit status






--
Patrick Shirkey
Boost Hardware Ltd


More information about the ffmpeg-user mailing list