git: 1945b8632d68 - releng/14.0 - libcrypto: Add buildasm and cleanasm targets

From: Ed Maste <emaste_at_FreeBSD.org>
Date: Wed, 25 Oct 2023 20:06:27 UTC
The branch releng/14.0 has been updated by emaste:

URL: https://cgit.FreeBSD.org/src/commit/?id=1945b8632d6822f5ca37c76a4ba5854fc7dc8511

commit 1945b8632d6822f5ca37c76a4ba5854fc7dc8511
Author:     John Baldwin <jhb@FreeBSD.org>
AuthorDate: 2023-08-29 21:39:54 +0000
Commit:     Ed Maste <emaste@FreeBSD.org>
CommitDate: 2023-10-25 19:56:08 +0000

    libcrypto: Add buildasm and cleanasm targets
    
    These targets generate all the assembly files in sys/crypto/openssl.
    
    Reviewed by:    markj, emaste (earlier version)
    Differential Revision:  https://reviews.freebsd.org/D41590
    
    (cherry picked from commit 73653b72af65e294dcfedc43a8ea09b2137d72ed)
    (cherry picked from commit ef81451d114ebae9f77e195534898b6c4061aa69)
    
    Approved by:    re (gjb)
---
 secure/lib/libcrypto/Makefile        | 7 +++++++
 secure/lib/libcrypto/Makefile.common | 2 ++
 2 files changed, 9 insertions(+)

diff --git a/secure/lib/libcrypto/Makefile b/secure/lib/libcrypto/Makefile
index 70208cd17c8a..acf615ac2a8f 100644
--- a/secure/lib/libcrypto/Makefile
+++ b/secure/lib/libcrypto/Makefile
@@ -608,6 +608,13 @@ buildinf.h: Makefile
 	echo "static const char compiler_flags[] = \"compiler: ${COMPILER_TYPE}\";" ) \
 	> ${.TARGET}
 
+buildasm cleanasm:
+.for arch in aarch64 amd64 arm i386 powerpc powerpc64 powerpc64le
+	make MK_AUTO_OBJ=no -DWITHOUT_AUTO_ASM -DASM_${arch} \
+	    -f ${.CURDIR}/Makefile.asm -C ${SRCTOP}/sys/crypto/openssl/${arch} \
+	    ${.TARGET:S/build/all/:S/asm$//}
+.endfor
+
 .include <bsd.lib.mk>
 
 PICFLAG+=	-DOPENSSL_PIC
diff --git a/secure/lib/libcrypto/Makefile.common b/secure/lib/libcrypto/Makefile.common
index a52e2979060a..b109fd7f7f4f 100644
--- a/secure/lib/libcrypto/Makefile.common
+++ b/secure/lib/libcrypto/Makefile.common
@@ -7,6 +7,7 @@ CFLAGS+=	-DL_ENDIAN
 CFLAGS+=	-DB_ENDIAN
 .endif
 
+.ifndef WITHOUT_AUTO_ASM
 .if ${MACHINE_CPUARCH} == "aarch64" || ${MACHINE_CPUARCH} == "amd64" || \
     ${MACHINE_CPUARCH} == "arm" || ${MACHINE_CPUARCH} == "i386"
 ASM_${MACHINE_CPUARCH}=
@@ -14,6 +15,7 @@ ASM_${MACHINE_CPUARCH}=
     ${MACHINE_ARCH} == "powerpc64le"
 ASM_${MACHINE_ARCH}=
 .endif
+.endif
 
 .if defined(ASM_${MACHINE_CPUARCH}) || defined(ASM_${MACHINE_ARCH})
 CFLAGS+=	-DOPENSSL_CPUID_OBJ