aboutsummaryrefslogtreecommitdiffstats
path: root/config/always-compiler-options.m4
diff options
context:
space:
mode:
authorRyan Moeller <[email protected]>2020-02-06 12:24:37 -0500
committerGitHub <[email protected]>2020-02-06 09:24:37 -0800
commit5b7e6a36175c1c13803785557b17977d2a9ecd9d (patch)
tree135889609205c599ac5173f4f102ba2f51e4ce76 /config/always-compiler-options.m4
parent81acb1edcb595a7377a6ad188c65dd23f2702ce9 (diff)
Fix unknown cc flag -fno-ipa-sra
Clang does not recognize -fno-ipa-sra, so add a check for it. Reviewed-by: Brian Behlendorf <[email protected]> Reviewed-by: Prakash Surya <[email protected]> Signed-off-by: Ryan Moeller <[email protected]> Closes #9946
Diffstat (limited to 'config/always-compiler-options.m4')
-rw-r--r--config/always-compiler-options.m421
1 files changed, 21 insertions, 0 deletions
diff --git a/config/always-compiler-options.m4 b/config/always-compiler-options.m4
index f903655fa..ca8b6bfcc 100644
--- a/config/always-compiler-options.m4
+++ b/config/always-compiler-options.m4
@@ -160,3 +160,24 @@ AC_DEFUN([ZFS_AC_CONFIG_ALWAYS_CC_NO_OMIT_FRAME_POINTER], [
CFLAGS="$saved_flags"
AC_SUBST([NO_OMIT_FRAME_POINTER])
])
+
+dnl #
+dnl # Check if cc supports -fno-ipa-sra option.
+dnl #
+AC_DEFUN([ZFS_AC_CONFIG_ALWAYS_CC_NO_IPA_SRA], [
+ AC_MSG_CHECKING([whether $CC supports -fno-ipa-sra])
+
+ saved_flags="$CFLAGS"
+ CFLAGS="$CFLAGS -Werror -fno-ipa-sra"
+
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([], [])], [
+ NO_IPA_SRA=-fno-ipa-sra
+ AC_MSG_RESULT([yes])
+ ], [
+ NO_IPA_SRA=
+ AC_MSG_RESULT([no])
+ ])
+
+ CFLAGS="$saved_flags"
+ AC_SUBST([NO_IPA_SRA])
+])