Page MenuHomeFreeBSD

D21765.id65431.diff
No OneTemporary

D21765.id65431.diff

Index: www/Makefile
===================================================================
--- www/Makefile
+++ www/Makefile
@@ -158,6 +158,7 @@
SUBDIR += filtron
SUBDIR += firefox
SUBDIR += firefox-esr
+ SUBDIR += firefox-ppc64
SUBDIR += flashplayer
SUBDIR += flat-frog
SUBDIR += flickcurl
Index: www/firefox-ppc64/Makefile
===================================================================
--- www/firefox-ppc64/Makefile
+++ www/firefox-ppc64/Makefile
@@ -0,0 +1,25 @@
+# $FreeBSD$
+
+MASTERDIR= ${.CURDIR}/../firefox
+PKGNAMESUFFIX= -ppc64
+DESCR= ${MASTERDIR}/pkg-descr
+
+ONLY_FOR_ARCHS= powerpc64
+
+.if defined(PPC_ABI) && ${PPC_ABI} == ELFv1
+IGNORE= only for ELFv2, requires libc++ on ELFv1
+.endif
+
+# post-patch already taken
+post-extract:
+ @${REINPLACE_CMD} 's#(r#(%r#g' \
+ ${WRKSRC}/xpcom/reflect/xptcall/md/unix/xptcinvoke_asm_ppc64_linux.S \
+ ${WRKSRC}/xpcom/reflect/xptcall/md/unix/xptcstubs_asm_ppc64_linux.S
+ @${REINPLACE_CMD} 's#mtctr r12#mtctr %r12#' \
+ ${WRKSRC}/xpcom/reflect/xptcall/md/unix/xptcinvoke_asm_ppc64_linux.S
+ @${REINPLACE_CMD} 's,"files":{[^}]*},"files":{},' \
+ ${WRKSRC}/third_party/rust/libloading/.cargo-checksum.json
+ @${REINPLACE_CMD} 's,OSREL,${OSREL},' \
+ ${WRKSRC}/third_party/rust/libloading/build.rs
+
+.include "${MASTERDIR}/Makefile"
Index: www/firefox-ppc64/files/patch-bug1269654_comment5
===================================================================
--- www/firefox-ppc64/files/patch-bug1269654_comment5
+++ www/firefox-ppc64/files/patch-bug1269654_comment5
@@ -0,0 +1,43 @@
+https://bugzilla.mozilla.org/show_bug.cgi?id=1269654#c5
+https://bug1269654.bmoattachments.org/attachment.cgi?id=8749234
+handle big-endian formats in Cairo format conversions
+
+# HG changeset patch
+# User Lee Salzman <lsalzman@mozilla.com>
+# Date 1462463631 14400
+# Thu May 05 11:53:51 2016 -0400
+# Node ID 8da374804a09977c8f89af5e6e0cb37cb074595d
+# Parent 29662e28a9c93ac67ee0b8ddfb65a9f29bbf73f5
+handle big-endian formats in Cairo format conversions
+
+--- gfx/2d/HelpersCairo.h.orig 2019-12-02 17:51:16.633474000 +0100
++++ gfx/2d/HelpersCairo.h 2019-12-02 17:52:44.939998000 +0100
+@@ -147,7 +147,14 @@ static inline cairo_format_t GfxFormatToCairoFormat(Su
+ case SurfaceFormat::R5G6B5_UINT16:
+ return CAIRO_FORMAT_RGB16_565;
+ default:
+- gfxCriticalError() << "Unknown image format " << (int)format;
++ // _UINT32 formats don't match B8G8R8[AX]8 on big-endian platforms,
++ // and Moz2d uses B8G8R8[AX]8 as if it was _UINT32.
++ // See bug 1269654
++ if (format == SurfaceFormat::B8G8R8X8) {
++ return CAIRO_FORMAT_RGB24;
++ } else if (format != SurfaceFormat::B8G8R8A8) {
++ gfxCriticalError() << "Unknown image format " << (int)format;
++ }
+ return CAIRO_FORMAT_ARGB32;
+ }
+ }
+@@ -177,7 +184,11 @@ static inline cairo_content_t GfxFormatToCairoContent(
+ case SurfaceFormat::A8:
+ return CAIRO_CONTENT_ALPHA;
+ default:
+- gfxCriticalError() << "Unknown image content format " << (int)format;
++ if (format == SurfaceFormat::B8G8R8X8) {
++ return CAIRO_CONTENT_COLOR;
++ } else if (format != SurfaceFormat::B8G8R8A8) {
++ gfxCriticalError() << "Unknown image content format " << (int)format;
++ }
+ return CAIRO_CONTENT_COLOR_ALPHA;
+ }
+ }
Index: www/firefox-ppc64/files/patch-bug1504834_comment10
===================================================================
--- www/firefox-ppc64/files/patch-bug1504834_comment10
+++ www/firefox-ppc64/files/patch-bug1504834_comment10
@@ -0,0 +1,34 @@
+https://bugzilla.mozilla.org/show_bug.cgi?id=1504834#c10
+https://bug1504834.bmoattachments.org/attachment.cgi?id=9111147
+mozilla-bmo1504834-part4.patch
+
+# HG changeset patch
+# Parent 46ea866ca3acb8bb5e1709ceb799b9c94f591dec
+Problem description: Tab-titles that are too long to fit into a tab get faded out.
+ On big endian this is broken and instead of fading out, the
+ tab gets white and the font transparent, leading to an unreadable
+ tab-title
+Solution: This is not a real solution, but a hack. The real solution would have been
+ to byte-swap the correct buffer, but I could not find it.
+ So the next best thing is to deactivate the fading-effect. Now all tab-titles
+ are readable, albeit not as pretty to look at as they could be.
+Side-effects: I have not yet found an unwanted side-effect.
+
+diff -r 46ea866ca3ac -r 6ef20eee3f8f gfx/2d/DrawTargetSkia.cpp
+--- gfx/2d/DrawTargetSkia.cpp Tue Oct 22 12:27:22 2019 +0200
++++ gfx/2d/DrawTargetSkia.cpp Thu Oct 31 09:11:56 2019 +0100
+@@ -1861,6 +1861,14 @@
+ SkCanvas::kPreserveLCDText_SaveLayerFlag |
+ (aCopyBackground ? SkCanvas::kInitWithPrevious_SaveLayerFlag : 0));
+
++#if MOZ_BIG_ENDIAN
++ // Pushing a layer where an aMask is defined produces wrong output.
++ // We _should_ endian swap the data, but I couldn't find a workable way to do so
++ // Therefore I deactivate those layers in the meantime.
++ // The result is: Tab-titles that are longer than the available space should be faded out.
++ // The fading doesn't work, so we deactivate the fading-effect here.
++ if (!aMask)
++#endif
+ mCanvas->saveLayer(saveRec);
+
+ SetPermitSubpixelAA(aOpaque);
Index: www/firefox-ppc64/files/patch-bug1504834_comment5
===================================================================
--- www/firefox-ppc64/files/patch-bug1504834_comment5
+++ www/firefox-ppc64/files/patch-bug1504834_comment5
@@ -0,0 +1,80 @@
+https://bugzilla.mozilla.org/show_bug.cgi?id=1504834#c5
+https://bugzilla.mozilla.org/attachment.cgi?id=9028600
+Rough progress patch
+
+
+diff -r 53107afbc21e gfx/skia/skia/third_party/skcms/skcms.cc
+--- gfx/skia/skia/third_party/skcms/skcms.cc Wed Nov 07 04:50:21 2018 +0000
++++ gfx/skia/skia/third_party/skcms/skcms.cc Thu Nov 29 12:49:35 2018 +0000
+@@ -17,6 +17,8 @@
+ #include <arm_neon.h>
+ #elif defined(__SSE__)
+ #include <immintrin.h>
++#else
++ #define SKCMS_PORTABLE
+ #endif
+
+ // sizeof(x) will return size_t, which is 32-bit on some machines and 64-bit on others.
+@@ -124,20 +126,28 @@
+ static uint16_t read_big_u16(const uint8_t* ptr) {
+ uint16_t be;
+ memcpy(&be, ptr, sizeof(be));
+-#if defined(_MSC_VER)
++#if __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
++ return be;
++#else
++ #if defined(_MSC_VER)
+ return _byteswap_ushort(be);
+-#else
++ #else
+ return __builtin_bswap16(be);
++ #endif
+ #endif
+ }
+
+ static uint32_t read_big_u32(const uint8_t* ptr) {
+ uint32_t be;
+ memcpy(&be, ptr, sizeof(be));
+-#if defined(_MSC_VER)
++#if __BYTE_ORDER == __ORDER_BIG_ENDIAN__
++ return be;
++#else
++ #if defined(_MSC_VER)
+ return _byteswap_ulong(be);
+-#else
++ #else
+ return __builtin_bswap32(be);
++ #endif
+ #endif
+ }
+
+--- gfx/2d/DrawTargetSkia.cpp.orig 2019-09-21 15:51:04.129603000 +0200
++++ gfx/2d/DrawTargetSkia.cpp 2019-09-21 15:52:11.900316000 +0200
+@@ -138,8 +138,7 @@ static IntRect CalculateSurfaceBounds(const IntSize& a
+ return surfaceBounds.Intersect(bounds);
+ }
+
+-static const int kARGBAlphaOffset =
+- SurfaceFormat::A8R8G8B8_UINT32 == SurfaceFormat::B8G8R8A8 ? 3 : 0;
++static const int kARGBAlphaOffset = 0;
+
+ static bool VerifyRGBXFormat(uint8_t* aData, const IntSize& aSize,
+ const int32_t aStride, SurfaceFormat aFormat) {
+--- gfx/2d/Types.h.orig 2019-09-21 15:52:47.044803000 +0200
++++ gfx/2d/Types.h 2019-09-21 15:53:40.113641000 +0200
+@@ -85,15 +85,8 @@ enum class SurfaceFormat : int8_t {
+ // The following values are endian-independent synonyms. The _UINT32 suffix
+ // indicates that the name reflects the layout when viewed as a uint32_t
+ // value.
+-#if MOZ_LITTLE_ENDIAN
+ A8R8G8B8_UINT32 = B8G8R8A8, // 0xAARRGGBB
+ X8R8G8B8_UINT32 = B8G8R8X8 // 0x00RRGGBB
+-#elif MOZ_BIG_ENDIAN
+- A8R8G8B8_UINT32 = A8R8G8B8, // 0xAARRGGBB
+- X8R8G8B8_UINT32 = X8R8G8B8 // 0x00RRGGBB
+-#else
+-# error "bad endianness"
+-#endif
+ };
+
+ static inline int BytesPerPixel(SurfaceFormat aFormat) {
Index: www/firefox-ppc64/files/patch-bug1504834_comment7
===================================================================
--- www/firefox-ppc64/files/patch-bug1504834_comment7
+++ www/firefox-ppc64/files/patch-bug1504834_comment7
@@ -0,0 +1,76 @@
+https://bugzilla.mozilla.org/show_bug.cgi?id=1504834#c7
+https://bugzilla.mozilla.org/attachment.cgi?id=9080593
+WIP-s390x-fixes.patch
+
+# HG changeset patch
+# Parent 548d0a2f3a22bfac32ec0c3921c6c969c8bf32a9
+
+diff -r 548d0a2f3a22 gfx/2d/ConvolutionFilter.cpp
+--- gfx/2d/ConvolutionFilter.cpp Mon Jul 22 16:57:54 2019 +0200
++++ gfx/2d/ConvolutionFilter.cpp Thu Jul 25 14:27:59 2019 +0200
+@@ -35,9 +35,38 @@
+ return true;
+ }
+
++static void ByteSwapArray(uint8_t *u8Array, int32_t size) {
++ uint32_t *array = reinterpret_cast<uint32_t*>(u8Array);
++ for (int pxl = 0; pxl < size; ++pxl) {
++ // Use an endian swap to move the bytes, i.e. BGRA -> ARGB.
++ uint32_t rgba = array[pxl];
++ array[pxl] = NativeEndian::swapToLittleEndian(rgba);
++ }
++}
++
+ void ConvolutionFilter::ConvolveHorizontally(const uint8_t* aSrc, uint8_t* aDst,
+ bool aHasAlpha) {
++#ifdef MOZ_BIG_ENDIAN
++ int outputSize = mFilter->numValues();
++
++ // Input size isn't handed in, so we have to calculate it quickly
++ int inputSize = 0;
++ for (int xx = 0; xx < outputSize; ++xx) {
++ // Get the filter that determines the current output pixel.
++ int filterOffset, filterLength;
++ mFilter->FilterForValue(xx, &filterOffset, &filterLength);
++ inputSize = std::max(inputSize, filterOffset + filterLength);
++ }
++
++ ByteSwapArray((uint8_t*)aSrc, inputSize);
++#endif
++
+ SkOpts::convolve_horizontally(aSrc, *mFilter, aDst, aHasAlpha);
++
++#ifdef MOZ_BIG_ENDIAN
++ ByteSwapArray((uint8_t*)aSrc, inputSize);
++ ByteSwapArray(aDst, outputSize);
++#endif
+ }
+
+ void ConvolutionFilter::ConvolveVertically(uint8_t* const* aSrc, uint8_t* aDst,
+@@ -49,8 +78,26 @@
+ int32_t filterLength;
+ auto filterValues =
+ mFilter->FilterForValue(aRowIndex, &filterOffset, &filterLength);
++
++#ifdef MOZ_BIG_ENDIAN
++ for (int filterY = 0; filterY < filterLength; filterY++) {
++ // Skia only knows LE, so we have to swizzle the input
++ ByteSwapArray(aSrc[filterY], aRowSize);
++ }
++#endif
++
+ SkOpts::convolve_vertically(filterValues, filterLength, aSrc, aRowSize, aDst,
+ aHasAlpha);
++
++#ifdef MOZ_BIG_ENDIAN
++ // After skia is finished, we swizzle back to BE, in case
++ // the input is used again somewhere else
++ for (int filterY = 0; filterY < filterLength; filterY++) {
++ ByteSwapArray(aSrc[filterY], aRowSize);
++ }
++ // The destination array as well
++ ByteSwapArray(aDst, aRowSize);
++#endif
+ }
+
+ /* ConvolutionFilter::ComputeResizeFactor is derived from Skia's
Index: www/firefox-ppc64/files/patch-bug1504834_comment9
===================================================================
--- www/firefox-ppc64/files/patch-bug1504834_comment9
+++ www/firefox-ppc64/files/patch-bug1504834_comment9
@@ -0,0 +1,49 @@
+https://bugzilla.mozilla.org/show_bug.cgi?id=1504834#c9
+https://bugzilla.mozilla.org/attachment.cgi?id=9111146
+mozilla-bmo1504834-part3.patch
+
+
+# HG changeset patch
+# Parent aecb4600e5da17443b224c79eee178c1d8e155e3
+For FF68, AntiAliasing of XULTexts seem to be broken on big endian (s390x). Text and icons of the sandwich-menu to the
+right of the address bar, as well as plugin-windows appears transparant, which usually means unreadable (white on white).
+
+diff -r aecb4600e5da gfx/skia/skia/include/private/SkNx.h
+--- gfx/skia/skia/include/private/SkNx.h Tue Aug 20 09:46:55 2019 +0200
++++ gfx/skia/skia/include/private/SkNx.h Mon Sep 09 10:04:06 2019 +0200
+@@ -238,7 +238,18 @@
+ AI SkNx operator*(const SkNx& y) const { return fVal * y.fVal; }
+ AI SkNx operator/(const SkNx& y) const { return fVal / y.fVal; }
+
++ // On Big endian the commented out variant doesn't work,
++ // and honestly, I have no idea why it exists in the first place.
++ // The reason its broken is, I think, that it defaults to the double-variant of ToBits()
++ // which gets a 64-bit integer, and FromBits returns 32-bit,
++ // cutting off the wrong half again.
++ // Overall, I see no reason to have ToBits and FromBits at all (even for floats/doubles).
++ // Still we are only "fixing" this for big endian and leave little endian alone (never touch a running system)
++#ifdef SK_CPU_BENDIAN
++ AI SkNx operator&(const SkNx& y) const { return fVal & y.fVal; }
++#else
+ AI SkNx operator&(const SkNx& y) const { return FromBits(ToBits(fVal) & ToBits(y.fVal)); }
++#endif
+ AI SkNx operator|(const SkNx& y) const { return FromBits(ToBits(fVal) | ToBits(y.fVal)); }
+ AI SkNx operator^(const SkNx& y) const { return FromBits(ToBits(fVal) ^ ToBits(y.fVal)); }
+
+diff -r aecb4600e5da gfx/skia/skia/src/opts/SkBlitMask_opts.h
+--- gfx/skia/skia/src/opts/SkBlitMask_opts.h Tue Aug 20 09:46:55 2019 +0200
++++ gfx/skia/skia/src/opts/SkBlitMask_opts.h Mon Sep 09 10:04:06 2019 +0200
+@@ -203,7 +203,13 @@
+ // ~~~>
+ // a = 1*aa + d(1-1*aa) = aa + d(1-aa)
+ // c = 0*aa + d(1-1*aa) = d(1-aa)
++
++ // For big endian we have to swap the alpha-mask from 0,0,0,255 to 255,0,0,0
++#ifdef SK_CPU_BENDIAN
++ return Sk4px(Sk16b(aa) & Sk16b(255,0,0,0, 255,0,0,0, 255,0,0,0, 255,0,0,0))
++#else
+ return Sk4px(Sk16b(aa) & Sk16b(0,0,0,255, 0,0,0,255, 0,0,0,255, 0,0,0,255))
++#endif
+ + d.approxMulDiv255(aa.inv());
+ };
+ while (h --> 0) {
Index: www/firefox-ppc64/files/patch-media_webrtc_trunk_webrtc_moz.build
===================================================================
--- www/firefox-ppc64/files/patch-media_webrtc_trunk_webrtc_moz.build
+++ www/firefox-ppc64/files/patch-media_webrtc_trunk_webrtc_moz.build
@@ -0,0 +1,16 @@
+--- media/webrtc/trunk/webrtc/moz.build.orig 2019-09-11 19:11:42.182838000 +0200
++++ media/webrtc/trunk/webrtc/moz.build 2019-09-11 17:16:33.611352000 +0200
+@@ -291,6 +291,13 @@ if CONFIG["CPU_ARCH"] == "arm" and CONFIG["OS_TARGET"]
+ "/media/webrtc/trunk/webrtc/modules/video_processing/video_processing_neon_gn"
+ ]
+
++if CONFIG["CPU_ARCH"] == "ppc64" and CONFIG["OS_TARGET"] == "FreeBSD":
++
++ DIRS += [
++ "/media/webrtc/trunk/webrtc/api/audio_codecs/isac/audio_decoder_isac_float_gn",
++ "/media/webrtc/trunk/webrtc/api/audio_codecs/isac/audio_encoder_isac_float_gn"
++ ]
++
+ if CONFIG["CPU_ARCH"] == "x86" and CONFIG["OS_TARGET"] == "FreeBSD":
+
+ DIRS += [
Index: www/firefox-ppc64/files/patch-third__party_rust_libloading_build.rs
===================================================================
--- www/firefox-ppc64/files/patch-third__party_rust_libloading_build.rs
+++ www/firefox-ppc64/files/patch-third__party_rust_libloading_build.rs
@@ -0,0 +1,10 @@
+--- third_party/rust/libloading/build.rs.orig 2019-09-23 12:39:53.924127000 +0200
++++ third_party/rust/libloading/build.rs 2019-09-23 12:15:14.203069000 +0200
+@@ -25,6 +25,7 @@ fn main(){
+ }
+ if is_unix {
+ cc::Build::new()
++ .target("powerpc64-unknown-freebsdOSREL")
+ .file("src/os/unix/global_static.c")
+ .compile("global_static");
+ }
Index: www/firefox-ppc64/files/patch-xpcom_reflect_xptcall_md_unix_moz.build
===================================================================
--- www/firefox-ppc64/files/patch-xpcom_reflect_xptcall_md_unix_moz.build
+++ www/firefox-ppc64/files/patch-xpcom_reflect_xptcall_md_unix_moz.build
@@ -0,0 +1,11 @@
+--- xpcom/reflect/xptcall/md/unix/moz.build.orig 2019-09-17 19:03:01.000000000 +0200
++++ xpcom/reflect/xptcall/md/unix/moz.build 2019-09-30 14:13:00.123448000 +0200
+@@ -180,7 +180,7 @@ if CONFIG['CPU_ARCH'] == 'ppc64':
+ 'xptcstubs_asm_ppc64_linux.S',
+ 'xptcstubs_ppc64_linux.cpp',
+ ]
+- if CONFIG['CC_TYPE'] == 'clang':
++ if CONFIG['CC_TYPE'] == 'clang' and CONFIG['OS_ARCH'] != 'FreeBSD':
+ ASFLAGS += [
+ '-fno-integrated-as',
+ ]

File Metadata

Mime Type
text/plain
Expires
Fri, Nov 28, 12:31 AM (12 h, 20 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
26268191
Default Alt Text
D21765.id65431.diff (16 KB)

Event Timeline