summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorwtc%google.com <devnull@localhost>2011-05-06 17:14:04 +0000
committerwtc%google.com <devnull@localhost>2011-05-06 17:14:04 +0000
commit5664d6637ab2e7c2636819e25260811912ade101 (patch)
tree08d20ce21eae3544e87b540fbb1f7cc6643b23e1
parentba51689a01009d5df082e475b3361086c06f5afe (diff)
parent7ca04c3c6d270e2f5257979c0898f121ae421f74 (diff)
downloadnspr-hg-5664d6637ab2e7c2636819e25260811912ade101.tar.gz
Set NSPR version to 4.8.9 Beta.
Modified Files: configure configure.in repackage.sh prinit.h vercheck.c
-rwxr-xr-xadmin/repackage.sh8
-rw-r--r--build/win32/pgomerge.py40
-rw-r--r--config/config.mk2
-rw-r--r--config/rules.mk37
-rwxr-xr-xconfigure2
-rw-r--r--configure.in2
-rw-r--r--pr/include/prinit.h6
-rw-r--r--pr/src/md/windows/w95sock.c27
-rw-r--r--pr/src/misc/prnetdb.c6
-rw-r--r--pr/tests/vercheck.c10
10 files changed, 126 insertions, 14 deletions
diff --git a/admin/repackage.sh b/admin/repackage.sh
index ba9f5829..8ed1a5df 100755
--- a/admin/repackage.sh
+++ b/admin/repackage.sh
@@ -64,10 +64,10 @@
#
# ------------------------------------------------------------------
-FROMTOP=/share/builds/components/nspr20/v4.8.8
-TOTOP=./v4.8.8
-NSPRDIR=nspr-4.8.8
-SOURCETAG=NSPR_4_8_8_RTM
+FROMTOP=/share/builds/components/nspr20/v4.8.9
+TOTOP=./v4.8.9
+NSPRDIR=nspr-4.8.9
+SOURCETAG=NSPR_4_8_9_RTM
#
# enumerate Unix object directories on /s/b/c
diff --git a/build/win32/pgomerge.py b/build/win32/pgomerge.py
new file mode 100644
index 00000000..383457bf
--- /dev/null
+++ b/build/win32/pgomerge.py
@@ -0,0 +1,40 @@
+#!/usr/bin/python
+# Usage: pgomerge.py <binary basename> <dist/bin>
+# Gathers .pgc files from dist/bin and merges them into
+# $PWD/$basename.pgd using pgomgr, then deletes them.
+# No errors if any of these files don't exist.
+
+import sys, os, os.path, subprocess
+if not sys.platform == "win32":
+ raise Exception("This script was only meant for Windows.")
+
+def MergePGOFiles(basename, pgddir, pgcdir):
+ """Merge pgc files produced from an instrumented binary
+ into the pgd file for the second pass of profile-guided optimization
+ with MSVC. |basename| is the name of the DLL or EXE without the
+ extension. |pgddir| is the path that contains <basename>.pgd
+ (should be the objdir it was built in). |pgcdir| is the path
+ containing basename!N.pgc files, which is probably dist/bin.
+ Calls pgomgr to merge each pgc file into the pgd, then deletes
+ the pgc files."""
+ if not os.path.isdir(pgddir) or not os.path.isdir(pgcdir):
+ return
+ pgdfile = os.path.abspath(os.path.join(pgddir, basename + ".pgd"))
+ if not os.path.isfile(pgdfile):
+ return
+ for file in os.listdir(pgcdir):
+ if file.startswith(basename+"!") and file.endswith(".pgc"):
+ try:
+ pgcfile = os.path.normpath(os.path.join(pgcdir, file))
+ subprocess.call(['pgomgr', '-merge',
+ pgcfile,
+ pgdfile])
+ os.remove(pgcfile)
+ except OSError:
+ pass
+
+if __name__ == '__main__':
+ if len(sys.argv) != 3:
+ print >>sys.stderr, "Usage: pgomerge.py <binary basename> <dist/bin>"
+ sys.exit(1)
+ MergePGOFiles(sys.argv[1], os.getcwd(), sys.argv[2])
diff --git a/config/config.mk b/config/config.mk
index f47d8fee..cfb9f3f2 100644
--- a/config/config.mk
+++ b/config/config.mk
@@ -78,11 +78,13 @@ LDFLAGS = $(OS_LDFLAGS)
ifdef MOZ_PROFILE_GENERATE
CFLAGS += $(PROFILE_GEN_CFLAGS)
LDFLAGS += $(PROFILE_GEN_LDFLAGS)
+DLLFLAGS += $(PROFILE_GEN_LDFLAGS)
endif # MOZ_PROFILE_GENERATE
ifdef MOZ_PROFILE_USE
CFLAGS += $(PROFILE_USE_CFLAGS)
LDFLAGS += $(PROFILE_USE_LDFLAGS)
+DLLFLAGS += $(PROFILE_USE_LDFLAGS)
endif # MOZ_PROFILE_USE
define MAKE_OBJDIR
diff --git a/config/rules.mk b/config/rules.mk
index 344ad2e5..a8ee1954 100644
--- a/config/rules.mk
+++ b/config/rules.mk
@@ -280,6 +280,13 @@ $(NFSPWD):
$(PROGRAM): $(OBJS)
@$(MAKE_OBJDIR)
ifeq ($(NS_USE_GCC)_$(OS_ARCH),_WINNT)
+ifdef MOZ_PROFILE_USE
+# In the second pass, we need to merge the pgc files into the pgd file.
+# The compiler would do this for us automatically if they were in the right
+# place, but they're in dist/bin.
+ python $(topsrcdir)/build/win32/pgomerge.py \
+ $(notdir $(PROGRAM:.exe=)) $(DIST)/bin
+endif # MOZ_PROFILE_USE
$(CC) $(OBJS) -Fe$@ -link $(LDFLAGS) $(OS_LIBS) $(EXTRA_LIBS)
ifdef MT
@if test -f $@.manifest; then \
@@ -287,6 +294,11 @@ ifdef MT
rm -f $@.manifest; \
fi
endif # MSVC with manifest tool
+ifdef MOZ_PROFILE_GENERATE
+# touch it a few seconds into the future to work around FAT's
+# 2-second granularity
+ touch -t `date +%Y%m%d%H%M.%S -d "now+5seconds"` pgo.relink
+endif # MOZ_PROFILE_GENERATE
else # WINNT && !GCC
$(CC) -o $@ $(CFLAGS) $(OBJS) $(LDFLAGS)
endif # WINNT && !GCC
@@ -326,6 +338,10 @@ ifeq ($(OS_ARCH)$(OS_RELEASE), AIX4.1)
-bM:SRE -bnoentry $(OS_LIBS) $(EXTRA_LIBS)
else # AIX 4.1
ifeq ($(NS_USE_GCC)_$(OS_ARCH),_WINNT)
+ifdef MOZ_PROFILE_USE
+ python $(topsrcdir)/build/win32/pgomerge.py \
+ $(notdir $(SHARED_LIBRARY:.$(DLL_SUFFIX)=)) $(DIST)/bin
+endif # MOZ_PROFILE_USE
$(LINK_DLL) -MAP $(DLLBASE) $(DLL_LIBS) $(EXTRA_LIBS) $(OBJS) $(RES)
ifdef MT
@if test -f $@.manifest; then \
@@ -333,6 +349,9 @@ ifdef MT
rm -f $@.manifest; \
fi
endif # MSVC with manifest tool
+ifdef MOZ_PROFILE_GENERATE
+ touch -t `date +%Y%m%d%H%M.%S -d "now+5seconds"` pgo.relink
+endif # MOZ_PROFILE_GENERATE
else # WINNT && !GCC
$(MKSHLIB) $(OBJS) $(RES) $(LDFLAGS) $(EXTRA_LIBS)
endif # WINNT && !GCC
@@ -341,6 +360,24 @@ ifdef ENABLE_STRIP
$(STRIP) $@
endif
+################################################################################
+
+ifdef MOZ_PROFILE_USE
+ifeq ($(NS_USE_GCC)_$(OS_ARCH),_WINNT)
+# When building with PGO, we have to make sure to re-link
+# in the MOZ_PROFILE_USE phase if we linked in the
+# MOZ_PROFILE_GENERATE phase. We'll touch this pgo.relink
+# file in the link rule in the GENERATE phase to indicate
+# that we need a relink.
+$(SHARED_LIBRARY): pgo.relink
+
+$(PROGRAM): pgo.relink
+
+endif # WINNT && !GCC
+endif # MOZ_PROFILE_USE
+
+################################################################################
+
ifeq ($(OS_ARCH),WINNT)
$(RES): $(RESNAME)
@$(MAKE_OBJDIR)
diff --git a/configure b/configure
index d6ff36f7..7c0b6434 100755
--- a/configure
+++ b/configure
@@ -713,7 +713,7 @@ test "$host_alias" != "$target_alias" &&
MOD_MAJOR_VERSION=4
MOD_MINOR_VERSION=8
-MOD_PATCH_VERSION=8
+MOD_PATCH_VERSION=9
NSPR_MODNAME=nspr20
_HAVE_PTHREADS=
USE_PTHREADS=
diff --git a/configure.in b/configure.in
index bd502c89..d9406aea 100644
--- a/configure.in
+++ b/configure.in
@@ -50,7 +50,7 @@ dnl = Defaults
dnl ========================================================
MOD_MAJOR_VERSION=4
MOD_MINOR_VERSION=8
-MOD_PATCH_VERSION=8
+MOD_PATCH_VERSION=9
NSPR_MODNAME=nspr20
_HAVE_PTHREADS=
USE_PTHREADS=
diff --git a/pr/include/prinit.h b/pr/include/prinit.h
index 075455e5..9f9de5fd 100644
--- a/pr/include/prinit.h
+++ b/pr/include/prinit.h
@@ -63,11 +63,11 @@ PR_BEGIN_EXTERN_C
** The format of the version string is
** "<major version>.<minor version>[.<patch level>] [<Beta>]"
*/
-#define PR_VERSION "4.8.8"
+#define PR_VERSION "4.8.9 Beta"
#define PR_VMAJOR 4
#define PR_VMINOR 8
-#define PR_VPATCH 8
-#define PR_BETA PR_FALSE
+#define PR_VPATCH 9
+#define PR_BETA PR_TRUE
/*
** PRVersionCheck
diff --git a/pr/src/md/windows/w95sock.c b/pr/src/md/windows/w95sock.c
index 4e67a223..cb39da8f 100644
--- a/pr/src/md/windows/w95sock.c
+++ b/pr/src/md/windows/w95sock.c
@@ -107,6 +107,7 @@ typedef struct _WSA_COMPATIBILITY_MODE {
static HMODULE libWinsock2 = NULL;
static WSAIOCTLPROC wsaioctlProc = NULL;
static PRBool socketSetCompatMode = PR_FALSE;
+static PRBool socketFixInet6RcvBuf = PR_FALSE;
void _PR_MD_InitSockets(void)
{
@@ -130,6 +131,11 @@ void _PR_MD_InitSockets(void)
}
}
}
+ else if (osvi.dwMajorVersion == 5 && osvi.dwMinorVersion == 1)
+ {
+ /* if Windows XP (32-bit) */
+ socketFixInet6RcvBuf = PR_TRUE;
+ }
}
void _PR_MD_CleanupSockets(void)
@@ -190,6 +196,27 @@ _PR_MD_SOCKET(int af, int type, int flags)
}
}
+ if (af == AF_INET6 && socketFixInet6RcvBuf)
+ {
+ int bufsize;
+ int len = sizeof(bufsize);
+ int rv;
+
+ /* Windows XP 32-bit returns an error on getpeername() for AF_INET6
+ * sockets if the receive buffer size is greater than 65535 before
+ * the connection is initiated. The default receive buffer size may
+ * be 128000 so fix it here to always be <= 65535. See bug 513659
+ * and IBM DB2 support technote "Receive/Send IPv6 Socket Size
+ * Problem in Windows XP SP2 & SP3".
+ */
+ rv = getsockopt(sock, SOL_SOCKET, SO_RCVBUF, (char*)&bufsize, &len);
+ if (rv == 0 && bufsize > 65535)
+ {
+ bufsize = 65535;
+ setsockopt(sock, SOL_SOCKET, SO_RCVBUF, (char*)&bufsize, len);
+ }
+ }
+
return (PROsfd)sock;
}
diff --git a/pr/src/misc/prnetdb.c b/pr/src/misc/prnetdb.c
index 52b72def..b8e32db4 100644
--- a/pr/src/misc/prnetdb.c
+++ b/pr/src/misc/prnetdb.c
@@ -2077,6 +2077,12 @@ PR_IMPLEMENT(PRAddrInfo *) PR_GetAddrInfoByName(const char *hostname,
hints.ai_socktype = SOCK_STREAM;
rv = GETADDRINFO(hostname, NULL, &hints, &res);
+#ifdef AI_ADDRCONFIG
+ if (rv == EAI_BADFLAGS) {
+ hints.ai_flags &= ~AI_ADDRCONFIG;
+ rv = GETADDRINFO(hostname, NULL, &hints, &res);
+ }
+#endif
if (rv == 0)
return (PRAddrInfo *) res;
diff --git a/pr/tests/vercheck.c b/pr/tests/vercheck.c
index 6569c793..70791e08 100644
--- a/pr/tests/vercheck.c
+++ b/pr/tests/vercheck.c
@@ -52,10 +52,10 @@
#include <stdlib.h>
/*
- * This release (4.8.8) is backward compatible with the
+ * This release (4.8.9) is backward compatible with the
* 4.0.x, 4.1.x, 4.2.x, 4.3.x, 4.4.x, 4.5.x, 4.6.x, 4.7.x,
- * 4.8, 4.8.1, 4.8.2, 4.8.3, 4.8.4, 4.8.5, 4.8.6 and 4.8.7 releases.
- * It, of course, is compatible with itself.
+ * 4.8, 4.8.1, 4.8.2, 4.8.3, 4.8.4, 4.8.5, 4.8.6, 4.8.7, and
+ * 4.8.8 releases. It, of course, is compatible with itself.
*/
static char *compatible_version[] = {
"4.0", "4.0.1", "4.1", "4.1.1", "4.1.2", "4.1.3",
@@ -66,7 +66,7 @@ static char *compatible_version[] = {
"4.7", "4.7.1", "4.7.2", "4.7.3", "4.7.4", "4.7.5",
"4.7.6",
"4.8", "4.8.1", "4.8.2", "4.8.3", "4.8.4", "4.8.5",
- "4.8.6", "4.8.7", PR_VERSION
+ "4.8.6", "4.8.7", "4.8.8", PR_VERSION
};
/*
@@ -81,7 +81,7 @@ static char *incompatible_version[] = {
"3.0", "3.0.1",
"3.1", "3.1.1", "3.1.2", "3.1.3",
"3.5", "3.5.1",
- "4.8.9",
+ "4.8.10",
"4.9", "4.9.1",
"10.0", "11.1", "12.14.20"
};