Differences between revisions 2 and 19 (spanning 17 versions)
Revision 2 as of 2007-10-12 01:51:01
Size: 895
Editor: ?quitte
Comment:
Revision 19 as of 2009-03-16 22:31:55
Size: 5743
Editor: HectorOron
Comment:
Deletions are marked like this. Additions are marked like this.
Line 1: Line 1:
= dpkg =
First of all dpkg needs to be told about uclibc-<arch> architectures. Those instructions are for post-etch. Look below for instructions for etch. Add to /usr/share/dpkg/triplettable (literally, you may copy and paste):
{{{
uclibc-linux-<cpu> uclibc-<cpu>
}}}
And to /usr/share/dpkg/ostable add this:
{{{
uclibc-linux linux-uclibc linux[^-]*-uclibc
}}}
For etch just add this to ostable instead:
{{{
uclibc linux-uclibc linux[^-]*(-uclibc.*)?
}}}
Now dpkg-architecture -auclibc-<arch> should give you reasonable output:
{{{
:~$dpkg-architecture -auclibc-i386
dpkg-architecture: warning: Specified GNU system type i486-linux-uclibc does not match gcc system type i486-linux-gnu.
DEB_BUILD_ARCH=i386
DEB_BUILD_ARCH_OS=linux
DEB_BUILD_ARCH_CPU=i386
DEB_BUILD_GNU_CPU=i486
DEB_BUILD_GNU_SYSTEM=linux-gnu
DEB_BUILD_GNU_TYPE=i486-linux-gnu
DEB_HOST_ARCH=uclibc-i386
DEB_HOST_ARCH_OS=linux
DEB_HOST_ARCH_CPU=i386
DEB_HOST_GNU_CPU=i486
DEB_HOST_GNU_SYSTEM=linux-uclibc
DEB_HOST_GNU_TYPE=i486-linux-uclibc
}}}
Line 2: Line 33:
To be able to build the linux-libc-dev packages a few changes have to be made. It is not possible yet to build kernel packages so you'll have to disable that. Also the rules file uses DEB_HOST_ARCH when DEB_HOST_ARCH_CPU seems to be perfectly fine. Finally the cntrol file gets generated by a python script which doesn't add uclibc-<arch> to the Architecture fields. The directory name changed! this section needs updating
To be able to build the linux-libc-dev packages a few changes have to be made. It is not possible yet to build kernel packages so you'll have to disable that. Also the rules file uses DEB_HOST_ARCH when DEB_HOST_ARCH_CPU seems to be perfectly fine for most arches. Unfortunately DEB_HOST_ARCH and DEB_HOST_ARCH_CPU aren't the same for armel. But as far as I can tell this might still work. Finally the control file gets generated by a python script which doesn't add uclibc-<arch> to the Architecture fields.
Line 7: Line 39:
Now you have to disable building kernel images. To do so edit debian/arch/<arch>/defines and in the [base] section comment all flavors and subarches. For i386 the resulting first lines should be like this: Now you have to disable building kernel images. To do so edit debian/config/<arch>/defines and in the [base] section comment all flavours and subarches. For i386 the resulting first lines should be something like this:
Line 10: Line 42:
{{{[base] {{{
[base]
Line 25: Line 58:
 ---- Now change debian/rules. All entries that are foo-$(DEB_HOST_ARCH) need to be changed to foo-$(DEB_HOST_ARCH_CPU). source-$(DEB_HOST_ARCH_CPU), setup-$(DEB_HOST_ARCH_CPU), build-$(DEB_HOST_ARCH_CPU), binary-arch-$(DEB_HOST_ARCH_CPU) and setup-$(DEB_HOST_ARCH_CPU)-real.

leave this alone:
{{{
DEB_HOST_ARCH := $(shell dpkg-architecture -qDEB_HOST_ARCH)
}}}

Now run debian/rules clean You should be told that the control file was created:
{{{
This target is made to fail intentionally, to make sure
that it is NEVER run during the automated build. Please
ignore the following error, the debian/control file has
been generated SUCCESSFULLY.
}}}

So it's time to change the control file. Open debian/control in an editor and search for your <arch>. So for i386 search for i386. If it is in an Architecture line add uclibc-<arch> (uclibc-i386). Repeat until your uclibc-<arch> is added to all Architecture lines. Here's an example:
{{{
Architecture: alpha amd64 arm armel hppa i386 ia64 m68k mips mipsel powerpc s390 sparc
becomes:
Architecture: alpha amd64 arm armel hppa i386 uclibc-i386 ia64 m68k mips mipsel powerpc s390 sparc
and
Architecture: i386
becomes:
Architecture: i386 uclibc-i386
}}}

Now everything should be fine and the Package can be built as usual. Generating the html docs takes a lot of time. So you might want to use -B instead of -b for dpkg-buildpackage:
{{{
dpkg-buildpackage -B -rfakeroot -auclibc-i386
}}}
= binutils =
To build binutils look at the debian/README.cross file that comes with the source.
{{{
TARGET=uclibc-mipsel fakeroot debian/rules binary-cross
}}}
= libuclibc-bootstrap =
since gcc-4.3 the libc headers are needed for gcc first pass.
Get the source from uclibc.org and untar this inside: http://lists.debian.org/debian-embedded/2008/03/bz2P7ugnDbWlL.bz2 and build it with DEB_CROSS_BOOTSTRAP=yes dpkg-buildpackage -auclibc-i386 ....
then install the package with dpkg-cross.
= gcc first pass =
The patch in the emdebian mailinglist shopuld work.
Just apply it and prepend DEB_CROSS_BOOTSTRAP=yes to the normal cross build.
Dependencies are not fixed yet. just ignore them
It'll take some time until I can make the patches work again. In the meantime you might want to try building gcc manually. The trick is use make all-gcc and make install-gcc instead of doing a full build. The Cross Linux From Scratch doumentation is a good reference.
 * build without common libs and common pkgs if DEB_CROSS_BOOTSTRAP=yes (rules.default)
 * change rules.defs to not build objc++, c++ and without ssp if DEB_CROSS_BOOTSTRAP=yes (rules.default)
 * make all-gcc and install-gcc if DEB_CROSS_BOOTSTRAP=yes (rules2)
 * disable threads and shared libraries (rules2)
 * probably some more, also the dependencies are most likely broken. but I want to look at the results of this before doing anything additionally

Unfortunately for now you are on your own for the time being. But building the bootstrap compiler the way it is describe in the CLFS book should do the trick
= uclibc first pass =
now do a normal build and install libuclibc-dev and its dependencies with dpkg-cross
= libexpat =
gettext may want it
= gettext =
If you want native language support you will need libintl, which uclibc doesn't support. So instead build it from gettext.
= gcc second pass =
try WITHOUT_LANG=nls until there are gettext packages
= final uclibc =
repeat the first pass.
= ToDo =
double check every step and fill in the missing parts. At the moment I'm using this page to not forget stuff.
----

dpkg

First of all dpkg needs to be told about uclibc-<arch> architectures. Those instructions are for post-etch. Look below for instructions for etch. Add to /usr/share/dpkg/triplettable (literally, you may copy and paste):

uclibc-linux-<cpu>      uclibc-<cpu>

And to /usr/share/dpkg/ostable add this:

uclibc-linux    linux-uclibc    linux[^-]*-uclibc

For etch just add this to ostable instead:

uclibc          linux-uclibc    linux[^-]*(-uclibc.*)?

Now dpkg-architecture -auclibc-<arch> should give you reasonable output:

:~$dpkg-architecture -auclibc-i386
dpkg-architecture: warning: Specified GNU system type i486-linux-uclibc does not match gcc system type i486-linux-gnu.
DEB_BUILD_ARCH=i386
DEB_BUILD_ARCH_OS=linux
DEB_BUILD_ARCH_CPU=i386
DEB_BUILD_GNU_CPU=i486
DEB_BUILD_GNU_SYSTEM=linux-gnu
DEB_BUILD_GNU_TYPE=i486-linux-gnu
DEB_HOST_ARCH=uclibc-i386
DEB_HOST_ARCH_OS=linux
DEB_HOST_ARCH_CPU=i386
DEB_HOST_GNU_CPU=i486
DEB_HOST_GNU_SYSTEM=linux-uclibc
DEB_HOST_GNU_TYPE=i486-linux-uclibc

linux-libc-dev:

The directory name changed! this section needs updating To be able to build the linux-libc-dev packages a few changes have to be made. It is not possible yet to build kernel packages so you'll have to disable that. Also the rules file uses DEB_HOST_ARCH when DEB_HOST_ARCH_CPU seems to be perfectly fine for most arches. Unfortunately DEB_HOST_ARCH and DEB_HOST_ARCH_CPU aren't the same for armel. But as far as I can tell this might still work. Finally the control file gets generated by a python script which doesn't add uclibc-<arch> to the Architecture fields.

Get the source apt-get source linux-libc-dev and change into the source directory. Now you have to disable building kernel images. To do so edit debian/config/<arch>/defines and in the [base] section comment all flavours and subarches. For i386 the resulting first lines should be something like this:

[base]
flavours:
# 486
# 686
# k7
# 686-bigmem
# amd64
kernel-arch: i386 uclibc-i386
kernel-header-dirs: i386 x86_64
subarches:
# vserver
# xen
# xen-vserver

Now change debian/rules. All entries that are foo-$(DEB_HOST_ARCH) need to be changed to foo-$(DEB_HOST_ARCH_CPU). source-$(DEB_HOST_ARCH_CPU), setup-$(DEB_HOST_ARCH_CPU), build-$(DEB_HOST_ARCH_CPU), binary-arch-$(DEB_HOST_ARCH_CPU) and setup-$(DEB_HOST_ARCH_CPU)-real.

leave this alone:

DEB_HOST_ARCH  := $(shell dpkg-architecture -qDEB_HOST_ARCH)

Now run debian/rules clean You should be told that the control file was created:

This target is made to fail intentionally, to make sure
that it is NEVER run during the automated build. Please
ignore the following error, the debian/control file has
been generated SUCCESSFULLY.

So it's time to change the control file. Open debian/control in an editor and search for your <arch>. So for i386 search for i386. If it is in an Architecture line add uclibc-<arch> (uclibc-i386). Repeat until your uclibc-<arch> is added to all Architecture lines. Here's an example:

Architecture: alpha amd64 arm armel hppa i386 ia64 m68k mips mipsel powerpc s390 sparc
becomes:
Architecture: alpha amd64 arm armel hppa i386 uclibc-i386 ia64 m68k mips mipsel powerpc s390 sparc
and
Architecture: i386
becomes:
Architecture: i386 uclibc-i386

Now everything should be fine and the Package can be built as usual. Generating the html docs takes a lot of time. So you might want to use -B instead of -b for dpkg-buildpackage:

dpkg-buildpackage -B -rfakeroot -auclibc-i386

binutils

To build binutils look at the debian/README.cross file that comes with the source.

TARGET=uclibc-mipsel fakeroot debian/rules binary-cross

libuclibc-bootstrap

since gcc-4.3 the libc headers are needed for gcc first pass. Get the source from uclibc.org and untar this inside: http://lists.debian.org/debian-embedded/2008/03/bz2P7ugnDbWlL.bz2 and build it with DEB_CROSS_BOOTSTRAP=yes dpkg-buildpackage -auclibc-i386 .... then install the package with dpkg-cross.

gcc first pass

The patch in the emdebian mailinglist shopuld work. Just apply it and prepend DEB_CROSS_BOOTSTRAP=yes to the normal cross build. Dependencies are not fixed yet. just ignore them It'll take some time until I can make the patches work again. In the meantime you might want to try building gcc manually. The trick is use make all-gcc and make install-gcc instead of doing a full build. The Cross Linux From Scratch doumentation is a good reference.

  • build without common libs and common pkgs if DEB_CROSS_BOOTSTRAP=yes (rules.default)
  • change rules.defs to not build objc++, c++ and without ssp if DEB_CROSS_BOOTSTRAP=yes (rules.default)
  • make all-gcc and install-gcc if DEB_CROSS_BOOTSTRAP=yes (rules2)
  • disable threads and shared libraries (rules2)
  • probably some more, also the dependencies are most likely broken. but I want to look at the results of this before doing anything additionally

Unfortunately for now you are on your own for the time being. But building the bootstrap compiler the way it is describe in the CLFS book should do the trick

uclibc first pass

now do a normal build and install libuclibc-dev and its dependencies with dpkg-cross

libexpat

gettext may want it

gettext

If you want native language support you will need libintl, which uclibc doesn't support. So instead build it from gettext.

gcc second pass

try WITHOUT_LANG=nls until there are gettext packages

final uclibc

repeat the first pass.

ToDo

double check every step and fill in the missing parts. At the moment I'm using this page to not forget stuff.