It seems similar to #225326. Relevant lines of log C_Initialize failed: 0x00000030, CKR_DEVICE_ERROR NSPR error code: -5977: Failure to load dynamic library Initiailzing softoken failed: 0x00000030, CKR_DEVICE_ERROR NSPR error code: -5977: Failure to load dynamic library moduleSpec configdir='' certPrefix='' keyPrefix='' secmod='' flags=noCertDB, noModDB gmake[5]: *** [Makefile:92: ../../../dist/FreeBSD12.1_OPT.OBJ/lib/libsoftokn3.chk] Error 1 gmake[5]: *** Waiting for unfinished jobs.... rm -f FreeBSD12.1_OPT.OBJ/certutil /nxb-bin/usr/bin/cc -o FreeBSD12.1_OPT.OBJ/certutil -O2 -pipe -I/usr/local/include/nspr -Wno-error=unused-function -fstack-protector-strong -fno-strict-aliasing -fPIC -Wall -Wno-switch -DFREEBSD -DHAVE_STRERROR -DHAVE_BSD_FLOCK -Wall -Wshadow -Qunused-arguments -Wno-parentheses-equality -Wno-array-bounds -Wno-unevaluated-expression -DNSS_NO_GCC48 -DXP_UNIX -UDEBUG -DNDEBUG -D_THREAD_SAFE -D_REENTRANT -DNSS_DISABLE_AVX2 -DNSS_NO_INIT_SUPPORT -DUSE_UTIL_DIRECTLY -DNO_NSPR_10_SUPPORT -DSSL_DISABLE_DEPRECATED_CIPHER_SUITE_NAMES -I./../dist/FreeBSD12.1_OPT.OBJ/include -I./../dist/public/ -I./../dist/private/ -fPIC -Wall -Wno-switch -DFREEBSD -DHAVE_STRERROR -DHAVE_BSD_FLOCK -Wall -Wshadow -Qunused-arguments -Wno-parentheses-equality -Wno-array-bounds -Wno-unevaluated-expression -DNSS_NO_GCC48 -DXP_UNIX -UDEBUG -DNDEBUG -D_THREAD_SAFE -D_REENTRANT -DNSS_DISABLE_AVX2 -DNSS_NO_INIT_SUPPORT -DUSE_UTIL_DIRECTLY -DNO_NSPR_10_SUPPORT -DSSL_DISABLE_DEPRECATED_CIPHER_SUITE_NAMES -I./../dist/FreeBSD12.1_OPT.OBJ/include -I./../dist/public/ -I./../dist/private/ -fPIC -Wall -Wno-switch -DFREEBSD -DHAVE_STRERROR -DHAVE_BSD_FLOCK -Wall -Wshadow -Qunused-arguments -Wno-parentheses-equality -Wno-array-bounds -Wno-unevaluated-expression -DNSS_NO_GCC48 -DXP_UNIX -UDEBUG -DNDEBUG -D_THREAD_SAFE -D_REENTRANT -DNSS_DISABLE_AVX2 -DNSS_NO_INIT_SUPPORT -DUSE_UTIL_DIRECTLY -DNO_NSPR_10_SUPPORT -DSSL_DISABLE_DEPRECATED_CIPHER_SUITE_NAMES -I../../dist/FreeBSD12.1_OPT.OBJ/include -I../../dist/public/ -I../../dist/private/ -I../../dist/public/nss -I../../dist/public/nspr -I../../dist/public/libdbm -I../../dist/FreeBSD12.1_OPT.OBJ/../public/security -I./include -fPIC -Wall -Wno-switch -DFREEBSD -DHAVE_STRERROR -DHAVE_BSD_FLOCK -Wall -Wshadow -Qunused-arguments -Wno-parentheses-equality -Wno-array-bounds -Wno-unevaluated-expression -DNSS_NO_GCC48 -DXP_UNIX -DNSPR20 -UDEBUG -DNDEBUG -D_THREAD_SAFE -D_REENTRANT -DNSS_DISABLE_AVX2 -DNSS_NO_INIT_SUPPORT -DUSE_UTIL_DIRECTLY -DNO_NSPR_10_SUPPORT -DSSL_DISABLE_DEPRECATED_CIPHER_SUITE_NAMES -I../../../dist/FreeBSD12.1_OPT.OBJ/include -I../../../dist/public/nss -I../../../dist/private/nss -I../../../dist/public/dbm -I../../../dist/public/seccmd FreeBSD12.1_OPT.OBJ/certext.o FreeBSD12.1_OPT.OBJ/certutil.o FreeBSD12.1_OPT.OBJ/keystuff.o -fstack-protector-strong ../../../dist/FreeBSD12.1_OPT.OBJ/lib/libsectool.a -L../../../dist/FreeBSD12.1_OPT.OBJ/lib -L../../../dist/FreeBSD12.1_OPT.OBJ/lib -lnssutil3 -L/usr/local/lib -lplc4 -lplds4 -lnspr4 -lssl3 -lsmime3 -lnss3 -pthread C_Initialize failed: 0x00000030, CKR_DEVICE_ERROR NSPR error code: -5977: Failure to load dynamic library Initiailzing softoken failed: 0x00000030, CKR_DEVICE_ERROR NSPR error code: -5977: Failure to load dynamic library gmake[4]: Leaving directory '/wrkdirs/usr/ports/security/nss/work/nss-3.56/nss/cmd/pk11gcmtest' gmake[4]: Entering directory '/wrkdirs/usr/ports/security/nss/work/nss-3.56/nss/cmd/strsclnt' moduleSpec configdir='' certPrefix='' keyPrefix='' secmod='' flags=noCertDB, noModDB gmake[5]: *** [Makefile:92: ../../../dist/FreeBSD12.1_OPT.OBJ/lib/libfreebl3.chk] Error 1 gmake[4]: Leaving directory '/wrkdirs/usr/ports/security/nss/work/nss-3.56/nss/cmd/pk12util' rm -f FreeBSD12.1_OPT.OBJ/sdrtest Full log can be found at https://bast.garga.net.br/data/12-aarch64-default/2020-09-01_08h45m18s/logs/errors/nss-3.56.log
I put some dlerror() in devel/nspr (nspr/pr/src/linking/prlink.c), here are the logs: /usr/ports/security/nss/work/nss-3.56/nss/cmd/shlibsign/FreeBSD13.0_OPT.OBJ/shlibsign -v -i /usr/ports/security/nss/work/nss-3.56/nss/cmd/shlibsign/../../../dist/FreeBSD13.0_OPT.OBJ/lib/libsoftokn3.so Error 0.2: Undefined symbol "nspr_use_zone_allocator" moduleSpec configdir='' certPrefix='' keyPrefix='' secmod='' flags=noCertDB, noModDB Error 3: /usr/ports/security/nss/work/nss-3.56/nss/cmd/shlibsign/../../../dist/FreeBSD13.0_OPT.OBJ/lib/libfreeblpriv3.so: Undefined symbol "gcm_HashInit_hw" Error 3: Cannot open "../../../nss/lib/softoken/FreeBSD13.0_OPT.OBJ/libfreeblpriv3.so" Error 3: /usr/ports/security/nss/work/nss-3.56/nss/cmd/shlibsign/../../../dist/FreeBSD13.0_OPT.OBJ/lib/libfreeblpriv3.so: Undefined symbol "gcm_HashInit_hw" C_Initialize failed: 0x00000030, CKR_DEVICE_ERROR NSPR error code: -5977: Failure to load dynamic library Initiailzing softoken failed: 0x00000030, CKR_DEVICE_ERROR NSPR error code: -5977: Failure to load dynamic library gcm_HashInit_hw is implemented in gcm-aarch64.c but is not compiled for aarch64/FreeBSD I'm still digging...
(In reply to Mikael Urankar from comment #1) It seems to build with NS_USE_GCC = 1 in nss/coreconf/FreeBSD.mk
(In reply to Mikael Urankar from comment #2) regressed with https://github.com/nss-dev/nss/commit/189d45b71fc004d8737e000987038fe1ffa857b4 *sigh*
It builds for me (only tried 13-current) with: @@ -20,7 +21,21 @@ endif ifeq ($(CPU_ARCH),amd64) CPU_ARCH = x86_64 endif +ifneq (,$(filter arm%, $(CPU_ARCH))) +CPU_ARCH = arm +endif +ifneq (,$(filter powerpc%, $(CPU_ARCH))) +CPU_ARCH = ppc +endif +ifeq ($(CPU_ARCH),aarch64) +NS_USE_GCC = 1 +endif <snip>
https://bugzilla.mozilla.org/show_bug.cgi?id=1662833
Created attachment 217716 [details] v1 Can you try this patch?
(In reply to Mikael Urankar from comment #6) It fixed the problem. Thanks!
Created attachment 217839 [details] v2 use upstream patch from: https://bugzilla.mozilla.org/show_bug.cgi?id=1659256
Comment on attachment 217839 [details] v2 I can confirm 12.1 aarch64 builds fine after applying the patch.
A commit references this bug: Author: mikael Date: Wed Sep 9 13:36:33 UTC 2020 New revision: 548091 URL: https://svnweb.freebsd.org/changeset/ports/548091 Log: security/nss: fix build on aarch64 Import upstream patch from https://bugzilla.mozilla.org/show_bug.cgi?id=1659256 PR: 249053 Reported by: garga@ Approved by: jbeich@ Changes: head/security/nss/files/patch-bug1659256
Can you MFH to 2020Q3 as well?
(In reply to Jan Beich from comment #11) I've sent an email to ports-secteam
(In reply to Mikael Urankar from comment #12) Build fixes are under blanket approval.
A commit references this bug: Author: mikael Date: Mon Sep 14 17:04:04 UTC 2020 New revision: 548632 URL: https://svnweb.freebsd.org/changeset/ports/548632 Log: MFH: r548091 security/nss: fix build on aarch64 Import upstream patch from https://bugzilla.mozilla.org/show_bug.cgi?id=1659256 PR: 249053 Reported by: garga@ Approved by: jbeich@ Approved by: ports-secteam (joneum) Changes: _U branches/2020Q3/ branches/2020Q3/security/nss/files/patch-bug1659256