RE: Porting GHC to powerpc-unknown-linux

simonmar:
There's a small possibility that I've missed something out from the instructions, I suppose :)
No. They are perfect. I've stress tested them today :p
+-----------------+--------------------+----------------------------+ | HOST | TARGET | Unregisterised bootstrap | +-----------------+--------------------+----------------------------+ | i386-*-openbsd | i386-*-openbsd | YES | | | i386-*-freebsd | YES | | | i386-*-linux | YES | | | i386-*-solaris2 | YES | | | sparc-sun-solaris2 | YES | | | sparc-sun-openbsd | in-progress | | | m68k-apple-netbsd | in-progress | | | | | | | alpha-dec-osf3 | dies on host with: | | | | cc1: Invalid option `ieee' | +-----------------+--------------------+----------------------------+
So all 32-bit platforms have worked or are looking good, but the 64 bit couldn't get of the host machine.
The problem you experienced on the Alpha has a perfectly rational explanation. The .hc files we generate on the host machine are designed to be compiled on the target machine only; it's entirely possible that the configuration of the compiler on the host machine may not be able to compile these .hc files to .o. Ideally, the build system should know when it is cross-compiling .hc files and just generate .hc files (passing -C to GHC instead of -c -keep-hc-files). I thought about doing this, but quickly realised it would be a lot of work to get right. You might be able to hack around it with lots of 'make -k' on the host machine.
But I think we can see that GHC is portable now :)
That's what I like to hear :-) Cheers, Simon

On Thu, 4 Sep 2003, Simon Marlow wrote: +-----------------+--------------------+----------------------------+ | HOST | TARGET | Unregisterised bootstrap | +-----------------+--------------------+----------------------------+ | i386-*-openbsd | i386-*-openbsd | YES | | | i386-*-freebsd | YES | | | i386-*-linux | YES | | | i386-*-solaris2 | YES | | | sparc-sun-solaris2 | YES | | | sparc-sun-openbsd | in-progress | | | m68k-apple-netbsd | in-progress | | | mips-sgi-irix65 | in-progress | | | | | | alpha-dec-osf3 | dies on host with: | | | | cc1: Invalid option `ieee' | +-----------------+--------------------+----------------------------+ I cannot miss this interesting thread , working with mips-sgi-irix65. Could you release a (transient) ghc-6.01-unreg-hc.tar.gz ? If not, Donald, please send it to me privately... However, I will try to make cross-porting from i386-*-linux.

On Thu, 4 Sep 2003, Rafael Martinez Torres wrote:
Could you release a (transient) ghc-6.01-unreg-hc.tar.gz ?
Sorry, I read the doc, and I understood the unreg (.hc) tar is built on host with a particular target "config.h" . I have to build it , hence.

rmartine:
On Thu, 4 Sep 2003, Simon Marlow wrote:
+-----------------+--------------------+----------------------------+ | HOST | TARGET | Unregisterised bootstrap | +-----------------+--------------------+----------------------------+ | i386-*-openbsd | i386-*-openbsd | YES | | | i386-*-freebsd | YES | | | i386-*-linux | YES | | | i386-*-solaris2 | YES | | | sparc-sun-solaris2 | YES | | | sparc-sun-openbsd | in-progress | | | m68k-apple-netbsd | in-progress | | | mips-sgi-irix65 | in-progress | | | | | | alpha-dec-osf3 | dies on host with: | | | | cc1: Invalid option `ieee' | +-----------------+--------------------+----------------------------+
I cannot miss this interesting thread , working with mips-sgi-irix65.
Could you release a (transient) ghc-6.01-unreg-hc.tar.gz ?
If not, Donald, please send it to me privately...
However, I will try to make cross-porting from i386-*-linux.
You need to generate a set for each arch/os combination. Unreg source for platforms I have confirmed to work are at: ftp://ftp.cse.unsw.edu.au/pub/users/dons/ghc/unreg/ i386-unknown-freebsd i386-unknown-linux i386-unknown-solaris2 sparc-sun-solaris2 m68k-unknown-netbsd I'll add more when I get a chance. If you want to unreg bootstrap for one of those platforms then untar the unreg tarball over a 6.0.1 src tree, and follow the latest distrib/hc-build instructions. I can't generate mips-sgi-irix65 because I don't have access to such a box, but I think this process is getting easier by the day, so generating your own set should be possible. -- Don

On Thu, Sep 04, 2003 at 10:41:49AM +0100, Simon Marlow wrote:
| | alpha-dec-osf3 | dies on host with: | | | | cc1: Invalid option `ieee' |
So all 32-bit platforms have worked or are looking good, but the 64 bit couldn't get of the host machine.
The problem you experienced on the Alpha has a perfectly rational explanation. The .hc files we generate on the host machine are designed to be compiled on the target machine only; it's entirely possible that the configuration of the compiler on the host machine may not be able to compile these .hc files to .o.
Ideally, the build system should know when it is cross-compiling .hc files and just generate .hc files (passing -C to GHC instead of -c -keep-hc-files). I thought about doing this, but quickly realised it would be a lot of work to get right. You might be able to hack around it with lots of 'make -k' on the host machine.
I have altered {libraries,hslibs}/mk/boilerplate.mk for b1 and ghc/mk/boilerplate.mk for b2 to include AR = /bin/true LD = /bin/true SRC_HC_OPTS += -pgmc /bin/true -pgma /bin/true -pgml /bin/true so it doesn't waste time building object files that are no use anyway as well as avoiding some issues like the above and, IIRC, inline assembly being used on some arches. Of course, alpha didn't build anyway due to the lack of memory allocation (I think) code for generic 64-bit platforms that I think was mentioned on one of the lists recently. Thanks Ian

simonmar:
dons:
No. They are perfect. I've stress tested them today :p
+-----------------+--------------------+----------------------------+ | HOST | TARGET | Unregisterised bootstrap | +-----------------+--------------------+----------------------------+ | i386-*-openbsd | i386-*-openbsd | YES | | | i386-*-freebsd | YES | | | i386-*-linux | YES | | | i386-*-solaris2 | YES | | | sparc-sun-solaris2 | YES | | | sparc-sun-openbsd | in-progress | | | m68k-apple-netbsd | in-progress | | | | | | | alpha-dec-osf3 | dies on host with: | | | | cc1: Invalid option `ieee' | +-----------------+--------------------+----------------------------+
So all 32-bit platforms have worked or are looking good, but the 64 bit couldn't get of the host machine.
(cough) I was a bit too soon reporting the sparc-sun-solaris2, two attempts have died with stg_ap_v_ret. Same result sparc-*-openbsd. Here's an updated list: +-----------------+--------------------+---------------------------+ | HOST | TARGET | Unregisterised bootstrap | +-----------------+--------------------+---------------------------+ | i386-*-openbsd | i386-*-openbsd | YES | | | i386-*-freebsd | YES | | | i386-*-linux | YES | | | i386-*-solaris2 | YES | | | | | | | sparc-sun-solaris2 | stg_ap_v_ret | | | sparc-sun-openbsd | stg_ap_v_ret | | | | | | | m68k-apple-netbsd | boots libs, dies in gmp | | | | | | | alpha-dec-osf3 | in progress | +-----------------+--------------------+---------------------------+ Is there an endianess thing here? What is the endianess of the amd64 and the powerpc? Are than any tricks I can try? -- Don

On Fri, Sep 05, 2003 at 02:56:19PM +1000, Donald Bruce Stewart wrote:
(cough)
I was a bit too soon reporting the sparc-sun-solaris2, two attempts have died with stg_ap_v_ret. Same result sparc-*-openbsd.
Here's an updated list:
+-----------------+--------------------+---------------------------+ | HOST | TARGET | Unregisterised bootstrap | +-----------------+--------------------+---------------------------+ | i386-*-openbsd | i386-*-openbsd | YES | | | i386-*-freebsd | YES | | | i386-*-linux | YES | | | i386-*-solaris2 | YES | | | | | | | sparc-sun-solaris2 | stg_ap_v_ret | | | sparc-sun-openbsd | stg_ap_v_ret | | | | | | | m68k-apple-netbsd | boots libs, dies in gmp | | | | | | | alpha-dec-osf3 | in progress | +-----------------+--------------------+---------------------------+
Maybe it would help if I show you what I have been using and you can look for differences? I'm not 100% sure that this will go through cleanly, but I hope it is now right. You need to copy mk/config.h from the target arch to the same place as the attached files on the host arch. You'll also need to change fptools_dir and arch near the top of cross-port. Then run ./cross-port on the host and copy the resulting tarball to the target along with one containing all the .hi files (if someone can spot why this is necessary, and how to fix it, that would be great!). Untar these over a source tree; you'll then need to do this to fix up a few files that get overwritten with broken links: find ghc-6.0.1 -type l > to_get tar -jxvf ghc-6.0.1-src.tar.bz2 -T to_get Finally: ../hc-build --enable-hc-boot-unregisterised --prefix=/wherever/you/want/it make install stage=1 on the target. I've got a sparc compile done (more or less) this way and make install on m68k has just finished and compiles hello world OK, which is promising :-) Thanks Ian
participants (4)
-
dons@cse.unsw.edu.au
-
Ian Lynagh
-
Rafael Martinez Torres
-
Simon Marlow