bug-libtool
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

ltdl.m4 requires /usr/lib*/libltdl.la


From: Nathan Phillip Brink
Subject: ltdl.m4 requires /usr/lib*/libltdl.la
Date: Tue, 15 Dec 2009 16:46:26 -0500
User-agent: Mutt/1.5.20 (2009-06-14)

https://bugs.gentoo.org/293921

When the target OS supports ELF-ish dynamic linking and libtool is being used 
to produce an executable (which doesn't use modules, etc.), it does not need to 
expand -l flags passed to gcc. This is because of the presence of .DT_NEEDED or 
something like that if I understand some things correctly. Thus, I can remove 
most (but not all) files matching the glob patter /usr/lib*/*.la from my system 
and will still be able to dynamically link executables even when using the 
libtool script to link.

However, the libtool configure macros for linking to ltdl do not take this into 
account. In my copy of libtool-2.2.6a, the distributed ltdl.m4 has a block 
looking like the following:
if test -n "$with_ltdl_lib"; then
  if test -f "$with_ltdl_lib/libltdl.la"; then :
  else
    AC_MSG_ERROR([invalid ltdl library directory: `$with_ltdl_lib'])
  fi
else
  with_ltdl_lib=no
fi

This block prevents a program from linking against a system-installed ltdl when 
there is an installed and working shared object named /usr/lib*/libltdl.so but 
the associated libltdl.la file was removed because it is _unnecessary_. If 
libltdl.la is installed, it contains a ``shouldnotlink=no'' directive (see the 
linked bug) which indicates that a program may link directly against the 
associated .so file without libtool needing to open the .la file. libltdl.la 
does contain this directive before being installed for my system, so it isn't 
installed.

I recognize that it is strange for people to run around deleting *.la files; 
but I am one of them. The original reason I deleted them was to solve problems 
when *.la files refer to nonexistent *.la files. The more recent reason is that 
I'm interested in using portage-multilib which removes the *.la files to 
facilitate building and linking to both 64-bit and 32-bit versions of 
libraries. For the most part, my system shouldn't need *.la files anyway 
because most programs are not statically linked and only a few packages I have 
installed use the module-loading feature of ltdl. I would much appreciate if 
the ltdl.m4 macros could be changed to recognize that libltdl.la doesn't have 
to exist :-).

-- 
ohnobinki

Look out for missing apostrophes!




reply via email to

[Prev in Thread] Current Thread [Next in Thread]