xref: /aoo41x/main/nss/nss.patch (revision 94670cb6)
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
740ae430aaSDon Lewisdiff -ur misc/nss-3.39/nss/coreconf/FreeBSD.mk misc/build/nss-3.39/nss/coreconf/FreeBSD.mk
750ae430aaSDon Lewis--- misc/nss-3.39/nss/coreconf/FreeBSD.mk	2018-08-31 05:55:53.000000000 -0700
76*f1341198SDon Lewis+++ misc/build/nss-3.39/nss/coreconf/FreeBSD.mk	2020-10-06 07:41:59.567345437 -0700
77e32eb42eStruckman@@ -5,9 +5,8 @@
78e32eb42eStruckman
79e32eb42eStruckman include $(CORE_DEPTH)/coreconf/UNIX.mk
80e32eb42eStruckman
81e32eb42eStruckman-DEFAULT_COMPILER	= gcc
82e32eb42eStruckman-CC			= gcc
83e32eb42eStruckman-CCC			= g++
84e32eb42eStruckman+DEFAULT_COMPILER	= $(CC)
85e32eb42eStruckman+CCC			= $(CXX)
86e32eb42eStruckman RANLIB			= ranlib
87e32eb42eStruckman
88e32eb42eStruckman CPU_ARCH		= $(OS_TEST)
89e32eb42eStruckman@@ -21,7 +20,7 @@
90e32eb42eStruckman CPU_ARCH		= x86_64
91e32eb42eStruckman endif
92e32eb42eStruckman
93e32eb42eStruckman-OS_CFLAGS		= $(DSO_CFLAGS) -Wall -Wno-switch -DFREEBSD -DHAVE_STRERROR -DHAVE_BSD_FLOCK
94e32eb42eStruckman+OS_CFLAGS		= $(DSO_CFLAGS) -Wall -Wno-switch -DFREEBSD -DHAVE_STRERROR -DHAVE_UNISTD_H -DHAVE_BSD_FLOCK
95e32eb42eStruckman
96e32eb42eStruckman DSO_CFLAGS		= -fPIC
97e32eb42eStruckman DSO_LDOPTS		= -shared -Wl,-soname -Wl,$(notdir $@)
980ae430aaSDon Lewisdiff -ur misc/nss-3.39/nss/coreconf/Linux.mk misc/build/nss-3.39/nss/coreconf/Linux.mk
990ae430aaSDon Lewis--- misc/nss-3.39/nss/coreconf/Linux.mk	2018-08-31 05:55:53.000000000 -0700
100*f1341198SDon Lewis+++ misc/build/nss-3.39/nss/coreconf/Linux.mk	2020-10-06 07:41:59.567345437 -0700
1010ae430aaSDon Lewis@@ -140,7 +140,7 @@
102e32eb42eStruckman endif
103e32eb42eStruckman
104e32eb42eStruckman DSO_CFLAGS		= -fPIC
105e32eb42eStruckman-DSO_LDOPTS		= -shared $(ARCHFLAG) -Wl,--gc-sections
106e32eb42eStruckman+DSO_LDOPTS		= -shared $(ARCHFLAG) -Wl,--gc-sections '-Wl,-rpath,$$ORIGIN'
107e32eb42eStruckman # The linker on Red Hat Linux 7.2 and RHEL 2.1 (GNU ld version 2.11.90.0.8)
108cdf0e10cSrcweir # incorrectly reports undefined references in the libraries we link with, so
109cdf0e10cSrcweir # we don't use -z defs there.
1100ae430aaSDon Lewis@@ -177,8 +177,13 @@
111c38ced1bSHerbert Dürr endif
112c38ced1bSHerbert Dürr endif
113cdf0e10cSrcweir
114cdf0e10cSrcweir+ifeq ($(SYSTEM_ZLIB),YES)
115cdf0e10cSrcweir+# Currently (3.12.4) only the tools modutil and signtool are linked with libz
116cdf0e10cSrcweir+# If USE_SYSTEM_ZLIB is not set then the tools link statically libzlib.a which
117cdf0e10cSrcweir+# is also build in nss.
118cdf0e10cSrcweir USE_SYSTEM_ZLIB = 1
119cdf0e10cSrcweir ZLIB_LIBS = -lz
120cdf0e10cSrcweir+endif
121cdf0e10cSrcweir
122cdf0e10cSrcweir # The -rpath '$$ORIGIN' linker option instructs this library to search for its
123cdf0e10cSrcweir # dependencies in the same directory where it resides.
124*f1341198SDon Lewisdiff -ur misc/nss-3.39/nss/coreconf/rules.mk misc/build/nss-3.39/nss/coreconf/rules.mk
125*f1341198SDon Lewis--- misc/nss-3.39/nss/coreconf/rules.mk	2018-08-31 05:55:53.000000000 -0700
126*f1341198SDon Lewis+++ misc/build/nss-3.39/nss/coreconf/rules.mk	2020-10-06 07:41:59.567345437 -0700
127*f1341198SDon Lewis@@ -322,7 +322,12 @@
128*f1341198SDon Lewis ifdef NS_USE_GCC
129*f1341198SDon Lewis 	$(RC) $(filter-out -U%,$(DEFINES)) $(INCLUDES:-I%=--include-dir %) -o $@ $<
130*f1341198SDon Lewis else
131*f1341198SDon Lewis-	$(RC) $(filter-out -U%,$(DEFINES)) $(INCLUDES) -Fo$@ $<
132*f1341198SDon Lewis+        #We remove stl from the paths to avoid that rc.exe finds the stlport of
133*f1341198SDon Lewis+        #OOo. stlport includes the system stl which will fail. By removing it,
134*f1341198SDon Lewis+        #rc will use the stl from the system if the path is in the INCLUDE
135*f1341198SDon Lewis+        #variable.
136*f1341198SDon Lewis+	INCLUDE="$(subst /stl,,$(INCLUDE))" $(RC) $(filter-out -U%,$(DEFINES)) $(INCLUDES) -Fo$@ $<
137*f1341198SDon Lewis+
138*f1341198SDon Lewis endif
139*f1341198SDon Lewis 	@echo $(RES) finished
140*f1341198SDon Lewis endif
1410ae430aaSDon Lewisdiff -ur misc/nss-3.39/nss/coreconf/SunOS5.mk misc/build/nss-3.39/nss/coreconf/SunOS5.mk
1420ae430aaSDon Lewis--- misc/nss-3.39/nss/coreconf/SunOS5.mk	2018-08-31 05:55:53.000000000 -0700
143*f1341198SDon Lewis+++ misc/build/nss-3.39/nss/coreconf/SunOS5.mk	2020-10-06 07:41:59.567345437 -0700
144c38ced1bSHerbert Dürr@@ -48,8 +48,12 @@
145cdf0e10cSrcweir 	    # OPTIMIZER += -mno-omit-leaf-frame-pointer -fno-omit-frame-pointer
146cdf0e10cSrcweir 	endif
147cdf0e10cSrcweir else
148cdf0e10cSrcweir-	CC         = cc
149cdf0e10cSrcweir-	CCC        = CC
150cdf0e10cSrcweir+# CC is taken from environment automatically.
151cdf0e10cSrcweir+#	CC         = cc
152cdf0e10cSrcweir+# Use CXX from environment.
153cdf0e10cSrcweir+#	CCC        = CC
154cdf0e10cSrcweir+        CCC       = $(CXX)
155cdf0e10cSrcweir+
156cdf0e10cSrcweir 	ASFLAGS   += -Wa,-P
157cdf0e10cSrcweir 	OS_CFLAGS += $(NOMD_OS_CFLAGS) $(ARCHFLAG)
158cdf0e10cSrcweir 	ifndef BUILD_OPT
1590ae430aaSDon Lewisdiff -ur misc/nss-3.39/nss/lib/zlib/inflate.c misc/build/nss-3.39/nss/lib/zlib/inflate.c
1600ae430aaSDon Lewis--- misc/nss-3.39/nss/lib/zlib/inflate.c	2018-08-31 05:55:53.000000000 -0700
161*f1341198SDon Lewis+++ misc/build/nss-3.39/nss/lib/zlib/inflate.c	2020-10-06 07:41:59.567345437 -0700
162e32eb42eStruckman@@ -1472,9 +1472,9 @@
163e32eb42eStruckman {
164e32eb42eStruckman     struct inflate_state FAR *state;
165cdf0e10cSrcweir
166e32eb42eStruckman-    if (strm == Z_NULL || strm->state == Z_NULL) return -1L << 16;
167e32eb42eStruckman+    if (strm == Z_NULL || strm->state == Z_NULL) return ~0UL << 16;
168e32eb42eStruckman     state = (struct inflate_state FAR *)strm->state;
169e32eb42eStruckman-    return ((long)(state->back) << 16) +
170e32eb42eStruckman+    return ((unsigned long)(state->back) << 16) +
171e32eb42eStruckman         (state->mode == COPY ? state->length :
172e32eb42eStruckman             (state->mode == MATCH ? state->was - state->length : 0));
173e32eb42eStruckman }
174*f1341198SDon Lewisdiff -ur misc/nss-3.39/nss/Makefile misc/build/nss-3.39/nss/Makefile
175*f1341198SDon Lewis--- misc/nss-3.39/nss/Makefile	2018-08-31 05:55:53.000000000 -0700
176*f1341198SDon Lewis+++ misc/build/nss-3.39/nss/Makefile	2020-10-06 07:41:59.567345437 -0700
177*f1341198SDon Lewis@@ -77,6 +77,9 @@
178*f1341198SDon Lewis ifeq ($(OS_TARGET),WIN95)
179*f1341198SDon Lewis NSPR_CONFIGURE_OPTS += --enable-win32-target=WIN95
180*f1341198SDon Lewis endif
181*f1341198SDon Lewis+ifdef MACOS_SDK_DIR
182*f1341198SDon Lewis+NSPR_CONFIGURE_OPTS += --with-macos-sdk=$(MACOS_SDK_DIR)
183*f1341198SDon Lewis+endif
184*f1341198SDon Lewis ifdef USE_DEBUG_RTL
185*f1341198SDon Lewis NSPR_CONFIGURE_OPTS += --enable-debug-rtl
186*f1341198SDon Lewis endif
187