1From f107467179428a0e3ea9e4aa9738ac12ff02822d Mon Sep 17 00:00:00 2001 2From: Colin Watson <cjwatson@debian.org> 3Date: Thu, 24 Feb 2022 16:04:18 +0000 4Subject: [PATCH] Improve detection of -fzero-call-used-regs=all support 5 6GCC doesn't tell us whether this option is supported unless it runs into 7the situation where it would need to emit corresponding code. 8 9Upstream-Status: Backport 10Signed-off-by: Alexander Kanavin <alex@linutronix.de> 11--- 12 m4/openssh.m4 | 3 +++ 13 1 file changed, 3 insertions(+) 14 15diff --git a/m4/openssh.m4 b/m4/openssh.m4 16index 4f9c3792dc1..8c33c701b8b 100644 17--- a/m4/openssh.m4 18+++ b/m4/openssh.m4 19@@ -14,6 +14,8 @@ AC_DEFUN([OSSH_CHECK_CFLAG_COMPILE], [{ 20 AC_COMPILE_IFELSE([AC_LANG_SOURCE([[ 21 #include <stdlib.h> 22 #include <stdio.h> 23+/* Trivial function to help test for -fzero-call-used-regs */ 24+void f(int n) {} 25 int main(int argc, char **argv) { 26 (void)argv; 27 /* Some math to catch -ftrapv problems in the toolchain */ 28@@ -21,6 +23,7 @@ int main(int argc, char **argv) { 29 float l = i * 2.1; 30 double m = l / 0.5; 31 long long int n = argc * 12345LL, o = 12345LL * (long long int)argc; 32+ f(0); 33 printf("%d %d %d %f %f %lld %lld\n", i, j, k, l, m, n, o); 34 /* 35 * Test fallthrough behaviour. clang 10's -Wimplicit-fallthrough does 36