cf: Use common macro to test compiler flags 32/14132/7
authorCheyenne Wills <cwills@sinenomine.net>
Sun, 5 Apr 2020 21:51:17 +0000 (15:51 -0600)
committerBenjamin Kaduk <kaduk@mit.edu>
Fri, 8 May 2020 16:27:31 +0000 (12:27 -0400)
Use the AX_APPEND_COMPILE_FLAGS macro to test and set compiler
specific flags.

Remove the OPENAFS_GCC_SUPPORTS_MARCH check entirely (and the
associated P5PLUS_KOPTS), since nothing has used it for quite some
time.

Change-Id: Ic9626c52ac62cf83d4b8c787aa5aa966e558a781
Reviewed-on: https://gerrit.openafs.org/14132
Reviewed-by: Benjamin Kaduk <kaduk@mit.edu>
Tested-by: BuildBot <buildbot@rampaginggeek.com>

src/cf/linux-checks.m4
src/cf/linux-test5.m4 [deleted file]
src/cf/solaris-test1.m4

index d4a6c97..f0d2daf 100644 (file)
@@ -14,12 +14,9 @@ AC_DEFUN([_OPENAFS_LINUX_KBUILD_SETUP],[
 if test "x$enable_debug_kernel" = "xno"; then
     LINUX_GCC_KOPTS="$LINUX_GCC_KOPTS -fomit-frame-pointer"
 fi
-OPENAFS_GCC_SUPPORTS_MARCH
-AC_SUBST(P5PLUS_KOPTS)
-OPENAFS_GCC_NEEDS_NO_STRENGTH_REDUCE
-OPENAFS_GCC_NEEDS_NO_STRICT_ALIASING
-OPENAFS_GCC_SUPPORTS_NO_COMMON
-OPENAFS_GCC_SUPPORTS_PIPE
+AX_APPEND_COMPILE_FLAGS([-fno-strict-aliasing -fno-strength-reduce \
+                         -fno-common -pipe],
+                        [LINUX_GCC_KOPTS])
 AC_SUBST(LINUX_GCC_KOPTS)
 
 dnl Setup the kernel build environment
diff --git a/src/cf/linux-test5.m4 b/src/cf/linux-test5.m4
deleted file mode 100644 (file)
index 59bdbfc..0000000
+++ /dev/null
@@ -1,88 +0,0 @@
-dnl These options seem to only be used for the 2.4.x
-dnl Linux kernel build
-AC_DEFUN([OPENAFS_GCC_SUPPORTS_MARCH], [
-  AC_CACHE_CHECK([if $CC accepts -march=pentium],
-    [openafs_cv_gcc_supports_march],
-    [save_CFLAGS="$CFLAGS"
-     CFLAGS="-MARCH=pentium"
-     AC_COMPILE_IFELSE(
-       [AC_LANG_PROGRAM(
-         [[]],
-         [[int x;]])],
-         [openafs_cv_gcc_supports_march=yes],
-         [openafs_cv_gcc_supports_march=no])
-     CFLAGS="$save_CFLAGS"
-    ])
-  AS_IF([test x$openafs_cv_gcc_supports_march = xyes],
-        [P5PLUS_KOPTS="-march=pentium"],
-        [P5PLUS_KOPTS="-m486 -malign-loops=2 -malign-jumps=2 -malign-functions=2"])
-])
-
-AC_DEFUN([OPENAFS_GCC_NEEDS_NO_STRICT_ALIASING], [
-  AC_CACHE_CHECK([if $CC needs -fno-strict-aliasing],
-    [openafs_cv_gcc_needs_no_strict_aliasing],
-    [save_CFLAGS="$CFLAGS"
-     CFLAGS="-fno-strict-aliasing"
-     AC_COMPILE_IFELSE(
-       [AC_LANG_PROGRAM(
-         [[]],
-         [[int x;]])],
-       [openafs_cv_gcc_needs_no_strict_aliasing=yes],
-       [openafs_cv_gcc_needs_no_strict_aliasing=no])
-     CFLAGS="$save_CFLAGS"
-  ])
-  AS_IF([test x$openafs_cv_gcc_needs_no_strict_aliasing = xyes],
-        [LINUX_GCC_KOPTS="$LINUX_GCC_KOPTS -fno-strict-aliasing"])
-])
-
-AC_DEFUN([OPENAFS_GCC_NEEDS_NO_STRENGTH_REDUCE], [
-  AC_CACHE_CHECK([if $CC needs -fno-strength-reduce],
-    [openafs_cv_gcc_needs_no_strength_reduce],
-    [save_CFLAGS="$CFLAGS"
-     CFLAGS="-fno-strength-reduce"
-     AC_COMPILE_IFELSE(
-       [AC_LANG_PROGRAM(
-         [[]],
-         [[int x;]])],
-       [openafs_cv_gcc_needs_no_strength_reduce=yes],
-       [openafs_cv_gcc_needs_no_strength_reduce=no])
-     CFLAGS="$save_CFLAGS"
-  ])
-  AS_IF([test x$openafs_cv_gcc_needs_no_strength_reduce = xyes],
-        [LINUX_GCC_KOPTS="$LINUX_GCC_KOPTS -fno-strength-reduce"])
-])
-
-AC_DEFUN([OPENAFS_GCC_SUPPORTS_NO_COMMON], [
-  AC_CACHE_CHECK([if $CC supports -fno-common],
-    [openafs_cv_gcc_supports_no_common],
-    [save_CFLAGS="$CFLAGS"
-     CFLAGS="-fno-common"
-     AC_COMPILE_IFELSE(
-       [AC_LANG_PROGRAM(
-         [[]],
-         [[int x;]])],
-       [openafs_cv_gcc_supports_no_common=yes],
-       [openafs_cv_gcc_supports_no_common=no])
-
-     CFLAGS="$save_CFLAGS"
-  ])
-  AS_IF([test x$openafs_cv_gcc_supports_no_common = xyes],
-       [LINUX_GCC_KOPTS="$LINUX_GCC_KOPTS -fno-common"])
-])
-
-AC_DEFUN([OPENAFS_GCC_SUPPORTS_PIPE], [
-  AC_CACHE_CHECK([if $CC supports -pipe],
-    [openafs_cv_gcc_supports_pipe],
-    [save_CFLAGS="$CFLAGS"
-     CFLAGS="-pipe"
-     AC_COMPILE_IFELSE(
-       [AC_LANG_PROGRAM(
-         [[]],
-         [[int x;]])],
-       [openafs_cv_gcc_supports_pipe=yes],
-       [openafs_cv_gcc_supports_pipe=no])
-  CFLAGS="$save_CFLAGS"
-  ])
-  AS_IF([test x$openafs_cv_gcc_supports_pipe = xyes],
-         [LINUX_GCC_KOPTS="$LINUX_GCC_KOPTS -pipe"])
-])
index 89fbdff..201445e 100644 (file)
@@ -8,17 +8,6 @@ dnl   BAD TRAP: type=7 (#nm Device not available)
 dnl
 dnl
 AC_DEFUN([SOLARIS_CC_TAKES_XVECTOR_NONE], [
-  AC_CACHE_CHECK([if $CC accepts -xvector=%none],
-    [ac_cv_solaris_cc_takes_xvector_none],
-    [save_CFLAGS="$CFLAGS"
-     CFLAGS="$CFLAGS -xvector=%none"
-     AC_COMPILE_IFELSE(
-       [AC_LANG_PROGRAM([[]], [[int x;]])],
-       [ac_cv_solaris_cc_takes_xvector_none=yes],
-       [ac_cv_solaris_cc_takes_xvector_none=no])
-     CFLAGS="$save_CFLAGS"
-    ])
-
 dnl -xvector=%none first appeared in Studio 11, but has only been
 dnl documented as required for Solaris x86 kernel code since Studio
 dnl 12.3.  Studio 12.3 is when the compiler started making more
@@ -28,11 +17,8 @@ dnl required to prevent these optimizations, it is not sufficient.
 dnl Experiments have shown that -xregs=no%float is also needed to
 dnl 1) eliminate a few optimizations not squelched by -xvector=%none,
 dnl and 2) prevent actual use of floating point types in the kernel
-dnl module.  -xregs=no%float has been present since before Studio 8, so
-dnl it is safe to assume its presence when -xvector=%none is present.
+dnl module.
 dnl
-
-  AS_IF([test "$ac_cv_solaris_cc_takes_xvector_none" = "yes"],
-        [SOLARIS_CC_KOPTS="-xvector=%none -xregs=no%float "])
+  AX_APPEND_COMPILE_FLAGS([-xvector=%none -xregs=no%float], [SOLARIS_CC_KOPTS])
 ])