From c4daf833ffc5203ce22b67bebdd9fce4eae5baac Mon Sep 17 00:00:00 2001 From: Shaun Tancheff Date: Fri, 25 Oct 2019 08:10:59 -0500 Subject: [PATCH] LU-12904 build: External _module_ decorator removed As of 5.4 the _module_ decorator prefix is not used for external kernel modules. This breaks building kernel modules for 5.4. Prior kernels still require the _module_ decorator. Add a configure check to test for and handle _module_ decorator is used. Linux-commit: d7b0827f28ab3a4fd65864451ffefa695e3255fd Test-Parameters: trivial Cray-bug-id: LUS-8042 Signed-off-by: Shaun Tancheff Change-Id: I4359452cea8e32a31234b9becc2ed319954c55a4 Reviewed-on: https://review.whamcloud.com/36576 Tested-by: jenkins Tested-by: Maloo Reviewed-by: Petros Koutoupis Reviewed-by: James Simmons Reviewed-by: Oleg Drokin --- config/lustre-build-linux.m4 | 43 ++++++++++++++++++++++++++----------------- 1 file changed, 26 insertions(+), 17 deletions(-) diff --git a/config/lustre-build-linux.m4 b/config/lustre-build-linux.m4 index 2f3db74..8ce66b8 100644 --- a/config/lustre-build-linux.m4 +++ b/config/lustre-build-linux.m4 @@ -8,26 +8,35 @@ KMODEXT=".ko" AC_SUBST(KMODEXT) makerule="$PWD/build" -AC_CACHE_CHECK([for external module build target], lb_cv_module_target, [ -lb_cv_module_target="" -MODULE_TARGET="SUBDIRS" -rm -f build/conftest.i -LB_LINUX_TRY_MAKE([], [], - [$makerule LUSTRE_KERNEL_TEST=conftest.i], - [test -s build/conftest.i], - [lb_cv_module_target="SUBDIRS"], [ - MODULE_TARGET="M" - makerule="_module_$PWD/build" - LB_LINUX_TRY_MAKE([], [], - [$makerule LUSTRE_KERNEL_TEST=conftest.i], - [test -s build/conftest.i], - [lb_cv_module_target="M"], [ - AC_MSG_ERROR([unknown; check config.log for details]) - ]) - ]) +AC_CACHE_CHECK([for external module build target], lb_cv_module_target, +[ + lb_cv_module_target="" + MODULE_TARGET="SUBDIRS" + rm -f build/conftest.i + LB_LINUX_TRY_MAKE([], [], + [$makerule LUSTRE_KERNEL_TEST=conftest.i], + [test -s build/conftest.i], + [lb_cv_module_target="SUBDIRS"],[ + MODULE_TARGET="M" + makerule="$PWD/build/" + LB_LINUX_TRY_MAKE([], [], + [$makerule LUSTRE_KERNEL_TEST=conftest.i], + [test -s build/conftest.i], + [lb_cv_module_target="M54"], [ + MODULE_TARGET="M" + makerule="_module_$PWD/build" + LB_LINUX_TRY_MAKE([], [], + [$makerule LUSTRE_KERNEL_TEST=conftest.i], + [test -s build/conftest.i], + [lb_cv_module_target="M"], [ + 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" = "xM"], [makerule="_module_$PWD/build"]) MODULE_TARGET=$lb_cv_module_target -- 1.8.3.1