[DVDnav-discuss] dvdread patch for gcc 4.7+ and mingw

Roger Pack rogerdpack2 at gmail.com
Thu Dec 12 23:17:10 CET 2013


On 11/16/13, Dominik 'Rathann' Mierzejewski <dominik at greysector.net> wrote:
> On Wednesday, 13 November 2013 at 19:05, Roger Pack wrote:
>> On 11/11/13, Dominik 'Rathann' Mierzejewski <dominik at greysector.net>
>> wrote:
>> > Hi Roger,
>> >
>> > On Monday, 21 October 2013 at 14:38, Roger Pack wrote:
>> > [...]
>> >> I'm not sure if it affects other OS's or not.  I "think" the problem
>> >> stems from gcc packing structures differently with 4.7+ though I'm not
>> >> certain [2] .  All I really know is that, for windows with gcc 4.8, it
>> >> fails without this patch and works with it.
>> >
>> > This should be fixed in current SVN. I used an older patch and added
>> > configure2 code, too, to match.
>>
>>
>> Interesting.
>> Thanks for applying that.  Unfortunately, at least with cross
>> compiling I get this:
>>
>> working patched 4.2.0 version:
>> libdvdread-4.2.0$ grep ATTRIBUTE_PACKED src/dvdread/ifo_types.h * | grep
>> define
>> src/dvdread/ifo_types.h:#define ATTRIBUTE_PACKED __attribute__
>> ((packed,gcc_struct))
>>
>> 4.2.1 (with ./autogen.sh && ./configure --host=...):
>>
>> libdvdread-4.2.1$ grep ATTRIBUTE_PACKED src/dvdread/ifo_types.h * | grep
>> define
>> grep: autom4te.cachesrc/dvdread/ifo_types.h:#define ATTRIBUTE_PACKED
>> __attribute__ ((packed))
>>
>> (it doesn't say gcc_struct with 4.2.1, and thus still fails)
>> Thanks, sorry I don't know more here.
>
> I thought you said this was related to missing -mno-ms-bitfields flag in
> CFLAGS. It should appear in your CFLAGS during compilation. Could you
> check?

Ok it does compile with -mno-ms-bitfields.  But still causes a
segfault without the gcc_struct patch (for me anyway).

I think the problem is that other programs pick up and use for
instance ifo_types.h (as a dependency) but then *they* don't add a
-mno-ms-bitfields (perhaps they don't even want to? ) to their
compilation so it still breaks when it ends up being used for method
parameters, etc.

If this is the problem, then I suppose possible fixes would be to just
put a "gcc_struct" into the source code, or to export the
-mno-ms-bitfields to the .pc file?  I'm just guessing here I don't
know for certain.
Thank you.
-roger


More information about the DVDnav-discuss mailing list