[LU-8322] Build issues with master (2.9), OFED 3.18-1, SLES 12 Created: 23/Jun/16  Updated: 01/Aug/16  Resolved: 01/Aug/16

Status: Closed
Project: Lustre
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Minor
Reporter: Chris Horn Assignee: WC Triage
Resolution: Duplicate Votes: 0
Labels: None

Issue Links:
Related
is related to LU-8401 modprobe: ERROR: could not insert 'ln... Resolved
Severity: 3
Rank (Obsolete): 9223372036854775807

 Description   

I'm unable to build today's master on SLES 12 against OFED 3.18.

The compilation error:

# sh ./autogen.sh; ./configure --disable-server --enable-client --enable-dlc --disable-manpages --with-o2ib=yes; make -j 4
<snip>
In file included from /home/build/builds/lnet/klnds/o2iblnd/o2iblnd.c:42:0:
/home/build/builds/lnet/klnds/o2iblnd/o2iblnd.h:767:19: error: redefinition of ‘ib_inc_rkey’
 static inline u32 ib_inc_rkey(u32 rkey)
                   ^
In file included from /usr/src/compat-rdma/include/rdma/ib_addr.h:47:0,
                 from /usr/src/compat-rdma/include/rdma/rdma_cm.h:39,
                 from /home/build/builds/lnet/klnds/o2iblnd/o2iblnd.h:74,
                 from /home/build/builds/lnet/klnds/o2iblnd/o2iblnd.c:42:
/usr/src/compat-rdma/include/rdma/ib_verbs.h:2483:19: note: previous definition of ‘ib_inc_rkey’ was here
 static inline u32 ib_inc_rkey(u32 rkey)

The config.log shows an error similar to LU-7042 which was fixed for 2.8.

configure:16582: checking if function 'ib_inc_rkey' is defined
configure:16618: cp conftest.c build && make -d modules LD=/usr/x86_64-suse-linux/bin/ld -m elf_x86_64 CC=gcc -f /home/build/builds/build/Makefile LUSTRE_LINUX_CONFIG=/lib/modules/3.12.28-4-default/build/.config LINUXINCLUDE= -include /usr/src/openib/include/linux/compat-2.6.h -I/usr/src/compat-rdma/include -I/lib/modules/3.12.28-4-default/source/arch/x86/include -Iinclude -Iarch/x86/include/generated -I/lib/modules/3.12.28-4-default/source/include -Iinclude2 -I/lib/modules/3.12.28-4-default/source/include/uapi -Iinclude/generated -I/lib/modules/3.12.28-4-default/source/arch/x86/include/uapi -Iarch/x86/include/generated/uapi -I/lib/modules/3.12.28-4-default/source/include/uapi -Iinclude/generated/uapi -include /lib/modules/3.12.28-4-default/source/include/linux/kconfig.h -o tmp_include_depends -o scripts -o include/config/MARKER -C /lib/modules/3.12.28-4-default/build EXTRA_CFLAGS=-Werror-implicit-function-declaration -Werror M=/home/build/builds/build
/home/build/builds/build/conftest.c:2:0: error: "PACKAGE_NAME" redefined [-Werror]
 #define PACKAGE_NAME "Lustre"
 ^
In file included from /usr/src/openib/include/linux/compat-2.6.h:7:0,
                 from <command-line>:0:
/usr/src/openib/include/linux/../../compat/config.h:398:0: note: this is the location of the previous definition
 #define PACKAGE_NAME "compat_ofa"
 ^
<etc>

I bisected this particular error to commit a0f7434 LU-8241 http://review.whamcloud.com/20644

If I undo that change I get another error:

iosr60-2:/home/build/builds # git diff a0f7434^..a0f7434 | patch -p1 -R
patching file config/lustre-build-linux.m4
patching file lnet/autoconf/lustre-lnet.m4
Hunk #1 succeeded at 253 (offset 7 lines).
Hunk #2 succeeded at 328 (offset 7 lines).
Hunk #3 succeeded at 337 (offset 7 lines).
Hunk #4 succeeded at 467 (offset 7 lines).
Hunk #5 succeeded at 656 (offset 7 lines).
iosr60-2:/home/build/builds # sh ./autogen.sh; ./configure --disable-server --enable-client --enable-dlc --disable-manpages --with-o2ib=yes; make -j 4
<snip>
/home/build/builds/lustre/llite/lloop.c: In function ‘loop_set_fd’:
/home/build/builds/lustre/llite/lloop.c:577:2: error: implicit declaration of function ‘blk_queue_max_phys_segments’ [-Werror=implicit-function-declaration]
  blk_queue_max_segments(lo->lo_queue, LLOOP_MAX_SEGMENTS);
  ^
/home/build/builds/lustre/llite/lloop.c:577:2: error: implicit declaration of function ‘blk_queue_max_hw_segments’ [-Werror=implicit-function-declaration]

The config.log shows the error I noted in LU-7527:

configure:18146: checking if 'blk_queue_max_segments' is defined
configure:18173: cp conftest.c build && make -d modules LD=/usr/x86_64-suse-linux/bin/ld -m elf_x86_64 CC=gcc -f /home/build/builds/build/Makefile LUSTRE_LINUX_CONFIG=/lib/modules/3.12.28-4-default/build/.config LINUXINCLUDE= -I/usr/src/compat-rdma/include -I/lib/modules/3.12.28-4-default/source/arch/x86/include -Iinclude -Iarch/x86/include/generated -I/lib/modules/3.12.28-4-default/source/include -Iinclude2 -I/lib/modules/3.12.28-4-default/source/include/uapi -Iinclude/generated -I/lib/modules/3.12.28-4-default/source/arch/x86/include/uapi -Iarch/x86/include/generated/uapi -I/lib/modules/3.12.28-4-default/source/include/uapi -Iinclude/generated/uapi -include /lib/modules/3.12.28-4-default/source/include/linux/kconfig.h -o tmp_include_depends -o scripts -o include/config/MARKER -C /lib/modules/3.12.28-4-default/build EXTRA_CFLAGS=-Werror-implicit-function-declaration -g -I/home/build/builds/libcfs/include -I/home/build/builds/lnet/include -I/home/build/builds/lustre/include M=/home/build/builds/build
In file included from /lib/modules/3.12.28-4-default/source/include/linux/device.h:29:0,
                 from /lib/modules/3.12.28-4-default/source/include/linux/genhd.h:62,
                 from /lib/modules/3.12.28-4-default/source/include/linux/blkdev.h:9,
                 from /home/build/builds/build/conftest.c:58:
/usr/src/compat-rdma/include/linux/kthread.h:23:8: error: redefinition of ‘struct kthread_worker’
 struct kthread_worker {
        ^
In file included from /usr/src/compat-rdma/include/linux/kthread.h:16:0,
                 from /lib/modules/3.12.28-4-default/source/include/linux/device.h:29,
                 from /lib/modules/3.12.28-4-default/source/include/linux/genhd.h:62,
                 from /lib/modules/3.12.28-4-default/source/include/linux/blkdev.h:9,
                 from /home/build/builds/build/conftest.c:58:
/lib/modules/3.12.28-4-default/source/include/linux/kthread.h:66:8: note: originally defined here
 struct kthread_worker {
        ^
<etc>

As noted in LU-7527 I can workaround this latter issue by adding the following to the autoconf tests that fail with the kthread_worker redefinition error:

+	#ifdef HAVE_COMPAT_RDMA
+	#undef PACKAGE_NAME
+	#undef PACKAGE_TARNAME
+	#undef PACKAGE_VERSION
+	#undef PACKAGE_STRING
+	#undef PACKAGE_BUGREPORT
+	#undef PACKAGE_URL
+	#include <linux/compat-2.6.h>
+	#endif


 Comments   
Comment by Chris Horn [ 07/Jul/16 ]

Okay, so about the PACKAGE_* redefines:

It looks to be the same issue as LU-7042. A lot of the OFED configure checks would be failing with this warning, except not all of them compile with -Werror (LN_CONFIG_IB_INC_RKEY is one that does have -Werror).

Comment by James A Simmons [ 07/Jul/16 ]

Does this mean removing "EXTRA_KCFLAGS="-Werror"" from the LN_CONFIG_IB_INC_RKEY fixed your build issue?

Comment by Chris Horn [ 08/Jul/16 ]

Yes, removing that line fixes this particular issue.

Comment by Chris Horn [ 08/Jul/16 ]

The "undef.h" header gets created later in the configure process and is included at the command line when we actually compile the modules. Can it be created sooner in the configure process so that it can be included at the command line when performing the compile tests? I do not know much about proper use of GNU autotools, so maybe there is a better solution here.

Comment by Chris Horn [ 01/Aug/16 ]

The patch from LU-8401 resolves this issue, so I'm resolving this ticket as a duplicate.

Generated at Sat Feb 10 02:16:32 UTC 2024 using Jira 9.4.14#940014-sha1:734e6822bbf0d45eff9af51f82432957f73aa32c.