summaryrefslogtreecommitdiffstats
path: root/patches
diff options
context:
space:
mode:
authorMichael Olbrich <m.olbrich@pengutronix.de>2020-04-04 09:48:34 +0200
committerMichael Olbrich <m.olbrich@pengutronix.de>2020-04-04 09:49:51 +0200
commitd78bfc96838c641dbabbb02830a1bcc63b28b8fe (patch)
tree6d66317ac94bbb5c8c31f2ec5ce91e50e83278bb /patches
parent4d57a3f9f810057b198db184954c3f3018574df2 (diff)
downloadptxdist-d78bfc96838c641dbabbb02830a1bcc63b28b8fe.tar.gz
ptxdist-d78bfc96838c641dbabbb02830a1bcc63b28b8fe.tar.xz
nss: fix building with older gcc for ARMv5
With gcc-5.4 building NEON code fails with: gcm-arm32-neon.c:1:0: error: target CPU does not support ARM mode gcm-arm32-neon.c:1:0: error: target CPU does not support ARM mode Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
Diffstat (limited to 'patches')
-rw-r--r--patches/nss-3.51/0004-HACK-make-neon-support-optional.patch47
-rw-r--r--patches/nss-3.51/series3
2 files changed, 49 insertions, 1 deletions
diff --git a/patches/nss-3.51/0004-HACK-make-neon-support-optional.patch b/patches/nss-3.51/0004-HACK-make-neon-support-optional.patch
new file mode 100644
index 000000000..f31919767
--- /dev/null
+++ b/patches/nss-3.51/0004-HACK-make-neon-support-optional.patch
@@ -0,0 +1,47 @@
+From: Michael Olbrich <m.olbrich@pengutronix.de>
+Date: Sat, 4 Apr 2020 08:54:33 +0200
+Subject: [PATCH] HACK: make neon support optional
+
+It fails to build with older ARMv5 compilers and is useless anyways on CPUs
+that don't support it
+
+Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
+---
+ nss/lib/freebl/Makefile | 3 +++
+ nss/lib/freebl/gcm.c | 2 +-
+ 2 files changed, 4 insertions(+), 1 deletion(-)
+
+diff --git a/nss/lib/freebl/Makefile b/nss/lib/freebl/Makefile
+index ce9d36f3a37c..b8200d5b66c2 100644
+--- a/nss/lib/freebl/Makefile
++++ b/nss/lib/freebl/Makefile
+@@ -124,6 +124,8 @@ ifeq ($(CPU_ARCH),aarch64)
+ EXTRA_SRCS += aes-armv8.c gcm-aarch64.c
+ endif
+ ifeq ($(CPU_ARCH),arm)
++ifdef USE_NEON
++ DEFINES += -DUSE_NEON
+ EXTRA_SRCS += gcm-arm32-neon.c
+ ifdef CC_IS_CLANG
+ DEFINES += -DUSE_HW_AES
+@@ -140,6 +142,7 @@ ifeq ($(CPU_ARCH),arm)
+ endif
+ endif
+ endif
++endif
+
+ ifeq ($(OS_TARGET),OSF1)
+ DEFINES += -DMP_ASSEMBLY_MULTIPLY -DMP_NO_MP_WORD
+diff --git a/nss/lib/freebl/gcm.c b/nss/lib/freebl/gcm.c
+index 2a42f74c0e3a..66eaa38ce9e7 100644
+--- a/nss/lib/freebl/gcm.c
++++ b/nss/lib/freebl/gcm.c
+@@ -21,7 +21,7 @@
+ #if defined(__aarch64__) && defined(IS_LITTLE_ENDIAN) && \
+ (defined(__clang__) || defined(__GNUC__) && __GNUC__ > 6)
+ #define USE_ARM_GCM
+-#elif defined(__arm__) && defined(IS_LITTLE_ENDIAN)
++#elif defined(__arm__) && defined(IS_LITTLE_ENDIAN) && defined(USE_NEON)
+ /* We don't test on big endian platform, so disable this on big endian. */
+ #define USE_ARM_GCM
+ #endif
diff --git a/patches/nss-3.51/series b/patches/nss-3.51/series
index f7f38f3be..75b8ba6f5 100644
--- a/patches/nss-3.51/series
+++ b/patches/nss-3.51/series
@@ -3,4 +3,5 @@
0001-nss-fix-nsinstall-build.patch
0002-add-nss.pc.in.patch
0003-HACK-don-t-build-the-commands.patch
-# 5a106339b1aacb64732e0a72df6e0416 - git-ptx-patches magic
+0004-HACK-make-neon-support-optional.patch
+# 845a22da2ee4b354f9b8791cdcf348b3 - git-ptx-patches magic