Re: [Hampshire] Cross-compiling Debian packages

Top Page

Reply to this message
Author: James Courtier-Dutton
Date:  
To: Hampshire LUG Discussion List
Subject: Re: [Hampshire] Cross-compiling Debian packages
On 19 April 2012 12:18, Chris Smith <cjs94@???> wrote:
> Hi all,
>
> I'm trying to cross-compile a Debian package for an ARM target on my x86
> box and failing miserably.  The target has Debian Lenny installed, and
> so I have also installed Lenny on my development box.
>
> I have tried Googling, but the search results are dominated by articles
> on setting up a cross-compiler on Debian, which is not what I need -- I
> have already installed a cross-compiler using Emdebian, which works
> fine: I can compile 'hello world' into an ARM executable, which runs on
> the target.  What I can't seem to do is persuade Debian to build
> packages using it!
>
> I thought it should be as simple as calling dpkg-buildpackage with the
> -a option, but that doesn't work: It tries to do the right thing, and
> produces a binary package with the correct architecture suffix, but the
> binaries inside are all x86.  How can I persuade it to use the Emdebian
> toolchain?
>

dpkg-architecture

DEB_BUILD_ARCH=amd64
DEB_BUILD_ARCH_OS=linux
DEB_BUILD_ARCH_CPU=amd64
DEB_BUILD_ARCH_BITS=64
DEB_BUILD_ARCH_ENDIAN=little
DEB_BUILD_GNU_CPU=x86_64
DEB_BUILD_GNU_SYSTEM=linux-gnu
DEB_BUILD_GNU_TYPE=x86_64-linux-gnu
DEB_BUILD_MULTIARCH=x86_64-linux-gnu
DEB_HOST_ARCH=amd64
DEB_HOST_ARCH_OS=linux
DEB_HOST_ARCH_CPU=amd64
DEB_HOST_ARCH_BITS=64
DEB_HOST_ARCH_ENDIAN=little
DEB_HOST_GNU_CPU=x86_64
DEB_HOST_GNU_SYSTEM=linux-gnu
DEB_HOST_GNU_TYPE=x86_64-linux-gnu
DEB_HOST_MULTIARCH=x86_64-linux-gnu


You need to get those right for your ARM target.




> Chris
> --
> Chris Smith <cjs94@???>
>
>
> --
> Please post to: Hampshire@???
> Web Interface: https://mailman.lug.org.uk/mailman/listinfo/hampshire
> LUG URL: http://www.hantslug.org.uk
> --------------------------------------------------------------


--
Please post to: Hampshire@???
Web Interface: https://mailman.lug.org.uk/mailman/listinfo/hampshire
LUG URL: http://www.hantslug.org.uk
--------------------------------------------------------------