xref: /aoo41x/main/nss/nss_linux.patch (revision 59e68e95)
1diff -ur misc/nss-3.39/nss/lib/freebl/Makefile misc/build/nss-3.39/nss/lib/freebl/Makefile
2--- misc/nss-3.39/nss/lib/freebl/Makefile	2018-08-31 14:55:53.000000000 +0200
3+++ misc/build/nss-3.39/nss/lib/freebl/Makefile	2022-01-29 21:49:32.000000000 +0100
4@@ -108,17 +108,17 @@
5 # NSS_X86 means the target is a 32-bits x86 CPU architecture
6 # NSS_X64 means the target is a 64-bits 64 CPU architecture
7 # NSS_X86_OR_X64 means the target is either x86 or x64
8-ifeq (,$(filter-out i386 x386 x86 x86_64,$(CPU_ARCH)))
9-        DEFINES += -DNSS_X86_OR_X64
10-        EXTRA_SRCS += gcm-x86.c aes-x86.c
11-$(OBJDIR)/gcm-x86.o: CFLAGS += -mpclmul -maes
12-$(OBJDIR)/aes-x86.o: CFLAGS += -mpclmul -maes
13-ifneq (,$(USE_64)$(USE_X32))
14-        DEFINES += -DNSS_X64
15-else
16-        DEFINES += -DNSS_X86
17-endif
18-endif
19+#ifeq (,$(filter-out i386 x386 x86 x86_64,$(CPU_ARCH)))
20+#        DEFINES += -DNSS_X86_OR_X64
21+#        EXTRA_SRCS += gcm-x86.c aes-x86.c
22+#$(OBJDIR)/gcm-x86.o: CFLAGS += -mpclmul -maes
23+#$(OBJDIR)/aes-x86.o: CFLAGS += -mpclmul -maes
24+#ifneq (,$(USE_64)$(USE_X32))
25+#        DEFINES += -DNSS_X64
26+#else
27+#        DEFINES += -DNSS_X86
28+#endif
29+#endif
30
31 ifeq ($(OS_TARGET),OSF1)
32     DEFINES += -DMP_ASSEMBLY_MULTIPLY -DMP_NO_MP_WORD
33@@ -156,8 +156,8 @@
34     # The Intel AES assembly code requires Visual C++ 2010.
35     # if $(_MSC_VER) >= 1600 (Visual C++ 2010)
36     ifeq ($(firstword $(sort $(_MSC_VER) 1600)),1600)
37-	DEFINES += -DUSE_HW_AES -DINTEL_GCM
38-	ASFILES += intel-aes-x86-masm.asm intel-gcm-x86-masm.asm
39+	#DEFINES += -DUSE_HW_AES -DINTEL_GCM
40+	#ASFILES += intel-aes-x86-masm.asm intel-gcm-x86-masm.asm
41 	EXTRA_SRCS += intel-gcm-wrap.c
42 	ifeq ($(CLANG_CL),1)
43 	    INTEL_GCM_CLANG_CL = 1
44@@ -224,8 +224,8 @@
45     DEFINES += -DMP_IS_LITTLE_ENDIAN
46 #   DEFINES += -DMPI_AMD64_ADD
47     # comment the next four lines to turn off Intel HW acceleration.
48-    DEFINES += -DUSE_HW_AES -DINTEL_GCM
49-    ASFILES += intel-aes.s intel-gcm.s
50+    #DEFINES += -DUSE_HW_AES -DINTEL_GCM
51+    #ASFILES += intel-aes.s intel-gcm.s
52     EXTRA_SRCS += intel-gcm-wrap.c
53     INTEL_GCM = 1
54     MPI_SRCS += mpi_amd64.c mp_comba.c
55diff -ur misc/nss-3.39/nss/lib/freebl/verified/kremlib.h misc/build/nss-3.39/nss/lib/freebl/verified/kremlib.h
56--- misc/nss-3.39/nss/lib/freebl/verified/kremlib.h	2018-08-31 14:55:53.000000000 +0200
57+++ misc/build/nss-3.39/nss/lib/freebl/verified/kremlib.h	2022-01-29 21:57:32.000000000 +0100
58@@ -182,11 +182,13 @@
59 /******************************************************************************/
60
61 /* ... for Linux */
62-#if defined(__linux__) || defined(__CYGWIN__)
63 #include <endian.h>
64+#define __BYTE_ORDER__ __BYTE_ORDER
65+#define __ORDER_LITTLE_ENDIAN__ __LITTLE_ENDIAN
66+#define __ORDER_BIG_ENDIAN__ __BIG_ENDIAN
67
68 /* ... for OSX */
69-#elif defined(__APPLE__)
70+#if defined(__APPLE__)
71 #include <libkern/OSByteOrder.h>
72 #define htole64(x) OSSwapHostToLittleInt64(x)
73 #define le64toh(x) OSSwapLittleToHostInt64(x)
74diff -ur misc/nss-3.39/nss/lib/softoken/sdb.c misc/build/nss-3.39/nss/lib/softoken/sdb.c
75--- misc/nss-3.39/nss/lib/softoken/sdb.c	2018-08-31 14:55:53.000000000 +0200
76+++ misc/build/nss-3.39/nss/lib/softoken/sdb.c	2022-01-29 22:01:18.000000000 +0100
77@@ -37,7 +37,7 @@
78 #elif defined(XP_UNIX)
79 #include <unistd.h>
80 #endif
81-#if defined(LINUX) && !defined(ANDROID)
82+#if defined(LINUX) && !defined(ANDROID) && 0
83 #include <linux/magic.h>
84 #include <sys/vfs.h>
85 #endif
86@@ -1944,7 +1944,7 @@
87     }
88
89     if (checkFSType) {
90-#if defined(LINUX) && !defined(ANDROID)
91+#if defined(LINUX) && !defined(ANDROID) && 0
92         struct statfs statfs_s;
93         if (statfs(dbname, &statfs_s) == 0) {
94             switch (statfs_s.f_type) {
95