xref: /aoo41x/main/nss/nss.patch (revision 0ae430aa)
1*0ae430aaSDon Lewisdiff -ur misc/nss-3.39/nspr/configure misc/build/nss-3.39/nspr/configure
2*0ae430aaSDon Lewis--- misc/nss-3.39/nspr/configure	2018-08-28 05:42:28.000000000 -0700
3*0ae430aaSDon Lewis+++ misc/build/nss-3.39/nspr/configure	2018-09-10 10:30:19.953743000 -0700
4*0ae430aaSDon 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
13*0ae430aaSDon Lewisdiff -ur misc/nss-3.39/nspr/pr/include/pratom.h misc/build/nss-3.39/nspr/pr/include/pratom.h
14*0ae430aaSDon Lewis--- misc/nss-3.39/nspr/pr/include/pratom.h	2018-08-28 05:42:28.000000000 -0700
15*0ae430aaSDon Lewis+++ misc/build/nss-3.39/nspr/pr/include/pratom.h	2018-09-10 10:30:19.954252000 -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)
26*0ae430aaSDon Lewisdiff -ur misc/nss-3.39/nss/Makefile misc/build/nss-3.39/nss/Makefile
27*0ae430aaSDon Lewis--- misc/nss-3.39/nss/Makefile	2018-08-31 05:55:53.000000000 -0700
28*0ae430aaSDon Lewis+++ misc/build/nss-3.39/nss/Makefile	2018-09-10 10:30:19.954774000 -0700
29*0ae430aaSDon Lewis@@ -77,6 +77,9 @@
30e32eb42eStruckman ifeq ($(OS_TARGET),WIN95)
31e32eb42eStruckman NSPR_CONFIGURE_OPTS += --enable-win32-target=WIN95
32e32eb42eStruckman endif
33e32eb42eStruckman+ifdef MACOS_SDK_DIR
34e32eb42eStruckman+NSPR_CONFIGURE_OPTS += --with-macos-sdk=$(MACOS_SDK_DIR)
35e32eb42eStruckman+endif
36e32eb42eStruckman ifdef USE_DEBUG_RTL
37e32eb42eStruckman NSPR_CONFIGURE_OPTS += --enable-debug-rtl
38e32eb42eStruckman endif
39*0ae430aaSDon Lewisdiff -ur misc/nss-3.39/nss/cmd/platlibs.mk misc/build/nss-3.39/nss/cmd/platlibs.mk
40*0ae430aaSDon Lewis--- misc/nss-3.39/nss/cmd/platlibs.mk	2018-08-31 05:55:53.000000000 -0700
41*0ae430aaSDon Lewis+++ misc/build/nss-3.39/nss/cmd/platlibs.mk	2018-09-10 10:30:19.955267000 -0700
42e32eb42eStruckman@@ -10,17 +10,18 @@
43e32eb42eStruckman
44e32eb42eStruckman ifeq ($(OS_ARCH), SunOS)
45e32eb42eStruckman ifeq ($(USE_64), 1)
46e32eb42eStruckman-EXTRA_SHARED_LIBS += -R '$$ORIGIN/../lib:/usr/lib/mps/secv1/64:/usr/lib/mps/64'
47e32eb42eStruckman+#In AOO we would probable put the executables next to libs
48e32eb42eStruckman+EXTRA_SHARED_LIBS += -R '$$ORIGIN'
49e32eb42eStruckman else
50e32eb42eStruckman-EXTRA_SHARED_LIBS += -R '$$ORIGIN/../lib:/usr/lib/mps/secv1:/usr/lib/mps'
51e32eb42eStruckman+EXTRA_SHARED_LIBS += -R '$$ORIGIN'
52e32eb42eStruckman endif
53e32eb42eStruckman endif
54e32eb42eStruckman
55e32eb42eStruckman ifeq ($(OS_ARCH), Linux)
56e32eb42eStruckman ifeq ($(USE_64), 1)
57e32eb42eStruckman-EXTRA_SHARED_LIBS += -Wl,-rpath,'$$ORIGIN/../lib64:/opt/sun/private/lib64:$$ORIGIN/../lib'
58e32eb42eStruckman+EXTRA_SHARED_LIBS += -Wl,-rpath,'$$ORIGIN'
59e32eb42eStruckman else
60e32eb42eStruckman-EXTRA_SHARED_LIBS += -Wl,-rpath,'$$ORIGIN/../lib:/opt/sun/private/lib'
61e32eb42eStruckman+EXTRA_SHARED_LIBS += -Wl,-rpath,'$$ORIGIN'
62e32eb42eStruckman endif
63e32eb42eStruckman endif
64e32eb42eStruckman
65*0ae430aaSDon Lewisdiff -ur misc/nss-3.39/nss/cmd/shlibsign/Makefile misc/build/nss-3.39/nss/cmd/shlibsign/Makefile
66*0ae430aaSDon Lewis--- misc/nss-3.39/nss/cmd/shlibsign/Makefile	2018-08-31 05:55:53.000000000 -0700
67*0ae430aaSDon Lewis+++ misc/build/nss-3.39/nss/cmd/shlibsign/Makefile	2018-09-10 10:30:19.955769000 -0700
68e32eb42eStruckman@@ -49,10 +49,15 @@
69e32eb42eStruckman CHECKLIBS =
70e32eb42eStruckman CHECKLOC =
71e32eb42eStruckman else
72e32eb42eStruckman-CHECKLIBS = $(DIST)/lib/$(DLL_PREFIX)softokn3.$(DLL_SUFFIX)
73e32eb42eStruckman-CHECKLIBS += $(wildcard $(DIST)/lib/$(DLL_PREFIX)freebl*3.$(DLL_SUFFIX))
74e32eb42eStruckman+# Signing causes loading of some system library which in turn loads
75e32eb42eStruckman+# libsqlite3. Then it loads libsqulite3 from nss, which does not have the proper
76e32eb42eStruckman+# version. Therefore signing fails.
77e32eb42eStruckman+# We cannot build with the system sqlite3, because it is too old (SDK
78e32eb42eStruckman+# 10.4). Otherwise one could set NSS_USE_SYSTEM_SQLITE=1 and use the system lib.
79e32eb42eStruckman+#CHECKLIBS = $(DIST)/lib/$(DLL_PREFIX)softokn3.$(DLL_SUFFIX)
80e32eb42eStruckman+#CHECKLIBS += $(wildcard $(DIST)/lib/$(DLL_PREFIX)freebl*3.$(DLL_SUFFIX))
81e32eb42eStruckman ifndef NSS_DISABLE_DBM
82e32eb42eStruckman-CHECKLIBS += $(DIST)/lib/$(DLL_PREFIX)nssdbm3.$(DLL_SUFFIX)
83e32eb42eStruckman+#CHECKLIBS += $(DIST)/lib/$(DLL_PREFIX)nssdbm3.$(DLL_SUFFIX)
84e32eb42eStruckman endif
85e32eb42eStruckman CHECKLOC = $(CHECKLIBS:.$(DLL_SUFFIX)=.chk)
86e32eb42eStruckman
87*0ae430aaSDon LewisOnly in misc/build/nss-3.39/nss/coreconf: Darwin.mk.rej
88*0ae430aaSDon Lewisdiff -ur misc/nss-3.39/nss/coreconf/FreeBSD.mk misc/build/nss-3.39/nss/coreconf/FreeBSD.mk
89*0ae430aaSDon Lewis--- misc/nss-3.39/nss/coreconf/FreeBSD.mk	2018-08-31 05:55:53.000000000 -0700
90*0ae430aaSDon Lewis+++ misc/build/nss-3.39/nss/coreconf/FreeBSD.mk	2018-09-10 10:30:19.956982000 -0700
91e32eb42eStruckman@@ -5,9 +5,8 @@
92e32eb42eStruckman
93e32eb42eStruckman include $(CORE_DEPTH)/coreconf/UNIX.mk
94e32eb42eStruckman
95e32eb42eStruckman-DEFAULT_COMPILER	= gcc
96e32eb42eStruckman-CC			= gcc
97e32eb42eStruckman-CCC			= g++
98e32eb42eStruckman+DEFAULT_COMPILER	= $(CC)
99e32eb42eStruckman+CCC			= $(CXX)
100e32eb42eStruckman RANLIB			= ranlib
101e32eb42eStruckman
102e32eb42eStruckman CPU_ARCH		= $(OS_TEST)
103e32eb42eStruckman@@ -21,7 +20,7 @@
104e32eb42eStruckman CPU_ARCH		= x86_64
105e32eb42eStruckman endif
106e32eb42eStruckman
107e32eb42eStruckman-OS_CFLAGS		= $(DSO_CFLAGS) -Wall -Wno-switch -DFREEBSD -DHAVE_STRERROR -DHAVE_BSD_FLOCK
108e32eb42eStruckman+OS_CFLAGS		= $(DSO_CFLAGS) -Wall -Wno-switch -DFREEBSD -DHAVE_STRERROR -DHAVE_UNISTD_H -DHAVE_BSD_FLOCK
109e32eb42eStruckman
110e32eb42eStruckman DSO_CFLAGS		= -fPIC
111e32eb42eStruckman DSO_LDOPTS		= -shared -Wl,-soname -Wl,$(notdir $@)
112*0ae430aaSDon Lewisdiff -ur misc/nss-3.39/nss/coreconf/Linux.mk misc/build/nss-3.39/nss/coreconf/Linux.mk
113*0ae430aaSDon Lewis--- misc/nss-3.39/nss/coreconf/Linux.mk	2018-08-31 05:55:53.000000000 -0700
114*0ae430aaSDon Lewis+++ misc/build/nss-3.39/nss/coreconf/Linux.mk	2018-09-10 10:30:19.957638000 -0700
115*0ae430aaSDon Lewis@@ -140,7 +140,7 @@
116e32eb42eStruckman endif
117e32eb42eStruckman
118e32eb42eStruckman DSO_CFLAGS		= -fPIC
119e32eb42eStruckman-DSO_LDOPTS		= -shared $(ARCHFLAG) -Wl,--gc-sections
120e32eb42eStruckman+DSO_LDOPTS		= -shared $(ARCHFLAG) -Wl,--gc-sections '-Wl,-rpath,$$ORIGIN'
121e32eb42eStruckman # The linker on Red Hat Linux 7.2 and RHEL 2.1 (GNU ld version 2.11.90.0.8)
122cdf0e10cSrcweir # incorrectly reports undefined references in the libraries we link with, so
123cdf0e10cSrcweir # we don't use -z defs there.
124*0ae430aaSDon Lewis@@ -177,8 +177,13 @@
125c38ced1bSHerbert Dürr endif
126c38ced1bSHerbert Dürr endif
127cdf0e10cSrcweir
128cdf0e10cSrcweir+ifeq ($(SYSTEM_ZLIB),YES)
129cdf0e10cSrcweir+# Currently (3.12.4) only the tools modutil and signtool are linked with libz
130cdf0e10cSrcweir+# If USE_SYSTEM_ZLIB is not set then the tools link statically libzlib.a which
131cdf0e10cSrcweir+# is also build in nss.
132cdf0e10cSrcweir USE_SYSTEM_ZLIB = 1
133cdf0e10cSrcweir ZLIB_LIBS = -lz
134cdf0e10cSrcweir+endif
135cdf0e10cSrcweir
136cdf0e10cSrcweir # The -rpath '$$ORIGIN' linker option instructs this library to search for its
137cdf0e10cSrcweir # dependencies in the same directory where it resides.
138*0ae430aaSDon LewisOnly in misc/build/nss-3.39/nss/coreconf: Linux.mk.rej
139*0ae430aaSDon Lewisdiff -ur misc/nss-3.39/nss/coreconf/SunOS5.mk misc/build/nss-3.39/nss/coreconf/SunOS5.mk
140*0ae430aaSDon Lewis--- misc/nss-3.39/nss/coreconf/SunOS5.mk	2018-08-31 05:55:53.000000000 -0700
141*0ae430aaSDon Lewis+++ misc/build/nss-3.39/nss/coreconf/SunOS5.mk	2018-09-10 10:30:19.958249000 -0700
142c38ced1bSHerbert Dürr@@ -48,8 +48,12 @@
143cdf0e10cSrcweir 	    # OPTIMIZER += -mno-omit-leaf-frame-pointer -fno-omit-frame-pointer
144cdf0e10cSrcweir 	endif
145cdf0e10cSrcweir else
146cdf0e10cSrcweir-	CC         = cc
147cdf0e10cSrcweir-	CCC        = CC
148cdf0e10cSrcweir+# CC is taken from environment automatically.
149cdf0e10cSrcweir+#	CC         = cc
150cdf0e10cSrcweir+# Use CXX from environment.
151cdf0e10cSrcweir+#	CCC        = CC
152cdf0e10cSrcweir+        CCC       = $(CXX)
153cdf0e10cSrcweir+
154cdf0e10cSrcweir 	ASFLAGS   += -Wa,-P
155cdf0e10cSrcweir 	OS_CFLAGS += $(NOMD_OS_CFLAGS) $(ARCHFLAG)
156cdf0e10cSrcweir 	ifndef BUILD_OPT
157*0ae430aaSDon LewisOnly in misc/build/nss-3.39/nss/coreconf: arch.mk.rej
158*0ae430aaSDon Lewisdiff -ur misc/nss-3.39/nss/coreconf/rules.mk misc/build/nss-3.39/nss/coreconf/rules.mk
159*0ae430aaSDon Lewis--- misc/nss-3.39/nss/coreconf/rules.mk	2018-08-31 05:55:53.000000000 -0700
160*0ae430aaSDon Lewis+++ misc/build/nss-3.39/nss/coreconf/rules.mk	2018-09-10 10:30:19.959531000 -0700
161e32eb42eStruckman@@ -322,7 +322,12 @@
162cdf0e10cSrcweir ifdef NS_USE_GCC
163cdf0e10cSrcweir 	$(RC) $(filter-out -U%,$(DEFINES)) $(INCLUDES:-I%=--include-dir %) -o $@ $<
164cdf0e10cSrcweir else
165cdf0e10cSrcweir-	$(RC) $(filter-out -U%,$(DEFINES)) $(INCLUDES) -Fo$@ $<
166cdf0e10cSrcweir+        #We remove stl from the paths to avoid that rc.exe finds the stlport of
167cdf0e10cSrcweir+        #OOo. stlport includes the system stl which will fail. By removing it,
168cdf0e10cSrcweir+        #rc will use the stl from the system if the path is in the INCLUDE
169cdf0e10cSrcweir+        #variable.
170cdf0e10cSrcweir+	INCLUDE="$(subst /stl,,$(INCLUDE))" $(RC) $(filter-out -U%,$(DEFINES)) $(INCLUDES) -Fo$@ $<
171cdf0e10cSrcweir+
172cdf0e10cSrcweir endif
173cdf0e10cSrcweir 	@echo $(RES) finished
174cdf0e10cSrcweir endif
175*0ae430aaSDon Lewisdiff -ur misc/nss-3.39/nss/lib/zlib/inflate.c misc/build/nss-3.39/nss/lib/zlib/inflate.c
176*0ae430aaSDon Lewis--- misc/nss-3.39/nss/lib/zlib/inflate.c	2018-08-31 05:55:53.000000000 -0700
177*0ae430aaSDon Lewis+++ misc/build/nss-3.39/nss/lib/zlib/inflate.c	2018-09-10 10:30:19.960242000 -0700
178e32eb42eStruckman@@ -1472,9 +1472,9 @@
179e32eb42eStruckman {
180e32eb42eStruckman     struct inflate_state FAR *state;
181cdf0e10cSrcweir
182e32eb42eStruckman-    if (strm == Z_NULL || strm->state == Z_NULL) return -1L << 16;
183e32eb42eStruckman+    if (strm == Z_NULL || strm->state == Z_NULL) return ~0UL << 16;
184e32eb42eStruckman     state = (struct inflate_state FAR *)strm->state;
185e32eb42eStruckman-    return ((long)(state->back) << 16) +
186e32eb42eStruckman+    return ((unsigned long)(state->back) << 16) +
187e32eb42eStruckman         (state->mode == COPY ? state->length :
188e32eb42eStruckman             (state->mode == MATCH ? state->was - state->length : 0));
189e32eb42eStruckman }
190