Date: Sun, 8 Jul 2012 13:53:42 +0400 From: Solar Designer <solar@...nwall.com> To: john-dev@...ts.openwall.com Subject: ARCH_ALLOWS_UNALIGNED in generic build (was: Build error for generic) On Sat, Jul 07, 2012 at 11:00:49AM -0500, jfoug wrote: > [...] That the generic build of linux uses this SLOWER > code bothers me. I think we should look at adding at least that much smarts > to the generic build. It can easily detect the ARCH_ALLOWS_UNALIGNED by > checking these (likely not all encompassing, but it would catch it MOST of > the time) > > #if defined(i386) || defined(__i386__) || defined(__i486__) || \ > defined(__i586__) || defined(__i686__) || defined(__pentium__) || \ > defined(__pentiumpro__) || defined(__pentium4__) || \ > defined(__nocona__) || defined(prescott) || defined(__core2__) || \ > defined(__k6__) || defined(__k8__) || defined(__athlon__) || \ > defined(__amd64) || defined(__amd64__) || \ > defined(__x86_64) || defined(__x86_64__) || defined(_M_IX86) || \ > defined(_M_AMD64) || defined(_M_IA64) || defined(_M_X64) > #define ARCH_ALLOWS_UNALIGNED 1 > #else > #define ARCH_ALLOWS_UNALIGNED 0 > #endif I agree that we should add a check like this to detect.c or to the arch.h that it outputs. I find the above set of checks excessive, though - wouldn't it be sufficient to check for defined(__i386__) || defined(__x86_64__)? I think one of these is implied by all others. For example, when compiling for i686, __i386__ is also defined. In md4.c and md5.c, we have: #if defined(__i386__) || defined(__x86_64__) || defined(__vax__) for the same purpose (these files were written outside of JtR initially, which is why they do not use JtR's ARCH_ALLOWS_UNALIGNED). I think we should reuse this same check. Eventually, we'll also need to add a check for x32, or maybe we can do it already (need to find out the proper define). Alexander
Powered by blists - more mailing lists
Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.