Debian Bug report logs - #482884
pkg-config doesn't handle all system directories

version graph

Package: pkg-config; Maintainer for pkg-config is Tollef Fog Heen <tfheen@debian.org>; Source for pkg-config is src:pkg-config.

Reported by: Matthias Klose <doko@cs.tu-berlin.de>

Date: Sun, 25 May 2008 18:15:01 UTC

Severity: normal

Tags: fixed-upstream

Found in version pkg-config/0.22-1

Fixed in version pkg-config/0.26-1

Done: Tollef Fog Heen <tfheen@debian.org>

Bug is archived. No further changes may be made.

Forwarded to http://bugs.freedesktop.org/show_bug.cgi?id=16095

Toggle useless messages

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to debian-bugs-dist@lists.debian.org, Tollef Fog Heen <tfheen@debian.org>:
Bug#482884; Package pkg-config. Full text and rfc822 format available.

Acknowledgement sent to Matthias Klose <doko@cs.tu-berlin.de>:
New Bug report received and forwarded. Copy sent to Tollef Fog Heen <tfheen@debian.org>. Full text and rfc822 format available.

Message #5 received at submit@bugs.debian.org (full text, mbox):

From: Matthias Klose <doko@cs.tu-berlin.de>
To: submit@bugs.debian.org
Subject: pkg-config doesn't handle all system directories
Date: Sun, 25 May 2008 20:11:10 +0200
Package: pkg-config
Version: 0.22-1
Severity: serious

pkg-config does handle system directories which appear in .pc files
specially by dropping them unless some environment variable is
set.  This handling is currently incomplete, because not all system
directories found in Debian are handled. In the case of include search
directories this leads to errors including the wrong directories when
using the #include_next directive; in the case of library search dirs
this may lead to a wrong search path if the library is found in a
directory found in a directory specified by the multiarch proposal.

The following additional directories should be handled as system
include directories:

 - /usr/include/<DEB_HOST_GNU_TYPE> for each architecture, including
   the non-default biarch and triarch directories.

The following additional directories should be handled as system
library directories:

 - /usr/lib64 *and* /usr/lib on s390, sparc, powerpc, i386.

 - /usr/lib, /usr/lib32 *and* /emul/ia32-linux/usr/lib/ on amd64 and
   ppc64.

 - /usr/lib/<DEB_HOST_GNU_TYPE> for each architecture, including
   the non-default biarch and triarch directories.




Information forwarded to debian-bugs-dist@lists.debian.org, Tollef Fog Heen <tfheen@debian.org>:
Bug#482884; Package pkg-config. Full text and rfc822 format available.

Acknowledgement sent to Tollef Fog Heen <tfheen@ubuntu.com>:
Extra info received and forwarded to list. Copy sent to Tollef Fog Heen <tfheen@debian.org>. Full text and rfc822 format available.

Message #10 received at 482884@bugs.debian.org (full text, mbox):

From: Tollef Fog Heen <tfheen@ubuntu.com>
To: control@bugs.debian.org
Cc: 482884@bugs.debian.org
Subject: severity of 482884 is normal
Date: Mon, 30 Jun 2008 08:01:56 +0200
# Automatically generated email from bts, devscripts version 2.10.11ubuntu5.8.04.1
# no justification given
severity 482884 normal





Severity set to `normal' from `serious' Request was from Tollef Fog Heen <tfheen@ubuntu.com> to control@bugs.debian.org. (Mon, 30 Jun 2008 06:03:03 GMT) Full text and rfc822 format available.

Set Bug forwarded-to-address to 'http://bugs.freedesktop.org/show_bug.cgi?id=16095'. Request was from Simon McVittie <smcv@debian.org> to control@bugs.debian.org. (Sun, 14 Feb 2010 15:12:03 GMT) Full text and rfc822 format available.

Information forwarded to debian-bugs-dist@lists.debian.org, Tollef Fog Heen <tfheen@debian.org>:
Bug#482884; Package pkg-config. (Sun, 14 Feb 2010 17:42:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Simon McVittie <smcv@debian.org>:
Extra info received and forwarded to list. Copy sent to Tollef Fog Heen <tfheen@debian.org>. (Sun, 14 Feb 2010 17:42:03 GMT) Full text and rfc822 format available.

Message #19 received at 482884@bugs.debian.org (full text, mbox):

From: Simon McVittie <smcv@debian.org>
To: Matthias Klose <doko@cs.tu-berlin.de>, 482884@bugs.debian.org
Subject: Re: Bug#482884: pkg-config doesn't handle all system directories
Date: Sun, 14 Feb 2010 17:39:13 +0000
[Message part 1 (text/plain, inline)]
user multiarch-devel@lists.alioth.debian.org
usertags 482884 + multiarch
thanks

On Sun, 25 May 2008 at 20:11:10 +0200, Matthias Klose wrote:
> pkg-config does handle system directories which appear in .pc files
> specially by dropping them unless some environment variable is
> set.  This handling is currently incomplete, because not all system
> directories found in Debian are handled.

I've linked this bug to a related upstream bug, in which Colin Walters
asks for -L/usr/lib64 to be excluded from output.

http://bugs.freedesktop.org/show_bug.cgi?id=16095

Here's a branch that adds --with-system-library-path and
--with-system-include-path configure options to pkg-config, with the
expectation that pkg-config's Debian packaging can determine the right
values for these paths:

http://git.debian.org/?p=users/smcv/multiarch/pkg-config.git;a=shortlog;h=refs/heads/multiarch

I'm not tagging this bug as +patch just yet, because the debian/rules changes
still also need to be written.

> In the case of include search
> directories this leads to errors including the wrong directories when
> using the #include_next directive

Can you provide a test case for this?

> in the case of library search dirs
> this may lead to a wrong search path if the library is found in a
> directory found in a directory specified by the multiarch proposal.

Can you provide a test case for this?

> The following additional directories should be handled as system
> include directories:
> 
>  - /usr/include/<DEB_HOST_GNU_TYPE> for each architecture, including
>    the non-default biarch and triarch directories.

It's non-trivial to determine what the non-default biarch and triarch
directories for a particular architecture are. Should the Debian packaging for
pkg-config just hard-code this for all known Debian architectures, or can it
be derived from gcc -print-search-dirs, or glibc, or something, in some
mechanical way?

>  - /usr/lib, /usr/lib32 *and* /emul/ia32-linux/usr/lib/ on amd64 and
>    ppc64.

Is /emul/ia32-linux/usr/lib still necessary, or has it been superseded?

Do /lib, /lib64, /lib32 also need to be filtered out?

Regards,
    Simon
[signature.asc (application/pgp-signature, inline)]

Information forwarded to debian-bugs-dist@lists.debian.org, Tollef Fog Heen <tfheen@debian.org>:
Bug#482884; Package pkg-config. (Fri, 30 Jul 2010 20:12:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Steve Langasek <vorlon@debian.org>:
Extra info received and forwarded to list. Copy sent to Tollef Fog Heen <tfheen@debian.org>. (Fri, 30 Jul 2010 20:12:03 GMT) Full text and rfc822 format available.

Message #24 received at 482884@bugs.debian.org (full text, mbox):

From: Steve Langasek <vorlon@debian.org>
To: 482884@bugs.debian.org
Cc: Matthias Klose <doko@cs.tu-berlin.de>
Subject: Re: Bug#482884: pkg-config doesn't handle all system directories
Date: Fri, 30 Jul 2010 13:10:06 -0700
[Message part 1 (text/plain, inline)]
Hi Simon,

>> The following additional directories should be handled as system
>> include directories:
>> 
>>  - /usr/include/<DEB_HOST_GNU_TYPE> for each architecture, including
>>    the non-default biarch and triarch directories.

> It's non-trivial to determine what the non-default biarch and triarch
> directories for a particular architecture are. Should the Debian packaging
> for pkg-config just hard-code this for all known Debian architectures, or
> can it be derived from gcc -print-search-dirs, or glibc, or something, in
> some mechanical way?

Here's a quick script to get the multilib path qualifiers for the current
architecture:

  for opt in $(gcc -print-multi-lib | sed -n -e's/.*;@/-/p'); do
	gcc $opt -print-multi-os-directory
  done

This currently returns paths like "../lib32" and "../lib64".  It's not yet
clear what these paths will be under multiarch, but the current set of
multiarch paths for gcc will cause these to be returned as "../../lib32" and
"../../lib64" instead, so pkgconfig may need to apply some heuristics to
these.

>>  - /usr/lib, /usr/lib32 *and* /emul/ia32-linux/usr/lib/ on amd64 and
>>    ppc64.

> Is /emul/ia32-linux/usr/lib still necessary, or has it been superseded?

I'm happy to say that this appears to be obsolete in squeeze, at least on
amd64.  I don't know about ia64, though (is that what Matthias meant when he
said ppc64?)

> Do /lib, /lib64, /lib32 also need to be filtered out?

I believe the answer here is "no" - only /usr/lib is part of the default
search path for ld, and even if the runtime libraries are shipped in /lib,
the .so's are still supposed to be under /usr/lib not under /lib.

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/
slangasek@ubuntu.com                                     vorlon@debian.org
[signature.asc (application/pgp-signature, inline)]

Information forwarded to debian-bugs-dist@lists.debian.org, Tollef Fog Heen <tfheen@debian.org>:
Bug#482884; Package pkg-config. (Sat, 02 Apr 2011 09:01:00 GMT) Full text and rfc822 format available.

Acknowledgement sent to Steve Langasek <vorlon@debian.org>:
Extra info received and forwarded to list. Copy sent to Tollef Fog Heen <tfheen@debian.org>. (Sat, 02 Apr 2011 09:01:04 GMT) Full text and rfc822 format available.

Message #29 received at 482884@bugs.debian.org (full text, mbox):

From: Steve Langasek <vorlon@debian.org>
To: 482884@bugs.debian.org
Cc: Simon McVittie <smcv@debian.org>
Subject: Re: pkg-config doesn't handle all system directories
Date: Sat, 2 Apr 2011 01:48:02 -0700
> Here's a branch that adds --with-system-library-path and
> --with-system-include-path configure options to pkg-config, with the
> expectation that pkg-config's Debian packaging can determine the right
> values for these paths:

> http://git.debian.org/?p=users/smcv/multiarch/pkg-config.git;a=shortlog;h=refs/heads/multiarch

This git repository has gone missing sometime in the past year. :(  Please
send patches to the BTS instead of referring to other websites for them!  Do
you still have a copy of this --with-system-library-path implementation
somewhere else?

A more refined implementation of the directory query for use in debian/rules
is:

$ for opt in '' $(${CC-gcc} -print-multi-lib | sed -n -e's/.*;@/-/p'); do
    gcc $opt -print-search-dirs | sed -n -e's/^libraries: =//p' \
    | sed -e's/:/\n/g' | xargs -n1 readlink -f | grep -v 'gcc\|/[0-9.]\+$'
  done | sort -u

on Ubuntu/amd64, for instance, this returns:

/lib
/lib32
/usr/lib
/usr/lib32
/usr/lib/x86_64-linux-gnu
/usr/x86_64-linux-gnu/lib

(I think the absence of the multiarch directory for i386 here may be a bug
in the gcc multiarch path; there is certainly code in gcc to map -m32 to
i386-linux-gnu... this will need investigating later.)

-- 
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/
slangasek@ubuntu.com                                     vorlon@debian.org




Information forwarded to debian-bugs-dist@lists.debian.org, Tollef Fog Heen <tfheen@debian.org>:
Bug#482884; Package pkg-config. (Sat, 02 Apr 2011 12:10:32 GMT) Full text and rfc822 format available.

Acknowledgement sent to Simon McVittie <smcv@debian.org>:
Extra info received and forwarded to list. Copy sent to Tollef Fog Heen <tfheen@debian.org>. (Sat, 02 Apr 2011 12:10:42 GMT) Full text and rfc822 format available.

Message #34 received at 482884@bugs.debian.org (full text, mbox):

From: Simon McVittie <smcv@debian.org>
To: Steve Langasek <vorlon@debian.org>
Cc: 482884@bugs.debian.org
Subject: Re: pkg-config doesn't handle all system directories
Date: Sat, 2 Apr 2011 13:04:00 +0100
[Message part 1 (text/plain, inline)]
On Sat, 02 Apr 2011 at 01:48:02 -0700, Steve Langasek wrote:
> > http://git.debian.org/?p=users/smcv/multiarch/pkg-config.git;a=shortlog;h=refs/heads/multiarch
> 
> This git repository has gone missing sometime in the past year. :(

Resurrected, same location (I was asked to reduce space usage on Alioth, and
there seemed to be no interest in the branch at the time). No changes since
I last looked at this, so I haven't reviewed whether this is still suitable
for the current multiarch proposal, but hopefully it is...

> Please
> send patches to the BTS instead of referring to other websites for them!

Attached. I'll copy them upstream too.

> $ for opt in '' $(${CC-gcc} -print-multi-lib | sed -n -e's/.*;@/-/p'); do
>     gcc $opt -print-search-dirs | sed -n -e's/^libraries: =//p' \
>     | sed -e's/:/\n/g' | xargs -n1 readlink -f | grep -v 'gcc\|/[0-9.]\+$'
>   done | sort -u
> 
> on Ubuntu/amd64, for instance, this returns:
> 
> /lib
> /lib32
> /usr/lib
> /usr/lib32
> /usr/lib/x86_64-linux-gnu
> /usr/x86_64-linux-gnu/lib

In Debian I currently get nearly the same, but without the traditional
/usr/$(gnu_triplet)/lib cross-compiling path:

  amd64:
    /lib
    /lib64
    /usr/lib
    /usr/lib/i486-linux-gnu
    /usr/lib64

  i386 chroot:
    /lib
    /lib32
    /usr/lib
    /usr/lib32
    /usr/lib/x86_64-linux-gnu

> (I think the absence of the multiarch directory for i386 here may be a bug
> in the gcc multiarch path; there is certainly code in gcc to map -m32 to
> i386-linux-gnu... this will need investigating later.)

We could hard-code that case in pkg-config for the moment? It looks to me as
though it won't be fixed otherwise in Debian until
http://wiki.debian.org/Multiarch/Bootstrapping step 3, "stage1 multiarch
build of gcc-4.5:i386", is done?

    S
[0001-fd.o-16095-exclude-both-usr-lib-and-usr-lib64.patch (text/x-diff, attachment)]
[0002-Rename-subiter-to-system_dir_iter-to-match-logic-for.patch (text/x-diff, attachment)]
[0003-Add-with-system-include-path-etc.patch (text/x-diff, attachment)]

Information forwarded to debian-bugs-dist@lists.debian.org, Tollef Fog Heen <tfheen@debian.org>:
Bug#482884; Package pkg-config. (Sat, 02 Apr 2011 18:42:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Steve Langasek <vorlon@debian.org>:
Extra info received and forwarded to list. Copy sent to Tollef Fog Heen <tfheen@debian.org>. (Sat, 02 Apr 2011 18:42:03 GMT) Full text and rfc822 format available.

Message #39 received at 482884@bugs.debian.org (full text, mbox):

From: Steve Langasek <vorlon@debian.org>
To: Simon McVittie <smcv@debian.org>
Cc: 482884@bugs.debian.org
Subject: Re: pkg-config doesn't handle all system directories
Date: Sat, 2 Apr 2011 11:38:52 -0700
On Sat, Apr 02, 2011 at 01:04:00PM +0100, Simon McVittie wrote:
> > Please send patches to the BTS instead of referring to other websites
> > for them!

> Attached. I'll copy them upstream too.

Thanks! :)

> In Debian I currently get nearly the same, but without the traditional
> /usr/$(gnu_triplet)/lib cross-compiling path:

Strange that this is different.  Maybe due to temporary package skew?

> > (I think the absence of the multiarch directory for i386 here may be a bug
> > in the gcc multiarch path; there is certainly code in gcc to map -m32 to
> > i386-linux-gnu... this will need investigating later.)

> We could hard-code that case in pkg-config for the moment? It looks to me as
> though it won't be fixed otherwise in Debian until
> http://wiki.debian.org/Multiarch/Bootstrapping step 3, "stage1 multiarch
> build of gcc-4.5:i386", is done?

I don't think it's worth hardcoding this, we can just pick up the fix
sometime after step 3) there.  Currently, the use of pkg-config for biarch
builds in Debian is approximately nil, so having an extra -L option in there
in the short term when someone manages to pull it off is IMHO no big deal.

(Besides, the list of triplets that you'd have to hard-code for
biarch/triarch is substantial, since a lot more than just amd64/i386 is
affected.)

-- 
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/
slangasek@ubuntu.com                                     vorlon@debian.org




Added tag(s) fixed-upstream. Request was from bts-link-upstream@lists.alioth.debian.org to control@bugs.debian.org. (Thu, 14 Apr 2011 16:42:33 GMT) Full text and rfc822 format available.

Reply sent to Tollef Fog Heen <tfheen@debian.org>:
You have taken responsibility. (Sun, 15 May 2011 13:36:11 GMT) Full text and rfc822 format available.

Notification sent to Matthias Klose <doko@cs.tu-berlin.de>:
Bug acknowledged by developer. (Sun, 15 May 2011 13:36:11 GMT) Full text and rfc822 format available.

Message #46 received at 482884-close@bugs.debian.org (full text, mbox):

From: Tollef Fog Heen <tfheen@debian.org>
To: 482884-close@bugs.debian.org
Subject: Bug#482884: fixed in pkg-config 0.26-1
Date: Sun, 15 May 2011 13:33:28 +0000
Source: pkg-config
Source-Version: 0.26-1

We believe that the bug you reported is fixed in the latest version of
pkg-config, which is due to be installed in the Debian FTP archive:

pkg-config_0.26-1.diff.gz
  to main/p/pkg-config/pkg-config_0.26-1.diff.gz
pkg-config_0.26-1.dsc
  to main/p/pkg-config/pkg-config_0.26-1.dsc
pkg-config_0.26-1_amd64.deb
  to main/p/pkg-config/pkg-config_0.26-1_amd64.deb
pkg-config_0.26.orig.tar.gz
  to main/p/pkg-config/pkg-config_0.26.orig.tar.gz



A summary of the changes between this version and the previous one is
attached.

Thank you for reporting the bug, which will now be closed.  If you
have further comments please address them to 482884@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.

Debian distribution maintenance software
pp.
Tollef Fog Heen <tfheen@debian.org> (supplier of updated pkg-config package)

(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmaster@debian.org)


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Format: 1.8
Date: Sun, 15 May 2011 14:37:09 +0200
Source: pkg-config
Binary: pkg-config
Architecture: source amd64
Version: 0.26-1
Distribution: unstable
Urgency: low
Maintainer: Tollef Fog Heen <tfheen@debian.org>
Changed-By: Tollef Fog Heen <tfheen@debian.org>
Description: 
 pkg-config - manage compile and link flags for libraries
Closes: 217902 389066 398901 475031 482884 576320 590992
Changes: 
 pkg-config (0.26-1) unstable; urgency=low
 .
   * New upstream release
     - Updated usage message.  Closes: #389066
     - Fixes old bug.  Closes: #475031
     - Allows PKG_CONFIG_LIBDIR.  Closes: #398901
     - Man page documents how to get the default search path.
       Closes: #576320
   * Switch to multiarch paths.  Thanks to Steve Langasek for the patch.
     Closes: #590992
   * Strip out multiarch library paths.  Closes: #482884
   * Drop a cross wrapper into /usr/share.  Thanks to Wookey for the
     implementation.   Closes: #217902
   * Re-add two missing lines in Changelog which were accidentially
     removed.
Checksums-Sha1: 
 8e3ea35c6cc1e6ede1f595d8aae4ab79ba25c0cf 1679 pkg-config_0.26-1.dsc
 fd71a70b023b9087c8a7bb76a0dc135a61059652 396399 pkg-config_0.26.orig.tar.gz
 47a4391e1dd532a6dca7d32e61cb66a94d4f8b2c 4866 pkg-config_0.26-1.diff.gz
 e099963dea542d6e9edcb9e09e1db5393fb88bd1 59502 pkg-config_0.26-1_amd64.deb
Checksums-Sha256: 
 946380edc59d586adb7c2dbac84314380c5a6761b4ee5f5ae1c152eb6703235a 1679 pkg-config_0.26-1.dsc
 94c1936a797c930fb3e4e5a154165b6268caba22b32d24083dd4c492a533c8af 396399 pkg-config_0.26.orig.tar.gz
 69d93e4866a8977ad8a465cabd09b0361c1b93e109c81ff46850f0b2fc29591d 4866 pkg-config_0.26-1.diff.gz
 cd2073c893b10135efa9650d7679d8d9ebdb156e6cf576d9222b4c36f0e229f5 59502 pkg-config_0.26-1_amd64.deb
Files: 
 3d1f34f0ae0670cf5f70e54c01d8888c 1679 devel optional pkg-config_0.26-1.dsc
 47525c26a9ba7ba14bf85e01509a7234 396399 devel optional pkg-config_0.26.orig.tar.gz
 ce641f17553792a5b01245f06aee590f 4866 devel optional pkg-config_0.26-1.diff.gz
 b790a7f1146ceede7903308cb89a0bbe 59502 devel optional pkg-config_0.26-1_amd64.deb

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)

iQIcBAEBCAAGBQJNz9P3AAoJELZaSHHKGdcXdF8P/2TlKx/gUgq/47hUsKmIA7EN
KmhRw6zaBb7MuMwZLkDmptV352OAnbbWZiHvJ30Da9IPM0Re21IcRZRO7PUwSXEY
+5E8aZhstOhYl9IX0P1XHeR62MsMrajSbzjy8oe7t+WaURbhyjqHFtu23AD5G/1P
kYinKv4Mo+z2DYl7l/6m9vrfAlKAoixpQeAzo4K1IWXrHqVdvkEuqkF85997mu1Q
sxazNl0VibwHbvmdjIugvM2OgWWE1on8eW0vbhbdQ//wEMbCgQYDcOI2UeOR2Zfr
Xz+ShMfnApd5T3fZGItNItQiyuy8s+6KW7K6cmWAK7aNDvduWUnBpOvJpkg0SZk5
bLGbGgJ0rmczJzJyQe9OcVmmiozgEkqd+aHg5HuoKeK+HRF7mtkbUC8n3zojjNO/
9J5BYmWeX3MtsfjYqDpNOntJgaQpgvF/CU0LJGa0mSs6IsaFSVkBUY5ucFXWtB1o
yiFbXouJM0bF71O5jfF+2nvjZ7ATyBLp/FmB2gsOwSysaFTRcfnVXiY+b5efcS4C
xnh0PB8ajF9+jCN9cpsBMC1Wzb4Bcth7SFhs+vM1+g539AFfg+Lq0gmx+xJjT/AU
d+RF6JUwS1vMPUjcmZRQMBNUyUsKiMR3RRuVz+MxXXBJNf6aJ5OXB7h8zHlYtu7i
z6BMVnT+nZK3oYoJwNUG
=9S2U
-----END PGP SIGNATURE-----





Bug archived. Request was from Debbugs Internal Request <owner@bugs.debian.org> to internal_control@bugs.debian.org. (Thu, 23 Jun 2011 07:37:58 GMT) Full text and rfc822 format available.

Send a report that this bug log contains spam.


Debian bug tracking system administrator <owner@bugs.debian.org>. Last modified: Sun Apr 20 04:25:21 2014; Machine Name: beach.debian.org

Debian Bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.