Package: libnspr4-dev
Version: 2:4.10.4-1
Severity: normal
Tags: patch

Dear Maintainer,

I've noticed some defines aren't well set for powerpc64le (aka ppc64el) in linux config file (include/md/_linux.cfg). There is an assumption that powerpc64 is big endian, so defines are set in this way (for example IS_BIG_ENDIAN is defined). This assumption could lead to compiling error on ppc64el arch which is powperpc64 and little endian. To prevent errors, I've added a test to check for powerpc64 to verify the endianness (little or big).

Hope it helps.

-- System Information:
Debian Release: jessie/sid
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: ppc64el (ppc64le)

Kernel: Linux 3.13-1-powerpc64le (SMP w/1 CPU core)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages libnspr4-dev depends on:
ii  libnspr4  2:4.10.4-1

libnspr4-dev recommends no packages.

libnspr4-dev suggests no packages.

-- no debconf information

--- a/nspr/pr/include/md/_linux.cfg
+++ b/nspr/pr/include/md/_linux.cfg
@@ -28,10 +28,56 @@
 #endif
 
 #ifdef __powerpc64__
+#define IS_64
+#ifdef _LITTLE_ENDIAN
+
+#define IS_LITTLE_ENDIAN 1
+#undef  IS_BIG_ENDIAN
+
+#define PR_BYTES_PER_BYTE   1
+#define PR_BYTES_PER_SHORT  2
+#define PR_BYTES_PER_INT    4
+#define PR_BYTES_PER_INT64  8
+#define PR_BYTES_PER_LONG   8
+#define PR_BYTES_PER_FLOAT  4
+#define PR_BYTES_PER_DOUBLE 8
+#define PR_BYTES_PER_WORD   8
+#define PR_BYTES_PER_DWORD  8
+
+#define PR_BITS_PER_BYTE    8
+#define PR_BITS_PER_SHORT   16
+#define PR_BITS_PER_INT     32
+#define PR_BITS_PER_INT64   64
+#define PR_BITS_PER_LONG    64
+#define PR_BITS_PER_FLOAT   32
+#define PR_BITS_PER_DOUBLE  64
+#define PR_BITS_PER_WORD    64
+
+#define PR_BITS_PER_BYTE_LOG2   3
+#define PR_BITS_PER_SHORT_LOG2  4
+#define PR_BITS_PER_INT_LOG2    5
+#define PR_BITS_PER_INT64_LOG2  6
+#define PR_BITS_PER_LONG_LOG2   6
+#define PR_BITS_PER_FLOAT_LOG2  5
+#define PR_BITS_PER_DOUBLE_LOG2 6
+#define PR_BITS_PER_WORD_LOG2   6
+
+#define PR_ALIGN_OF_SHORT   2
+#define PR_ALIGN_OF_INT     4
+#define PR_ALIGN_OF_LONG    8
+#define PR_ALIGN_OF_INT64   8
+#define PR_ALIGN_OF_FLOAT   4
+#define PR_ALIGN_OF_DOUBLE  8
+#define PR_ALIGN_OF_POINTER 8
+#define PR_ALIGN_OF_WORD    8
+
+#define PR_BYTES_PER_WORD_LOG2  3
+#define PR_BYTES_PER_DWORD_LOG2 3
+
+#else /* assuming this is BIG ENDIAN */
 
 #undef  IS_LITTLE_ENDIAN
 #define IS_BIG_ENDIAN    1
-#define IS_64
 
 #define PR_BYTES_PER_BYTE   1
 #define PR_BYTES_PER_SHORT  2
@@ -72,6 +118,7 @@
 
 #define PR_BYTES_PER_WORD_LOG2   3
 #define PR_BYTES_PER_DWORD_LOG2  3
+#endif
 
 #elif defined(__powerpc__)
 

Reply via email to