From 1acee63da4b98fecdb59b3ce4b67a4d5fbd21323 Mon Sep 17 00:00:00 2001 From: "Gary V. Vaughan" Date: Wed, 26 Nov 2014 19:36:47 +0000 Subject: [PATCH] ltdl: fix a long standing duplicate `-ldl' bug in the link line. * m4/ltdl.m4 (LT_LIB_DLLOAD): Save contents of LIBS before calling AC_SEARCH_LIBS, which prepends to LIBS by default, and restore afterwards. We set LIBADD_DLOPEN and LIBADD_SHL_LOAD so that dynamic loader libraries can be added selectively only where they are needed. * NEWS: Update. Signed-off-by: Gary V. Vaughan --- NEWS | 11 +++++++++++ m4/ltdl.m4 | 2 ++ 2 files changed, 13 insertions(+) diff --git a/NEWS b/NEWS index 75da6ea0b..2782511cc 100644 --- a/NEWS +++ b/NEWS @@ -12,10 +12,21 @@ NEWS - list of user-visible changes between releases of GNU Libtool - Installation of 'libtoolize' once again obeys '--program-prefix', '--program-suffix' and '--program-transform-name' configure options. + - `libtoolize` doesn't remove any files that it can't reinstall, including old versions of the snippet directory, and gnulib's version of the argz module and supporting files. +** Important incompatible changes: + + - LT_LIB_DLLOAD no longer prepends -ldl or -ldld to LIBS, causing + duplicate occurrences in libltdl link lines. If you need to + add a library for dlopen() or shl_load() in your Makefile, then + use $(LIBADD_DLOPEN) or $(LIBADD_SHL_LOAD) respectively. If you + are using libltdl, this all happens automatically, and the only + difference you'll see is no more duplicated library names in the + verbose link line. + ** Changes in supported systems or compilers: - Preliminary support for tcc on linux*. Although it already worked diff --git a/m4/ltdl.m4 b/m4/ltdl.m4 index eeb37ac4b..411984416 100644 --- a/m4/ltdl.m4 +++ b/m4/ltdl.m4 @@ -651,6 +651,7 @@ LT_DLLOADERS= AC_SUBST([LT_DLLOADERS]) AC_LANG_PUSH([C]) +lt_dlload_save_LIBS=$LIBS LIBADD_DLOPEN= AC_SEARCH_LIBS([dlopen], [dl], @@ -734,6 +735,7 @@ dnl This isn't used anymore, but set it for backwards compatibility LIBADD_DL="$LIBADD_DLOPEN $LIBADD_SHL_LOAD" AC_SUBST([LIBADD_DL]) +LIBS=$lt_dlload_save_LIBS AC_LANG_POP ])# LT_LIB_DLLOAD -- 2.47.3