» | Kernel Trees | |||||
» | Tebecai | |||||
frodo.looijaard.name | » | Documentation | » | Glibc-2 (libc6) | » | Examples |
» | Copyrights | |||||
» | Introduction | |||||
» | Other docs | |||||
» | Overview | |||||
» | Downloads | |||||
» | Preliminaries | |||||
» | gcc | |||||
» | ld.so | |||||
» | binutils | |||||
» | libc6 | |||||
» | gcc (cross) | |||||
» | libc5 | |||||
» | libc++ | |||||
» | Cleaning up | |||||
» | Going on | |||||
» | Known problems | |||||
» | Essay | |||||
» | Changelog |
Note that this documentation is historic. It may no longer be very relevant. There will be no updates or further releases.
⇐ Previous | ⇑ Parent |
Next ⇒ |
Here you can find several examples of using the newly created glibc-2 compilation environment.
In the third step of the installation, we have created some binary cross-utilties. These binary utilties operate on glibc-2 files, but the utilities themselves are libc-5 executables. It is very easy to recompile them and install them as glibc-2 executables: they will then be native utilties instead of cross-utilties (this is of course only possible because our platform can execute both formats).
I will assume you use bash as shell; if not, some commands may slightly differ. I will explain each step. Note that this is a global overview, and more extensive explanations can be found at the main binutils page. Remember to apply the patches on that page first - except for the third patch (softlinks), as they will do more harm than good in this case.
(bash) export PATH="/usr/i486-linux-libc6/bin:$PATH"
Enter the glibc-2 compilation environment.
(bash) ./configure i486-pc-linux-gnu \
--enable-targets=i486-pc-linux-gnulibc1,i486-pc-linux-gnu \
--verbose --prefix=/usr \
--libdir=/usr/i486-linux-libc6/lib \
--includedir=/usr/i486-linux-libc6/include \
--bindir=/usr/i486-linux-libc6/bin
Our host format is i486-pc-linux-gnu
, as we are now in the glibc-2 compilation environment. Our target format must also be i486-pc-linux-gnu
. The --prefix
and --whateverdir
arguments are fairly typical, if you are configuring in the libc6-environment. Basically, you want everything installed on the usual places, except for the libraries and include files. In this specific case, the binaries also go into another directory, but usually you should not specify it.
Now edit ld/Makefile
to change the tdir*
variables.
(bash) make target_alias=i486-linux-libc6
This is the same command we used when creating the cross-utilties.
(bash) make install install-info target_alias=i486-linux-libc6
(bash) install -o root -g root -m 755 binutils/{ar,ranlib} \
/usr/i486-linux-libc6/bin
(bash) install -o root -g root -m 755 gprof/gprof /usr/i486-linux-libc6/bin
(bash) install -o root -g root -m 755 gas/as-new /usr/i486-linux-libc6/bin/as
(bash) install -o root -g root -m 755 gas/gasp-new \
/usr/i486-linux-libc6/bin/gasp
(bash) install -o root -g root -m 755 ld/ld-new /usr/i486-linux-libc6/bin/ld
(bash) install -o root -g root -m 755 binutils/nm-new \
/usr/i486-linux-libc6/bin/nm
(bash) install -o root -g root -m 755 binutils/strip-new \
/usr/i486-linux-libc6/bin/strip
There is a slight problem with the install target in the Makefiles, which inhibits the installation of most binaries if the tooldir is the same as the bindir. It would not be difficult to write a patch for it, but installing things by hand is not so bad either.
That's all! The only big difference lies in the places we install the files, and of course how we specify our host machine for configure.
If you wanted to, you could even generate cross-utilties which operate on libc-5 files, but are themselves glibc-2 executables, though I do not recommend it until glibc-2 is out of beta testing (hint: use the same configure line as above, but add --target=i486-pc-linux-gnulibc1
).
⇐ Previous | ⇑ Parent |
Next ⇒ |