... | @@ -87,7 +87,7 @@ libraries: |
... | @@ -87,7 +87,7 @@ libraries: |
|
|
|
|
|
The first step in porting to a new platform is to get an
|
|
The first step in porting to a new platform is to get an
|
|
*unregisterised* build working. An unregisterised build is one that
|
|
*unregisterised* build working. An unregisterised build is one that
|
|
compiles via vanilla C only. Tist costs about a factor of two in
|
|
compiles via vanilla C only. This costs about a factor of two in
|
|
performance, but since unregisterised compilation is usually just a step
|
|
performance, but since unregisterised compilation is usually just a step
|
|
on the way to a full registerised port, we don't mind too much.
|
|
on the way to a full registerised port, we don't mind too much.
|
|
|
|
|
... | @@ -138,9 +138,8 @@ version). We will call the path to the root of this |
... | @@ -138,9 +138,8 @@ version). We will call the path to the root of this |
|
tree `<T>`.
|
|
tree `<T>`.
|
|
|
|
|
|
```wiki
|
|
```wiki
|
|
$ cd <T>
|
|
<T>$ sh boot
|
|
$ sh boot
|
|
<T>$ ./configure --enable-hc-boot
|
|
$ ./configure --enable-hc-boot
|
|
|
|
```
|
|
```
|
|
|
|
|
|
|
|
|
... | @@ -148,18 +147,17 @@ You might need to update `configure.ac` to recognise the new |
... | @@ -148,18 +147,17 @@ You might need to update `configure.ac` to recognise the new |
|
platform, and re-generate `configure` with `autoreconf`.
|
|
platform, and re-generate `configure` with `autoreconf`.
|
|
|
|
|
|
```wiki
|
|
```wiki
|
|
$ make bootstrapping-files
|
|
<T>$ make bootstrapping-files
|
|
```
|
|
```
|
|
|
|
|
|
**On the host machine**
|
|
**On the host machine**
|
|
|
|
|
|
|
|
|
|
Unpack a source tree (same released version, with the extra libs). Call this directory `<H>`.
|
|
Unpack a source tree (exactly the same version as before). Call this directory `<H>`.
|
|
|
|
|
|
```wiki
|
|
```wiki
|
|
$ cd <H>
|
|
<H>$ sh boot
|
|
$ sh boot
|
|
<H>$ ./configure
|
|
$ ./configure
|
|
|
|
```
|
|
```
|
|
|
|
|
|
|
|
|
... | @@ -202,7 +200,7 @@ be suitable for compiling on the target system. |
... | @@ -202,7 +200,7 @@ be suitable for compiling on the target system. |
|
Now build the compiler:
|
|
Now build the compiler:
|
|
|
|
|
|
```wiki
|
|
```wiki
|
|
$ make
|
|
<H>$ make
|
|
```
|
|
```
|
|
|
|
|
|
|
|
|
... | @@ -210,38 +208,36 @@ You may need to work around problems that occur due to differences |
... | @@ -210,38 +208,36 @@ You may need to work around problems that occur due to differences |
|
between the host and target platforms.
|
|
between the host and target platforms.
|
|
|
|
|
|
```wiki
|
|
```wiki
|
|
$ cd <H>
|
|
<H>$ rm -f list mkfiles boot.tar.gz
|
|
$ rm -f list mkfiles boot.tar.gz
|
|
<H>$ find . -name "*.hc" >> list
|
|
$ find . -name "*.hc" >> list
|
|
<H>$ find . -name "*_stub.*" >> list
|
|
$ find . -name "*_stub.*" >> list
|
|
<H>$ find . -name package-data.mk >> list
|
|
$ find . -name package-data.mk >> list
|
|
<H>$ find . -name package.conf >> list
|
|
$ find . -name package.conf >> list
|
|
<H>$ find . -name package.conf.inplace >> list
|
|
$ find . -name package.conf.inplace >> list
|
|
<H>$ echo compiler/main/Config.hs >> list
|
|
$ echo compiler/main/Config.hs >> list
|
|
<H>$ find . -name .depend | sed -e 's/^/mkdir -p `dirname /' -e 's/$/`/' >> mkfiles
|
|
$ find . -name .depend | sed -e 's/^/mkdir -p `dirname /' -e 's/$/`/' >> mkfiles
|
|
<H>$ find . -name .depend | sed "s/^/touch /" >> mkfiles
|
|
$ find . -name .depend | sed "s/^/touch /" >> mkfiles
|
|
<H>$ echo mkfiles >> list
|
|
$ echo mkfiles >> list
|
|
<H>$ tar -zcf boot.tar.gz -T list
|
|
$ tar -zcf boot.tar.gz -T list
|
|
|
|
```
|
|
```
|
|
|
|
|
|
**On the target machine**
|
|
**On the target machine**
|
|
|
|
|
|
```wiki
|
|
```wiki
|
|
$ cd <T>
|
|
<T>$ cp /bin/pwd utils/ghc-pwd/ghc-pwd
|
|
$ cp /bin/pwd utils/ghc-pwd/ghc-pwd
|
|
|
|
```
|
|
```
|
|
|
|
|
|
```wiki
|
|
```wiki
|
|
$ sh boot
|
|
<T>$ sh boot
|
|
$ ./configure --enable-hc-boot
|
|
<T>$ ./configure --enable-hc-boot
|
|
```
|
|
```
|
|
|
|
|
|
|
|
|
|
Unpack `<H>/boot.tar.gz` to `<T>/`.
|
|
Unpack `<H>/boot.tar.gz` to `<T>/`.
|
|
|
|
|
|
```wiki
|
|
```wiki
|
|
$ tar --touch -zxf boot.tar.gz
|
|
<T>$ tar --touch -zxf boot.tar.gz
|
|
$ sh mkfiles
|
|
<T>$ sh mkfiles
|
|
```
|
|
```
|
|
|
|
|
|
|
|
|
... | @@ -264,12 +260,12 @@ ghc_stage2_v_EXTRA_CC_OPTS += -Lgmp -lgmp -lm -lutil -lrt |
... | @@ -264,12 +260,12 @@ ghc_stage2_v_EXTRA_CC_OPTS += -Lgmp -lgmp -lm -lutil -lrt |
|
```
|
|
```
|
|
|
|
|
|
```wiki
|
|
```wiki
|
|
$ for c in libraries/*/configure; do ( cd `dirname $c`; ./configure ); done
|
|
<T>$ for c in libraries/*/configure; do ( cd `dirname $c`; ./configure ); done
|
|
```
|
|
```
|
|
|
|
|
|
```wiki
|
|
```wiki
|
|
$ sed -i .bak "s#<H>#<T>#g" */*/package-data.mk */*/*/package-data.mk
|
|
<T>$ sed -i .bak "s#<H>#<T>#g" */*/package-data.mk */*/*/package-data.mk
|
|
$ touch -r compiler/stage2/package-data.mk */*/package-data.mk */*/*/package-data.mk
|
|
<T>$ touch -r compiler/stage2/package-data.mk */*/package-data.mk */*/*/package-data.mk
|
|
```
|
|
```
|
|
|
|
|
|
|
|
|
... | @@ -277,11 +273,11 @@ Now make bootstrapping files; what we're really doing here is making |
... | @@ -277,11 +273,11 @@ Now make bootstrapping files; what we're really doing here is making |
|
libffi, and libgmp if necessary:
|
|
libffi, and libgmp if necessary:
|
|
|
|
|
|
```wiki
|
|
```wiki
|
|
$ make bootstrapping-files
|
|
<T>$ make bootstrapping-files
|
|
```
|
|
```
|
|
|
|
|
|
```wiki
|
|
```wiki
|
|
$ make all_ghc_stage2 2>&1 | tee log
|
|
<T>$ make all_ghc_stage2 2>&1 | tee log
|
|
```
|
|
```
|
|
|
|
|
|
|
|
|
... | | ... | |