Bug#902100: webkit2gtk: Please update patch fix-ftbfs-m68k.patch

Geert Uytterhoeven geert at linux-m68k.org
Fri Jun 22 11:54:40 BST 2018


Hi Adrian,

On Fri, Jun 22, 2018 at 12:40 PM John Paul Adrian Glaubitz
<glaubitz at physik.fu-berlin.de> wrote:
> On 06/22/2018 10:44 AM, Geert Uytterhoeven wrote:
> >> The patch fix-ftbfs-m68k.patch needs to be updated to fix the FTBFS
> >> of webkit2gtk on m68k. I have done that, could you apply the attached
> >> patch for the next upload?

> >> --- webkit2gtk-2.20.3.orig/Source/WebCore/css/CSSProperty.cpp
> >> +++ webkit2gtk-2.20.3/Source/WebCore/css/CSSProperty.cpp
> >> @@ -33,7 +33,11 @@ struct SameSizeAsCSSProperty {
> >>      void* value;
> >>  };
> >>
> >> +#if defined(__m68k__)
> >> +COMPILE_ASSERT(sizeof(CSSProperty) <= sizeof(SameSizeAsCSSProperty), CSSProperty_should_stay_small);
> >> +#else
> >>  COMPILE_ASSERT(sizeof(CSSProperty) == sizeof(SameSizeAsCSSProperty), CSSProperty_should_stay_small);
> >> +#endif
> >
> > These two structures are not equivalent!
> > If anything assumes so, it will crash when dereferencing the pointer.
>
> Hmm. The original patch came from Andreas using this comparison. I just extended
> it. I can have a closer look if I find the time.
>
> > The patch below makes them match:
> >
> > --- webkitgtk-2.20.3/Source/WebCore/css/CSSProperty.cpp.orig
> > 2018-06-22 10:40:49.389060321 +0200
> > +++ webkitgtk-2.20.3/Source/WebCore/css/CSSProperty.cpp 2018-06-22
> > 10:40:52.681053717 +0200
> > @@ -29,7 +29,7 @@
> >  namespace WebCore {
> >
> >  struct SameSizeAsCSSProperty {
> > -    uint32_t bitfields;
> > +    uint16_t bitfields;
> >      void* value;
> >  };
> >
> > If anything relies on having a hole in between the two fields, explicit
> > padding should be added.
>
> Well, I don't think we can add this change as this reduces the size of
> the bitfield. Do you think we can just cut it in half without any issues?

CSSProperty contains:

    StylePropertyMetadata m_metadata;
    RefPtr<CSSValue> m_value;

StylePropertyMetadata contains:
    uint16_t m_propertyID : 10;
    uint16_t m_isSetFromShorthand : 1;
    uint16_t m_indexInShorthandsVector : 2; // If this property was
set as part of an ambiguous shorthand, gives the index in the
shorthands vector.
    uint16_t m_important : 1;
    uint16_t m_implicit : 1; // Whether or not the property was set
implicitly as the result of a shorthand.
    uint16_t m_inherited : 1;
    uint16_t pad;

So the bitfield is in the first uint16_t, not in a uint32_t (yes, that matters
on big endian).

Oops, I did miss StylePropertyMetadata already has padding.
So the sizes of CSSProperty and SameSizeAsCSSProperty should already match.

To avoid future endianness issues, you still may want to reflect this in
SameSizeAsCSSProperty:

--- webkitgtk-2.20.3/Source/WebCore/css/CSSProperty.cpp.orig
2018-06-22 10:40:49.389060321 +0200
+++ webkitgtk-2.20.3/Source/WebCore/css/CSSProperty.cpp 2018-06-22
12:50:51.005024268 +0200
@@ -29,7 +29,8 @@
 namespace WebCore {

 struct SameSizeAsCSSProperty {
-    uint32_t bitfields;
+    uint16_t bitfields;
+    uint16_t pad;
     void* value;
 };



Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert at linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds



More information about the Pkg-webkit-maintainers mailing list