1diff -ur nss.org/nspr/build/autoconf/config.sub nss/nspr/build/autoconf/config.sub
2--- nss.org/nspr/build/autoconf/config.sub	2017-09-07 15:29:45.031246453 +0200
3+++ nss/nspr/build/autoconf/config.sub	2017-09-07 15:32:13.087235423 +0200
4@@ -111,6 +111,11 @@
5     exit 1;;
6 esac
7
8+if test $1 = "arm-unknown-linux-androideabi"; then echo $1; exit; fi
9+if test $1 = "aarch64-unknown-linux-android"; then echo $1; exit; fi
10+if test $1 = "i686-pc-linux-android"; then echo $1; exit; fi
11+if test $1 = "x86_64-pc-linux-android"; then echo $1; exit; fi
12+
13 # Split fields of configuration type
14 # shellcheck disable=SC2162
15 IFS="-" read field1 field2 field3 field4 <<EOF
16diff -ur nss.org/nspr/configure nss/nspr/configure
17--- nss.org/nspr/configure	2017-09-07 15:29:45.018246359 +0200
18+++ nss/nspr/configure	2017-09-07 15:31:47.604075663 +0200
19@@ -2737,18 +2739,15 @@
20     esac
21
22         AS="$android_toolchain"/bin/"$android_tool_prefix"-as
23-    CC="$android_toolchain"/bin/"$android_tool_prefix"-gcc
24-    CXX="$android_toolchain"/bin/"$android_tool_prefix"-g++
25-    CPP="$android_toolchain"/bin/"$android_tool_prefix"-cpp
26+    CC="$CC"
27+    CXX="$CXX"
28+    CPP="$CC" -E
29     LD="$android_toolchain"/bin/"$android_tool_prefix"-ld
30     AR="$android_toolchain"/bin/"$android_tool_prefix"-ar
31     RANLIB="$android_toolchain"/bin/"$android_tool_prefix"-ranlib
32     STRIP="$android_toolchain"/bin/"$android_tool_prefix"-strip
33
34     CPPFLAGS="-I$android_platform/usr/include $CPPFLAGS"
35-    CFLAGS="-mandroid -I$android_platform/usr/include -fno-short-enums -fno-exceptions $CFLAGS"
36-    CXXFLAGS="-mandroid -I$android_platform/usr/include -fpic -fno-short-enums -fno-exceptions $CXXFLAGS"
37-    LDFLAGS="-mandroid -L$android_platform/usr/lib -Wl,-rpath-link=$android_platform/usr/lib --sysroot=$android_platform $LDFLAGS"
38
39     $as_echo "#define ANDROID 1" >>confdefs.h
40
41diff -ur nss.org/nss/Makefile nss/nss/Makefile
42--- nss.org/nss/Makefile	2017-09-07 15:29:44.933245745 +0200
43+++ nss/nss/Makefile	2017-09-07 15:32:04.347181076 +0200
44@@ -62,7 +62,7 @@
45
46 ifeq ($(OS_TARGET),Android)
47 NSPR_CONFIGURE_OPTS += --with-android-ndk=$(ANDROID_NDK) \
48-                       --target=$(ANDROID_PREFIX) \
49+                       --with-arch=toolchain-default \
50                        --with-android-version=$(OS_TARGET_RELEASE) \
51                        --with-android-toolchain=$(ANDROID_TOOLCHAIN) \
52                        --with-android-platform=$(ANDROID_SYSROOT)
53--- nss/nss/Makefile.orig	2019-11-26 14:52:15.934561202 +0100
54+++ nss/nss/Makefile	2019-11-26 14:52:20.538559612 +0100
55@@ -140,7 +140,6 @@
56
57 build_nspr: $(NSPR_CONFIG_STATUS)
58 	$(MAKE) -C $(CORE_DEPTH)/../nspr/$(OBJDIR_NAME)
59-	$(MAKE) -C $(CORE_DEPTH)/../nspr/$(OBJDIR_NAME)/pr/tests
60
61 install_nspr: build_nspr
62 	$(MAKE) -C $(CORE_DEPTH)/../nspr/$(OBJDIR_NAME) install
63--- nss/nss/lib/ckfw/builtins/manifest.mn.orig	2019-11-26 15:18:22.185985193 +0100
64+++ nss/nss/lib/ckfw/builtins/manifest.mn	2019-11-26 15:18:29.281982387 +0100
65@@ -5,7 +5,7 @@
66
67 CORE_DEPTH = ../../..
68
69-DIRS = testlib
70+DIRS =
71
72 MODULE = nss
73
74diff -ur nss/nss/coreconf/arch.mk nss/nss/coreconf/arch.mk
75--- nss/nss/coreconf/arch.mk	2019-11-01 10:29:44.933245745 +0100
76+++ nss/nss/coreconf/arch.mk	2019-11-01 10:32:04.347181076 +0100
77@@ -234,7 +234,15 @@
78 #
79 # this should be  configurable from the user
80 #
81-   OS_TEST := arm
82+   ifneq (,$(filter x86 x86_64,$(ANDROID_APP_ABI)))
83+       OS_TEST := $(ANDROID_APP_ABI)
84+   else
85+       ifeq ($(USE_64),1)
86+          OS_TEST := aarch64
87+       else
88+          OS_TEST := arm
89+       endif
90+   endif
91    OS_ARCH = Android
92    ifndef OS_TARGET_RELEASE
93 	OS_TARGET_RELEASE := 8
94