Whamcloud - gitweb
LU-1461 libcfs: Fix crypto not to use x86 pcmul for non x86 arch
authorOleg Drokin <green@whamcloud.com>
Mon, 9 Jul 2012 18:26:12 +0000 (14:26 -0400)
committerOleg Drokin <green@whamcloud.com>
Sat, 28 Jul 2012 16:19:08 +0000 (12:19 -0400)
Also fix x86 detection in configure.

This fixes a build failure on ppc64:

In file included from user-crypto.c:34:
/var/lib/jenkins/workspace/lustre-ppc-builder/arch/ppc64/
build_type/client/distro/el6/ib_stack/inkernel/BUILD/BUILD/
lustre-2.2.60/libcfs/include/libcfs/user-crypto.h:30:
error: 'regparm' attribute directive ignored

Signed-off-by: Oleg Drokin <green@whamcloud.com>
Change-Id: Icb229a9db0826420ecc431bc7f7f5e45ecbdbd37
Reviewed-on: http://review.whamcloud.com/3361
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Tested-by: Hudson
Tested-by: Maloo <whamcloud.maloo@gmail.com>
build/autoconf/lustre-build.m4
libcfs/include/libcfs/user-crypto.h

index 98bc950..1e30341 100644 (file)
@@ -700,7 +700,7 @@ AM_CONDITIONAL(LINUX, test x$lb_target_os = "xlinux")
 AM_CONDITIONAL(DARWIN, test x$lb_target_os = "xdarwin")
 AM_CONDITIONAL(SUNOS, test x$lb_target_os = "xSunOS")
 AM_CONDITIONAL(USES_DPKG, test x$uses_dpkg = "xyes")
 AM_CONDITIONAL(DARWIN, test x$lb_target_os = "xdarwin")
 AM_CONDITIONAL(SUNOS, test x$lb_target_os = "xSunOS")
 AM_CONDITIONAL(USES_DPKG, test x$uses_dpkg = "xyes")
-AM_CONDITIONAL(ARCH_x86, test x$target_cpu != "xpowerpc")
+AM_CONDITIONAL(ARCH_x86, test x$target_cpu = "xx86_64" -o x$target_cpu = "xi686")
 
 # this lets lustre cancel libsysio, per-branch or if liblustre is
 # disabled
 
 # this lets lustre cancel libsysio, per-branch or if liblustre is
 # disabled
index 9f928e6..dbf2117 100644 (file)
@@ -26,6 +26,7 @@
  *
  */
 
  *
  */
 
+#if (defined i386) || (defined __amd64__)
 unsigned int crc32_pclmul_le_16(unsigned char const *buffer, size_t len,
                                unsigned int crc32) __attribute__((regparm(3)));
 
 unsigned int crc32_pclmul_le_16(unsigned char const *buffer, size_t len,
                                unsigned int crc32) __attribute__((regparm(3)));
 
@@ -33,3 +34,4 @@ unsigned int crc32_pclmul_le(unsigned int crc, unsigned char const *p,
                             size_t len);
 
 int crc32_pclmul_init(void);
                             size_t len);
 
 int crc32_pclmul_init(void);
+#endif