From: Oleg Drokin Date: Mon, 9 Jul 2012 18:26:12 +0000 (-0400) Subject: LU-1461 libcfs: Fix crypto not to use x86 pcmul for non x86 arch X-Git-Tag: 2.2.92~2 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=67c05929725d99a001ae0036e5f4ae25b01bf938 LU-1461 libcfs: Fix crypto not to use x86 pcmul for non x86 arch 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 Change-Id: Icb229a9db0826420ecc431bc7f7f5e45ecbdbd37 Reviewed-on: http://review.whamcloud.com/3361 Reviewed-by: Andreas Dilger Tested-by: Hudson Tested-by: Maloo --- diff --git a/build/autoconf/lustre-build.m4 b/build/autoconf/lustre-build.m4 index 98bc950..1e30341 100644 --- a/build/autoconf/lustre-build.m4 +++ b/build/autoconf/lustre-build.m4 @@ -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(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 diff --git a/libcfs/include/libcfs/user-crypto.h b/libcfs/include/libcfs/user-crypto.h index 9f928e6..dbf2117 100644 --- a/libcfs/include/libcfs/user-crypto.h +++ b/libcfs/include/libcfs/user-crypto.h @@ -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))); @@ -33,3 +34,4 @@ unsigned int crc32_pclmul_le(unsigned int crc, unsigned char const *p, size_t len); int crc32_pclmul_init(void); +#endif