summaryrefslogtreecommitdiffstats
path: root/configure.ac
diff options
context:
space:
mode:
authorDarren Tucker <dtucker@dtucker.net>2022-11-30 01:23:11 +0100
committerDarren Tucker <dtucker@dtucker.net>2022-11-30 01:45:07 +0100
commit62cc33e6eed847aafdc29e34aa69e9bd82a0ee16 (patch)
treeb445097eb54f5fc5bf8f934c2e3c5ab4f897a398 /configure.ac
parentSkip unit tests on slow riscv64 hardware. (diff)
downloadopenssh-62cc33e6eed847aafdc29e34aa69e9bd82a0ee16.tar.xz
openssh-62cc33e6eed847aafdc29e34aa69e9bd82a0ee16.zip
Use -fzero-call-used-regs=used on clang 15.
clang 15 seems to have a problem with -fzero-call-used-reg=all which causes spurious "incorrect signature" failures with ED25519. On those versions, use -fzero-call-used-regs=used instead. (We may add exceptions later if specific versions prove to be OK). Also move the GCC version check to match. Initial investigation by Daniel Pouzzner (douzzer at mega nu), workaround suggested by Bill Wendling (morbo at google com). bz#3475, ok djm@
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac35
1 files changed, 23 insertions, 12 deletions
diff --git a/configure.ac b/configure.ac
index d1998c94d..5507688e1 100644
--- a/configure.ac
+++ b/configure.ac
@@ -172,6 +172,22 @@ AC_COMPILE_IFELSE([AC_LANG_SOURCE([[int main(void) { return 0; }]])],
CFLAGS="$saved_CFLAGS"
if test "$GCC" = "yes" || test "$GCC" = "egcs"; then
+ AC_MSG_CHECKING([gcc version])
+ GCC_VER=`$CC -v 2>&1 | $AWK '/gcc version /{print $3}'`
+ case "$GCC_VER" in
+ 1.*) no_attrib_nonnull=1 ;;
+ 2.8* | 2.9*)
+ no_attrib_nonnull=1
+ ;;
+ 2.*) no_attrib_nonnull=1 ;;
+ *) ;;
+ esac
+ AC_MSG_RESULT([$GCC_VER])
+
+ AC_MSG_CHECKING([clang version])
+ CLANG_VER=`$CC -v 2>&1 | $AWK '/clang version /{print $3}'`
+ AC_MSG_RESULT([$CLANG_VER])
+
OSSH_CHECK_CFLAG_COMPILE([-pipe])
OSSH_CHECK_CFLAG_COMPILE([-Wunknown-warning-option])
OSSH_CHECK_CFLAG_COMPILE([-Wno-error=format-truncation])
@@ -203,20 +219,15 @@ if test "$GCC" = "yes" || test "$GCC" = "egcs"; then
# actually links. The test program compiled/linked includes a number
# of integer operations that should exercise this.
OSSH_CHECK_CFLAG_LINK([-ftrapv])
- OSSH_CHECK_CFLAG_COMPILE([-fzero-call-used-regs=all])
+ # clang 15 seems to have a big in -fzero-call-used-regs=all. See
+ # 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]) ;;
+ *) OSSH_CHECK_CFLAG_COMPILE([-fzero-call-used-regs=all]) ;;
+ esac
OSSH_CHECK_CFLAG_COMPILE([-ftrivial-auto-var-init=zero])
fi
- AC_MSG_CHECKING([gcc version])
- GCC_VER=`$CC -v 2>&1 | $AWK '/gcc version /{print $3}'`
- case $GCC_VER in
- 1.*) no_attrib_nonnull=1 ;;
- 2.8* | 2.9*)
- no_attrib_nonnull=1
- ;;
- 2.*) no_attrib_nonnull=1 ;;
- *) ;;
- esac
- AC_MSG_RESULT([$GCC_VER])
AC_MSG_CHECKING([if $CC accepts -fno-builtin-memset])
saved_CFLAGS="$CFLAGS"