On Wed, Jul 23, 2003 at 03:55:14PM +0100, Simon Marlow wrote:
>  
> > Using ghc 6.0 with this script it felt like I was getting most of the
> > way to an Alpha Linux compiler from an x86 Linux one. It fails with
> > 
> > gcc -x c GHC/Int.hc -o GHC/Int.raw_s -S -O  -mieee  -static 
> > -w -D__GLASGOW_HASKELL__=600  -O 
> > -I/home/igloo/ghc/ghc-6.0/ghc/includes 
> > -I/home/igloo/ghc/ghc-6.0/libraries/base/include 
> > -I/home/igloo/ghc/ghc-6.0/hslibs/lang/cbits 
> > -I/home/igloo/ghc/ghc-6.0/hslibs/posix/cbits 
> > -I/home/igloo/ghc/ghc-6.0/hslibs/util/cbits 
> > -I/home/igloo/ghc/ghc-6.0/hslibs/text/cbits 
> > -I/home/igloo/ghc/ghc-6.0/hslibs/hssource/cbits    -I.  `echo 
> >  | sed 's/^$/-DSTOLEN_X86_REGS=4/'`
> > GHC/Int.hc: In function `sbsy_ret':
> > GHC/Int.hc:3092: `int64ToIntegerzh_fast' undeclared (first 
> > use in this function)
> > GHC/Int.hc:3092: (Each undeclared identifier is reported only once
> > GHC/Int.hc:3092: for each function it appears in.)
> > GHC/Int.hc: In function `sbst_ret':
> > GHC/Int.hc:3169: `int64ToIntegerzh_fast' undeclared (first 
> > use in this function)
> > make[1]: *** [GHC/Int.raw_s] Error 1
> > 
> > I'm not sure how to fix this - I can give 'config.h's from the target
> > system and recompile the library '.hc's, but I think the 
> > generated code
> > also depends on the compiler which will break if compiled 
> > with the wrong sizes. Any suggestions?
> 
> This is the right thing to do: you should take config.h from the Alpha
> and plug it into your Linux build.  You want the compiler to generate
> .hc code for a 64-bit system, and using the Alpha's config.h will cause
> it to do this.
> 
> However, you might be unable to compile the resulting .hc's down to .o
> on the Linux box, which means the build might fail.  This is harmless,
> because we don't need the .o's, but you might need to work around it
> somehow.

Hmm, I tried making a b3 with

-----8<----------8<----------8<-----
perl -pi -e "[EMAIL PROTECTED] [EMAIL PROTECTED] = \\\$(GHC)@" mk/config.mk.in
./configure --with-ghc=$base/b1/ghc/compiler/stage1/ghc-inplace

echo "GhcHcOpts = -O -H32m -fvia-C -keep-hc-files" >> mk/config.mk
echo "GhcWithNativeCodeGen = NO" >> mk/config.mk
         
echo "GhcUnregisterised = YES" >> mk/config.mk
echo "GhcLibHcOpts = -O -H32m -fvia-C -keep-hc-files" >> mk/config.mk
echo "GhcLibWays =" >> mk/config.mk
echo "SplitObjs = NO" >> mk/config.mk

# from the alpha:
cp ../../mk-config.h mk/
cp ../../ghc-includes-config.h ghc/includes/

mv glafp-utils orig-glafp-utils
mv ghc/utils ghc/orig-utils
ln -s ../b1/glafp-utils glafp-utils
ln -s ../../b1/ghc/utils ghc/utils

cd ghc && make boot && cd .. # Might not be necessary with the above symlinks
cd libraries && make boot && make && cd ..
cd hslibs && make boot && make && cd ..
-----8<----------8<----------8<-----

but b3/libraries/base/GHC/Int.hc still uses int64ToIntegerzh_fast.

$ grep SIZEOF_VOID_P *config.h 
ghc-includes-config.h:#define SIZEOF_VOID_P 8
mk-config.h:#define SIZEOF_VOID_P 8

This is what makes me think I'd need a compiler which was built for a
64bit machine, but I can't imagine I'd get a working compiler if I lied
to it about sizes of various things.

Am I missing something obvious?

> > Files copied across to the alpha:
> > b1: "*.hc", "*_hsc.c" package.conf
> > b2: "*.hc", ".depend*"
> 
> package.conf and .depend* shouldn't be necessary, but I haven't got as
> far as checking the HC bootstrapping phase here yet.

I'm not sure I understand - ghc-pkg-inplace is compiled using the
currently installed compiler (hence the --list-packages-local problems)
and the dependency files are generated by ghc -M before a compiler is
built. Surely they must be needed?

> > Comment out the $(AUTO_APPLY) rule in ghc/rts/Makefile
> 
> I'll take a look at this.

I imagine it should be inside if BootingFromHc != YES or whatever make's
syntax is.


Thanks
Ian

_______________________________________________
Cvs-fptools mailing list
[EMAIL PROTECTED]
http://www.haskell.org/mailman/listinfo/cvs-fptools

Reply via email to