]> git.ipfire.org Git - thirdparty/openssh-portable.git/commitdiff
Improve detection of -fzero-call-used-regs=all support
authorColin Watson <cjwatson@debian.org>
Thu, 24 Feb 2022 16:04:18 +0000 (16:04 +0000)
committerDamien Miller <djm@mindrot.org>
Fri, 25 Feb 2022 00:28:45 +0000 (11:28 +1100)
GCC doesn't tell us whether this option is supported unless it runs into
the situation where it would need to emit corresponding code.

m4/openssh.m4

index 4f9c3792dc171448c309c48ccabbf72166b6368f..8c33c701b8b42ee7eef99cdcbaf0c695591fe0b8 100644 (file)
@@ -14,6 +14,8 @@ AC_DEFUN([OSSH_CHECK_CFLAG_COMPILE], [{
        AC_COMPILE_IFELSE([AC_LANG_SOURCE([[
 #include <stdlib.h>
 #include <stdio.h>
+/* Trivial function to help test for -fzero-call-used-regs */
+void f(int n) {}
 int main(int argc, char **argv) {
        (void)argv;
        /* Some math to catch -ftrapv problems in the toolchain */
@@ -21,6 +23,7 @@ int main(int argc, char **argv) {
        float l = i * 2.1;
        double m = l / 0.5;
        long long int n = argc * 12345LL, o = 12345LL * (long long int)argc;
+       f(0);
        printf("%d %d %d %f %f %lld %lld\n", i, j, k, l, m, n, o);
        /*
         * Test fallthrough behaviour.  clang 10's -Wimplicit-fallthrough does