Snow Leopard Breaks GHC

Just thought I'd point out that my old GHC install is now broken by the update to Snow Leopard. Dave

My 6.10.1 install still works alright after upgrade to 10.6/Snow Leopard. What version did you have? -Ross On Aug 28, 2009, at 7:15 PM, David Leimbach wrote:
Just thought I'd point out that my old GHC install is now broken by the update to Snow Leopard.
Dave _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

6.10.4. Did you try to build any binaries? It doesn't produce correct
assembly code (it looks like).
Dave
On Fri, Aug 28, 2009 at 4:55 PM, Ross Mellgren
My 6.10.1 install still works alright after upgrade to 10.6/Snow Leopard. What version did you have?
-Ross
On Aug 28, 2009, at 7:15 PM, David Leimbach wrote:
Just thought I'd point out that my old GHC install is now broken by the
update to Snow Leopard.
Dave _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

I did a trivial compile and it worked yes (the binary it produced was alright, also). Did the binary it generate have problems, or was it the compilation that failed? -Ross On Aug 28, 2009, at 7:57 PM, David Leimbach wrote:
6.10.4. Did you try to build any binaries? It doesn't produce correct assembly code (it looks like).
Dave
On Fri, Aug 28, 2009 at 4:55 PM, Ross Mellgren
wrote: My 6.10.1 install still works alright after upgrade to 10.6/Snow Leopard. What version did you have? -Ross
On Aug 28, 2009, at 7:15 PM, David Leimbach wrote:
Just thought I'd point out that my old GHC install is now broken by the update to Snow Leopard.
Dave _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

The compilation failed.
On Fri, Aug 28, 2009 at 4:58 PM, Ross Mellgren
I did a trivial compile and it worked yes (the binary it produced was alright, also). Did the binary it generate have problems, or was it the compilation that failed? -Ross
On Aug 28, 2009, at 7:57 PM, David Leimbach wrote:
6.10.4. Did you try to build any binaries? It doesn't produce correct assembly code (it looks like). Dave
On Fri, Aug 28, 2009 at 4:55 PM, Ross Mellgren
wrote: My 6.10.1 install still works alright after upgrade to 10.6/Snow Leopard. What version did you have?
-Ross
On Aug 28, 2009, at 7:15 PM, David Leimbach wrote:
Just thought I'd point out that my old GHC install is now broken by the
update to Snow Leopard.
Dave _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

The same here: $ghc hw.hs /var/folders/1J/1JKije6yHpm78qqdjF5N2U+++TI/-Tmp-/ghc7743_0/ ghc7743_0.s:1357:0: suffix or operands invalid for `push' /var/folders/1J/1JKije6yHpm78qqdjF5N2U+++TI/-Tmp-/ghc7743_0/ ghc7743_0.s:1401:0: suffix or operands invalid for `push' ... I've tried to build ghc from svn, but build process failed, cause it requires working version of GHC. I've tried to cross build from Ubuntu, but it failed too. There is a ticket - http://hackage.haskell.org/trac/ghc/ticket/3400, but it's not helpful for me. D On 29/08/2009, at 10:06 AM, David Leimbach wrote:
The compilation failed.
On Fri, Aug 28, 2009 at 4:58 PM, Ross Mellgren
wrote: I did a trivial compile and it worked yes (the binary it produced was alright, also). Did the binary it generate have problems, or was it the compilation that failed? -Ross
On Aug 28, 2009, at 7:57 PM, David Leimbach wrote:
6.10.4. Did you try to build any binaries? It doesn't produce correct assembly code (it looks like).
Dave
On Fri, Aug 28, 2009 at 4:55 PM, Ross Mellgren
wrote: My 6.10.1 install still works alright after upgrade to 10.6/Snow Leopard. What version did you have? -Ross
On Aug 28, 2009, at 7:15 PM, David Leimbach wrote:
Just thought I'd point out that my old GHC install is now broken by the update to Snow Leopard.
Dave _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

On Fri, Aug 28, 2009 at 5:28 PM, Dmitri Sosnik
The same here:$ghc hw.hs
/var/folders/1J/1JKije6yHpm78qqdjF5N2U+++TI/-Tmp-/ghc7743_0/ghc7743_0.s:1357:0: suffix or operands invalid for `push'
/var/folders/1J/1JKije6yHpm78qqdjF5N2U+++TI/-Tmp-/ghc7743_0/ghc7743_0.s:1401:0: suffix or operands invalid for `push' ...
I've tried to build ghc from svn, but build process failed, cause it requires working version of GHC. I've tried to cross build from Ubuntu, but it failed too. There is a ticket - http://hackage.haskell.org/trac/ghc/ticket/3400, but it's not helpful for me.
There is a closed ticket for this bug, but it doesn't exactly tell us how or when we'll see a fix :-) Maybe the answer is "run windows" or "linux" :-)
D
On 29/08/2009, at 10:06 AM, David Leimbach wrote:
The compilation failed.
On Fri, Aug 28, 2009 at 4:58 PM, Ross Mellgren
wrote: I did a trivial compile and it worked yes (the binary it produced was alright, also). Did the binary it generate have problems, or was it the compilation that failed? -Ross
On Aug 28, 2009, at 7:57 PM, David Leimbach wrote:
6.10.4. Did you try to build any binaries? It doesn't produce correct assembly code (it looks like). Dave
On Fri, Aug 28, 2009 at 4:55 PM, Ross Mellgren
wrote: My 6.10.1 install still works alright after upgrade to 10.6/Snow Leopard. What version did you have?
-Ross
On Aug 28, 2009, at 7:15 PM, David Leimbach wrote:
Just thought I'd point out that my old GHC install is now broken by the
update to Snow Leopard.
Dave _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

leimy2k:
On Fri, Aug 28, 2009 at 5:28 PM, Dmitri Sosnik
wrote: The same here: $ghc hw.hs
/var/folders/1J/1JKije6yHpm78qqdjF5N2U+++TI/-Tmp-/ghc7743_0/ ghc7743_0.s:1357:0: suffix or operands invalid for `push'
/var/folders/1J/1JKije6yHpm78qqdjF5N2U+++TI/-Tmp-/ghc7743_0/ ghc7743_0.s:1401:0: suffix or operands invalid for `push' ...
I've tried to build ghc from svn, but build process failed, cause it requires working version of GHC. I've tried to cross build from Ubuntu, but it failed too. There is a ticket - http://hackage.haskell.org/trac/ghc/ticket/3400, but it's not helpful for me.
There is a closed ticket for this bug, but it doesn't exactly tell us how or when we'll see a fix :-)
Maybe the answer is "run windows" or "linux" :-)
If it is closed, it is fixed in the HEAD. -- Don

Here - http://hackage.haskell.org/trac/ghc/wiki/Building, but it won't help, cause you need working ghc to build ghc. D On 29/08/2009, at 6:33 PM, Thomas Davie wrote:
If it is closed, it is fixed in the HEAD.
Any ideas how to get hold of a copy of HEAD, when my Haskell compiler currently outputs rubbish?
Bob _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Hi,
If you compile with:
-opta -m32 -optl -m32
Then you can get GHC to produce binaries again.
WARNING: currently you cannot use this trick to build a Snow Leopard
compatible GHC using the HEAD snapshot at
http://www.haskell.org/ghc/dist/current/d ist/, because the most
recent (20090828) does not include the relevant patch. You have to use
HEAD directly, at least until the next packaged source release shows
up in that directory.
Once you have the source code from HEAD, you can add those flags to
SRC_HC_OPTS in your mk/build.mk and it should work. Disclaimer: I
haven't actually tried this yet.
Cheers,
Max
2009/8/29 Dmitri Sosnik
Here - http://hackage.haskell.org/trac/ghc/wiki/Building, but it won't help, cause you need working ghc to build ghc.
D
On 29/08/2009, at 6:33 PM, Thomas Davie wrote:
If it is closed, it is fixed in the HEAD.
Any ideas how to get hold of a copy of HEAD, when my Haskell compiler currently outputs rubbish?
Bob _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Well if I build GHC on Leopard from HEAD and then copy it to Snow Leopard
would that not work?
Dave
On Sat, Aug 29, 2009 at 1:52 AM, Dmitri Sosnik
Here - http://hackage.haskell.org/trac/ghc/wiki/Building, but it won't help, cause you need working ghc to build ghc.
D
On 29/08/2009, at 6:33 PM, Thomas Davie wrote:
If it is closed, it is fixed in the HEAD.
Any ideas how to get hold of a copy of HEAD, when my Haskell compiler currently outputs rubbish?
Bob _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Hm, don't think so, you have to build for a new platform - http://hackage.haskell.org/trac/ghc/wiki/Building/Porting D On 30/08/2009, at 2:10 AM, David Leimbach wrote:
Well if I build GHC on Leopard from HEAD and then copy it to Snow Leopard would that not work?
Dave
On Sat, Aug 29, 2009 at 1:52 AM, Dmitri Sosnik
wrote: Here - http://hackage.haskell.org/trac/ghc/wiki/Building, but it won't help, cause you need working ghc to build ghc. D
On 29/08/2009, at 6:33 PM, Thomas Davie wrote:
If it is closed, it is fixed in the HEAD.
Any ideas how to get hold of a copy of HEAD, when my Haskell compiler currently outputs rubbish?
Bob _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Well the old binaries for Leopard already work on Snow Leopard. The problem
is the code generated by the GHC compiler doesn't create correct 64bit code
when invoking gcc, and gcc on Snow Leopard defaults to 64bit code now. The
solution is to use -m32 in the invocation of gcc by default for Snow
Leopard, or to make it emit correct 64bit code.
Given all of the above, I don't think there's any "porting" work to be done.
On Sun, Aug 30, 2009 at 2:22 AM, Dmitri Sosnik
Hm, don't think so, you have to build for a new platform - http://hackage.haskell.org/trac/ghc/wiki/Building/Porting D
On 30/08/2009, at 2:10 AM, David Leimbach wrote:
Well if I build GHC on Leopard from HEAD and then copy it to Snow Leopard would that not work? Dave
On Sat, Aug 29, 2009 at 1:52 AM, Dmitri Sosnik
wrote: Here - http://hackage.haskell.org/trac/ghc/wiki/Building, but it won't help, cause you need working ghc to build ghc.
D
On 29/08/2009, at 6:33 PM, Thomas Davie wrote:
If it is closed, it is fixed in the HEAD.
Any ideas how to get hold of a copy of HEAD, when my Haskell compiler currently outputs rubbish?
Bob _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

How I can tell gcc to generate 32 bit code? I've tried to set CFLAGS=- m32, but it doesn't work. Cheers, D On 31/08/2009, at 12:06 AM, David Leimbach wrote:
Well the old binaries for Leopard already work on Snow Leopard. The problem is the code generated by the GHC compiler doesn't create correct 64bit code when invoking gcc, and gcc on Snow Leopard defaults to 64bit code now. The solution is to use -m32 in the invocation of gcc by default for Snow Leopard, or to make it emit correct 64bit code.
Given all of the above, I don't think there's any "porting" work to be done.
On Sun, Aug 30, 2009 at 2:22 AM, Dmitri Sosnik
wrote: Hm, don't think so, you have to build for a new platform - http://hackage.haskell.org/trac/ghc/wiki/Building/Porting D
On 30/08/2009, at 2:10 AM, David Leimbach wrote:
Well if I build GHC on Leopard from HEAD and then copy it to Snow Leopard would that not work?
Dave
On Sat, Aug 29, 2009 at 1:52 AM, Dmitri Sosnik
wrote: Here - http://hackage.haskell.org/trac/ghc/wiki/Building, but it won't help, cause you need working ghc to build ghc. D
On 29/08/2009, at 6:33 PM, Thomas Davie wrote:
If it is closed, it is fixed in the HEAD.
Any ideas how to get hold of a copy of HEAD, when my Haskell compiler currently outputs rubbish?
Bob _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

Dmitri Sosnik wrote:
How I can tell gcc to generate 32 bit code? I've tried to set CFLAGS=-m32, but it doesn't work.
(Flags do not work -- without Makefile) Pass -optc-m32 -opta-m32 -optl-m32 through ghc (as pointed out before) for gcc, the assembler "as" and the linker "ld" resp. (I think, gcc is only used for -via-C) These options can be added to the script "/usr/local/bin/ghc" (if it was installed there). HTH Christian
Cheers, D
On 31/08/2009, at 12:06 AM, David Leimbach wrote:
Well the old binaries for Leopard already work on Snow Leopard. The problem is the code generated by the GHC compiler doesn't create correct 64bit code when invoking gcc, and gcc on Snow Leopard defaults to 64bit code now. The solution is to use -m32 in the invocation of gcc by default for Snow Leopard, or to make it emit correct 64bit code.
Given all of the above, I don't think there's any "porting" work to be done.
On Sun, Aug 30, 2009 at 2:22 AM, Dmitri Sosnik
mailto:dimavs@gmail.com> wrote: Hm, don't think so, you have to build for a new platform - http://hackage.haskell.org/trac/ghc/wiki/Building/Porting
D
On 30/08/2009, at 2:10 AM, David Leimbach wrote:
Well if I build GHC on Leopard from HEAD and then copy it to Snow Leopard would that not work?
Dave
On Sat, Aug 29, 2009 at 1:52 AM, Dmitri Sosnik
mailto:dimavs@gmail.com> wrote: Here - http://hackage.haskell.org/trac/ghc/wiki/Building, but it won't help, cause you need working ghc to build ghc.
D
On 29/08/2009, at 6:33 PM, Thomas Davie wrote:
If it is closed, it is fixed in the HEAD.
Any ideas how to get hold of a copy of HEAD, when my Haskell compiler currently outputs rubbish?
Bob _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org mailto:Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org mailto:Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
------------------------------------------------------------------------
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

That works here just fine. Thanks!
On Mon, Aug 31, 2009 at 4:02 AM, Christian Maeder
Dmitri Sosnik wrote:
How I can tell gcc to generate 32 bit code? I've tried to set CFLAGS=-m32, but it doesn't work.
(Flags do not work -- without Makefile) Pass
-optc-m32 -opta-m32 -optl-m32
through ghc (as pointed out before) for gcc, the assembler "as" and the linker "ld" resp. (I think, gcc is only used for -via-C)
These options can be added to the script "/usr/local/bin/ghc" (if it was installed there).
HTH Christian
Cheers, D
On 31/08/2009, at 12:06 AM, David Leimbach wrote:
Well the old binaries for Leopard already work on Snow Leopard. The problem is the code generated by the GHC compiler doesn't create correct 64bit code when invoking gcc, and gcc on Snow Leopard defaults to 64bit code now. The solution is to use -m32 in the invocation of gcc by default for Snow Leopard, or to make it emit correct 64bit code.
Given all of the above, I don't think there's any "porting" work to be done.
On Sun, Aug 30, 2009 at 2:22 AM, Dmitri Sosnik
mailto:dimavs@gmail.com> wrote: Hm, don't think so, you have to build for a new platform - http://hackage.haskell.org/trac/ghc/wiki/Building/Porting
D
On 30/08/2009, at 2:10 AM, David Leimbach wrote:
Well if I build GHC on Leopard from HEAD and then copy it to Snow Leopard would that not work?
Dave
On Sat, Aug 29, 2009 at 1:52 AM, Dmitri Sosnik
mailto:dimavs@gmail.com> wrote: Here - http://hackage.haskell.org/trac/ghc/wiki/Building, but it won't help, cause you need working ghc to build ghc.
D
On 29/08/2009, at 6:33 PM, Thomas Davie wrote:
If it is closed, it is fixed in the HEAD.
Any ideas how to get hold of a copy of HEAD, when my Haskell compiler currently outputs rubbish?
Bob _______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org mailto:Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org mailto:Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe
------------------------------------------------------------------------
_______________________________________________ Haskell-Cafe mailing list Haskell-Cafe@haskell.org http://www.haskell.org/mailman/listinfo/haskell-cafe

On 31/08/2009, at 9:02 PM, Christian Maeder wrote:
Dmitri Sosnik wrote:
How I can tell gcc to generate 32 bit code? I've tried to set CFLAGS=-m32, but it doesn't work.
(Flags do not work -- without Makefile) Pass
Stupid me :-)
-optc-m32 -opta-m32 -optl-m32
Yep, it work. Thanks! Cheers, D

On Mon, Aug 31, 2009 at 7:18 PM, Dmitri Sosnik
On 31/08/2009, at 9:02 PM, Christian Maeder wrote:
Dmitri Sosnik wrote:
How I can tell gcc to generate 32 bit code? I've tried to set CFLAGS=-m32, but it doesn't work.
(Flags do not work -- without Makefile) Pass
Stupid me :-)
-optc-m32 -opta-m32 -optl-m32
Yep, it work. Thanks!
Hmm ... running Snow Leopard here, I added these arguments to my /usr/bin/ghc (and my /usr/bin/ghci, and /usr/bin/runhaskell, for good measure), and I end up getting the following error on "cabal update" after installing cabal-install: ***** cabal: user error (Codec.Compression.Zlib: incompatible version) ***** Earlier in the cabal-install bootstrap process, I get the following line: ***** ld: warning: in /Library/Frameworks/GHC.framework/Versions/610/usr/lib/ghc-6.10.4/libgmp.a, file is not of required architecture ***** I'm guessing something's still not being set to 32-bit?

It seems, bootstrapping cabal went wrong. Does http://hackage.haskell.org/platform/2009.2.0.2/haskell-platform-2009.2.0.2-i... work? Once cabal works, options --ld-option=-m32 (and also --gcc-option=-m32) may be used. These options may also be passed to "./Setup configure" C. Tom Tobin wrote:
Hmm ... running Snow Leopard here, I added these arguments to my /usr/bin/ghc (and my /usr/bin/ghci, and /usr/bin/runhaskell, for good measure), and I end up getting the following error on "cabal update" after installing cabal-install:
***** cabal: user error (Codec.Compression.Zlib: incompatible version) *****
Earlier in the cabal-install bootstrap process, I get the following line:
***** ld: warning: in /Library/Frameworks/GHC.framework/Versions/610/usr/lib/ghc-6.10.4/libgmp.a, file is not of required architecture *****
I'm guessing something's still not being set to 32-bit?

On Tue, Sep 1, 2009 at 3:14 AM, Christian
Maeder
It seems, bootstrapping cabal went wrong. Does http://hackage.haskell.org/platform/2009.2.0.2/haskell-platform-2009.2.0.2-i... work?
Installing the Haskell Platform package, combined with adding the previously mentioned options to /usr/bin/ghc (-optc-m32 -opta-m32 -optl-m32), seems to have done the trick. Thank you!

Tom Tobin
On Tue, Sep 1, 2009 at 3:14 AM, Christian Maeder
wrote: It seems, bootstrapping cabal went wrong. Does http://hackage.haskell.org/platform/2009.2.0.2/haskell-platform-2009.2.0.2-i... work?
Installing the Haskell Platform package, combined with adding the previously mentioned options to /usr/bin/ghc (-optc-m32 -opta-m32 -optl-m32), seems to have done the trick. Thank you!
N.B. everybody, you also need to patch /usr/bin/hsc2hs to read:
exec /Library/Frameworks/GHC.framework/Versions/610/usr/lib/ghc-6.10.4/hsc2hs \
$tflag $HSC2HS_EXTRA --cflag="-m32" --lflag="-m32" ${1+"$@"} "$Iflag"
if you want FFI to work. See details on
http://hackage.haskell.org/trac/ghc/ticket/3400#comment:9.
G.
--
Gregory Collins
participants (9)
-
Christian Maeder
-
David Leimbach
-
Dmitri Sosnik
-
Don Stewart
-
Gregory Collins
-
Max Bolingbroke
-
Ross Mellgren
-
Thomas Davie
-
Tom Tobin