From owner-svn-ports-head@freebsd.org Wed Dec 11 18:57:49 2019 Return-Path: Delivered-To: svn-ports-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 224301DE114; Wed, 11 Dec 2019 18:57:49 +0000 (UTC) (envelope-from pkubaj@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47Y5lx09Hbz4Vjb; Wed, 11 Dec 2019 18:57:49 +0000 (UTC) (envelope-from pkubaj@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id F072DFAD9; Wed, 11 Dec 2019 18:57:48 +0000 (UTC) (envelope-from pkubaj@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id xBBIvm7m025793; Wed, 11 Dec 2019 18:57:48 GMT (envelope-from pkubaj@FreeBSD.org) Received: (from pkubaj@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id xBBIvm60025791; Wed, 11 Dec 2019 18:57:48 GMT (envelope-from pkubaj@FreeBSD.org) Message-Id: <201912111857.xBBIvm60025791@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: pkubaj set sender to pkubaj@FreeBSD.org using -f From: Piotr Kubaj Date: Wed, 11 Dec 2019 18:57:48 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r519827 - in head/security/nss: . files X-SVN-Group: ports-head X-SVN-Commit-Author: pkubaj X-SVN-Commit-Paths: in head/security/nss: . files X-SVN-Commit-Revision: 519827 X-SVN-Commit-Repository: ports MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the ports tree for head List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Dec 2019 18:57:49 -0000 Author: pkubaj Date: Wed Dec 11 18:57:48 2019 New Revision: 519827 URL: https://svnweb.freebsd.org/changeset/ports/519827 Log: security/nss: fix build on powerpc platforms NSS 3.48 broke powerpc by using getauxval, which FreeBSD doesn't have. GCC9 is also required because of usage of VSX, which needs to be manually added for some files. PR: 242521 Approved by: jbeich (maintainer) Added: head/security/nss/files/patch-bug1602386 (contents, props changed) Modified: head/security/nss/Makefile Modified: head/security/nss/Makefile ============================================================================== --- head/security/nss/Makefile Wed Dec 11 18:41:52 2019 (r519826) +++ head/security/nss/Makefile Wed Dec 11 18:57:48 2019 (r519827) @@ -55,8 +55,8 @@ BINS= ${DIST}/${OPSYS}${OSREL}_OPT.OBJ BINS= ${DIST}/${OPSYS}${OSREL}_DBG.OBJ .endif -.if ${OPSYS} == FreeBSD && ${ARCH} == i386 && ! ${MACHINE_CPU:Msse2} -USES+= compiler:c++14-lang # gcm.h +.if ${ARCH} == powerpc64 +USES+= compiler:c++11-lang # -mcrypto -mvsx .endif .if ${OPSYS} == FreeBSD && ${ARCH} == amd64 Added: head/security/nss/files/patch-bug1602386 ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/security/nss/files/patch-bug1602386 Wed Dec 11 18:57:48 2019 (r519827) @@ -0,0 +1,49 @@ +Fix build on FreeBSD/powerpc platforms. + +https://bugzilla.mozilla.org/show_bug.cgi?id=1602386 + +--- lib/freebl/Makefile.orig 2019-12-04 01:03:31.000000000 +0100 ++++ lib/freebl/Makefile 2019-12-11 16:48:47.959791000 +0100 +@@ -788,5 +788,7 @@ + endif + + ifeq ($(CPU_ARCH),ppc) +-$(OBJDIR)/$(PROG_PREFIX)gcm-ppc$(OBJ_SUFFIX): CFLAGS += -mcrypto -maltivec ++$(OBJDIR)/$(PROG_PREFIX)gcm-ppc$(OBJ_SUFFIX): CFLAGS += -mcrypto -maltivec -mvsx ++$(OBJDIR)/$(PROG_PREFIX)gcm$(OBJ_SUFFIX): CFLAGS += -mcrypto -maltivec -mvsx ++$(OBJDIR)/$(PROG_PREFIX)rijndael$(OBJ_SUFFIX): CFLAGS += -mcrypto -maltivec -mvsx + endif +--- lib/freebl/blinit.c.orig 2019-12-11 17:45:06.930646000 +0100 ++++ lib/freebl/blinit.c 2019-12-11 17:50:04.797680000 +0100 +@@ -393,7 +393,12 @@ + + #if defined(__powerpc__) + ++#if defined(__FreeBSD__) && __FreeBSD__ < 12 ++#include ++#include ++#else + #include ++#endif + + // Defines from cputable.h in Linux kernel - PPC, letting us build on older kernels + #ifndef PPC_FEATURE2_VEC_CRYPTO +@@ -405,7 +410,17 @@ + { + char *disable_hw_crypto = PR_GetEnvSecure("NSS_DISABLE_PPC_GHASH"); + +- long hwcaps = getauxval(AT_HWCAP2); ++ unsigned long hwcaps = 0; ++#if defined(__linux__) ++ hwcaps = getauxval(AT_HWCAP2); ++#elif defined(__FreeBSD__) ++# if __FreeBSD__ >= 12 ++ elf_aux_info(AT_HWCAP2, &hwcaps, sizeof(hwcaps)); ++# else ++ size_t len = sizeof(hwcaps); ++ sysctlbyname("hw.cpu_features2", &hwcaps, &len, NULL, 0); ++# endif ++#endif + + ppc_crypto_support_ = hwcaps & PPC_FEATURE2_VEC_CRYPTO && disable_hw_crypto == NULL; + }