Whamcloud - gitweb
LU-16662 autoconf: fix configure test compile for CONFIG_KEYS 99/50399/3
authorXinliang Liu <xinliang.liu@linaro.org>
Fri, 24 Mar 2023 07:16:10 +0000 (07:16 +0000)
committerOleg Drokin <green@whamcloud.com>
Tue, 4 Apr 2023 14:38:52 +0000 (14:38 +0000)
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 <xinliang.liu@linaro.org>
Reviewed-on: https://review.whamcloud.com/c/fs/lustre-release/+/50399
Reviewed-by: Shaun Tancheff <shaun.tancheff@hpe.com>
Reviewed-by: James Simmons <jsimmons@infradead.org>
Reviewed-by: Oleg Drokin <green@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
Tested-by: jenkins <devops@whamcloud.com>
lnet/autoconf/lustre-lnet.m4

index c38fd1b..b54603b 100644 (file)
@@ -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