[MPlayer-dev-eng] mingw64 4.7.x struct alignment behavior has changed

Josh joshf87 at live.com
Sun Jan 19 04:57:48 CET 2014


On 1/18/2014 15:35, Reimar Döffinger wrote:
> On Fri, Jan 10, 2014 at 02:53:10AM +0100, Gianluigi Tiesi wrote:
>> Sorry for cross posting but it's related both to mplayer/ffmpeg
>>
>> 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.
>>
>> this actually breaks mplayer libmpdemux/asf.h structs
>>
>> e.g. ASF_stream_header_t is 56 bytes instead of 54
>
> This doesn't make sense, according to the documentation -mms-bitfields
> only affects bitfields.
> These structs do not use bitfields.
> The default 8-byte structure alignment could cause this, except
> that these are all marked with packed attribute which
> a) Is gcc-specific, so applying MS-compatibility stuff would be so
> idiotic I'd call it a bug
> b) Even on MS compilers packed structures should not have padding at the
> end
>
> So I think this must be an actual compiler bug.
> _______________________________________________
> MPlayer-dev-eng mailing list
> MPlayer-dev-eng at mplayerhq.hu
> https://lists.mplayerhq.hu/mailman/listinfo/mplayer-dev-eng
>
>

 From what I can gather it is an actual bug since 4.2.0, but starting in 
4.7 they enabled it by default for mingw targets even though it's still 
broken.

libdvdread is also broken (libdvdread4/dvdread/ifo_types.h) by 
ms-bitfields. DVDs won't work at all unless -mno-ms-bitfields is used. 
Specifying 'gcc_struct' in ifo_types.h still crashed. Appending 
-mno-ms-bitfields in MPlayer's cflags takes care of both problems 
without changing any actual source.


More information about the MPlayer-dev-eng mailing list