File 0017-LU-13783-build-Fix-LB_LINUX_VERSION-rule-for-v5.8.patch of Package lustre_2_12

From b21dc446068d5dfd4e967f1229d6842b9073f465 Mon Sep 17 00:00:00 2001
From: Mr NeilBrown <neilb@suse.de>
Date: Fri, 23 Oct 2020 15:07:36 +1100
Subject: [PATCH 17/35] LU-13783 build: Fix LB_LINUX_VERSION rule for v5.8

Since Commit 20b1be595282 ("kbuild: fix single target builds for
external modules") in v5.8-rc7, the LB_LINUX_VERSION autoconf
rule doesn't work.

I don't know exactly why, but it can be fixed by setting "makerule" to
an empty string.

Passing the path to the directory in $makerule is unnecessary as
LB_LINUX_COMPILE_IFELSE, which LB_LINUX_TRY_MAKE eventually calls,
passes "$MODULE_TARGET=$PWD/build" which has the required effect.

Test-Parameters: trivial
Signed-off-by: Mr NeilBrown <neilb@suse.de>
Change-Id: I2b381d3546aaa0f365328a1319b2d4f145f33eeb
Reviewed-on: https://review.whamcloud.com/40371
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Reviewed-by: Aurelien Degremont <degremoa@amazon.com>
Reviewed-by: James Simmons <jsimmons@infradead.org>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
---
 config/lustre-build-linux.m4 | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/config/lustre-build-linux.m4 b/config/lustre-build-linux.m4
index f3a224a98abc..21cf19f7d6f7 100644
--- a/config/lustre-build-linux.m4
+++ b/config/lustre-build-linux.m4
@@ -29,14 +29,23 @@ AC_CACHE_CHECK([for external module build target], lb_cv_module_target,
 		[$makerule LUSTRE_KERNEL_TEST=conftest.i],
 		[test -s build/conftest.i],
 		[lb_cv_module_target="M"], [
+	MODULE_TARGET="M"
+	makerule=""
+	LB_LINUX_TRY_MAKE([], [],
+		[$makerule LUSTRE_KERNEL_TEST=conftest.i],
+		[test -s build/conftest.i],
+		[lb_cv_module_target="M58"], [
 			AC_MSG_ERROR([kernel module make failed; check config.log for details])
-	])])])
+	])])])])
 ])
 AS_IF([test -z "$lb_cv_module_target"],
 	[AC_MSG_ERROR([unknown external module build target])],
 [test "x$lb_cv_module_target" = "xM54"],
 	[makerule="$PWD/build"
 	lb_cv_module_target="M"],
+[test "x$lb_cv_module_target" = "xM58"],
+	[makerule=""
+	lb_cv_module_target="M"],
 [test "x$lb_cv_module_target" = "xM"],
 	[makerule="_module_$PWD/build"])
 MODULE_TARGET=$lb_cv_module_target
-- 
2.41.0

openSUSE Build Service is sponsored by