From 99d71fdba3f28d2d4f5bce4eeec2925295b5db63 Mon Sep 17 00:00:00 2001 From: Than Ngo Date: Mar 09 2016 14:53:57 +0000 Subject: fix endian issues on s390x/ppc64 --- diff --git a/libtomcrypt-big-endian.patch b/libtomcrypt-big-endian.patch new file mode 100644 index 0000000..aa93743 --- /dev/null +++ b/libtomcrypt-big-endian.patch @@ -0,0 +1,38 @@ +diff -up libtomcrypt-912eff4949f46c0b426d2180429a6fa4c1144f1d/src/headers/tomcrypt_cfg.h.than libtomcrypt-912eff4949f46c0b426d2180429a6fa4c1144f1d/src/headers/tomcrypt_cfg.h +--- libtomcrypt-912eff4949f46c0b426d2180429a6fa4c1144f1d/src/headers/tomcrypt_cfg.h.than 2016-01-23 13:11:30.000000000 -0500 ++++ libtomcrypt-912eff4949f46c0b426d2180429a6fa4c1144f1d/src/headers/tomcrypt_cfg.h 2016-03-09 09:30:52.655998598 -0500 +@@ -55,6 +55,25 @@ LTC_EXPORT int LTC_CALL XSTRCMP(const + * use the portable [slower] macros. + */ + ++#if defined(__powerpc64__) ++#define ENDIAN_64BITWORD ++#if __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__ ++#define ENDIAN_BIG ++#else ++#define ENDIAN_LITTLE ++#endif ++#endif ++ ++#if defined(__s390x__) ++#define ENDIAN_64BITWORD ++#define ENDIAN_BIG ++#endif ++ ++#if defined(__s390__) ++#define ENDIAN_32BITWORD ++#define ENDIAN_BIG ++#endif ++ + /* detect x86-32 machines somewhat */ + #if !defined(__STRICT_ANSI__) && !defined(__x86_64__) && !defined(_WIN64) && ((defined(_MSC_VER) && defined(WIN32)) || (defined(__GNUC__) && (defined(__DJGPP__) || defined(__CYGWIN__) || defined(__MINGW32__) || defined(__i386__)))) + #define ENDIAN_LITTLE +@@ -94,7 +113,7 @@ LTC_EXPORT int LTC_CALL XSTRCMP(const + /* this is the "32-bit at least" data type + * Re-define it to suit your platform but it must be at least 32-bits + */ +-#if defined(__x86_64__) || (defined(__sparc__) && defined(__arch64__)) ++#if defined(__x86_64__) || defined(__powerpc64__) || defined(__s390x__) || (defined(__sparc__) && defined(__arch64__)) + typedef unsigned ulong32; + #else + typedef unsigned long ulong32; diff --git a/libtomcrypt.spec b/libtomcrypt.spec index bfe7ccf..14a5153 100644 --- a/libtomcrypt.spec +++ b/libtomcrypt.spec @@ -3,12 +3,13 @@ Name: libtomcrypt Version: 1.17 -Release: 28%{?dist} +Release: 29%{?dist} Summary: A comprehensive, portable cryptographic toolkit License: Public Domain URL: http://www.libtom.org/ Source0: https://github.com/libtom/%{name}/archive/%{commit0}/%{name}-%{commit0}.tar.gz#/%{name}-%{shortcommit0}.tar.gz +Patch0: libtomcrypt-big-endian.patch BuildRequires: ghostscript BuildRequires: libtommath-devel >= 1.0 @@ -55,6 +56,8 @@ The %{name}-doc package contains documentation for use with %{name}. %prep %setup -qn %{name}-%{commit0} +%patch0 -p1 -b .endian + # Be verbose when calling latex so we can see what's breaking sed -i -e 's|> /dev/null||g' makefile # Latex syntax update @@ -115,6 +118,9 @@ find %{buildroot} -name '*.h' -exec chmod 644 {} \; %doc doc/crypt.pdf %changelog +* Wed Mar 09 2016 Than Ngo - 1.17-29 +- fix endian issues on s390x/ppc64 + * Tue Feb 23 2016 Simone Caronni - 1.17-28 - Fix shared object name: https://github.com/libtom/libtomcrypt/commit/14272976d0615b546e9e0215ec4e2f01854a2dc9