[FFmpeg-user] compiling for android
Carl Eugen Hoyos
cehoyos at ag.or.at
Thu Jul 10 09:23:33 CEST 2014
Nicolas George <george <at> nsup.org> writes:
> Le primidi 21 messidor, an CCXXII, Patrick Shirkey a écrit :
> > Unfortunately all these flags not working for me.
> > Does that suggest a problem (in this case) with the
> > compiler or ffmpeg?
>
> You can try to compile the following simple code:
Thank you for the more useful test case!
> #include <math.h>
>
> double test(double x)
> {
> return cos(x) + sin(x);
> }
>
> If the compiler from the Android NDK issues code
> using sincos, then it is broken, since the platform
> does not provide it.
Which appears not to be unusual on Android.
The complete test case:
$ cat test.c
#define _GNU_SOURCE
#include <math.h>
double sc(double a)
{
return sin(a) + cos(a);
}
$ gcc test.c -c && nm test.o
U cos
0000000000000000 T sc
U sin
$ gcc test.c -c -O1 && nm test.o
0000000000000000 T sc
U sincos
$ gcc test.c -c -O1 -fno-builtin-sin && nm test.o
U cos
0000000000000000 T sc
U sin
$ gcc test.c -c -O1 -fno-builtin-cos && nm test.o
U cos
0000000000000000 T sc
U sin
I believe the toolchain is broken if it produces a
sincos symbol although you compiled with -fno-builtin.
(-fno-builtin-sincos has NO effect.)
The define is not needed but maybe it makes the
compiler believe that sincos() is available?
Carl Eugen
More information about the ffmpeg-user
mailing list