diff -up nss/lib/freebl/Makefile.aarch64 nss/lib/freebl/Makefile --- nss/lib/freebl/Makefile.aarch64 2020-07-22 12:22:50.983883934 +0200 +++ nss/lib/freebl/Makefile 2020-07-22 12:23:29.054608879 +0200 @@ -120,8 +120,20 @@ else endif endif ifeq ($(CPU_ARCH),aarch64) - DEFINES += -DUSE_HW_AES - EXTRA_SRCS += aes-armv8.c gcm-aarch64.c + ifdef CC_IS_CLANG + DEFINES += -DUSE_HW_AES + EXTRA_SRCS += aes-armv8.c gcm-aarch64.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 gcm-aarch64.c + endif + ifeq (,$(filter 0 1 2 3 4,$(word 1,$(GCC_VERSION)))) + DEFINES += -DUSE_HW_AES + EXTRA_SRCS += aes-armv8.c gcm-aarch64.c + endif + endif endif ifeq ($(CPU_ARCH),arm) ifndef NSS_DISABLE_ARM32_NEON