summaryrefslogtreecommitdiff
path: root/nss
diff options
context:
space:
mode:
Diffstat (limited to 'nss')
-rw-r--r--nss/dtoa.patch110
-rw-r--r--nss/makefile.mk6
-rw-r--r--nss/nss.patch30
3 files changed, 136 insertions, 10 deletions
diff --git a/nss/dtoa.patch b/nss/dtoa.patch
new file mode 100644
index 000000000000..3632df335f83
--- /dev/null
+++ b/nss/dtoa.patch
@@ -0,0 +1,110 @@
+--- misc/mozilla/nsprpub/pr/src/misc/prdtoa.c 20 Mar 2009 03:41:21 -0000 4.7
++++ misc/build/mozilla/nsprpub/pr/src/misc/prdtoa.c 15 Sep 2009 00:10:20 -0000
+@@ -169,17 +169,22 @@ void _PR_CleanupDtoa(void)
+ * Llong, #define #ULLong to be the corresponding unsigned type.
+ * #define KR_headers for old-style C function headers.
+ * #define Bad_float_h if your system lacks a float.h or if it does not
+ * define some or all of DBL_DIG, DBL_MAX_10_EXP, DBL_MAX_EXP,
+ * FLT_RADIX, FLT_ROUNDS, and DBL_MAX.
+ * #define MALLOC your_malloc, where your_malloc(n) acts like malloc(n)
+ * if memory is available and otherwise does something you deem
+ * appropriate. If MALLOC is undefined, malloc will be invoked
+- * directly -- and assumed always to succeed.
++ * directly -- and assumed always to succeed. Similarly, if you
++ * want something other than the system's free() to be called to
++ * recycle memory acquired from MALLOC, #define FREE to be the
++ * name of the alternate routine. (FREE or free is only called in
++ * pathological cases, e.g., in a dtoa call after a dtoa return in
++ * mode 3 with thousands of digits requested.)
+ * #define Omit_Private_Memory to omit logic (added Jan. 1998) for making
+ * memory allocations from a private pool of memory when possible.
+ * When used, the private pool is PRIVATE_MEM bytes long: 2304 bytes,
+ * unless #defined to be a different length. This default length
+ * suffices to get rid of MALLOC calls except for unusual cases,
+ * such as decimal-to-binary conversion of a very long string of
+ * digits. The longest string dtoa can return is about 751 bytes
+ * long. For conversions by strtod of strings of 800 digits and
+@@ -553,17 +558,17 @@ extern double rnd_prod(double, double),
+ #endif
+ #endif /* NO_LONG_LONG */
+
+ #ifndef MULTIPLE_THREADS
+ #define ACQUIRE_DTOA_LOCK(n) /*nothing*/
+ #define FREE_DTOA_LOCK(n) /*nothing*/
+ #endif
+
+-#define Kmax 15
++#define Kmax 7
+
+ struct
+ Bigint {
+ struct Bigint *next;
+ int k, maxwds, sign, wds;
+ ULong x[1];
+ };
+
+@@ -581,27 +586,28 @@ Balloc
+ {
+ int x;
+ Bigint *rv;
+ #ifndef Omit_Private_Memory
+ unsigned int len;
+ #endif
+
+ ACQUIRE_DTOA_LOCK(0);
+- if (rv = freelist[k]) {
++ /* The k > Kmax case does not need ACQUIRE_DTOA_LOCK(0), */
++ /* but this case seems very unlikely. */
++ if (k <= Kmax && (rv = freelist[k]))
+ freelist[k] = rv->next;
+- }
+ else {
+ x = 1 << k;
+ #ifdef Omit_Private_Memory
+ rv = (Bigint *)MALLOC(sizeof(Bigint) + (x-1)*sizeof(ULong));
+ #else
+ len = (sizeof(Bigint) + (x-1)*sizeof(ULong) + sizeof(double) - 1)
+ /sizeof(double);
+- if (pmem_next - private_mem + len <= PRIVATE_mem) {
++ if (k <= Kmax && pmem_next - private_mem + len <= PRIVATE_mem) {
+ rv = (Bigint*)pmem_next;
+ pmem_next += len;
+ }
+ else
+ rv = (Bigint*)MALLOC(len*sizeof(double));
+ #endif
+ rv->k = k;
+ rv->maxwds = x;
+@@ -615,20 +621,28 @@ Balloc
+ Bfree
+ #ifdef KR_headers
+ (v) Bigint *v;
+ #else
+ (Bigint *v)
+ #endif
+ {
+ if (v) {
+- ACQUIRE_DTOA_LOCK(0);
+- v->next = freelist[v->k];
+- freelist[v->k] = v;
+- FREE_DTOA_LOCK(0);
++ if (v->k > Kmax)
++#ifdef FREE
++ FREE((void*)v);
++#else
++ free((void*)v);
++#endif
++ else {
++ ACQUIRE_DTOA_LOCK(0);
++ v->next = freelist[v->k];
++ freelist[v->k] = v;
++ FREE_DTOA_LOCK(0);
++ }
+ }
+ }
+
+ #define Bcopy(x,y) memcpy((char *)&x->sign, (char *)&y->sign, \
+ y->wds*sizeof(Long) + 2*sizeof(int))
+
+ static Bigint *
+ multadd
diff --git a/nss/makefile.mk b/nss/makefile.mk
index 8c9fb41ef768..2123c36b57a1 100644
--- a/nss/makefile.mk
+++ b/nss/makefile.mk
@@ -47,7 +47,9 @@ all:
TARFILE_NAME=nss_3_12_4
TARFILE_ROOTDIR=mozilla
-PATCH_FILES=nss.patch
+PATCH_FILES=nss.patch dtoa.patch
+ # Note: dtoa.patch fixes https://bugzilla.mozilla.org/show_bug.cgi?id=516396. It can be removed as soon as
+ # we upgrade to a new NSS version which already contains this fix.
.IF "$(debug)" != ""
.ELSE
@@ -57,7 +59,7 @@ BUILD_OPT=1
.IF "$(GUI)"=="UNX"
.IF "$(OS)$(COM)"=="LINUXGCC"
-.IF "$(CPU)"=="X"
+.IF "$(BUILD64)"=="1"
# force 64-bit buildmode
USE_64:=1
.EXPORT : USE_64
diff --git a/nss/nss.patch b/nss/nss.patch
index d37d892dd6b8..32831ea29d52 100644
--- a/nss/nss.patch
+++ b/nss/nss.patch
@@ -1,5 +1,5 @@
--- misc/mozilla/nsprpub/config/rules.mk 2009-05-02 01:08:01.000000000 +0200
-+++ misc/build/mozilla/nsprpub/config/rules.mk 2009-09-17 10:29:39.823155149 +0200
++++ misc/build/mozilla/nsprpub/config/rules.mk 2009-10-20 17:03:24.733286198 +0200
@@ -350,7 +350,12 @@
ifdef NS_USE_GCC
$(RC) $(RCFLAGS) $(filter-out -U%,$(DEFINES)) $(INCLUDES:-I%=--include-dir %) -o $@ $<
@@ -15,7 +15,7 @@
@echo $(RES) finished
endif
--- misc/mozilla/nsprpub/configure 2009-05-08 15:12:31.000000000 +0200
-+++ misc/build/mozilla/nsprpub/configure 2009-09-17 10:31:55.064081763 +0200
++++ misc/build/mozilla/nsprpub/configure 2009-10-20 17:03:24.759501457 +0200
@@ -3898,7 +3898,7 @@
PR_MD_CSRCS=linux.c
MKSHLIB='$(CC) $(DSO_LDOPTS) -o $@'
@@ -26,7 +26,7 @@
_DEBUG_FLAGS="-g -fno-inline" # most people on linux use gcc/gdb, and that
# combo is not yet good at debugging inlined
--- misc/mozilla/security/coreconf/Darwin.mk 2009-07-30 23:36:02.000000000 +0200
-+++ misc/build/mozilla/security/coreconf/Darwin.mk 2009-09-17 11:11:36.442683705 +0200
++++ misc/build/mozilla/security/coreconf/Darwin.mk 2009-10-20 17:03:24.767804881 +0200
@@ -39,8 +39,12 @@
DEFAULT_COMPILER = cc
@@ -43,7 +43,7 @@
ifndef CPU_ARCH
--- misc/mozilla/security/coreconf/Linux.mk 2009-07-30 01:43:41.000000000 +0200
-+++ misc/build/mozilla/security/coreconf/Linux.mk 2009-09-17 10:39:40.372245066 +0200
++++ misc/build/mozilla/security/coreconf/Linux.mk 2009-10-20 17:04:09.972612751 +0200
@@ -46,8 +46,11 @@
IMPL_STRATEGY = _PTH
endif
@@ -67,8 +67,22 @@
DSO_LDFLAGS =
LDFLAGS += $(ARCHFLAG)
+@@ -161,8 +164,13 @@
+ #
+ CPU_TAG = _$(CPU_ARCH)
+
++ifeq ($(SYSTEM_ZLIB),YES)
++# Currently (3.12.4) only the tools modutil and signtool are linked with libz
++# If USE_SYSTEM_ZLIB is not set then the tools link statically libzlib.a which
++# is also build in nss.
+ USE_SYSTEM_ZLIB = 1
+ ZLIB_LIBS = -lz
++endif
+
+ # The -rpath '$$ORIGIN' linker option instructs this library to search for its
+ # dependencies in the same directory where it resides.
--- misc/mozilla/security/coreconf/SunOS5.mk 2009-06-11 02:55:32.000000000 +0200
-+++ misc/build/mozilla/security/coreconf/SunOS5.mk 2009-09-17 10:42:17.845459669 +0200
++++ misc/build/mozilla/security/coreconf/SunOS5.mk 2009-10-20 17:03:24.786509911 +0200
@@ -89,8 +89,12 @@
# OPTIMIZER += -mno-omit-leaf-frame-pointer -fno-omit-frame-pointer
endif
@@ -85,7 +99,7 @@
OS_CFLAGS += $(NOMD_OS_CFLAGS) $(ARCHFLAG)
ifndef BUILD_OPT
--- misc/mozilla/security/coreconf/arch.mk 2009-06-05 04:14:49.000000000 +0200
-+++ misc/build/mozilla/security/coreconf/arch.mk 2009-09-17 10:45:27.710858021 +0200
++++ misc/build/mozilla/security/coreconf/arch.mk 2009-10-20 17:03:24.807236644 +0200
@@ -324,7 +324,12 @@
# IMPL_STRATEGY may be defined too.
#
@@ -101,7 +115,7 @@
ifeq (,$(filter-out WIN%,$(OS_TARGET)))
ifndef BUILD_OPT
--- misc/mozilla/security/coreconf/rules.mk 2009-08-11 05:23:39.000000000 +0200
-+++ misc/build/mozilla/security/coreconf/rules.mk 2009-09-17 10:48:07.361462582 +0200
++++ misc/build/mozilla/security/coreconf/rules.mk 2009-10-20 17:03:24.815121351 +0200
@@ -355,7 +355,12 @@
ifdef NS_USE_GCC
$(RC) $(filter-out -U%,$(DEFINES)) $(INCLUDES:-I%=--include-dir %) -o $@ $<
@@ -117,7 +131,7 @@
@echo $(RES) finished
endif
--- misc/mozilla/security/nss/cmd/platlibs.mk 2009-06-18 01:01:48.000000000 +0200
-+++ misc/build/mozilla/security/nss/cmd/platlibs.mk 2009-09-17 11:08:16.697236076 +0200
++++ misc/build/mozilla/security/nss/cmd/platlibs.mk 2009-10-20 17:03:24.831220397 +0200
@@ -41,27 +41,28 @@
ifeq ($(OS_ARCH), SunOS)
ifeq ($(BUILD_SUN_PKG), 1)