Cross compile rules update
Loïc Minier
loic.minier at ubuntu.com
Mon Oct 11 16:30:20 UTC 2010
On Mon, Oct 11, 2010, Jan, Sebastien wrote:
> Either ways you expect to retrieve the cross-compiler name through the
> DEB_HOST_GNU_TYPE variable? In my case I always get
> DEB_HOST_GNU_TYPE=arm-linux-gnueabi (that's the output of
> dpkg-architecture). Is this expected?
> If yes, I don't understand how my cross-compiler (CS here) gets passed
> to make. Your two above proposals would override what I could write on
> the command line? (hence my 1st patch)
So for Debian/Ubuntu-style cross-builds (dpkg-buildpackage -aarmel), we
can assume that the cross-toolchain is using the $(DEB_HOST_GNU_TYPE)-
prefix, so $(DEB_HOST_GNU_TYPE)-gcc, -ld etc. are available.
It's however convenient for some specific packages, like the kernel or
u-boot or x-loader, to be able to override the standard
cross-compilation toolchain with a personal one. In your case, the
arm-none-linux-gnueabi- prefix or something like that.
So the intent was to set CROSS_COMPILE to $(DEB_HOST_GNU_TYPE)- by
default (standard Debian/Ubuntu cross builds) unless if CROSS_COMPILE
is set (in which case, just use what's in CROSS_COMPILE instead).
Note the ?= in my proposals which means that CROSS_COMPILE is only set
if it wasn't set in the environment.
--
Loïc Minier
More information about the kernel-team
mailing list