NetBSD Problem Report #15981

Received: (qmail 14516 invoked from network); 20 Mar 2002 14:28:57 -0000
Message-Id: <200203201428.g2KESkP16797@mudshark.mcmahill.net>
Date: Wed, 20 Mar 2002 09:28:46 -0500 (EST)
From: dmcmahill@netbsd.org
Reply-To: dmcmahill@netbsd.org
To: gnats-bugs@gnats.netbsd.org
Subject: libtool pattern matching broken?
X-Send-Pr-Version: 3.95

>Number:         15981
>Category:       pkg
>Synopsis:       libtool pattern matching broken?
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    skrll
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Wed Mar 20 14:30:00 +0000 2002
>Closed-Date:    Thu Mar 21 09:16:22 +0000 2002
>Last-Modified:  Wed May 13 13:33:53 +0000 2015
>Originator:     Dan McMahill
>Release:        NetBSD 1.5ZA
>Organization:
NetBSD.org

>Environment:


System: NetBSD mudshark 1.5ZA NetBSD 1.5ZA (GENERIC) #0: Sat Mar 2 22:02:27 EST 2002 dan@bondage:/export/disk1/src/netbsd-current/src/obj.alpha/sys/arch/alpha/compile/GENERIC alpha
Architecture: alpha
Machine: alpha
>Description:

it seems that our libtool's pattern for matching shared libs doesn't like
'.' in the library name.  

The way libtool checks to see if a shared library is available from the
-lfoo flag is it looks for libfoo.so (or libfoo_pic.a).  However if you have something like
-lfoo-1.0, it tries to look for libfoo-1.0.so, but the extra '.' throws
off the regexp in the pattern matching.


[using the current pkgsrc libtool's matching]
# echo "/usr/pkgsrc/x11/gtk2/work/.buildlink/lib/libgmodule-2.0.so" | \
   sed 10q | egrep "/lib[^/\.]+(\.so|_pic\.a)$"

no match!

# echo "/usr/pkgsrc/x11/gtk2/work/.buildlink/lib/libgmodule.so" | \
   sed 10q | egrep "/lib[^/\.]+(\.so|_pic\.a)$"
/usr/pkgsrc/x11/gtk2/work/.buildlink/lib/libgmodule.so

found a match!

[using a more relaxed matching that doesn't exclude the '.']
#  echo "/usr/pkgsrc/x11/gtk2/work/.buildlink/lib/libgmodule-2.0.so" | \
   sed 10q | egrep "/lib[^/]+(\.so|_pic\.a)$"
/usr/pkgsrc/x11/gtk2/work/.buildlink/lib/libgmodule-2.0.so

found a match!


>How-To-Repeat:

try and create a shared library that links to a -lsomethingwith.inthename
with libtool.  It will complain that no shared lib for -lsomethingwith.inthename
is found.

>Fix:

change the matching pattern as shown above.

I didn't make the change myself because libtool touches too many pkgs and 
I wanted extra opinions on this fix.

>Release-Note:
>Audit-Trail:

From: Johnny Lam <jlam@jgrind.org>
To: dmcmahill@netbsd.org
Cc: gnats-bugs@gnats.netbsd.org
Subject: Re: pkg/15981: libtool pattern matching broken?
Date: Wed, 20 Mar 2002 06:56:54 -0800

 On Wed, Mar 20, 2002 at 09:28:46AM -0500, dmcmahill@netbsd.org wrote:
 > 
 > it seems that our libtool's pattern for matching shared libs doesn't like
 > '.' in the library name.  
 > 
 > The way libtool checks to see if a shared library is available from the
 > -lfoo flag is it looks for libfoo.so (or libfoo_pic.a).  However if you have something like
 > -lfoo-1.0, it tries to look for libfoo-1.0.so, but the extra '.' throws
 > off the regexp in the pattern matching.
 > 
 [snip]
 > 
 > I didn't make the change myself because libtool touches too many pkgs and 
 > I wanted extra opinions on this fix.

 This code is all part of the NetBSD-specific section of libtool, so I don't
 think we need to consult the libtool mailing list on this one.  Your change
 to remove checking for a "." before .so or _pic.a looks to be correct.  The
 only place in libtool that uses the regexp in question will test it only
 against a single library at a time, so there's no worry about matching
 across whitespace.

 I think it would be good to check on tech-toolchain whether it's okay to
 have "." in the base part of the shared library name for both ELF and a.out,
 just in case there's some funniness in either of the linkers if they try
 to link against these libraries.

 	Cheers,

 	-- Johnny Lam <jlam@jgrind.org>
State-Changed-From-To: open->analyzed 
State-Changed-By: skrll 
State-Changed-When: Wed Mar 20 08:19:42 PST 2002 
State-Changed-Why:  
The stated fix seems sensible. I'll do some more testing to make sure. 


Responsible-Changed-From-To: pkg-manager->skrll 
Responsible-Changed-By: skrll 
Responsible-Changed-When: Wed Mar 20 08:19:42 PST 2002 
Responsible-Changed-Why:  
I'm Mr. libtool. 
State-Changed-From-To: analyzed->closed 
State-Changed-By: skrll 
State-Changed-When: Thu Mar 21 01:15:35 PST 2002 
State-Changed-Why:  
Fix has been committed. 

>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.51 2026/08/10 02:28:17 riastradh Exp $
$NetBSD: gnats_config.sh,v 1.10 2026/05/13 22:00:09 riastradh Exp $
Copyright © 1994-2026 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.