[FFmpeg-devel] addcompat does work correctly when overridden functions are declared to use a non-default calling convention

Reimar Döffinger Reimar.Doeffinger at gmx.de
Sat May 17 11:36:58 CEST 2014


On Sat, May 17, 2014 at 05:15:41PM +0800, Yu Xiaolei wrote:
> Android armeabi-v7a-hard defaults to hardfp abi while using softfp on
> JNI and system library calls.
> It relies on these functions being marked with correct abi through
> __attribute__((pcs("aapcs"))).
> 
> When addcompat adds -Dstrtod=avpriv_strtod to compiler flags and
> avpriv_strtod implementation redeclares it through:
> 
> #undef strtod
> double strtod(const char *, char **);
> 
> avpriv_strtod ends up calling system strtod with hardfp abi.
> 
> I think it is at least not future proof to assume libc functions being
> always declared without a calling convention,

As far as I can tell the C standard pretty much requires that.
I.e. if that doesn't work, the system isn't C99-compatible.
Now it would be nicer if it still would work, but I think
this is enough to justify dealing with the problem only when
it actually happens.


More information about the ffmpeg-devel mailing list