summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZhang Le <r0bertz@gentoo.org>2010-12-20 21:13:25 +0800
committerZhang Le <r0bertz@gentoo.org>2010-12-20 21:13:25 +0800
commit0b139a92ae2ea51793901c302e1d262e8b712636 (patch)
tree9717902776eb5714a5ea9fc151bc536a5745241c /net-libs
parentfixed binutils's mo confliction with gdb (diff)
downloadloongson-0b139a92ae2ea51793901c302e1d262e8b712636.tar.gz
loongson-0b139a92ae2ea51793901c302e1d262e8b712636.tar.bz2
loongson-0b139a92ae2ea51793901c302e1d262e8b712636.zip
added xulrunner-1.9.2.13, firefox-3.6.13 and xorg-server-1.9.2.902
Signed-off-by: Zhang Le <r0bertz@gentoo.org>
Diffstat (limited to 'net-libs')
-rw-r--r--net-libs/xulrunner/Manifest8
-rw-r--r--net-libs/xulrunner/files/bug-606109.patch48
-rw-r--r--net-libs/xulrunner/files/fix-animated-gifs.patch246
-rw-r--r--net-libs/xulrunner/files/xulrunner-1.9.2.13-mips-bus-error.patch24
-rw-r--r--net-libs/xulrunner/files/xulrunner-1.9.2.13-mips-n32.patch762
-rw-r--r--net-libs/xulrunner/files/xulrunner-1.9.2.13-mips-tls.patch30
-rw-r--r--net-libs/xulrunner/xulrunner-1.9.2.13.ebuild253
7 files changed, 1371 insertions, 0 deletions
diff --git a/net-libs/xulrunner/Manifest b/net-libs/xulrunner/Manifest
index da751b2..68ddaa8 100644
--- a/net-libs/xulrunner/Manifest
+++ b/net-libs/xulrunner/Manifest
@@ -5,7 +5,12 @@ AUX 1000_fix-system-sqlite.patch 868 RMD160 cfca12438e3e90d80908cb91a923e14e24c7
AUX 1009-armv4t-nanojit-v2.patch 12251 RMD160 9e9d862879d4897067605879245c1a6d50cf32fe SHA1 dcfe3da40dc822f2769e244571b721b59e59f322 SHA256 68c4df9c5313b93e8c5d7c7e8ed8375a88e9afa28c05e3965180058ba06cf05b
AUX 301-xulrunner-xpctools.diff 550 RMD160 12d370d5473de5c54233a70533cd35e37305ef86 SHA1 e3812ce6a4446b0b9d496a9dd4760d03bf0de449 SHA256 6bf510f7df5a41f47501cbdbcffc46d0c04865e3597dc6a575cd4a9cfae1def4
AUX README 145 RMD160 e6b6991f1dc429a081f6f16a0a7a24909c2ee576 SHA1 10e9be7039df62377a2e2ba8358beeceffbbbb07 SHA256 9b7fac0b4b5834c404c392bd34408eb3cbcfc75be6335395f44f8953adc102df
+AUX bug-606109.patch 1243 RMD160 ec262eed0480d8a13c914c4781329e3ea1c23b0f SHA1 0c0cc40ee0a663422b107cc3ae5d1412b8c45ac7 SHA256 266d9c7218cc04c3badadc54f8f31b1238326b9c3052aed057ffce40c69541dc
+AUX fix-animated-gifs.patch 7789 RMD160 a8889110a2daea27e07f92a70df6cb1e39e05546 SHA1 05b335feeefff4f06004a20182f821d998b44879 SHA256 6d85d3c103b0dcdbb073302a4041a37bea97c715384d04d299c1fb49a5da7443
AUX mxgot.patch 704 RMD160 34960622c2bd61336e077289c4473b189e4d0199 SHA1 173301a56c01d1458fd710dc511f9cb8e1437a5f SHA256 2ab115c54f76d4f146b283700548faf1b944c1491dd8a22217a7ed80c7fa42a7
+AUX xulrunner-1.9.2.13-mips-bus-error.patch 957 RMD160 fab47698b8e22205d5b43ee3a5268b5776b32663 SHA1 d4bc49bc1d4871ec2001e72825cdf1e0035fd2fa SHA256 609c10f9f35fe039a472e802af8628c89c796f8d257687f05f43fde846d1a109
+AUX xulrunner-1.9.2.13-mips-n32.patch 24738 RMD160 63995685e4343420469fbb056e051afd28cc56db SHA1 e6435e8e9b15db8103b6d6d0c9213ce36ec88f94 SHA256 24ac461bffbd7c2978a2cd30dc4cbed95370a77a2db054ade2794e902620d3de
+AUX xulrunner-1.9.2.13-mips-tls.patch 875 RMD160 04628d62a3107ffc13089a6eef5b8c714bfb1c99 SHA1 4f1f4bd2ecad56b67ed41c4f393a2c2e221850f5 SHA256 a39c1d5d278f2bbff49711b4a5d5b35c1b1892cfdf7fc5dd89becb23824bef92
AUX xulrunner-1.9.2.8-mips-bus-error.patch 957 RMD160 fab47698b8e22205d5b43ee3a5268b5776b32663 SHA1 d4bc49bc1d4871ec2001e72825cdf1e0035fd2fa SHA256 609c10f9f35fe039a472e802af8628c89c796f8d257687f05f43fde846d1a109
AUX xulrunner-1.9.2.8-mips-n32.patch 24738 RMD160 63995685e4343420469fbb056e051afd28cc56db SHA1 e6435e8e9b15db8103b6d6d0c9213ce36ec88f94 SHA256 24ac461bffbd7c2978a2cd30dc4cbed95370a77a2db054ade2794e902620d3de
AUX xulrunner-1.9.2.8-mips-tls.patch 875 RMD160 04628d62a3107ffc13089a6eef5b8c714bfb1c99 SHA1 4f1f4bd2ecad56b67ed41c4f393a2c2e221850f5 SHA256 a39c1d5d278f2bbff49711b4a5d5b35c1b1892cfdf7fc5dd89becb23824bef92
@@ -21,12 +26,15 @@ AUX xulrunner-mips-bus-error.patch 1997 RMD160 22b41e26d5ac86b53fc35c5a9220fd805
AUX xulrunner-mips-n32.patch 24732 RMD160 d5020c88801e6647131c6c2d780a90ccc0717c7a SHA1 37be69001a75f62d51e84b8b22f1946c27e8baa1 SHA256 5cce08d42a0cf629717b34ec0310b86080640ff6fe5bc14988d1b046562e7254
AUX xulrunner-mips-o32.patch 17598 RMD160 997add4cc1c0aa96c2484e860bb51441d5adb7e1 SHA1 e32d33007446db694ca5e61c853620970fe9d22e SHA256 9ce5a23a4d2582e48ae43a4cb414a7ce690e1cf029e24d0d5d93b8e301b41bc5
AUX xulrunner.conf 113 RMD160 8be48cf5040eb5753c8eb35c048cc6b2c1a8a057 SHA1 62cce7ee5b1e51343c3dbc388894011da913d9d4 SHA256 9ac56b42cfb48854d23c299330ad327af5f0815140dcb7fdee905b660cd9a8a3
+DIST firefox-3.6.13.source.tar.bz2 51478675 RMD160 658409db60a8f412ac74ff15a8c1d8c4ed85b71e SHA1 1d1bc70d651bce4006687f5762638563c0494267 SHA256 4b90775c0f29cb7e170a80894311d8c7a2cd794c50e2124b70d1b83011c45f63
DIST firefox-3.6.8.source.tar.bz2 51238976 RMD160 14e245c643d41a1da25fe4dbc15d6ae466a19e5b SHA1 4936e543f6c7492c5954cbd5b30ddda6b20e3797 SHA256 fc609cc6a0ddaa2a9ebd8511ec39ae4a404e1107a12e07b233e2afca51d9a10e
DIST firefox-3.7a5.source.tar.bz2 50425212 RMD160 aa8874224fc080897d5de3c61adff83b9e91bb7c SHA1 6e71e59898baa5d8a9c51ad354accc02fa0ca46a SHA256 38644edc35d922a6cfb1c7ebc27dfb75d5a9bf870fa19d06821e1a9131b33b2d
DIST firefox-4.0b5_pre_414ff9016349.source.tar.bz2 62665981 RMD160 2a1ee9e1b8596f6ec84e3658cb671bec4ebed969 SHA1 bead1813f2b78885aa83556c2be458b3dbae8d1d SHA256 30eac26556c1d39b960afba86bf842aa76580510a57b99431e9120dbdc04a3e1
DIST xulrunner-1.9.2-patches-0.6.tar.bz2 16308 RMD160 6066ea0b01f8b6c9eae1a0692ad9a07f04ab7327 SHA1 ebba861e23ef36256dc29d7d04820222be8e4241 SHA256 6a9d709f9ee15d6c139a35f8a6826cd7b473188290bd5e81e56297d8f36e2235
+DIST xulrunner-1.9.2-patches-0.9.tar.bz2 15320 RMD160 2dfb86650c0a9a1f0c5bf86df7434c7c286658d6 SHA1 a2276c708eec2e92611ac1e7a2eaf25c39263d30 SHA256 5cca685442f1ab920eb1ba86719a38a437ae05bd5cefc42ababc2556425ebf5a
DIST xulrunner-1.9.3-patches-0.1.tar.bz2 4761 RMD160 d13fa5e53235fbe4eba50f210107b352530d95ab SHA1 78904c4543eb27717131d159e8ef02762e94c6f7 SHA256 fab399d174e6959afb998446e152f1da41575058afb40e9c442cfa804de326fc
DIST xulrunner-2.0-patches-0.4.tar.bz2 6121 RMD160 4bb2a879632894a4185c7c778fbf80a6c80f6847 SHA1 139af0b2fabe4f2c46bda27c9e29f7dd2731c6a3 SHA256 606e9f9b44e6ce61035047e58f4c0dc8e4dc6c67b1d159a0623212dedc50c4b9
+EBUILD xulrunner-1.9.2.13.ebuild 8110 RMD160 a19351d61fa537b0b90c36dbb048915d8a8f6ebd SHA1 7b586c0456b5e6ac11089634b3bf9a9282a14a27 SHA256 f3c6882464edf0902b34d172ef8f014f0242b317a2e9299c300c2b188a5f3a49
EBUILD xulrunner-1.9.2.8-r1.ebuild 8213 RMD160 5c8d817c91155e4bbd8763bbd0d99b8ca78cdc93 SHA1 5292e24359386e503b4b3a1e3ecb7cbac3754bbe SHA256 716743ab7bf42421333843adf5a75b23109ae142519a0fb85fda87a4a94a6923
EBUILD xulrunner-1.9.3_alpha5.ebuild 6811 RMD160 3ac0a6d11b664b0a77b80164e640469c770ed089 SHA1 35bac75d31b1927848235e4d60d993edf487d7cb SHA256 a3a229d9d24b51641b5d2e8e9819766cc1b3ebc19b0827210e87857a9a609dc7
EBUILD xulrunner-2.0_beta5_pre-r2.ebuild 8139 RMD160 bd837f2c4696444398b0a7aae93d5d8172a33c5e SHA1 f03c08dbdf05005dbd5011121dd68f97238cbe92 SHA256 bc7d175790269a8699bb7cd3c3eb9947f9e63e033a1076b3af7c0a7940fc1f6c
diff --git a/net-libs/xulrunner/files/bug-606109.patch b/net-libs/xulrunner/files/bug-606109.patch
new file mode 100644
index 0000000..93f1142
--- /dev/null
+++ b/net-libs/xulrunner/files/bug-606109.patch
@@ -0,0 +1,48 @@
+# HG changeset patch
+# User Jory A. Pratt <anarchy@gentoo.org>
+# Parent 74e4421e0a30c6e21b594675e32a8d9d663c309c
+Add missing ifde MOZ_MEDIA
+
+diff --git a/content/base/src/nsContentSink.cpp b/content/base/src/nsContentSink.cpp
+--- a/content/base/src/nsContentSink.cpp
++++ b/content/base/src/nsContentSink.cpp
+@@ -1860,17 +1860,19 @@ nsIAtom** const kDefaultAllowedTags [] =
+ &nsGkAtoms::nobr,
+ &nsGkAtoms::noscript,
+ &nsGkAtoms::ol,
+ &nsGkAtoms::optgroup,
+ &nsGkAtoms::option,
+ &nsGkAtoms::output,
+ &nsGkAtoms::p,
+ &nsGkAtoms::pre,
++#ifdef MOZ_MEDIA
+ &nsGkAtoms::progress,
++#endif
+ &nsGkAtoms::q,
+ &nsGkAtoms::rp,
+ &nsGkAtoms::rt,
+ &nsGkAtoms::ruby,
+ &nsGkAtoms::s,
+ &nsGkAtoms::samp,
+ &nsGkAtoms::section,
+ &nsGkAtoms::select,
+@@ -1952,17 +1954,19 @@ nsIAtom** const kDefaultAllowedAttribute
+ &nsGkAtoms::itemref,
+ &nsGkAtoms::itemscope,
+ &nsGkAtoms::itemtype,
+ &nsGkAtoms::kind,
+ &nsGkAtoms::label,
+ &nsGkAtoms::lang,
+ &nsGkAtoms::list,
+ &nsGkAtoms::longdesc,
++#ifdef MOZ_MEDIA
+ &nsGkAtoms::loop,
++#endif
+ &nsGkAtoms::low,
+ &nsGkAtoms::max,
+ &nsGkAtoms::maxlength,
+ &nsGkAtoms::media,
+ &nsGkAtoms::min,
+ &nsGkAtoms::mozdonotsend,
+ &nsGkAtoms::method,
+ &nsGkAtoms::multiple,
diff --git a/net-libs/xulrunner/files/fix-animated-gifs.patch b/net-libs/xulrunner/files/fix-animated-gifs.patch
new file mode 100644
index 0000000..58b994c
--- /dev/null
+++ b/net-libs/xulrunner/files/fix-animated-gifs.patch
@@ -0,0 +1,246 @@
+# HG changeset patch
+# User Rafał Mużyło <galtgendo@o2.pl>
+# Parent 69e253891ca3839b6d4b8f5cb7c0e6950bb66902
+Fix animated gif flickering bug 597174
+
+diff --git a/modules/libpr0n/decoders/gif/nsGIFDecoder2.cpp b/modules/libpr0n/decoders/gif/nsGIFDecoder2.cpp
+--- a/modules/libpr0n/decoders/gif/nsGIFDecoder2.cpp
++++ b/modules/libpr0n/decoders/gif/nsGIFDecoder2.cpp
+@@ -197,30 +197,29 @@ static NS_METHOD ReadDataOut(nsIInputStr
+ }
+
+ // Push any new rows according to mCurrentPass/mLastFlushedPass and
+ // mCurrentRow/mLastFlushedRow. Note: caller is responsible for
+ // updating mlastFlushed{Row,Pass}.
+ nsresult
+ nsGIFDecoder2::FlushImageData(PRUint32 fromRow, PRUint32 rows)
+ {
+- nsIntRect r(0, fromRow, mGIFStruct.width, rows);
++ nsIntRect r(mGIFStruct.x_offset, mGIFStruct.y_offset + fromRow, mGIFStruct.width, rows);
+
+ // Update image
+ nsresult rv = mImageContainer->FrameUpdated(mGIFStruct.images_decoded, r);
+ if (NS_FAILED(rv)) {
+ return rv;
+ }
+
+ // Offset to the frame position
+ // Only notify observer(s) for first frame
+ if (!mGIFStruct.images_decoded && mObserver) {
+ PRUint32 imgCurFrame;
+ mImageContainer->GetCurrentFrameIndex(&imgCurFrame);
+- r.y += mGIFStruct.y_offset;
+ mObserver->OnDataAvailable(nsnull, imgCurFrame == PRUint32(mGIFStruct.images_decoded), &r);
+ }
+ return NS_OK;
+ }
+
+ nsresult
+ nsGIFDecoder2::FlushImageData()
+ {
+diff --git a/modules/libpr0n/src/imgContainer.cpp b/modules/libpr0n/src/imgContainer.cpp
+--- a/modules/libpr0n/src/imgContainer.cpp
++++ b/modules/libpr0n/src/imgContainer.cpp
+@@ -415,16 +415,18 @@ nsresult imgContainer::InternalAddFrameH
+
+ nsAutoPtr<imgFrame> frame(aFrame);
+
+ if (paletteData && paletteLength)
+ frame->GetPaletteData(paletteData, paletteLength);
+
+ frame->GetImageData(imageData, imageLength);
+
++ frame->LockImageData();
++
+ mFrames.InsertElementAt(framenum, frame.forget());
+ mNumFrames++;
+
+ return NS_OK;
+ }
+
+ nsresult imgContainer::InternalAddFrame(PRUint32 framenum,
+ PRInt32 aX, PRInt32 aY,
+@@ -440,16 +442,21 @@ nsresult imgContainer::InternalAddFrame(
+ return NS_ERROR_INVALID_ARG;
+
+ nsAutoPtr<imgFrame> frame(new imgFrame());
+ NS_ENSURE_TRUE(frame, NS_ERROR_OUT_OF_MEMORY);
+
+ nsresult rv = frame->Init(aX, aY, aWidth, aHeight, aFormat, aPaletteDepth);
+ NS_ENSURE_SUCCESS(rv, rv);
+
++ if (mFrames.Length() > 0) {
++ imgFrame *prevframe = mFrames.ElementAt(mFrames.Length() - 1);
++ prevframe->UnlockImageData();
++ }
++
+ if (mFrames.Length() == 0) {
+ return InternalAddFrameHelper(framenum, frame.forget(), imageData, imageLength,
+ paletteData, paletteLength);
+ }
+
+ if (mFrames.Length() == 1) {
+ // Since we're about to add our second frame, initialize animation stuff
+ if (!ensureAnimExists())
+diff --git a/modules/libpr0n/src/imgFrame.cpp b/modules/libpr0n/src/imgFrame.cpp
+--- a/modules/libpr0n/src/imgFrame.cpp
++++ b/modules/libpr0n/src/imgFrame.cpp
+@@ -152,16 +152,17 @@ imgFrame::imgFrame() :
+ mBlendMethod(1), /* imgIContainer::kBlendOver */
+ mSinglePixel(PR_FALSE),
+ mNeverUseDeviceSurface(PR_FALSE),
+ mFormatChanged(PR_FALSE),
+ mCompositingFailed(PR_FALSE)
+ #ifdef USE_WIN_SURFACE
+ , mIsDDBSurface(PR_FALSE)
+ #endif
++ , mLocked(PR_FALSE)
+ {
+ static PRBool hasCheckedOptimize = PR_FALSE;
+ if (!hasCheckedOptimize) {
+ if (PR_GetEnv("MOZ_DISABLE_IMAGE_OPTIMIZE")) {
+ gDisableOptimize = PR_TRUE;
+ }
+ hasCheckedOptimize = PR_TRUE;
+ }
+@@ -413,18 +414,17 @@ void imgFrame::Draw(gfxContext *aContext
+ nsRefPtr<gfxASurface> surface;
+ gfxImageSurface::gfxImageFormat format;
+
+ NS_ASSERTION(!sourceRect.Intersect(subimage).IsEmpty(),
+ "We must be allowed to sample *some* source pixels!");
+
+ PRBool doTile = !imageRect.Contains(sourceRect);
+ if (doPadding || doPartialDecode) {
+- gfxRect available = gfxRect(mDecoded.x, mDecoded.y, mDecoded.width, mDecoded.height) +
+- gfxPoint(aPadding.left, aPadding.top);
++ gfxRect available = gfxRect(mDecoded.x, mDecoded.y, mDecoded.width, mDecoded.height);
+
+ if (!doTile && !mSinglePixel) {
+ // Not tiling, and we have a surface, so we can account for
+ // padding and/or a partial decode just by twiddling parameters.
+ // First, update our user-space fill rect.
+ sourceRect = sourceRect.Intersect(available);
+ gfxMatrix imageSpaceToUserSpace = userSpaceToImageSpace;
+ imageSpaceToUserSpace.Invert();
+@@ -708,17 +708,17 @@ nsresult imgFrame::ImageUpdated(const ns
+ mem->IsLowMemory(&lowMemory);
+ if (lowMemory)
+ return NS_ERROR_OUT_OF_MEMORY;
+
+ mDecoded.UnionRect(mDecoded, aUpdateRect);
+
+ // clamp to bounds, in case someone sends a bogus updateRect (I'm looking at
+ // you, gif decoder)
+- nsIntRect boundsRect(0, 0, mSize.width, mSize.height);
++ nsIntRect boundsRect(mOffset, mSize);
+ mDecoded.IntersectRect(mDecoded, boundsRect);
+
+ #ifdef XP_MACOSX
+ if (mQuartzSurface)
+ mQuartzSurface->Flush();
+ #endif
+ return NS_OK;
+ }
+@@ -806,17 +806,23 @@ void imgFrame::GetPaletteData(PRUint32 *
+ *aPalette = (PRUint32 *) mPalettedImageData;
+ *length = PaletteDataLength();
+ }
+ }
+
+ nsresult imgFrame::LockImageData()
+ {
+ if (mPalettedImageData)
+- return NS_OK;
++ return NS_ERROR_NOT_AVAILABLE;
++
++ NS_ABORT_IF_FALSE(!mLocked, "Trying to lock already locked image data.");
++ if (mLocked) {
++ return NS_ERROR_FAILURE;
++ }
++ mLocked = PR_TRUE;
+
+ if ((mOptSurface || mSinglePixel) && !mImageSurface) {
+ // Recover the pixels
+ mImageSurface = new gfxImageSurface(gfxIntSize(mSize.width, mSize.height),
+ gfxImageSurface::ImageFormatARGB32);
+ if (!mImageSurface || mImageSurface->CairoStatus())
+ return NS_ERROR_OUT_OF_MEMORY;
+
+@@ -832,23 +838,35 @@ nsresult imgFrame::LockImageData()
+ #ifdef USE_WIN_SURFACE
+ mWinSurface = nsnull;
+ #endif
+ #ifdef XP_MACOSX
+ mQuartzSurface = nsnull;
+ #endif
+ }
+
++ if (mImageSurface)
++ mImageSurface->Flush();
++
+ return NS_OK;
+ }
+
+ nsresult imgFrame::UnlockImageData()
+ {
+ if (mPalettedImageData)
+- return NS_OK;
++ return NS_ERROR_NOT_AVAILABLE;
++
++ NS_ABORT_IF_FALSE(mLocked, "Unlocking an unlocked image!");
++ if (!mLocked) {
++ return NS_ERROR_FAILURE;
++ }
++ mLocked = PR_FALSE;
++
++ if (mImageSurface)
++ mImageSurface->MarkDirty();
+
+ #ifdef XP_MACOSX
+ if (mQuartzSurface)
+ mQuartzSurface->Flush();
+ #endif
+ return NS_OK;
+ }
+
+@@ -895,17 +913,17 @@ PRInt32 imgFrame::GetBlendMethod() const
+
+ void imgFrame::SetBlendMethod(PRInt32 aBlendMethod)
+ {
+ mBlendMethod = (PRInt8)aBlendMethod;
+ }
+
+ PRBool imgFrame::ImageComplete() const
+ {
+- return mDecoded == nsIntRect(0, 0, mSize.width, mSize.height);
++ return mDecoded == nsIntRect(mOffset, mSize);
+ }
+
+ // A hint from the image decoders that this image has no alpha, even
+ // though we created is ARGB32. This changes our format to RGB24,
+ // which in turn will cause us to Optimize() to RGB24. Has no effect
+ // after Optimize() is called, though in all cases it will be just a
+ // performance win -- the pixels are still correct and have the A byte
+ // set to 0xff.
+diff --git a/modules/libpr0n/src/imgFrame.h b/modules/libpr0n/src/imgFrame.h
+--- a/modules/libpr0n/src/imgFrame.h
++++ b/modules/libpr0n/src/imgFrame.h
+@@ -167,16 +167,17 @@ private: // data
+
+ gfxASurface::gfxImageFormat mFormat;
+ PRInt8 mPaletteDepth;
+ PRInt8 mBlendMethod;
+ PRPackedBool mSinglePixel;
+ PRPackedBool mNeverUseDeviceSurface;
+ PRPackedBool mFormatChanged;
+ PRPackedBool mCompositingFailed;
++ PRPackedBool mLocked;
+
+ #ifdef XP_WIN
+ PRPackedBool mIsDDBSurface;
+ #endif
+
+ };
+
+ #endif /* imgFrame_h */
diff --git a/net-libs/xulrunner/files/xulrunner-1.9.2.13-mips-bus-error.patch b/net-libs/xulrunner/files/xulrunner-1.9.2.13-mips-bus-error.patch
new file mode 100644
index 0000000..2bf51d7
--- /dev/null
+++ b/net-libs/xulrunner/files/xulrunner-1.9.2.13-mips-bus-error.patch
@@ -0,0 +1,24 @@
+--- ./xpcom/glue/nsTArray.h.orig 2009-04-26 01:21:58.000000000 +0800
++++ ./xpcom/glue/nsTArray.h 2009-04-26 01:21:33.000000000 +0800
+@@ -168,6 +168,7 @@
+
+ // The array's elements (prefixed with a Header). This pointer is never
+ // null. If the array is empty, then this will point to sEmptyHdr.
++ void *padding;
+ Header *mHdr;
+ };
+
+diff --git a/layout/svg/base/src/nsSVGGlyphFrame.cpp b/layout/svg/base/src/nsSVGGlyphFrame.cpp
+index 6d452d0..3ce4193 100644
+--- a/layout/svg/base/src/nsSVGGlyphFrame.cpp
++++ b/layout/svg/base/src/nsSVGGlyphFrame.cpp
+@@ -169,8 +169,8 @@ private:
+ PRBool SetupForDirectTextRun(gfxContext *aContext, float aScale);
+ void SetupFor(gfxContext *aContext, float aScale);
+
+- nsSVGGlyphFrame *mSource;
+ nsAutoTArray<CharacterPosition,80> mPositions;
++ nsSVGGlyphFrame *mSource;
+ gfxMatrix mInitialMatrix;
+ // Textrun advance width from start to mCurrentChar, in appunits
+ gfxFloat mCurrentAdvance;
diff --git a/net-libs/xulrunner/files/xulrunner-1.9.2.13-mips-n32.patch b/net-libs/xulrunner/files/xulrunner-1.9.2.13-mips-n32.patch
new file mode 100644
index 0000000..c1a415d
--- /dev/null
+++ b/net-libs/xulrunner/files/xulrunner-1.9.2.13-mips-n32.patch
@@ -0,0 +1,762 @@
+From 1aa3577cf7e79b574bd2cff058ea00221194869b Mon Sep 17 00:00:00 2001
+From: Zhang Le <r0bertz@gentoo.org>
+Date: Thu, 12 Mar 2009 02:24:34 +0800
+Subject: [PATCH 2/2] xulrunner mips n32 ABI patch
+
+Signed-off-by: Zhang Le <r0bertz@gentoo.org>
+---
+ xpcom/reflect/xptcall/src/md/unix/Makefile.in | 5 +
+ .../xptcall/src/md/unix/xptcinvoke_asm_mips64.s | 159 ++++++++++++++
+ .../xptcall/src/md/unix/xptcinvoke_mips64.cpp | 173 ++++++++++++++++
+ .../xptcall/src/md/unix/xptcstubs_asm_mips64.s | 149 +++++++++++++
+ .../xptcall/src/md/unix/xptcstubs_mips64.cpp | 218 ++++++++++++++++++++
+ 5 files changed, 704 insertions(+), 0 deletions(-)
+ create mode 100644 xpcom/reflect/xptcall/src/md/unix/xptcinvoke_asm_mips64.s
+ create mode 100644 xpcom/reflect/xptcall/src/md/unix/xptcinvoke_mips64.cpp
+ create mode 100644 xpcom/reflect/xptcall/src/md/unix/xptcstubs_asm_mips64.s
+ create mode 100644 xpcom/reflect/xptcall/src/md/unix/xptcstubs_mips64.cpp
+
+diff --git a/xpcom/reflect/xptcall/src/md/unix/Makefile.in b/xpcom/reflect/xptcall/src/md/unix/Makefile.in
+index 524174e..63586cf 100644
+--- a/xpcom/reflect/xptcall/src/md/unix/Makefile.in
++++ b/xpcom/reflect/xptcall/src/md/unix/Makefile.in
+@@ -274,8 +274,13 @@ endif
+
+ ifeq ($(OS_ARCH),Linux)
+ ifneq (,$(findstring mips, $(OS_TEST)))
++ifneq (,$(findstring mips64, $(OS_TEST)))
++CPPSRCS := xptcinvoke_mips64.cpp xptcstubs_mips64.cpp
++ASFILES := xptcinvoke_asm_mips64.s xptcstubs_asm_mips64.s
++else
+ CPPSRCS := xptcinvoke_mips.cpp xptcstubs_mips.cpp
+ ASFILES := xptcinvoke_asm_mips.s xptcstubs_asm_mips.s
++endif
+ ASFLAGS += -I$(DIST)/include -x assembler-with-cpp
+ endif
+ endif
+diff --git a/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_asm_mips64.s b/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_asm_mips64.s
+new file mode 100644
+index 0000000..f146ad8
+--- /dev/null
++++ b/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_asm_mips64.s
+@@ -0,0 +1,159 @@
++/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
++/* ***** BEGIN LICENSE BLOCK *****
++ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
++ *
++ * The contents of this file are subject to the Mozilla Public License Version
++ * 1.1 (the "License"); you may not use this file except in compliance with
++ * the License. You may obtain a copy of the License at
++ * http://www.mozilla.org/MPL/
++ *
++ * Software distributed under the License is distributed on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
++ * for the specific language governing rights and limitations under the
++ * License.
++ *
++ * The Original Code is mozilla.org code.
++ *
++ * The Initial Developer of the Original Code is
++ * Netscape Communications Corporation.
++ * Portions created by the Initial Developer are Copyright (C) 1998
++ * the Initial Developer. All Rights Reserved.
++ *
++ * Contributor(s):
++ * ZHANG Le <r0bertz@gentoo.org>
++ *
++ * Alternatively, the contents of this file may be used under the terms of
++ * either of the GNU General Public License Version 2 or later (the "GPL"),
++ * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
++ * in which case the provisions of the GPL or the LGPL are applicable instead
++ * of those above. If you wish to allow use of your version of this file only
++ * under the terms of either the GPL or the LGPL, and not to allow others to
++ * use your version of this file under the terms of the MPL, indicate your
++ * decision by deleting the provisions above and replace them with the notice
++ * and other provisions required by the GPL or the LGPL. If you do not delete
++ * the provisions above, a recipient may use your version of this file under
++ * the terms of any one of the MPL, the GPL or the LGPL.
++ *
++ * ***** END LICENSE BLOCK ***** */
++#include <sys/regdef.h>
++#include <sys/asm.h>
++
++.text
++.globl invoke_count_words
++.globl invoke_copy_to_stack
++
++LOCALSZ=7 # a0, a1, a2, a3, s0, ra, gp
++FRAMESZ=(((NARGSAVE+LOCALSZ)*SZREG)+ALSZ)&ALMASK
++
++RAOFF=FRAMESZ-(1*SZREG)
++A0OFF=FRAMESZ-(2*SZREG)
++A1OFF=FRAMESZ-(3*SZREG)
++A2OFF=FRAMESZ-(4*SZREG)
++A3OFF=FRAMESZ-(5*SZREG)
++S0OFF=FRAMESZ-(6*SZREG)
++GPOFF=FRAMESZ-(7*SZREG)
++
++#
++# _NS_InvokeByIndex_P(that, methodIndex, paramCount, params)
++# a0 a1 a2 a3
++
++NESTED(_NS_InvokeByIndex_P, FRAMESZ, ra)
++ PTR_SUBU sp, FRAMESZ
++ SETUP_GP64(GPOFF, _NS_InvokeByIndex_P)
++
++ REG_S ra, RAOFF(sp)
++ REG_S a0, A0OFF(sp)
++ REG_S a1, A1OFF(sp)
++ REG_S a2, A2OFF(sp)
++ REG_S a3, A3OFF(sp)
++ REG_S s0, S0OFF(sp)
++
++ # invoke_count_words(paramCount, params)
++ move a0, a2
++ move a1, a3
++ jal invoke_count_words
++
++ # invoke_copy_to_stack(PRUint32* d, PRUint32 paramCount,
++ # nsXPTCVariant* s, PRUint32 *reg)
++
++ REG_L a1, A2OFF(sp) # a1 - paramCount
++ REG_L a2, A3OFF(sp) # a2 - params
++
++ # save sp before we copy the params to the stack
++ move t0, sp
++
++ # assume full size of 16 bytes per param to be safe
++ sll v0, 4 # 16 bytes * num params
++ subu sp, sp, v0 # make room
++ move a0, sp # a0 - param stack address
++
++ # create temporary stack space to write int and fp regs
++ subu sp, 64 # 64 = 8 regs of 8 bytes
++ move a3, sp
++
++ # save the old sp and save the arg stack
++ subu sp, sp, 16
++ REG_S t0, 0(sp)
++ REG_S a0, 8(sp)
++
++ # copy the param into the stack areas
++ jal invoke_copy_to_stack
++
++ REG_L t3, 8(sp) # get previous a0
++ REG_L sp, 0(sp) # get orig sp back
++
++ REG_L a0, A0OFF(sp) # a0 - that
++ REG_L a1, A1OFF(sp) # a1 - methodIndex
++
++ # t1 = methodIndex * pow(2, PTRLOG)
++ # (use shift instead of mult)
++ sll t1, a1, PTRLOG
++
++ # calculate the function we need to jump to,
++ # which must then be saved in t9
++ lw t9, 0(a0)
++ addu t9, t9, t1
++#if defined(__GXX_ABI_VERSION) && __GXX_ABI_VERSION >= 100 /* G++ V3 ABI */
++ lw t9, (t9)
++#else /* not G++ V3 ABI */
++ lw t9, 2*PTRSIZE(t9)
++#endif /* G++ V3 ABI */
++
++ # get register save area from invoke_copy_to_stack
++ subu t1, t3, 64
++
++ # a1..a7 and f13..f19 should now be set to what
++ # invoke_copy_to_stack told us. skip a0 and f12
++ # because that's the "this" pointer
++
++ REG_L a1, 0(t1)
++ REG_L a2, 8(t1)
++ REG_L a3, 16(t1)
++ REG_L a4, 24(t1)
++ REG_L a5, 32(t1)
++ REG_L a6, 40(t1)
++ REG_L a7, 48(t1)
++
++ l.d $f13, 0(t1)
++ l.d $f14, 8(t1)
++ l.d $f15, 16(t1)
++ l.d $f16, 24(t1)
++ l.d $f17, 32(t1)
++ l.d $f18, 40(t1)
++ l.d $f19, 48(t1)
++
++ # save away our stack pointer and create
++ # the stack pointer for the function
++ move s0, sp
++ move sp, t3
++
++ jalr t9
++
++ move sp, s0
++
++ RESTORE_GP64
++ REG_L ra, RAOFF(sp)
++ REG_L s0, S0OFF(sp)
++ PTR_ADDU sp, FRAMESZ
++ j ra
++.end _NS_InvokeByIndex_P
+diff --git a/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_mips64.cpp b/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_mips64.cpp
+new file mode 100644
+index 0000000..d1d1a7d
+--- /dev/null
++++ b/xpcom/reflect/xptcall/src/md/unix/xptcinvoke_mips64.cpp
+@@ -0,0 +1,173 @@
++/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
++/* ***** BEGIN LICENSE BLOCK *****
++ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
++ *
++ * The contents of this file are subject to the Mozilla Public License Version
++ * 1.1 (the "License"); you may not use this file except in compliance with
++ * the License. You may obtain a copy of the License at
++ * http://www.mozilla.org/MPL/
++ *
++ * Software distributed under the License is distributed on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
++ * for the specific language governing rights and limitations under the
++ * License.
++ *
++ * The Original Code is mozilla.org code.
++ *
++ * The Initial Developer of the Original Code is
++ * Netscape Communications Corporation.
++ * Portions created by the Initial Developer are Copyright (C) 1998
++ * the Initial Developer. All Rights Reserved.
++ *
++ * Contributor(s):
++ * ZHANG Le <r0bertz@gentoo.org>
++ *
++ * Alternatively, the contents of this file may be used under the terms of
++ * either of the GNU General Public License Version 2 or later (the "GPL"),
++ * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
++ * in which case the provisions of the GPL or the LGPL are applicable instead
++ * of those above. If you wish to allow use of your version of this file only
++ * under the terms of either the GPL or the LGPL, and not to allow others to
++ * use your version of this file under the terms of the MPL, indicate your
++ * decision by deleting the provisions above and replace them with the notice
++ * and other provisions required by the GPL or the LGPL. If you do not delete
++ * the provisions above, a recipient may use your version of this file under
++ * the terms of any one of the MPL, the GPL or the LGPL.
++ *
++ * ***** END LICENSE BLOCK ***** */
++
++/* Platform specific code to invoke XPCOM methods on native objects */
++
++#include "xptcprivate.h"
++
++#if (_MIPS_SIM != _ABIN32)
++#error "This code is for MIPS N32 only"
++#endif
++
++extern "C" uint32
++invoke_count_words(PRUint32 paramCount, nsXPTCVariant* s)
++{
++ return paramCount;
++}
++
++extern "C" void
++invoke_copy_to_stack(PRUint64* d, PRUint32 paramCount,
++ nsXPTCVariant* s, PRUint64 *regs)
++{
++#define N_ARG_REGS 7 /* 8 regs minus 1 for "this" ptr */
++
++ for (PRUint32 i = 0; i < paramCount; i++, s++)
++ {
++ if (s->IsPtrData()) {
++ if (i < N_ARG_REGS)
++ regs[i] = (PRUint64)s->ptr;
++ else
++ *d++ = (PRUint64)s->ptr;
++ continue;
++ }
++ switch (s->type) {
++ //
++ // signed types first
++ //
++ case nsXPTType::T_I8:
++ if (i < N_ARG_REGS)
++ ((PRInt64*)regs)[i] = s->val.i8;
++ else
++ *d++ = s->val.i8;
++ break;
++ case nsXPTType::T_I16:
++ if (i < N_ARG_REGS)
++ ((PRInt64*)regs)[i] = s->val.i16;
++ else
++ *d++ = s->val.i16;
++ break;
++ case nsXPTType::T_I32:
++ if (i < N_ARG_REGS)
++ ((PRInt64*)regs)[i] = s->val.i32;
++ else
++ *d++ = s->val.i32;
++ break;
++ case nsXPTType::T_I64:
++ if (i < N_ARG_REGS)
++ ((PRInt64*)regs)[i] = s->val.i64;
++ else
++ *d++ = s->val.i64;
++ break;
++ //
++ // unsigned types next
++ //
++ case nsXPTType::T_U8:
++ if (i < N_ARG_REGS)
++ regs[i] = s->val.u8;
++ else
++ *d++ = s->val.u8;
++ break;
++ case nsXPTType::T_U16:
++ if (i < N_ARG_REGS)
++ regs[i] = s->val.u16;
++ else
++ *d++ = s->val.u16;
++ break;
++ case nsXPTType::T_U32:
++ if (i < N_ARG_REGS)
++ regs[i] = s->val.u32;
++ else
++ *d++ = s->val.u32;
++ break;
++ case nsXPTType::T_U64:
++ if (i < N_ARG_REGS)
++ regs[i] = s->val.u64;
++ else
++ *d++ = s->val.u64;
++ break;
++ case nsXPTType::T_FLOAT:
++ if (i < N_ARG_REGS)
++ *(float*)&regs[i] = s->val.f;
++ else
++ *(float*)d++ = s->val.f;
++ break;
++ case nsXPTType::T_DOUBLE:
++ if (i < N_ARG_REGS)
++ *(double*)&regs[i] = s->val.d;
++ else
++ *(double*)d++ = s->val.d;
++ break;
++ case nsXPTType::T_BOOL:
++ if (i < N_ARG_REGS)
++ regs[i] = s->val.b;
++ else
++ *d++ = s->val.b;
++ break;
++ case nsXPTType::T_CHAR:
++ if (i < N_ARG_REGS)
++ regs[i] = s->val.c;
++ else
++ *d++ = s->val.c;
++ break;
++ case nsXPTType::T_WCHAR:
++ if (i < N_ARG_REGS)
++ regs[i] = s->val.wc;
++ else
++ *d++ = s->val.wc;
++ break;
++ default:
++ // all the others are plain pointer types
++ if (i < N_ARG_REGS)
++ regs[i] = (PRUint64)s->val.p;
++ else
++ *d++ = (PRUint64)s->val.p;
++ break;
++ }
++ }
++}
++
++extern "C" nsresult _NS_InvokeByIndex_P(nsISupports* that, PRUint32 methodIndex,
++ PRUint32 paramCount,
++ nsXPTCVariant* params);
++
++EXPORT_XPCOM_API(nsresult)
++NS_InvokeByIndex_P(nsISupports* that, PRUint32 methodIndex,
++ PRUint32 paramCount, nsXPTCVariant* params)
++{
++ return _NS_InvokeByIndex_P(that, methodIndex, paramCount, params);
++}
+diff --git a/xpcom/reflect/xptcall/src/md/unix/xptcstubs_asm_mips64.s b/xpcom/reflect/xptcall/src/md/unix/xptcstubs_asm_mips64.s
+new file mode 100644
+index 0000000..dfee24b
+--- /dev/null
++++ b/xpcom/reflect/xptcall/src/md/unix/xptcstubs_asm_mips64.s
+@@ -0,0 +1,149 @@
++/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
++/* ***** BEGIN LICENSE BLOCK *****
++ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
++ *
++ * The contents of this file are subject to the Mozilla Public License Version
++ * 1.1 (the "License"); you may not use this file except in compliance with
++ * the License. You may obtain a copy of the License at
++ * http://www.mozilla.org/MPL/
++ *
++ * Software distributed under the License is distributed on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
++ * for the specific language governing rights and limitations under the
++ * License.
++ *
++ * The Original Code is mozilla.org code.
++ *
++ * The Initial Developer of the Original Code is
++ * Netscape Communications Corporation.
++ * Portions created by the Initial Developer are Copyright (C) 1998
++ * the Initial Developer. All Rights Reserved.
++ *
++ * Contributor(s):
++ * ZHANG Le <r0bertz@gentoo.org>
++ *
++ * Alternatively, the contents of this file may be used under the terms of
++ * either of the GNU General Public License Version 2 or later (the "GPL"),
++ * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
++ * in which case the provisions of the GPL or the LGPL are applicable instead
++ * of those above. If you wish to allow use of your version of this file only
++ * under the terms of either the GPL or the LGPL, and not to allow others to
++ * use your version of this file under the terms of the MPL, indicate your
++ * decision by deleting the provisions above and replace them with the notice
++ * and other provisions required by the GPL or the LGPL. If you do not delete
++ * the provisions above, a recipient may use your version of this file under
++ * the terms of any one of the MPL, the GPL or the LGPL.
++ *
++ * ***** END LICENSE BLOCK ***** */
++#include <sys/regdef.h>
++#include <sys/asm.h>
++
++LOCALSZ=16
++FRAMESZ=(((NARGSAVE+LOCALSZ)*SZREG)+ALSZ)&ALMASK
++
++A1OFF=FRAMESZ-(9*SZREG)
++A2OFF=FRAMESZ-(8*SZREG)
++A3OFF=FRAMESZ-(7*SZREG)
++A4OFF=FRAMESZ-(6*SZREG)
++A5OFF=FRAMESZ-(5*SZREG)
++A6OFF=FRAMESZ-(4*SZREG)
++A7OFF=FRAMESZ-(3*SZREG)
++GPOFF=FRAMESZ-(2*SZREG)
++RAOFF=FRAMESZ-(1*SZREG)
++
++F13OFF=FRAMESZ-(16*SZREG)
++F14OFF=FRAMESZ-(15*SZREG)
++F15OFF=FRAMESZ-(14*SZREG)
++F16OFF=FRAMESZ-(13*SZREG)
++F17OFF=FRAMESZ-(12*SZREG)
++F18OFF=FRAMESZ-(11*SZREG)
++F19OFF=FRAMESZ-(10*SZREG)
++
++#define SENTINEL_ENTRY(n) /* defined in cpp file, not here */
++
++#if defined(__GXX_ABI_VERSION) && __GXX_ABI_VERSION >= 100 /* G++ V3 ABI */
++#define STUB_ENTRY(x) \
++ .if x < 10; \
++ MAKE_STUB(x, _ZN14nsXPTCStubBase5Stub ##x ##Ev); \
++ .elseif x < 100; \
++ MAKE_STUB(x, _ZN14nsXPTCStubBase6Stub ##x ##Ev); \
++ .elseif x < 1000; \
++ MAKE_STUB(x, _ZN14nsXPTCStubBase7Stub ##x ##Ev); \
++ .else; \
++ .err; \
++ .endif
++#else /* not G++ V3 ABI */
++#define STUB_ENTRY(x) \
++ MAKE_STUB(x, Stub ##x ##__14nsXPTCStubBase)
++#endif /* G++ V3 ABI */
++
++#define MAKE_STUB(x, name) \
++ .globl name; \
++ .type name,@function; \
++ .aent name,0; \
++name:; \
++ PTR_SUBU sp,FRAMESZ; \
++ SETUP_GP64(GPOFF, name); \
++ li t0,x; \
++ b sharedstub; \
++
++#
++# open a dummy frame for the function entries
++#
++ .text
++ .align 2
++ .type dummy,@function
++ .ent dummy, 0
++dummy:
++ .frame sp, FRAMESZ, ra
++ .mask 0x90000FF0, RAOFF-FRAMESZ
++ .fmask 0x000FF000, F19OFF-FRAMESZ
++
++#include "xptcstubsdef.inc"
++
++sharedstub:
++
++ REG_S a1, A1OFF(sp)
++ REG_S a2, A2OFF(sp)
++ REG_S a3, A3OFF(sp)
++ REG_S a4, A4OFF(sp)
++ REG_S a5, A5OFF(sp)
++ REG_S a6, A6OFF(sp)
++ REG_S a7, A7OFF(sp)
++ REG_S ra, RAOFF(sp)
++
++ s.d $f13, F13OFF(sp)
++ s.d $f14, F14OFF(sp)
++ s.d $f15, F15OFF(sp)
++ s.d $f16, F16OFF(sp)
++ s.d $f17, F17OFF(sp)
++ s.d $f18, F18OFF(sp)
++ s.d $f19, F19OFF(sp)
++
++ # t0 is methodIndex
++ move a1, t0
++
++ # a2 is stack address where extra function params
++ # are stored that do not fit in registers
++ move a2, sp
++ addi a2, FRAMESZ
++
++ # a3 is stack address of a1..a7
++ move a3, sp
++ addi a3, A1OFF
++
++ # a4 is stack address of f13..f19
++ move a4, sp
++ addi a4, F13OFF
++
++ # PrepareAndDispatch(that, methodIndex, args, gprArgs, fpArgs)
++ # a0 a1 a2 a3 a4
++ #
++ jal PrepareAndDispatch
++
++ REG_L ra, RAOFF(sp)
++ RESTORE_GP64
++
++ PTR_ADDU sp, FRAMESZ
++ j ra
++ END(dummy)
+diff --git a/xpcom/reflect/xptcall/src/md/unix/xptcstubs_mips64.cpp b/xpcom/reflect/xptcall/src/md/unix/xptcstubs_mips64.cpp
+new file mode 100644
+index 0000000..c404065
+--- /dev/null
++++ b/xpcom/reflect/xptcall/src/md/unix/xptcstubs_mips64.cpp
+@@ -0,0 +1,218 @@
++/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
++/* ***** BEGIN LICENSE BLOCK *****
++ * Version: MPL 1.1/GPL 2.0/LGPL 2.1
++ *
++ * The contents of this file are subject to the Mozilla Public License Version
++ * 1.1 (the "License"); you may not use this file except in compliance with
++ * the License. You may obtain a copy of the License at
++ * http://www.mozilla.org/MPL/
++ *
++ * Software distributed under the License is distributed on an "AS IS" basis,
++ * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
++ * for the specific language governing rights and limitations under the
++ * License.
++ *
++ * The Original Code is mozilla.org code.
++ *
++ * The Initial Developer of the Original Code is
++ * Netscape Communications Corporation.
++ * Portions created by the Initial Developer are Copyright (C) 1999
++ * the Initial Developer. All Rights Reserved.
++ *
++ * Contributor(s):
++ * ZHANG Le <r0bertz@gentoo.org>
++ *
++ * Alternatively, the contents of this file may be used under the terms of
++ * either of the GNU General Public License Version 2 or later (the "GPL"),
++ * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
++ * in which case the provisions of the GPL or the LGPL are applicable instead
++ * of those above. If you wish to allow use of your version of this file only
++ * under the terms of either the GPL or the LGPL, and not to allow others to
++ * use your version of this file under the terms of the MPL, indicate your
++ * decision by deleting the provisions above and replace them with the notice
++ * and other provisions required by the GPL or the LGPL. If you do not delete
++ * the provisions above, a recipient may use your version of this file under
++ * the terms of any one of the MPL, the GPL or the LGPL.
++ *
++ * ***** END LICENSE BLOCK ***** */
++
++#include "xptcprivate.h"
++#include "xptiprivate.h"
++
++#if (_MIPS_SIM != _ABIN32)
++#error "This code is for MIPS N32 only"
++#endif
++
++/*
++ * This is for MIPS N32 ABI
++ *
++ * When we're called, the "gp" registers are stored in gprData and
++ * the "fp" registers are stored in fprData. There are 8 regs
++ * available which coorespond to the first 7 parameters of the
++ * function and the "this" pointer. If there are additional parms,
++ * they are stored on the stack at address "args".
++ *
++ */
++extern "C" nsresult
++PrepareAndDispatch(nsXPTCStubBase* self, PRUint32 methodIndex, PRUint64* args,
++ PRUint64 *gprData, double *fprData)
++{
++#define PARAM_BUFFER_COUNT 16
++#define PARAM_GPR_COUNT 7
++#define PARAM_FPR_COUNT 7
++
++ nsXPTCMiniVariant paramBuffer[PARAM_BUFFER_COUNT];
++ nsXPTCMiniVariant* dispatchParams = NULL;
++ const nsXPTMethodInfo* info;
++ PRUint8 paramCount;
++ PRUint8 i;
++ nsresult result = NS_ERROR_FAILURE;
++
++ NS_ASSERTION(self,"no self");
++
++ self->mEntry->GetMethodInfo(PRUint16(methodIndex), &info);
++ NS_ASSERTION(info,"no method info");
++
++ paramCount = info->GetParamCount();
++
++ // setup variant array pointer
++ if(paramCount > PARAM_BUFFER_COUNT)
++ dispatchParams = new nsXPTCMiniVariant[paramCount];
++ else
++ dispatchParams = paramBuffer;
++ NS_ASSERTION(dispatchParams,"no place for params");
++
++ PRUint64* ap = args;
++ PRUint32 iCount = 0;
++ for(i = 0; i < paramCount; i++)
++ {
++ const nsXPTParamInfo& param = info->GetParam(i);
++ const nsXPTType& type = param.GetType();
++ nsXPTCMiniVariant* dp = &dispatchParams[i];
++
++ if(param.IsOut() || !type.IsArithmetic())
++ {
++ if (iCount < PARAM_GPR_COUNT)
++ dp->val.p = (void*)gprData[iCount++];
++ else
++ dp->val.p = (void*)*ap++;
++ continue;
++ }
++ // else
++ switch(type)
++ {
++ case nsXPTType::T_I8:
++ if (iCount < PARAM_GPR_COUNT)
++ dp->val.i8 = (PRInt8)gprData[iCount++];
++ else
++ dp->val.i8 = (PRInt8)*ap++;
++ break;
++
++ case nsXPTType::T_I16:
++ if (iCount < PARAM_GPR_COUNT)
++ dp->val.i16 = (PRInt16)gprData[iCount++];
++ else
++ dp->val.i16 = (PRInt16)*ap++;
++ break;
++
++ case nsXPTType::T_I32:
++ if (iCount < PARAM_GPR_COUNT)
++ dp->val.i32 = (PRInt32)gprData[iCount++];
++ else
++ dp->val.i32 = (PRInt32)*ap++;
++ break;
++
++ case nsXPTType::T_I64:
++ if (iCount < PARAM_GPR_COUNT)
++ dp->val.i64 = (PRInt64)gprData[iCount++];
++ else
++ dp->val.i64 = (PRInt64)*ap++;
++ break;
++
++ case nsXPTType::T_U8:
++ if (iCount < PARAM_GPR_COUNT)
++ dp->val.u8 = (PRUint8)gprData[iCount++];
++ else
++ dp->val.u8 = (PRUint8)*ap++;
++ break;
++
++ case nsXPTType::T_U16:
++ if (iCount < PARAM_GPR_COUNT)
++ dp->val.u16 = (PRUint16)gprData[iCount++];
++ else
++ dp->val.u16 = (PRUint16)*ap++;
++ break;
++
++ case nsXPTType::T_U32:
++ if (iCount < PARAM_GPR_COUNT)
++ dp->val.u32 = (PRUint32)gprData[iCount++];
++ else
++ dp->val.u32 = (PRUint32)*ap++;
++ break;
++
++ case nsXPTType::T_U64:
++ if (iCount < PARAM_GPR_COUNT)
++ dp->val.u64 = (PRUint64)gprData[iCount++];
++ else
++ dp->val.u64 = (PRUint64)*ap++;
++ break;
++
++ case nsXPTType::T_FLOAT:
++ if (iCount < PARAM_FPR_COUNT)
++ dp->val.f = (double)fprData[iCount++];
++ else
++ dp->val.f = *((double*)ap++);
++ break;
++
++ case nsXPTType::T_DOUBLE:
++ if (iCount < PARAM_FPR_COUNT)
++ dp->val.d = (double)fprData[iCount++];
++ else
++ dp->val.d = *((double*)ap++);
++ break;
++
++ case nsXPTType::T_BOOL:
++ if (iCount < PARAM_GPR_COUNT)
++ dp->val.b = (PRBool)gprData[iCount++];
++ else
++ dp->val.b = (PRBool)*ap++;
++ break;
++
++ case nsXPTType::T_CHAR:
++ if (iCount < PARAM_GPR_COUNT)
++ dp->val.c = (char)gprData[iCount++];
++ else
++ dp->val.c = (char)*ap++;
++ break;
++
++ case nsXPTType::T_WCHAR:
++ if (iCount < PARAM_GPR_COUNT)
++ dp->val.wc = (wchar_t)gprData[iCount++];
++ else
++ dp->val.wc = (wchar_t)*ap++;
++ break;
++
++ default:
++ NS_ASSERTION(0, "bad type");
++ break;
++ }
++ }
++
++ result = self->mOuter->CallMethod((PRUint16)methodIndex, info, dispatchParams);
++
++ if(dispatchParams != paramBuffer)
++ delete [] dispatchParams;
++
++ return result;
++}
++
++#define STUB_ENTRY(n) /* defined in the assembly file */
++
++#define SENTINEL_ENTRY(n) \
++nsresult nsXPTCStubBase::Sentinel##n() \
++{ \
++ NS_ASSERTION(0,"nsXPTCStubBase::Sentinel called"); \
++ return NS_ERROR_NOT_IMPLEMENTED; \
++}
++
++#include "xptcstubsdef.inc"
+--
+1.6.2
+
diff --git a/net-libs/xulrunner/files/xulrunner-1.9.2.13-mips-tls.patch b/net-libs/xulrunner/files/xulrunner-1.9.2.13-mips-tls.patch
new file mode 100644
index 0000000..51aaf57
--- /dev/null
+++ b/net-libs/xulrunner/files/xulrunner-1.9.2.13-mips-tls.patch
@@ -0,0 +1,30 @@
+
+# HG changeset patch
+# User Mike Hommey <mh+mozilla@glandium.org>
+# Date 1271746824 -7200
+# Node ID bfe106e6ca9a983a0059911df70b0701c0c1786b
+# Parent a164b2809859dd76bc254e077b7191ffb4b06469
+Bug 528687 - Don't use TLS variables on mips, because of a binutils bug [r=benjamin]
+
+diff --git a/configure.in b/configure.in
+--- a/configure.in
++++ b/configure.in
+@@ -4269,7 +4269,16 @@ AC_CACHE_CHECK(for __thread keyword for
+ ac_cv_thread_keyword=no)])
+ LDFLAGS=$_SAVE_LDFLAGS
+ if test "$ac_cv_thread_keyword" = yes; then
+- AC_DEFINE(HAVE_THREAD_TLS_KEYWORD)
++ # mips builds fail with TLS variables because of a binutils bug.
++ # See bug 528687
++ case "${target_cpu}" in
++ mips*)
++ :
++ ;;
++ *)
++ AC_DEFINE(HAVE_THREAD_TLS_KEYWORD)
++ ;;
++ esac
+ fi
+
+ dnl Check for the existence of various allocation headers/functions
+
diff --git a/net-libs/xulrunner/xulrunner-1.9.2.13.ebuild b/net-libs/xulrunner/xulrunner-1.9.2.13.ebuild
new file mode 100644
index 0000000..9068788
--- /dev/null
+++ b/net-libs/xulrunner/xulrunner-1.9.2.13.ebuild
@@ -0,0 +1,253 @@
+# Copyright 1999-2010 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/net-libs/xulrunner/xulrunner-1.9.2.13.ebuild,v 1.7 2010/12/11 15:58:24 jer Exp $
+
+EAPI="3"
+WANT_AUTOCONF="2.1"
+
+inherit flag-o-matic toolchain-funcs eutils mozconfig-3 makeedit multilib java-pkg-opt-2 autotools python prefix pax-utils
+
+MY_PV="${PV/_rc/rc}" # Handle beta
+MY_PV="${MY_PV/1.9.2/3.6}"
+MAJ_PV="1.9.2" # from mozilla-* branch name
+PATCH="${PN}-1.9.2-patches-0.9"
+
+DESCRIPTION="Mozilla runtime package that can be used to bootstrap XUL+XPCOM applications"
+HOMEPAGE="http://developer.mozilla.org/en/docs/XULRunner"
+SRC_URI="http://releases.mozilla.org/pub/mozilla.org/firefox/releases/${MY_PV}/source/firefox-${MY_PV}.source.tar.bz2
+ http://dev.gentoo.org/~anarchy/mozilla/patchsets/${PATCH}.tar.bz2"
+
+KEYWORDS="~alpha amd64 arm hppa ~ia64 ppc ppc64 ~sparc x86 ~amd64-linux ~x86-linux ~sparc-solaris ~x64-solaris ~x86-solaris"
+SLOT="1.9"
+LICENSE="|| ( MPL-1.1 GPL-2 LGPL-2.1 )"
+IUSE="+alsa debug +ipc libnotify system-sqlite wifi"
+
+RDEPEND="
+ >=sys-devel/binutils-2.16.1
+ >=dev-libs/nss-3.12.8
+ >=dev-libs/nspr-4.8.6
+ system-sqlite? ( >=dev-db/sqlite-3.7.1[fts3,secure-delete] )
+ alsa? ( media-libs/alsa-lib )
+ >=app-text/hunspell-1.2
+ >=x11-libs/cairo-1.8.8[X]
+ x11-libs/pango[X]
+ x11-libs/libXt
+ x11-libs/pixman
+ >=dev-libs/libevent-1.4.7
+ wifi? ( net-wireless/wireless-tools )
+ libnotify? ( >=x11-libs/libnotify-0.4 )"
+
+DEPEND="java? ( >=virtual/jdk-1.4 )
+ ${RDEPEND}
+ =dev-lang/python-2*[threads]
+ dev-util/pkgconfig"
+
+# virtual/jre should not be in DEPEND. bug 325981
+RDEPEND="java? ( >=virtual/jre-1.4 ) ${RDEPEND}"
+
+S="${WORKDIR}/mozilla-${MAJ_PV}"
+
+pkg_setup() {
+ # Ensure we always build with C locale.
+ export LANG="C"
+ export LC_ALL="C"
+ export LC_MESSAGES="C"
+ export LC_CTYPE="C"
+
+ java-pkg-opt-2_pkg_setup
+
+ python_set_active_version 2
+}
+
+src_prepare() {
+ # Apply our patches
+ EPATCH_SUFFIX="patch" \
+ EPATCH_FORCE="yes" \
+ epatch "${WORKDIR}"
+
+ epatch "${FILESDIR}/bug-606109.patch"
+ epatch "${FILESDIR}/fix-animated-gifs.patch"
+
+ if use mips; then
+ epatch "${FILESDIR}"/${P}-mips-n32.patch
+ epatch "${FILESDIR}"/${P}-mips-bus-error.patch
+ epatch "${FILESDIR}"/${P}-mips-tls.patch
+ fi
+
+ eprefixify \
+ extensions/java/xpcom/interfaces/org/mozilla/xpcom/Mozilla.java \
+ xpcom/build/nsXPCOMPrivate.h \
+ xulrunner/installer/Makefile.in \
+ xulrunner/app/nsRegisterGREUnix.cpp
+
+ # fix double symbols due to double -ljemalloc
+ sed -i -e '/^LIBS += $(JEMALLOC_LIBS)/s/^/#/' \
+ xulrunner/stub/Makefile.in || die
+
+ # Allow user to apply additional patches without modifing ebuild
+ epatch_user
+
+ # Same as in config/autoconf.mk.in
+ MOZLIBDIR="/usr/$(get_libdir)/${PN}-${MAJ_PV}"
+ SDKDIR="/usr/$(get_libdir)/${PN}-devel-${MAJ_PV}/sdk"
+
+ # Gentoo install dirs
+ sed -i -e "s:@PV@:${MAJ_PV}:" "${S}"/config/autoconf.mk.in \
+ || die "${MAJ_PV} sed failed!"
+
+ # Enable gnomebreakpad
+ if use debug ; then
+ sed -i -e "s:GNOME_DISABLE_CRASH_DIALOG=1:GNOME_DISABLE_CRASH_DIALOG=0:g" \
+ "${S}"/build/unix/run-mozilla.sh || die "sed failed!"
+ fi
+
+ eautoreconf
+
+ cd js/src
+ eautoreconf
+}
+
+src_configure() {
+ ####################################
+ #
+ # mozconfig, CFLAGS and CXXFLAGS setup
+ #
+ ####################################
+
+ mozconfig_init
+ mozconfig_config
+
+ MEXTENSIONS="default"
+
+ MOZLIBDIR="/usr/$(get_libdir)/${PN}-${MAJ_PV}"
+
+ # It doesn't compile on alpha without this LDFLAGS
+ use alpha && append-ldflags "-Wl,--no-relax"
+
+ mozconfig_annotate '' --with-default-mozilla-five-home="${MOZLIBDIR}"
+ mozconfig_annotate '' --enable-extensions="${MEXTENSIONS}"
+ mozconfig_annotate '' --enable-application=xulrunner
+ mozconfig_annotate '' --disable-mailnews
+ mozconfig_annotate 'broken' --disable-crashreporter
+ mozconfig_annotate '' --enable-image-encoder=all
+ mozconfig_annotate '' --enable-canvas
+ mozconfig_annotate 'gtk' --enable-default-toolkit=cairo-gtk2
+ # Bug 60668: Galeon doesn't build without oji enabled, so enable it
+ # regardless of java setting.
+ mozconfig_annotate '' --enable-oji --enable-mathml
+ mozconfig_annotate 'places' --enable-storage --enable-places
+ mozconfig_annotate '' --enable-safe-browsing
+
+ # Build mozdevelop permately
+ mozconfig_annotate '' --enable-jsd --enable-xpctools
+
+ # System-wide install specs
+ mozconfig_annotate '' --disable-installer
+ mozconfig_annotate '' --disable-updater
+ mozconfig_annotate '' --disable-strip
+ mozconfig_annotate '' --disable-install-strip
+
+ # Use system libraries
+ mozconfig_annotate '' --enable-system-cairo
+ mozconfig_annotate '' --enable-system-hunspell
+ mozconfig_annotate '' --with-system-nspr --with-nspr-prefix="${EPREFIX}"/usr
+ mozconfig_annotate '' --with-system-nss --with-nss-prefix="${EPREFIX}"/usr
+ mozconfig_annotate '' --x-includes="${EPREFIX}"/usr/include --x-libraries="${EPREFIX}"/usr/$(get_libdir)
+ mozconfig_annotate '' --with-system-bz2
+ mozconfig_annotate '' --with-system-libevent="${EPREFIX}"/usr
+
+ mozconfig_use_enable ipc # +ipc, upstream default
+ mozconfig_use_enable libnotify
+ mozconfig_use_enable java javaxpcom
+ mozconfig_use_enable wifi necko-wifi
+ mozconfig_use_enable alsa ogg
+ mozconfig_use_enable alsa wave
+ mozconfig_use_enable system-sqlite
+
+ # Debug
+ if use debug ; then
+ mozconfig_annotate 'debug' --disable-optimize
+ mozconfig_annotate 'debug' --enable-debug=-ggdb
+ mozconfig_annotate 'debug' --enable-debug-modules=all
+ mozconfig_annotate 'debug' --enable-debugger-info-modules
+ fi
+
+ # Finalize and report settings
+ mozconfig_final
+
+ if [[ $(gcc-major-version) -lt 4 ]]; then
+ append-flags -fno-stack-protector
+ fi
+
+ ####################################
+ #
+ # Configure and build
+ #
+ ####################################
+
+ # Disable no-print-directory
+ MAKEOPTS=${MAKEOPTS/--no-print-directory/}
+
+ # Ensure that are plugins dir is enabled as default
+ sed -i -e "s:/usr/lib/mozilla/plugins:/usr/$(get_libdir)/nsbrowser/plugins:" \
+ "${S}"/xpcom/io/nsAppFileLocationProvider.cpp || die "sed failed to replace plugin path!"
+
+ # hack added to workaround bug 299905 on hosts with libc that doesn't
+ # support tls, (probably will only hit this condition with Gentoo Prefix)
+ tc-has-tls -l || export ac_cv_thread_keyword=no
+
+ CC="$(tc-getCC)" CXX="$(tc-getCXX)" LD="$(tc-getLD)" PYTHON="$(PYTHON)" econf
+}
+
+src_install() {
+ emake DESTDIR="${D}" install || die "emake install failed"
+
+ rm "${ED}"/usr/bin/xulrunner
+
+ MOZLIBDIR="/usr/$(get_libdir)/${PN}-${MAJ_PV}"
+ SDKDIR="/usr/$(get_libdir)/${PN}-devel-${MAJ_PV}/sdk"
+
+ if has_multilib_profile; then
+ local config
+ for config in "${ED}"/etc/gre.d/*.system.conf ; do
+ mv "${config}" "${config%.conf}.${CHOST}.conf"
+ done
+ fi
+
+ dodir /usr/bin
+ dosym "${MOZLIBDIR}/xulrunner" "/usr/bin/xulrunner-${MAJ_PV}" || die
+
+ # env.d file for ld search path
+ dodir /etc/env.d
+ echo "LDPATH=${EPREFIX}/${MOZLIBDIR}" > "${ED}"/etc/env.d/08xulrunner || die "env.d failed"
+
+ # Add our defaults to xulrunner and out of firefox
+ cp "${FILESDIR}"/xulrunner-default-prefs.js \
+ "${ED}/${MOZLIBDIR}/defaults/pref/all-gentoo.js" || \
+ die "failed to cp xulrunner-default-prefs.js"
+
+ pax-mark m "${D}"/${MOZLIBDIR}/plugin-container
+
+ if use java ; then
+ java-pkg_regjar "${ED}/${MOZLIBDIR}/javaxpcom.jar"
+ java-pkg_regso "${ED}/${MOZLIBDIR}/libjavaxpcomglue.so"
+ java-pkg_regjar "${ED}/${SDKDIR}/lib/MozillaGlue.jar"
+ java-pkg_regjar "${ED}/${SDKDIR}/lib/MozillaInterfaces.jar"
+ fi
+}
+
+pkg_postinst() {
+ ewarn "If firefox fails to start with \"failed to load xpcom\", run revdep-rebuild"
+ ewarn "If that does not fix the problem, rebuild dev-libs/nss"
+ ewarn "Try dev-util/lafilefixer if you get build failures related to .la files"
+
+ einfo
+ einfo "All prefs can be overridden by the user. The preferences are to make"
+ einfo "use of xulrunner out of the box on an average system without the user"
+ einfo "having to go through and enable the basics."
+
+ einfo
+ ewarn "Any package that requires xulrunner:1.9 slot could and most likely will"
+ ewarn "have issues. These issues should be reported to maintainer, and mozilla herd"
+ ewarn "should be cc'd on the bug report. Thank you anarchy@gentoo.org ."
+}