[FFmpeg-user] compiling for android

Nicolas George george at nsup.org
Thu Jul 10 14:03:07 CEST 2014


Le duodi 22 messidor, an CCXXII, Carl Eugen Hoyos a écrit :
> I believe the toolchain is broken if it produces a 
> sincos symbol although you compiled with -fno-builtin.
> 
> (-fno-builtin-sincos has NO effect.)

I agree, but the examples you showed seem to indicate correct behaviour:
with -fno-builtin-sin, the call to sin() stays a call to the external
function (and the call to cos() is not optimized to sincos(), since the sin
was already computed); the symmetric analysis applies for -fno-builtin-cos.

And -fno-builtin-sincos has no effect since there is no builtin sincos():
-fno-builtin-foo only changes places where the program calls foo() to
replace them by assembly code that behaves the same.

For example:

gcc -fno-builtin-memcpy -S -Os -o - -x c - <<<'
#include <string.h>
struct foo { unsigned x[42000]; };
void copy_foo(struct foo *t, struct foo *s) { memcpy(t, s, sizeof(*t)); }
'

gives this:

	movl    $168000, %edx
	jmp     memcpy

While without -fno-builtin-memcpy:

	movl    $42000, %ecx
	rep movsl

> The define is not needed but maybe it makes the 
> compiler believe that sincos() is available?

My experiences also show that the define does not change anything. Then the
compiler is definitely broken.

OTOH, defining _GNU_SOURCE for Android programs is definitely totally WRONG.
Android is not GNU, it does not implement most GNU extensions to the libc.
Building for Android with _GNU_SOURCE is likely to fail, and that is
perfectly normal.

Regards,

-- 
  Nicolas George
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <https://ffmpeg.org/pipermail/ffmpeg-user/attachments/20140710/3f911a24/attachment.asc>


More information about the ffmpeg-user mailing list