Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 20 Dec 2021 14:02:20 GMT
From:      Andrew Turner <andrew@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org
Subject:   git: a72050a86fff - stable/13 - Add an arm64 sha512 feature check
Message-ID:  <202112201402.1BKE2Kog042926@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch stable/13 has been updated by andrew:

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

commit a72050a86fffef345f1afb4eeb54c11037d3edd9
Author:     Andrew Turner <andrew@FreeBSD.org>
AuthorDate: 2021-11-29 17:21:31 +0000
Commit:     Andrew Turner <andrew@FreeBSD.org>
CommitDate: 2021-12-20 11:09:27 +0000

    Add an arm64 sha512 feature check
    
    This is only available in recent toolchains. Check for it so we can
    use it in libmd.
    
    Reviewed by:    emaste
    Sponsored by:   The FreeBSD Foundation
    Differential Revision: https://reviews.freebsd.org/D33166
    
    (cherry picked from commit 629b5e87ed82aa428be1abbe51b80fa338fa839a)
---
 share/mk/bsd.compiler.mk | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/share/mk/bsd.compiler.mk b/share/mk/bsd.compiler.mk
index 4c14e3811f6e..71f0df70ad25 100644
--- a/share/mk/bsd.compiler.mk
+++ b/share/mk/bsd.compiler.mk
@@ -25,6 +25,7 @@
 # - retpoline: supports the retpoline speculative execution vulnerability
 #              mitigation.
 # - init-all:  supports stack variable initialization.
+# - aarch64-sha512: supports the AArch64 sha512 intrinsic functions.
 #
 # When bootstrapping on macOS, 'apple-clang' will be set in COMPILER_FEATURES
 # to differentiate Apple's version of Clang. Apple Clang uses a different
@@ -237,6 +238,13 @@ ${X_}COMPILER_FEATURES+=	c++17
 ${X_}COMPILER_FEATURES+=	retpoline init-all
 .endif
 
+.if (${${X_}COMPILER_TYPE} == "clang" && ${${X_}COMPILER_VERSION} >= 130000) || \
+	(${${X_}COMPILER_TYPE} == "gcc" && ${${X_}COMPILER_VERSION} >= 90000)
+# AArch64 sha512 intrinsics are supported (and have been tested) in
+# clang 13 and gcc 9.
+${X_}COMPILER_FEATURES+=	aarch64-sha512
+.endif
+
 .else
 # Use CC's values
 X_COMPILER_TYPE=	${COMPILER_TYPE}



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