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

Re: Cross-building for ARM: experience report and some questions

On 2018-04-05 16:28 +0200, tomas@tuxteam.de wrote:
> Hi,
> I just tried to cross-build a package for Debian armhf (well,
> I have now a binary .deb, but I still don't know whether it
> works, so...). I wanted to share my experiences and pose a
> couple of questions perhaps more seasoned folks here might
> want to answer.
> The package is a small thing in C I wrote eons ago for a
> customer, for a then (gasp!) 486. It was autoconf from the
> beginning, some wise soul added Debian packaging later.
> When I saw that dpkg-buildpackage has an --host-arch <foo>,
> I thought "well, that's magic!" and decided to give it a
> try.
> To anticipate the best, yes, it's magic, and I'd like to
> thank all the folks making that possible.
> My build host is an x86_64, FWIW.
> Now the (for me) stumbling blocks and questions:
> - Need to set CC
> Yes, the warning was clear enough, but I was a bit surprised
> I had to set CC like so:
>  CC=arm-linux-gnueabihf-gcc dpkg-buildpackage -uc -us -b --host-arch armhf

The debian packaging should do this for you. Report a bug.
The rules files should arrange for CC=$(DEB_HOST_GNU_TYPE)-gcc
> For some reason I expected the --host-arch to pick the right
> default compiler.

No, it just sets the correct dpkg-architecture variables and dpkg/apt
multiarch resolving context. The rules file still has to set the
correct environment variables.

There was some discussion about dpkg-buildpackage or debhelper setting
$CC (and other vars), but I don't think that has happened.

> - Is there something like build-depends?
> I'm spoiled by apt-get build-dep: here I had to "hunt-and-peck"
> the *-dev:armhf packages after each build failure. Since I know
> the baby fairly well, it wasn't difficult, but... is there a
> better/more canonical way to do that?

yes: apt build-dep -a armhf <package>

So long as all the dependencies have correct multiarch metadata then
that should just work.

Principal hats:  Linaro, Debian, Wookware, ARM

Attachment: signature.asc
Description: PGP signature

Reply to: