xref: /aoo41x/main/nss/nss.patch (revision e32eb42e)
1*e32eb42eStruckmandiff -ur misc/nss-3.25/nspr/config/rules.mk misc/build/nss-3.25/nspr/config/rules.mk
2*e32eb42eStruckman--- misc/nss-3.25/nspr/config/rules.mk	2016-02-12 05:51:25.000000000 -0800
3*e32eb42eStruckman+++ misc/build/nss-3.25/nspr/config/rules.mk	2016-07-14 23:47:54.492034000 -0700
4*e32eb42eStruckman@@ -382,7 +382,12 @@
5cdf0e10cSrcweir ifdef NS_USE_GCC
6cdf0e10cSrcweir 	$(RC) $(RCFLAGS) $(filter-out -U%,$(DEFINES)) $(INCLUDES:-I%=--include-dir %) -o $@ $<
7cdf0e10cSrcweir else
8cdf0e10cSrcweir-	$(RC) $(RCFLAGS) $(filter-out -U%,$(DEFINES)) $(INCLUDES) -Fo$@ $<
9b597708bSHerbert Dürr+        #We remove stl from the paths to avoid that rc.exe finds the stl wrapper
10b597708bSHerbert Dürr+        #of AOO. stlport includes the system stl which will fail. By removing it,
11cdf0e10cSrcweir+        #rc will use the stl from the system if the path is in the INCLUDE
12cdf0e10cSrcweir+        #variable.
13cdf0e10cSrcweir+	INCLUDE="$(subst /stl,,$(INCLUDE))" $(RC) $(RCFLAGS) $(filter-out -U%,$(DEFINES)) $(INCLUDES) -Fo$@ $<
14cdf0e10cSrcweir+
15cdf0e10cSrcweir endif # GCC
16cdf0e10cSrcweir 	@echo $(RES) finished
17cdf0e10cSrcweir endif
18*e32eb42eStruckmandiff -ur misc/nss-3.25/nspr/configure misc/build/nss-3.25/nspr/configure
19*e32eb42eStruckman--- misc/nss-3.25/nspr/configure	2016-02-12 05:51:25.000000000 -0800
20*e32eb42eStruckman+++ misc/build/nss-3.25/nspr/configure	2016-07-14 23:47:54.531323000 -0700
21*e32eb42eStruckman@@ -6992,7 +6992,7 @@
22cdf0e10cSrcweir     PR_MD_CSRCS=linux.c
23cdf0e10cSrcweir     MKSHLIB='$(CC) $(DSO_LDOPTS) -o $@'
24cdf0e10cSrcweir     DSO_CFLAGS=-fPIC
25cdf0e10cSrcweir-    DSO_LDOPTS='-shared -Wl,-soname -Wl,$(notdir $@)'
26cdf0e10cSrcweir+    DSO_LDOPTS='-shared -Wl,-rpath,\$$ORIGIN -Wl,-soname -Wl,$(notdir $@)'
27cdf0e10cSrcweir     _OPTIMIZE_FLAGS=-O2
28cdf0e10cSrcweir     _DEBUG_FLAGS="-g -fno-inline"  # most people on linux use gcc/gdb, and that
29cdf0e10cSrcweir                                    # combo is not yet good at debugging inlined
30*e32eb42eStruckmandiff -ur misc/nss-3.25/nspr/pr/include/pratom.h misc/build/nss-3.25/nspr/pr/include/pratom.h
31*e32eb42eStruckman--- misc/nss-3.25/nspr/pr/include/pratom.h	2016-02-12 05:51:25.000000000 -0800
32*e32eb42eStruckman+++ misc/build/nss-3.25/nspr/pr/include/pratom.h	2016-07-14 23:47:54.538325000 -0700
33*e32eb42eStruckman@@ -81,7 +81,9 @@
34*e32eb42eStruckman #if defined(_WIN32) && !defined(_WIN32_WCE) && \
35*e32eb42eStruckman     (!defined(_MSC_VER) || (_MSC_VER >= 1310))
36cdf0e10cSrcweir
37*e32eb42eStruckman+PR_END_EXTERN_C
38*e32eb42eStruckman #include <intrin.h>
39*e32eb42eStruckman+PR_BEGIN_EXTERN_C
40*e32eb42eStruckman
41*e32eb42eStruckman #ifdef _MSC_VER
42*e32eb42eStruckman #pragma intrinsic(_InterlockedIncrement)
43*e32eb42eStruckmandiff -ur misc/nss-3.25/nss/Makefile misc/build/nss-3.25/nss/Makefile
44*e32eb42eStruckman--- misc/nss-3.25/nss/Makefile	2016-06-20 10:11:28.000000000 -0700
45*e32eb42eStruckman+++ misc/build/nss-3.25/nss/Makefile	2016-07-14 23:47:54.544021000 -0700
46*e32eb42eStruckman@@ -76,6 +76,9 @@
47*e32eb42eStruckman ifeq ($(OS_TARGET),WIN95)
48*e32eb42eStruckman NSPR_CONFIGURE_OPTS += --enable-win32-target=WIN95
49*e32eb42eStruckman endif
50*e32eb42eStruckman+ifdef MACOS_SDK_DIR
51*e32eb42eStruckman+NSPR_CONFIGURE_OPTS += --with-macos-sdk=$(MACOS_SDK_DIR)
52*e32eb42eStruckman+endif
53*e32eb42eStruckman ifdef USE_DEBUG_RTL
54*e32eb42eStruckman NSPR_CONFIGURE_OPTS += --enable-debug-rtl
55*e32eb42eStruckman endif
56*e32eb42eStruckmandiff -ur misc/nss-3.25/nss/cmd/platlibs.mk misc/build/nss-3.25/nss/cmd/platlibs.mk
57*e32eb42eStruckman--- misc/nss-3.25/nss/cmd/platlibs.mk	2016-06-20 10:11:28.000000000 -0700
58*e32eb42eStruckman+++ misc/build/nss-3.25/nss/cmd/platlibs.mk	2016-07-14 23:47:54.549839000 -0700
59*e32eb42eStruckman@@ -10,17 +10,18 @@
60*e32eb42eStruckman
61*e32eb42eStruckman ifeq ($(OS_ARCH), SunOS)
62*e32eb42eStruckman ifeq ($(USE_64), 1)
63*e32eb42eStruckman-EXTRA_SHARED_LIBS += -R '$$ORIGIN/../lib:/usr/lib/mps/secv1/64:/usr/lib/mps/64'
64*e32eb42eStruckman+#In AOO we would probable put the executables next to libs
65*e32eb42eStruckman+EXTRA_SHARED_LIBS += -R '$$ORIGIN'
66*e32eb42eStruckman else
67*e32eb42eStruckman-EXTRA_SHARED_LIBS += -R '$$ORIGIN/../lib:/usr/lib/mps/secv1:/usr/lib/mps'
68*e32eb42eStruckman+EXTRA_SHARED_LIBS += -R '$$ORIGIN'
69*e32eb42eStruckman endif
70*e32eb42eStruckman endif
71*e32eb42eStruckman
72*e32eb42eStruckman ifeq ($(OS_ARCH), Linux)
73*e32eb42eStruckman ifeq ($(USE_64), 1)
74*e32eb42eStruckman-EXTRA_SHARED_LIBS += -Wl,-rpath,'$$ORIGIN/../lib64:/opt/sun/private/lib64:$$ORIGIN/../lib'
75*e32eb42eStruckman+EXTRA_SHARED_LIBS += -Wl,-rpath,'$$ORIGIN'
76*e32eb42eStruckman else
77*e32eb42eStruckman-EXTRA_SHARED_LIBS += -Wl,-rpath,'$$ORIGIN/../lib:/opt/sun/private/lib'
78*e32eb42eStruckman+EXTRA_SHARED_LIBS += -Wl,-rpath,'$$ORIGIN'
79*e32eb42eStruckman endif
80*e32eb42eStruckman endif
81*e32eb42eStruckman
82*e32eb42eStruckmandiff -ur misc/nss-3.25/nss/cmd/shlibsign/Makefile misc/build/nss-3.25/nss/cmd/shlibsign/Makefile
83*e32eb42eStruckman--- misc/nss-3.25/nss/cmd/shlibsign/Makefile	2016-06-20 10:11:28.000000000 -0700
84*e32eb42eStruckman+++ misc/build/nss-3.25/nss/cmd/shlibsign/Makefile	2016-07-14 23:47:54.554784000 -0700
85*e32eb42eStruckman@@ -49,10 +49,15 @@
86*e32eb42eStruckman CHECKLIBS =
87*e32eb42eStruckman CHECKLOC =
88*e32eb42eStruckman else
89*e32eb42eStruckman-CHECKLIBS = $(DIST)/lib/$(DLL_PREFIX)softokn3.$(DLL_SUFFIX)
90*e32eb42eStruckman-CHECKLIBS += $(wildcard $(DIST)/lib/$(DLL_PREFIX)freebl*3.$(DLL_SUFFIX))
91*e32eb42eStruckman+# Signing causes loading of some system library which in turn loads
92*e32eb42eStruckman+# libsqlite3. Then it loads libsqulite3 from nss, which does not have the proper
93*e32eb42eStruckman+# version. Therefore signing fails.
94*e32eb42eStruckman+# We cannot build with the system sqlite3, because it is too old (SDK
95*e32eb42eStruckman+# 10.4). Otherwise one could set NSS_USE_SYSTEM_SQLITE=1 and use the system lib.
96*e32eb42eStruckman+#CHECKLIBS = $(DIST)/lib/$(DLL_PREFIX)softokn3.$(DLL_SUFFIX)
97*e32eb42eStruckman+#CHECKLIBS += $(wildcard $(DIST)/lib/$(DLL_PREFIX)freebl*3.$(DLL_SUFFIX))
98*e32eb42eStruckman ifndef NSS_DISABLE_DBM
99*e32eb42eStruckman-CHECKLIBS += $(DIST)/lib/$(DLL_PREFIX)nssdbm3.$(DLL_SUFFIX)
100*e32eb42eStruckman+#CHECKLIBS += $(DIST)/lib/$(DLL_PREFIX)nssdbm3.$(DLL_SUFFIX)
101*e32eb42eStruckman endif
102*e32eb42eStruckman CHECKLOC = $(CHECKLIBS:.$(DLL_SUFFIX)=.chk)
103*e32eb42eStruckman
104*e32eb42eStruckmandiff -ur misc/nss-3.25/nss/coreconf/Darwin.mk misc/build/nss-3.25/nss/coreconf/Darwin.mk
105*e32eb42eStruckman--- misc/nss-3.25/nss/coreconf/Darwin.mk	2016-06-20 10:11:28.000000000 -0700
106*e32eb42eStruckman+++ misc/build/nss-3.25/nss/coreconf/Darwin.mk	2016-07-14 23:47:54.560325000 -0700
107*e32eb42eStruckman@@ -6,10 +6,12 @@
108c38ced1bSHerbert Dürr include $(CORE_DEPTH)/coreconf/UNIX.mk
109*e32eb42eStruckman include $(CORE_DEPTH)/coreconf/Werror.mk
110cdf0e10cSrcweir
111c38ced1bSHerbert Dürr-DEFAULT_COMPILER = gcc
112c38ced1bSHerbert Dürr+DEFAULT_COMPILER = cc
113c38ced1bSHerbert Dürr+
114cdf0e10cSrcweir+# CC is taken from environment automatically.
115cdf0e10cSrcweir+#CC		= cc
116cdf0e10cSrcweir+CCC		= $(CXX)
117c38ced1bSHerbert Dürr
118c38ced1bSHerbert Dürr-CC		= gcc
119c38ced1bSHerbert Dürr-CCC		= g++
120cdf0e10cSrcweir RANLIB		= ranlib
121cdf0e10cSrcweir
122cdf0e10cSrcweir ifndef CPU_ARCH
123*e32eb42eStruckmandiff -ur misc/nss-3.25/nss/coreconf/FreeBSD.mk misc/build/nss-3.25/nss/coreconf/FreeBSD.mk
124*e32eb42eStruckman--- misc/nss-3.25/nss/coreconf/FreeBSD.mk	2016-06-20 10:11:28.000000000 -0700
125*e32eb42eStruckman+++ misc/build/nss-3.25/nss/coreconf/FreeBSD.mk	2016-07-14 23:47:54.564724000 -0700
126*e32eb42eStruckman@@ -5,9 +5,8 @@
127*e32eb42eStruckman
128*e32eb42eStruckman include $(CORE_DEPTH)/coreconf/UNIX.mk
129*e32eb42eStruckman
130*e32eb42eStruckman-DEFAULT_COMPILER	= gcc
131*e32eb42eStruckman-CC			= gcc
132*e32eb42eStruckman-CCC			= g++
133*e32eb42eStruckman+DEFAULT_COMPILER	= $(CC)
134*e32eb42eStruckman+CCC			= $(CXX)
135*e32eb42eStruckman RANLIB			= ranlib
136*e32eb42eStruckman
137*e32eb42eStruckman CPU_ARCH		= $(OS_TEST)
138*e32eb42eStruckman@@ -21,7 +20,7 @@
139*e32eb42eStruckman CPU_ARCH		= x86_64
140*e32eb42eStruckman endif
141*e32eb42eStruckman
142*e32eb42eStruckman-OS_CFLAGS		= $(DSO_CFLAGS) -Wall -Wno-switch -DFREEBSD -DHAVE_STRERROR -DHAVE_BSD_FLOCK
143*e32eb42eStruckman+OS_CFLAGS		= $(DSO_CFLAGS) -Wall -Wno-switch -DFREEBSD -DHAVE_STRERROR -DHAVE_UNISTD_H -DHAVE_BSD_FLOCK
144*e32eb42eStruckman
145*e32eb42eStruckman DSO_CFLAGS		= -fPIC
146*e32eb42eStruckman DSO_LDOPTS		= -shared -Wl,-soname -Wl,$(notdir $@)
147*e32eb42eStruckmandiff -ur misc/nss-3.25/nss/coreconf/Linux.mk misc/build/nss-3.25/nss/coreconf/Linux.mk
148*e32eb42eStruckman--- misc/nss-3.25/nss/coreconf/Linux.mk	2016-06-20 10:11:28.000000000 -0700
149*e32eb42eStruckman+++ misc/build/nss-3.25/nss/coreconf/Linux.mk	2016-07-14 23:47:54.569918000 -0700
150c38ced1bSHerbert Dürr@@ -16,8 +16,11 @@
151cdf0e10cSrcweir 	IMPL_STRATEGY = _PTH
152cdf0e10cSrcweir endif
153cdf0e10cSrcweir
154cdf0e10cSrcweir-CC			= gcc
155cdf0e10cSrcweir-CCC			= g++
156cdf0e10cSrcweir+# CC is taken from environment automatically.
157cdf0e10cSrcweir+#CC			= gcc
158cdf0e10cSrcweir+# Use CCC from environment.
159cdf0e10cSrcweir+#CCC			= g++
160cdf0e10cSrcweir+CCC		= $(CXX)
161cdf0e10cSrcweir RANLIB			= ranlib
162cdf0e10cSrcweir
163cdf0e10cSrcweir DEFAULT_COMPILER = gcc
164*e32eb42eStruckman@@ -139,7 +142,7 @@
165*e32eb42eStruckman OS_PTHREAD = -lpthread
166*e32eb42eStruckman endif
167*e32eb42eStruckman
168*e32eb42eStruckman-OS_CFLAGS		= $(DSO_CFLAGS) $(OS_REL_CFLAGS) $(ARCHFLAG) -pipe -ffunction-sections -fdata-sections -DLINUX -Dlinux -DHAVE_STRERROR
169*e32eb42eStruckman+OS_CFLAGS		= $(DSO_CFLAGS) $(OS_REL_CFLAGS) $(ARCHFLAG) -pipe -ffunction-sections -fdata-sections -DLINUX -Dlinux -DHAVE_STRERROR -DHAVE_UNISTD_H
170*e32eb42eStruckman OS_LIBS			= $(OS_PTHREAD) -ldl -lc
171*e32eb42eStruckman
172*e32eb42eStruckman ifdef USE_PTHREADS
173*e32eb42eStruckman@@ -149,7 +152,7 @@
174*e32eb42eStruckman ARCH			= linux
175*e32eb42eStruckman
176*e32eb42eStruckman DSO_CFLAGS		= -fPIC
177*e32eb42eStruckman-DSO_LDOPTS		= -shared $(ARCHFLAG) -Wl,--gc-sections
178*e32eb42eStruckman+DSO_LDOPTS		= -shared $(ARCHFLAG) -Wl,--gc-sections '-Wl,-rpath,$$ORIGIN'
179*e32eb42eStruckman # The linker on Red Hat Linux 7.2 and RHEL 2.1 (GNU ld version 2.11.90.0.8)
180cdf0e10cSrcweir # incorrectly reports undefined references in the libraries we link with, so
181cdf0e10cSrcweir # we don't use -z defs there.
182*e32eb42eStruckman@@ -189,8 +192,13 @@
183c38ced1bSHerbert Dürr endif
184c38ced1bSHerbert Dürr endif
185cdf0e10cSrcweir
186cdf0e10cSrcweir+ifeq ($(SYSTEM_ZLIB),YES)
187cdf0e10cSrcweir+# Currently (3.12.4) only the tools modutil and signtool are linked with libz
188cdf0e10cSrcweir+# If USE_SYSTEM_ZLIB is not set then the tools link statically libzlib.a which
189cdf0e10cSrcweir+# is also build in nss.
190cdf0e10cSrcweir USE_SYSTEM_ZLIB = 1
191cdf0e10cSrcweir ZLIB_LIBS = -lz
192cdf0e10cSrcweir+endif
193cdf0e10cSrcweir
194cdf0e10cSrcweir # The -rpath '$$ORIGIN' linker option instructs this library to search for its
195cdf0e10cSrcweir # dependencies in the same directory where it resides.
196*e32eb42eStruckmandiff -ur misc/nss-3.25/nss/coreconf/SunOS5.mk misc/build/nss-3.25/nss/coreconf/SunOS5.mk
197*e32eb42eStruckman--- misc/nss-3.25/nss/coreconf/SunOS5.mk	2016-06-20 10:11:28.000000000 -0700
198*e32eb42eStruckman+++ misc/build/nss-3.25/nss/coreconf/SunOS5.mk	2016-07-14 23:47:54.575211000 -0700
199c38ced1bSHerbert Dürr@@ -48,8 +48,12 @@
200cdf0e10cSrcweir 	    # OPTIMIZER += -mno-omit-leaf-frame-pointer -fno-omit-frame-pointer
201cdf0e10cSrcweir 	endif
202cdf0e10cSrcweir else
203cdf0e10cSrcweir-	CC         = cc
204cdf0e10cSrcweir-	CCC        = CC
205cdf0e10cSrcweir+# CC is taken from environment automatically.
206cdf0e10cSrcweir+#	CC         = cc
207cdf0e10cSrcweir+# Use CXX from environment.
208cdf0e10cSrcweir+#	CCC        = CC
209cdf0e10cSrcweir+        CCC       = $(CXX)
210cdf0e10cSrcweir+
211cdf0e10cSrcweir 	ASFLAGS   += -Wa,-P
212cdf0e10cSrcweir 	OS_CFLAGS += $(NOMD_OS_CFLAGS) $(ARCHFLAG)
213cdf0e10cSrcweir 	ifndef BUILD_OPT
214*e32eb42eStruckmandiff -ur misc/nss-3.25/nss/coreconf/arch.mk misc/build/nss-3.25/nss/coreconf/arch.mk
215*e32eb42eStruckman--- misc/nss-3.25/nss/coreconf/arch.mk	2016-06-20 10:11:28.000000000 -0700
216*e32eb42eStruckman+++ misc/build/nss-3.25/nss/coreconf/arch.mk	2016-07-14 23:47:54.579901000 -0700
217*e32eb42eStruckman@@ -294,7 +294,12 @@
218*e32eb42eStruckman ifdef CROSS_COMPILE
219*e32eb42eStruckman OBJDIR_NAME = $(OS_TARGET)$(OS_RELEASE)$(CPU_TAG)$(LIBC_TAG)$(IMPL_STRATEGY)$(OBJDIR_TAG).OBJ
220*e32eb42eStruckman else
221cdf0e10cSrcweir-OBJDIR_NAME = $(OS_TARGET)$(OS_RELEASE)$(CPU_TAG)$(COMPILER_TAG)$(LIBC_TAG)$(IMPL_STRATEGY)$(OBJDIR_TAG).OBJ
222*e32eb42eStruckman+# OBJDIR_NAME is used to build the directory containing the built objects, for
223cdf0e10cSrcweir+# example mozilla/dist/Linux2.6_x86_glibc_PTH_DBG.OBJ
224cdf0e10cSrcweir+# We need to deliver the contents of that folder into the solver. To make that easier
225*e32eb42eStruckman+# in the makefile we rename this directory to "out".
226cdf0e10cSrcweir+#OBJDIR_NAME = $(OS_TARGET)$(OS_RELEASE)$(CPU_TAG)$(COMPILER_TAG)$(LIBC_TAG)$(IMPL_STRATEGY)$(OBJDIR_TAG).OBJ
227cdf0e10cSrcweir+OBJDIR_NAME = out
228*e32eb42eStruckman endif
229cdf0e10cSrcweir
230*e32eb42eStruckman
231*e32eb42eStruckmandiff -ur misc/nss-3.25/nss/coreconf/rules.mk misc/build/nss-3.25/nss/coreconf/rules.mk
232*e32eb42eStruckman--- misc/nss-3.25/nss/coreconf/rules.mk	2016-06-20 10:11:28.000000000 -0700
233*e32eb42eStruckman+++ misc/build/nss-3.25/nss/coreconf/rules.mk	2016-07-14 23:47:54.586736000 -0700
234*e32eb42eStruckman@@ -322,7 +322,12 @@
235cdf0e10cSrcweir ifdef NS_USE_GCC
236cdf0e10cSrcweir 	$(RC) $(filter-out -U%,$(DEFINES)) $(INCLUDES:-I%=--include-dir %) -o $@ $<
237cdf0e10cSrcweir else
238cdf0e10cSrcweir-	$(RC) $(filter-out -U%,$(DEFINES)) $(INCLUDES) -Fo$@ $<
239cdf0e10cSrcweir+        #We remove stl from the paths to avoid that rc.exe finds the stlport of
240cdf0e10cSrcweir+        #OOo. stlport includes the system stl which will fail. By removing it,
241cdf0e10cSrcweir+        #rc will use the stl from the system if the path is in the INCLUDE
242cdf0e10cSrcweir+        #variable.
243cdf0e10cSrcweir+	INCLUDE="$(subst /stl,,$(INCLUDE))" $(RC) $(filter-out -U%,$(DEFINES)) $(INCLUDES) -Fo$@ $<
244cdf0e10cSrcweir+
245cdf0e10cSrcweir endif
246cdf0e10cSrcweir 	@echo $(RES) finished
247cdf0e10cSrcweir endif
248*e32eb42eStruckmandiff -ur misc/nss-3.25/nss/lib/zlib/inflate.c misc/build/nss-3.25/nss/lib/zlib/inflate.c
249*e32eb42eStruckman--- misc/nss-3.25/nss/lib/zlib/inflate.c	2016-06-20 10:11:28.000000000 -0700
250*e32eb42eStruckman+++ misc/build/nss-3.25/nss/lib/zlib/inflate.c	2016-07-14 23:47:54.598199000 -0700
251*e32eb42eStruckman@@ -1472,9 +1472,9 @@
252*e32eb42eStruckman {
253*e32eb42eStruckman     struct inflate_state FAR *state;
254cdf0e10cSrcweir
255*e32eb42eStruckman-    if (strm == Z_NULL || strm->state == Z_NULL) return -1L << 16;
256*e32eb42eStruckman+    if (strm == Z_NULL || strm->state == Z_NULL) return ~0UL << 16;
257*e32eb42eStruckman     state = (struct inflate_state FAR *)strm->state;
258*e32eb42eStruckman-    return ((long)(state->back) << 16) +
259*e32eb42eStruckman+    return ((unsigned long)(state->back) << 16) +
260*e32eb42eStruckman         (state->mode == COPY ? state->length :
261*e32eb42eStruckman             (state->mode == MATCH ? state->was - state->length : 0));
262*e32eb42eStruckman }
263