problems running ghc-6.8.2 on solaris 10, sparc

Daniil Elovkov daniil.elovkov at
Fri Aug 15 08:54:46 EDT 2008

Hello folks, Christian

I'm trying to get ghc 6.8.2 running on Solaris 10 and having problems.
To be precise, I'm trying to compile a 'hello world' program by ghc
6.8.2 which I got in binary form

gcc is 2.95, it uses sun linker. I remember there were problems with
that in the past. Is ghc supposed to work only with gnu ld or sun ld
as well?

So, how it went

first I got compiler errors in many places of Reg.hs:
   global register variable follows a function definition

Googling showed that Don Stewart used to fix it by swapping 2 includes
in Stg.h - putting MachRegs.h after Regs.h instead of before. It

Then there was assembler error:
     cannot use v8plus instructions in a non-v8plus target binary

It was caused by -mcpu=v9, which ghc passes to gcc. I blindly added
-optc -mcpu=v8 and it helped :)

Then the linker complained that it could not resolve aio_fork and
__aio_suspend64, referenced from

-lrt is passed by ghc to the linker. On this machine there is
/lib/ Linking with it didn't help. It doesn't really contain
exactly those functions, only with slightly different names, like
_aio_forkinit, _libaio_fork.

Also, librt which was linked in was the one lying close to where gcc
is installed. Apart from that, there is also in /lib. I
thought, maybe the wrong librt was used and said -optl -L/lib to link
against the one in /lib.

No complaints, but the resulting binary segfaults.

Does anybody have any ideas?

Daniil Elovkov

More information about the Glasgow-haskell-users mailing list