Hi,
this has not been agreed upon with a wider audience yet, so I'll post
this just as a proposal and to not loose the patch I attached.
By default, build dependencies are resolved using only host architecture
packages (except for dependencies on multiarch:foreign packages). The
multiarch cross spec [MACROSS] allows to explicitly select packages of
the build architecture instead, using the :native architecture
qualifier.
When building compilers, there is a third architecture to be considered
beyond build and host architecture: the target architecture which
specifies the architecture the compiler will produce code for.
Since it is already possible to explicitly depend on packages of the
host and build architecture, it only makes sense to also allow to
explicitly depend on packages of the target architecture. I propose the
:target qualifier for this purpose.
In the multiarch context, dependencies with the :target qualifier will
be resolved using packages of the target architecture except
multiarch:foreign packages which are not allowed to satisfy such a
dependency. This goes in line with the :native qualifier which also does
not allow multiarch:foreign packages. In this sense, the table on the
multiarch cross spec page would get a fourth column which would look
exactly like the third column except that s/native/target/.
In addition to preserving consistency between the input architectures
for a compilation (build, host and target) and the architectures that
one is allowed to select through build dependencies, having the :target
qualifier has a practical purpose.
When building gcc as a cross compiler, then it is currently necessary to
regenerate its debian/control to reflect its dependencies when building
a cross instead of a native compiler. If the :target qualifier would
exist, then it would be possible to switch between building a native
compiler or a cross compiler (or even a canadian cross?) without
regenerating debian/control.
Some build dependencies, like the one of gcc on binutils during stage2,
have to be translated to binutils-$TARGET:native. This can be done in
the same way that the translation of native compilers to cross compilers
is proposed using multiarch in section 4.1 of the bootstrap sprint
results [SPRINT] but is only possible once the :target qualifier exists.
Thank you for your consideration.
cheers, josch
[MACROSS] https://wiki.ubuntu.com/MultiarchCross
[SPRINT] https://lists.debian.org/debian-devel-announce/2014/08/msg00013.html