From: Xinliang Liu Date: Fri, 24 Mar 2023 07:16:10 +0000 (+0000) Subject: LU-16662 autoconf: fix configure test compile for CONFIG_KEYS X-Git-Tag: 2.15.55~5 X-Git-Url: https://git.whamcloud.com/gitweb?a=commitdiff_plain;h=321a533b868908f37d01a4b787f5a463a02e427c;p=fs%2Flustre-release.git LU-16662 autoconf: fix configure test compile for CONFIG_KEYS This fixes below configure error on Linux v5.19+: $ ./configure --disable-server ... checking whether to enable gss keyring backend... yes checking if Linux kernel was built with CONFIG_KEYS in or as module... no configure: WARNING: GSS keyring backend requires that CONFIG_KEYS be enabled in your kernel. checking for keyctl_search in -lkeyutils... yes configure: error: Cannot enable gss_keyring. See above for details. $ grep CONFIG_KEYS -rn /boot/config-* 6884:CONFIG_KEYS=y For in-tree IB support and without passing Linux src path when run ./configure, the LINUX_OBJ maybe just a soft link to O2IBPATH, they are pointing to the same dir. E.g.: O2IBPATH='/usr/src/kernels/6.1.8-3.0.0.7.oe1.aarch64' LINUX_OBJ='/lib/modules/6.1.8-3.0.0.7.oe1.aarch64/build' $ ls -l /lib/modules/6.1.8-3.0.0.7.oe1.aarch64/build lrwxrwxrwx 1 root root 42 Feb 7 00:00 /lib/modules/6.1.8-3.0.0.7.oe1.aarch64/build -> /usr/src/kernels/6.1.8-3.0.0.7.oe1.aarch64 In this case, current configure will put kernel's Module.symvers to variable KBUILD_EXTRA_SYMBOLS. This should be avoided after kernel v5.19 which contains commit "b8422711080f modpost: make multiple export error". This making multiple export symbol as an error from a warning which can be seen in the config.log: ... ERROR: modpost: vmlinux: 'init_uts_ns' exported twice. Previous export was in vmlinux ... Test-Parameters: trivial Change-Id: I35295b3acc7fffb93716362f5d8c659eb922afcb Signed-off-by: Xinliang Liu Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/50399 Reviewed-by: Shaun Tancheff Reviewed-by: James Simmons Reviewed-by: Oleg Drokin Tested-by: Maloo Tested-by: jenkins --- diff --git a/lnet/autoconf/lustre-lnet.m4 b/lnet/autoconf/lustre-lnet.m4 index c38fd1b..b54603b 100644 --- a/lnet/autoconf/lustre-lnet.m4 +++ b/lnet/autoconf/lustre-lnet.m4 @@ -245,7 +245,7 @@ AS_IF([test $ENABLEO2IB = "no"], [ O2IB_SYMVER=$LINUX_OBJ/Module.symvers fi if test -n "$O2IB_SYMVER"; then - if test "$O2IB_SYMVER" != "$LINUX_OBJ/Module.symvers"; then + if test !"$O2IB_SYMVER" -ef "$LINUX_OBJ/Module.symvers"; then AC_MSG_NOTICE([adding $O2IB_SYMVER to Symbol Path O2IB]) EXTRA_SYMBOLS="$EXTRA_SYMBOLS $O2IB_SYMVER" AC_SUBST(EXTRA_SYMBOLS) @@ -286,7 +286,7 @@ AC_SUBST(ENABLEO2IB) AS_IF([test $ENABLEO2IB != "no"], [ EXTRA_CHECK_INCLUDE="$EXTRA_OFED_CONFIG $EXTRA_OFED_INCLUDE" - if test $O2IBPATH != $LINUX_OBJ; then + if test ! $O2IBPATH -ef $LINUX_OBJ; then KBUILD_EXTRA_SYMBOLS="$KBUILD_EXTRA_SYMBOLS $O2IBPATH/Module.symvers" fi