[LU-1786] build failure on crc32-pclmul_asm Created: 27/Aug/12  Updated: 18/Apr/13  Resolved: 31/Aug/12

Status: Resolved
Project: Lustre
Component/s: None
Affects Version/s: Lustre 2.3.0
Fix Version/s: Lustre 2.3.0, Lustre 2.4.0

Type: Bug Priority: Blocker
Reporter: Gregoire Pichon Assignee: Minh Diep
Resolution: Fixed Votes: 0
Labels: None
Environment:

lustre version 2.2.93
x86_64 system
ARCH=x86_64


Severity: 3
Epic: build
Rank (Obsolete): 4471

 Description   

When building lustre (version tagged 2.2.93) on x86_64 system, with ARCH environment variable set to x86_64, it fails as described below.

# echo $ARCH
x86_64
# make rpms
...
make[2]: Entering directory `/home/build/lustre-release/libcfs'
 (cd libcfs && make  top_distdir=../../lustre-2.2.93 distdir=../../lustre-2.2.93/libcfs/libcfs \
     am__remove_distdir=: am__skip_length_check=: am__skip_mode_fix=: distdir)
make[3]: *** No rule to make target `crc32-pclmul_asm.c', needed by `distdir'.  Stop.

Maybe having ARCH environment variable set when building lustre is not standard, but anyway the makefiles should not rely on its value, or it should recompute it.

in libcfs/libcfs/Makefile.in

ifeq ($(ARCH),x86)
libcfs-linux-objs += linux-crypto-crc32pclmul.o
libcfs-pclmul-obj += crc32-pclmul_asm.o
endif
ifeq ($(ARCH),i386)
libcfs-linux-objs += linux-crypto-crc32pclmul.o
libcfs-pclmul-obj += crc32-pclmul_asm.o
endif
ifeq ($(ARCH),x86_64)
libcfs-linux-objs += linux-crypto-crc32pclmul.o
libcfs-pclmul-obj += crc32-pclmul_asm.o
endif

...

libcfs-all-objs := debug.o fail.o nidstrings.o lwt.o module.o tracefile.o \
                   watchdog.o libcfs_string.o hash.o kernel_user_comm.o \
                   prng.o workitem.o upcall_cache.o libcfs_cpu.o \
                   libcfs_mem.o libcfs_lock.o $(libcfs-pclmul-obj)

libcfs-objs := $(libcfs-linux-objs) $(libcfs-all-objs)

in libcfs/libcfs/autoMakefile.in

...
EXTRA_DIST := $(libcfs-all-objs:%.o=%.c) Info.plist tracefile.h prng.c \
              user-lock.c user-tcpip.c user-bitops.c user-prim.c workitem.c \
              user-mem.c kernel_user_comm.c fail.c libcfs_cpu.c \
              libcfs_mem.c libcfs_lock.c linux/linux-tracefile.h
...
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
...
distdir: $(DISTFILES)
...

When the directive "$(libcfs-all-objs:%.o=%.c)" is applied to crc32-pclmul_asm.o, it adds a dependency on crc32-pclmul_asm.c file which does not exist.

The problem does not appears when ARCH environment variable is not set because in that case libcfs-pclmul-obj is null.

So I propose to update libcfs/libcfs/Makefile and move libcfs-pclmul-obj from libcfs-all-objs to libcfs-objs.

libcfs-all-objs := debug.o fail.o nidstrings.o lwt.o module.o tracefile.o \
                   watchdog.o libcfs_string.o hash.o kernel_user_comm.o \
                   prng.o workitem.o upcall_cache.o libcfs_cpu.o \
                   libcfs_mem.o libcfs_lock.o

libcfs-objs := $(libcfs-linux-objs) $(libcfs-all-objs) $(libcfs-pclmul-obj)

Additionally, the ARCH variable should probably be replaced in libcfs/libcfs/Makefile.in.



 Comments   
Comment by Peter Jones [ 27/Aug/12 ]

Minh

Could you please look into this one?

Thanks

Peter

Comment by Alexander Boyko [ 28/Aug/12 ]

http://review.whamcloud.com/3801

Comment by James A Simmons [ 28/Aug/12 ]

Builds now. Any test besides sanity77 and running IOR with checksums enabled.

Comment by James A Simmons [ 28/Aug/12 ]

If this pans out we will need a patch for 2.3 branch as well before it closes.

Comment by Gregoire Pichon [ 29/Aug/12 ]

Alexander,
Do you plan to replace the ARCH variable in libcfs/libcfs/Makefile.in ?
This change does not appear in the patch #3801 you submitted.

Comment by Alexander Boyko [ 29/Aug/12 ]

No, I don`t plan this change. The ARCH is used at Makefile to check architecture and this variable came from Kbuild. The current issue happend for user mode build only, because kernel objects was put to user mode autoMakefile.

Comment by Gregoire Pichon [ 29/Aug/12 ]

What do you mean by "this variable [ARCH] came from Kbuild" ?

Comment by Alexander Boyko [ 30/Aug/12 ]

When lustre modules are building for kernel, Kbuild set ARCH and it is used at Makefile to detect current architecture.

Comment by James A Simmons [ 31/Aug/12 ]

Submitted patch for 2.3 branch as well at http://review.whamcloud.com/#change,3839

Comment by Peter Jones [ 31/Aug/12 ]

Landed for 2.3 and 2.4

Generated at Sat Feb 10 01:19:40 UTC 2024 using Jira 9.4.14#940014-sha1:734e6822bbf0d45eff9af51f82432957f73aa32c.