From cede7db6e8ac101085b77ec233307f806389314b Mon Sep 17 00:00:00 2001 From: John Paul Adrian Glaubitz Date: Thu, 17 Feb 2022 18:52:20 +0000 Subject: [PATCH] Fix FTBFS on m68k Bug-Debian: https://bugs.debian.org/868126 Last-Update: 2020-01-23 =================================================================== Gbp-Pq: Name fix-ftbfs-m68k.patch --- Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp | 8 ++++++++ Source/WTF/wtf/PlatformCPU.h | 5 +++++ Source/WebCore/css/CSSProperty.cpp | 4 ++++ Source/WebCore/css/CSSValue.cpp | 4 ++++ Source/WebCore/dom/ElementRareData.cpp | 4 ++++ Source/WebCore/dom/NodeRareData.cpp | 4 ++++ Source/WebCore/dom/ShadowRoot.cpp | 4 ++++ .../WebCore/platform/graphics/FontCascadeDescription.cpp | 4 ++++ Source/WebCore/rendering/LegacyInlineFlowBox.cpp | 4 ++++ Source/WebCore/rendering/style/RenderStyle.cpp | 8 ++++++++ Source/WebCore/rendering/style/StyleBoxData.cpp | 4 ++++ Source/WebCore/style/RuleData.cpp | 4 ++++ 12 files changed, 57 insertions(+) diff --git a/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp b/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp index 5d8e8d158a..aa92943acc 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 @@ -5455,3 +5460,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 10491cb1a5..ddb70ad469 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 b8571b0a01..89210895dc 100644 --- a/Source/WebCore/css/CSSProperty.cpp +++ b/Source/WebCore/css/CSSProperty.cpp @@ -32,7 +32,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/CSSValue.cpp b/Source/WebCore/css/CSSValue.cpp index 87369ab0db..b4d1f1e69b 100644 --- a/Source/WebCore/css/CSSValue.cpp +++ b/Source/WebCore/css/CSSValue.cpp @@ -79,7 +79,11 @@ struct SameSizeAsCSSValue { uint32_t bitfields; }; +#if defined(__m68k__) +COMPILE_ASSERT(sizeof(CSSValue) <= sizeof(SameSizeAsCSSValue), CSS_value_should_stay_small); +#else COMPILE_ASSERT(sizeof(CSSValue) == sizeof(SameSizeAsCSSValue), CSS_value_should_stay_small); +#endif bool CSSValue::isImplicitInitialValue() const { diff --git a/Source/WebCore/dom/ElementRareData.cpp b/Source/WebCore/dom/ElementRareData.cpp index ec85a4999d..d38360f5c9 100644 --- a/Source/WebCore/dom/ElementRareData.cpp +++ b/Source/WebCore/dom/ElementRareData.cpp @@ -50,6 +50,10 @@ struct SameSizeAsElementRareData : NodeRareData { }; +#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 928da436e7..d10fb597e5 100644 --- a/Source/WebCore/dom/NodeRareData.cpp +++ b/Source/WebCore/dom/NodeRareData.cpp @@ -41,7 +41,11 @@ struct SameSizeAsNodeRareData { void* m_pointer[2]; }; +#if defined(__m68k__) +COMPILE_ASSERT(sizeof(NodeRareData) <= sizeof(SameSizeAsNodeRareData), NodeRareDataShouldStaySmall); +#else COMPILE_ASSERT(sizeof(NodeRareData) == sizeof(SameSizeAsNodeRareData), NodeRareDataShouldStaySmall); +#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 a85288225a..2523d7c43d 100644 --- a/Source/WebCore/dom/ShadowRoot.cpp +++ b/Source/WebCore/dom/ShadowRoot.cpp @@ -59,10 +59,14 @@ struct SameSizeAsShadowRoot : public DocumentFragment, public TreeScope { std::optional> partMappings; }; +#if defined(__m68k__) +COMPILE_ASSERT(sizeof(ShadowRoot) <= sizeof(SameSizeAsShadowRoot), shadowroot_should_stay_small); +#else COMPILE_ASSERT(sizeof(ShadowRoot) == sizeof(SameSizeAsShadowRoot), shadowroot_should_stay_small); #if !ASSERT_ENABLED COMPILE_ASSERT(sizeof(WeakPtr) == sizeof(void*), WeakPtr_should_be_same_size_as_raw_pointer); #endif +#endif ShadowRoot::ShadowRoot(Document& document, ShadowRootMode type, DelegatesFocus delegatesFocus) : DocumentFragment(document, CreateShadowRoot) diff --git a/Source/WebCore/platform/graphics/FontCascadeDescription.cpp b/Source/WebCore/platform/graphics/FontCascadeDescription.cpp index 1d293d7f15..8206e976f4 100644 --- a/Source/WebCore/platform/graphics/FontCascadeDescription.cpp +++ b/Source/WebCore/platform/graphics/FontCascadeDescription.cpp @@ -48,7 +48,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 FontCascadeDescription::FontCascadeDescription() : m_isAbsoluteSize(false) diff --git a/Source/WebCore/rendering/LegacyInlineFlowBox.cpp b/Source/WebCore/rendering/LegacyInlineFlowBox.cpp index 7533446055..c09f1571db 100644 --- a/Source/WebCore/rendering/LegacyInlineFlowBox.cpp +++ b/Source/WebCore/rendering/LegacyInlineFlowBox.cpp @@ -53,7 +53,11 @@ struct SameSizeAsLegacyInlineFlowBox : public LegacyInlineBox { void* pointers[5]; }; +#if defined(__m68k__) +COMPILE_ASSERT(sizeof(LegacyInlineFlowBox) >= sizeof(SameSizeAsLegacyInlineFlowBox), LegacyInlineFlowBox_should_stay_small); +#else COMPILE_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 a9a17d67ad..0256820a18 100644 --- a/Source/WebCore/rendering/style/RenderStyle.cpp +++ b/Source/WebCore/rendering/style/RenderStyle.cpp @@ -66,7 +66,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]; @@ -84,7 +88,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 DEFINE_ALLOCATOR_WITH_HEAP_IDENTIFIER(RenderStyle); diff --git a/Source/WebCore/rendering/style/StyleBoxData.cpp b/Source/WebCore/rendering/style/StyleBoxData.cpp index db977a8333..77ae85c7fd 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 DEFINE_ALLOCATOR_WITH_HEAP_IDENTIFIER(StyleBoxData); diff --git a/Source/WebCore/style/RuleData.cpp b/Source/WebCore/style/RuleData.cpp index 2129a677b7..26d415d6b4 100644 --- a/Source/WebCore/style/RuleData.cpp +++ b/Source/WebCore/style/RuleData.cpp @@ -59,7 +59,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 static inline MatchBasedOnRuleHash computeMatchBasedOnRuleHash(const CSSSelector& selector) { -- 2.30.2