From nobody Tue Aug 29 21:47:22 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4Rb1HG5Dpvz4rFrp; Tue, 29 Aug 2023 21:47:22 +0000 (UTC) (envelope-from git@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) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Rb1HG3MWnz3KBF; Tue, 29 Aug 2023 21:47:22 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1693345642; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TD+ejg1PLrDYZUaNnea1mIaMXCKGEyXPgjE/Hi1Dlk8=; b=sE6tBOzDVBVmK7TYwXl9hmuCHeOK3T2fjgTaDu+HA1oktr+YH5ewvFZWGQPkeaRIGHtBIa mJ7H5IgaKYj/6C/SN2R7mCVJjZJp0XrB09/lR1GtBTCYooKw00dkwz9R4zwXYnDTtoYep9 gh71+jPuSPwZ9CQki74MhkQxIkVYuLv55FbuCz2TKVFCgbaDjXbm8Jfzb+D0AHjd+qNg4t 4Gv4ZV4mRNiIuH9pJBdrF8w38b2gh216XJKB4uUKpWqS7k1OhbDalX3lJn/nMHYm9ilWAt 8q+8sZRWZePC1bawCs2KOZKcwTHUMie09eBW02s4H4Wkb+Qf73Hv79F8DISV3g== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1693345642; a=rsa-sha256; cv=none; b=kubuvDxQMXMgoh7goy1bBI4UxK6qNvJ19JZNmVGkfOSuR6WSl+v1aYxDHUjOu6eSqH3xjo qXkIV/Sy3WfgcJIUkbPobAwnvgUCiejbI3iKDh9GDZt1jEeNKjs2w3Hurdcqd+P/zLl9UI 1yEuWtp0pHby3BOa2XTSQBMUe25x+bqrjjvVhcMVSo3djxNhuDFhPGmj67QCrEVJXGSf4s gXBRkjw44YN2nMItjkIYK2S4T2nQ2nO+Eqh4NrwZmUZmFpWrF6fxxhUZ94l1cxc/NSSJOu ENlDCdhECGyAoBnvorZ3SflP9vGwqSFjGjUEbYnjT+hlLHuJuwoFWK1kzV9QvA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1693345642; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=TD+ejg1PLrDYZUaNnea1mIaMXCKGEyXPgjE/Hi1Dlk8=; b=pCJOgz6yqClZDn1f2YkQT6CRAEMCcs0paueAiZMYLJenX9MkKfG076f4xkdcvi/Cv/XxCK PSUtEGL/uAGFBAo72PH+pDzsoDajQve6MSnGk1HF+Nf3CPQmYQnibk/w2QycrJuutxsFuA 1KOFYpWZzY3GwrV46syY+rkE50hjaDLD5QgWbWyBZX0aCkayUXSB6AO0Jqz+MbiB2o6h1G hcl08IDPuwwOgbo+RURnKQwBhfF5q7zCAFJ1J76tHow3/4SIoPNVN+dqrOMEcjCUVMdKt/ lApQ5RDjYQzpUjGgRhWRL0Fkh7JT7pXhXgtGaVMLvH3KkqK56L1PDy/s2lGOvg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4Rb1HG2DqRz17HH; Tue, 29 Aug 2023 21:47:22 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 37TLlM6U087656; Tue, 29 Aug 2023 21:47:22 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 37TLlMWe087653; Tue, 29 Aug 2023 21:47:22 GMT (envelope-from git) Date: Tue, 29 Aug 2023 21:47:22 GMT Message-Id: <202308292147.37TLlMWe087653@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: John Baldwin Subject: git: c0fe6b9d7506 - main - libcrypto: Refactor Makefile.asm so it can be run outside of buildenv List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: jhb X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: c0fe6b9d7506d6ce6f9ec3688ee0cc5656a8707e Auto-Submitted: auto-generated The branch main has been updated by jhb: URL: https://cgit.FreeBSD.org/src/commit/?id=c0fe6b9d7506d6ce6f9ec3688ee0cc5656a8707e commit c0fe6b9d7506d6ce6f9ec3688ee0cc5656a8707e Author: John Baldwin AuthorDate: 2023-08-29 21:39:36 +0000 Commit: John Baldwin CommitDate: 2023-08-29 21:39:36 +0000 libcrypto: Refactor Makefile.asm so it can be run outside of buildenv Currently Makefile.asm relies on the current buildenv to set CFLAGS for i386. The current approach also leaves various temporary *.s files around in the current directory. To make this a bit better: - Instead of using CFLAGS from buildenv for i386, define the actual flags the perl scripts need: -DOPENSSL_IA32_SSE2 to enable SSE2. - Change i386 to have the perl scripts write to /dev/stdout to avoid creating temporaries. Previously i386 was generating the temporary files in the OpenSSL contrib src. - Cleanup temporary *.s files in the all target after generating the real *.S files for architectures which need them. - Remove a duplicate rule for aes-armv4.S. Reviewed by: markj Differential Revision: https://reviews.freebsd.org/D41589 --- secure/lib/libcrypto/Makefile.asm | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/secure/lib/libcrypto/Makefile.asm b/secure/lib/libcrypto/Makefile.asm index 0ee8c17369e9..d3243e5b20b8 100644 --- a/secure/lib/libcrypto/Makefile.asm +++ b/secure/lib/libcrypto/Makefile.asm @@ -45,8 +45,9 @@ SRCS+= keccak1600-armv8.pl sha1-armv8.pl sha512-armv8.pl ASM= ${SRCS:R:S/$/.S/} sha256-armv8.S all: ${ASM} + rm -f ${ASM:R:S/$/.s/} -CLEANFILES= ${ASM} ${SRCS:R:S/$/.s/} sha256-armv8.s +CLEANFILES= ${ASM} .SUFFIXES: .pl sha256-armv8.S: sha512-armv8.pl @@ -125,8 +126,9 @@ SHA_TMP= ${SHA_ASM:S/$/.s/} ASM= ${SRCS:R:S/$/.S/} ${SHA_ASM:S/$/.S/} all: ${ASM} + rm -f ${SHA_TMP} -CLEANFILES= ${ASM} ${SHA_ASM:S/$/.s/} +CLEANFILES= ${ASM} .SUFFIXES: .pl .pl.S: @@ -179,17 +181,14 @@ SRCS+= poly1305-armv4.pl # sha SRCS+= keccak1600-armv4.pl sha1-armv4-large.pl sha256-armv4.pl sha512-armv4.pl -ASM= aes-armv4.S ${SRCS:R:S/$/.S/} +ASM= ${SRCS:R:S/$/.S/} all: ${ASM} + rm -f ${ASM:R:S/$/.s/} -CLEANFILES= ${ASM} ${SRCS:R:S/$/.s/} +CLEANFILES= ${ASM} .SUFFIXES: .pl -aes-armv4.S: aes-armv4.pl - ( echo '/* Do not modify. This file is auto-generated from ${.ALLSRC:T}. */' ;\ - env CC=cc perl ${.ALLSRC} linux32 ) > ${.TARGET} - .pl.S: env CC=cc perl ${.IMPSRC} linux32 ${.TARGET:R:S/$/.s/} ( echo '/* Do not modify. This file is auto-generated from ${.IMPSRC:T}. */' ;\ @@ -217,6 +216,7 @@ aes-armv4.S: aes-armv4.pl ${LCRYPTO_SRC}/engines/asm #PERLPATH= -I${LCRYPTO_SRC}/crypto/des/asm -I${LCRYPTO_SRC}/crypto/perlasm +CFLAGS= -DOPENSSL_IA32_SSE2 # cpuid SRCS= x86cpuid.pl @@ -276,17 +276,15 @@ ASM= ${SRCS:R:S/$/.S/} all: ${ASM} -CLEANFILES= ${ASM} ${SRCS:R:S/$/.s/} +CLEANFILES= ${ASM} .SUFFIXES: .pl .pl.S: ( echo '/* Do not modify. This file is auto-generated from ${.IMPSRC:T}. */' ;\ echo '#ifdef PIC' ;\ - env CC=cc perl ${PERLPATH} ${.IMPSRC} elf ${CFLAGS} -fpic -DPIC ${.IMPSRC:R:S/$/.s/} ;\ - cat ${.IMPSRC:R:S/$/.s/} ;\ + env CC=cc perl ${PERLPATH} ${.IMPSRC} elf ${CFLAGS} -fpic /dev/stdout ;\ echo '#else' ;\ - env CC=cc perl ${PERLPATH} ${.IMPSRC} elf ${CFLAGS} ${.IMPSRC:R:S/$/.s/} ;\ - cat ${.IMPSRC:R:S/$/.s/} ;\ + env CC=cc perl ${PERLPATH} ${.IMPSRC} elf ${CFLAGS} /dev/stdout ;\ echo '#endif' ) > ${.TARGET} .elif defined(ASM_powerpc) @@ -325,6 +323,7 @@ SRCS+= poly1305-ppc.pl poly1305-ppcfp.pl ASM= ${SRCS:R:S/$/.S/} bn-ppc.S sha256-ppc.S sha256p8-ppc.S all: ${ASM} + rm -f ${ASM:R:S/$/.s/} CLEANFILES= ${ASM} .SUFFIXES: .pl @@ -392,6 +391,7 @@ SRCS+= keccak1600-ppc64.pl ASM= ${SRCS:R:S/$/.S/} bn-ppc.S sha256-ppc.S sha256p8-ppc.S all: ${ASM} + rm -f ${ASM:R:S/$/.s/} CLEANFILES= ${ASM} .SUFFIXES: .pl @@ -459,6 +459,7 @@ SRCS+= keccak1600-ppc64.pl ASM= ${SRCS:R:S/$/.S/} bn-ppc.S sha256-ppc.S sha256p8-ppc.S all: ${ASM} + rm -f ${ASM:R:S/$/.s/} CLEANFILES= ${ASM} .SUFFIXES: .pl