Subject: Re: libtool, C++ shared libraries, and pthreads
To: Todd Vierling <tv@duh.org>
From: Johnny C. Lam <jlam@buildlink.org>
List: tech-pkg
Date: 11/11/2004 17:15:39
Todd Vierling wrote:
> On Thu, 11 Nov 2004, Johnny C. Lam wrote:
> 
> 
>>I've attached the essential part of the changes to libtool that I wish to make
>>to fix the libtool.m4 that differ from the current changes in
>>manual-libtool.m4.  This correctly links -lpthread to the shared library when
>>I build comms/gsmlib.
> 
> 
> However, it assumes that --host includes a version number, which is not the
> case when e.g. compiling from pkgsrc.  It's also NetBSD's policy not to use
> [kernel] version numbers to determine system features in configuration tests
> such as these.
> 
> I have a different fix based on yours which will change the command for all
> ELF platforms, not just 2.0.  This is OK (see below).  When tested, I'll
> commit it to devel/libtool*.

Okay, that's good.  I was unsure if the fix should depend on ELF or not 
(I was fuzzy on whether it was converting to ELF or updating the system 
GCC that fixed the C++ shared libs).  The tests on my end look pretty 
good.  Combined with other pthread.buildlink3.mk fixes I'll be 
committing tonight, this should allow pkgsrc to correctly use the native 
pthread library on NetBSD.

I do think that we should bump the PKGREVISION for libtool-base as a 
result.  We also need to bump PKGREVISIONs for all packages that for 
which USE_LIBTOOL=yes and !empty(USE_LANGUAGES:Mc++), since this now 
correctly adds -lpthread to the C++ shared library dependencies, which 
wasn't happening before this change.

These changes should also be fed back upstream to the libtool 
developers, too.  I think that 1.5.x development has stopped, but 
they'll need something like this for the 2.x branch.

	Thanks!

	-- Johnny Lam <jlam@buildlink.org>