nss.patch (0ae430aa) nss.patch (f1341198)
1diff -ur misc/nss-3.39/nspr/configure misc/build/nss-3.39/nspr/configure
2--- misc/nss-3.39/nspr/configure 2018-08-28 05:42:28.000000000 -0700
1diff -ur misc/nss-3.39/nspr/configure misc/build/nss-3.39/nspr/configure
2--- misc/nss-3.39/nspr/configure 2018-08-28 05:42:28.000000000 -0700
3+++ misc/build/nss-3.39/nspr/configure 2018-09-10 10:30:19.953743000 -0700
3+++ misc/build/nss-3.39/nspr/configure 2020-10-06 07:41:59.563345390 -0700
4@@ -7039,7 +7039,7 @@
5 PR_MD_CSRCS=linux.c
6 MKSHLIB='$(CC) $(DSO_LDOPTS) -o $@'
7 DSO_CFLAGS=-fPIC
8- DSO_LDOPTS='-shared -Wl,-soname -Wl,$(notdir $@)'
9+ DSO_LDOPTS='-shared -Wl,-rpath,\$$ORIGIN -Wl,-soname -Wl,$(notdir $@)'
10 _OPTIMIZE_FLAGS=-O2
11 _DEBUG_FLAGS="-g -fno-inline" # most people on linux use gcc/gdb, and that
12 # combo is not yet good at debugging inlined
13diff -ur misc/nss-3.39/nspr/pr/include/pratom.h misc/build/nss-3.39/nspr/pr/include/pratom.h
14--- misc/nss-3.39/nspr/pr/include/pratom.h 2018-08-28 05:42:28.000000000 -0700
4@@ -7039,7 +7039,7 @@
5 PR_MD_CSRCS=linux.c
6 MKSHLIB='$(CC) $(DSO_LDOPTS) -o $@'
7 DSO_CFLAGS=-fPIC
8- DSO_LDOPTS='-shared -Wl,-soname -Wl,$(notdir $@)'
9+ DSO_LDOPTS='-shared -Wl,-rpath,\$$ORIGIN -Wl,-soname -Wl,$(notdir $@)'
10 _OPTIMIZE_FLAGS=-O2
11 _DEBUG_FLAGS="-g -fno-inline" # most people on linux use gcc/gdb, and that
12 # combo is not yet good at debugging inlined
13diff -ur misc/nss-3.39/nspr/pr/include/pratom.h misc/build/nss-3.39/nspr/pr/include/pratom.h
14--- misc/nss-3.39/nspr/pr/include/pratom.h 2018-08-28 05:42:28.000000000 -0700
15+++ misc/build/nss-3.39/nspr/pr/include/pratom.h 2018-09-10 10:30:19.954252000 -0700
15+++ misc/build/nss-3.39/nspr/pr/include/pratom.h 2020-10-06 07:41:59.563345390 -0700
16@@ -81,7 +81,9 @@
17 #if defined(_WIN32) && !defined(_WIN32_WCE) && \
18 (!defined(_MSC_VER) || (_MSC_VER >= 1310))
19
20+PR_END_EXTERN_C
21 #include <intrin.h>
22+PR_BEGIN_EXTERN_C
23
24 #ifdef _MSC_VER
25 #pragma intrinsic(_InterlockedIncrement)
16@@ -81,7 +81,9 @@
17 #if defined(_WIN32) && !defined(_WIN32_WCE) && \
18 (!defined(_MSC_VER) || (_MSC_VER >= 1310))
19
20+PR_END_EXTERN_C
21 #include <intrin.h>
22+PR_BEGIN_EXTERN_C
23
24 #ifdef _MSC_VER
25 #pragma intrinsic(_InterlockedIncrement)
26diff -ur misc/nss-3.39/nss/Makefile misc/build/nss-3.39/nss/Makefile
27--- misc/nss-3.39/nss/Makefile 2018-08-31 05:55:53.000000000 -0700
28+++ misc/build/nss-3.39/nss/Makefile 2018-09-10 10:30:19.954774000 -0700
29@@ -77,6 +77,9 @@
30 ifeq ($(OS_TARGET),WIN95)
31 NSPR_CONFIGURE_OPTS += --enable-win32-target=WIN95
32 endif
33+ifdef MACOS_SDK_DIR
34+NSPR_CONFIGURE_OPTS += --with-macos-sdk=$(MACOS_SDK_DIR)
35+endif
36 ifdef USE_DEBUG_RTL
37 NSPR_CONFIGURE_OPTS += --enable-debug-rtl
38 endif
39diff -ur misc/nss-3.39/nss/cmd/platlibs.mk misc/build/nss-3.39/nss/cmd/platlibs.mk
40--- misc/nss-3.39/nss/cmd/platlibs.mk 2018-08-31 05:55:53.000000000 -0700
26diff -ur misc/nss-3.39/nss/cmd/platlibs.mk misc/build/nss-3.39/nss/cmd/platlibs.mk
27--- misc/nss-3.39/nss/cmd/platlibs.mk 2018-08-31 05:55:53.000000000 -0700
41+++ misc/build/nss-3.39/nss/cmd/platlibs.mk 2018-09-10 10:30:19.955267000 -0700
28+++ misc/build/nss-3.39/nss/cmd/platlibs.mk 2020-10-06 07:41:59.567345437 -0700
42@@ -10,17 +10,18 @@
43
44 ifeq ($(OS_ARCH), SunOS)
45 ifeq ($(USE_64), 1)
46-EXTRA_SHARED_LIBS += -R '$$ORIGIN/../lib:/usr/lib/mps/secv1/64:/usr/lib/mps/64'
47+#In AOO we would probable put the executables next to libs
48+EXTRA_SHARED_LIBS += -R '$$ORIGIN'
49 else

--- 9 unchanged lines hidden (view full) ---

59 else
60-EXTRA_SHARED_LIBS += -Wl,-rpath,'$$ORIGIN/../lib:/opt/sun/private/lib'
61+EXTRA_SHARED_LIBS += -Wl,-rpath,'$$ORIGIN'
62 endif
63 endif
64
65diff -ur misc/nss-3.39/nss/cmd/shlibsign/Makefile misc/build/nss-3.39/nss/cmd/shlibsign/Makefile
66--- misc/nss-3.39/nss/cmd/shlibsign/Makefile 2018-08-31 05:55:53.000000000 -0700
29@@ -10,17 +10,18 @@
30
31 ifeq ($(OS_ARCH), SunOS)
32 ifeq ($(USE_64), 1)
33-EXTRA_SHARED_LIBS += -R '$$ORIGIN/../lib:/usr/lib/mps/secv1/64:/usr/lib/mps/64'
34+#In AOO we would probable put the executables next to libs
35+EXTRA_SHARED_LIBS += -R '$$ORIGIN'
36 else

--- 9 unchanged lines hidden (view full) ---

46 else
47-EXTRA_SHARED_LIBS += -Wl,-rpath,'$$ORIGIN/../lib:/opt/sun/private/lib'
48+EXTRA_SHARED_LIBS += -Wl,-rpath,'$$ORIGIN'
49 endif
50 endif
51
52diff -ur misc/nss-3.39/nss/cmd/shlibsign/Makefile misc/build/nss-3.39/nss/cmd/shlibsign/Makefile
53--- misc/nss-3.39/nss/cmd/shlibsign/Makefile 2018-08-31 05:55:53.000000000 -0700
67+++ misc/build/nss-3.39/nss/cmd/shlibsign/Makefile 2018-09-10 10:30:19.955769000 -0700
54+++ misc/build/nss-3.39/nss/cmd/shlibsign/Makefile 2020-10-06 07:41:59.567345437 -0700
68@@ -49,10 +49,15 @@
69 CHECKLIBS =
70 CHECKLOC =
71 else
72-CHECKLIBS = $(DIST)/lib/$(DLL_PREFIX)softokn3.$(DLL_SUFFIX)
73-CHECKLIBS += $(wildcard $(DIST)/lib/$(DLL_PREFIX)freebl*3.$(DLL_SUFFIX))
74+# Signing causes loading of some system library which in turn loads
75+# libsqlite3. Then it loads libsqulite3 from nss, which does not have the proper
76+# version. Therefore signing fails.
77+# We cannot build with the system sqlite3, because it is too old (SDK
78+# 10.4). Otherwise one could set NSS_USE_SYSTEM_SQLITE=1 and use the system lib.
79+#CHECKLIBS = $(DIST)/lib/$(DLL_PREFIX)softokn3.$(DLL_SUFFIX)
80+#CHECKLIBS += $(wildcard $(DIST)/lib/$(DLL_PREFIX)freebl*3.$(DLL_SUFFIX))
81 ifndef NSS_DISABLE_DBM
82-CHECKLIBS += $(DIST)/lib/$(DLL_PREFIX)nssdbm3.$(DLL_SUFFIX)
83+#CHECKLIBS += $(DIST)/lib/$(DLL_PREFIX)nssdbm3.$(DLL_SUFFIX)
84 endif
85 CHECKLOC = $(CHECKLIBS:.$(DLL_SUFFIX)=.chk)
86
55@@ -49,10 +49,15 @@
56 CHECKLIBS =
57 CHECKLOC =
58 else
59-CHECKLIBS = $(DIST)/lib/$(DLL_PREFIX)softokn3.$(DLL_SUFFIX)
60-CHECKLIBS += $(wildcard $(DIST)/lib/$(DLL_PREFIX)freebl*3.$(DLL_SUFFIX))
61+# Signing causes loading of some system library which in turn loads
62+# libsqlite3. Then it loads libsqulite3 from nss, which does not have the proper
63+# version. Therefore signing fails.
64+# We cannot build with the system sqlite3, because it is too old (SDK
65+# 10.4). Otherwise one could set NSS_USE_SYSTEM_SQLITE=1 and use the system lib.
66+#CHECKLIBS = $(DIST)/lib/$(DLL_PREFIX)softokn3.$(DLL_SUFFIX)
67+#CHECKLIBS += $(wildcard $(DIST)/lib/$(DLL_PREFIX)freebl*3.$(DLL_SUFFIX))
68 ifndef NSS_DISABLE_DBM
69-CHECKLIBS += $(DIST)/lib/$(DLL_PREFIX)nssdbm3.$(DLL_SUFFIX)
70+#CHECKLIBS += $(DIST)/lib/$(DLL_PREFIX)nssdbm3.$(DLL_SUFFIX)
71 endif
72 CHECKLOC = $(CHECKLIBS:.$(DLL_SUFFIX)=.chk)
73
87Only in misc/build/nss-3.39/nss/coreconf: Darwin.mk.rej
74diff -ur misc/nss-3.39/nss/coreconf/Darwin.mk misc/build/nss-3.39/nss/coreconf/Darwin.mk
75--- misc/nss-3.39/nss/coreconf/Darwin.mk 2018-08-31 05:55:53.000000000 -0700
76+++ misc/build/nss-3.39/nss/coreconf/Darwin.mk 2020-10-06 07:51:49.590356560 -0700
77@@ -3,14 +3,15 @@
78 # License, v. 2.0. If a copy of the MPL was not distributed with this
79 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
80
81-CC ?= gcc
82-CCC ?= g++
83+# CC is taken from environment automatically.
84+#CC ?= gcc
85+CCC ?= $(CXX) -stdlib=libc++ -std=c++11
86 RANLIB ?= ranlib
87
88 include $(CORE_DEPTH)/coreconf/UNIX.mk
89-include $(CORE_DEPTH)/coreconf/Werror.mk
90+#include $(CORE_DEPTH)/coreconf/Werror.mk
91
92-DEFAULT_COMPILER = gcc
93+DEFAULT_COMPILER = cc
94
95 ifndef CPU_ARCH
96 # When cross-compiling, CPU_ARCH should already be defined as the target
88diff -ur misc/nss-3.39/nss/coreconf/FreeBSD.mk misc/build/nss-3.39/nss/coreconf/FreeBSD.mk
89--- misc/nss-3.39/nss/coreconf/FreeBSD.mk 2018-08-31 05:55:53.000000000 -0700
97diff -ur misc/nss-3.39/nss/coreconf/FreeBSD.mk misc/build/nss-3.39/nss/coreconf/FreeBSD.mk
98--- misc/nss-3.39/nss/coreconf/FreeBSD.mk 2018-08-31 05:55:53.000000000 -0700
90+++ misc/build/nss-3.39/nss/coreconf/FreeBSD.mk 2018-09-10 10:30:19.956982000 -0700
99+++ misc/build/nss-3.39/nss/coreconf/FreeBSD.mk 2020-10-06 07:41:59.567345437 -0700
91@@ -5,9 +5,8 @@
92
93 include $(CORE_DEPTH)/coreconf/UNIX.mk
94
95-DEFAULT_COMPILER = gcc
96-CC = gcc
97-CCC = g++
98+DEFAULT_COMPILER = $(CC)

--- 7 unchanged lines hidden (view full) ---

106
107-OS_CFLAGS = $(DSO_CFLAGS) -Wall -Wno-switch -DFREEBSD -DHAVE_STRERROR -DHAVE_BSD_FLOCK
108+OS_CFLAGS = $(DSO_CFLAGS) -Wall -Wno-switch -DFREEBSD -DHAVE_STRERROR -DHAVE_UNISTD_H -DHAVE_BSD_FLOCK
109
110 DSO_CFLAGS = -fPIC
111 DSO_LDOPTS = -shared -Wl,-soname -Wl,$(notdir $@)
112diff -ur misc/nss-3.39/nss/coreconf/Linux.mk misc/build/nss-3.39/nss/coreconf/Linux.mk
113--- misc/nss-3.39/nss/coreconf/Linux.mk 2018-08-31 05:55:53.000000000 -0700
100@@ -5,9 +5,8 @@
101
102 include $(CORE_DEPTH)/coreconf/UNIX.mk
103
104-DEFAULT_COMPILER = gcc
105-CC = gcc
106-CCC = g++
107+DEFAULT_COMPILER = $(CC)

--- 7 unchanged lines hidden (view full) ---

115
116-OS_CFLAGS = $(DSO_CFLAGS) -Wall -Wno-switch -DFREEBSD -DHAVE_STRERROR -DHAVE_BSD_FLOCK
117+OS_CFLAGS = $(DSO_CFLAGS) -Wall -Wno-switch -DFREEBSD -DHAVE_STRERROR -DHAVE_UNISTD_H -DHAVE_BSD_FLOCK
118
119 DSO_CFLAGS = -fPIC
120 DSO_LDOPTS = -shared -Wl,-soname -Wl,$(notdir $@)
121diff -ur misc/nss-3.39/nss/coreconf/Linux.mk misc/build/nss-3.39/nss/coreconf/Linux.mk
122--- misc/nss-3.39/nss/coreconf/Linux.mk 2018-08-31 05:55:53.000000000 -0700
114+++ misc/build/nss-3.39/nss/coreconf/Linux.mk 2018-09-10 10:30:19.957638000 -0700
123+++ misc/build/nss-3.39/nss/coreconf/Linux.mk 2020-10-06 07:41:59.567345437 -0700
115@@ -140,7 +140,7 @@
116 endif
117
118 DSO_CFLAGS = -fPIC
119-DSO_LDOPTS = -shared $(ARCHFLAG) -Wl,--gc-sections
120+DSO_LDOPTS = -shared $(ARCHFLAG) -Wl,--gc-sections '-Wl,-rpath,$$ORIGIN'
121 # The linker on Red Hat Linux 7.2 and RHEL 2.1 (GNU ld version 2.11.90.0.8)
122 # incorrectly reports undefined references in the libraries we link with, so

--- 7 unchanged lines hidden (view full) ---

130+# If USE_SYSTEM_ZLIB is not set then the tools link statically libzlib.a which
131+# is also build in nss.
132 USE_SYSTEM_ZLIB = 1
133 ZLIB_LIBS = -lz
134+endif
135
136 # The -rpath '$$ORIGIN' linker option instructs this library to search for its
137 # dependencies in the same directory where it resides.
124@@ -140,7 +140,7 @@
125 endif
126
127 DSO_CFLAGS = -fPIC
128-DSO_LDOPTS = -shared $(ARCHFLAG) -Wl,--gc-sections
129+DSO_LDOPTS = -shared $(ARCHFLAG) -Wl,--gc-sections '-Wl,-rpath,$$ORIGIN'
130 # The linker on Red Hat Linux 7.2 and RHEL 2.1 (GNU ld version 2.11.90.0.8)
131 # incorrectly reports undefined references in the libraries we link with, so

--- 7 unchanged lines hidden (view full) ---

139+# If USE_SYSTEM_ZLIB is not set then the tools link statically libzlib.a which
140+# is also build in nss.
141 USE_SYSTEM_ZLIB = 1
142 ZLIB_LIBS = -lz
143+endif
144
145 # The -rpath '$$ORIGIN' linker option instructs this library to search for its
146 # dependencies in the same directory where it resides.
138Only in misc/build/nss-3.39/nss/coreconf: Linux.mk.rej
147diff -ur misc/nss-3.39/nss/coreconf/rules.mk misc/build/nss-3.39/nss/coreconf/rules.mk
148--- misc/nss-3.39/nss/coreconf/rules.mk 2018-08-31 05:55:53.000000000 -0700
149+++ misc/build/nss-3.39/nss/coreconf/rules.mk 2020-10-06 07:41:59.567345437 -0700
150@@ -322,7 +322,12 @@
151 ifdef NS_USE_GCC
152 $(RC) $(filter-out -U%,$(DEFINES)) $(INCLUDES:-I%=--include-dir %) -o $@ $<
153 else
154- $(RC) $(filter-out -U%,$(DEFINES)) $(INCLUDES) -Fo$@ $<
155+ #We remove stl from the paths to avoid that rc.exe finds the stlport of
156+ #OOo. stlport includes the system stl which will fail. By removing it,
157+ #rc will use the stl from the system if the path is in the INCLUDE
158+ #variable.
159+ INCLUDE="$(subst /stl,,$(INCLUDE))" $(RC) $(filter-out -U%,$(DEFINES)) $(INCLUDES) -Fo$@ $<
160+
161 endif
162 @echo $(RES) finished
163 endif
139diff -ur misc/nss-3.39/nss/coreconf/SunOS5.mk misc/build/nss-3.39/nss/coreconf/SunOS5.mk
140--- misc/nss-3.39/nss/coreconf/SunOS5.mk 2018-08-31 05:55:53.000000000 -0700
164diff -ur misc/nss-3.39/nss/coreconf/SunOS5.mk misc/build/nss-3.39/nss/coreconf/SunOS5.mk
165--- misc/nss-3.39/nss/coreconf/SunOS5.mk 2018-08-31 05:55:53.000000000 -0700
141+++ misc/build/nss-3.39/nss/coreconf/SunOS5.mk 2018-09-10 10:30:19.958249000 -0700
166+++ misc/build/nss-3.39/nss/coreconf/SunOS5.mk 2020-10-06 07:41:59.567345437 -0700
142@@ -48,8 +48,12 @@
143 # OPTIMIZER += -mno-omit-leaf-frame-pointer -fno-omit-frame-pointer
144 endif
145 else
146- CC = cc
147- CCC = CC
148+# CC is taken from environment automatically.
149+# CC = cc
150+# Use CXX from environment.
151+# CCC = CC
152+ CCC = $(CXX)
153+
154 ASFLAGS += -Wa,-P
155 OS_CFLAGS += $(NOMD_OS_CFLAGS) $(ARCHFLAG)
156 ifndef BUILD_OPT
167@@ -48,8 +48,12 @@
168 # OPTIMIZER += -mno-omit-leaf-frame-pointer -fno-omit-frame-pointer
169 endif
170 else
171- CC = cc
172- CCC = CC
173+# CC is taken from environment automatically.
174+# CC = cc
175+# Use CXX from environment.
176+# CCC = CC
177+ CCC = $(CXX)
178+
179 ASFLAGS += -Wa,-P
180 OS_CFLAGS += $(NOMD_OS_CFLAGS) $(ARCHFLAG)
181 ifndef BUILD_OPT
157Only in misc/build/nss-3.39/nss/coreconf: arch.mk.rej
158diff -ur misc/nss-3.39/nss/coreconf/rules.mk misc/build/nss-3.39/nss/coreconf/rules.mk
159--- misc/nss-3.39/nss/coreconf/rules.mk 2018-08-31 05:55:53.000000000 -0700
160+++ misc/build/nss-3.39/nss/coreconf/rules.mk 2018-09-10 10:30:19.959531000 -0700
161@@ -322,7 +322,12 @@
162 ifdef NS_USE_GCC
163 $(RC) $(filter-out -U%,$(DEFINES)) $(INCLUDES:-I%=--include-dir %) -o $@ $<
164 else
165- $(RC) $(filter-out -U%,$(DEFINES)) $(INCLUDES) -Fo$@ $<
166+ #We remove stl from the paths to avoid that rc.exe finds the stlport of
167+ #OOo. stlport includes the system stl which will fail. By removing it,
168+ #rc will use the stl from the system if the path is in the INCLUDE
169+ #variable.
170+ INCLUDE="$(subst /stl,,$(INCLUDE))" $(RC) $(filter-out -U%,$(DEFINES)) $(INCLUDES) -Fo$@ $<
171+
172 endif
173 @echo $(RES) finished
174 endif
175diff -ur misc/nss-3.39/nss/lib/zlib/inflate.c misc/build/nss-3.39/nss/lib/zlib/inflate.c
176--- misc/nss-3.39/nss/lib/zlib/inflate.c 2018-08-31 05:55:53.000000000 -0700
182diff -ur misc/nss-3.39/nss/lib/zlib/inflate.c misc/build/nss-3.39/nss/lib/zlib/inflate.c
183--- misc/nss-3.39/nss/lib/zlib/inflate.c 2018-08-31 05:55:53.000000000 -0700
177+++ misc/build/nss-3.39/nss/lib/zlib/inflate.c 2018-09-10 10:30:19.960242000 -0700
184+++ misc/build/nss-3.39/nss/lib/zlib/inflate.c 2020-10-06 07:41:59.567345437 -0700
178@@ -1472,9 +1472,9 @@
179 {
180 struct inflate_state FAR *state;
181
182- if (strm == Z_NULL || strm->state == Z_NULL) return -1L << 16;
183+ if (strm == Z_NULL || strm->state == Z_NULL) return ~0UL << 16;
184 state = (struct inflate_state FAR *)strm->state;
185- return ((long)(state->back) << 16) +
186+ return ((unsigned long)(state->back) << 16) +
187 (state->mode == COPY ? state->length :
188 (state->mode == MATCH ? state->was - state->length : 0));
189 }
185@@ -1472,9 +1472,9 @@
186 {
187 struct inflate_state FAR *state;
188
189- if (strm == Z_NULL || strm->state == Z_NULL) return -1L << 16;
190+ if (strm == Z_NULL || strm->state == Z_NULL) return ~0UL << 16;
191 state = (struct inflate_state FAR *)strm->state;
192- return ((long)(state->back) << 16) +
193+ return ((unsigned long)(state->back) << 16) +
194 (state->mode == COPY ? state->length :
195 (state->mode == MATCH ? state->was - state->length : 0));
196 }
197diff -ur misc/nss-3.39/nss/Makefile misc/build/nss-3.39/nss/Makefile
198--- misc/nss-3.39/nss/Makefile 2018-08-31 05:55:53.000000000 -0700
199+++ misc/build/nss-3.39/nss/Makefile 2020-10-06 07:41:59.567345437 -0700
200@@ -77,6 +77,9 @@
201 ifeq ($(OS_TARGET),WIN95)
202 NSPR_CONFIGURE_OPTS += --enable-win32-target=WIN95
203 endif
204+ifdef MACOS_SDK_DIR
205+NSPR_CONFIGURE_OPTS += --with-macos-sdk=$(MACOS_SDK_DIR)
206+endif
207 ifdef USE_DEBUG_RTL
208 NSPR_CONFIGURE_OPTS += --enable-debug-rtl
209 endif