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}}}


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/arch/<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 }}}


To build binutils look at the debian/README.cross file that comes with the source. {{{TARGET=uclibc-mipsel fakeroot debian/rules binary-cross }}}

gcc first pass

As quite a few things in the buildsystem changed recently 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.

uclibc first pass

gcc second pass

final uclibc