From: John Paul Adrian Glaubitz Date: Wed, 27 Sep 2023 08:49:22 +0000 (+0100) Subject: Fix FTBFS on m68k X-Git-Tag: archive/raspbian/2.42.1-1+rpi1^2~6 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=92a33e446f4bf22bc233c3494df56afe4cdaa6d7;p=webkit2gtk.git Fix FTBFS on m68k Bug-Debian: https://bugs.debian.org/868126 Last-Update: 2020-01-23 =================================================================== Gbp-Pq: Name fix-ftbfs-m68k.patch --- diff --git a/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp b/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp index e44b931f00..7cf9c724bb 100644 --- a/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp +++ b/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp @@ -61,6 +61,11 @@ #include #include +#if defined(__m68k__) || defined(__SH4__) +#pragma GCC push_options +#pragma GCC optimize ("-O0") +#endif + namespace JSC { template @@ -5584,3 +5589,6 @@ void printInternal(PrintStream& out, JSC::Variable::VariableKind kind) } // namespace WTF +#if defined(__m68k__) || defined(__SH4__) +#pragma GCC pop_options +#endif diff --git a/Source/WTF/wtf/PlatformCPU.h b/Source/WTF/wtf/PlatformCPU.h index 105013ce55..50d3f6a4ec 100644 --- a/Source/WTF/wtf/PlatformCPU.h +++ b/Source/WTF/wtf/PlatformCPU.h @@ -35,6 +35,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 a8cfaafdc6..2f84aab85f 100644 --- a/Source/WebCore/css/CSSProperty.cpp +++ b/Source/WebCore/css/CSSProperty.cpp @@ -32,7 +32,9 @@ struct SameSizeAsCSSProperty { void* value; }; +#if !defined(__m68k__) static_assert(sizeof(CSSProperty) == sizeof(SameSizeAsCSSProperty), "CSSProperty should stay small"); +#endif CSSPropertyID StylePropertyMetadata::shorthandID() const { diff --git a/Source/WebCore/css/CSSValue.cpp b/Source/WebCore/css/CSSValue.cpp index 0a16f39d9e..43cd7e80fc 100644 --- a/Source/WebCore/css/CSSValue.cpp +++ b/Source/WebCore/css/CSSValue.cpp @@ -88,7 +88,9 @@ struct SameSizeAsCSSValue { uint32_t bitfields; }; +#if !defined(__m68k__) static_assert(sizeof(CSSValue) == sizeof(SameSizeAsCSSValue), "CSS value should stay small"); +#endif DEFINE_ALLOCATOR_WITH_HEAP_IDENTIFIER(CSSValue); diff --git a/Source/WebCore/dom/ElementRareData.cpp b/Source/WebCore/dom/ElementRareData.cpp index 28d186054b..178e2e01b7 100644 --- a/Source/WebCore/dom/ElementRareData.cpp +++ b/Source/WebCore/dom/ElementRareData.cpp @@ -47,6 +47,8 @@ struct SameSizeAsElementRareData : NodeRareData { ExplicitlySetAttrElementsMap explicitlySetAttrElementsMap; }; +#if !defined(__m68k__) static_assert(sizeof(ElementRareData) == sizeof(SameSizeAsElementRareData), "ElementRareData should stay small"); +#endif } // namespace WebCore diff --git a/Source/WebCore/dom/Node.cpp b/Source/WebCore/dom/Node.cpp index 062a1ce6bf..1b1690a886 100644 --- a/Source/WebCore/dom/Node.cpp +++ b/Source/WebCore/dom/Node.cpp @@ -122,7 +122,9 @@ struct SameSizeAsNode : public EventTarget { uint8_t rareDataWithBitfields[8]; }; +#if !defined(__m68k__) static_assert(sizeof(Node) == sizeof(SameSizeAsNode), "Node should stay small"); +#endif #if DUMP_NODE_STATISTICS static WeakHashSet& liveNodeSet() diff --git a/Source/WebCore/dom/NodeRareData.cpp b/Source/WebCore/dom/NodeRareData.cpp index 60671f9605..c7cd287dbe 100644 --- a/Source/WebCore/dom/NodeRareData.cpp +++ b/Source/WebCore/dom/NodeRareData.cpp @@ -41,7 +41,9 @@ struct SameSizeAsNodeRareData { bool m_isElementRareData; }; +#if !defined(__m68k__) static_assert(sizeof(NodeRareData) == sizeof(SameSizeAsNodeRareData), "NodeRareData should stay small"); +#endif // Ensure the 10 bits reserved for the m_connectedFrameCount cannot overflow static_assert(Page::maxNumberOfFrames < 1024, "Frame limit should fit in rare data count"); diff --git a/Source/WebCore/dom/ShadowRoot.cpp b/Source/WebCore/dom/ShadowRoot.cpp index a171c568a3..b202ed6eee 100644 --- a/Source/WebCore/dom/ShadowRoot.cpp +++ b/Source/WebCore/dom/ShadowRoot.cpp @@ -58,10 +58,12 @@ struct SameSizeAsShadowRoot : public DocumentFragment, public TreeScope { std::optional> partMappings; }; +#if !defined(__m68k__) static_assert(sizeof(ShadowRoot) == sizeof(SameSizeAsShadowRoot), "shadowroot should stay small"); #if !ASSERT_ENABLED static_assert(sizeof(WeakPtr) == sizeof(void*), "WeakPtr should be same size as raw pointer"); #endif +#endif ShadowRoot::ShadowRoot(Document& document, ShadowRootMode mode, SlotAssignmentMode assignmentMode, DelegatesFocus delegatesFocus, Cloneable cloneable, AvailableToElementInternals availableToElementInternals) : DocumentFragment(document, CreateShadowRoot) diff --git a/Source/WebCore/dom/SlotAssignment.cpp b/Source/WebCore/dom/SlotAssignment.cpp index 8c29722a5a..40d2078a45 100644 --- a/Source/WebCore/dom/SlotAssignment.cpp +++ b/Source/WebCore/dom/SlotAssignment.cpp @@ -45,7 +45,9 @@ struct SameSizeAsNamedSlotAssignment { #endif }; +#if !defined(__m68k__) static_assert(sizeof(NamedSlotAssignment) == sizeof(SameSizeAsNamedSlotAssignment), "NamedSlotAssignment should remain small"); +#endif static const AtomString& slotNameFromAttributeValue(const AtomString& value) { diff --git a/Source/WebCore/platform/graphics/FontCascadeDescription.cpp b/Source/WebCore/platform/graphics/FontCascadeDescription.cpp index c123aa458a..6b206b3396 100644 --- a/Source/WebCore/platform/graphics/FontCascadeDescription.cpp +++ b/Source/WebCore/platform/graphics/FontCascadeDescription.cpp @@ -54,7 +54,9 @@ struct SameSizeAsFontCascadeDescription { float size2; unsigned bitfields3 : 10; }; +#if !defined(__m68k__) static_assert(sizeof(FontCascadeDescription) == sizeof(SameSizeAsFontCascadeDescription), "FontCascadeDescription should stay small"); +#endif FontCascadeDescription::FontCascadeDescription() : m_families(RefCountedFixedVector::create(1)) diff --git a/Source/WebCore/rendering/LegacyInlineFlowBox.cpp b/Source/WebCore/rendering/LegacyInlineFlowBox.cpp index cf3139d817..8fdd112035 100644 --- a/Source/WebCore/rendering/LegacyInlineFlowBox.cpp +++ b/Source/WebCore/rendering/LegacyInlineFlowBox.cpp @@ -60,7 +60,9 @@ struct SameSizeAsLegacyInlineFlowBox : public LegacyInlineBox { void* pointers[5]; }; +#if !defined(__m68k__) static_assert(sizeof(LegacyInlineFlowBox) == sizeof(SameSizeAsLegacyInlineFlowBox), "LegacyInlineFlowBox should stay small"); +#endif #if !ASSERT_WITH_SECURITY_IMPLICATION_DISABLED diff --git a/Source/WebCore/rendering/style/RenderStyle.cpp b/Source/WebCore/rendering/style/RenderStyle.cpp index 5e344cd926..2e920dcbf1 100644 --- a/Source/WebCore/rendering/style/RenderStyle.cpp +++ b/Source/WebCore/rendering/style/RenderStyle.cpp @@ -81,7 +81,9 @@ struct SameSizeAsBorderValue { int m_restBits; }; +#if !defined(__m68k__) static_assert(sizeof(BorderValue) == sizeof(SameSizeAsBorderValue), "BorderValue should not grow"); +#endif struct SameSizeAsRenderStyle { void* nonInheritedDataRefs[1]; @@ -100,7 +102,9 @@ struct SameSizeAsRenderStyle { #endif }; +#if !defined(__m68k__) static_assert(sizeof(RenderStyle) == sizeof(SameSizeAsRenderStyle), "RenderStyle should stay small"); +#endif static_assert(PublicPseudoIDBits == static_cast(PseudoId::FirstInternalPseudoId) - static_cast(PseudoId::FirstPublicPseudoId)); diff --git a/Source/WebCore/rendering/style/StyleBoxData.cpp b/Source/WebCore/rendering/style/StyleBoxData.cpp index 2a55665e8c..496755845b 100644 --- a/Source/WebCore/rendering/style/StyleBoxData.cpp +++ b/Source/WebCore/rendering/style/StyleBoxData.cpp @@ -33,7 +33,9 @@ struct SameSizeAsStyleBoxData : public RefCounted { uint32_t bitfields; }; +#if !defined(__m68k__) static_assert(sizeof(StyleBoxData) == sizeof(SameSizeAsStyleBoxData), "StyleBoxData should not grow"); +#endif DEFINE_ALLOCATOR_WITH_HEAP_IDENTIFIER(StyleBoxData); diff --git a/Source/WebCore/style/RuleData.cpp b/Source/WebCore/style/RuleData.cpp index 596144dd17..ae9390c337 100644 --- a/Source/WebCore/style/RuleData.cpp +++ b/Source/WebCore/style/RuleData.cpp @@ -57,7 +57,9 @@ struct SameSizeAsRuleData { unsigned d[4]; }; +#if !defined(__m68k__) static_assert(sizeof(RuleData) == sizeof(SameSizeAsRuleData), "RuleData should stay small"); +#endif static inline MatchBasedOnRuleHash computeMatchBasedOnRuleHash(const CSSSelector& selector) {