summaryrefslogtreecommitdiff
path: root/debian/patches/big-endian.patch
diff options
context:
space:
mode:
Diffstat (limited to 'debian/patches/big-endian.patch')
-rw-r--r--debian/patches/big-endian.patch53
1 files changed, 53 insertions, 0 deletions
diff --git a/debian/patches/big-endian.patch b/debian/patches/big-endian.patch
new file mode 100644
index 0000000..60c9868
--- /dev/null
+++ b/debian/patches/big-endian.patch
@@ -0,0 +1,53 @@
+From: Aurelien Jarno <aurel32@debian.org>
+Subject: libscrypt: FTBFS on big endian architecture
+Date: Wed, 30 Oct 2013 00:09:08 +0100
+
+Version: 1-2
+Severity: important
+Tags: upstream patch
+Justification: fails to build from source
+
+libscrypt fails to build from source on big endian architectures, due
+to testsuite errors:
+
+| TEST EIGHT: Create an MCF format output
+| TEST EIGHT: SUCCESSFUL, calculated mcf
+| $s1$0e0801$U29kaXVtQ2hsb3JpZGU=$cCO9yzr9c0hGHAbNgf046/2o+7qQT44+qbVD9lRdofLVQylVYT8Pz2LUlwUkKpr55h6F3A1lHkDfzwF7RVdYhw==
+| TEST NINE: Password verify on given MCF
+| TEST NINE: FAILED, hash failed to calculate
+| make[1]: *** [check] Error 1
+
+This is due to code in modp_b64.c which is endianness dependent. A big
+and a little endian version of the code are provided, but the selection
+mechanism is supposed to be done by modifying the source code, which is
+not really compatible with a Debian source package. This leads to the
+little endian code to be always used.
+
+The patch below fixes the problem by getting the endianness from
+<endian.h>.
+
+It has been tested on mips, powerpc and s390x.
+
+Index: libscrypt-1/modp_b64.c
+===================================================================
+--- libscrypt-1.orig/modp_b64.c
++++ libscrypt-1/modp_b64.c
+@@ -45,10 +45,14 @@
+ #include "modp_b64.h"
+
+
+-/* if on motoral, sun, ibm; uncomment this */
+-/* #define WORDS_BIGENDIAN 1 */
+-/* else for Intel, Amd; uncomment this */
+-/* #undef WORDS_BIGENDIAN */
++#include <endian.h>
++#if __BYTE_ORDER == __BIG_ENDIAN
++# define WORDS_BIGENDIAN 1
++#elif __BYTE_ORDER == __LITTLE_ENDIAN
++# undef WORDS_BIGENDIAN
++#else
++#error "Unknown endianess"
++#endif
+
+ #include "modp_b64_data.h"
+