libgcrypt: upgraded package to upstream

Upgraded dev-libs/libgcrypt to version 1.5.4-r1 on amd64, arm, x86

BUG=None
TEST=build with gcc/clang for daisy, build with gcc for lumpy/x86-zgb, build with gcc for host

Change-Id: Ife8f677d3764d7d7a9aaef16e7b4c830096f11a1
Reviewed-on: https://chromium-review.googlesource.com/284630
Reviewed-by: Mike Frysinger <vapier@chromium.org>
Commit-Queue: Han Shen <shenhan@chromium.org>
Tested-by: Han Shen <shenhan@chromium.org>
diff --git a/dev-libs/libgcrypt/files/libgcrypt-1.5.4-clang-arm.patch b/dev-libs/libgcrypt/files/libgcrypt-1.5.4-clang-arm.patch
new file mode 100644
index 0000000..ab5d844
--- /dev/null
+++ b/dev-libs/libgcrypt/files/libgcrypt-1.5.4-clang-arm.patch
@@ -0,0 +1,84 @@
+fix from upstream
+
+From e67c67321ce240c93dd0fa2b21c649c0a8e233f7 Mon Sep 17 00:00:00 2001
+From: Jussi Kivilinna <jussi.kivilinna@iki.fi>
+Date: Tue, 22 Oct 2013 17:07:53 +0300
+Subject: [PATCH] mpi: allow building with clang on ARM
+
+* mpi/longlong.h [__arm__] (add_ssaaaa, sub_ddmmss, umul_ppmm)
+(count_leading_zeros): Do not cast assembly output arguments.
+[__arm__] (umul_ppmm): Remove the extra '%' ahead of assembly comment.
+[_ARM_ARCH >= 4] (umul_ppmm): Use correct inputs and outputs instead of
+registers.
+--
+
+Signed-off-by: Jussi Kivilinna <jussi.kivilinna@iki.fi>
+---
+ mpi/longlong.h | 27 +++++++++++++--------------
+ 1 file changed, 13 insertions(+), 14 deletions(-)
+
+diff --git a/mpi/longlong.h b/mpi/longlong.h
+index c2ab9c5..8c8260e 100644
+--- a/mpi/longlong.h
++++ b/mpi/longlong.h
+@@ -188,8 +188,8 @@ extern UDItype __udiv_qrnnd ();
+ #define add_ssaaaa(sh, sl, ah, al, bh, bl) \
+   __asm__ ("adds %1, %4, %5\n"                                          \
+ 	   "adc  %0, %2, %3"                                            \
+-	   : "=r" ((USItype)(sh)),                                      \
+-	     "=&r" ((USItype)(sl))                                      \
++	   : "=r" ((sh)),                                               \
++	     "=&r" ((sl))                                               \
+ 	   : "%r" ((USItype)(ah)),                                      \
+ 	     "rI" ((USItype)(bh)),                                      \
+ 	     "%r" ((USItype)(al)),                                      \
+@@ -197,15 +197,15 @@ extern UDItype __udiv_qrnnd ();
+ #define sub_ddmmss(sh, sl, ah, al, bh, bl) \
+   __asm__ ("subs %1, %4, %5\n"                                          \
+ 	   "sbc  %0, %2, %3"                                            \
+-	   : "=r" ((USItype)(sh)),                                      \
+-	     "=&r" ((USItype)(sl))                                      \
++	   : "=r" ((sh)),                                               \
++	     "=&r" ((sl))                                               \
+ 	   : "r" ((USItype)(ah)),                                       \
+ 	     "rI" ((USItype)(bh)),                                      \
+ 	     "r" ((USItype)(al)),                                       \
+ 	     "rI" ((USItype)(bl)))
+ #if defined __ARM_ARCH_2__ || defined __ARM_ARCH_3__
+ #define umul_ppmm(xh, xl, a, b) \
+-  __asm__ ("%@ Inlined umul_ppmm\n"                                     \
++  __asm__ ("@ Inlined umul_ppmm\n"                                      \
+ 	"mov	%|r0, %2, lsr #16		@ AAAA\n"               \
+ 	"mov	%|r2, %3, lsr #16		@ BBBB\n"               \
+ 	"bic	%|r1, %2, %|r0, lsl #16		@ aaaa\n"               \
+@@ -218,20 +218,19 @@ extern UDItype __udiv_qrnnd ();
+ 	"addcs	%|r2, %|r2, #65536\n"                                   \
+ 	"adds	%1, %|r1, %|r0, lsl #16\n"                              \
+ 	"adc	%0, %|r2, %|r0, lsr #16"                                \
+-	   : "=&r" ((USItype)(xh)),                                     \
+-	     "=r" ((USItype)(xl))                                       \
++	   : "=&r" ((xh)),                                              \
++	     "=r" ((xl))                                                \
+ 	   : "r" ((USItype)(a)),                                        \
+ 	     "r" ((USItype)(b))                                         \
+ 	   : "r0", "r1", "r2")
+ #else
+ #define umul_ppmm(xh, xl, a, b)                                         \
+-  __asm__ ("%@ Inlined umul_ppmm\n"                                     \
+-	   "umull %r1, %r0, %r2, %r3"                                   \
+-		   : "=&r" ((USItype)(xh)),                             \
+-		     "=r" ((USItype)(xl))                               \
++  __asm__ ("@ Inlined umul_ppmm\n"                                      \
++	   "umull %1, %0, %2, %3"                                       \
++		   : "=&r" ((xh)),                                      \
++		     "=r" ((xl))                                        \
+ 		   : "r" ((USItype)(a)),                                \
+-		     "r" ((USItype)(b))                                 \
+-		   : "r0", "r1")
++		     "r" ((USItype)(b)))
+ #endif
+ #define UMUL_TIME 20
+ #define UDIV_TIME 100
+-- 
+2.4.4
+
diff --git a/dev-libs/libgcrypt/libgcrypt-1.5.4.ebuild b/dev-libs/libgcrypt/libgcrypt-1.5.4-r1.ebuild
similarity index 71%
rename from dev-libs/libgcrypt/libgcrypt-1.5.4.ebuild
rename to dev-libs/libgcrypt/libgcrypt-1.5.4-r1.ebuild
index 67500f6..249ce1e 100644
--- a/dev-libs/libgcrypt/libgcrypt-1.5.4.ebuild
+++ b/dev-libs/libgcrypt/libgcrypt-1.5.4-r1.ebuild
@@ -1,11 +1,11 @@
-# Copyright 1999-2014 Gentoo Foundation
+# Copyright 1999-2015 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/dev-libs/libgcrypt/libgcrypt-1.5.4.ebuild,v 1.11 2014/08/24 09:02:47 ago Exp $
+# $Header: /var/cvsroot/gentoo-x86/dev-libs/libgcrypt/libgcrypt-1.5.4-r1.ebuild,v 1.9 2015/07/08 07:53:59 vapier Exp $
 
 EAPI=5
 AUTOTOOLS_AUTORECONF=1
 
-inherit autotools-utils
+inherit autotools-multilib
 
 DESCRIPTION="General purpose crypto library based on the code used in GnuPG"
 HOMEPAGE="http://www.gnupg.org/"
@@ -16,7 +16,12 @@
 KEYWORDS="*"
 IUSE="static-libs"
 
-RDEPEND=">=dev-libs/libgpg-error-1.8"
+RDEPEND=">=dev-libs/libgpg-error-1.12[${MULTILIB_USEDEP}]
+	!dev-libs/libgcrypt:11
+	abi_x86_32? (
+		!<=app-emulation/emul-linux-x86-baselibs-20131008-r19
+		!app-emulation/emul-linux-x86-baselibs[-abi_x86_32]
+	)"
 DEPEND="${RDEPEND}"
 
 DOCS=( AUTHORS ChangeLog NEWS README THANKS TODO )
@@ -24,6 +29,11 @@
 PATCHES=(
 	"${FILESDIR}"/${PN}-1.5.0-uscore.patch
 	"${FILESDIR}"/${PN}-multilib-syspath.patch
+	"${FILESDIR}"/${P}-clang-arm.patch
+)
+
+MULTILIB_CHOST_TOOLS=(
+	/usr/bin/libgcrypt-config
 )
 
 src_configure() {
@@ -43,5 +53,5 @@
 		$([[ ${CHOST} == *86*-darwin* ]] && echo "--disable-asm")
 		$([[ ${CHOST} == sparcv9-*-solaris* ]] && echo "--disable-asm")
 	)
-	autotools-utils_src_configure
+	autotools-multilib_src_configure
 }
diff --git a/metadata/md5-cache/dev-libs/libgcrypt-1.5.4 b/metadata/md5-cache/dev-libs/libgcrypt-1.5.4
deleted file mode 100644
index dd58b99..0000000
--- a/metadata/md5-cache/dev-libs/libgcrypt-1.5.4
+++ /dev/null
@@ -1,13 +0,0 @@
-DEFINED_PHASES=compile configure install prepare test
-DEPEND=>=dev-libs/libgpg-error-1.8 !<sys-devel/gettext-0.18.1.1-r3 || ( >=sys-devel/automake-1.13:1.13 >=sys-devel/automake-1.15:1.15 ) >=sys-devel/autoconf-2.69 >=sys-devel/libtool-2.4
-DESCRIPTION=General purpose crypto library based on the code used in GnuPG
-EAPI=5
-HOMEPAGE=http://www.gnupg.org/
-IUSE=static-libs
-KEYWORDS=*
-LICENSE=LGPL-2.1 MIT
-RDEPEND=>=dev-libs/libgpg-error-1.8
-SLOT=0/11
-SRC_URI=mirror://gnupg/libgcrypt/libgcrypt-1.5.4.tar.bz2
-_eclasses_=autotools	999c8f6cf5d91495cb0779588f20716c	autotools-utils	3727db64c7b960903d5033280f108080	eutils	06133990e861be0fe60c2b428fd025d9	libtool	52d0e17251d04645ffaa61bfdd858944	multilib	3bf24e6abb9b76d9f6c20600f0b716bf	toolchain-funcs	48b38a216afb92db6314d6c3187abea3
-_md5_=15eae39447062547872544c8a96c1f63
diff --git a/metadata/md5-cache/dev-libs/libgcrypt-1.5.4-r1 b/metadata/md5-cache/dev-libs/libgcrypt-1.5.4-r1
new file mode 100644
index 0000000..eed7b0d
--- /dev/null
+++ b/metadata/md5-cache/dev-libs/libgcrypt-1.5.4-r1
@@ -0,0 +1,13 @@
+DEFINED_PHASES=compile configure install prepare test
+DEPEND=>=dev-libs/libgpg-error-1.12[abi_x86_32(-)?,abi_x86_64(-)?,abi_x86_x32(-)?,abi_mips_n32(-)?,abi_mips_n64(-)?,abi_mips_o32(-)?,abi_ppc_32(-)?,abi_ppc_64(-)?,abi_s390_32(-)?,abi_s390_64(-)?] !dev-libs/libgcrypt:11 abi_x86_32? ( !<=app-emulation/emul-linux-x86-baselibs-20131008-r19 !app-emulation/emul-linux-x86-baselibs[-abi_x86_32] ) !<sys-devel/gettext-0.18.1.1-r3 || ( >=sys-devel/automake-1.13:1.13 >=sys-devel/automake-1.15:1.15 ) >=sys-devel/autoconf-2.69 >=sys-devel/libtool-2.4
+DESCRIPTION=General purpose crypto library based on the code used in GnuPG
+EAPI=5
+HOMEPAGE=http://www.gnupg.org/
+IUSE=static-libs abi_x86_32 abi_x86_64 abi_x86_x32 abi_mips_n32 abi_mips_n64 abi_mips_o32 abi_ppc_32 abi_ppc_64 abi_s390_32 abi_s390_64
+KEYWORDS=*
+LICENSE=LGPL-2.1 MIT
+RDEPEND=>=dev-libs/libgpg-error-1.12[abi_x86_32(-)?,abi_x86_64(-)?,abi_x86_x32(-)?,abi_mips_n32(-)?,abi_mips_n64(-)?,abi_mips_o32(-)?,abi_ppc_32(-)?,abi_ppc_64(-)?,abi_s390_32(-)?,abi_s390_64(-)?] !dev-libs/libgcrypt:11 abi_x86_32? ( !<=app-emulation/emul-linux-x86-baselibs-20131008-r19 !app-emulation/emul-linux-x86-baselibs[-abi_x86_32] )
+SLOT=0/11
+SRC_URI=mirror://gnupg/libgcrypt/libgcrypt-1.5.4.tar.bz2
+_eclasses_=autotools	999c8f6cf5d91495cb0779588f20716c	autotools-multilib	037c4046d25f29e78dd44dccabd5d66b	autotools-utils	3727db64c7b960903d5033280f108080	eutils	06133990e861be0fe60c2b428fd025d9	libtool	52d0e17251d04645ffaa61bfdd858944	multibuild	6d4858dc00f8bc51caf3f957f8430eb0	multilib	3bf24e6abb9b76d9f6c20600f0b716bf	multilib-build	0983c7893df461213a05f791cc7dea6d	multilib-minimal	13dd976916c35a1e2c8d170e840c7018	toolchain-funcs	48b38a216afb92db6314d6c3187abea3
+_md5_=23993185aaed57b5b343c68c65b80310