From 65bd9f4a0c61e835314c8ec9e4bbcaf62af2cbdf Mon Sep 17 00:00:00 2001 From: John Paul Adrian Glaubitz Date: Mon, 13 Aug 2018 08:52:34 +0100 Subject: [PATCH] Fix FTBFS on m68k =================================================================== Gbp-Pq: Name fix-ftbfs-m68k.patch --- Source/WTF/wtf/Platform.h | 5 +++++ Source/WebCore/css/CSSProperty.cpp | 4 ++++ Source/WebCore/css/RuleSet.h | 4 ++++ Source/WebCore/dom/ElementRareData.cpp | 4 ++++ Source/WebCore/dom/NodeRareData.cpp | 4 ++++ Source/WebCore/dom/ShadowRoot.cpp | 4 ++++ Source/WebCore/platform/graphics/FontDescription.cpp | 4 ++++ Source/WebCore/rendering/style/RenderStyle.cpp | 8 ++++++++ Source/WebCore/rendering/style/StyleBoxData.cpp | 4 ++++ 9 files changed, 41 insertions(+) diff --git a/Source/WTF/wtf/Platform.h b/Source/WTF/wtf/Platform.h index 6fb8767d4c..fe0fe97e0b 100644 --- a/Source/WTF/wtf/Platform.h +++ b/Source/WTF/wtf/Platform.h @@ -59,6 +59,11 @@ /* ==== CPU() - the target CPU architecture ==== */ /* CPU(KNOWN) becomes true if we explicitly support a target CPU. */ +/* CPU(M68K) - m68k */ +#if defined(__m68k__) +#define WTF_CPU_BIG_ENDIAN 1 +#endif + /* CPU(MIPS) - MIPS 32-bit and 64-bit */ #if (defined(mips) || defined(__mips__) || defined(MIPS) || defined(_MIPS_) || defined(__mips64)) #if defined(_ABI64) && (_MIPS_SIM == _ABI64) diff --git a/Source/WebCore/css/CSSProperty.cpp b/Source/WebCore/css/CSSProperty.cpp index 181ba5ddb4..284daf69d6 100644 --- a/Source/WebCore/css/CSSProperty.cpp +++ b/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 CSSPropertyID StylePropertyMetadata::shorthandID() const { diff --git a/Source/WebCore/css/RuleSet.h b/Source/WebCore/css/RuleSet.h index ba5dc60fe3..7442a7e45a 100644 --- a/Source/WebCore/css/RuleSet.h +++ b/Source/WebCore/css/RuleSet.h @@ -98,7 +98,11 @@ struct SameSizeAsRuleData { unsigned d[4]; }; +#if defined(__m68k__) +COMPILE_ASSERT(sizeof(RuleData) <= sizeof(SameSizeAsRuleData), RuleData_should_stay_small); +#else COMPILE_ASSERT(sizeof(RuleData) == sizeof(SameSizeAsRuleData), RuleData_should_stay_small); +#endif class RuleSet { WTF_MAKE_NONCOPYABLE(RuleSet); WTF_MAKE_FAST_ALLOCATED; diff --git a/Source/WebCore/dom/ElementRareData.cpp b/Source/WebCore/dom/ElementRareData.cpp index 478a8887e0..c098633527 100644 --- a/Source/WebCore/dom/ElementRareData.cpp +++ b/Source/WebCore/dom/ElementRareData.cpp @@ -46,6 +46,10 @@ struct SameSizeAsElementRareData : NodeRareData { void* pointers[8]; }; +#if defined(__m68k__) +static_assert(sizeof(ElementRareData) <= sizeof(SameSizeAsElementRareData), "ElementRareData should stay small"); +#else static_assert(sizeof(ElementRareData) == sizeof(SameSizeAsElementRareData), "ElementRareData should stay small"); +#endif } // namespace WebCore diff --git a/Source/WebCore/dom/NodeRareData.cpp b/Source/WebCore/dom/NodeRareData.cpp index 821db174e0..bac77f081b 100644 --- a/Source/WebCore/dom/NodeRareData.cpp +++ b/Source/WebCore/dom/NodeRareData.cpp @@ -38,6 +38,10 @@ struct SameSizeAsNodeRareData { void* m_pointer[3]; }; +#if defined(__m68k__) +COMPILE_ASSERT(sizeof(NodeRareData) <= sizeof(SameSizeAsNodeRareData), NodeRareDataShouldStaySmall); +#else COMPILE_ASSERT(sizeof(NodeRareData) == sizeof(SameSizeAsNodeRareData), NodeRareDataShouldStaySmall); +#endif } // namespace WebCore diff --git a/Source/WebCore/dom/ShadowRoot.cpp b/Source/WebCore/dom/ShadowRoot.cpp index dec798811a..97476c2d67 100644 --- a/Source/WebCore/dom/ShadowRoot.cpp +++ b/Source/WebCore/dom/ShadowRoot.cpp @@ -47,7 +47,11 @@ struct SameSizeAsShadowRoot : public DocumentFragment, public TreeScope { void* slotAssignment; }; +#if defined(__m68k__) +COMPILE_ASSERT(sizeof(ShadowRoot) <= sizeof(SameSizeAsShadowRoot), shadowroot_should_stay_small); +#else COMPILE_ASSERT(sizeof(ShadowRoot) == sizeof(SameSizeAsShadowRoot), shadowroot_should_stay_small); +#endif ShadowRoot::ShadowRoot(Document& document, ShadowRootMode type) : DocumentFragment(document, CreateShadowRoot) diff --git a/Source/WebCore/platform/graphics/FontDescription.cpp b/Source/WebCore/platform/graphics/FontDescription.cpp index 3d5dd35714..ae3af36cf0 100644 --- a/Source/WebCore/platform/graphics/FontDescription.cpp +++ b/Source/WebCore/platform/graphics/FontDescription.cpp @@ -52,7 +52,11 @@ struct SameSizeAsFontCascadeDescription { unsigned bitfields3 : 10; }; +#if defined(__m68k__) +COMPILE_ASSERT(sizeof(FontCascadeDescription) <= sizeof(SameSizeAsFontCascadeDescription), FontCascadeDescription_should_stay_small); +#else COMPILE_ASSERT(sizeof(FontCascadeDescription) == sizeof(SameSizeAsFontCascadeDescription), FontCascadeDescription_should_stay_small); +#endif FontDescription::FontDescription() : m_fontSelectionRequest { FontCascadeDescription::initialWeight(), FontCascadeDescription::initialStretch(), FontCascadeDescription::initialItalic() } diff --git a/Source/WebCore/rendering/style/RenderStyle.cpp b/Source/WebCore/rendering/style/RenderStyle.cpp index 7fba88cd89..e77abe6da4 100644 --- a/Source/WebCore/rendering/style/RenderStyle.cpp +++ b/Source/WebCore/rendering/style/RenderStyle.cpp @@ -63,7 +63,11 @@ struct SameSizeAsBorderValue { int m_restBits; }; +#if defined(__m68k__) +COMPILE_ASSERT(sizeof(BorderValue) <= sizeof(SameSizeAsBorderValue), BorderValue_should_not_grow); +#else COMPILE_ASSERT(sizeof(BorderValue) == sizeof(SameSizeAsBorderValue), BorderValue_should_not_grow); +#endif struct SameSizeAsRenderStyle { void* dataRefs[7]; @@ -81,7 +85,11 @@ struct SameSizeAsRenderStyle { #endif }; +#if defined(__m68k__) +static_assert(sizeof(RenderStyle) <= sizeof(SameSizeAsRenderStyle), "RenderStyle should stay small"); +#else static_assert(sizeof(RenderStyle) == sizeof(SameSizeAsRenderStyle), "RenderStyle should stay small"); +#endif RenderStyle& RenderStyle::defaultStyle() { diff --git a/Source/WebCore/rendering/style/StyleBoxData.cpp b/Source/WebCore/rendering/style/StyleBoxData.cpp index 392708aae5..e91da0de49 100644 --- a/Source/WebCore/rendering/style/StyleBoxData.cpp +++ b/Source/WebCore/rendering/style/StyleBoxData.cpp @@ -33,7 +33,11 @@ struct SameSizeAsStyleBoxData : public RefCounted { uint32_t bitfields; }; +#if defined(__m68k__) +COMPILE_ASSERT(sizeof(StyleBoxData) <= sizeof(SameSizeAsStyleBoxData), StyleBoxData_should_not_grow); +#else COMPILE_ASSERT(sizeof(StyleBoxData) == sizeof(SameSizeAsStyleBoxData), StyleBoxData_should_not_grow); +#endif StyleBoxData::StyleBoxData() : m_minWidth(RenderStyle::initialMinSize()) -- 2.30.2