Comment 8 for bug 739693

Revision history for this message
Steve Langasek (vorlon) wrote : Re: [Bug 739693] Re: Configure does not find libs in /lib/x86_64-linux-gnu

Hi Andy,

On Wed, Mar 30, 2011 at 07:51:36PM -0000, Andy Dougherty wrote:
> Assuming this is a deliberate change in Ubuntu,

Yes, this is a deliberate change. Sorry that this is causing trouble for
building perl, it seems that there are a few more build systems out there
bypassing the compiler's view of the available libraries than we had
anticipated.

> Second: Does anyone understand this new organization enough to suggest how to coax
> the necessary directory name (e.g. /lib/i386-linux-gnu) out of the build
> tools? (For example, what should it be on an amd64 system? How about
> PPC? SPARC? Are there trailing 32s or 64s on any of those names? etc.)

To find the directory name, there are two options that can be used reliably
without having to embed detailed logic into perl's build system. The first
is preferable, since it doesn't rely on Ubuntu-specific interfaces at all.
The major downside is that it assumes use of gcc or something supporting
similar commandline options - gcc is the standard compiler on Debian and
Ubuntu today, but there are of course other compilers available and someone
might use one of these for building perl on Ubuntu.

$ ${CC:-gcc} -print-search-dirs | grep libraries |cut -f2- -d= | \
  sed -e's/\:/\n/g' | xargs -n1 readlink -f | uniq
/usr/lib/x86_64-linux-gnu/gcc/x86_64-linux-gnu/4.5
/usr/x86_64-linux-gnu/lib
/usr/lib/x86_64-linux-gnu
/lib/x86_64-linux-gnu/4.5.2
/lib
/usr/lib/x86_64-linux-gnu/4.5.2
/usr/lib
/usr/lib/x86_64-linux-gnu
$

this spits out the full list of libraries that gcc is configured to look in;
I think it would be appropriate to prepend this to the search path. Maybe
filtering out directories with 'gcc' in the name or that have a final path
component consisting of [0-9.]+ is also wanted.

The other option is to check the output of dpkg-architecture
-qDEB_HOST_MULTIARCH; but this relies on the dpkg-dev package which is not
guaranteed to be installed when building perl (at least, not when building
from upstream source).

--
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/
<email address hidden> <email address hidden>