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