How to create custom toolchain in debian way

Hi Team,

We would like to create in house cross compiler tool chain in debian way for arm(Dragon 410C boards). The tool chain consists of glibc, gcc, binutils. The way is to get the source code of the tool chain and build them as ‘.deb’ for arm target. We followed different methods to get the debians as below.

Method 1:

  1. dpkg --add-architecture
    E.g: dpkg --add-architecture i386

  2. apt-get build-dep
    Ex: apt-get build-dep binutils

  3. apt-get source -b

Using the above method we created binutils debian for ARM processor(binutils-aarch64-linux-gnu_2.26.1-ubunu-16.04.6_amd64.deb) successfully. But when we are trying to build the arm debians for glibc, we are able to create them only for x86 and i386 architectures but not for arm architecture.

We tried doing it with pbuilder as well. Here is the procedure we followed.

  1. sudo apt-get install pbuilder debootstrap devscripts
  2. sudo pbuilder create --debootstrapopts --variant=buildd
  3. sudo OS=debian pbuilder --build --distribution wheezy --architecture armhf --basetgz /var/cache/pbuilder/debian-wheezy-armhf-base.tgz ./glibc_2.23-0ubuntu10.dsc

We are not able to create tarball for xenial debian version itself.

Can you please help to resolve this issue.

Best Regards,
Santosh.

I’m not sure building glibc for the cross toolchains is the debian way! Normally you would get the cross-toolchain to use the glibc package from the target architecture:
https://wiki.debian.org/MultiarchCrossToolchainBuild

Note also that there’s not really anything 96Boards specific here (an Arm toolchain for Debian has nothing tying it to Dragonboard 410C) so if you want to learn the right Debian way you might be better off discussing it in the Debian channels.

Note also that @protocoder has been asking a similar question recently. They have a Hikey960 but as I said neither question is related to 96Boards… a toolchain is a toolchain.