Bump version to 24.04.3.4
[LibreOffice.git] / external / nss / nss-ios.patch
blob58239f71897813d85e8ac3cf0e3e7b8060f6ff7f
1 --- a/a/nss/Makefile
2 +++ a/a/nss/Makefile
3 @@ -91,13 +91,11 @@
4 ifdef NS_USE_GCC
5 NSPR_CONFIGURE_ENV = CC=gcc CXX=g++
6 endif
7 -# Make sure to remove -arch arguments. NSPR can't handle that.
8 -remove_arch = $(filter-out __REMOVEME%,$(subst $(NULL) -arch , __REMOVEME,$(1)))
9 ifdef CC
10 -NSPR_CONFIGURE_ENV = CC="$(call remove_arch,$(CC))"
11 +NSPR_CONFIGURE_ENV = CC="$(CC)"
12 endif
13 ifdef CCC
14 -NSPR_CONFIGURE_ENV += CXX="$(call remove_arch,$(CCC))"
15 +NSPR_CONFIGURE_ENV += CXX="$(CCC)"
16 endif
19 @@ -140,7 +138,6 @@
21 build_nspr: $(NSPR_CONFIG_STATUS)
22 $(MAKE) -C $(CORE_DEPTH)/../nspr/$(OBJDIR_NAME)
23 - $(MAKE) -C $(CORE_DEPTH)/../nspr/$(OBJDIR_NAME)/pr/tests
25 install_nspr: build_nspr
26 $(MAKE) -C $(CORE_DEPTH)/../nspr/$(OBJDIR_NAME) install
27 --- a/a/nss/lib/ckfw/builtins/manifest.mn
28 +++ a/a/nss/lib/ckfw/builtins/manifest.mn
29 @@ -5,7 +5,7 @@
31 CORE_DEPTH = ../../..
33 -DIRS = testlib
34 +DIRS =
36 MODULE = nss
38 --- a/a/nss/lib/nss/nssinit.c
39 +++ a/a/nss/lib/nss/nssinit.c
40 @@ -275,6 +275,7 @@
41 const char *secmodprefix,
42 char **retoldpath, char **retnewpath)
44 +#ifndef NSS_STATIC_PKCS11
45 char *path, *oldpath = NULL, *lastsep;
46 int len, path_len, secmod_len, dll_len;
48 @@ -309,6 +310,10 @@
50 *retoldpath = oldpath;
51 *retnewpath = path;
52 +#else
53 + *retoldpath = NULL;
54 + *retnewpath = PORT_Strdup("NSSCKBI");
55 +#endif
56 return;
59 --- a/a/nss/lib/pk11wrap/pk11load.c
60 +++ a/a/nss/lib/pk11wrap/pk11load.c
61 @@ -390,6 +390,8 @@
63 * load a new module into our address space and initialize it.
65 +extern CK_RV NSSCKBI_C_GetFunctionList();
67 SECStatus
68 secmod_LoadPKCS11Module(SECMODModule *mod, SECMODModule **oldModule)
70 @@ -468,6 +470,7 @@
71 /* load the library. If this succeeds, then we have to remember to
72 * unload the library if anything goes wrong from here on out...
74 +#ifndef NSS_STATIC_PKCS11 // With NSS_STATIC_PKCS11, the only module wodule we load here is nssckbi
75 #if defined(_WIN32)
76 if (nssUTF8_Length(mod->dllName, NULL)) {
77 wchar_t *dllNameWide = _NSSUTIL_UTF8ToWide(mod->dllName);
78 @@ -507,6 +510,11 @@
79 mod->moduleDBFunc = (void *)
80 PR_FindSymbol(library, "NSS_ReturnModuleSpecData");
82 +#else
83 + if (strcmp(mod->dllName, "NSSCKBI") == 0)
84 + fentry = NSSCKBI_C_GetFunctionList;
85 +#endif
87 if (mod->moduleDBFunc == NULL)
88 mod->isModuleDB = PR_FALSE;
89 if ((ientry == NULL) && (fentry == NULL)) {
90 @@ -643,10 +651,12 @@
92 fail:
93 mod->functionList = NULL;
94 +#ifndef NSS_STATIC_PKCS11
95 disableUnload = PR_GetEnvSecure("NSS_DISABLE_UNLOAD");
96 if (library && !disableUnload) {
97 PR_UnloadLibrary(library);
99 +#endif
100 return SECFailure;
103 --- a/a/nss/lib/ckfw/nssck.api
104 +++ a/a/nss/lib/ckfw/nssck.api
105 @@ -1842,7 +1842,11 @@
107 /* This one is always present */
108 CK_RV CK_ENTRY
109 +#ifndef NSS_STATIC_PKCS11
110 C_GetFunctionList
111 +#else
112 +NSSCKBI_C_GetFunctionList
113 +#endif
115 CK_FUNCTION_LIST_PTR_PTR ppFunctionList
117 --- a/a/nss/lib/freebl/loader.c
118 +++ a/a/nss/lib/freebl/loader.c
119 @@ -35,6 +35,7 @@
120 static PRStatus
121 freebl_LoadDSO(void)
123 +#ifndef NSS_STATIC_FREEBL
124 PRLibrary *handle;
125 const char *name = getLibName();
127 @@ -47,32 +48,42 @@
128 if (handle) {
129 PRFuncPtr address = PR_FindFunctionSymbol(handle, "FREEBL_GetVector");
130 if (address) {
131 - FREEBLGetVectorFn *getVector = (FREEBLGetVectorFn *)address;
132 +#else
133 + FREEBLGetVectorFn *getVector = FREEBL_GetVector;
134 +#endif
135 const FREEBLVector *dsoVector = getVector();
136 if (dsoVector) {
137 unsigned short dsoVersion = dsoVector->version;
138 unsigned short myVersion = FREEBL_VERSION;
139 if (MSB(dsoVersion) == MSB(myVersion) &&
140 LSB(dsoVersion) >= LSB(myVersion) &&
141 dsoVector->length >= sizeof(FREEBLVector)) {
142 vector = dsoVector;
143 +#ifndef NSS_STATIC_FREEBL
144 libraryName = name;
145 blLib = handle;
146 +#else
147 + libraryName = "self";
148 +#endif
149 return PR_SUCCESS;
152 + else
153 + return PR_FAILURE;
154 +#ifndef NSS_STATIC_FREEBL
156 #ifdef DEBUG
157 if (blLib) {
158 PRStatus status = PR_UnloadLibrary(blLib);
159 PORT_Assert(PR_SUCCESS == status);
161 #else
162 if (blLib)
163 PR_UnloadLibrary(blLib);
164 #endif
166 return PR_FAILURE;
167 +#endif
170 static const PRCallOnceType pristineCallOnce;
171 @@ -860,6 +871,7 @@
172 void
173 BL_Unload(void)
175 +#ifndef NSS_STATIC_FREEBL
176 /* This function is not thread-safe, but doesn't need to be, because it is
177 * only called from functions that are also defined as not thread-safe,
178 * namely C_Finalize in softoken, and the SSL bypass shutdown callback called
179 @@ -872,6 +884,7 @@
180 PR_UnloadLibrary(blLib);
181 #endif
183 +#endif
184 blLib = NULL;
185 loadFreeBLOnce = pristineCallOnce;
187 --- a/a/nspr/build/autoconf/config.sub 2017-09-07 15:29:45.031246453 +0200
188 +++ a/a/nspr/build/autoconf/config.sub 2017-09-07 15:32:13.087235423 +0200
189 @@ -110,6 +110,9 @@
190 exit 1;;
191 esac
193 +if test $1 = "arm64-apple-darwin"; then echo $1; exit; fi
194 +if test $1 = "aarch64-apple-darwin"; then echo $1; exit; fi
196 # Split fields of configuration type
197 # shellcheck disable=SC2162
198 IFS="-" read field1 field2 field3 field4 <<EOF
199 --- a/a/nspr/config/autoconf.mk.in
200 +++ a/a/nspr/config/autoconf.mk.in
201 @@ -69,7 +69,7 @@
202 MSC_VER = @MSC_VER@
203 AR = @AR@
204 AR_FLAGS = @AR_FLAGS@
205 -LD = @LD@
206 +LD = echo
207 RANLIB = @RANLIB@
208 PERL = @PERL@
209 RC = @RC@
210 --- a/a/nspr/configure
211 +++ a/a/nspr/configure
212 @@ -2507,7 +2507,7 @@
213 OBJDIR='$(OBJDIR_NAME)'
214 OBJDIR_NAME=.
215 OBJDIR_SUFFIX=OBJ
216 -NSINSTALL='$(MOD_DEPTH)/config/$(OBJDIR_NAME)/nsinstall'
217 +NSINSTALL=${NSINSTALL?'$(MOD_DEPTH)/config/$(OBJDIR_NAME)/nsinstall'}
218 NOSUCHFILE=/no-such-file
219 LIBNSPR='-L$(dist_libdir) -lnspr$(MOD_MAJOR_VERSION)'
220 LIBPLC='-L$(dist_libdir) -lplc$(MOD_MAJOR_VERSION)'
221 @@ -5571,7 +5571,7 @@
222 LIB_SUFFIX=a
223 DLL_SUFFIX=so
224 ASM_SUFFIX=s
225 -MKSHLIB='$(LD) $(DSO_LDOPTS) -o $@'
226 +MKSHLIB='touch $@; echo'
227 PR_MD_ASFILES=
228 PR_MD_CSRCS=
229 PR_MD_ARCH_DIR=unix
230 @@ -6485,7 +6485,7 @@
231 DSO_CFLAGS=-fPIC
232 DSO_LDOPTS='-dynamiclib -compatibility_version 1 -current_version 1 -all_load -install_name @__________________________________________________OOO/$@ -headerpad_max_install_names'
233 _OPTIMIZE_FLAGS=-O2
234 - MKSHLIB='$(CC) $(DSO_LDOPTS) -o $@'
235 + MKSHLIB=touch $@
236 STRIP="$STRIP -x -S"
237 DLL_SUFFIX=dylib
238 USE_PTHREADS=1
239 --- a/a/nss/coreconf/ruleset.mk
240 +++ a/a/nss/coreconf/ruleset.mk
241 @@ -45,7 +45,7 @@
242 endif
244 ifeq ($(MKPROG),)
245 - MKPROG = $(CC)
246 + MKPROG = touch $@; echo
247 endif
250 --- a/a/nss/coreconf/Darwin.mk
251 +++ a/a/nss/coreconf/Darwin.mk
252 @@ -116,7 +116,7 @@
253 DSO_LDOPTS += --coverage
254 endif
256 -MKSHLIB = $(CC) $(DSO_LDOPTS) $(DARWIN_SDK_SHLIBFLAGS)
257 +MKSHLIB = touch $@; echo
258 DLL_SUFFIX = dylib
259 ifdef MAPFILE
260 MKSHLIB += -exported_symbols_list $(MAPFILE)
261 --- a/a/nss/coreconf/UNIX.mk
262 +++ a/a/nss/coreconf/UNIX.mk
263 @@ -19,10 +19,14 @@
265 ifdef BUILD_TREE
266 NSINSTALL_DIR = $(BUILD_TREE)/nss
267 +ifndef NSINSTALL
268 NSINSTALL = $(BUILD_TREE)/nss/nsinstall
269 +endif
270 else
271 NSINSTALL_DIR = $(CORE_DEPTH)/coreconf/nsinstall
272 +ifndef NSINSTALL
273 NSINSTALL = $(NSINSTALL_DIR)/$(OBJDIR_NAME)/nsinstall
274 +endif
275 endif
277 ####################################################################
278 --- a/a/nspr/pr/include/md/_darwin.h
279 +++ a/a/nspr/pr/include/md/_darwin.h
280 @@ -26,6 +26,8 @@
281 #define _PR_SI_ARCHITECTURE "ppc"
282 #elif defined(__arm__)
283 #define _PR_SI_ARCHITECTURE "arm"
284 +#elif defined(__arm64__)
285 +#define _PR_SI_ARCHITECTURE "arm64"
286 #elif defined(__aarch64__)
287 #define _PR_SI_ARCHITECTURE "aarch64"
288 #else
289 --- a/a/nss/cmd/shlibsign/sign.sh
290 +++ a/a/nss/cmd/shlibsign/sign.sh
291 @@ -2,6 +2,9 @@
292 # This Source Code Form is subject to the terms of the Mozilla Public
293 # License, v. 2.0. If a copy of the MPL was not distributed with this
294 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
296 +# Pointless to sign anything for iOS as we don't build any real shared libraries
297 +exit 0
299 # arguments:
300 # 1: full path to DIST/OBJDIR (parent dir of "lib")