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

Re: cross-build-essential



On Thu, Jun 28, 2012 at 12:29:25PM +0100, Simon McVittie wrote:
> On 28/06/12 10:43, Svante Signell wrote:
> > The situation is even more complicated if compiling for different OSes:
> > Like as host (build) Linux:i386 and guest (target) kFreeBSD:amd64 or
> > Hurd:i386. Any plans to support such combinations with
> > cross-build-essential?
> 
> It shouldn't differ from compiling for different CPUs: the key problem
> in cross-compilation is "your build system can't run your host system's
> binaries", which you can arrive at either via differing OSs or differing
> CPUs. (Or both, of course.)

It's not just that: if qemu-user is enabled, you will be able to run target
system's binaries, although at a prohibitively slow speed.  The last time I
tried, it was a matter of 8 hours vs 44 seconds[1].

So we have the following cases:

0. primary arch
1. secondary arch that can run on native speeds
2. secondary arch that goes through qemu
3. secondary arch with no qemu enabled
4. non-multiarch cross compiler[2]

You are talking about the distinction between 0-2 vs 3-4, while there's a
reason to avoid 2 if possible (yet it's more likely to succeed than 3).

It'd be nice to specify the dependency in a way that doesn't make
build-essential:armel prefer gcc:armel over gcc-armel-cross:amd64.

Otherwise, I agree with you that multi-arch build-essential are so much
better than cross-build-essential.
 
> A note on terminology: in cross-compiling, the standard meaning of
> "host" doesn't match how you used it. If I cross-compile a package for
> armel on an i386 machine, armel is the "host architecture" and i386 is
> the "build architecture".

It's a terrible choice of names: outside of autotools world, everyone
assumes that "host" is the architecture you're running the cross build on,
hosting qemu on, etc.  Kernel-like build systems for example print:
  HOSTCC something
  CC something
This is the intuitive naming.

> There is a third variable, "target", which is only used for compilers,
> linkers and similar tools: to compile that package, I would have needed
> a compiler built for an i386 "host architecture" with an armel "target
> architecture".

And outside of autotools, "target" is the target of your compilation.
Confusion ensues.

Too bad, I have no idea how to make it unambiguous.  None of the three words
is safe; even "build" would cause gems like BUILDCC which is unobvious at
the very least.


[1]. That was qemu-system, I guess qemu-user would at least be able to use
more than one core, and avoid a crippling memory limit.

[2]. And that's not even exhaustive.  Just today, running "make clean" on
something spawned a wine popup about updating some config, and the build log
included:
  checking for suffix of executables... .exe
  checking whether we are cross-compiling... no

-- 
Sanity is overrated anyway.

Attachment: signature.asc
Description: Digital signature


Reply to: