RE: lawbreakers in Text.PrettyPrint.HughesPJ

I had trouble parsing your message. Are you saying that (a) before changing the library you have a program that compiles ok (b) after changing the library, the program becomes gigantic and won't link ? Nothing to do with *running* the program? If I have understood right, what are the sizes of the .o files in (a) and (b)? Has one (or lots) gotten gigantic? Simon | -----Original Message----- | From: libraries-bounces@haskell.org [mailto:libraries-bounces@haskell.org] On Behalf Of Christian | Maeder | Sent: 30 November 2005 14:45 | To: Simon Peyton-Jones | Cc: libraries@haskell.org | Subject: Re: lawbreakers in Text.PrettyPrint.HughesPJ | | Christian Maeder wrote: | > I've tried both versions, without noticing a difference. So take the | > following patch (as suggested by Conal). | | I became a problem with my (Conal's) suggested patch on a mac. When | compiled with optimization the code was so blown up that it could no | longer be linked on a mac. (The problem does not occur if only isEmpty | is changed as suggested before.) | | Unfortunately the example is large and takes ages to be reproduced and | it took me an age to find that the cause was my change to our version of | HughesPJ.hs. | | Christian | | the link error shows up as: | | [...] | /usr/bin/ld: ./Logic/Logic.o relocation overflow for relocation entry | 5401 in se | ction (__TEXT,__text) (displacement too large) | collect2: ld returned 1 exit status | make: *** [hets] Error 1 | _______________________________________________ | Libraries mailing list | Libraries@haskell.org | http://www.haskell.org/mailman/listinfo/libraries

Simon Peyton-Jones wrote:
I had trouble parsing your message.
Sorry, what should I improve? At last, you've parsed my message correctly.
Are you saying that (a) before changing the library you have a program that compiles ok (b) after changing the library, the program becomes gigantic and won't link ?
Yes, I say (a) and (b)
Nothing to do with *running* the program?
Right, no run-time problem.
If I have understood right, what are the sizes of the .o files in (a) and (b)? Has one (or lots) gotten gigantic?
Yes, one .o file has (a) 150 KB before and (b) 4 MB after the library change. I assume, I should supply a test case (to glasgow-haskell-bugs@haskell.org). I'll do so later. Better, do not commit the patch I've sent you to Text.PrettyPrint.HughesPJ before this issue is settled. Christian

Hi Simon,
| Christian Maeder wrote: | I became a problem with my (Conal's) suggested patch on a mac. When | compiled with optimization the code was so blown up that it could no | longer be linked on a mac. (The problem does not occur if only isEmpty | is changed as suggested before.)
Before HughesPJ.hs does not get fixed at all, because of the open "object code blow up by minor source code change" bug http://hackage.haskell.org/trac/ghc/ticket/490 You may apply the alternative patch (attached), that worked for me. Cheers Christian Index: HughesPJ.hs =================================================================== RCS file: /cvs/fptools/libraries/base/Text/PrettyPrint/HughesPJ.hs,v retrieving revision 1.17 diff -u -r1.17 HughesPJ.hs --- HughesPJ.hs 22 Sep 2005 09:43:01 -0000 1.17 +++ HughesPJ.hs 22 Dec 2005 16:11:27 -0000 @@ -582,8 +582,9 @@ empty = Empty -isEmpty Empty = True -isEmpty _ = False +isEmpty d = case reduceDoc d of + Empty -> True + _ -> False char c = textBeside_ (Chr c) 1 Empty text s = case length s of {sl -> textBeside_ (Str s) sl Empty}
participants (2)
-
Christian Maeder
-
Simon Peyton-Jones