From: Ralf Wildenhues Date: Sat, 12 Jan 2008 17:00:51 +0000 (+0000) Subject: * libltdl/m4/ltdl.m4 (_LTDL_SETUP): Define X-Git-Tag: release-2-1b~30 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=75142db4f8afc65ba7aae0ed80ea0b35bd9cc382;p=thirdparty%2Flibtool.git * libltdl/m4/ltdl.m4 (_LTDL_SETUP): Define LTDL_DLOPEN_SELF_WORKS, depending upon lt_cv_dlopen_self. * libltdl/loaders/dlopen.c (vm_open) [!LTDL_DLOPEN_SELF_WORKS]: Fail for dlopen(NULL), so that the preopen loader is used. This fixes mdemo-exec.test failures on AIX where dlopen(NULL) succeeds but dlsym resolves no symbol. * NEWS: Update. Report by Rainer Tammer. --- diff --git a/ChangeLog b/ChangeLog index 9c2f959b1..ae0bb3905 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,14 @@ 2008-01-12 Ralf Wildenhues + * libltdl/m4/ltdl.m4 (_LTDL_SETUP): Define + LTDL_DLOPEN_SELF_WORKS, depending upon lt_cv_dlopen_self. + * libltdl/loaders/dlopen.c (vm_open) [!LTDL_DLOPEN_SELF_WORKS]: + Fail for dlopen(NULL), so that the preopen loader is used. This + fixes mdemo-exec.test failures on AIX where dlopen(NULL) + succeeds but dlsym resolves no symbol. + * NEWS: Update. + Report by Rainer Tammer. + * tests/am-subdir.at: Drop unused variables. * tests/configure-iface.at: Likewise. * tests/ctor.at: Likewise. diff --git a/NEWS b/NEWS index 6ab55eb9f..a165c4c86 100644 --- a/NEWS +++ b/NEWS @@ -116,6 +116,7 @@ New in 2.1a: 2008-??-??; CVS version 2.1a, Libtool team: - Some configure variables have been renamed to fix caching: lt_prog_compiler_pic_works to lt_cv_prog_compiler_pic_works lt_prog_compiler_static_works to lt_cv_prog_compiler_static_works. + - Fix 1.9b regression: lt_dlopen(NULL) works on AIX again. - Loads of smaller bug fixes. diff --git a/libltdl/loaders/dlopen.c b/libltdl/loaders/dlopen.c index 1cd6b4d94..d8bc45b3e 100644 --- a/libltdl/loaders/dlopen.c +++ b/libltdl/loaders/dlopen.c @@ -1,7 +1,7 @@ /* loader-dlopen.c -- dynamic linking with dlopen/dlsym Copyright (C) 1998, 1999, 2000, 2004, 2006, - 2007 Free Software Foundation, Inc. + 2007, 2008 Free Software Foundation, Inc. Written by Thomas Tanner, 1998 NOTE: The canonical source of this file is maintained with the @@ -178,7 +178,14 @@ vm_open (lt_user_data LT__UNUSED loader_data, const char *filename, #endif } - module = dlopen (filename, module_flags); + /* On AIX, dlopen(NULL) succeeds but dlsym of symbols fails. + In this case, fail here to let the preopen loader do the job. */ +#ifndef LTDL_DLOPEN_SELF_WORKS + if (!filename) + module = NULL; + else +#endif + module = dlopen (filename, module_flags); if (!module) { diff --git a/libltdl/m4/ltdl.m4 b/libltdl/m4/ltdl.m4 index f7d696528..435eed16c 100644 --- a/libltdl/m4/ltdl.m4 +++ b/libltdl/m4/ltdl.m4 @@ -338,6 +338,12 @@ m4_require([_LT_HEADER_DLFCN])dnl m4_require([_LT_CHECK_DLPREOPEN])dnl m4_require([_LT_DECL_SED])dnl +# lt_cv_dlopen_self gets defined by LT_SYS_DLOPEN_SELF, called by LT_INIT +if test "$lt_cv_dlopen_self" = yes; then + AC_DEFINE([LTDL_DLOPEN_SELF_WORKS], [1], + [Define if dlopen(NULL) is able to resolve symbols from the main program.]) +fi + dnl Don't require this, or it will be expanded earlier than the code dnl that sets the variables it relies on: _LT_ENABLE_INSTALL