Skip Menu |
Report information
Id: 86854
Status: resolved
Priority: 0/
Queue: perl5

Owner: doughera <doughera [at] lafayette.edu>
Requestors: ilmari.vacklin [at] cs.helsinki.fi
Cc:
AdminCc:

Operating System: (no value)
PatchStatus: (no value)
Severity: low
Type:
Perl Version: (no value)
Fixed In: (no value)



Subject: libs empty on Ubuntu 11.04 alpha (linux 2.6.38-7-generic #38-Ubuntu)
Date: Wed, 23 Mar 2011 18:00:11 +0200
To: perlbug [...] perl.org
From: Ilmari Vacklin <ilmari.vacklin [...] cs.helsinki.fi>
Download (untitled) / with headers
text/plain 288b
Hi, I'm trying to compile perl-5.12.3 on Ubuntu 11.04 alpha 3, 32-bit variant. Configure fails to find any libs to link against, which causes make to fail because e.g. pow() isn't found (-lm is not used). I've attached myconfig's output. Any ideas what's going on? -- Ilmari Vacklin
Download perl-5.12.3.myconfig
application/octet-stream 1.4k

Message body not shown because it is not plain text.

CC: Perl Porters <perl5-porters [...] perl.org>
Subject: Re: [perl #86854] libs empty on Ubuntu 11.04 alpha (linux 2.6.38-7-generic #38-Ubuntu)
Date: Fri, 25 Mar 2011 10:46:36 -0400
To: Andy Dougherty <doughera [...] lafayette.edu>
From: Jesse Vincent <jesse [...] fsck.com>
Download (untitled) / with headers
text/plain 118b
I have made this bug a 5.14 blocker. It'd really suck if we didn't work right on the latest ubuntu when it came out.
Subject: Fwd: Re: [perl #86854] libs empty on Ubuntu 11.04 alpha (linux 2.6.38-7-generic #38-Ubuntu)
Date: Wed, 30 Mar 2011 16:04:12 +0100
To: perl5-porters [...] perl.org, doughera [...] lafayette.edu
From: Dave Mitchell <davem [...] iabyn.com>
Download (untitled) / with headers
text/plain 2.7k
I'm just forwarding this email back to the list (and to RT), because for some reason it hasn't shown up on the ticket, and possibly the OP hasn't seen it. Also, a question to the OP: does your Ubuntu alpha installation already have a system perl installed on it; if so, could you post the output of /usr/bin/perl -V ? ----- Forwarded message from Andy Dougherty <doughera@lafayette.edu> ----- Date: Thu, 24 Mar 2011 12:37:17 -0400 (EDT) From: Andy Dougherty <doughera@lafayette.edu> To: Perl Porters <perl5-porters@perl.org> Subject: Re: [perl #86854] libs empty on Ubuntu 11.04 alpha (linux 2.6.38-7-generic #38-Ubuntu) Message-ID: <alpine.DEB.2.00.1103241207540.22420@fractal.phys.lafayette.edu> On Wed, 23 Mar 2011, Ilmari Vacklin wrote: Show quoted text
> # New Ticket Created by Ilmari Vacklin > # Please include the string: [perl #86854] > # in the subject line of all future correspondence about this issue. > # <URL: http://rt.perl.org/rt3/Ticket/Display.html?id=86854 > > > > Hi, > > I'm trying to compile perl-5.12.3 on Ubuntu 11.04 alpha 3, 32-bit > variant. Configure fails to find any libs to link against, which > causes make to fail because e.g. pow() isn't found (-lm is not used).
By default, Configure looks in the following directories for libraries: /usr/local/lib /lib /usr/lib /usr/lib64 It looks like Ubuntu has moved the math library (and presumably other libraries as well) out of /lib/ and /usr/lib into /lib/i386-linux-gnu. (I presume other names are used for other architectures, but I don't know what those other names actually are.) The quick workaround is to tell Configure about the new directory: sh Configure -Dplibpth=/lib/i386-linux-gnu -de I don't know how Ubuntu is managing to compile perl for itself without such a workaround (or its equivalent). Assuming this is a deliberate change in Ubuntu, the fix for 5.14 will be to detect this situation in the hints/linux.sh hint file and add the appropriate plibpth values automatically. In order to do that, I could use some help: 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.) Clearly, however, the compiler on the system has been taught to look in the appropriate directories. In the long term, perhaps Configure ought to consider looking for a library by trying to use it cc -o try try.c -lm rather than trying to find the file libm.*. -- Andy Dougherty doughera@lafayette.edu Show quoted text
----- End forwarded message ----- -- Indomitable in retreat, invincible in advance, insufferable in victory -- Churchill on Montgomery
RT-Send-CC: perl5-porters [...] perl.org
Download (untitled) / with headers
text/plain 159b
This is also listed in the Ubuntu bug tracker as https://bugs.launchpad.net/ubuntu/natty/+source/perl/+bug/739693 I have posted a follow-up request there.
CC: perl5-porters [...] perl.org, doughera [...] lafayette.edu
Subject: Re: Fwd: Re: [perl #86854] libs empty on Ubuntu 11.04 alpha (linux2.6.38-7-generic #38-Ubuntu)
Date: Thu, 31 Mar 2011 16:19:13 +0200
To: perl5-porters [...] perl.org, Dave Mitchell <davem [...] iabyn.com>
From: Salvador Fandino <sfandino [...] yahoo.com>
Download (untitled) / with headers
text/plain 1.1k
On 03/30/2011 05:04 PM, Dave Mitchell wrote: Show quoted text
> I'm just forwarding this email back to the list (and to RT), because for > some reason it hasn't shown up on the ticket, and possibly the OP hasn't > seen it. > > Also, a question to the OP: does your Ubuntu alpha installation already > have a system perl installed on it; if so, could you post the output of > /usr/bin/perl -V ?
The output of perl -V is attached. I come across the same bug again today while trying to compile blead on the upcoming Ubuntu release. Besides libm, librt is also missing. And this is for a blead perl compiled adding "-lm -lrt" into the broken ld command executions by hand: $ ldd /usr/local/perl/blead/bin//perl linux-vdso.so.1 => (0x00007fff93dff000) librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007febb56a0000) libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007febb541b000) libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007febb5075000) libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007febb4e57000) /lib64/ld-linux-x86-64.so.2 (0x00007febb58d1000) $ uname -a Linux topo 2.6.38-7-generic #39-Ubuntu SMP Fri Mar 25 21:24:57 UTC 2011 x86_64 x86_64 x86_64 GNU/Linux - Salva
Download perl-V.txt
text/plain 9k

Message body is not shown because sender requested not to inline it.

RT-Send-CC: perl5-porters [...] perl.org
Download (untitled) / with headers
text/plain 555b
On a whim, I cloned the following code from hints/cygwin.sh into hints/linux.sh: plibpth=`gcc -print-file-name=libc.a` plibpth=`dirname $plibpth` plibpth=`cd $plibpth && pwd` This is enough goo to actually get Perl building on ubuntu 11.04 and other similar multiarch distributions. But it's ungodly brittle and makes too many assumptions. Could someone who knows something about how to write hints code portably and safely perhaps gin us up an equivalent stanza with the right bulletproofing? (Or some better way to do this) Thanks!
CC: Perl Porters <perl5-porters [...] perl.org>
Subject: Re: [perl #86854] libs empty on Ubuntu 11.04 alpha (linux 2.6.38-7-generic #38-Ubuntu)
Date: Thu, 14 Apr 2011 09:57:51 -0400 (EDT)
To: Jesse via RT <perlbug-followup [...] perl.org>
From: Andy Dougherty <doughera [...] lafayette.edu>
Download (untitled) / with headers
text/plain 1.2k
On Wed, 13 Apr 2011, Jesse via RT wrote: Show quoted text
> On a whim, I cloned the following code from hints/cygwin.sh into > hints/linux.sh: > > plibpth=`gcc -print-file-name=libc.a` > plibpth=`dirname $plibpth` > plibpth=`cd $plibpth && pwd` > > This is enough goo to actually get Perl building on ubuntu 11.04 and > other similar multiarch distributions. But it's ungodly brittle and > makes > too many assumptions. > > Could someone who knows something about how to write hints code portably > and safely perhaps gin us up an equivalent stanza with the right > bulletproofing? (Or some better way to do this)
Currently, I'm fiddling with # Configure sets trnl='\n'; plibpth=`gcc -print-search-dirs | grep libraries | cut -f2- -d= | \ tr ':' $trnl | grep -v 'gcc' | uniq` For Linux only, where 'readlink' is likely to be available, I've also fiddled with pblibpth=`gcc -print-search-dirs | grep libraries |cut -f2- -d= | \ sed -e's/\:/\n/g' | xargs -n1 readlink -f | grep -v 'gcc | uniq` I want to check whether this can safely go in a cc.cbu call-back unit, where we know the name of the compiler be used. I just haven't checked whether that's too late for setting plibpth. -- Andy Dougherty doughera@lafayette.edu
CC: Perl Porters <perl5-porters [...] perl.org>
Subject: Re: [perl #86854] libs empty on Ubuntu 11.04 alpha (linux 2.6.38-7-generic #38-Ubuntu)
Date: Fri, 15 Apr 2011 10:22:47 -0400 (EDT)
To: Jesse via RT <perlbug-followup [...] perl.org>
From: Andy Dougherty <doughera [...] lafayette.edu>
Download (untitled) / with headers
text/plain 1.4k
Could a few people with various Linux distributions give this a try (and particuarly with Ubuntu 11.04 or later)? If it looks ok, could someone please apply it? (I probably won't be able to do so in a timely manner.) diff --git a/hints/linux.sh b/hints/linux.sh index ac27f23..e03ab1e 100644 --- a/hints/linux.sh +++ b/hints/linux.sh @@ -151,6 +151,24 @@ case "$optimize" in ;; esac +# Ubuntu 11.04 (and later, presumably) doesn't keep most libraries +# (such as -lm) in /lib or /usr/lib. So we have to ask gcc to tell us +# where to look. We don't want gcc's own libraries, however, so we +# filter those out. +# This could be conditional on Unbuntu, but other distributions may +# follow suit, and this scheme seems to work even on rather old gcc's. +# This unconditionally uses gcc because even if the user is using another +# compiler, we still need to find the math library and friends, and I don't +# know how other compilers will cope with that situation. +# Still, as an escape hatch, allow Configure command line overrides to +# plibpth to bypass this check. +case "$plibpth" in +'') plibpth=`gcc -print-search-dirs | grep libraries | + cut -f2- -d= | tr ':' $trnl | grep -v 'gcc'` + plibpth="$plibpth" # Collapse all entries on one line + ;; +esac + # Are we using ELF? Thanks to Kenneth Albanowski <kjahds@kjahds.com> # for this test. cat >try.c <<'EOM' -- Andy Dougherty doughera@lafayette.edu Dept. of Physics Lafayette College, Easton PA 18042
CC: Jesse via RT <perlbug-followup [...] perl.org>, Perl Porters <perl5-porters [...] perl.org>
Subject: Re: [perl #86854] libs empty on Ubuntu 11.04 alpha (linux 2.6.38-7-generic #38-Ubuntu)
Date: Fri, 15 Apr 2011 10:33:49 -0400
To: Andy Dougherty <doughera [...] lafayette.edu>
From: Jesse Vincent <jesse [...] fsck.com>
Download (untitled) / with headers
text/plain 433b
On Fri, Apr 15, 2011 at 10:22:47AM -0400, Andy Dougherty wrote: Show quoted text
> Could a few people with various Linux distributions give this a try (and > particuarly with Ubuntu 11.04 or later)? > > If it looks ok, could someone please apply it? (I probably won't be > able to do so in a timely manner.) >
It works for me on Ubuntu Natty x86_64. I'd love to hear about reports on slackware ppc or something equally ancient and esoteric.
Subject: Re: [perl #86854] libs empty on Ubuntu 11.04 alpha (linux 2.6.38-7-generic #38-Ubuntu)
Date: Fri, 15 Apr 2011 11:00:49 -0400
To: <perl5-porters [...] perl.org>
From: Tom Horsley <tom.horsley [...] ccur.com>
Download (untitled) / with headers
text/plain 628b
I've got a lot of various vintage virtual machines installed for testing, so I'm running this command on some of the older ones: gcc -print-search-dirs | grep libraries | cut -f2- -d= | tr ':' '\n' | grep -v gcc Debian GNU/Linux 4.0 (etch) prints: /lib/i486-linux-gnu/4.1.2/ /lib/ /usr/lib/i486-linux-gnu/4.1.2/ /usr/lib/ Fedora release 8 (Werewolf) prints: /lib/i386-redhat-linux/4.1.2/ /lib/ /usr/lib/i386-redhat-linux/4.1.2/ /usr/lib/ openSUSE 10.2 (i586) prints: /lib/i586-suse-linux/4.1.2/ /lib/ /usr/lib/i586-suse-linux/4.1.2/ /usr/lib/ I think those are my oldest virtual machines. Seems to work on all of them.
CC: Jesse via RT <perlbug-followup [...] perl.org>, Perl Porters <perl5-porters [...] perl.org>
Subject: Re: [perl #86854] libs empty on Ubuntu 11.04 alpha (linux 2.6.38-7-generic #38-Ubuntu)
Date: Fri, 15 Apr 2011 16:29:44 +0100
To: Andy Dougherty <doughera [...] lafayette.edu>
From: Dave Mitchell <davem [...] iabyn.com>
Download (untitled) / with headers
text/plain 321b
On Fri, Apr 15, 2011 at 10:22:47AM -0400, Andy Dougherty wrote: Show quoted text
> Could a few people with various Linux distributions give this a try (and > particuarly with Ubuntu 11.04 or later)?
Works fine on Fedora 13 x86_64 -- But Pity stayed his hand. "It's a pity I've run out of bullets", he thought. -- "Bored of the Rings"
Subject: Fwd: [perl #86854] libs empty on Ubuntu 11.04 alpha (linux 2.6.38-7-generic #38-Ubuntu)
Date: Fri, 15 Apr 2011 10:09:04 -0700
To: perl5-porters [...] perl.org
From: "Kevin J. Woolley" <kjw [...] pathillogical.com>
Download (untitled) / with headers
text/plain 932b
Missed the "Reply all" button -- apologies to Tom for the spurious e-mail. Results for FC5 i386 and FC4 x86_64 below. Cheers, kjw Show quoted text
---------- Forwarded message ---------- From: Kevin J. Woolley <kjw@pathillogical.com> Date: 15 April 2011 10:07 Subject: Re: [perl #86854] libs empty on Ubuntu 11.04 alpha (linux 2.6.38-7-generic #38-Ubuntu) To: Tom Horsley <tom.horsley@ccur.com> On 15 April 2011 08:00, Tom Horsley <tom.horsley@ccur.com> wrote:
> I've got a lot of various vintage virtual machines installed > for testing, so I'm running this command on some of the older > ones: > > gcc -print-search-dirs | grep libraries | cut -f2- -d= | tr ':' '\n' | grep -v gcc
Fedora 5 i386: /lib/i386-redhat-linux/4.1.1/ /lib/ /usr/lib/i386-redhat-linux/4.1.1/ /usr/lib/ Fedora 4 x86_64: /lib/x86_64-redhat-linux/4.0.0/ /lib/ /usr/lib/x86_64-redhat-linux/4.0.0/ /usr/lib/ I think that's as old and weird as I get. Cheers, kjw
CC: Jesse via RT <perlbug-followup [...] perl.org>, Perl Porters <perl5-porters [...] perl.org>
Subject: Re: [perl #86854] libs empty on Ubuntu 11.04 alpha (linux 2.6.38-7-generic #38-Ubuntu)
Date: Sun, 17 Apr 2011 04:23:09 -0400
To: Andy Dougherty <doughera [...] lafayette.edu>
From: Jesse Vincent <jesse [...] fsck.com>
Download (untitled) / with headers
text/plain 1.6k
Thanks. Applied as 40f0262. On Fri, Apr 15, 2011 at 10:22:47AM -0400, Andy Dougherty wrote: Show quoted text
> Could a few people with various Linux distributions give this a try (and > particuarly with Ubuntu 11.04 or later)? > > If it looks ok, could someone please apply it? (I probably won't be > able to do so in a timely manner.) > > diff --git a/hints/linux.sh b/hints/linux.sh > index ac27f23..e03ab1e 100644 > --- a/hints/linux.sh > +++ b/hints/linux.sh > @@ -151,6 +151,24 @@ case "$optimize" in > ;; > esac > > +# Ubuntu 11.04 (and later, presumably) doesn't keep most libraries > +# (such as -lm) in /lib or /usr/lib. So we have to ask gcc to tell us > +# where to look. We don't want gcc's own libraries, however, so we > +# filter those out. > +# This could be conditional on Unbuntu, but other distributions may > +# follow suit, and this scheme seems to work even on rather old gcc's. > +# This unconditionally uses gcc because even if the user is using another > +# compiler, we still need to find the math library and friends, and I don't > +# know how other compilers will cope with that situation. > +# Still, as an escape hatch, allow Configure command line overrides to > +# plibpth to bypass this check. > +case "$plibpth" in > +'') plibpth=`gcc -print-search-dirs | grep libraries | > + cut -f2- -d= | tr ':' $trnl | grep -v 'gcc'` > + plibpth="$plibpth" # Collapse all entries on one line > + ;; > +esac > + > # Are we using ELF? Thanks to Kenneth Albanowski <kjahds@kjahds.com> > # for this test. > cat >try.c <<'EOM' > > -- > Andy Dougherty doughera@lafayette.edu > Dept. of Physics > Lafayette College, Easton PA 18042
--
Subject: [PATCH] Re: [perl #86854] libs empty on Ubuntu 11.04 alpha (linux 2.6.38-7-generic #38-Ubuntu)
Date: Mon, 18 Apr 2011 14:57:12 +0100
To: Perl Porters <perl5-porters [...] perl.org>
From: Robin Barker <rmbarker.cpan [...] btinternet.com>
Download (untitled) / with headers
text/plain 193b
The previous patch creates library paths with trailing / this leads to effective duplicate paths in libpth This further patch fixes the construction of plibpth to suppress trailing / Robin

Message body is not shown because sender requested not to inline it.

CC: Perl Porters <perl5-porters [...] perl.org>
Subject: Re: [PATCH] Re: [perl #86854] libs empty on Ubuntu 11.04 alpha (linux 2.6.38-7-generic #38-Ubuntu)
Date: Mon, 18 Apr 2011 13:42:22 -0400 (EDT)
To: Robin Barker <rmbarker.cpan [...] btinternet.com>
From: Andy Dougherty <doughera [...] lafayette.edu>
Download (untitled) / with headers
text/plain 1.2k
On Mon, 18 Apr 2011, Robin Barker wrote: Show quoted text
> The previous patch creates library paths with trailing / > this leads to effective duplicate paths in libpth > > This further patch fixes the construction of plibpth to suppress > trailing /
Good catch. I suspect those were harmless, but certainly unintended. Your patch looks fine. However, looking at my lines right below it, I realized they didn't do what I intended (and I didn't adequate test them.) Specifically, plibpth doesn't end up all on a single line, and running ./perl -Ilib -V:plibpth comes up curiously empty. Here's a fix that includes your patch as well as the correct incantation to collapse plibpth onto a single line. diff --git a/hints/linux.sh b/hints/linux.sh index e03ab1e..970640c 100644 --- a/hints/linux.sh +++ b/hints/linux.sh @@ -164,8 +164,10 @@ esac # plibpth to bypass this check. case "$plibpth" in '') plibpth=`gcc -print-search-dirs | grep libraries | - cut -f2- -d= | tr ':' $trnl | grep -v 'gcc'` - plibpth="$plibpth" # Collapse all entries on one line + cut -f2- -d= | tr ':' $trnl | grep -v 'gcc' | sed -e 's:/$::'` + set X $plibpth # Collapse all entries on one line + shift + plibpth="$*" ;; esac -- Andy Dougherty doughera@lafayette.edu
CC: Robin Barker <rmbarker.cpan [...] btinternet.com>, Perl Porters <perl5-porters [...] perl.org>
Subject: Re: [PATCH] Re: [perl #86854] libs empty on Ubuntu 11.04 alpha (linux 2.6.38-7-generic #38-Ubuntu)
Date: Tue, 19 Apr 2011 00:34:35 +0100
To: Andy Dougherty <doughera [...] lafayette.edu>
From: Dave Mitchell <davem [...] iabyn.com>
Download (untitled) / with headers
text/plain 1.3k
On Mon, Apr 18, 2011 at 01:42:22PM -0400, Andy Dougherty wrote: Show quoted text
> On Mon, 18 Apr 2011, Robin Barker wrote: >
> > The previous patch creates library paths with trailing / > > this leads to effective duplicate paths in libpth > > > > This further patch fixes the construction of plibpth to suppress > > trailing /
> > Good catch. I suspect those were harmless, but certainly unintended. > > Your patch looks fine. However, looking at my lines right below > it, I realized they didn't do what I intended (and I didn't > adequate test them.) Specifically, plibpth doesn't end up all on a single > line, and running > ./perl -Ilib -V:plibpth > comes up curiously empty.
I think I fixed that with commit ebf3760c26025a6c498c5d5dd2c9d1a8a46be64b Author: David Mitchell <davem@iabyn.com> AuthorDate: Mon Apr 18 19:29:52 2011 +0100 Commit: David Mitchell <davem@iabyn.com> CommitDate: Mon Apr 18 19:29:52 2011 +0100 configpm: handle multi-line key='value\n...' Show quoted text
> Here's a fix that includes your patch as well as the correct incantation > to collapse plibpth onto a single line.
I independently committed a separate collapsing fix, but yours looks more robust and includes the trailing / removal, so I've reverted mine and applied yours instead, as bcab1245a0693be445ce018352f6fbe4abc26e88 -- Never do today what you can put off till tomorrow.


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

For issues related to this RT instance (aka "perlbug"), please contact perlbug-admin at perl.org