Bug 20270

Summary: libtool needlessly runs ldconfig after install shlibs
Product: Ports & Packages Reporter: FUJISHIMA Satsuki <k5>
Component: Individual Port(s)Assignee: Ade Lovett <ade>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: Latest   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
file.diff none

Description FUJISHIMA Satsuki 2000-07-28 20:30:01 UTC
	libtool installed with ports/devel/libtool runs ldconfig when
	shared library installed. This is FreeBSD specific, and now
	bsd.port.mk handles this properly. So libtool doesn't need to run
	ldconfig.

	I found this behavior of libtool when I work with audio/xmms port
	(ports/20261). This port installs some sharelibs as plugin module
	into ${X11BASE}/lib/xmms/* and libtool runs ldconfig -m there.

	The problem happens when you deinstall this port; pkg_delete
	removes all plugins and directories and then try to ldconfig -R.
	Of course there are no such directories and complains:

===>  Deinstalling for xmms-1.2.2
ldconfig: /usr/X11R6/lib/xmms/Output: No such file or directory
ldconfig: /usr/X11R6/lib/xmms/Effect: No such file or directory
ldconfig: /usr/X11R6/lib/xmms/General: No such file or directory
ldconfig: /usr/X11R6/lib/xmms/Visualization: No such file or directory

	So I think that ldconfig run by libtool is overkill.

How-To-Repeat: 
o make audio/xmms WITH patch ports/20261 applied.
/usr/ports/audio/xmms# make install
<< successfully installed >>

/usr/ports/audio/xmms# ldconfig -r|head -2
/var/run/ld-elf.so.hints:
        search directories: /usr/lib:/usr/lib/compat:/usr/X11R6/lib:/usr/local/lib:/usr/X11R6/lib/xmms/Input:/usr/X11R6/lib/xmms/Output:/usr/X11R6/lib/xmms/Effect:/usr/X11R6/lib/xmms/General:/usr/X11R6/lib/xmms/Visualization

o then remove this package.
/usr/ports/audio/xmms# make deinstall
ldconfig: /usr/X11R6/lib/xmms/Output: No such file or directory
ldconfig: /usr/X11R6/lib/xmms/Effect: No such file or directory
ldconfig: /usr/X11R6/lib/xmms/General: No such file or directory
ldconfig: /usr/X11R6/lib/xmms/Visualization: No such file or directory
Comment 1 Jeremy Lea freebsd_committer freebsd_triage 2000-07-31 08:06:18 UTC
Hi,

On Sat, Jul 29, 2000 at 04:26:50AM +0900, FUJISHIMA Satsuki wrote:
> 	libtool installed with ports/devel/libtool runs ldconfig when
> 	shared library installed. This is FreeBSD specific, and now
> 	bsd.port.mk handles this properly. So libtool doesn't need to run
> 	ldconfig.

Well yes, and no.  Any ports specific behaviour in libtool is controled
by command line options, so I'd have to add one for not running
ldconfig when it's run from bsd.port.mk.

> 	The problem happens when you deinstall this port; pkg_delete
> 	removes all plugins and directories and then try to ldconfig -R.
> 	Of course there are no such directories and complains:
> 
> ===>  Deinstalling for xmms-1.2.2
> ldconfig: /usr/X11R6/lib/xmms/Output: No such file or directory
> ldconfig: /usr/X11R6/lib/xmms/Effect: No such file or directory
> ldconfig: /usr/X11R6/lib/xmms/General: No such file or directory
> ldconfig: /usr/X11R6/lib/xmms/Visualization: No such file or directory
> 
> 	So I think that ldconfig run by libtool is overkill.

It's also harmless.  Other than in this case.  I think we have multiple
problems here:

1.  ldconfig should be ignoring non existant directories.
2.  bsd.port.mk should run ldconfig before @dirrms.
3.  libtool shouldn't be running ldconfig for modules (xmms's plugins
are compiled with --avoid-version).

I'll fix the last problem.

Regards,
 -Jeremy

-- 
FreeBSD - Because the best things in life are free...
                                           http://www.freebsd.org/
Comment 2 FUJISHIMA Satsuki 2000-07-31 15:51:46 UTC
At Mon, 31 Jul 2000 00:06:18 -0700,
Jeremy Lea <reg@FreeBSD.ORG> wrote:
> It's also harmless.  Other than in this case.  I think we have multiple
> problems here:
> 
> 1.  ldconfig should be ignoring non existant directories.
> 2.  bsd.port.mk should run ldconfig before @dirrms.
> 3.  libtool shouldn't be running ldconfig for modules (xmms's plugins
> are compiled with --avoid-version).
> 
> I'll fix the last problem.

(1) This would be harmful. we would be hard to find a typo such as
    "/usr/X11R6/lbi", so current behavior is better.

(2) Hmm, binaries linked against libraries installed non-standard
    place should be linked with -rpath doesn't it(and don't ldconfig -m
    its directory)? This is a design issue of FreeBSD system (ldconfig
    VS -rpath) so leave it as is for now. :-)

(3) This is good solusion I think.

BTW, would you please update libtool to 1.3.5 if it is better than 1.3.4?

-- 
FUJISHIMA Satsuki
Comment 3 Ade Lovett freebsd_committer freebsd_triage 2000-09-17 19:13:38 UTC
Responsible Changed
From-To: freebsd-ports->reg

Over to maintainer (yes, I read the audit trail again :)
Comment 4 Ade Lovett freebsd_committer freebsd_triage 2003-01-20 04:50:10 UTC
Responsible Changed
From-To: reg->ade

I'll be looking at all things libtool prior to 4.8-RELEASE
Comment 5 Ade Lovett freebsd_committer freebsd_triage 2003-06-30 21:12:05 UTC
State Changed
From-To: open->analyzed

Will be dealt with as part of ongoing work with gnu building tools 
in general.
Comment 6 Ade Lovett freebsd_committer freebsd_triage 2004-06-04 18:44:12 UTC
State Changed
From-To: analyzed->closed

Unfortunately, with the recent major changes to the autotools ports 
infrastructure, this PR would have to have extensive rebuilding work. 

If you believe this is still a problem, please submit a new PR against 
the updated bsd.autotools.mk as of today (June 4 2004)