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

Re: haskell-skein and exotic architectures



Hello,

On Thu, Nov 24, 2011 at 01:18:48PM +0000, Iain Lane wrote:
> Hiya,
> 
> On Tue, Nov 22, 2011 at 08:26:41PM -0200, Felipe Almeida Lessa wrote:
> > […] 
> > 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
> > something?
> 
> Just keeping it up-to-date as new architectures come in. It might be
> easier to have an endianness flag that we can then set in Debian during
> the build based on the output of `dpkg-architecture
> -qDEB_HOST_ARCH_ENDIAN'

I just implemented this in Debian as a patch, which I've attached and it
would be nice if you could incorporate upstream. I don't see how the
static list solution can work for biendian architectures like arm (the
Debian LE arm porterbox 'abel.debian.org' returns 'arm' for
System.Info.arch) and mips, but you could add s390 to BE.

Sorry for the silence; I must admit this fell off the radar. :-(

Cheers,

-- 
Iain Lane                                  [ iain@orangesquash.org.uk ]
Debian Developer                                   [ laney@debian.org ]
Ubuntu Developer                                   [ laney@ubuntu.com ]
PhD student                                       [ ial@cs.nott.ac.uk ]
Description: Add a flag to manually set endianness
Author: Iain Lane <laney@debian.org>

--- haskell-skein-0.1.0.3.orig/skein.cabal
+++ haskell-skein-0.1.0.3/skein.cabal
@@ -54,6 +54,9 @@ Flag reference
     Description: Use the reference implementation instead of the optimized one.
     Default: False
 
+Flag be
+    Description: Swap byte ordering for big-endian arches
+    Default: False
 
 Library
     Hs-Source-Dirs: src
@@ -81,9 +84,9 @@ Library
     Includes:
         skein.h
 
-    if arch(i386) || arch(x86_64)
+    if arch(i386) || arch(x86_64) || !flag(be)
         CC-options: "-DSKEIN_NEED_SWAP=0"
-    if arch(ppc) || arch(sparc)
+    if arch(ppc) || arch(sparc) || flag(be) 
         CC-options: "-DSKEIN_NEED_SWAP=1"
 
     if flag(reference)

Attachment: signature.asc
Description: Digital signature


Reply to: