From bd235377eb5f4b957949c3a1671ecace68b23ac1 Mon Sep 17 00:00:00 2001 From: Michael Olbrich Date: Mon, 4 Nov 2019 11:25:55 +0100 Subject: nss: fix building on ARMv7 The code is not NEON in general, but ARMv8 code. Just don't compile it for ARCH = 'arm'. Signed-off-by: Michael Olbrich --- .../0004-allow-building-without-NEON.patch | 32 ----------------- patches/nss-3.47/0004-fix-building-on-ARM.patch | 40 ++++++++++++++++++++++ patches/nss-3.47/series | 4 +-- rules/nss.make | 3 +- 4 files changed, 43 insertions(+), 36 deletions(-) delete mode 100644 patches/nss-3.47/0004-allow-building-without-NEON.patch create mode 100644 patches/nss-3.47/0004-fix-building-on-ARM.patch diff --git a/patches/nss-3.47/0004-allow-building-without-NEON.patch b/patches/nss-3.47/0004-allow-building-without-NEON.patch deleted file mode 100644 index 0feb596bb..000000000 --- a/patches/nss-3.47/0004-allow-building-without-NEON.patch +++ /dev/null @@ -1,32 +0,0 @@ -From: Michael Olbrich -Date: Fri, 1 Nov 2019 16:58:55 +0100 -Subject: [PATCH] allow building without NEON - -The build-system currently assumes that NEON code can always be built on -ARM. Make it possible to disable this via the 'make' command-line. - -Signed-off-by: Michael Olbrich ---- - nss/lib/freebl/Makefile | 2 ++ - 1 file changed, 2 insertions(+) - -diff --git a/nss/lib/freebl/Makefile b/nss/lib/freebl/Makefile -index 5943fb377894..1401f8154fcc 100644 ---- a/nss/lib/freebl/Makefile -+++ b/nss/lib/freebl/Makefile -@@ -124,6 +124,7 @@ ifeq ($(CPU_ARCH),aarch64) - EXTRA_SRCS += aes-armv8.c gcm-aarch64.c - endif - ifeq ($(CPU_ARCH),arm) -+ ifndef NO_NEON - ifdef CC_IS_CLANG - DEFINES += -DUSE_HW_AES - EXTRA_SRCS += aes-armv8.c -@@ -138,6 +139,7 @@ ifeq ($(CPU_ARCH),arm) - EXTRA_SRCS += aes-armv8.c - endif - endif -+ endif - endif - - ifeq ($(OS_TARGET),OSF1) diff --git a/patches/nss-3.47/0004-fix-building-on-ARM.patch b/patches/nss-3.47/0004-fix-building-on-ARM.patch new file mode 100644 index 000000000..8f1e087d2 --- /dev/null +++ b/patches/nss-3.47/0004-fix-building-on-ARM.patch @@ -0,0 +1,40 @@ +From: Michael Olbrich +Date: Fri, 1 Nov 2019 16:58:55 +0100 +Subject: [PATCH] fix building on ARM + +The build-system currently assumes that 'arm' is ARMv8 as well. This is +completely broken. Fix it by ensuring, that ARMv8 code is only build for +aarch64. + +Signed-off-by: Michael Olbrich +--- + nss/lib/freebl/Makefile | 16 ---------------- + 1 file changed, 16 deletions(-) + +diff --git a/nss/lib/freebl/Makefile b/nss/lib/freebl/Makefile +index 5943fb377894..53bf55b57fc8 100644 +--- a/nss/lib/freebl/Makefile ++++ b/nss/lib/freebl/Makefile +@@ -123,22 +123,6 @@ ifeq ($(CPU_ARCH),aarch64) + DEFINES += -DUSE_HW_AES + EXTRA_SRCS += aes-armv8.c gcm-aarch64.c + endif +-ifeq ($(CPU_ARCH),arm) +- ifdef CC_IS_CLANG +- DEFINES += -DUSE_HW_AES +- EXTRA_SRCS += aes-armv8.c +- else ifeq (1,$(CC_IS_GCC)) +- # Old compiler doesn't support ARM AES. +- ifneq (,$(filter 4.9,$(word 1,$(GCC_VERSION)).$(word 2,$(GCC_VERSION)))) +- DEFINES += -DUSE_HW_AES +- EXTRA_SRCS += aes-armv8.c +- endif +- ifeq (,$(filter 0 1 2 3 4,$(word 1,$(GCC_VERSION)))) +- DEFINES += -DUSE_HW_AES +- EXTRA_SRCS += aes-armv8.c +- endif +- endif +-endif + + ifeq ($(OS_TARGET),OSF1) + DEFINES += -DMP_ASSEMBLY_MULTIPLY -DMP_NO_MP_WORD diff --git a/patches/nss-3.47/series b/patches/nss-3.47/series index 81523e277..44a6b1e96 100644 --- a/patches/nss-3.47/series +++ b/patches/nss-3.47/series @@ -3,5 +3,5 @@ 0001-nss-fix-nsinstall-build.patch 0002-add-nss.pc.in.patch 0003-HACK-don-t-build-the-commands.patch -0004-allow-building-without-NEON.patch -# 519407b92c5bc296cbc80edaabf6253f - git-ptx-patches magic +0004-fix-building-on-ARM.patch +# a74f505fdd783f123199d2e6f1a43c32 - git-ptx-patches magic diff --git a/rules/nss.make b/rules/nss.make index 0e52ab91e..373a9c01a 100644 --- a/rules/nss.make +++ b/rules/nss.make @@ -55,8 +55,7 @@ NSS_MAKE_PAR := NO NSS_MAKE_OPT := \ OS_ARCH=Linux \ OS_RELEASE=$(PTXCONF_KERNEL_VERSION) \ - OS_TEST=$(NSS_ARCH) \ - NO_NEON=$(call ptx/ifdef, PTXCONF_ARCH_ARM_NEON,,1) + OS_TEST=$(NSS_ARCH) # ---------------------------------------------------------------------------- # Install -- cgit v1.2.3