Building GHC on Solaris

Bernie Pope bjpop at csse.unimelb.edu.au
Sun Mar 9 23:34:25 EDT 2008


Hi,

I'm trying to get GHC built on Solaris x86 (somewhat old version of  
it too -- not my choice).

    uname -a
    SunOS queeg 5.9 Generic_122301-19 i86pc i386 i86pc Solaris

Here is how I configured ghc:

./configure --prefix=$HOME --with-gcc=/local/solaris/apps/gcc-4.0.2/ 
bin/gcc --with-gas=/local/solaris/apps/binutils-2.16.1/bin/as --with- 
ld=/local/solaris/apps/binutils-2.16.1/bin/ld --with-gmp-includes=/ 
local/solaris86/apps/gmp-4.2.1/include/ --with-gmp-libraries=/local/ 
solaris86/apps/gmp-4.2.1/lib/

I think the --with-gas setting is bogus, but I was clutching at  
straws :)

After a while the build crashes when executing this command:

../compiler/ghc-inplace -optc-O -optc-Wall -optc-W -optc-Wstrict- 
prototypes -optc-Wmissing-prototypes -optc-Wmissing-declarations - 
optc-Winline -optc-Waggregate-return -optc-I../includes -optc-I. - 
optc-Iparallel -optc-Ism -optc-DCOMPILING_RTS -optc-fomit-frame- 
pointer -optc-I/local/solaris86/apps/gmp-4.2.1/include/ -optc-I../gmp/ 
gmpbuild -optc-fno-strict-aliasing -optc-w -H16m -O -optc-O2 -package- 
name rts -static -I/local/solaris86/apps/gmp-4.2.1/include/ -I../gmp/ 
gmpbuild -I. -#include HCIncludes.h -dcmm-lint     -c StgCRun.c -o  
StgCRun.o
Assembler: StgCRun.c
         "/tmp/ghc17357_0/ghc17357_0.s", line 18 : Illegal mnemonic
         "/tmp/ghc17357_0/ghc17357_0.s", line 18 : Syntax error
         "/tmp/ghc17357_0/ghc17357_0.s", line 18 : Illegal mnemonic
make[1]: *** [StgCRun.o] Error 1
make: *** [stage1] Error 1


After looking in the offending assembly file, I see that the "illegal  
mnemonic" is caused by the use of "global" instead of "globl":

            .global StgReturn

The sun assembler chokes on that line, but the gnu assembler is okay  
with it.

One question is: can I use gas as the assembler instead of the  
solaris as? How do I get that to work?

However, I would like to get to the bottom of the error.

My suspicion is that the use of "global" is not coming from the C  
compiler (gcc), but from the evil mangler perl script.
All other occurrences are spelt "globl", which is why I made my  
hypothesis about the mangler.

I'm not knowledgeable enough about the mangler to know if this is  
true, and a moment of browsing didn't make me
any wiser. I can't see why gcc would use two different spellings of  
"globl".

Is there a way forward?

Cheers,
Bernie.







More information about the Cvs-ghc mailing list