[openssh-commits] [openssh] 01/01: Use zero-call-used-regs=used with Apple compilers.

git+noreply at mindrot.org git+noreply at mindrot.org
Sun Sep 10 15:51:19 AEST 2023


This is an automated email from the git hooks/post-receive script.

dtucker pushed a commit to branch V_9_4
in repository openssh.

commit ca2937a607c5578b6508db95e228e51593525940
Author: Darren Tucker <dtucker at dtucker.net>
Date:   Sun Sep 10 15:45:38 2023 +1000

    Use zero-call-used-regs=used with Apple compilers.
    
    Apple's versions of clang have version numbers that do not match the
    corresponding upstream clang versions.  Unfortunately, they do still
    have the clang-15 zero-call-used-regs=all bug, so for now use the value
    that doesn't result in segfaults.  We could allowlist future versions
    that are known to work.  bz#3584 (and probably also our github CI
    failures).
---
 configure.ac | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/configure.ac b/configure.ac
index e3128dfc..d8816e3f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -187,7 +187,13 @@ if test "$GCC" = "yes" || test "$GCC" = "egcs"; then
 	AC_MSG_RESULT([$GCC_VER])
 
 	AC_MSG_CHECKING([clang version])
-	CLANG_VER=`$CC -v 2>&1 | $AWK '/clang version /{print $3}'`
+	ver="`$CC -v 2>&1`"
+	if echo "$ver" | grep "Apple" >/dev/null; then
+		CLANG_VER="apple-`echo "$ver" | \
+		    awk '/Apple LLVM/ {print $4"-"$5}'`"
+	else
+		CLANG_VER=`echo "$ver" | $AWK '/clang version /{print $3}'`
+	fi
 	AC_MSG_RESULT([$CLANG_VER])
 
 	OSSH_CHECK_CFLAG_COMPILE([-pipe])
@@ -225,7 +231,7 @@ if test "$GCC" = "yes" || test "$GCC" = "egcs"; then
 	# https://bugzilla.mindrot.org/show_bug.cgi?id=3475 and
 	# https://github.com/llvm/llvm-project/issues/59242
 	case "$CLANG_VER" in
-	15.*) OSSH_CHECK_CFLAG_COMPILE([-fzero-call-used-regs=used]) ;;
+	15.*|apple*) OSSH_CHECK_CFLAG_COMPILE([-fzero-call-used-regs=used]) ;;
 	*)    OSSH_CHECK_CFLAG_COMPILE([-fzero-call-used-regs=all]) ;;
 	esac
 	OSSH_CHECK_CFLAG_COMPILE([-ftrivial-auto-var-init=zero])

-- 
To stop receiving notification emails like this one, please contact
djm at mindrot.org.


More information about the openssh-commits mailing list