Guillem, your analysis seems to point to a flaw in pkg-config's
architecture handling but it's nothing the user has any control over.
Consequently, on common architectures eg. x86_64 the flawed handling of
architecture tags prevents "multiarch" from working at all, at least
using documented commands (dpkg). .
While blame might be put on dpkg for using an inconsistent set of
architecture tags, pkg-config could be a bit more robust in how it
handles package flags Following is a patch to skip over triplets for
which there was no architecture match, enabling a successful operation.
As suggested, a warning has been added in this situation, to hilight the
problem for developers (I think aborting in this situation is
unwarranted as it would leave users with no recourse).
I noticed that after applying my patch, that dpkg --add-architecture
doesn't actually seem to care what the architecture tag is! The
"improper" tag x86 can still be added, as well as completely random ones
eg x8xx8. However, this seems to have nothing to do with my patch which
simply ignores triplets with no "key", so I'm submitting this as a clear
step forward.
The full path to the installed file is /usr/share/pkg-config-dpkghook
--
*Jim Patterson*
Ottawa, Ont
*** pkg-config-dpkghook.orig 2017-12-21 01:21:48.314744719 -0500
--- pkg-config-dpkghook 2017-12-22 21:23:13.234095209 -0500
***************
*** 12,18 ****
use warnings;
use Dpkg::Arch qw(debarch_to_gnutriplet);
! use Dpkg::ErrorHandling qw(error);
my $crosswrapper = "/usr/share/pkg-config-crosswrapper";
--- 12,18 ----
use warnings;
use Dpkg::Arch qw(debarch_to_gnutriplet);
! use Dpkg::ErrorHandling qw(error warning);
my $crosswrapper = "/usr/share/pkg-config-crosswrapper";
***************
*** 27,33 ****
push @architectures, $arch;
chomp @architectures;
! my %gnutriplets = map { debarch_to_gnutriplet($_) => 1 } @architectures;
my %symlinks = map { $_ => 1 } </usr/bin/*-pkg-config>;
--- 27,41 ----
push @architectures, $arch;
chomp @architectures;
! my %gnutriplets;
! foreach my $arch ( @architectures ) {
! my $triplet = debarch_to_gnutriplet($arch);
! if ( defined($triplet)) {
! $gnutriplets{$triplet} = 1;
! } else {
! warning("Architecture $arch not defined in architecture tables,
ignored");
! }
! }
my %symlinks = map { $_ => 1 } </usr/bin/*-pkg-config>;