aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Turner <andrew@FreeBSD.org>2021-11-29 17:21:31 +0000
committerAndrew Turner <andrew@FreeBSD.org>2021-12-01 15:14:57 +0000
commit629b5e87ed82aa428be1abbe51b80fa338fa839a (patch)
tree5b09c57c058307bcf9a497cea775baf3a3af8919
parent73d41cc730858aa1fe273c36f3653afd16791091 (diff)
downloadsrc-629b5e87ed82aa428be1abbe51b80fa338fa839a.tar.gz
src-629b5e87ed82aa428be1abbe51b80fa338fa839a.zip
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
-rw-r--r--share/mk/bsd.compiler.mk8
1 files changed, 8 insertions, 0 deletions
diff --git a/share/mk/bsd.compiler.mk b/share/mk/bsd.compiler.mk
index c58eb114f4b8..4a1472c6bfab 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
@@ -255,6 +256,13 @@ ${X_}COMPILER_FEATURES+= compressed-debug
${X_}COMPILER_FEATURES+= fileprefixmap
.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}