On Wed, Sep 21, 2011 at 02:41:21PM +0100, Simon McVittie wrote:
> Steve's patch in #631275 also uses the GNU triplet as if it was a
> multiarch tuple (or, equivalently, assumes that your --host is one of the
> "base" GNU triplets like arm-linux-gnueabi or i386-linux-gnu that is its
> own multiarch tuple, as opposed to something like armv5tel-linux-gnueabi
> or i486-linux-gnu).

Right; I assumed that this would be used with toolchains targeting other
Debian ports, and for all of those, the toolchain target matches the
multiarch name with the exception of i386.  (armv5tel-linux-gnueabi is not
used as the toolchain target of the native compiler on any of the Debian
ports.)  For i386, I simply punted because this is not typically a
cross-compilation target.

So my suggestion would be to make the script special-case i386, instead of
adding a runtime dependency on dpkg-dev for dpkg-architecture.

> Currently, native compilation on Debian i386 (i486-linux-gnu-gcc, i386- in
> the multiarch tuple) will search:

<snip>
>         /usr/local/lib/i386-linux-gnu/pkgconfig         (site multiarch)
>         /usr/local/lib/pkgconfig                        (site pre-multiarch)
>         /usr/local/share/pkgconfig                      (site arch-indep)
>         /usr/lib/i386-linux-gnu/pkgconfig               (distro multiarch)
>         /usr/lib/pkgconfig                              (distro pre-multiarch)
>         /usr/share/pkgconfig                            (distro arch-indep)

Ah; my patch had gone by the manpage and as a result, I overlooked the fact
that the multiarch paths were part of this variable.  Yes, we certainly
don't want to search in multiarch directories for the native architecture as
part of the cross tools!

However:

> One subtle departure from Steve's patch here is that if you run
> armv5tel-linux-gnueabi-pkg-config on an i386 system, it will never search
> /usr/lib/pkgconfig - which I think is desirable. If you're missing a
> cross-compiled dependency (zlib, say), it's better that configure fails
> early, rather than trying to link an i386 zlib into an armel binary
> and failing horribly later.

Keeping /usr/lib/pkgconfig on the path was quite deliberate on my part. 
Certainly any library shipping in /usr/lib/pkgconfig is not a multiarch
library, but that doesn't actually mean it has to be a *native* library: it
will be possible to cross-install many -dev packages for a while before it's
possible to co-install them together with the native versions.

So I do think it's useful to look in /usr/lib/pkgconfig by default even in
the cross-config (and obviously as a last resort, after searching the
architecture-specific directories).  In general I think people will find it
easier to simply remove any conflicting native -dev packages from their
build environment than to fiddle with the pkg-config path.

> I attach a patch to give the semantics I suggest, plus a patch to put
> pkg-config-crosswrapper into a directory that complies with the FHS (with
> a compatibility symlink).

By my reading of the FHS, there is no requirement to move it.  The FHS says
simply:

  It is recommended that a subdirectory be used in /usr/share for this
  purpose.

so it's not a requirement, just a recommendation.

Cheers,
-- 
Steve Langasek                   Give me a lever long enough and a Free OS
Debian Developer                   to set it on, and I can move the world.
Ubuntu Developer                                    http://www.debian.org/
slanga...@ubuntu.com                                     vor...@debian.org

Attachment: signature.asc
Description: Digital signature

Reply via email to