FreeRADIUS/pam_radius

pam_radius powerpc build issue

arr2036 opened this issue · 2 comments

(Originally by @TomasFuego, moved to pam_radius repo)

The pam_radius/md5.c needs to account for other big endian processors like powerpc.

This patch works for me using gcc 4.6.3:

Index: md5.c
--- md5.c (revision 210)
+++ md5.c (working copy)
@@ -42,7 +42,7 @@

include

include "md5.h"

-#if defined(__sparc) || defined(__mips)
+#if __BYTE_ORDER == __BIG_ENDIAN

define HIGHFIRST

endif

Arran Cudbard-Bell wrote:

-#if defined(__sparc) || defined(__mips)
+#if __BYTE_ORDER == __BIG_ENDIAN

Breaking existing code isn't an option.

A better solution would be:

#ifdef __BYTE_ORDER
... use it
#else
... existing code ..
#endif

That would be fine. I'm not sure when __BYTE_ORDER was introduced to gcc, though I'm pretty sure I've used this check with gcc33. But, it may not be present if other compilers if you support things other than gcc.

Will you be the one to commit the change?