Skip to content

Commit 66df143

Browse files
committed
Revert "config: cache results of kernel checks (openzfs#17106)"
This reverts commit dd2a46b.
1 parent 8f08dbf commit 66df143

File tree

1 file changed

+18
-45
lines changed

1 file changed

+18
-45
lines changed

config/kernel.m4

Lines changed: 18 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -465,11 +465,6 @@ AC_DEFUN([ZFS_AC_KERNEL], [
465465
AC_SUBST(LINUX)
466466
AC_SUBST(LINUX_OBJ)
467467
AC_SUBST(LINUX_VERSION)
468-
469-
dnl # create a relatively unique numeric checksum based on the kernel
470-
dnl # version and path. this is included in the cache key below,
471-
dnl # allowing different cached values for different kernels
472-
_zfs_linux_cache_checksum=$(echo ${kernelsrc} {$kernelbuild} ${kernsrcver} | cksum | cut -f1 -d' ')
473468
])
474469

475470
AC_DEFUN([ZFS_AC_KERNEL_VERSION_WARNING], [
@@ -817,18 +812,14 @@ dnl # must never depend on the results of previous tests. Each test
817812
dnl # needs to be entirely independent.
818813
dnl #
819814
AC_DEFUN([ZFS_LINUX_TEST_SRC], [
820-
cachevar="zfs_cv_kernel_[$1]_$_zfs_linux_cache_checksum"
821-
eval "cacheval=\$$cachevar"
822-
AS_IF([test "x$cacheval" = "x"], [
823-
ZFS_LINUX_CONFTEST_C([ZFS_LINUX_TEST_PROGRAM([[$2]], [[$3]],
824-
[["Dual BSD/GPL"]])], [$1])
825-
ZFS_LINUX_CONFTEST_MAKEFILE([$1], [yes], [$4])
826-
827-
AS_IF([ test -n "$5" ], [
828-
ZFS_LINUX_CONFTEST_C([ZFS_LINUX_TEST_PROGRAM(
829-
[[$2]], [[$3]], [[$5]])], [$1_license])
830-
ZFS_LINUX_CONFTEST_MAKEFILE([$1_license], [yes], [$4])
831-
])
815+
ZFS_LINUX_CONFTEST_C([ZFS_LINUX_TEST_PROGRAM([[$2]], [[$3]],
816+
[["Dual BSD/GPL"]])], [$1])
817+
ZFS_LINUX_CONFTEST_MAKEFILE([$1], [yes], [$4])
818+
819+
AS_IF([ test -n "$5" ], [
820+
ZFS_LINUX_CONFTEST_C([ZFS_LINUX_TEST_PROGRAM(
821+
[[$2]], [[$3]], [[$5]])], [$1_license])
822+
ZFS_LINUX_CONFTEST_MAKEFILE([$1_license], [yes], [$4])
832823
])
833824
])
834825

@@ -840,23 +831,14 @@ dnl # $2 - run on success (valid .ko generated)
840831
dnl # $3 - run on failure (unable to compile)
841832
dnl #
842833
AC_DEFUN([ZFS_LINUX_TEST_RESULT], [
843-
cachevar="zfs_cv_kernel_[$1]_$_zfs_linux_cache_checksum"
844-
AC_CACHE_VAL([$cachevar], [
845-
AS_IF([test -d build/$1], [
846-
AS_IF([test -f build/$1/$1.ko], [
847-
eval "$cachevar=yes"
848-
], [
849-
eval "$cachevar=no"
850-
])
851-
], [
852-
AC_MSG_ERROR([
834+
AS_IF([test -d build/$1], [
835+
AS_IF([test -f build/$1/$1.ko], [$2], [$3])
836+
], [
837+
AC_MSG_ERROR([
853838
*** No matching source for the "$1" test, check that
854839
*** both the test source and result macros refer to the same name.
855-
])
856840
])
857841
])
858-
eval "cacheval=\$$cachevar"
859-
AS_IF([test "x$cacheval" = "xyes"], [$2], [$3])
860842
])
861843

862844
dnl #
@@ -885,24 +867,15 @@ dnl # verify symbol exports, unless --enable-linux-builtin was provided to
885867
dnl # configure.
886868
dnl #
887869
AC_DEFUN([ZFS_LINUX_TEST_RESULT_SYMBOL], [
888-
cachevar="zfs_cv_kernel_[$1]_$_zfs_linux_cache_checksum"
889-
AC_CACHE_VAL([$cachevar], [
890-
AS_IF([ ! test -f build/$1/$1.ko], [
891-
eval "$cachevar=no"
870+
AS_IF([ ! test -f build/$1/$1.ko], [
871+
$5
872+
], [
873+
AS_IF([test "x$enable_linux_builtin" != "xyes"], [
874+
ZFS_CHECK_SYMBOL_EXPORT([$2], [$3], [$4], [$5])
892875
], [
893-
AS_IF([test "x$enable_linux_builtin" != "xyes"], [
894-
ZFS_CHECK_SYMBOL_EXPORT([$2], [$3], [
895-
eval "$cachevar=yes"
896-
], [
897-
eval "$cachevar=no"
898-
])
899-
], [
900-
eval "$cacheval=yes"
901-
])
876+
$4
902877
])
903878
])
904-
eval "cacheval=\$$cachevar"
905-
AS_IF([test "x$cacheval" = "xyes"], [$4], [$5])
906879
])
907880

908881
dnl #

0 commit comments

Comments
 (0)