summaryrefslogtreecommitdiff
path: root/Distrib/BuildingTheHurd.mdwn
diff options
context:
space:
mode:
authorOgnyan Kulev <ogi@fmi.uni-sofia.bg>2003-04-13 16:13:00 +0000
committerOgnyan Kulev <ogi@fmi.uni-sofia.bg>2003-04-13 16:13:00 +0000
commit644f76d81bd4177570a28a7824b1a0ea155f71de (patch)
treed1b87bcaa9e91301b3315812cc8452602488c1ae /Distrib/BuildingTheHurd.mdwn
parented7220469aa87c4b57ef3c004e1bda78a44224cf (diff)
none
Diffstat (limited to 'Distrib/BuildingTheHurd.mdwn')
-rw-r--r--Distrib/BuildingTheHurd.mdwn346
1 files changed, 157 insertions, 189 deletions
diff --git a/Distrib/BuildingTheHurd.mdwn b/Distrib/BuildingTheHurd.mdwn
index 80b8a01a..fb412eae 100644
--- a/Distrib/BuildingTheHurd.mdwn
+++ b/Distrib/BuildingTheHurd.mdwn
@@ -1,54 +1,26 @@
-<table align="center" width="75%">
- <tr>
- <td align="center" colspan="2"><nop><h2><a name="HowTo_setup_a_Hurd_cross_compile"> <nop>HowTo setup a Hurd cross-compiler in Linux </nop></a></h2></nop></td>
- </tr>
- <tr>
- <td><nop><h2><a name="Table_of_Contents"> Table of Contents </a></h2> %TOC% </nop></td>
- <td valign="top">
- <p> Created from the original by <a href="http://cvs.gentoo.org/~avenj/" target="_top">Jon Portnoy</a>, <a href="http://cvs.gentoo.org/~avenj/doc/xcompile-en.html" target="_top">http://cvs.gentoo.org/~avenj/doc/xcompile-en.html</a></p>
- <p><nop></nop></p>
- <h2><a name="Introduction"> Introduction </a></h2>
- <p> For a Linux to Hurd cross-compiler you need these versions (I tried newer versions of gcc but they won't compile) </p>
- <p>
- </p>
- <ul>
- <li><a href="http://ftp.gnu.org/gnu/binutils/" target="_top">binutils-2.13.90.0.16</a></li>
- </ul>
- <p>
- </p>
- <ul>
- <li> egcs-core-1.2.2 &amp;lt;- a very old version of gcc, but it is very stable, you will need it for compiling the gnumach headers and the mig kernel </li>
- </ul>
- <p>
- </p>
- <ul>
- <li><a href="http://ftp.gnu.org/gnu/gcc/" target="_top">gcc-core-2.95.2</a> &amp;lt;- for compiling hurd </li>
- </ul>
- <p>
- </p>
- <ul>
- <li><a href="http://ftp.gnu.org/gnu/glibc/" target="_top">glibc-2.2.5</a></li>
- </ul>
- <p>
- </p>
- <ul>
- <li><a href="http://ftp.gnu.org/gnu/gnumach/gnumach-1.3.tar.gz" target="_top">gnumach-1.3</a></li>
- </ul>
- <p>
- </p>
- <ul>
- <li><a href="http://ftp.gnu.org/gnu/mig/mig-1.3.tar.gz" target="_top">mig-1.3</a></li>
- </ul>
- <p>
- </p>
- <ul>
- <li><a href="http://www.gnu.org/software/hurd/download.html" target="_top">hurd</a></li>
- </ul>
- <p>
- </p>
- </td>
- </tr>
-</table>
+## <a name="Table_of_Contents"> Table of Contents </a>
+
+%TOC%
+
+Created from the original by [Jon Portnoy](http://cvs.gentoo.org/~avenj/), <http://cvs.gentoo.org/~avenj/doc/xcompile-en.html>
+
+## <a name="Introduction"> Introduction </a>
+
+For a Linux to Hurd cross-compiler you need these versions (I tried newer versions of gcc but they won't compile)
+
+* [binutils-2.13.90.0.16](http://ftp.gnu.org/gnu/binutils/)
+
+* egcs-core-1.2.2 &lt;- a very old version of gcc, but it is very stable, you will need it for compiling the gnumach headers and the mig kernel
+
+* [gcc-core-2.95.2](http://ftp.gnu.org/gnu/gcc/) &lt;- for compiling hurd
+
+* [glibc-2.2.5](http://ftp.gnu.org/gnu/glibc/)
+
+* [gnumach-1.3](http://ftp.gnu.org/gnu/gnumach/gnumach-1.3.tar.gz)
+
+* [mig-1.3](http://ftp.gnu.org/gnu/mig/mig-1.3.tar.gz)
+
+* [hurd](http://www.gnu.org/software/hurd/download.html)
## <a name="Building"> Building </a>
@@ -56,221 +28,215 @@
It is easier to compile the whole sources in an extra directory:
-* build/binutils &lt;- the unpacked binutils sources
+* `build/binutils` &lt;- the unpacked binutils sources
-* build/binutils.build
+* `build/binutils.build`
-* build/egcs &lt;- the unpacked egcs sources
+* `build/egcs` &lt;- the unpacked egcs sources
-* build/egcs.build
+* `build/egcs.build`
-* build/gcc &lt;- the unpacked gcc sources
+* `build/gcc` &lt;- the unpacked gcc sources
-* build/gcc.build
+* `build/gcc.build`
-* build/glibc &lt;- the unpacked glibc sources
+* `build/glibc` &lt;- the unpacked glibc sources
-* build/glibc.build
+* `build/glibc.build`
-* build/gnumach &lt;- the unpacked gnumach kernel sources
+* `build/gnumach` &lt;- the unpacked gnumach kernel sources
-* build/gnumach.build
+* `build/gnumach.build`
-* build/mig &lt;- the unpacked mig kernel sources
+* `build/mig` &lt;- the unpacked mig kernel sources
-* build/mig.build
+* `build/mig.build`
-* build/hurd &lt;- the unpacked hurd kernel sources
+* `build/hurd` &lt;- the unpacked hurd kernel sources
-* build/hurd.build
+* `build/hurd.build`
-### <a name="Exporting_the_CFLAG_and_PATH"> </a> Exporting the CFLAG and PATH
+### <a name="Exporting_the_CFLAGS_tt_and_PATH"> Exporting the `CFLAGS` and `PATH` </a>
-`/usr/local` is where the sources we compile will be installed. If you want to choose another directory you have to change the path to the bin directory and too you have to change the --prefix path to the directory you want.
+`/usr/local` is where the sources we compile will be installed. If you want to choose another directory you have to change the path to the bin directory and too you have to change the `--prefix` path to the directory you want.
- export CFLAGS="-march=i686 -O2 -fomit-frame-pointer"
+ $ export CFLAGS="-march=i686 -O2 -fomit-frame-pointer"
+ $ export PATH=/usr/local/bin:$PATH
- export PATH=/usr/local/bin:$PATH
+**_All commands that are prefixed by `#` must be run as root with `CFLAGS` and `PATH` exported._**
### <a name="Cross_binutils"> Cross binutils </a>
-cd binutils.build ../binutils/configure --prefix=/usr/local --target=i686-pc-gnu make make check
-
-make install (as root, and don't forget to export the CFLAGS and the PATH)
-
-cd ..
+ $ cd binutils.build
+ $ ../binutils/configure --prefix=/usr/local --target=i686-pc-gnu
+ $ make
+ $ make check
+ # make install
+ $ cd ..
### <a name="Cross_egcs"> Cross egcs </a>
When the `/usr/local/bin` directory do not exist before you will now have to export the `PATH` again because after installing binutils you will have it.
- cd egcs.build
- ../egcs/configure --prefix=/usr/local --target=i686-pc-gnu \
- --with-gnu-as --with-gnu-ld
- make -k
- make -k install (as root, don't forget to export CFLAGS and PATH)
- ln -s /usr/local/i686-pc-gnu /usr/local/lib/gcc-lib/i686-pc-gnu/egcs-2.91.66/i686-pc-gnu
- cd ..
+ $ cd egcs.build
+ $ ../egcs/configure --prefix=/usr/local --target=i686-pc-gnu \
+ --with-gnu-as --with-gnu-ld
+ $ make -k
+ # make -k install
+ $ ln -s /usr/local/i686-pc-gnu \
+ /usr/local/lib/gcc-lib/i686-pc-gnu/egcs-2.91.66/i686-pc-gnu
+ $ cd ..
-### <a name="GNUmach_Headers"> </a> GNUmach Headers
+### <a name="GNUmach_Headers"> GNUmach Headers </a>
- cd gnumach.build
- ../gnumach/configure --build=i686-pc-linux-gnu --host=i686-pc-gnu
- make -k install-headers prefix=/usr/local/i686-pc-gnu (as root ...)
- cd ..
+ $ cd gnumach.build
+ $ ../gnumach/configure --build=i686-pc-linux-gnu --host=i686-pc-gnu
+ # make -k install-headers prefix=/usr/local/i686-pc-gnu
+ $ cd ..
### <a name="Mig"> Mig </a>
Mig is the Mach Interface Generator - needed by Mach and the Hurd to create C code from their IDL files. Mig is what helps us do RPC without ever knowing much about it.
- cd mig.build
- ../mig/configure --target=i686-pc-gnu --host=i686-pc-linux-gnu \
- --prefix=/usr/local
- make
- make install (as root ...)
- cd ..
+ $ cd mig.build
+ $ ../mig/configure --target=i686-pc-gnu --host=i686-pc-linux-gnu \
+ --prefix=/usr/local
+ $ make
+ # make install
+ $ cd ..
### <a name="Gnumach_Headers_inclusive_Mig"> Gnumach Headers inclusive Mig </a>
-When you first compile the GNUmach headers Mig won't be mentioned (it wasn't installed actually) and this causes some errors when compiling the GNUmach headers but you need them to compile mig. (I do nt know if you have to do this but i think it is the better way)
-
- cd gnumach.build
- rm -r * (deletes every file and directory in this directory)
+When you first compile the GNUmach headers Mig won't be mentioned (it wasn't installed actually) and this causes some errors when compiling the GNUmach headers but you need them to compile mig. (I don't know if you have to do this but i think it is the better way)
- ../gnumach/configure --build=i686-pc-linux-gnu --host=i686-pc-gnu
- make -k install-headers prefix=/usr/local/i686-pc-gnu (as root ...)
- cd ..
+ $ cd gnumach.build
+ $ rm -r * (deletes every file and directory in this directory)
+ $ ../gnumach/configure --build=i686-pc-linux-gnu --host=i686-pc-gnu
+ # make -k install-headers prefix=/usr/local/i686-pc-gnu
+ $ cd ..
-### <a name="Cross_GCC"> </a> Cross GCC
+### <a name="Cross_GCC"> Cross GCC </a>
For the coexistence of EGCS and GCC you have to move the `/usr/local/bin/i686-pc-gnu-gcc` to the `/usr/local/bin` directory in `i686-pc-gnu-egcs`. So you can choose wich compiler you want use: with the `CC` environment variable set to `i686-pc-gnu-egcs` you can use EGCS without this command you use GCC.
- mv /usr/local/bin/i686-pc-gnu-gcc /usr/local/bin/i686-pc-gnu-egcs
+ # mv /usr/local/bin/i686-pc-gnu-gcc \
+ /usr/local/bin/i686-pc-gnu-egcs
- cd gcc.build
- ../gcc/configure --prefix=/usr/local --target=i686-pc-gnu --with-gnu-as --with-gnu-ld
- make -k compile the glibc-headers)
- sudo make -k install
- cd ..
- ln -s /usr/local/i686-pc-gnu/ /usr/local/lib/gcc-lib/i686-pc-gnu/2.95.2/i686-pc-gnu
+ $ cd gcc.build
+ $ ../gcc/configure --prefix=/usr/local --target=i686-pc-gnu \
+ --with-gnu-as --with-gnu-ld
+ $ make -k compile the glibc-headers)
+ # make -k install
+ $ cd ..
-You need `make -k` because otherwise it will fail but with -k you will have everything you need.
+ # ln -s /usr/local/i686-pc-gnu/ \
+ /usr/local/lib/gcc-lib/i686-pc-gnu/2.95.2/i686-pc-gnu
-### <a name="Hurd_Headers"> Hurd Headers </a>
+You need `make -k` because otherwise it will fail but with `-k` you will have everything you need.
- cd hurd.build
+### <a name="Hurd_Headers"> Hurd Headers </a>
- ../hurd/configure --build=i686-pc-linux-gnu -�host=i686-pc-gnu \
- -�prefix=/usr/local/i686-pc- gnu --disable-profile
- make install-headers no_deps=t (as root ...)
- cd ..
+ $ cd hurd.build
+ $ ../hurd/configure --build=i686-pc-linux-gnu -�host=i686-pc-gnu \
+ -�prefix=/usr/local/i686-pc-gnu --disable-profile
+ # make install-headers no_deps=t
+ $ cd ..
### <a name="Cross_GLibC"> Cross GLibC </a>
-For having glibc compiled with the cross-gcc and not with your original gcc you have to export another PATH. The normal user who configures and compiles and also root has to export this PATH.
+For having glibc compiled with the cross-gcc and not with your original gcc you have to export another `PATH`. The normal user who configures and compiles and also root has to export this `PATH`.
- export PATH=/usr/local/bin:/usr/local/i686-pc-gnu/bin:$PATH
-
- cd glibc.build
- ../glibc/configure --without-cvs --enable-add-ons=crypt --disable-profile \
- --build=i686-pc-linux-gnu --host=i686-pc-gnu \
- --prefix=/usr/local/i686-pc-gnu
+ $ export PATH=/usr/local/bin:/usr/local/i686-pc-gnu/bin:$PATH
+ $ cd glibc.build
+ $ ../glibc/configure --without-cvs --enable-add-ons=crypt \
+ --disable-profile --build=i686-pc-linux-gnu \
+ --host=i686-pc-gnu --prefix=/usr/local/i686-pc-gnu
AS ROOT WITH EXPORTED CFLAGS:
- export PATH=/usr/local/bin:/usr/local/i686-pc-gnu/bin:$PATH
-
- make -k install-headers install_root=/usr/local/i686-pc-gnu
-
- cp ../glibc/include/features.h /usr/local/i686-pc-gnu/include/features.h
- touch /usr/local/i686-pc-gnu/include/gnu/stubs.h
- cd ..
+ # export PATH=/usr/local/bin:/usr/local/i686-pc-gnu/bin:$PATH
+ # make -k install-headers install_root=/usr/local/i686-pc-gnu
+ # cp ../glibc/include/features.h \
+ /usr/local/i686-pc-gnu/include/features.h
+ # touch /usr/local/i686-pc-gnu/include/gnu/stubs.h
+ $ cd ..
### <a name="Building_Cross_egcs"> Building Cross egcs </a>
- mv /usr/local/bin/i686-pc-gnu-gcc /usr/local/bin/i686-pc-gnu-foo (for protecting gcc)
-
- mv /usr/local/bin/i686-pc-gnu-egcs /usr/local/bin/i686-pc-gnu-gcc
-
- cd egcs.build
- make
- make install (as root, export CFLAGS and the NEW PATH)
+ # mv /usr/local/bin/i686-pc-gnu-gcc \
+ /usr/local/bin/i686-pc-gnu-foo (for protecting gcc)
+ # mv /usr/local/bin/i686-pc-gnu-egcs \
+ /usr/local/bin/i686-pc-gnu-gcc
+ $ cd egcs.build
+ $ make
+ # make install (as root, export CFLAGS and the NEW PATH)
+ $ cd ..
+ # mv /usr/local/bin/i686-pc-gnu-gcc \
+ /usr/local/bin/i686-pc-gnu-egcs
+ # mv /usr/local/bin/i686-pc-gnu-foo \
+ /usr/local/bin/i686-pc-gnu-gcc
- cd ..
+### <a name="Building_Cross_GCC"> Building Cross GCC </a>
- mv /usr/local/bin/i686-pc-gnu-gcc /usr/local/bin/i686-pc-gnu-egcs
+ $ cd gcc.build
+ $ make
+ # make install
+ $ cd ..
- mv /usr/local/bin/i686-pc-gnu-foo /usr/local/bin/i686-pc-gnu-gcc
-
-### <a name="Building_Cross_GCC"> </a> Building Cross GCC
-
- cd gcc.build
-
- make
-
- sudo make install
-
- cd ..
-
-Remember to export CFLAGS and the new PATH
+Remember to export `CFLAGS` and the new `PATH`
### <a name="Building_Cross_GLibC"> Building Cross GLibC </a>
- cd glibc.build
-
- make
-
- sudo make install root_install=/usr/local/i686-pc-gnu
+ $ cd glibc.build
+ $ make
+ # make install root_install=/usr/local/i686-pc-gnu
-Remember to export CFLAGS and the new PATH
+Remember to export `CFLAGS` and the new `PATH`
For solving a glibc bug you have to link the `/usr/local/i686-pc-gnu/include/libc.so.0.2` with the `/usr/local/i686-pc-gnu/lib/libc.so` ever when you (re)install glibc.
- ln -sf /usr/local/i686-pc-gnu/lib/libc.so.0.2 /usr/local/i686-pc-gnu/lib/libc.so
-
-### <a name="Install_the_GNUmach_kernel_somew"> </a> Install the GNUmach kernel somewhere
-
- rm -r gnumach.build
+ # ln -sf /usr/local/i686-pc-gnu/lib/libc.so.0.2 \
+ /usr/local/i686-pc-gnu/lib/libc.so
- mkdir gnumach.build
+### <a name="Install_the_GNUmach_kernel_somew"> Install the GNUmach kernel somewhere </a>
- cd gnumach.build
+ $ rm -r gnumach.build
+ $ mkdir gnumach.build
+ $ cd gnumach.build
-You will need more than the -�target and -�host variables to build the GNUmach kernel. You have to enable some kernel features with the --enable command to have your kernel working properly. To have a quick view of what you need you can edit the gnumach/i386/README-Drivers (I do not know how old it is, so maybe there are more options available but i haven't searched for more).
+You will need more than the `-�target` and `-�host` variables to build the GNUmach kernel. You have to enable some kernel features with the `--enable` command to have your kernel working properly. To have a quick view of what you need you can view the `gnumach/i386/README-Drivers` (I do not know how old it is, so maybe there are more options available but i haven't searched for more).
My configure command:
- ../gnumach/configure --build=i686-pc-linux-gnu --host=i686-pc-gnu �-enable-lpr \
- --enable-floppy --enable-ide --enable-aic7xxx \
- �-enable-rtl8139
-
- ln -s /usr/local/i686-pc-gnu/include /where/you/want/to/install/the/kernel/include
-
- ln -s /usr/locali686-pc-gnu/lib /where/you/want/to/install/the/kernel/lib
-
- make
-
- make install-kernel prefix=/where/you/want/to/install/the/kernel (as root ...)
+ $ ../gnumach/configure --build=i686-pc-linux-gnu \
+ --host=i686-pc-gnu �-enable-lpr \
+ --enable-floppy --enable-ide \
+ --enable-aic7xxx �-enable-rtl8139
+ # ln -s /usr/local/i686-pc-gnu/include \
+ /where/you/want/to/install/the/kernel/include
+ # ln -s /usr/locali686-pc-gnu/lib \
+ /where/you/want/to/install/the/kernel/lib
+ $ make
+ # make install-kernel \
+ prefix=/where/you/want/to/install/the/kernel (as root ...)
### <a name="Hurd_Servers"> Hurd Servers </a>
-rm -r hurd.build
-
-mkdir hurd.build
+ $ rm -r hurd.build
+ $ mkdir hurd.build
+ $ cd hurd.build
+ $ nano -w/vi (or what editor you ever use) ../hurd/Makeconf
-cd hurd.build
+You have to comment out the `CFLAGS` in this file or delete the `-std=gnu99` and the `-O3`.
-nano -w/vi (or what editor you ever use) ../hurd/Makeconf
+ $ ../hurd/configure �build=i686-pc-linux-gnu \
+ --host=i686-pc-gnu \
+ -�prefix=/where/you/want/to/install/the/kernel \
+ --disable-profile
+ $ make -k
+ # make -k install prefix=/where/you/want/to/install/the/kernel
-You have to comment out the CFLAGS in this file or delete the -std=gnu99 and the -03.
-
- ../hurd/configure �build=i686-pc-linux-gnu --host=i686-pc-gnu -�prefix=/where/you/want/to/install/the/kernel --disable-profile
-
- make -k
-
- make -k install prefix=/where/you/want/to/install/the/kernel
-
-You have to use -k because when you don't use it the compilation will brake with an error. I tried different installations of gcc and glibc and too i used different versions of hurd but i cannot solve this prob so maybe it is hurd related.
+You have to use `-k` because when you don't use it the compilation will brake with an error. I tried different installations of gcc and glibc and too i used different versions of hurd but i cannot solve this prob so maybe it is hurd related.
So there is no warranty that the hurd kernel you compiled will work. I will try it and then update this guide.
@@ -281,3 +247,5 @@ So there is no warranty that the hurd kernel you compiled will work. I will try
Created from the original, <http://cvs.gentoo.org/~avenj/doc/xcompile-en.html>, by [Jon Portnoy](http://cvs.gentoo.org/~avenj/)
I would recommend not using EGCS, but instead using the GCC cross compiler. See [[Hurd/BuildingHurd]] and [[Mach/BuildingOskitMach]] for more information on building the GNU OS components. <br />-- [[Main/JoachimNilsson]] - 13 Apr 2003
+
+Text formatting. <br />-- [[Main/OgnyanKulev]] - 13 Apr 2003