commit:     f30c216790959e23260ddb19c0b55e19f3f18c5b
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Tue Sep  7 00:19:48 2021 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Tue Sep  7 00:19:48 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f30c2167

dev-libs/libtommath: add sparc patch from upstream

Closes: https://bugs.gentoo.org/781938
See: https://github.com/libtom/libtommath/issues/509
Signed-off-by: Sam James <sam <AT> gentoo.org>

 .../libtommath/files/libtommath-1.2.0-sparc.patch  | 22 ++++++++++++++++++++++
 dev-libs/libtommath/libtommath-1.2.0.ebuild        |  4 ++++
 2 files changed, 26 insertions(+)

diff --git a/dev-libs/libtommath/files/libtommath-1.2.0-sparc.patch 
b/dev-libs/libtommath/files/libtommath-1.2.0-sparc.patch
new file mode 100644
index 00000000000..3ed8aedf398
--- /dev/null
+++ b/dev-libs/libtommath/files/libtommath-1.2.0-sparc.patch
@@ -0,0 +1,22 @@
+https://bugs.gentoo.org/781938
+https://github.com/libtom/libtommath/issues/509
+https://github.com/libtom/libtommath/pull/510 (didn't apply)
+https://github.com/tcltk/tcl/commit/dadb2c18d0b1b2bd26628aded323e9df4566d463
+
+From: "jan.nijtmans" <[email protected]>
+Date: Wed, 14 Jul 2021 15:54:56 +0000
+Subject: [PATCH] Fix build on Linux/Sparc with 32 bit userspace. See:
+ [https://github.com/libtom/libtommath/issues/509] for the upstream libtommath
+ fix
+
+--- a/tommath.h
++++ b/tommath.h
+@@ -45,7 +45,7 @@ extern "C" {
+     defined(__ia64) || defined(__ia64__) || defined(__itanium__) || 
defined(_M_IA64) || \
+     defined(__LP64__) || defined(_LP64) || defined(__64BIT__)
+ #   if !(defined(MP_64BIT) || defined(MP_32BIT) || defined(MP_16BIT) || 
defined(MP_8BIT))
+-#      if defined(__GNUC__) && !defined(__hppa)
++#      if defined(__GNUC__) && defined(__SIZEOF_INT128__) && !defined(__hppa)
+ /* we support 128bit integers only via: __attribute__((mode(TI))) */
+ #         define MP_64BIT
+ #      else

diff --git a/dev-libs/libtommath/libtommath-1.2.0.ebuild 
b/dev-libs/libtommath/libtommath-1.2.0.ebuild
index e65ded25c03..fd90c3f2981 100644
--- a/dev-libs/libtommath/libtommath-1.2.0.ebuild
+++ b/dev-libs/libtommath/libtommath-1.2.0.ebuild
@@ -16,6 +16,10 @@ IUSE="doc examples static-libs"
 
 BDEPEND="sys-devel/libtool"
 
+PATCHES=(
+       "${FILESDIR}"/${P}-sparc.patch
+)
+
 src_prepare() {
        default
 

Reply via email to