Package: gmp
Version: 4.1.4-10
Severity: wishlist
Tags: patch
The gmp package assumes that all arm platforms run the cpu in
little-endian mode, which is not true in general. The attached patch
adds support for big-endian arm platforms.
-- System Information:
Debian Release: 3.1
Architecture: armeb (armv5teb)
Kernel: Linux 2.6.13
Locale: LANG=C, LC_CTYPE=C (charmap=ANSI_X3.4-1968)
--- gmp-4.1.4/gmp-impl.h.orig 2005-08-07 22:38:22.000000000 +0200
+++ gmp-4.1.4/gmp-impl.h 2005-08-07 22:43:07.000000000 +0200
@@ -2476,7 +2476,7 @@
/* Define ieee_double_extract and _GMP_IEEE_FLOATS. */
-#if (defined (__arm__) && (defined (__ARMWEL__) || defined (__linux__)))
+#if (defined (__arm__) && !defined (__ARMEB__) && (defined (__ARMWEL__) || defined (__linux__)))
/* Special case for little endian ARM since floats remain in big-endian. */
#define _GMP_IEEE_FLOATS 1
union ieee_double_extract
@@ -2534,7 +2534,7 @@
#else
#if defined (_BIG_ENDIAN) || defined (__BIG_ENDIAN__) \
|| defined (__a29k__) || defined (_AM29K) \
- || defined (__arm__) \
+ || (defined (__arm__) && defined (__ARMEB__)) \
|| (defined (__convex__) && defined (_IEEE_FLOAT_)) \
|| defined (_CRAYMPP) || defined (_CRAYIEEE) \
|| defined (__i370__) || defined (__mvs__) \
--- gmp-4.1.4/mpfr/mpfr-math.h.orig 2005-08-07 22:39:01.000000000 +0200
+++ gmp-4.1.4/mpfr/mpfr-math.h 2005-08-07 22:41:43.000000000 +0200
@@ -19,7 +19,7 @@
the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
MA 02111-1307, USA. */
-#if (defined (__arm__) && (defined (__ARMWEL__) || defined (__linux__)))
+#if (defined (__arm__) && !defined (__ARMEB__) && (defined (__ARMWEL__) || defined (__linux__)))
/* little endian ARM */
#define _MPFR_NAN_BYTES { 0, 0, 0xf8, 0x7f, 0, 0, 0, 0 }
#define _MPFR_INFP_BYTES { 0, 0, 0x80, 0x7f }
@@ -28,7 +28,6 @@
#else
#if defined (_LITTLE_ENDIAN) || defined (__LITTLE_ENDIAN__) \
|| defined (__alpha) \
- || (defined (__arm__) && (defined (__ARMWEL__) || defined (__linux__)))\
|| defined (__clipper__) \
|| defined (__cris) \
|| defined (__i386__) \
@@ -47,7 +46,7 @@
|| defined (__mc68000__) || defined (__mc68020__) || defined (__m68k__)\
|| defined (mc68020) \
|| defined (__a29k__) || defined (_AM29K) \
- || defined (__arm__) \
+ || (defined (__arm__) && defined (__ARMEB__)) \
|| (defined (__convex__) && defined (_IEEE_FLOAT_)) \
|| defined (_CRAYMPP) || defined (_CRAYIEEE) \
|| defined (__i370__) || defined (__mvs__) \