xref: /trunk/main/nss/nss.patch (revision 8cbbd4e89632851a5c403bc49fa61e6f018e19ec)
113effbfbSDon Lewisdiff -ur misc/nss-3.39/nspr/configure misc/build/nss-3.39/nspr/configure
213effbfbSDon Lewis--- misc/nss-3.39/nspr/configure    2018-08-28 05:42:28.000000000 -0700
32034d942SDon Lewis+++ misc/build/nss-3.39/nspr/configure  2020-10-06 07:41:59.563345390 -0700
413effbfbSDon 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
1313effbfbSDon Lewisdiff -ur misc/nss-3.39/nspr/pr/include/pratom.h misc/build/nss-3.39/nspr/pr/include/pratom.h
1413effbfbSDon Lewis--- misc/nss-3.39/nspr/pr/include/pratom.h  2018-08-28 05:42:28.000000000 -0700
152034d942SDon Lewis+++ misc/build/nss-3.39/nspr/pr/include/pratom.h    2020-10-06 07:41:59.563345390 -0700
16282fc96fStruckman@@ -81,7 +81,9 @@
17282fc96fStruckman #if defined(_WIN32) && !defined(_WIN32_WCE) && \
18282fc96fStruckman     (!defined(_MSC_VER) || (_MSC_VER >= 1310))
19cdf0e10cSrcweir
20282fc96fStruckman+PR_END_EXTERN_C
21282fc96fStruckman #include <intrin.h>
22282fc96fStruckman+PR_BEGIN_EXTERN_C
23cdf0e10cSrcweir
24282fc96fStruckman #ifdef _MSC_VER
25282fc96fStruckman #pragma intrinsic(_InterlockedIncrement)
2613effbfbSDon Lewisdiff -ur misc/nss-3.39/nss/cmd/platlibs.mk misc/build/nss-3.39/nss/cmd/platlibs.mk
2713effbfbSDon Lewis--- misc/nss-3.39/nss/cmd/platlibs.mk   2018-08-31 05:55:53.000000000 -0700
282034d942SDon Lewis+++ misc/build/nss-3.39/nss/cmd/platlibs.mk 2020-10-06 07:41:59.567345437 -0700
29c38ced1bSHerbert Dürr@@ -10,17 +10,18 @@
30c38ced1bSHerbert Dürr
31cdf0e10cSrcweir ifeq ($(OS_ARCH), SunOS)
32cdf0e10cSrcweir ifeq ($(USE_64), 1)
33cdf0e10cSrcweir-EXTRA_SHARED_LIBS += -R '$$ORIGIN/../lib:/usr/lib/mps/secv1/64:/usr/lib/mps/64'
34c38ced1bSHerbert Dürr+#In AOO we would probable put the executables next to libs
35cdf0e10cSrcweir+EXTRA_SHARED_LIBS += -R '$$ORIGIN'
36cdf0e10cSrcweir else
37cdf0e10cSrcweir-EXTRA_SHARED_LIBS += -R '$$ORIGIN/../lib:/usr/lib/mps/secv1:/usr/lib/mps'
38cdf0e10cSrcweir+EXTRA_SHARED_LIBS += -R '$$ORIGIN'
39cdf0e10cSrcweir endif
40cdf0e10cSrcweir endif
41cdf0e10cSrcweir
42cdf0e10cSrcweir ifeq ($(OS_ARCH), Linux)
43cdf0e10cSrcweir ifeq ($(USE_64), 1)
44cdf0e10cSrcweir-EXTRA_SHARED_LIBS += -Wl,-rpath,'$$ORIGIN/../lib64:/opt/sun/private/lib64:$$ORIGIN/../lib'
45cdf0e10cSrcweir+EXTRA_SHARED_LIBS += -Wl,-rpath,'$$ORIGIN'
46cdf0e10cSrcweir else
47cdf0e10cSrcweir-EXTRA_SHARED_LIBS += -Wl,-rpath,'$$ORIGIN/../lib:/opt/sun/private/lib'
48cdf0e10cSrcweir+EXTRA_SHARED_LIBS += -Wl,-rpath,'$$ORIGIN'
49cdf0e10cSrcweir endif
50cdf0e10cSrcweir endif
51c38ced1bSHerbert Dürr
5213effbfbSDon Lewisdiff -ur misc/nss-3.39/nss/cmd/shlibsign/Makefile misc/build/nss-3.39/nss/cmd/shlibsign/Makefile
5313effbfbSDon Lewis--- misc/nss-3.39/nss/cmd/shlibsign/Makefile    2018-08-31 05:55:53.000000000 -0700
542034d942SDon Lewis+++ misc/build/nss-3.39/nss/cmd/shlibsign/Makefile  2020-10-06 07:41:59.567345437 -0700
55282fc96fStruckman@@ -49,10 +49,15 @@
56282fc96fStruckman CHECKLIBS =
57282fc96fStruckman CHECKLOC =
58282fc96fStruckman else
59cdf0e10cSrcweir-CHECKLIBS = $(DIST)/lib/$(DLL_PREFIX)softokn3.$(DLL_SUFFIX)
60cdf0e10cSrcweir-CHECKLIBS += $(wildcard $(DIST)/lib/$(DLL_PREFIX)freebl*3.$(DLL_SUFFIX))
61cdf0e10cSrcweir+# Signing causes loading of some system library which in turn loads
62cdf0e10cSrcweir+# libsqlite3. Then it loads libsqulite3 from nss, which does not have the proper
63cdf0e10cSrcweir+# version. Therefore signing fails.
64cdf0e10cSrcweir+# We cannot build with the system sqlite3, because it is too old (SDK
65cdf0e10cSrcweir+# 10.4). Otherwise one could set NSS_USE_SYSTEM_SQLITE=1 and use the system lib.
66cdf0e10cSrcweir+#CHECKLIBS = $(DIST)/lib/$(DLL_PREFIX)softokn3.$(DLL_SUFFIX)
67cdf0e10cSrcweir+#CHECKLIBS += $(wildcard $(DIST)/lib/$(DLL_PREFIX)freebl*3.$(DLL_SUFFIX))
68cdf0e10cSrcweir ifndef NSS_DISABLE_DBM
69cdf0e10cSrcweir-CHECKLIBS += $(DIST)/lib/$(DLL_PREFIX)nssdbm3.$(DLL_SUFFIX)
70cdf0e10cSrcweir+#CHECKLIBS += $(DIST)/lib/$(DLL_PREFIX)nssdbm3.$(DLL_SUFFIX)
71cdf0e10cSrcweir endif
72cdf0e10cSrcweir CHECKLOC = $(CHECKLIBS:.$(DLL_SUFFIX)=.chk)
73cdf0e10cSrcweir
742034d942SDon Lewisdiff -ur misc/nss-3.39/nss/coreconf/Darwin.mk misc/build/nss-3.39/nss/coreconf/Darwin.mk
752034d942SDon Lewis--- misc/nss-3.39/nss/coreconf/Darwin.mk    2018-08-31 05:55:53.000000000 -0700
762034d942SDon Lewis+++ misc/build/nss-3.39/nss/coreconf/Darwin.mk  2020-10-06 07:51:49.590356560 -0700
772034d942SDon Lewis@@ -3,14 +3,15 @@
782034d942SDon Lewis # License, v. 2.0. If a copy of the MPL was not distributed with this
792034d942SDon Lewis # file, You can obtain one at http://mozilla.org/MPL/2.0/.
802034d942SDon Lewis
812034d942SDon Lewis-CC     ?= gcc
822034d942SDon Lewis-CCC    ?= g++
832034d942SDon Lewis+# CC is taken from environment automatically.
842034d942SDon Lewis+#CC     ?= gcc
85*8cbbd4e8SJim Jagielski+CCC    ?= $(CXX)
862034d942SDon Lewis RANLIB ?= ranlib
872034d942SDon Lewis
882034d942SDon Lewis include $(CORE_DEPTH)/coreconf/UNIX.mk
892034d942SDon Lewis-include $(CORE_DEPTH)/coreconf/Werror.mk
902034d942SDon Lewis+#include $(CORE_DEPTH)/coreconf/Werror.mk
912034d942SDon Lewis
922034d942SDon Lewis-DEFAULT_COMPILER = gcc
932034d942SDon Lewis+DEFAULT_COMPILER = cc
942034d942SDon Lewis
952034d942SDon Lewis ifndef CPU_ARCH
962034d942SDon Lewis # When cross-compiling, CPU_ARCH should already be defined as the target
9713effbfbSDon Lewisdiff -ur misc/nss-3.39/nss/coreconf/FreeBSD.mk misc/build/nss-3.39/nss/coreconf/FreeBSD.mk
9813effbfbSDon Lewis--- misc/nss-3.39/nss/coreconf/FreeBSD.mk   2018-08-31 05:55:53.000000000 -0700
992034d942SDon Lewis+++ misc/build/nss-3.39/nss/coreconf/FreeBSD.mk 2020-10-06 07:41:59.567345437 -0700
100282fc96fStruckman@@ -5,9 +5,8 @@
101282fc96fStruckman
102282fc96fStruckman include $(CORE_DEPTH)/coreconf/UNIX.mk
103282fc96fStruckman
104282fc96fStruckman-DEFAULT_COMPILER   = gcc
105282fc96fStruckman-CC         = gcc
106282fc96fStruckman-CCC            = g++
107282fc96fStruckman+DEFAULT_COMPILER   = $(CC)
108282fc96fStruckman+CCC            = $(CXX)
109282fc96fStruckman RANLIB         = ranlib
110282fc96fStruckman
111282fc96fStruckman CPU_ARCH       = $(OS_TEST)
112282fc96fStruckman@@ -21,7 +20,7 @@
113282fc96fStruckman CPU_ARCH       = x86_64
114282fc96fStruckman endif
115282fc96fStruckman
116282fc96fStruckman-OS_CFLAGS      = $(DSO_CFLAGS) -Wall -Wno-switch -DFREEBSD -DHAVE_STRERROR -DHAVE_BSD_FLOCK
117282fc96fStruckman+OS_CFLAGS      = $(DSO_CFLAGS) -Wall -Wno-switch -DFREEBSD -DHAVE_STRERROR -DHAVE_UNISTD_H -DHAVE_BSD_FLOCK
118282fc96fStruckman
119282fc96fStruckman DSO_CFLAGS     = -fPIC
120282fc96fStruckman DSO_LDOPTS     = -shared -Wl,-soname -Wl,$(notdir $@)
12113effbfbSDon Lewisdiff -ur misc/nss-3.39/nss/coreconf/Linux.mk misc/build/nss-3.39/nss/coreconf/Linux.mk
12213effbfbSDon Lewis--- misc/nss-3.39/nss/coreconf/Linux.mk 2018-08-31 05:55:53.000000000 -0700
1232034d942SDon Lewis+++ misc/build/nss-3.39/nss/coreconf/Linux.mk   2020-10-06 07:41:59.567345437 -0700
12413effbfbSDon Lewis@@ -140,7 +140,7 @@
125282fc96fStruckman endif
126282fc96fStruckman
127282fc96fStruckman DSO_CFLAGS     = -fPIC
128282fc96fStruckman-DSO_LDOPTS     = -shared $(ARCHFLAG) -Wl,--gc-sections
129282fc96fStruckman+DSO_LDOPTS     = -shared $(ARCHFLAG) -Wl,--gc-sections '-Wl,-rpath,$$ORIGIN'
130282fc96fStruckman # The linker on Red Hat Linux 7.2 and RHEL 2.1 (GNU ld version 2.11.90.0.8)
131282fc96fStruckman # incorrectly reports undefined references in the libraries we link with, so
132282fc96fStruckman # we don't use -z defs there.
13313effbfbSDon Lewis@@ -177,8 +177,13 @@
134282fc96fStruckman endif
135282fc96fStruckman endif
136282fc96fStruckman
137282fc96fStruckman+ifeq ($(SYSTEM_ZLIB),YES)
138282fc96fStruckman+# Currently (3.12.4) only the tools modutil and signtool are linked with libz
139282fc96fStruckman+# If USE_SYSTEM_ZLIB is not set then the tools link statically libzlib.a which
140282fc96fStruckman+# is also build in nss.
141282fc96fStruckman USE_SYSTEM_ZLIB = 1
142282fc96fStruckman ZLIB_LIBS = -lz
143282fc96fStruckman+endif
144282fc96fStruckman
145282fc96fStruckman # The -rpath '$$ORIGIN' linker option instructs this library to search for its
146282fc96fStruckman # dependencies in the same directory where it resides.
1472034d942SDon Lewisdiff -ur misc/nss-3.39/nss/coreconf/rules.mk misc/build/nss-3.39/nss/coreconf/rules.mk
1482034d942SDon Lewis--- misc/nss-3.39/nss/coreconf/rules.mk 2018-08-31 05:55:53.000000000 -0700
1492034d942SDon Lewis+++ misc/build/nss-3.39/nss/coreconf/rules.mk   2020-10-06 07:41:59.567345437 -0700
1502034d942SDon Lewis@@ -322,7 +322,12 @@
1512034d942SDon Lewis ifdef NS_USE_GCC
1522034d942SDon Lewis    $(RC) $(filter-out -U%,$(DEFINES)) $(INCLUDES:-I%=--include-dir %) -o $@ $<
1532034d942SDon Lewis else
1542034d942SDon Lewis-   $(RC) $(filter-out -U%,$(DEFINES)) $(INCLUDES) -Fo$@ $<
1552034d942SDon Lewis+        #We remove stl from the paths to avoid that rc.exe finds the stlport of
1562034d942SDon Lewis+        #OOo. stlport includes the system stl which will fail. By removing it,
1572034d942SDon Lewis+        #rc will use the stl from the system if the path is in the INCLUDE
1582034d942SDon Lewis+        #variable.
1592034d942SDon Lewis+   INCLUDE="$(subst /stl,,$(INCLUDE))" $(RC) $(filter-out -U%,$(DEFINES)) $(INCLUDES) -Fo$@ $<
1602034d942SDon Lewis+
1612034d942SDon Lewis endif
1622034d942SDon Lewis    @echo $(RES) finished
1632034d942SDon Lewis endif
16413effbfbSDon Lewisdiff -ur misc/nss-3.39/nss/coreconf/SunOS5.mk misc/build/nss-3.39/nss/coreconf/SunOS5.mk
16513effbfbSDon Lewis--- misc/nss-3.39/nss/coreconf/SunOS5.mk    2018-08-31 05:55:53.000000000 -0700
1662034d942SDon Lewis+++ misc/build/nss-3.39/nss/coreconf/SunOS5.mk  2020-10-06 07:41:59.567345437 -0700
167282fc96fStruckman@@ -48,8 +48,12 @@
168282fc96fStruckman        # OPTIMIZER += -mno-omit-leaf-frame-pointer -fno-omit-frame-pointer
169282fc96fStruckman    endif
170282fc96fStruckman else
171282fc96fStruckman-   CC         = cc
172282fc96fStruckman-   CCC        = CC
173282fc96fStruckman+# CC is taken from environment automatically.
174282fc96fStruckman+#  CC         = cc
175282fc96fStruckman+# Use CXX from environment.
176282fc96fStruckman+#  CCC        = CC
177282fc96fStruckman+        CCC       = $(CXX)
178282fc96fStruckman+
179282fc96fStruckman    ASFLAGS   += -Wa,-P
180282fc96fStruckman    OS_CFLAGS += $(NOMD_OS_CFLAGS) $(ARCHFLAG)
181282fc96fStruckman    ifndef BUILD_OPT
18213effbfbSDon Lewisdiff -ur misc/nss-3.39/nss/lib/zlib/inflate.c misc/build/nss-3.39/nss/lib/zlib/inflate.c
18313effbfbSDon Lewis--- misc/nss-3.39/nss/lib/zlib/inflate.c    2018-08-31 05:55:53.000000000 -0700
1842034d942SDon Lewis+++ misc/build/nss-3.39/nss/lib/zlib/inflate.c  2020-10-06 07:41:59.567345437 -0700
185282fc96fStruckman@@ -1472,9 +1472,9 @@
186282fc96fStruckman {
187282fc96fStruckman     struct inflate_state FAR *state;
188282fc96fStruckman
189282fc96fStruckman-    if (strm == Z_NULL || strm->state == Z_NULL) return -1L << 16;
190282fc96fStruckman+    if (strm == Z_NULL || strm->state == Z_NULL) return ~0UL << 16;
191282fc96fStruckman     state = (struct inflate_state FAR *)strm->state;
192282fc96fStruckman-    return ((long)(state->back) << 16) +
193282fc96fStruckman+    return ((unsigned long)(state->back) << 16) +
194282fc96fStruckman         (state->mode == COPY ? state->length :
195282fc96fStruckman             (state->mode == MATCH ? state->was - state->length : 0));
196282fc96fStruckman }
1972034d942SDon Lewisdiff -ur misc/nss-3.39/nss/Makefile misc/build/nss-3.39/nss/Makefile
1982034d942SDon Lewis--- misc/nss-3.39/nss/Makefile  2018-08-31 05:55:53.000000000 -0700
1992034d942SDon Lewis+++ misc/build/nss-3.39/nss/Makefile    2020-10-06 07:41:59.567345437 -0700
2002034d942SDon Lewis@@ -77,6 +77,9 @@
2012034d942SDon Lewis ifeq ($(OS_TARGET),WIN95)
2022034d942SDon Lewis NSPR_CONFIGURE_OPTS += --enable-win32-target=WIN95
2032034d942SDon Lewis endif
2042034d942SDon Lewis+ifdef MACOS_SDK_DIR
2052034d942SDon Lewis+NSPR_CONFIGURE_OPTS += --with-macos-sdk=$(MACOS_SDK_DIR)
2062034d942SDon Lewis+endif
2072034d942SDon Lewis ifdef USE_DEBUG_RTL
2082034d942SDon Lewis NSPR_CONFIGURE_OPTS += --enable-debug-rtl
2092034d942SDon Lewis endif
210