HEADS UP (was Re: [commit: ghc] master: Tidy up cross-compiling (109a1e5))

Karel Gardas karel.gardas at centrum.cz
Fri Jan 18 22:40:59 CET 2013

Thanks a lot for this job and thanks a lot to everyone working on 
cross-compilation capability of GHC!

Using GHC HEAD just after Simon M patch I've been able to cross-compile 
it from i386-solaris to x86_64-solaris for the first time. I've 
attempted this port a year or two ago doing it the old way, but 
miserably failed. Today this was just a hour or so task. Three patches 
for this needed are already submitted. Hello world is working:

$ ./inplace/bin/ghc-stage2 --make HelloWorld.hs
[1 of 1] Compiling Main             ( HelloWorld.hs, HelloWorld.o )
Linking HelloWorld ...
karel at silence:~/vcs/ghc-src/ghc-head$ file HelloWorld
HelloWorld:	ELF 64-bit LSB executable AMD64 Version 1, dynamically 
linked, not stripped
karel at silence:~/vcs/ghc-src/ghc-head$ ldd HelloWorld
	libgmp.so.3 =>	 /usr/lib/64/libgmp.so.3
	libm.so.2 =>	 /lib/64/libm.so.2
	librt.so.1 =>	 /lib/64/librt.so.1
	libdl.so.1 =>	 /lib/64/libdl.so.1
	libc.so.1 =>	 /lib/64/libc.so.1
karel at silence:~/vcs/ghc-src/ghc-head$ ./HelloWorld
Hello World!
karel at silence:~/vcs/ghc-src/ghc-head$

The only issue I see with it is that I'm not able to perform another 
clean build of GHC HEAD using this amd64 compiler since genprimopcode 
segfaults on me.

gmake[1]: Nothing to be done for `phase_0_builds'.
===--- building phase 1
gmake -r --no-print-directory -f ghc.mk phase=1 phase_1_builds
libraries/hpc/ghc.mk:3: libraries/hpc/dist-boot/build/.depend-v.haskell: 
No such file or directory
compiler/ghc.mk:439: compiler/stage1/build/.depend-v.haskell: No such 
file or directory
"inplace/bin/genprimopcode" --data-decl          < 
compiler/stage1/build/primops.txt > 
gmake[1]: *** [compiler/stage1/build/primop-data-decl.hs-incl] 
Segmentation Fault (core dumped)
gmake[1]: *** Deleting file `compiler/stage1/build/primop-data-decl.hs-incl'
gmake: *** [all] Error 2

Anyway, thanks a lot for this fantastic job!

On 01/17/13 02:00 PM, Simon Marlow wrote:
> Cross-compilers please take note:
> On 17/01/13 12:57, Simon Marlow wrote:
>> Before
>> ------
>> To build a cross-compiler:
>> ./configure --target=<..>
>> To compile a foreign GHC:
>> ./configure --host=<..> --target=<..>
>> Now
>> ---
>> To build a cross-compiler:
>> ./configure --target=<..>
>> And set "Stage1Only=YES" in mk/build.mk
>> To compile a foreign GHC:
>> ./configure --target=<..>
> Cheers,
> Simon
> _______________________________________________
> ghc-devs mailing list
> ghc-devs at haskell.org
> http://www.haskell.org/mailman/listinfo/ghc-devs

More information about the ghc-devs mailing list