opensvc / multipath-tools

Other
60 stars 48 forks source link

Build error "‘ELS_DTAG_LNK_INTEGRITY’ undeclared" on powerpc64le #61

Closed egorenar closed 1 year ago

egorenar commented 1 year ago

Hi,

i'm getting the following build error with buildroot + powerpc64le:

/home/egorenar/Documents/buildroot/powerpc64/host/bin/powerpc64le-buildroot-linux-gnu-gcc  -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -DBIN_DIR=\"/sbin\" -DMULTIPATH_DIR=\"/lib/multipath\" -DRUNTIME_DIR=\"/run\" -DCONFIG_DIR=\"/etc/multipath/conf.d\" -DEXTRAVERSION=\"\" -MMD -MP -I../libmultipath -I../libmpathutil -I../libmpathpersist -I../libmpathcmd -I../third-party -DURCU_VERSION=0x000d02 -DBINDIR='"/sbin"'  --std=gnu99 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64  -O1 -g0 -D_FORTIFY_SOURCE=1   -pipe -fPIE -DPIE -c -o waiter.o waiter.c
building dmevents.o because of dmevents.c
/home/egorenar/Documents/buildroot/powerpc64/host/bin/powerpc64le-buildroot-linux-gnu-gcc  -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -DBIN_DIR=\"/sbin\" -DMULTIPATH_DIR=\"/lib/multipath\" -DRUNTIME_DIR=\"/run\" -DCONFIG_DIR=\"/etc/multipath/conf.d\" -DEXTRAVERSION=\"\" -MMD -MP -I../libmultipath -I../libmpathutil -I../libmpathpersist -I../libmpathcmd -I../third-party -DURCU_VERSION=0x000d02 -DBINDIR='"/sbin"'  --std=gnu99 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64  -O1 -g0 -D_FORTIFY_SOURCE=1   -pipe -fPIE -DPIE -c -o dmevents.o dmevents.c
building init_unwinder.o because of init_unwinder.c
/home/egorenar/Documents/buildroot/powerpc64/host/bin/powerpc64le-buildroot-linux-gnu-gcc  -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -DBIN_DIR=\"/sbin\" -DMULTIPATH_DIR=\"/lib/multipath\" -DRUNTIME_DIR=\"/run\" -DCONFIG_DIR=\"/etc/multipath/conf.d\" -DEXTRAVERSION=\"\" -MMD -MP -I../libmultipath -I../libmpathutil -I../libmpathpersist -I../libmpathcmd -I../third-party -DURCU_VERSION=0x000d02 -DBINDIR='"/sbin"'  --std=gnu99 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64  -O1 -g0 -D_FORTIFY_SOURCE=1   -pipe -fPIE -DPIE -c -o init_unwinder.o init_unwinder.c
building fpin_handlers.o because of fpin_handlers.c
/home/egorenar/Documents/buildroot/powerpc64/host/bin/powerpc64le-buildroot-linux-gnu-gcc  -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -DBIN_DIR=\"/sbin\" -DMULTIPATH_DIR=\"/lib/multipath\" -DRUNTIME_DIR=\"/run\" -DCONFIG_DIR=\"/etc/multipath/conf.d\" -DEXTRAVERSION=\"\" -MMD -MP -I../libmultipath -I../libmpathutil -I../libmpathpersist -I../libmpathcmd -I../third-party -DURCU_VERSION=0x000d02 -DBINDIR='"/sbin"'  --std=gnu99 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64  -O1 -g0 -D_FORTIFY_SOURCE=1   -pipe -fPIE -DPIE -c -o fpin_handlers.o fpin_handlers.c
make[2]: Leaving directory '/home/egorenar/Documents/buildroot/powerpc64/build/multipath-tools-0.9.4/libmultipath/prioritizers'
/home/egorenar/Documents/buildroot/powerpc64/host/bin/powerpc64le-buildroot-linux-gnu-gcc  -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -DBIN_DIR=\"/sbin\" -DMULTIPATH_DIR=\"/lib/multipath\" -DRUNTIME_DIR=\"/run\" -DCONFIG_DIR=\"/etc/multipath/conf.d\" -DEXTRAVERSION=\"\" -MMD -MP -I../libmultipath -I../libmpathutil -I../libmpathpersist -I../libmpathcmd -I../third-party -DURCU_VERSION=0x000d02 -DBINDIR='"/sbin"'   --std=gnu99 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64  -O1 -g0 -D_FORTIFY_SOURCE=1   -pipe -fPIE -DPIE -Wno-unused-parameter -c -o multipathc.o multipathc.c
make[2]: Leaving directory '/home/egorenar/Documents/buildroot/powerpc64/build/multipath-tools-0.9.4/mpathpersist'
fpin_handlers.c:281:62: warning: ‘struct fc_tlv_desc’ declared inside parameter list will not be visible outside of this definition or declaration
  281 | fpin_parse_li_els_setpath_marginal(uint16_t host_num, struct fc_tlv_desc *tlv,
      |                                                              ^~~~~~~~~~~
In file included from ../libmultipath/byteorder.h:6,
                 from ../libmultipath/structs.h:10,
                 from fpin_handlers.c:12:
fpin_handlers.c: In function ‘fpin_parse_li_els_setpath_marginal’:
fpin_handlers.c:291:40: error: invalid use of undefined type ‘struct fc_fn_li_desc’
  291 |         wwn_count = be32_to_cpu(li_desc->pname_count);
      |                                        ^~
fpin_handlers.c:291:21: note: in expansion of macro ‘be32_to_cpu’
  291 |         wwn_count = be32_to_cpu(li_desc->pname_count);
      |                     ^~~~~~~~~~~
fpin_handlers.c:295:43: error: invalid use of undefined type ‘struct fc_fn_li_desc’
  295 |                 wwpn = be64_to_cpu(li_desc->pname_list[iter]);
      |                                           ^~
fpin_handlers.c:295:24: note: in expansion of macro ‘be64_to_cpu’
  295 |                 wwpn = be64_to_cpu(li_desc->pname_list[iter]);
      |                        ^~~~~~~~~~~
fpin_handlers.c: In function ‘fpin_process_els_frame’:
fpin_handlers.c:318:42: error: invalid use of undefined type ‘struct fc_els_fpin’
  318 |         tlv = (struct fc_tlv_desc *)&fpin->fpin_desc[0];
      |                                          ^~
fpin_handlers.c:324:62: warning: passing argument 2 of ‘fpin_parse_li_els_setpath_marginal’ from incompatible pointer type [-Wincompatible-pointer-types]
  324 |         count = fpin_parse_li_els_setpath_marginal(host_num, tlv, vecs);
      |                                                              ^~~
      |                                                              |
      |                                                              struct fc_tlv_desc *
fpin_handlers.c:281:75: note: expected ‘struct fc_tlv_desc *’ but argument is of type ‘struct fc_tlv_desc *’
  281 | fpin_parse_li_els_setpath_marginal(uint16_t host_num, struct fc_tlv_desc *tlv,
      |                                                       ~~~~~~~~~~~~~~~~~~~~^~~
fpin_handlers.c: In function ‘fpin_handle_els_frame’:
fpin_handlers.c:346:42: error: invalid use of undefined type ‘struct fc_els_fpin’
  346 |         tlv = (struct fc_tlv_desc *)&fpin->fpin_desc[0];
      |                                          ^~
In file included from ../libmultipath/byteorder.h:6,
                 from ../libmultipath/structs.h:10,
                 from fpin_handlers.c:12:
fpin_handlers.c:347:31: error: invalid use of undefined type ‘struct fc_tlv_desc’
  347 |         dtag = be32_to_cpu(tlv->desc_tag);
      |                               ^~
fpin_handlers.c:347:16: note: in expansion of macro ‘be32_to_cpu’
  347 |         dtag = be32_to_cpu(tlv->desc_tag);
      |                ^~~~~~~~~~~
In file included from fpin_handlers.c:15:
fpin_handlers.c:349:38: error: invalid use of undefined type ‘struct fc_els_fpin’
  349 |                         els_cmd, fpin->fpin_cmd, dtag);
      |                                      ^~
../libmpathutil/debug.h:30:47: note: in definition of macro ‘condlog’
   30 |                         dlog(__p, fmt "\n", ##args);                    \
      |                                               ^~~~
fpin_handlers.c:355:32: error: ‘ELS_FPIN’ undeclared (first use in this function); did you mean ‘ELS_FAN’?
  355 |                 if (els_cmd == ELS_FPIN) {
      |                                ^~~~~~~~
      |                                ELS_FAN
fpin_handlers.c:355:32: note: each undeclared identifier is reported only once for each function it appears in
fpin_handlers.c:360:37: error: ‘ELS_DTAG_LNK_INTEGRITY’ undeclared (first use in this function)
  360 |                         if (dtag == ELS_DTAG_LNK_INTEGRITY) {
      |                                     ^~~~~~~~~~~~~~~~~~~~~~
make[2]: *** [../Makefile.inc:116: fpin_handlers.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[2]: Leaving directory '/home/egorenar/Documents/buildroot/powerpc64/build/multipath-tools-0.9.4/multipathd'
make[1]: *** [Makefile:45: multipathd] Error 2
make[1]: Leaving directory '/home/egorenar/Documents/buildroot/powerpc64/build/multipath-tools-0.9.4'
make: *** [package/pkg-generic.mk:293: /home/egorenar/Documents/buildroot/powerpc64/build/multipath-tools-0.9.4/.stamp_built] Error 2

Linux kernel version: 4.4.305

Makefile says Checking for ELS_DTAG_LNK_INTEGRITY in /usr/include/scsi/fc/fc_els.h ... yes which indicates that it checks the host header not the target one.

Regards Alex

egorenar commented 1 year ago

Sorry, my fault, didn't notice the Makefile change 6b7d47be3b23 ("multipath-tools: Makefiles: simplify code for include dirs")

mwilck commented 1 year ago

Thanks for double-checking.