[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: haskell-skein and exotic architectures

On Tue, Nov 22, 2011 at 7:26 PM, Iain Lane <laney@debian.org> wrote:
> Yeah, looks like we have to define SKEIN_NEED_SWAP for all arches. From
> skein_port.h:
> ,----
> | Skein is "natively" little-endian (unlike SHA-xxx), for optimal
> | performance on x86 CPUs.  The Skein code requires the following
> | definitions for dealing with endianness:
> |
> |    SKEIN_NEED_SWAP:  0 for little-endian, 1 for big-endian
> `----
> It then goes on to claim auto detection of endianness, but that looks to be
> disabled.
> So, following the pattern we would have to enumerate all Debian architectures
> for endianness. That looks troublesome. Is there a better way?

IIRC, there was some code to auto detect the endianness, but that code
was (a) GPL-ed and (b) very difficult to work with.  Since every other
part of the C library was BSD, I just riped apart all GPL-ed headers
to have everything with a BSD license (C code and Haskell code).

Currently on skein.cabal we have

    if arch(i386) || arch(x86_64)
        CC-options: "-DSKEIN_NEED_SWAP=0"
    if arch(ppc) || arch(sparc)
        CC-options: "-DSKEIN_NEED_SWAP=1"

so this is (I think) the only place where changes would be needed.
Since I don't have access to these architectures (actually, not even
ppc or sparc), could you please try adding another "|| arch(...)" for
each of those arches?  I don't see this process as too troublesome,
since it would be a once-in-a-lifetime change and I'm happy to
incorporate them on the skein package.  Perhaps I am missing



Reply to: