2010-03-04 Ginn Chen <[email protected]>
authorginnchen
Thu, 04 Mar 2010 12:16:33 +0000
changeset 17633 0a0292dce587
parent 17632 f2cba04705c7
child 17634 f9c65e7db10b
2010-03-04 Ginn Chen <[email protected]> * base-specs/firefox.spec: enable PGO, enable system sqlite * ext-sources/firefox36-profile-sparc-ss12.tar.bz2: * ext-sources/firefox36-profile-sparc-ss12u1.tar.bz2: * ext-sources/firefox36-profile-x86-ss12.tar.bz2: * ext-sources/firefox36-profile-x86-ss12u1.tar.bz2: * patches/firefox3-24-storage-test.diff: * patches/firefox3-25-jslock.diff: * patches/firefox3-26-pgo-sparc.diff: * patches/firefox3-27-522684-ssl-tunnel-hang.diff:
ChangeLog
base-specs/firefox.spec
ext-sources/firefox36-profile-sparc-ss12.tar.bz2
ext-sources/firefox36-profile-sparc-ss12u1.tar.bz2
ext-sources/firefox36-profile-x86-ss12.tar.bz2
ext-sources/firefox36-profile-x86-ss12u1.tar.bz2
patches/firefox3-24-storage-test.diff
patches/firefox3-25-jslock.diff
patches/firefox3-26-pgo-sparc.diff
patches/firefox3-27-522684-ssl-tunnel-hang.diff
--- a/ChangeLog	Thu Mar 04 07:22:42 2010 +0000
+++ b/ChangeLog	Thu Mar 04 12:16:33 2010 +0000
@@ -1,8 +1,14 @@
-2010-03-04  Ginn Chen  <set EMAIL_ADDRESS environment variable>
-
-	* SUNWfirefox.spec:
-	* base-specs/cairo.spec:
-	* base-specs/firefox.spec:
+2010-03-04  Ginn Chen  <[email protected]>
+
+	* base-specs/firefox.spec: enable PGO, enable system sqlite
+	* ext-sources/firefox36-profile-sparc-ss12.tar.bz2:
+	* ext-sources/firefox36-profile-sparc-ss12u1.tar.bz2:
+	* ext-sources/firefox36-profile-x86-ss12.tar.bz2:
+	* ext-sources/firefox36-profile-x86-ss12u1.tar.bz2:
+	* patches/firefox3-24-storage-test.diff:
+	* patches/firefox3-25-jslock.diff:
+	* patches/firefox3-26-pgo-sparc.diff:
+	* patches/firefox3-27-522684-ssl-tunnel-hang.diff:
 
 2010-03-04  Ginn Chen  <[email protected]>
 
--- a/base-specs/firefox.spec	Thu Mar 04 07:22:42 2010 +0000
+++ b/base-specs/firefox.spec	Thu Mar 04 12:16:33 2010 +0000
@@ -29,6 +29,14 @@
 Source7:     nspr-nss-config
 %endif
 
+%ifarch sparc
+Source8:     firefox36-profile-sparc-ss12.tar.bz2
+#Source8:     firefox36-profile-sparc-ss12u1.tar.bz2
+%else
+Source8:     firefox36-profile-x86-ss12.tar.bz2
+#Source8:     firefox36-profile-x86-ss12u1.tar.bz2
+%endif
+
 # owner:hawklu date:2007-11-28 type:branding
 # change preference to support multi-language
 Patch1: firefox3-01-locale.diff
@@ -113,6 +121,23 @@
 # status:upstream
 Patch23: firefox3-23-nspr_use_zone_allocator.diff
 
+%if %option_without_moz_nss_nspr
+# owner:ginnchen date:2010-03-04 type:branding
+# we need to move -lsqlite3 ahead of -L/usr/lib/mps
+Patch24: firefox3-24-storage-test.diff
+%endif
+
+# owner:ginnchen date:2010-03-04 type:bug bugzilla:537076
+# status:upstream
+Patch25: firefox3-25-jslock.diff
+
+# owner:ginnchen date:2010-03-04 type:bug bugzilla:550154
+Patch26: firefox3-26-pgo-sparc.diff
+
+# owner:ginnchen date:2010-03-04 type:bug bugzilla:522684
+# status:upstream
+Patch27: firefox3-27-522684-ssl-tunnel-hang.diff
+
 URL:         http://www.mozilla.com/firefox
 
 BuildRoot:   %{_tmppath}/%{name}-%{tarball_version}-build
@@ -169,6 +194,10 @@
 %patch21 -p1
 %patch22 -p1
 %patch23 -p1
+%patch24 -p1
+%patch25 -p1
+%patch26 -p1
+%patch27 -p1
 
 %if %option_with_indiana_branding
 %patch14 -p1
@@ -203,7 +232,7 @@
 %endif
 ac_add_options --enable-official-branding
 ac_add_options --disable-updater
-ac_add_options --disable-tests
+ac_add_options --enable-tests
 ac_add_options --enable-dtrace
 ac_add_options --with-system-jpeg
 ac_add_options --with-system-zlib
@@ -214,7 +243,7 @@
 ac_add_options --with-system-nspr
 ac_add_options --with-system-nss
 %endif
-#ac_add_options --enable-system-sqlite
+ac_add_options --enable-system-sqlite
 ac_add_options --enable-startup-notification
 EOF
 
@@ -237,6 +266,13 @@
 export NSS_CONFIG=${SRCDIR}/../obj/nspr-nss-config\ nss
 %endif
 
+# PGO build
+# to generate PGO profile
+# export MOZ_PROFILE_GENERATE=1
+# to use PGO profile
+export MOZ_PROFILE_USE=1
+gtar jxf %{SOURCE8}
+
 ${SRCDIR}/mozilla-1.9.2/configure
 make -j $CPUS
 
@@ -356,6 +392,8 @@
 /bin/rm -rf $RPM_BUILD_ROOT
 
 %changelog
+* Thu Mar 04 2010 - [email protected]
+- Enable PGO, enable system sqlite, enable tests.
 * Mon Feb 08 2010 - [email protected]
 - Disable system sqlite for d.o.o. 14364.
 * Thu Feb 04 2010 - [email protected]
Binary file ext-sources/firefox36-profile-sparc-ss12.tar.bz2 has changed
Binary file ext-sources/firefox36-profile-sparc-ss12u1.tar.bz2 has changed
Binary file ext-sources/firefox36-profile-x86-ss12.tar.bz2 has changed
Binary file ext-sources/firefox36-profile-x86-ss12u1.tar.bz2 has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/firefox3-24-storage-test.diff	Thu Mar 04 12:16:33 2010 +0000
@@ -0,0 +1,13 @@
+--- mozilla-1.9.2/storage/test/Makefile.in.orig	2010-01-21 11:31:10.000000000 +0800
++++ mozilla-1.9.2/storage/test/Makefile.in	2010-03-01 16:58:32.333791525 +0800
+@@ -78,9 +78,9 @@
+ 
+ LIBS = \
+ 	$(LIBS_DIR) \
++	$(SQLITE_LIBS) \
+ 	$(LIBXUL_DIST)/lib/$(LIB_PREFIX)xpcomglue_s.$(LIB_SUFFIX) \
+ 	$(MOZ_COMPONENT_LIBS) \
+-	$(SQLITE_LIBS) \
+ 	$(NULL)
+ 
+ include $(topsrcdir)/config/rules.mk
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/firefox3-25-jslock.diff	Thu Mar 04 12:16:33 2010 +0000
@@ -0,0 +1,60 @@
+diff --git a/js/src/jslock.cpp b/js/src/jslock.cpp
+--- a/js/src/jslock.cpp
++++ b/js/src/jslock.cpp
+@@ -109,17 +109,17 @@ NativeCompareAndSwap(jsword *w, jsword o
+ 
+ static JS_ALWAYS_INLINE int
+ NativeCompareAndSwap(jsword *w, jsword ov, jsword nv)
+ {
+     /* Details on these functions available in the manpage for atomic */
+     return OSAtomicCompareAndSwapPtrBarrier(ov, nv, w);
+ }
+ 
+-#elif defined(__i386) && (defined(__GNUC__) || defined(__SUNPRO_CC))
++#elif defined(__i386) && defined(__GNUC__)
+ 
+ /* Note: This fails on 386 cpus, cmpxchgl is a >= 486 instruction */
+ static JS_ALWAYS_INLINE int
+ NativeCompareAndSwap(jsword *w, jsword ov, jsword nv)
+ {
+     unsigned int res;
+ 
+     __asm__ __volatile__ (
+@@ -128,16 +128,37 @@ NativeCompareAndSwap(jsword *w, jsword o
+                           "sete %%al\n"
+                           "andl $1, %%eax\n"
+                           : "=a" (res)
+                           : "r" (w), "r" (nv), "a" (ov)
+                           : "cc", "memory");
+     return (int)res;
+ }
+ 
++#elif defined(__i386) && defined(__SUNPRO_CC)
++
++/* Different code for Sun Studio because of a bug of SS12U1 */
++
++/* Note: This fails on 386 cpus, cmpxchgl is a >= 486 instruction */
++static JS_ALWAYS_INLINE int
++NativeCompareAndSwap(jsword *w, jsword ov, jsword nv)
++{
++    unsigned int res;
++
++    __asm__ __volatile__ (
++                          "lock\n"
++                          "cmpxchgl %2, (%1)\n"
++                          "sete %%al\n"
++                          "andl $1, %%eax\n"
++                          : "=a" (res)
++                          : "c" (w), "d" (nv), "a" (ov)
++                          : "cc", "memory");
++    return (int)res;
++}
++
+ #elif defined(__x86_64) && (defined(__GNUC__) || defined(__SUNPRO_CC))
+ 
+ static JS_ALWAYS_INLINE int
+ NativeCompareAndSwap(jsword *w, jsword ov, jsword nv)
+ {
+     unsigned int res;
+ 
+     __asm__ __volatile__ (
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/firefox3-26-pgo-sparc.diff	Thu Mar 04 12:16:33 2010 +0000
@@ -0,0 +1,56 @@
+diff --git a/xpcom/reflect/xptcall/src/md/unix/Makefile.in b/xpcom/reflect/xptcall/src/md/unix/Makefile.in
+index 0c563e0..de9091a 100644
+--- a/xpcom/reflect/xptcall/src/md/unix/Makefile.in
++++ b/xpcom/reflect/xptcall/src/md/unix/Makefile.in
+@@ -56,6 +56,14 @@ CPPSRCS = $(error XPTCall not implemented on this platform!)
+ # Force use of PIC
+ FORCE_USE_PIC	= 1
+ 
++ifeq ($(OS_ARCH),SunOS)
++ifneq (86,$(findstring 86,$(OS_TEST)))
++# disable PGO for this directory with Sun Studio on SPARC
++# because compiling with xprofile=collect will insert code into nsXPTCStubBase::Stub##n
++NO_PROFILE_GUIDED_OPTIMIZE = 1
++endif
++endif
++
+ include $(topsrcdir)/config/config.mk
+ 
+ ######################################################################
+@@ -432,10 +440,6 @@ ASFILES		:= xptcinvoke_asm_sparc_solaris_GCC.s xptcstubs_asm_sparc_solaris.s
+ endif
+ else
+ 
+-# disable PGO for this directory with Sun Studio on SPARC
+-# because compiling with xprofile=collect will insert code into nsXPTCStubBase::Stub##n
+-NO_PROFILE_GUIDED_OPTIMIZE = 1
+-
+ ifdef HAVE_64BIT_OS
+ ASFILES		:= xptcinvoke_asm_sparcv9_solaris_SUNW.s xptcstubs_asm_sparcv9_solaris.s
+ else
+--- mozilla-1.9.2/configure	Tue Mar  2 15:42:39 2010
++++ mozilla-1.9.2/configure	Tue Mar  2 15:43:08 2010
+@@ -19716,8 +19716,8 @@
+     PROFILE_USE_CFLAGS="-xprofile=use:$_objdir/$enable_application"
+     PROFILE_USE_LDFLAGS="-xprofile=use:$_objdir/$enable_application"
+   else
+-    PROFILE_USE_CFLAGS="-xlinkopt=2 -xprofile=use:$_objdir/$enable_application"
+-    PROFILE_USE_LDFLAGS="-xlinkopt=2 -xprofile=use:$_objdir/$enable_application"
++    PROFILE_USE_CFLAGS="-xprofile=use:$_objdir/$enable_application"
++    PROFILE_USE_LDFLAGS="-xprofile=use:$_objdir/$enable_application"
+   fi
+ fi
+ 
+--- mozilla-1.9.2/js/src/configure	Tue Mar  2 15:48:48 2010
++++ mozilla-1.9.2/js/src/configure	Tue Mar  2 15:49:06 2010
+@@ -12869,8 +12869,8 @@
+     PROFILE_USE_CFLAGS="-xprofile=use:$_objdir/$enable_application"
+     PROFILE_USE_LDFLAGS="-xprofile=use:$_objdir/$enable_application"
+   else
+-    PROFILE_USE_CFLAGS="-xlinkopt=2 -xprofile=use:$_objdir/$enable_application"
+-    PROFILE_USE_LDFLAGS="-xlinkopt=2 -xprofile=use:$_objdir/$enable_application"
++    PROFILE_USE_CFLAGS="-xprofile=use:$_objdir/$enable_application"
++    PROFILE_USE_LDFLAGS="-xprofile=use:$_objdir/$enable_application"
+   fi
+ fi
+ 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/patches/firefox3-27-522684-ssl-tunnel-hang.diff	Thu Mar 04 12:16:33 2010 +0000
@@ -0,0 +1,105 @@
+diff --git a/testing/mochitest/ssltunnel/ssltunnel.cpp b/testing/mochitest/ssltunnel/ssltunnel.cpp
+--- a/testing/mochitest/ssltunnel/ssltunnel.cpp
++++ b/testing/mochitest/ssltunnel/ssltunnel.cpp
+@@ -371,20 +371,21 @@ void HandleConnection(void* data)
+         client_error = true;
+       else
+         numberOfSockets = 2;
+     }
+ 
+     PRPollDesc sockets[2] = 
+     { 
+       {ci->client_sock, PR_POLL_READ, 0},
+       {other_sock, PR_POLL_READ, 0}
+     };
++    PRBool socketErrorState[2] = {PR_FALSE, PR_FALSE};
+ 
+     while (!((client_error||client_done) && buffers[0].empty() && buffers[1].empty()))
+     {
+       sockets[0].in_flags |= PR_POLL_EXCEPT;
+       sockets[1].in_flags |= PR_POLL_EXCEPT;
+       PRInt32 pollStatus = PR_Poll(sockets, numberOfSockets, PR_MillisecondsToInterval(1000));
+       if (pollStatus < 0)
+       {
+         client_error = true;
+         break;
+@@ -398,44 +399,57 @@ void HandleConnection(void* data)
+       {
+         PRInt32 s2 = s == 1 ? 0 : 1;
+         PRInt16 out_flags = sockets[s].out_flags;
+         PRInt16 &in_flags = sockets[s].in_flags;
+         PRInt16 &in_flags2 = sockets[s2].in_flags;
+         sockets[s].out_flags = 0;
+ 
+         if (out_flags & (PR_POLL_EXCEPT | PR_POLL_ERR | PR_POLL_HUP))
+         {
+           client_error = true;
++          socketErrorState[s] = PR_TRUE;
+           // We got a fatal error state on the socket. Clear the output buffer
+           // for this socket to break the main loop, we will never more be able
+           // to send those data anyway.
+           buffers[s2].bufferhead = buffers[s2].buffertail = buffers[s2].buffer;
+           continue;
+         } // PR_POLL_EXCEPT, PR_POLL_ERR, PR_POLL_HUP handling
+ 
+         if (out_flags & PR_POLL_READ && buffers[s].free())
+         {
+           PRInt32 bytesRead = PR_Recv(sockets[s].fd, buffers[s].buffertail, 
+               buffers[s].free(), 0, PR_INTERVAL_NO_TIMEOUT);
+ 
+           if (bytesRead == 0)
+           {
+             client_done = true;
+             in_flags &= ~PR_POLL_READ;
+           }
+           else if (bytesRead < 0)
+           {
+             if (PR_GetError() != PR_WOULD_BLOCK_ERROR)
++            {
++              // We are in error state, indicate that the connection was 
++              // not closed gracefully
+               client_error = true;
++              socketErrorState[s] = PR_TRUE;
++              // Wipe out our send buffer, we cannot send it anyway.
++              buffers[s2].bufferhead = buffers[s2].buffertail = buffers[s2].buffer;
++            }
+           }
+           else
+           {
++            // If the other socket is in error state (unable to send/receive)
++            // throw this data away and continue loop
++            if (socketErrorState[s2])
++              continue;
++
+             buffers[s].buffertail += bytesRead;
+ 
+             // We have to accept and handle the initial CONNECT request here
+             PRInt32 response;
+             if (!connect_accepted && ReadConnectRequest(ci->server_info, buffers[s],
+                 &response, certificateToUse, &clientAuth, fullHost))
+             {
+               // Clean the request as it would be read
+               buffers[s].bufferhead = buffers[s].buffertail = buffers[s].buffer;
+ 
+@@ -478,20 +492,21 @@ void HandleConnection(void* data)
+ 
+         if (out_flags & PR_POLL_WRITE)
+         {
+           PRInt32 bytesWrite = PR_Send(sockets[s].fd, buffers[s2].bufferhead, 
+               buffers[s2].present(), 0, PR_INTERVAL_NO_TIMEOUT);
+ 
+           if (bytesWrite < 0)
+           {
+             if (PR_GetError() != PR_WOULD_BLOCK_ERROR) {
+               client_error = true;
++              socketErrorState[s] = PR_TRUE;
+               // We got a fatal error while writting the buffer. Clear it to break
+               // the main loop, we will never more be able to send it.
+               buffers[s2].bufferhead = buffers[s2].buffertail = buffers[s2].buffer;
+             }
+           }
+           else
+           {
+             buffers[s2].bufferhead += bytesWrite;
+             if (buffers[s2].present())
+               in_flags |= PR_POLL_WRITE;