Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F175080616
D21765.id62787.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
15 KB
Referenced Files
None
Subscribers
None
D21765.id62787.diff
View Options
Index: www/firefox/Makefile
===================================================================
--- www/firefox/Makefile
+++ www/firefox/Makefile
@@ -42,12 +42,28 @@
.include "${.CURDIR}/../../www/firefox/Makefile.options"
+.include <bsd.port.pre.mk>
+
+.if ${ARCH} == powerpc64
+. if ${OSVERSION} < 1300050
+IGNORE= only for ELFv2
+. endif
+EXTRA_PATCHES= ${FILESDIR}/extra-patch-third__party_rust_libloading_build.rs
+.endif
+
post-patch:
@${REINPLACE_CMD} -e 's/%u/%U/' -e '/X-MultipleArgs/d' \
-e '/^Icon/s/=.*/=${FIREFOX_ICON:R}/' \
${FIREFOX_DESKTOP}
@${REINPLACE_CMD} -e 's|%%LOCALBASE%%|${LOCALBASE}|g' \
${WRKSRC}/browser/app/nsBrowserApp.cpp
+ @${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
pre-configure:
(cd ${WRKSRC} && ${LOCALBASE}/bin/autoconf-2.13)
@@ -58,4 +74,4 @@
${MKDIR} ${STAGEDIR}${PREFIX}/share/pixmaps
${LN} -sf ${FIREFOX_ICON_SRC} ${STAGEDIR}${PREFIX}/share/pixmaps/${FIREFOX_ICON}
-.include <bsd.port.mk>
+.include <bsd.port.post.mk>
Index: www/firefox/files/extra-patch-third__party_rust_libloading_build.rs
===================================================================
--- www/firefox/files/extra-patch-third__party_rust_libloading_build.rs
+++ www/firefox/files/extra-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-freebsd13.0")
+ .file("src/os/unix/global_static.c")
+ .compile("global_static");
+ }
Index: www/firefox/files/patch-bug_1504834_comment5_Rough_progress_patch
===================================================================
--- www/firefox/files/patch-bug_1504834_comment5_Rough_progress_patch
+++ www/firefox/files/patch-bug_1504834_comment5_Rough_progress_patch
@@ -0,0 +1,79 @@
+https://bugzilla.mozilla.org/show_bug.cgi?id=1504834#c5
+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/files/patch-bug_1504834_comment7_s390-fixes.patch
===================================================================
--- www/firefox/files/patch-bug_1504834_comment7_s390-fixes.patch
+++ www/firefox/files/patch-bug_1504834_comment7_s390-fixes.patch
@@ -0,0 +1,75 @@
+https://bugzilla.mozilla.org/show_bug.cgi?id=1504834#c7
+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/files/patch-bug_1504834_comment8_big-endian-antialiasing
===================================================================
--- www/firefox/files/patch-bug_1504834_comment8_big-endian-antialiasing
+++ www/firefox/files/patch-bug_1504834_comment8_big-endian-antialiasing
@@ -0,0 +1,54 @@
+https://bugzilla.mozilla.org/show_bug.cgi?id=1504834#c8
+mozilla-big-endian-antialiasing.patch
+
+# HG changeset patch
+# Parent 8f367d4a806d4163351386841777c926c6332304
+
+diff -r 8f367d4a806d -r 65ad01b418d2 gfx/2d/DrawTargetSkia.cpp
+--- gfx/2d/DrawTargetSkia.cpp Thu Jul 25 14:27:58 2019 +0200
++++ gfx/2d/DrawTargetSkia.cpp Wed Jul 31 09:08:31 2019 +0200
+@@ -578,7 +578,11 @@
+
+ // TODO: Can we set greyscale somehow?
+ if (aOptions.mAntialiasMode != AntialiasMode::NONE) {
+- mPaint.setAntiAlias(true);
++ // AA is broken for Big Endian (black text is 100% transparent).
++ // This function seems to place that deals with
++ // menu icons and symbols (e.g. printing symbol, search symbol, ..)
++ // Deactivating AA here makes those icons and symbols visible (albeit pixely)
++ mPaint.setAntiAlias(false);
+ } else {
+ mPaint.setAntiAlias(false);
+ }
+diff -r 8f367d4a806d -r 65ad01b418d2 gfx/thebes/gfxFont.cpp
+--- gfx/thebes/gfxFont.cpp Thu Jul 25 14:27:58 2019 +0200
++++ gfx/thebes/gfxFont.cpp Wed Jul 31 09:08:31 2019 +0200
+@@ -2230,8 +2230,12 @@
+
+ Matrix mat;
+ Matrix oldMat = aRunParams.dt->GetTransform();
+-
+- fontParams.drawOptions.mAntialiasMode = Get2DAAMode(mAntialiasOption);
++ // Changing this here to NONE deactivates AA for _all_ text
++ // AA is broken for XULText on Big Endian, while normal text works fine.
++ // I can't find a way to differentiate a call from XULText from "normal" text here,
++ // so I set ctx->antialismode to NONE for XULText and check it here to deactivate AA for only them.
++ fontParams.drawOptions.mAntialiasMode = aRunParams.context->CurrentAntialiasMode() == AntialiasMode::NONE ?
++ AntialiasMode::NONE : Get2DAAMode(mAntialiasOption);
+
+ if (mStyle.baselineOffset != 0.0) {
+ baseline +=
+diff -r 8f367d4a806d -r 65ad01b418d2 layout/xul/nsTextBoxFrame.cpp
+--- layout/xul/nsTextBoxFrame.cpp Thu Jul 25 14:27:58 2019 +0200
++++ layout/xul/nsTextBoxFrame.cpp Wed Jul 31 09:08:31 2019 +0200
+@@ -287,6 +287,10 @@
+ mFrame->StyleColor()->mColor.ToColor(),
+ PaintTextShadowCallback, (void*)this);
+
++ // AA is broken for XULText on Big Endian, while normal text works fine.
++ // I can't find a way to differentiate a call from XULText from "normal" text further down the call-stack,
++ // so I set ctx->antialismode to NONE here and use that to check whether to deactivate AA further down.
++ aCtx->SetAntialiasMode(AntialiasMode::NONE);
+ PaintTextToContext(aCtx, nsPoint(0, 0), nullptr);
+ }
+
Index: www/firefox/files/patch-bug_1511604-hg_f6afcabc8f75
===================================================================
--- www/firefox/files/patch-bug_1511604-hg_f6afcabc8f75
+++ www/firefox/files/patch-bug_1511604-hg_f6afcabc8f75
@@ -0,0 +1,48 @@
+# HG changeset patch
+# User A. Wilcox <AWilcox@Wilcox-Tech.com>
+# Date 1543674229 0
+# Sat Dec 01 14:23:49 2018 +0000
+# Node ID 0309ff19e46b126c527e633518d7de8570442114
+# Parent 53107afbc21ec78e7ac46d37af212505f2032d5d
+Bug 1511604 - Swizzle YCbCr->RGB data on big-endian machines
+
+diff -r 53107afbc21e -r 0309ff19e46b gfx/ycbcr/YCbCrUtils.cpp
+--- gfx/ycbcr/YCbCrUtils.cpp Wed Nov 07 04:50:21 2018 +0000
++++ gfx/ycbcr/YCbCrUtils.cpp Sat Dec 01 14:23:49 2018 +0000
+@@ -3,7 +3,9 @@
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
++#include "mozilla/EndianUtils.h"
+ #include "gfx2DGlue.h"
++#include "mozilla/gfx/Swizzle.h"
+
+ #include "YCbCrUtils.h"
+ #include "yuv_convert.h"
+@@ -236,6 +238,13 @@
+ yuvtype,
+ srcData.mYUVColorSpace);
+ }
++#if MOZ_BIG_ENDIAN
++ // libyuv makes endian-correct result, which needs to be swapped to BGRX
++ if (aDestFormat != SurfaceFormat::R5G6B5_UINT16)
++ gfx::SwizzleData(aDestBuffer, aStride, gfx::SurfaceFormat::X8R8G8B8,
++ aDestBuffer, aStride, gfx::SurfaceFormat::B8G8R8X8,
++ srcData.mPicSize);
++#endif
+ }
+
+ void
+@@ -257,6 +266,12 @@
+ aSrcStrideYA,
+ aSrcStrideUV,
+ aDstStrideARGB);
++#if MOZ_BIG_ENDIAN
++ // libyuv makes endian-correct result, which needs to be swapped to BGRA
++ gfx::SwizzleData(aDstARGB, aDstStrideARGB, gfx::SurfaceFormat::A8R8G8B8,
++ aDstARGB, aDstStrideARGB, gfx::SurfaceFormat::B8G8R8A8,
++ IntSize(aWidth, aHeight));
++#endif
+ }
+
+ } // namespace gfx
Index: www/firefox/files/patch-media_webrtc_trunk_webrtc_moz.build
===================================================================
--- www/firefox/files/patch-media_webrtc_trunk_webrtc_moz.build
+++ www/firefox/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/files/patch-security_nss_lib_freebl_mpi_mpcpucache.c
===================================================================
--- www/firefox/files/patch-security_nss_lib_freebl_mpi_mpcpucache.c
+++ www/firefox/files/patch-security_nss_lib_freebl_mpi_mpcpucache.c
@@ -0,0 +1,11 @@
+--- security/nss/lib/freebl/mpi/mpcpucache.c.orig 2019-09-10 17:44:47.498849000 +0200
++++ security/nss/lib/freebl/mpi/mpcpucache.c 2019-09-10 17:54:41.488730000 +0200
+@@ -727,7 +727,7 @@ static inline void
+ dcbzl(char *array)
+ {
+ register char *a asm("r2") = array;
+- __asm__ __volatile__("dcbzl %0,r0"
++ __asm__ __volatile__("dcbzl %0,0"
+ : "=r"(a)
+ : "0"(a));
+ }
Index: www/firefox/files/patch-shut-up-warning
===================================================================
--- www/firefox/files/patch-shut-up-warning
+++ www/firefox/files/patch-shut-up-warning
@@ -0,0 +1,11 @@
+--- gfx/2d/HelpersCairo.h.old 2019-07-17 20:51:26.000000000 +0000
++++ gfx/2d/HelpersCairo.h 2019-08-10 11:38:36.047380153 +0000
+@@ -147,7 +147,7 @@
+ case SurfaceFormat::R5G6B5_UINT16:
+ return CAIRO_FORMAT_RGB16_565;
+ default:
+- gfxCriticalError() << "Unknown image format " << (int)format;
++ //gfxCriticalError() << "Unknown image format " << (int)format;
+ return CAIRO_FORMAT_ARGB32;
+ }
+ }
Index: www/firefox/files/patch-xpcom_reflect_xptcall_md_unix_moz.build
===================================================================
--- www/firefox/files/patch-xpcom_reflect_xptcall_md_unix_moz.build
+++ www/firefox/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
Details
Attached
Mime Type
text/plain
Expires
Fri, Oct 9, 3:01 AM (12 h, 23 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
40460763
Default Alt Text
D21765.id62787.diff (15 KB)
Attached To
Mode
D21765: www/firefox: port to powerpc64
Attached
Detach File
Event Timeline
Log In to Comment