bug-libtool
[Top][All Lists]
Advanced

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

Re: Bug#519702: libtool: LTDL_INIT causes -ldl to be added to LIBS, thus


From: Ralf Wildenhues
Subject: Re: Bug#519702: libtool: LTDL_INIT causes -ldl to be added to LIBS, thus linking every program with -ldl
Date: Sat, 14 Mar 2009 16:45:06 +0100
User-agent: Mutt/1.5.18 (2008-05-17)

tags forwarded
thanks

Adding bug-libtool in Cc:, this should be fixed upstream.
(I'll look at it when I get back to Libtool, unless beaten to).

* Török Edwin wrote on Sat, Mar 14, 2009 at 03:16:30PM CET:
> 
> When using LTDL_INIT in configure, it causes -ldl to be added to LIBS,
> thus later causing all the programs in a package (that uses ltdl) to
> be linked with dl, even if not all would need it, see below.
> 
> I think it would be better if LIBLTDL would contain -ldl, and thus
> only programs that actually use ltdl get linked with dl, and not all.
> 
> This happens because the LT_DLLOADERS macro uses AC_SEARCH_LIBS that sets 
> LIBS, and
> LIBS is not saved/restored before/after:
> LIBADD_DLOPEN=
> AC_SEARCH_LIBS([dlopen], [dl],
> ...
> LT_DLLOADERS="$LT_DLLOADERS ${lt_dlopen_dir+$lt_dlopen_dir/}dlopen.la"])])])
> if test x"$libltdl_cv_func_dlopen" = xyes || test 
> x"$libltdl_cv_lib_dl_dlopen" = xyes
> then
>   lt_save_LIBS="$LIBS"
>   LIBS="$LIBS $LIBADD_DLOPEN"
>   AC_CHECK_FUNCS([dlerror])
>   LIBS="$lt_save_LIBS"
> fi
> 
> Here is a snippet from the output of 'sh -x ./configure':
> + LIBS=
> + printf '%s\n' 'configure:11758: result: -ldl'
> + printf '%s\n' -ldl
> + ac_res=-ldl
> + test -ldl '!=' no
> + test -ldl = 'none required'
> + LIBS='-ldl '
> + cat
> + test -ldl '!=' 'none required'
> + LIBADD_DLOPEN=-ldl
> + libltdl_cv_lib_dl_dlopen=yes
> + LT_DLLOADERS=' dlopen.la'
> + test x = xyes
> + test xyes = xyes
> + lt_save_LIBS='-ldl '
> 
> Also configure snippet:
> if test "$ac_res" != no; then
>   test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
> 
> cat >>confdefs.h <<\_ACEOF
> #define HAVE_LIBDL 1
> _ACEOF
> 
>       if test "$ac_cv_search_dlopen" != "none required" ; then
>         LIBADD_DLOPEN="-ldl"
>       fi
> ...
> if test x"$libltdl_cv_func_dlopen" = xyes || test 
> x"$libltdl_cv_lib_dl_dlopen" = xyes
> then
>   lt_save_LIBS="$LIBS"




reply via email to

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