xref: /aoo41x/main/nss/nss.patch (revision f1341198)
10ae430aaSDon Lewisdiff -ur misc/nss-3.39/nspr/configure misc/build/nss-3.39/nspr/configure
20ae430aaSDon Lewis--- misc/nss-3.39/nspr/configure	2018-08-28 05:42:28.000000000 -0700
3*f1341198SDon Lewis+++ misc/build/nss-3.39/nspr/configure	2020-10-06 07:41:59.563345390 -0700
40ae430aaSDon Lewis@@ -7039,7 +7039,7 @@
5cdf0e10cSrcweir     PR_MD_CSRCS=linux.c
6cdf0e10cSrcweir     MKSHLIB='$(CC) $(DSO_LDOPTS) -o $@'
7cdf0e10cSrcweir     DSO_CFLAGS=-fPIC
8cdf0e10cSrcweir-    DSO_LDOPTS='-shared -Wl,-soname -Wl,$(notdir $@)'
9cdf0e10cSrcweir+    DSO_LDOPTS='-shared -Wl,-rpath,\$$ORIGIN -Wl,-soname -Wl,$(notdir $@)'
10cdf0e10cSrcweir     _OPTIMIZE_FLAGS=-O2
11cdf0e10cSrcweir     _DEBUG_FLAGS="-g -fno-inline"  # most people on linux use gcc/gdb, and that
12cdf0e10cSrcweir                                    # combo is not yet good at debugging inlined
130ae430aaSDon Lewisdiff -ur misc/nss-3.39/nspr/pr/include/pratom.h misc/build/nss-3.39/nspr/pr/include/pratom.h
140ae430aaSDon Lewis--- misc/nss-3.39/nspr/pr/include/pratom.h	2018-08-28 05:42:28.000000000 -0700
15*f1341198SDon Lewis+++ misc/build/nss-3.39/nspr/pr/include/pratom.h	2020-10-06 07:41:59.563345390 -0700
16e32eb42eStruckman@@ -81,7 +81,9 @@
17e32eb42eStruckman #if defined(_WIN32) && !defined(_WIN32_WCE) && \
18e32eb42eStruckman     (!defined(_MSC_VER) || (_MSC_VER >= 1310))
19cdf0e10cSrcweir
20e32eb42eStruckman+PR_END_EXTERN_C
21e32eb42eStruckman #include <intrin.h>
22e32eb42eStruckman+PR_BEGIN_EXTERN_C
23e32eb42eStruckman
24e32eb42eStruckman #ifdef _MSC_VER
25e32eb42eStruckman #pragma intrinsic(_InterlockedIncrement)
260ae430aaSDon Lewisdiff -ur misc/nss-3.39/nss/cmd/platlibs.mk misc/build/nss-3.39/nss/cmd/platlibs.mk
270ae430aaSDon Lewis--- misc/nss-3.39/nss/cmd/platlibs.mk	2018-08-31 05:55:53.000000000 -0700
28*f1341198SDon Lewis+++ misc/build/nss-3.39/nss/cmd/platlibs.mk	2020-10-06 07:41:59.567345437 -0700
29e32eb42eStruckman@@ -10,17 +10,18 @@
30e32eb42eStruckman
31e32eb42eStruckman ifeq ($(OS_ARCH), SunOS)
32e32eb42eStruckman ifeq ($(USE_64), 1)
33e32eb42eStruckman-EXTRA_SHARED_LIBS += -R '$$ORIGIN/../lib:/usr/lib/mps/secv1/64:/usr/lib/mps/64'
34e32eb42eStruckman+#In AOO we would probable put the executables next to libs
35e32eb42eStruckman+EXTRA_SHARED_LIBS += -R '$$ORIGIN'
36e32eb42eStruckman else
37e32eb42eStruckman-EXTRA_SHARED_LIBS += -R '$$ORIGIN/../lib:/usr/lib/mps/secv1:/usr/lib/mps'
38e32eb42eStruckman+EXTRA_SHARED_LIBS += -R '$$ORIGIN'
39e32eb42eStruckman endif
40e32eb42eStruckman endif
41e32eb42eStruckman
42e32eb42eStruckman ifeq ($(OS_ARCH), Linux)
43e32eb42eStruckman ifeq ($(USE_64), 1)
44e32eb42eStruckman-EXTRA_SHARED_LIBS += -Wl,-rpath,'$$ORIGIN/../lib64:/opt/sun/private/lib64:$$ORIGIN/../lib'
45e32eb42eStruckman+EXTRA_SHARED_LIBS += -Wl,-rpath,'$$ORIGIN'
46e32eb42eStruckman else
47e32eb42eStruckman-EXTRA_SHARED_LIBS += -Wl,-rpath,'$$ORIGIN/../lib:/opt/sun/private/lib'
48e32eb42eStruckman+EXTRA_SHARED_LIBS += -Wl,-rpath,'$$ORIGIN'
49e32eb42eStruckman endif
50e32eb42eStruckman endif
51e32eb42eStruckman
520ae430aaSDon Lewisdiff -ur misc/nss-3.39/nss/cmd/shlibsign/Makefile misc/build/nss-3.39/nss/cmd/shlibsign/Makefile
530ae430aaSDon Lewis--- misc/nss-3.39/nss/cmd/shlibsign/Makefile	2018-08-31 05:55:53.000000000 -0700
54*f1341198SDon Lewis+++ misc/build/nss-3.39/nss/cmd/shlibsign/Makefile	2020-10-06 07:41:59.567345437 -0700
55e32eb42eStruckman@@ -49,10 +49,15 @@
56e32eb42eStruckman CHECKLIBS =
57e32eb42eStruckman CHECKLOC =
58e32eb42eStruckman else
59e32eb42eStruckman-CHECKLIBS = $(DIST)/lib/$(DLL_PREFIX)softokn3.$(DLL_SUFFIX)
60e32eb42eStruckman-CHECKLIBS += $(wildcard $(DIST)/lib/$(DLL_PREFIX)freebl*3.$(DLL_SUFFIX))
61e32eb42eStruckman+# Signing causes loading of some system library which in turn loads
62e32eb42eStruckman+# libsqlite3. Then it loads libsqulite3 from nss, which does not have the proper
63e32eb42eStruckman+# version. Therefore signing fails.
64e32eb42eStruckman+# We cannot build with the system sqlite3, because it is too old (SDK
65e32eb42eStruckman+# 10.4). Otherwise one could set NSS_USE_SYSTEM_SQLITE=1 and use the system lib.
66e32eb42eStruckman+#CHECKLIBS = $(DIST)/lib/$(DLL_PREFIX)softokn3.$(DLL_SUFFIX)
67e32eb42eStruckman+#CHECKLIBS += $(wildcard $(DIST)/lib/$(DLL_PREFIX)freebl*3.$(DLL_SUFFIX))
68e32eb42eStruckman ifndef NSS_DISABLE_DBM
69e32eb42eStruckman-CHECKLIBS += $(DIST)/lib/$(DLL_PREFIX)nssdbm3.$(DLL_SUFFIX)
70e32eb42eStruckman+#CHECKLIBS += $(DIST)/lib/$(DLL_PREFIX)nssdbm3.$(DLL_SUFFIX)
71e32eb42eStruckman endif
72e32eb42eStruckman CHECKLOC = $(CHECKLIBS:.$(DLL_SUFFIX)=.chk)
73e32eb42eStruckman
74*f1341198SDon Lewisdiff -ur misc/nss-3.39/nss/coreconf/Darwin.mk misc/build/nss-3.39/nss/coreconf/Darwin.mk
75*f1341198SDon Lewis--- misc/nss-3.39/nss/coreconf/Darwin.mk	2018-08-31 05:55:53.000000000 -0700
76*f1341198SDon Lewis+++ misc/build/nss-3.39/nss/coreconf/Darwin.mk	2020-10-06 07:51:49.590356560 -0700
77*f1341198SDon Lewis@@ -3,14 +3,15 @@
78*f1341198SDon Lewis # License, v. 2.0. If a copy of the MPL was not distributed with this
79*f1341198SDon Lewis # file, You can obtain one at http://mozilla.org/MPL/2.0/.
80*f1341198SDon Lewis
81*f1341198SDon Lewis-CC     ?= gcc
82*f1341198SDon Lewis-CCC    ?= g++
83*f1341198SDon Lewis+# CC is taken from environment automatically.
84*f1341198SDon Lewis+#CC     ?= gcc
85*f1341198SDon Lewis+CCC    ?= $(CXX) -stdlib=libc++ -std=c++11
86*f1341198SDon Lewis RANLIB ?= ranlib
87*f1341198SDon Lewis
88*f1341198SDon Lewis include $(CORE_DEPTH)/coreconf/UNIX.mk
89*f1341198SDon Lewis-include $(CORE_DEPTH)/coreconf/Werror.mk
90*f1341198SDon Lewis+#include $(CORE_DEPTH)/coreconf/Werror.mk
91*f1341198SDon Lewis
92*f1341198SDon Lewis-DEFAULT_COMPILER = gcc
93*f1341198SDon Lewis+DEFAULT_COMPILER = cc
94*f1341198SDon Lewis
95*f1341198SDon Lewis ifndef CPU_ARCH
96*f1341198SDon Lewis # When cross-compiling, CPU_ARCH should already be defined as the target
970ae430aaSDon Lewisdiff -ur misc/nss-3.39/nss/coreconf/FreeBSD.mk misc/build/nss-3.39/nss/coreconf/FreeBSD.mk
980ae430aaSDon Lewis--- misc/nss-3.39/nss/coreconf/FreeBSD.mk	2018-08-31 05:55:53.000000000 -0700
99*f1341198SDon Lewis+++ misc/build/nss-3.39/nss/coreconf/FreeBSD.mk	2020-10-06 07:41:59.567345437 -0700
100e32eb42eStruckman@@ -5,9 +5,8 @@
101e32eb42eStruckman
102e32eb42eStruckman include $(CORE_DEPTH)/coreconf/UNIX.mk
103e32eb42eStruckman
104e32eb42eStruckman-DEFAULT_COMPILER	= gcc
105e32eb42eStruckman-CC			= gcc
106e32eb42eStruckman-CCC			= g++
107e32eb42eStruckman+DEFAULT_COMPILER	= $(CC)
108e32eb42eStruckman+CCC			= $(CXX)
109e32eb42eStruckman RANLIB			= ranlib
110e32eb42eStruckman
111e32eb42eStruckman CPU_ARCH		= $(OS_TEST)
112e32eb42eStruckman@@ -21,7 +20,7 @@
113e32eb42eStruckman CPU_ARCH		= x86_64
114e32eb42eStruckman endif
115e32eb42eStruckman
116e32eb42eStruckman-OS_CFLAGS		= $(DSO_CFLAGS) -Wall -Wno-switch -DFREEBSD -DHAVE_STRERROR -DHAVE_BSD_FLOCK
117e32eb42eStruckman+OS_CFLAGS		= $(DSO_CFLAGS) -Wall -Wno-switch -DFREEBSD -DHAVE_STRERROR -DHAVE_UNISTD_H -DHAVE_BSD_FLOCK
118e32eb42eStruckman
119e32eb42eStruckman DSO_CFLAGS		= -fPIC
120e32eb42eStruckman DSO_LDOPTS		= -shared -Wl,-soname -Wl,$(notdir $@)
1210ae430aaSDon Lewisdiff -ur misc/nss-3.39/nss/coreconf/Linux.mk misc/build/nss-3.39/nss/coreconf/Linux.mk
1220ae430aaSDon Lewis--- misc/nss-3.39/nss/coreconf/Linux.mk	2018-08-31 05:55:53.000000000 -0700
123*f1341198SDon Lewis+++ misc/build/nss-3.39/nss/coreconf/Linux.mk	2020-10-06 07:41:59.567345437 -0700
1240ae430aaSDon Lewis@@ -140,7 +140,7 @@
125e32eb42eStruckman endif
126e32eb42eStruckman
127e32eb42eStruckman DSO_CFLAGS		= -fPIC
128e32eb42eStruckman-DSO_LDOPTS		= -shared $(ARCHFLAG) -Wl,--gc-sections
129e32eb42eStruckman+DSO_LDOPTS		= -shared $(ARCHFLAG) -Wl,--gc-sections '-Wl,-rpath,$$ORIGIN'
130e32eb42eStruckman # The linker on Red Hat Linux 7.2 and RHEL 2.1 (GNU ld version 2.11.90.0.8)
131cdf0e10cSrcweir # incorrectly reports undefined references in the libraries we link with, so
132cdf0e10cSrcweir # we don't use -z defs there.
1330ae430aaSDon Lewis@@ -177,8 +177,13 @@
134c38ced1bSHerbert Dürr endif
135c38ced1bSHerbert Dürr endif
136cdf0e10cSrcweir
137cdf0e10cSrcweir+ifeq ($(SYSTEM_ZLIB),YES)
138cdf0e10cSrcweir+# Currently (3.12.4) only the tools modutil and signtool are linked with libz
139cdf0e10cSrcweir+# If USE_SYSTEM_ZLIB is not set then the tools link statically libzlib.a which
140cdf0e10cSrcweir+# is also build in nss.
141cdf0e10cSrcweir USE_SYSTEM_ZLIB = 1
142cdf0e10cSrcweir ZLIB_LIBS = -lz
143cdf0e10cSrcweir+endif
144cdf0e10cSrcweir
145cdf0e10cSrcweir # The -rpath '$$ORIGIN' linker option instructs this library to search for its
146cdf0e10cSrcweir # dependencies in the same directory where it resides.
147*f1341198SDon Lewisdiff -ur misc/nss-3.39/nss/coreconf/rules.mk misc/build/nss-3.39/nss/coreconf/rules.mk
148*f1341198SDon Lewis--- misc/nss-3.39/nss/coreconf/rules.mk	2018-08-31 05:55:53.000000000 -0700
149*f1341198SDon Lewis+++ misc/build/nss-3.39/nss/coreconf/rules.mk	2020-10-06 07:41:59.567345437 -0700
150*f1341198SDon Lewis@@ -322,7 +322,12 @@
151*f1341198SDon Lewis ifdef NS_USE_GCC
152*f1341198SDon Lewis 	$(RC) $(filter-out -U%,$(DEFINES)) $(INCLUDES:-I%=--include-dir %) -o $@ $<
153*f1341198SDon Lewis else
154*f1341198SDon Lewis-	$(RC) $(filter-out -U%,$(DEFINES)) $(INCLUDES) -Fo$@ $<
155*f1341198SDon Lewis+        #We remove stl from the paths to avoid that rc.exe finds the stlport of
156*f1341198SDon Lewis+        #OOo. stlport includes the system stl which will fail. By removing it,
157*f1341198SDon Lewis+        #rc will use the stl from the system if the path is in the INCLUDE
158*f1341198SDon Lewis+        #variable.
159*f1341198SDon Lewis+	INCLUDE="$(subst /stl,,$(INCLUDE))" $(RC) $(filter-out -U%,$(DEFINES)) $(INCLUDES) -Fo$@ $<
160*f1341198SDon Lewis+
161*f1341198SDon Lewis endif
162*f1341198SDon Lewis 	@echo $(RES) finished
163*f1341198SDon Lewis endif
1640ae430aaSDon Lewisdiff -ur misc/nss-3.39/nss/coreconf/SunOS5.mk misc/build/nss-3.39/nss/coreconf/SunOS5.mk
1650ae430aaSDon Lewis--- misc/nss-3.39/nss/coreconf/SunOS5.mk	2018-08-31 05:55:53.000000000 -0700
166*f1341198SDon Lewis+++ misc/build/nss-3.39/nss/coreconf/SunOS5.mk	2020-10-06 07:41:59.567345437 -0700
167c38ced1bSHerbert Dürr@@ -48,8 +48,12 @@
168cdf0e10cSrcweir 	    # OPTIMIZER += -mno-omit-leaf-frame-pointer -fno-omit-frame-pointer
169cdf0e10cSrcweir 	endif
170cdf0e10cSrcweir else
171cdf0e10cSrcweir-	CC         = cc
172cdf0e10cSrcweir-	CCC        = CC
173cdf0e10cSrcweir+# CC is taken from environment automatically.
174cdf0e10cSrcweir+#	CC         = cc
175cdf0e10cSrcweir+# Use CXX from environment.
176cdf0e10cSrcweir+#	CCC        = CC
177cdf0e10cSrcweir+        CCC       = $(CXX)
178cdf0e10cSrcweir+
179cdf0e10cSrcweir 	ASFLAGS   += -Wa,-P
180cdf0e10cSrcweir 	OS_CFLAGS += $(NOMD_OS_CFLAGS) $(ARCHFLAG)
181cdf0e10cSrcweir 	ifndef BUILD_OPT
1820ae430aaSDon Lewisdiff -ur misc/nss-3.39/nss/lib/zlib/inflate.c misc/build/nss-3.39/nss/lib/zlib/inflate.c
1830ae430aaSDon Lewis--- misc/nss-3.39/nss/lib/zlib/inflate.c	2018-08-31 05:55:53.000000000 -0700
184*f1341198SDon Lewis+++ misc/build/nss-3.39/nss/lib/zlib/inflate.c	2020-10-06 07:41:59.567345437 -0700
185e32eb42eStruckman@@ -1472,9 +1472,9 @@
186e32eb42eStruckman {
187e32eb42eStruckman     struct inflate_state FAR *state;
188cdf0e10cSrcweir
189e32eb42eStruckman-    if (strm == Z_NULL || strm->state == Z_NULL) return -1L << 16;
190e32eb42eStruckman+    if (strm == Z_NULL || strm->state == Z_NULL) return ~0UL << 16;
191e32eb42eStruckman     state = (struct inflate_state FAR *)strm->state;
192e32eb42eStruckman-    return ((long)(state->back) << 16) +
193e32eb42eStruckman+    return ((unsigned long)(state->back) << 16) +
194e32eb42eStruckman         (state->mode == COPY ? state->length :
195e32eb42eStruckman             (state->mode == MATCH ? state->was - state->length : 0));
196e32eb42eStruckman }
197*f1341198SDon Lewisdiff -ur misc/nss-3.39/nss/Makefile misc/build/nss-3.39/nss/Makefile
198*f1341198SDon Lewis--- misc/nss-3.39/nss/Makefile	2018-08-31 05:55:53.000000000 -0700
199*f1341198SDon Lewis+++ misc/build/nss-3.39/nss/Makefile	2020-10-06 07:41:59.567345437 -0700
200*f1341198SDon Lewis@@ -77,6 +77,9 @@
201*f1341198SDon Lewis ifeq ($(OS_TARGET),WIN95)
202*f1341198SDon Lewis NSPR_CONFIGURE_OPTS += --enable-win32-target=WIN95
203*f1341198SDon Lewis endif
204*f1341198SDon Lewis+ifdef MACOS_SDK_DIR
205*f1341198SDon Lewis+NSPR_CONFIGURE_OPTS += --with-macos-sdk=$(MACOS_SDK_DIR)
206*f1341198SDon Lewis+endif
207*f1341198SDon Lewis ifdef USE_DEBUG_RTL
208*f1341198SDon Lewis NSPR_CONFIGURE_OPTS += --enable-debug-rtl
209*f1341198SDon Lewis endif
210