[Libreoffice-commits] core.git: external/nss
Jan-Marek Glogowski (via logerrit)
logerrit at kemper.freedesktop.org
Thu Sep 17 04:39:28 UTC 2020
external/nss/ExternalProject_nss.mk | 6 +++
external/nss/UnpackedTarball_nss.mk | 1
external/nss/nss-win-arm64.patch | 66 ++++++++++++++++++++++++++++++++++++
3 files changed, 73 insertions(+)
New commits:
commit dab9f9afe214fd5c5803e880c0e3d69f6fad3b14
Author: Jan-Marek Glogowski <glogow at fbihome.de>
AuthorDate: Sat Jul 18 03:56:14 2020 +0200
Commit: Jan-Marek Glogowski <glogow at fbihome.de>
CommitDate: Thu Sep 17 06:38:43 2020 +0200
nss: fix Windows Arm64 build
Change-Id: I59834daebd6c9ccd1255be6f08e5f61b20ee06e4
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/102853
Tested-by: Jenkins
Reviewed-by: Jan-Marek Glogowski <glogow at fbihome.de>
diff --git a/external/nss/ExternalProject_nss.mk b/external/nss/ExternalProject_nss.mk
index 3679af52b614..8b14ce58153d 100644
--- a/external/nss/ExternalProject_nss.mk
+++ b/external/nss/ExternalProject_nss.mk
@@ -26,11 +26,17 @@ $(call gb_ExternalProject_get_state_target,nss,build): $(call gb_ExternalExecuta
OPT_CODE_SIZE=0) \
OS_TARGET=WIN95 \
$(if $(filter X86_64,$(CPUNAME)),USE_64=1) \
+ $(if $(filter ARM64,$(CPUNAME)),USE_64=1) \
LIB="$(ILIB)" \
XCFLAGS="$(SOLARINC)" \
+ $(if $(CROSS_COMPILING),\
+ CROSS_COMPILE=1 \
+ $(if $(filter ARM64,$(CPUNAME)),CPU_ARCH=aarch64) \
+ NSPR_CONFIGURE_OPTS="--build=$(BUILD_PLATFORM) --host=$(HOST_PLATFORM)") \
$(MAKE) nss_build_all RC="rc.exe $(SOLARINC)" \
NSINSTALL='$(call gb_ExternalExecutable_get_command,python) $(SRCDIR)/external/nss/nsinstall.py' \
NSS_DISABLE_GTESTS=1 \
+ CCC="$(CXX)" \
,nss)
$(call gb_Trace_EndRange,nss,EXTERNAL)
diff --git a/external/nss/UnpackedTarball_nss.mk b/external/nss/UnpackedTarball_nss.mk
index 4aaa70fc2131..7921d36078bf 100644
--- a/external/nss/UnpackedTarball_nss.mk
+++ b/external/nss/UnpackedTarball_nss.mk
@@ -27,6 +27,7 @@ $(eval $(call gb_UnpackedTarball_add_patches,nss,\
external/nss/nss-bz1646594.patch.1 \
external/nss/macos-dlopen.patch.0 \
external/nss/nss.getopt.patch.0 \
+ external/nss/nss-win-arm64.patch \
$(if $(filter iOS,$(OS)), \
external/nss/nss-ios.patch) \
$(if $(filter ANDROID,$(OS)), \
diff --git a/external/nss/nss-win-arm64.patch b/external/nss/nss-win-arm64.patch
new file mode 100644
index 000000000000..eda198f85afc
--- /dev/null
+++ b/external/nss/nss-win-arm64.patch
@@ -0,0 +1,66 @@
+--- a/a/nspr/configure
++++ a/a/nspr/configure
+@@ -821,6 +821,7 @@
+ linux*) OS_ARCH=Linux ;;
+ solaris*) OS_ARCH=SunOS OS_RELEASE=5 ;;
+ mingw*) OS_ARCH=WINNT CPU_ARCH=x86 ;;
++ cygwin*) OS_ARCH=WINNT ;;
+ darwin*) OS_ARCH=Darwin ;;
+ riscos*) OS_ARCH=RISCOS ;;
+ esac
+--- a/a/nss/lib/freebl/Makefile.orig
++++ a/a/nss/lib/freebl/Makefile
+@@ -119,8 +119,23 @@
+ endif
+ endif
+ ifeq ($(CPU_ARCH),aarch64)
+- DEFINES += -DUSE_HW_AES -DUSE_HW_SHA2
+- EXTRA_SRCS += aes-armv8.c gcm-aarch64.c sha256-armv8.c
++ ifdef CC_IS_CLANG
++ DEFINES += -DUSE_HW_AES -DUSE_HW_SHA2
++ EXTRA_SRCS += aes-armv8.c gcm-aarch64.c sha256-armv8.c
++ else ifeq (1,$(CC_IS_GCC))
++ # GCC versions older than 4.9 don't support ARM AES. The check
++ # is done in two parts, first allows "major.minor" == "4.9",
++ # and then rejects any major versions prior to 5. Note that
++ # there has been no GCC 4.10, as it is renamed to GCC 5.
++ ifneq (,$(filter 4.9,$(word 1,$(GCC_VERSION)).$(word 2,$(GCC_VERSION))))
++ DEFINES += -DUSE_HW_AES -DUSE_HW_SHA2
++ EXTRA_SRCS += aes-armv8.c gcm-aarch64.c sha256-armv8.c
++ endif
++ ifeq (,$(filter 0 1 2 3 4,$(word 1,$(GCC_VERSION))))
++ DEFINES += -DUSE_HW_AES -DUSE_HW_SHA2
++ EXTRA_SRCS += aes-armv8.c gcm-aarch64.c sha256-armv8.c
++ endif
++ endif
+ endif
+ ifeq ($(CPU_ARCH),arm)
+ ifndef NSS_DISABLE_ARM32_NEON
+@@ -133,7 +146,10 @@
+ DEFINES += -DUSE_HW_AES -DUSE_HW_SHA2
+ EXTRA_SRCS += aes-armv8.c sha256-armv8.c
+ else ifeq (1,$(CC_IS_GCC))
+- # Old compiler doesn't support ARM AES.
++ # GCC versions older than 4.9 don't support ARM AES. The check
++ # is done in two parts, first allows "major.minor" == "4.9",
++ # and then rejects any major versions prior to 5. Note that
++ # there has been no GCC 4.10, as it is renamed to GCC 5.
+ ifneq (,$(filter 4.9,$(word 1,$(GCC_VERSION)).$(word 2,$(GCC_VERSION))))
+ DEFINES += -DUSE_HW_AES -DUSE_HW_SHA2
+ EXTRA_SRCS += aes-armv8.c sha256-armv8.c
+@@ -198,6 +200,7 @@
+ ifdef BUILD_OPT
+ OPTIMIZER += -Ox # maximum optimization for freebl
+ endif
++ifeq ($(CPU_ARCH),x86_64)
+ ASFILES = arcfour-amd64-masm.asm mpi_amd64_masm.asm mp_comba_amd64_masm.asm
+ DEFINES += -DNSS_BEVAND_ARCFOUR -DMPI_AMD64 -DMP_ASSEMBLY_MULTIPLY
+ DEFINES += -DNSS_USE_COMBA
+@@ -215,6 +218,7 @@
+ endif
+ endif
+ endif
++endif
+
+ ifeq ($(OS_TARGET),IRIX)
+ ifeq ($(USE_N32),1)
More information about the Libreoffice-commits
mailing list