[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Cross-compiling for big-endian arm



On Sun, Feb 18, 2018 at 10:44:29AM +0100, Niels Möller wrote:
> I would expect that I need both libgcc and libc, compiled for big-endian
> arm. Are there any debian packages that could help me? Or do I need to
> compile libc and gcc from source (with the appropriate bootstrap tricks,
> which I'm not really familiar with)? I prefer to not install binary
> packages from unofficial sources.

I think you pretty much nailed it here. You'll likely have to build your
own cross toolchains here.

So the gnu triplet will likely be armeb-linux-gnueabihf. Unfortunately,
we don't have a Debian architecture for that triplet, so you'd have add
a line like to /usr/share/dpkg/cputable (where you'd choose a Debian
architeture name e.g. armbhf):

    eabihf-gnu-linux-armeb armbhf

Then you can use the usual bootstrap tooling. The major tools for
building cross toolchains are src:cross-toolchain-base/src:gcc-N-cross
(you'd need to patch it somewhat) and
https://wiki.debian.org/wiki/HelmutGrohne/rebootstrap (you can limit it
to a toolchain bootstrap by carefully placing an "exit 0" in the shell
script).

While rebootstrap is outside the archive, it only is a "small" shell
script that drives the building and the vast majority of its source
consists of patches pending upstream inclusion. It is supposed to be a
machine+human readable documentation of the bootstrap process though I
don't think it excels at the human readable part. My goal is to upstream
as many things as possible and thus shrink the script to triviality.
We're not there unfortunately.

Hope this helps somewhat.

Helmut


Reply to: