Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 2 Nov 2017 18:16:01 +0000 (UTC)
From:      Jung-uk Kim <jkim@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-11@freebsd.org
Subject:   svn commit: r325333 - in stable/11: crypto/openssl/crypto crypto/openssl/crypto/aes/asm crypto/openssl/crypto/modes/asm secure/lib/libcrypto secure/lib/libcrypto/aarch64
Message-ID:  <201711021816.vA2IG1El075878@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jkim
Date: Thu Nov  2 18:16:01 2017
New Revision: 325333
URL: https://svnweb.freebsd.org/changeset/base/325333

Log:
  MFC:	r307976
  
  Build OpenSSL assembly sources for aarch64.

Added:
  stable/11/secure/lib/libcrypto/aarch64/
     - copied from r307976, head/secure/lib/libcrypto/aarch64/
Modified:
  stable/11/crypto/openssl/crypto/aes/asm/aesv8-armx.pl
  stable/11/crypto/openssl/crypto/arm64cpuid.S
  stable/11/crypto/openssl/crypto/modes/asm/ghashv8-armx.pl
  stable/11/secure/lib/libcrypto/Makefile
  stable/11/secure/lib/libcrypto/Makefile.asm
  stable/11/secure/lib/libcrypto/Makefile.inc
Directory Properties:
  stable/11/   (props changed)

Modified: stable/11/crypto/openssl/crypto/aes/asm/aesv8-armx.pl
==============================================================================
--- stable/11/crypto/openssl/crypto/aes/asm/aesv8-armx.pl	Thu Nov  2 18:13:26 2017	(r325332)
+++ stable/11/crypto/openssl/crypto/aes/asm/aesv8-armx.pl	Thu Nov  2 18:16:01 2017	(r325333)
@@ -42,7 +42,7 @@ $code=<<___;
 #if __ARM_MAX_ARCH__>=7
 .text
 ___
-$code.=".arch	armv8-a+crypto\n"			if ($flavour =~ /64/);
+# $code.=".arch	armv8-a+crypto\n"			if ($flavour =~ /64/);
 $code.=".arch	armv7-a\n.fpu	neon\n.code	32\n"	if ($flavour !~ /64/);
 		#^^^^^^ this is done to simplify adoption by not depending
 		#	on latest binutils.

Modified: stable/11/crypto/openssl/crypto/arm64cpuid.S
==============================================================================
--- stable/11/crypto/openssl/crypto/arm64cpuid.S	Thu Nov  2 18:13:26 2017	(r325332)
+++ stable/11/crypto/openssl/crypto/arm64cpuid.S	Thu Nov  2 18:16:01 2017	(r325333)
@@ -1,7 +1,6 @@
 #include "arm_arch.h"
 
 .text
-.arch	armv8-a+crypto
 
 .align	5
 .global	_armv7_neon_probe

Modified: stable/11/crypto/openssl/crypto/modes/asm/ghashv8-armx.pl
==============================================================================
--- stable/11/crypto/openssl/crypto/modes/asm/ghashv8-armx.pl	Thu Nov  2 18:13:26 2017	(r325332)
+++ stable/11/crypto/openssl/crypto/modes/asm/ghashv8-armx.pl	Thu Nov  2 18:16:01 2017	(r325333)
@@ -49,7 +49,7 @@ $code=<<___;
 
 .text
 ___
-$code.=".arch	armv8-a+crypto\n"	if ($flavour =~ /64/);
+# $code.=".arch	armv8-a+crypto\n"	if ($flavour =~ /64/);
 $code.=".fpu	neon\n.code	32\n"	if ($flavour !~ /64/);
 
 ################################################################################

Modified: stable/11/secure/lib/libcrypto/Makefile
==============================================================================
--- stable/11/secure/lib/libcrypto/Makefile	Thu Nov  2 18:13:26 2017	(r325332)
+++ stable/11/secure/lib/libcrypto/Makefile	Thu Nov  2 18:16:01 2017	(r325333)
@@ -22,7 +22,10 @@ MAN+=	config.5 des_modes.7
 # base sources
 SRCS=	cpt_err.c cryptlib.c cversion.c ex_data.c mem.c mem_dbg.c o_dir.c \
 	o_fips.c o_init.c o_str.c o_time.c uid.c
-.if defined(ASM_amd64)
+.if defined(ASM_aarch64)
+SRCS+=	arm64cpuid.S armcap.c mem_clr.c
+CFLAGS.arm64cpuid.S=	-march=armv8-a+crypto
+.elif defined(ASM_amd64)
 SRCS+=	x86_64cpuid.S
 .elif defined(ASM_arm)
 SRCS+=	armcap.c armv4cpuid.S
@@ -35,7 +38,10 @@ INCS+=	crypto.h ebcdic.h opensslv.h ossl_typ.h symhack
 
 # aes
 SRCS+=	aes_cfb.c aes_ctr.c aes_ecb.c aes_ige.c aes_misc.c aes_ofb.c aes_wrap.c
-.if defined(ASM_amd64)
+.if defined(ASM_aarch64)
+SRCS+=	aes_cbc.c aes_core.c aesv8-armx.S
+CFLAGS.aesv8-armx.S=	-march=armv8-a+crypto
+.elif defined(ASM_amd64)
 SRCS+=	aes-x86_64.S aesni-mb-x86_64.S aesni-sha1-x86_64.S \
 	aesni-sha256-x86_64.S aesni-x86_64.S bsaes-x86_64.S vpaes-x86_64.S
 .elif defined(ASM_arm)
@@ -238,7 +244,10 @@ INCS+=	mdc2.h
 # modes
 SRCS+=	cbc128.c ccm128.c cfb128.c ctr128.c cts128.c gcm128.c ofb128.c \
 	wrap128.c xts128.c
-.if defined(ASM_amd64)
+.if defined(ASM_aarch64)
+SRCS+=	ghashv8-armx.S
+CFLAGS.ghashv8-armx.S=	-march=armv8-a+crypto
+.elif defined(ASM_amd64)
 SRCS+=	aesni-gcm-x86_64.S ghash-x86_64.S
 .elif defined(ASM_arm)
 SRCS+=	ghash-armv4.S ghashv8-armx.S
@@ -324,7 +333,9 @@ INCS+=	seed.h
 
 # sha
 SRCS+=	sha1_one.c sha1dgst.c sha256.c sha512.c sha_dgst.c sha_one.c
-.if defined(ASM_amd64)
+.if defined(ASM_aarch64)
+SRCS+=	sha1-armv8.S sha256-armv8.S sha512-armv8.S
+.elif defined(ASM_amd64)
 SRCS+=	sha1-mb-x86_64.S sha1-x86_64.S sha256-mb-x86_64.S sha256-x86_64.S \
 	sha512-x86_64.S
 .elif defined(ASM_arm)

Modified: stable/11/secure/lib/libcrypto/Makefile.asm
==============================================================================
--- stable/11/secure/lib/libcrypto/Makefile.asm	Thu Nov  2 18:13:26 2017	(r325332)
+++ stable/11/secure/lib/libcrypto/Makefile.asm	Thu Nov  2 18:16:01 2017	(r325333)
@@ -6,7 +6,44 @@
 
 .include "Makefile.inc"
 
-.if defined(ASM_amd64)
+.if defined(ASM_aarch64)
+
+.PATH:	${LCRYPTO_SRC}/crypto \
+	${LCRYPTO_SRC}/crypto/aes/asm \
+	${LCRYPTO_SRC}/crypto/modes/asm \
+	${LCRYPTO_SRC}/crypto/sha/asm
+
+PERLPATH=	-I${LCRYPTO_SRC}/crypto/perlasm
+
+# aes
+SRCS=	aesv8-armx.pl
+
+# modes
+SRCS+=	ghashv8-armx.pl
+
+# sha
+SRCS+=	sha1-armv8.pl sha512-armv8.pl
+
+ASM=	${SRCS:R:S/$/.S/} sha256-armv8.S
+
+all:	${ASM}
+
+CLEANFILES=	${ASM} ${SRCS:R:S/$/.s/} sha256-armv8.s
+.SUFFIXES:	.pl
+
+sha256-armv8.S:	sha512-armv8.pl
+	env CC=cc perl ${.ALLSRC} 64 ${.TARGET:R:S/$/.s/}
+	( echo '/* $$'FreeBSD'$$ */' ;\
+	echo '/* Do not modify. This file is auto-generated from ${.ALLSRC:T:R:S/$/.pl/}. */' ;\
+	cat ${.TARGET:R:S/$/.s/}) > ${.TARGET}
+
+.pl.S:
+	env CC=cc perl ${.IMPSRC} 64 ${.TARGET:R:S/$/.s/}
+	( echo '/* $$'FreeBSD'$$ */' ;\
+	echo '/* Do not modify. This file is auto-generated from ${.IMPSRC:T:R:S/$/.pl/}. */' ;\
+	cat ${.TARGET:R:S/$/.s/}) > ${.TARGET}
+
+.elif defined(ASM_amd64)
 
 .PATH:	${LCRYPTO_SRC}/crypto \
 	${LCRYPTO_SRC}/crypto/aes/asm \

Modified: stable/11/secure/lib/libcrypto/Makefile.inc
==============================================================================
--- stable/11/secure/lib/libcrypto/Makefile.inc	Thu Nov  2 18:13:26 2017	(r325332)
+++ stable/11/secure/lib/libcrypto/Makefile.inc	Thu Nov  2 18:16:01 2017	(r325333)
@@ -21,7 +21,9 @@ CFLAGS+=-DL_ENDIAN
 CFLAGS+=-DB_ENDIAN
 .endif
 
-.if ${MACHINE_CPUARCH} == "amd64" || ${MACHINE_CPUARCH} == "i386"
+.if ${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_CPUARCH} == "arm"
+ASM_${MACHINE_CPUARCH}=
+.elif ${MACHINE_CPUARCH} == "amd64" || ${MACHINE_CPUARCH} == "i386"
 _ASM_AVX!=	{ \
 		    echo vzeroall | \
 		    ${CC} -x assembler -o /dev/null -c - 2> /dev/null; \
@@ -29,11 +31,11 @@ _ASM_AVX!=	{ \
 .if ${_ASM_AVX} == yes
 ASM_${MACHINE_CPUARCH}=
 .endif
-.elif ${MACHINE_CPUARCH} == "arm"
-ASM_arm=
 .endif
 
-.if defined(ASM_amd64)
+.if defined(ASM_aarch64)
+CFLAGS+=-DSHA1_ASM -DSHA256_ASM -DSHA512_ASM
+.elif defined(ASM_amd64)
 CFLAGS+=-DOPENSSL_IA32_SSE2
 CFLAGS+=-DAES_ASM -DBSAES_ASM -DVPAES_ASM
 CFLAGS+=-DECP_NISTZ256_ASM



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201711021816.vA2IG1El075878>