Re: More on FreeBSD/amd64

2007-04-02 Thread Ian Lynagh
Hi Gregory, On Mon, Apr 02, 2007 at 11:57:49AM -0400, Gregory Wright wrote: > > On Apr 1, 2007, at 6:22 PM, Ian Lynagh wrote: > > >Does the 6.6 one work with 6.4.2?: > > > >puts :: String -> IO () > >puts s = do write_rawBuffer 1 (unsafeCoerce# (packCString# s)) > >0

Re[2]: More on FreeBSD/amd64

2007-04-02 Thread Bulat Ziganshin
Hello Gregory, Monday, April 2, 2007, 7:57:49 PM, you wrote: >> puts :: String -> IO () >> puts s = do write_rawBuffer 1 (unsafeCoerce# (packCString# s)) >> 0 (fromIntegral (length s)) >> return () >> >> (packCString# come from GHC.Pack) you may try to cal

Re: More on FreeBSD/amd64

2007-04-02 Thread Gregory Wright
Hi Ian, On Apr 1, 2007, at 6:22 PM, Ian Lynagh wrote: On Sun, Apr 01, 2007 at 06:10:25PM -0400, Gregory Wright wrote: Ah, remove the #if/#endif around the definition of "puts", its export, and the GHC.Pack import in libraries/base/GHC/Handle.hs No such luck. I even copied "puts" into l

Re: More on FreeBSD/amd64

2007-04-01 Thread Ian Lynagh
On Sun, Apr 01, 2007 at 06:10:25PM -0400, Gregory Wright wrote: > > >Ah, remove the #if/#endif around the definition of "puts", its export, > >and the GHC.Pack import in libraries/base/GHC/Handle.hs > > > No such luck. I even copied "puts" into libraries/base/GHC/ > ForeignPtr.hs > but I still g

Re: More on FreeBSD/amd64

2007-04-01 Thread Gregory Wright
Hi Ian, On Apr 1, 2007, at 3:57 PM, Ian Lynagh wrote: Hi Gregory, Is there a version of "print" I can use for debugging these libraries? Just adding "print" causes a cycle in module dependencies. Ah, remove the #if/#endif around the definition of "puts", its export, and the GHC.Pack imp

Re: More on FreeBSD/amd64

2007-04-01 Thread Ian Lynagh
Hi Gregory, On Sun, Apr 01, 2007 at 03:40:11PM -0400, Gregory Wright wrote: > > >mallocPlainForeignPtrBytes i@(I# size) = do > > print ('A', i) > > IO $ \s -> > >case newPinnedByteArray# size s of { (# s, mbarr# #) -> > > > >(it might be worth printing something after

Re: More on FreeBSD/amd64

2007-04-01 Thread Gregory Wright
Hi Ian, On Mar 29, 2007, at 8:36 PM, Ian Lynagh wrote: Hmm, oh well. OK, so we know that the wrong value is being passed to newPinnedByteArray#, right? There aren't many calls to that: libraries/base/Foreign/Marshal/Alloc.hs libraries/base/GHC/ForeignPtr.hs (4 calls) libraries/b

Re: More on FreeBSD/amd64

2007-03-30 Thread Ian Lynagh
Hi Gregory, On Fri, Mar 30, 2007 at 06:17:10PM -0400, Gregory Wright wrote: > > On Mar 30, 2007, at 8:22 AM, Ian Lynagh wrote: > > >On Fri, Mar 30, 2007 at 09:31:07AM +0100, Simon Marlow wrote: > >>Ian Lynagh wrote: > >>> > >>>OK, so we know that the wrong value is being passed to > >>>newPinne

Re: More on FreeBSD/amd64

2007-03-30 Thread Gregory Wright
Hi Ian, On Mar 30, 2007, at 8:22 AM, Ian Lynagh wrote: On Fri, Mar 30, 2007 at 09:31:07AM +0100, Simon Marlow wrote: Ian Lynagh wrote: OK, so we know that the wrong value is being passed to newPinnedByteArray#, right? There aren't many calls to that: libraries/base/Foreign/Marshal/Alloc

Re: More on FreeBSD/amd64

2007-03-29 Thread Gregory Wright
Hi SImon, On Mar 29, 2007, at 5:40 AM, Simon Marlow wrote: Hi Greg, Good analysis so far. I think you're close to this one. Thank you for checking over what I've done thus far. Based on what you said, I looked at Compat.Unicode and there is indeed a type error in this foreign call: f

Re: More on FreeBSD/amd64

2007-03-29 Thread Ian Lynagh
On Thu, Mar 29, 2007 at 10:40:32AM +0100, Simon Marlow wrote: > > Based on what you said, I looked at Compat.Unicode and there is indeed a > type error in this foreign call: > > foreign import ccall unsafe "u_gencat" > wgencat :: CInt -> Int > > The return type should be CInt, not Int. Try c

Re: More on FreeBSD/amd64

2007-03-29 Thread Simon Marlow
Hi Greg, Good analysis so far. I think you're close to this one. Based on what you said, I looked at Compat.Unicode and there is indeed a type error in this foreign call: foreign import ccall unsafe "u_gencat" wgencat :: CInt -> Int The return type should be CInt, not Int. Try changing t

More on FreeBSD/amd64

2007-03-28 Thread Gregory Wright
Hi Ian, I have made some more progress on understanding the build failure on FreeBSD/amd64. I could use a check on my understanding of the problem, though. The setup: I have an unregisterized ghc-6.4.2 successfully built on FreeBSD/amd64. It was bootstrapped from .hc files compiled on FreeBS