[FFmpeg-devel] mingw64 4.7.x struct alignment behavior has changed

Timothy Gu timothygu99 at gmail.com
Fri Jan 10 03:42:49 CET 2014


On Jan 9, 2014 6:53 PM, "Gianluigi Tiesi" <mplayer at netfarm.it> wrote:

> as stated in this announce:
> http://cygwin.com/ml/cygwin-announce/2013-07/msg00011.html
>
> For gcc-4.7.x, struct alignment behavior has changed, -mms-bitfields is
> now default for better MSVC compatibility. This may cause ABI changes
> in libraries that expose data structures directly to clients. Workaround
> include marking the struct with the gcc_struct attributes.

More technical details here:
http://gcc.gnu.org/onlinedocs/gccint/Storage-Layout.html#index-TARGET_005fMS_005fBITFIELD_005fLAYOUT_005fP-3938

>
> this actually breaks mplayer libmpdemux/asf.h structs
>
> e.g. ASF_stream_header_t is 56 bytes instead of 54
>
> I'm not sure about other places in mplayer and/or ffmpeg
> I'm not even sure for libraries I build for dependencies
>
> Should we add explicit gcc_struct or pass -mno-ms-bitfields to mingw?

I'd say to pass the compiler option to prevent corruption of source code,
if really necessary.

Timothy


More information about the ffmpeg-devel mailing list