[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Bug#824449: firefox: FTBFS on sparc64 due to wrong platform definitions



Hi!

With Firefox 60.0 ESR now in experimental, most of the sparc64-related patches
are now part of the upstream source.

The only patches we actually need are the one to fix skia on big-endian targets
(I am currently in the process of upstreaming this one) and one tiny patch
to fix an alignment issue on sparc64.

Attaching both of them. The skia patch will also fix the build on s390x.

Adrian

--
 .''`.  John Paul Adrian Glaubitz
: :' :  Debian Developer - glaubitz@debian.org
`. `'   Freie Universitaet Berlin - glaubitz@physik.fu-berlin.de
  `-    GPG: 62FF 8A75 84E0 2956 9546  0006 7426 3B37 F5B5 F913
diff -r ee1d1bf1dc8a gfx/skia/skia/include/core/SkColorPriv.h
--- a/gfx/skia/skia/include/core/SkColorPriv.h	Thu Apr 12 03:35:11 2018 -0700
+++ b/gfx/skia/skia/include/core/SkColorPriv.h	Fri Apr 13 10:04:36 2018 +0300
@@ -55,17 +55,10 @@
  *  Here we enforce this constraint.
  */
 
-#ifdef SK_CPU_BENDIAN
-    #define SK_RGBA_R32_SHIFT   24
-    #define SK_RGBA_G32_SHIFT   16
-    #define SK_RGBA_B32_SHIFT   8
-    #define SK_RGBA_A32_SHIFT   0
-#else
-    #define SK_RGBA_R32_SHIFT   0
-    #define SK_RGBA_G32_SHIFT   8
-    #define SK_RGBA_B32_SHIFT   16
-    #define SK_RGBA_A32_SHIFT   24
-#endif
+#define SK_RGBA_R32_SHIFT   0
+#define SK_RGBA_G32_SHIFT   8
+#define SK_RGBA_B32_SHIFT   16
+#define SK_RGBA_A32_SHIFT   24
 
 #define SkGetPackedA32(packed)      ((uint32_t)((packed) << (24 - SK_A32_SHIFT)) >> 24)
 #define SkGetPackedR32(packed)      ((uint32_t)((packed) << (24 - SK_R32_SHIFT)) >> 24)
diff -r ee1d1bf1dc8a gfx/skia/skia/include/core/SkImageInfo.h
--- a/gfx/skia/skia/include/core/SkImageInfo.h	Thu Apr 12 03:35:11 2018 -0700
+++ b/gfx/skia/skia/include/core/SkImageInfo.h	Fri Apr 13 10:04:36 2018 +0300
@@ -84,7 +84,7 @@
 #elif SK_PMCOLOR_BYTE_ORDER(R,G,B,A)
     kN32_SkColorType = kRGBA_8888_SkColorType,
 #else
-    #error "SK_*32_SHIFT values must correspond to BGRA or RGBA byte order"
+    kN32_SkColorType = kBGRA_8888_SkColorType
 #endif
 };
 
diff -r ee1d1bf1dc8a gfx/skia/skia/include/gpu/GrTypes.h
--- a/gfx/skia/skia/include/gpu/GrTypes.h	Thu Apr 12 03:35:11 2018 -0700
+++ b/gfx/skia/skia/include/gpu/GrTypes.h	Fri Apr 13 10:04:36 2018 +0300
@@ -344,15 +344,13 @@
 static const int kGrPixelConfigCnt = kLast_GrPixelConfig + 1;
 
 // Aliases for pixel configs that match skia's byte order.
-#ifndef SK_CPU_LENDIAN
-    #error "Skia gpu currently assumes little endian"
-#endif
 #if SK_PMCOLOR_BYTE_ORDER(B,G,R,A)
     static const GrPixelConfig kSkia8888_GrPixelConfig = kBGRA_8888_GrPixelConfig;
 #elif SK_PMCOLOR_BYTE_ORDER(R,G,B,A)
     static const GrPixelConfig kSkia8888_GrPixelConfig = kRGBA_8888_GrPixelConfig;
 #else
-    #error "SK_*32_SHIFT values must correspond to GL_BGRA or GL_RGBA format."
+    static const GrPixelConfig kSkia8888_GrPixelConfig = kBGRA_8888_GrPixelConfig;
+    static const GrPixelConfig kSkiaGamma8888_GrPixelConfig = kSBGRA_8888_GrPixelConfig;
 #endif
 
 /**
diff -r ee1d1bf1dc8a gfx/skia/skia/include/private/GrColor.h
--- a/gfx/skia/skia/include/private/GrColor.h	Thu Apr 12 03:35:11 2018 -0700
+++ b/gfx/skia/skia/include/private/GrColor.h	Fri Apr 13 10:04:36 2018 +0300
@@ -74,7 +74,11 @@
  *  Since premultiplied means that alpha >= color, we construct a color with
  *  each component==255 and alpha == 0 to be "illegal"
  */
+#ifdef SK_CPU_BENDIAN
+#define GrColor_ILLEGAL     0xFFFFFF00
+#else
 #define GrColor_ILLEGAL     (~(0xFF << GrColor_SHIFT_A))
+#endif
 
 #define GrColor_WHITE 0xFFFFFFFF
 #define GrColor_TRANSPARENT_BLACK 0x0
diff -r ee1d1bf1dc8a gfx/skia/skia/src/core/SkColorData.h
--- a/gfx/skia/skia/src/core/SkColorData.h	Thu Apr 12 03:35:11 2018 -0700
+++ b/gfx/skia/skia/src/core/SkColorData.h	Fri Apr 13 10:04:36 2018 +0300
@@ -32,17 +32,10 @@
  *  Here we enforce this constraint.
  */
 
-#ifdef SK_CPU_BENDIAN
-    #define SK_BGRA_B32_SHIFT   24
-    #define SK_BGRA_G32_SHIFT   16
-    #define SK_BGRA_R32_SHIFT   8
-    #define SK_BGRA_A32_SHIFT   0
-#else
-    #define SK_BGRA_B32_SHIFT   0
-    #define SK_BGRA_G32_SHIFT   8
-    #define SK_BGRA_R32_SHIFT   16
-    #define SK_BGRA_A32_SHIFT   24
-#endif
+#define SK_BGRA_B32_SHIFT   0
+#define SK_BGRA_G32_SHIFT   8
+#define SK_BGRA_R32_SHIFT   16
+#define SK_BGRA_A32_SHIFT   24
 
 #if defined(SK_PMCOLOR_IS_RGBA) && defined(SK_PMCOLOR_IS_BGRA)
     #error "can't define PMCOLOR to be RGBA and BGRA"
>From 334b650e843cb307397fd627814421873131f0ed Mon Sep 17 00:00:00 2001
From: Michael Karcher <debian@mkarcher.dialup.fu-berlin.de>
Date: Thu, 1 Feb 2018 00:04:36 +0100
Subject: [PATCH] Bug 1434726 - Early startup crash on Linux sparc64 in
 HashIIDPtrKey

---
 js/xpconnect/src/XPCMaps.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/js/xpconnect/src/XPCMaps.cpp b/js/xpconnect/src/XPCMaps.cpp
index bb99b9f8c034..837d5d78970f 100644
--- a/js/xpconnect/src/XPCMaps.cpp
+++ b/js/xpconnect/src/XPCMaps.cpp
@@ -23,7 +23,7 @@ using namespace mozilla;
 static PLDHashNumber
 HashIIDPtrKey(const void* key)
 {
-    return HashGeneric(*((uintptr_t*)key));
+    return HashGeneric(((nsID*)key)->m0);
 }
 
 static bool
-- 
2.15.1


Reply to: