Debian ARM toolchain for HiKey


#1

Dear experts
We want to build arm toolchain in Debian for hikey, (build pc: Ubuntu 16.0.4)
No matter how we build, if successful the glibc is generated from i386 or amd but not for ARM
Really need your help

What we did till now:

  1. We used debian architecture name and pointed arm package to abel.debian.org / amdahl.debian.org
  2. autotools-dev package to ensure latest config.sub and config.guess files
  3. The debian name for the architecture is arm64; and NOT have aarch64-linux-gnu.
  4. GCC defines aarch64 for the architecture.

Still we get lot of errors as attached for glibc.png

We tried with pbuilder as well, ensuring target board is hikey and for arm machine, we get errors in pbuilder as well but I think we are doing some thing wrong which you can help us…

Thanks in Advance


#2

There’s no attachment glibc.png.

Anyway, you can use Linaro ABE tool framework to build cross arm toolchain. See https://wiki.linaro.org/ABE for details.

Linaro prebuilt toolchains can be found here: http://releases.linaro.org/components/toolchain/binaries. If you can use these, you don’t have to build.


#3

Hi vchong

Thank yo for your prompt reply. Sorry just learned how to attach files. As we are supposed to do custom build the image, please confirm, if we build image as per https://wiki.linaro.org/ABE, is it debian way.


#4

You’re welcome. What exactly do you need to custom for the build? Some specific or modified version of glibc or gcc? Not sure what you mean by Debian tools or Debian way. You can use ABE on Debian and it will build for you a cross toolchain that you can use to compile binaries for HiKey.


#5

Thank you vChong for the patience.

  1. Build hikey ARM tool chain and flash the image in Debian
  2. Once done, we may add a few libraries as new packages and build again. - later
    So we need the following help
  3. Please suggest us to most stable debian arm mirrorsite (wheezy, or jessy etc)
  4. Components:
  5. Debootstrapopts: Please advice what we point to
  6. Example of the following
    To use debconf inside pbuilder, setting DEBIAN_FRONTEND to “readline” in pbuilderrc should work. Setting it to “dialog” should also work, but make sure whiptail or dialog is installed inside the chroot.

In short please can you suggest a sample pbuilder, where I can re-use.

I think, we need all the above data, if we have to use ABE. Most of the issues, we face would go away and with the knowledge of these

Thanks in advance and sorry for bothering.


#6

Sorry but I’m not familiar with debootstrapopts and pbuilder. A toolchain is a toolchain so not sure why you must stick with specific tools. Hopefully others can chip in.


#7

You can maybe also try asking at Linaro irc’s toolchain channel: https://www.linaro.org/contact/irc. There might be some Ubuntu/Debian guys there.


#8

Hi vChong

I thank you for advice, I will build using Linaro ABE, please can you confirm the following. I know nothing about the flags

Host system: Ubuntu 16.0.4 32 bit
Target system: Hikey ARM 64 bit and
Native 32 bit

  1. https://git.linaro.org/toolchain/abe.git; 2017-04-27 Touch all C files after checkout (Stable)
    2.mkdir _build;
  2. cd _build
  3. …/abe/configure
  4. abe.sh --target aarch64-elf --set libc=eglibc --build all

Thanks in Advance


#9

I’m not sure about a 32 bit host. You can try but might be easier to use a 64 bit host.

  1. Please use master branch. Stable looks old.
  2. Make sure you don’t have any missing dependencies after running this command.
  3. Do you really need a baremetal (aarch64-elf) target? If not, then use aarch64-linux-gnu. Do you really need eglibc? It has been discontinued. If not, then just remote the ‘–set libc=’ option.

#10

Thank you vchong . I owe you.
Handling total newcomers like me is not easy.

Constrained by the systems given to us by client. I will however try for 64 bit

  1. Thank you, will follow
  2. Yes I noted it down which is defined in the site

Regarding 3. I read in https://wiki.debian.org/Arm64Port
that gnu name is different to debian name… that confuses me. It seems debian architecture name is arm64 only. ( Please can you provide me references for these nomenclature a standard all the tools follow)
Yes I will use aarch64-linux-gnu, as we are not building for baremetal. regarding eglibc, I saw that option and wanted to make it doubly sure we are building debian glibc.

Please can I know, which command or git reference is making sure that I get only debian packages.

Thanks a lot


#11

Hi Vchong

I found this link

https://wiki.linaro.org/Resources/HowTo/PackageYourOwnKernel?highlight=(Debian)#Debian_Rules

Now is there a way I can do the above integrated with ABE.

Thanks


#12

@protocoder:
Regarding arm64 versus aarch64 they mean the same thing (targetting the 64-bit Arm instruction set). The kernel and debian packages use arm64, compilers and toolsets (and Arm Ltd) call it aarch64.

Additionally I don’t understand from the thread what you want to do with this compiler when you have built it. You talk about “Build hikey ARM tool chain and flash the image in Debian” which suggests a real confusion on your part about terminology: there’s no such thing as a hikey toolchain (the toolchain will be for any AArch64 board) and building a toolchain does not result in an image that you flash anywhere).

What are you actually trying to do with your hikey960?


#13

Dear Danielt

Thank you answer. Yes you are right about Installation image and bootable (which is board specific). We want to load only minimalistic image built internally as we have to make some custom changes in #defines etc.

So what we have is this
Host system: Ubuntu 16.0.4 32 bit
Target system: Hikey ARM 64 bit and
Native 32 bit

what we want to build is the .deb files so I can install as Debian packages. I am using as advised by our friends here Linaro ABE …
What I am looking for :
To make changes to the ABE script so I can generate glibc.deb files as we got for binutils as enclosed
Tried to change .host.conf but it got overwritten after build

Picture 1 attached is successful debian build of binutils:

Picture 2: output from Linaro ABE (tried with options suggested above along with making changes in .host.conf file to point to aarch64-linux-gnu. however we still did not get .deb files
Please request you suggest how we can get .deb files for all the toolchains(binutils, gcc, gdb and glibc).

Thanks in advance


#14

Compared to a normal debian minimalistic image which components do you need to change?

It sounds much easier to do this natively. In other words install normal Debian on hikey960 (or on any other AArch64 machine) and use that to build whatever custom packages you need. Then you make those packages available in an apt repo and point one of the debian rootfs builders at it.

You were advised to use ABE because you said you wanted to build a Debian Arm toolchain. However it really is not clear that this is the best route for what you want to achieve.


#15

Hi Danielt
Thank you for the prompt response. Discussed your approach with PoC of project, but they insist .deb files for tool chains. :frowning: I thought of loading the image use dpkg -l and reverse do reverse way of building but I when binutils build was successful, I thought we can make this as well. But it was a very learning experience, I am reading your other post eagerly as well. Quite informative, will seek help in debian way… However if you come across a hint, please do share it sir. Thank you @danielt and @vchong… both for excellent support