Fix FTBFS on m68k
authorJohn Paul Adrian Glaubitz <glaubitz@physik.fu-berlin.de>
Thu, 17 Feb 2022 18:52:20 +0000 (18:52 +0000)
committerAlberto Garcia <berto@igalia.com>
Thu, 17 Feb 2022 18:52:20 +0000 (18:52 +0000)
Bug-Debian: https://bugs.debian.org/868126
Last-Update: 2020-01-23

===================================================================

Gbp-Pq: Name fix-ftbfs-m68k.patch

12 files changed:
Source/JavaScriptCore/bytecompiler/BytecodeGenerator.cpp
Source/WTF/wtf/PlatformCPU.h
Source/WebCore/css/CSSProperty.cpp
Source/WebCore/css/CSSValue.cpp
Source/WebCore/dom/ElementRareData.cpp
Source/WebCore/dom/NodeRareData.cpp
Source/WebCore/dom/ShadowRoot.cpp
Source/WebCore/platform/graphics/FontCascadeDescription.cpp
Source/WebCore/rendering/LegacyInlineFlowBox.cpp
Source/WebCore/rendering/style/RenderStyle.cpp
Source/WebCore/rendering/style/StyleBoxData.cpp
Source/WebCore/style/RuleData.cpp

index 5d8e8d158aa4275ec8b729dc6221aa4f488d5f21..aa92943accd9634a63f883703130d935612e210a 100644 (file)
 #include <wtf/StdLibExtras.h>
 #include <wtf/text/WTFString.h>
 
+#if defined(__m68k__) || defined(__SH4__)
+#pragma GCC push_options
+#pragma GCC optimize ("-O0")
+#endif
+
 namespace JSC {
 
 template<typename CallOp, typename = std::true_type>
@@ -5455,3 +5460,6 @@ void printInternal(PrintStream& out, JSC::Variable::VariableKind kind)
 
 } // namespace WTF
 
+#if defined(__m68k__) || defined(__SH4__)
+#pragma GCC pop_options
+#endif
index 10491cb1a5aab5b90a4d331b140e052b1c93a96d..ddb70ad469011b62274127af15e0c148324e973e 100644 (file)
 /* ==== 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)
index b8571b0a01c956fca47283cba41159df154b66df..89210895dce2ebf42811b08a8bbe622272370db1 100644 (file)
@@ -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
 {
index 87369ab0db52f0a2e8a3ba2c03953604c44d17e2..b4d1f1e69b1b95e9ee5ee1497506b2f03b3736d1 100644 (file)
@@ -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
 {
index ec85a4999d5e89ed433291cc55a3fa1f471ec55d..d38360f5c9846ce4bf3f4cc4a01d5e8df26aab5f 100644 (file)
@@ -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
index 928da436e7f02eb6e36610ae22759c16a3eb0d98..d10fb597e5acf3f46d44fcdf297f3063320f6d78 100644 (file)
@@ -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");
index a85288225a8646b3f18e1a48b9a56dff22507ad3..2523d7c43d5976d5475be6eac4b5804bf4a9272f 100644 (file)
@@ -59,10 +59,14 @@ struct SameSizeAsShadowRoot : public DocumentFragment, public TreeScope {
     std::optional<HashMap<AtomString, AtomString>> 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<Element>) == sizeof(void*), WeakPtr_should_be_same_size_as_raw_pointer);
 #endif
+#endif
 
 ShadowRoot::ShadowRoot(Document& document, ShadowRootMode type, DelegatesFocus delegatesFocus)
     : DocumentFragment(document, CreateShadowRoot)
index 1d293d7f158cd5c29aa02c319248043fa7464adc..8206e976f401da60fdf0526db15d42ed7a5bbcad 100644 (file)
@@ -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)
index 753344605569e21715a457cb438e6c370037ec8e..c09f1571db5a9280d8aece3ca93cc72782beb2ba 100644 (file)
@@ -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
 
index a9a17d67ad43af462eca4a97fb3e0ea0dcc0a5a7..0256820a1818a4bc360c7e2f0f4c75fd622078e2 100644 (file)
@@ -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);
 
index db977a8333c058493389233a5343388a593d8b83..77ae85c7fd3cdb75df4b05ec88d99208c9ee8473 100644 (file)
@@ -33,7 +33,11 @@ struct SameSizeAsStyleBoxData : public RefCounted<SameSizeAsStyleBoxData> {
     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);
 
index 2129a677b71d0ed4e50cefacf3e823e1ed376068..26d415d6b42c086d674e44ebc69c375c4cf85119 100644 (file)
@@ -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)
 {