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

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

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@silence:~/vcs/ghc-src/ghc-head$ file HelloWorld HelloWorld: ELF 64-bit LSB executable AMD64 Version 1, dynamically linked, not stripped karel@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@silence:~/vcs/ghc-src/ghc-head$ ./HelloWorld Hello World! karel@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 > compiler/stage1/build/primop-data-decl.hs-incl 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! Karel 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@haskell.org http://www.haskell.org/mailman/listinfo/ghc-devs

On 18/01/13 21:40, Karel Gardas wrote:
Thanks a lot for this job and thanks a lot to everyone working on cross-compilation capability of GHC!
I should mention that most of the hard work was done by others: Stephen Blackheath, Mark Lentczner, Ian Lynagh, Gabor Grief and others, I've just been tidying up a few loose ends and updating the wiki.
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.
I suggest running the testsuite with this compiler to see if you can idenfity the smallest test case that fails, and start debugging from there. Cheers, Simon

On Thu, 17 Jan 2013 13:00:44 +0000
Simon Marlow
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
Looks great! Tried a while ago with the following setup: * --tagret=ia64-unknown-linux-gnu * "Stage1Only=YES" * host compiler is ghc-7.6.1 (unregisterised build) to get real cross-compiler and found out the following issues: mkGmpDerivedConstants is built for target and ran on host [attached patches for it] make install fails as it 'forgets' to install proper ghc-pkg in $(${cross}-ghc --print-libdir)/bin/ But the resulting cross-compiler was able to build working hello world! -- Sergei

On 23/01/13 23:44, Sergei Trofimovich wrote:
mkGmpDerivedConstants is built for target and ran on host [attached patches for it]
Thanks, I pushed your patches today. Cheers, Simon

On Thu, 24 Jan 2013 15:06:58 +0000
Simon Marlow
On 23/01/13 23:44, Sergei Trofimovich wrote:
mkGmpDerivedConstants is built for target and ran on host [attached patches for it]
Thanks, I pushed your patches today.
Cheers, Simon
I see a ghc patch in tree, but not integer-gmp one: https://github.com/ghc/packages-integer-gmp/commits/master Thanks! -- Sergei

On 25/01/13 08:55, Sergei Trofimovich wrote:
On Thu, 24 Jan 2013 15:06:58 +0000 Simon Marlow
wrote: On 23/01/13 23:44, Sergei Trofimovich wrote:
mkGmpDerivedConstants is built for target and ran on host [attached patches for it]
Thanks, I pushed your patches today.
Cheers, Simon
I see a ghc patch in tree, but not integer-gmp one:
Just pushed it, sorry about that. Cheers, Simon

Hio all!
Just a piece of feedback,
this patch is giving me (when 'perl boot') an error:
Booting libraries/integer-gmp/
configure.ac:70: error: possibly undefined macro: AC_COMPUTE_INT
If this token and others are legitimate, please use m4_pattern_allow.
See the Autoconf documentation.
autoreconf: /usr/bin/autoconf failed with exit status: 1
I have
$ autoconf --version
autoconf (GNU Autoconf) 2.59
Written by David J. MacKenzie and Akim Demaille.
Copyright (C) 2003 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Cheers,
Gabor
On 1/25/13, Simon Marlow
On 25/01/13 08:55, Sergei Trofimovich wrote:
On Thu, 24 Jan 2013 15:06:58 +0000 Simon Marlow
wrote: On 23/01/13 23:44, Sergei Trofimovich wrote:
mkGmpDerivedConstants is built for target and ran on host [attached patches for it]
Thanks, I pushed your patches today.
Cheers, Simon
I see a ghc patch in tree, but not integer-gmp one:
Just pushed it, sorry about that.
Cheers, Simon
_______________________________________________ ghc-devs mailing list ghc-devs@haskell.org http://www.haskell.org/mailman/listinfo/ghc-devs

On Fri, 25 Jan 2013 11:00:23 +0100
Gabor Greif
Hio all!
Just a piece of feedback,
this patch is giving me (when 'perl boot') an error:
Booting libraries/integer-gmp/ configure.ac:70: error: possibly undefined macro: AC_COMPUTE_INT If this token and others are legitimate, please use m4_pattern_allow. See the Autoconf documentation. autoreconf: /usr/bin/autoconf failed with exit status: 1
I have
$ autoconf --version autoconf (GNU Autoconf) 2.59 Written by David J. MacKenzie and Akim Demaille.
Copyright (C) 2003 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
How easy for you would be to update autoconf-2.61? It's rather old (from Nov 2006). I guess it should be present in repositories. Would AC_PREREQ be enough to report minimal requirement to a ghc's dev tree? Patch attached. -- Sergei

On Fri, Jan 25, 2013 at 10:18:35PM +0300, Sergei Trofimovich wrote:
How easy for you would be to update autoconf-2.61? It's rather old (from Nov 2006). I guess it should be present in repositories.
FWIW, 2.61 is what my OSX installation (10.7.2, Xcode 4.1, I think) has. Thanks Ian
participants (5)
-
Gabor Greif
-
Ian Lynagh
-
Karel Gardas
-
Sergei Trofimovich
-
Simon Marlow