Mon Aug 11 10:09:21 2008 UTC ()
Add "unicode" processing alignment patch from mozilla's bugzilla to make
firefox work again on archs requiring strict alignement.
Bump pkgrevision.


(martin)
diff -r1.46 -r1.47 pkgsrc/www/firefox/Makefile
diff -r1.80 -r1.81 pkgsrc/www/firefox/distinfo
diff -r1.19 -r1.20 pkgsrc/www/firefox-gtk1/Makefile
diff -r0 -r1.1 pkgsrc/www/firefox/patches/patch-ee
diff -r0 -r1.1 pkgsrc/www/firefox/patches/patch-ef
diff -r0 -r1.1 pkgsrc/www/firefox/patches/patch-eg

cvs diff -r1.46 -r1.47 pkgsrc/www/firefox/Makefile (expand / switch to unified diff)

--- pkgsrc/www/firefox/Makefile 2007/08/07 21:59:11 1.46
+++ pkgsrc/www/firefox/Makefile 2008/08/11 10:09:21 1.47
@@ -1,12 +1,13 @@ @@ -1,12 +1,13 @@
1# $NetBSD: Makefile,v 1.46 2007/08/07 21:59:11 ghen Exp $ 1# $NetBSD: Makefile,v 1.47 2008/08/11 10:09:21 martin Exp $
2 2
3MOZILLA= firefox 3MOZILLA= firefox
4COMMENT= Lightweight gecko-based web browser 4COMMENT= Lightweight gecko-based web browser
 5PKGREVISION= 1
5 6
6MOZILLA_USE_GTK2= # yes 7MOZILLA_USE_GTK2= # yes
7MOZILLA_USE_XFT= YES 8MOZILLA_USE_XFT= YES
8 9
9INSTALLATION_DIRS= lib/pkgconfig 10INSTALLATION_DIRS= lib/pkgconfig
10 11
11.include "../../www/firefox/Makefile-firefox.common" 12.include "../../www/firefox/Makefile-firefox.common"
12.include "../../mk/bsd.pkg.mk" 13.include "../../mk/bsd.pkg.mk"

cvs diff -r1.80 -r1.81 pkgsrc/www/firefox/distinfo (expand / switch to unified diff)

--- pkgsrc/www/firefox/distinfo 2008/07/16 09:52:56 1.80
+++ pkgsrc/www/firefox/distinfo 2008/08/11 10:09:21 1.81
@@ -1,14 +1,14 @@ @@ -1,14 +1,14 @@
1$NetBSD: distinfo,v 1.80 2008/07/16 09:52:56 ghen Exp $ 1$NetBSD: distinfo,v 1.81 2008/08/11 10:09:21 martin Exp $
2 2
3SHA1 (firefox-2.0.0.16-source.tar.bz2) = ae1d451ce85a5515b37d73d2c4b7cb1377206d86 3SHA1 (firefox-2.0.0.16-source.tar.bz2) = ae1d451ce85a5515b37d73d2c4b7cb1377206d86
4RMD160 (firefox-2.0.0.16-source.tar.bz2) = 485c5d7c3c3fc9c462ee348802742905d3becfdf 4RMD160 (firefox-2.0.0.16-source.tar.bz2) = 485c5d7c3c3fc9c462ee348802742905d3becfdf
5Size (firefox-2.0.0.16-source.tar.bz2) = 40235443 bytes 5Size (firefox-2.0.0.16-source.tar.bz2) = 40235443 bytes
6SHA1 (patch-aa) = 5095449d4e979085fc5791b9d0251076b9c969c3 6SHA1 (patch-aa) = 5095449d4e979085fc5791b9d0251076b9c969c3
7SHA1 (patch-ab) = 19069a4e572744eccb04e9906e16dad28d2dac01 7SHA1 (patch-ab) = 19069a4e572744eccb04e9906e16dad28d2dac01
8SHA1 (patch-ac) = 96bee96d365d6a95d14031f4f1df9584b94d570b 8SHA1 (patch-ac) = 96bee96d365d6a95d14031f4f1df9584b94d570b
9SHA1 (patch-ad) = 20f2184a7e5e98b065e884c67e4c17fc52019a79 9SHA1 (patch-ad) = 20f2184a7e5e98b065e884c67e4c17fc52019a79
10SHA1 (patch-ae) = fea251aabc772c3d4ad3044c8295af45cc9cab2d 10SHA1 (patch-ae) = fea251aabc772c3d4ad3044c8295af45cc9cab2d
11SHA1 (patch-af) = 2500e35f74eab9ec16df7303fe8d1c2bff0a655b 11SHA1 (patch-af) = 2500e35f74eab9ec16df7303fe8d1c2bff0a655b
12SHA1 (patch-ag) = 1266333a482483f786d5f00e92e641e282266442 12SHA1 (patch-ag) = 1266333a482483f786d5f00e92e641e282266442
13SHA1 (patch-ah) = c737519c8ab8a66993d4892a6efac73e2da979f5 13SHA1 (patch-ah) = c737519c8ab8a66993d4892a6efac73e2da979f5
14SHA1 (patch-ai) = 58d7d87295cfbcaeba3e6a27457e15533d4b8e78 14SHA1 (patch-ai) = 58d7d87295cfbcaeba3e6a27457e15533d4b8e78
@@ -58,13 +58,16 @@ SHA1 (patch-dm) = eb86aee54fd213eb64a89e @@ -58,13 +58,16 @@ SHA1 (patch-dm) = eb86aee54fd213eb64a89e
58SHA1 (patch-do) = bdb018e157dcb5ef706b69184d8b739cfd32d8c3 58SHA1 (patch-do) = bdb018e157dcb5ef706b69184d8b739cfd32d8c3
59SHA1 (patch-dr) = 377b1d83079ada4d819b6702c1010cdd900575fc 59SHA1 (patch-dr) = 377b1d83079ada4d819b6702c1010cdd900575fc
60SHA1 (patch-ds) = 1e2e371b9ff7ab9049a947d8e0a63483a1fd244e 60SHA1 (patch-ds) = 1e2e371b9ff7ab9049a947d8e0a63483a1fd244e
61SHA1 (patch-dt) = 9eef43663de12721ecc38124d5bd4a90a825eefc 61SHA1 (patch-dt) = 9eef43663de12721ecc38124d5bd4a90a825eefc
62SHA1 (patch-du) = c6e66bb420ce9ea988f89b57d1c20a247704cfcf 62SHA1 (patch-du) = c6e66bb420ce9ea988f89b57d1c20a247704cfcf
63SHA1 (patch-dv) = a380d261d4c2771a672d2b0f4f1f23821e3e5266 63SHA1 (patch-dv) = a380d261d4c2771a672d2b0f4f1f23821e3e5266
64SHA1 (patch-dw) = ab7606171564b6879effc3b37d9eadc6565cb74b 64SHA1 (patch-dw) = ab7606171564b6879effc3b37d9eadc6565cb74b
65SHA1 (patch-dx) = 17b444ac732951359df44b482ee9ce2455050b1f 65SHA1 (patch-dx) = 17b444ac732951359df44b482ee9ce2455050b1f
66SHA1 (patch-dy) = a5fa5db83ae4c035c28f54f46ddb816330c764e0 66SHA1 (patch-dy) = a5fa5db83ae4c035c28f54f46ddb816330c764e0
67SHA1 (patch-ea) = 14e31d17c2493e468cd01f99abfc996853a11032 67SHA1 (patch-ea) = 14e31d17c2493e468cd01f99abfc996853a11032
68SHA1 (patch-eb) = dc9232b10075d17f7ed742e7be8ea036db2f0241 68SHA1 (patch-eb) = dc9232b10075d17f7ed742e7be8ea036db2f0241
69SHA1 (patch-ec) = 8235af6634306b2a5725754cd5a32285b311b714 69SHA1 (patch-ec) = 8235af6634306b2a5725754cd5a32285b311b714
70SHA1 (patch-ed) = ae922f591b871a1f427c4c32d76a2c25701382d4 70SHA1 (patch-ed) = ae922f591b871a1f427c4c32d76a2c25701382d4
 71SHA1 (patch-ee) = 02a9320b2f9e8d9cdb3837b74b7aa51080946d73
 72SHA1 (patch-ef) = d9ac38cca1105931db34927930984cc35c3cd833
 73SHA1 (patch-eg) = 82a92c2982c5a19df866323a2522703a166ba24e

cvs diff -r1.19 -r1.20 pkgsrc/www/firefox-gtk1/Attic/Makefile (expand / switch to unified diff)

--- pkgsrc/www/firefox-gtk1/Attic/Makefile 2007/05/31 07:25:09 1.19
+++ pkgsrc/www/firefox-gtk1/Attic/Makefile 2008/08/11 10:09:21 1.20
@@ -1,7 +1,8 @@ @@ -1,7 +1,8 @@
1# $NetBSD: Makefile,v 1.19 2007/05/31 07:25:09 ghen Exp $ 1# $NetBSD: Makefile,v 1.20 2008/08/11 10:09:21 martin Exp $
2 2
3MOZILLA= firefox-gtk1 3MOZILLA= firefox-gtk1
4COMMENT= Lightweight gecko-based web browser built with GTK+-1.x 4COMMENT= Lightweight gecko-based web browser built with GTK+-1.x
 5PKGREVISION= 1
5 6
6.include "../../www/firefox/Makefile-firefox.common" 7.include "../../www/firefox/Makefile-firefox.common"
7.include "../../mk/bsd.pkg.mk" 8.include "../../mk/bsd.pkg.mk"

File Added: pkgsrc/www/firefox/patches/Attic/patch-ee
$NetBSD: patch-ee,v 1.1 2008/08/11 10:09:21 martin Exp $

This is align.patch from https://bugzilla.mozilla.org/show_bug.cgi?id=161826
(https://bugzilla.mozilla.org/attachment.cgi?id=294965)

It is needed to make firefox work on CPUs requiring strict alignment.

(Part 1 of 3 [patch-ee .. patch-eg])

Index: intl/unicharutil/util/nsUnicharUtils.cpp
===================================================================
RCS file: /cvsroot/mozilla/intl/unicharutil/util/nsUnicharUtils.cpp,v
retrieving revision 1.27.8.1
diff -u -b -B -u -8 -p -r1.27.8.1 nsUnicharUtils.cpp
--- intl/unicharutil/util/nsUnicharUtils.cpp	22 Jun 2006 19:13:00 -0000	1.27.8.1
+++ intl/unicharutil/util/nsUnicharUtils.cpp	31 Dec 2007 16:07:40 -0000
@@ -343,8 +343,20 @@ ToUpperCase(PRUnichar aChar)
         if (aChar < 256)
             result = toupper(char(aChar));
         else
             result = aChar;
     }
     return result;
 }
 
+void
+SetUnichar(void *ptr, PRUnichar aChar)
+{
+#if NEED_STRICT_ALIGNMENT
+    *((char *) ptr) = *((char *) &aChar);
+    *((char *) ptr + 1) = *((char *) &aChar + 1);
+#else
+    *((PRUnichar *) ptr) = aChar;
+#endif
+}
+
+

File Added: pkgsrc/www/firefox/patches/Attic/patch-ef
$NetBSD: patch-ef,v 1.1 2008/08/11 10:09:21 martin Exp $

This is align.patch from https://bugzilla.mozilla.org/show_bug.cgi?id=161826
(https://bugzilla.mozilla.org/attachment.cgi?id=294965)

It is needed to make firefox work on CPUs requiring strict alignment.

(Part 2 of 3 [patch-ee .. patch-eg])

Index: intl/unicharutil/util/nsUnicharUtils.h
===================================================================
RCS file: /cvsroot/mozilla/intl/unicharutil/util/nsUnicharUtils.h,v
retrieving revision 1.19
diff -u -b -B -u -8 -p -r1.19 nsUnicharUtils.h
--- intl/unicharutil/util/nsUnicharUtils.h	24 Feb 2005 15:50:57 -0000	1.19
+++ intl/unicharutil/util/nsUnicharUtils.h	31 Dec 2007 16:07:40 -0000
@@ -77,16 +77,20 @@ inline PRBool CaseInsensitiveFindInReada
                         aHay.BeginReading(searchBegin),
                         aHay.EndReading(searchEnd),
                         nsCaseInsensitiveStringComparator());
 }
 
 PRUnichar ToUpperCase(PRUnichar);
 PRUnichar ToLowerCase(PRUnichar);
 
+#define NEED_STRICT_ALIGNMENT defined(__sparc__) || defined(__alpha__) || defined(__mips__)
+
+void SetUnichar(void *, PRUnichar);
+
 inline PRBool IsUpperCase(PRUnichar c) {
     return ToLowerCase(c) != c;
 }
 
 inline PRBool IsLowerCase(PRUnichar c) {
     return ToUpperCase(c) != c;
 }
 

File Added: pkgsrc/www/firefox/patches/Attic/patch-eg
$NetBSD: patch-eg,v 1.1 2008/08/11 10:09:21 martin Exp $

This is align.patch from https://bugzilla.mozilla.org/show_bug.cgi?id=161826
(https://bugzilla.mozilla.org/attachment.cgi?id=294965)

It is needed to make firefox work on CPUs requiring strict alignment.

(Part 3 of 3 [patch-ee .. patch-eg])

Index: layout/generic/nsTextFrame.cpp
===================================================================
RCS file: /cvsroot/mozilla/layout/generic/Attic/nsTextFrame.cpp,v
retrieving revision 1.513.4.17
diff -u -b -B -u -8 -p -r1.513.4.17 nsTextFrame.cpp
--- layout/generic/nsTextFrame.cpp	19 Sep 2007 01:45:40 -0000	1.513.4.17
+++ layout/generic/nsTextFrame.cpp	31 Dec 2007 16:07:41 -0000
@@ -5118,28 +5118,37 @@ struct TextRun {
     mSegments[mNumSegments].mIsWhitespace = aIsWhitespace;
     mTotalContentLen += aContentLen;
     mSegments[mNumSegments].mContentLen = PRUint32(mTotalContentLen);
     mNumSegments++;
   }
 };
 
 // Transforms characters in place from ascii to Unicode
-static void
+static PRUnichar *
 TransformTextToUnicode(char* aText, PRInt32 aNumChars)
 {
   // Go backwards over the characters and convert them.
   unsigned char*  cp1 = (unsigned char*)aText + aNumChars - 1;
-  PRUnichar*      cp2 = (PRUnichar*)aText + (aNumChars - 1);
+  PRUnichar*      cp2;
+  PRUnichar*      ret;
   
-  while (aNumChars-- > 0) {
-    // XXX: If you crash here then you may see the issue described
-    // in http://bugzilla.mozilla.org/show_bug.cgi?id=36146#c44
-    *cp2-- = PRUnichar(*cp1--);
-  }
+  if ((unsigned long) aText & 0x1)
+    cp2 = ((PRUnichar*)(aText + 1));
+  else
+    cp2 = (PRUnichar*)aText;
+  
+  ret = cp2;
+
+  cp2 += (aNumChars - 1);
+
+  while (aNumChars-- > 0)
+    SetUnichar(cp2--, PRUnichar(*cp1--));
+
+  return ret;
 }
  
 PRUint32
 nsTextFrame::EstimateNumChars(PRUint32 aAvailableWidth,
                               PRUint32 aAverageCharWidth)
 {
   // Estimate the number of characters that will fit. Use 105% of the available
   // width divided by the average character width.
@@ -5697,17 +5706,17 @@ nsTextFrame::MeasureText(nsPresContext* 
           PRUnichar* pWordBuf = lastWordPtr;
           PRUint32   wordBufLen = aTx.GetWordBufferLength() -
                                   (lastWordPtr - aTx.GetWordBuffer());
 
           if (aTx.TransformedTextIsAscii()) {
             // The text transform buffer contains ascii characters, so
             // transform it to Unicode
             NS_ASSERTION(wordBufLen >= PRUint32(lastWordLen), "no room to transform in place");
-            TransformTextToUnicode((char*)lastWordPtr, lastWordLen);
+            pWordBuf = TransformTextToUnicode((char*)lastWordPtr, lastWordLen);
           }
 
           // Look ahead in the text-run and compute the final word
           // width, taking into account any style changes and stopping
           // at the first breakable point.
           if (!aTextData.mMeasureText || (lastWordDimensions.width == -1)) {
             // We either didn't measure any text or we measured multiple words
             // at once so either way we don't know lastWordDimensions. We'll have to
@@ -6227,17 +6236,17 @@ nsTextFrame::TrimTrailingWhiteSpace(nsPr
 
 static void
 RevertSpacesToNBSP(PRUnichar* aBuffer, PRInt32 aWordLen)
 {
   PRUnichar* end = aBuffer + aWordLen;
   for (; aBuffer < end; aBuffer++) {
     PRUnichar ch = *aBuffer;
     if (ch == ' ') {
-      *aBuffer = CH_NBSP;
+      SetUnichar(aBuffer, CH_NBSP);
     }
   }
 }
 
 nsTextDimensions
 nsTextFrame::ComputeTotalWordDimensions(nsPresContext* aPresContext,
                                    nsILineBreaker* aLineBreaker,
                                    nsLineLayout& aLineLayout,