Pre-release of 2.1.7

Alan DeKok aland at deployingradius.com
Sat Sep 5 17:34:00 CEST 2009


Joe Maimon wrote:
> The last time I had a problem with libltdl, I has to execute a make
> manually in the source tree libltdl directory.
> 
> After that everything worked, including rebuilds.

  It turns out it's a problem with newer versions of libltdl.  Warning:
this message is long and complicated.

  To recap, when you see:

...  undefined reference to `lt__PROGRAM__LTX_preloaded_symbols'

  it's a bug in libltdl / libtool.

  See:

http://git.savannah.gnu.org/cgit/libtool.git/tree/libltdl/ltdl.h

  There's a line:

#define lt_preloaded_symbols	lt__PROGRAM__LTX_preloaded_symbols

  Which causes the problem.  The apparent *intent* of the libtool
crazies is to define this symbol inside of libtool.  The source code
they distribute contains this inside of their "libltdl/m4/libtool.m4":

libtool.m4:lt__PROGRAM__LTX_preloaded_symbols[[]] =
libtool.m4:  return lt__PROGRAM__LTX_preloaded_symbols;

  Ok... that looks reasonable, right?  Except that the *installed*
version of libtool on the systems with this bug looks like:

libtool:lt_${my_prefix}_LTX_preloaded_symbols[];
libtool:lt_${my_prefix}_LTX_preloaded_symbols[] =
libtool:  return lt_${my_prefix}_LTX_preloaded_symbols;

  And what is "my_prefix" set to?  Nothing useful, that's for sure.

  But it gets better.  There's *another* file distributed with the main
libtool code.  That file is intended to be used by projects like
FreeRADIUS, in order to create the "right" version of libtool for each
platform.  FreeRADIUS has one (ltmain.sh, right beside the top-level
configure and Makefile).

  The version of ltmain.sh distributed with the upstream libltdl source
code has:

ltmain.m4sh:lt_${my_prefix}_LTX_preloaded_symbols[];
ltmain.m4sh:lt_${my_prefix}_LTX_preloaded_symbols[] =
ltmain.m4sh:  return lt_${my_prefix}_LTX_preloaded_symbols;

  Aha!  That's it.  The ltmain.sh that everyone is supposed to use
doesn't match the version of ltdl.h that they're also supposed to use.

  To recap, the version of libtool used to BUILD libltdl has the right
symbols defined. But when libltdl is *installed*, that symbol
disappears, and is replaced by lt_libltdl_LTX_preloaded_symbols.  The
version of libtool that the *suckers* like FreeRADIUS are supposed to
use has references to t__PROGRAM__LTX_preloaded_symbols, but it does NOT
have references to lt_libltdl_LTX_preloaded_symbols.

  It's like libtool and libltdl are some kind of sick joke.

  The solution *seems* to be simple.  Update the FreeRADIUS source code
to add:

#define lt__PROGRAM__LTX_preloaded_symbols \
	lt_libltdl_LTX_preloaded_symbols

  It then compiles and runs.

  Did I mention I hate libtool and libltdl?  I hate them with a passion
that (in contrast) makes a rabid dog look like a good babysitter for
your children.

  Alan DeKok.



More information about the Freeradius-Users mailing list