Subject: | [PATCH] alignment problem on sparc |
Hi,
This module does not pass tests (dies, even) on the sparc architecture
due to an alignment problem (see
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=477741).
The following and attached patch from Matthew Green fixes the problem.
Thanks for Authen::DecHpwd and the great Authen::Passphrase suite!
--- lib/Authen/DecHpwd.xs.orig 2007-09-17 13:32:14.000000000 -0700
+++ lib/Authen/DecHpwd.xs 2008-05-07 19:15:59.000000000 -0700
@@ -72,6 +72,12 @@
#define UAIC_PURDY_V 2 /* Purdy polynomial + variable length
username */
#define UAIC_PURDY_S 3 /* PURDY_V + additional bit rotation
*/
+#ifdef __GNUC__
+# define _aligned(n) __attribute__ ((__aligned__(n)))
+#else
+# define _aligned(n)
+#endif
+
typedef struct {
#if ARCH_LITTLE_ENDIAN
dword d_low;
@@ -80,7 +86,7 @@
dword d_high;
dword d_low;
#endif
- } qword;
+ } qword _aligned(8);
#ifdef __GNUC__
# define _packed __attribute__ ((packed))
Subject: | authen-dechwpwd.diff |
--- lib/Authen/DecHpwd.xs.orig 2007-09-17 13:32:14.000000000 -0700
+++ lib/Authen/DecHpwd.xs 2008-05-07 19:15:59.000000000 -0700
@@ -72,6 +72,12 @@
#define UAIC_PURDY_V 2 /* Purdy polynomial + variable length username */
#define UAIC_PURDY_S 3 /* PURDY_V + additional bit rotation */
+#ifdef __GNUC__
+# define _aligned(n) __attribute__ ((__aligned__(n)))
+#else
+# define _aligned(n)
+#endif
+
typedef struct {
#if ARCH_LITTLE_ENDIAN
dword d_low;
@@ -80,7 +86,7 @@
dword d_high;
dword d_low;
#endif
- } qword;
+ } qword _aligned(8);
#ifdef __GNUC__
# define _packed __attribute__ ((packed))