From 3170025a4aca46c22ee2ef577f34d069e86b3ce6 Mon Sep 17 00:00:00 2001 From: John Paul Adrian Glaubitz Date: Tue, 21 Mar 2023 17:11:48 +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 | 2 ++ Source/WebCore/css/CSSValue.cpp | 2 ++ Source/WebCore/dom/ElementRareData.cpp | 2 ++ Source/WebCore/dom/NodeRareData.cpp | 2 ++ Source/WebCore/dom/ShadowRoot.cpp | 2 ++ .../WebCore/platform/graphics/FontCascadeDescription.cpp | 2 ++ Source/WebCore/rendering/LegacyInlineFlowBox.cpp | 2 ++ Source/WebCore/rendering/style/RenderStyle.cpp | 4 ++++ Source/WebCore/rendering/style/StyleBoxData.cpp | 2 ++ Source/WebCore/style/RuleData.cpp | 2 ++ 12 files changed, 35 insertions(+) diff --git a/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp b/Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp index 46e03e7d0e..b5e9117b30 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 @@ -5497,3 +5502,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 568d3c7c51..2ec32b9925 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 9831d5cb0e..8892b6fe40 100644 --- a/Source/WebCore/css/CSSValue.cpp +++ b/Source/WebCore/css/CSSValue.cpp @@ -87,7 +87,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 46bace7579..7a601c3819 100644 --- a/Source/WebCore/dom/ElementRareData.cpp +++ b/Source/WebCore/dom/ElementRareData.cpp @@ -44,6 +44,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/NodeRareData.cpp b/Source/WebCore/dom/NodeRareData.cpp index 9915fdb00f..cc21d0d831 100644 --- a/Source/WebCore/dom/NodeRareData.cpp +++ b/Source/WebCore/dom/NodeRareData.cpp @@ -42,7 +42,9 @@ struct SameSizeAsNodeRareData { WeakPtr m_weakPointer; }; +#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 43ac11b03b..b0d74c10a4 100644 --- a/Source/WebCore/dom/ShadowRoot.cpp +++ b/Source/WebCore/dom/ShadowRoot.cpp @@ -59,10 +59,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/platform/graphics/FontCascadeDescription.cpp b/Source/WebCore/platform/graphics/FontCascadeDescription.cpp index e02d2854ed..3bb8818f55 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 f1285d9aee..be64cf3105 100644 --- a/Source/WebCore/rendering/LegacyInlineFlowBox.cpp +++ b/Source/WebCore/rendering/LegacyInlineFlowBox.cpp @@ -55,7 +55,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 0c4281f721..6a29f79ecf 100644 --- a/Source/WebCore/rendering/style/RenderStyle.cpp +++ b/Source/WebCore/rendering/style/RenderStyle.cpp @@ -70,7 +70,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]; @@ -89,7 +91,9 @@ struct SameSizeAsRenderStyle { #endif }; +#if !defined(__m68k__) static_assert(sizeof(RenderStyle) == sizeof(SameSizeAsRenderStyle), "RenderStyle should stay small"); +#endif DEFINE_ALLOCATOR_WITH_HEAP_IDENTIFIER(PseudoStyleCache); DEFINE_ALLOCATOR_WITH_HEAP_IDENTIFIER(RenderStyle); diff --git a/Source/WebCore/rendering/style/StyleBoxData.cpp b/Source/WebCore/rendering/style/StyleBoxData.cpp index 038834a5e7..a475ddf890 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 6dfd9fff9a..fb04a24fc1 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) { -- 2.30.2