]> git.ipfire.org Git - thirdparty/libtool.git/commitdiff
* libltdl/m4/ltdl.m4 (_LTDL_SETUP): Define
authorRalf Wildenhues <Ralf.Wildenhues@gmx.de>
Sat, 12 Jan 2008 17:00:51 +0000 (17:00 +0000)
committerRalf Wildenhues <Ralf.Wildenhues@gmx.de>
Sat, 12 Jan 2008 17:00:51 +0000 (17:00 +0000)
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.

ChangeLog
NEWS
libltdl/loaders/dlopen.c
libltdl/m4/ltdl.m4

index 9c2f959b1ef32f1aabbdfcd2160412988f2725b2..ae0bb39050feff8a4960294f9aba81ce697c8523 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,14 @@
 2008-01-12  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
 
+       * 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 6ab55eb9ff1caf2c751af0534970ed0f9f7d78db..a165c4c866e5f3446c5ac263152579f33e513f39 100644 (file)
--- 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.
 
 \f
index 1cd6b4d94a83a7494a7dee73c490812558399f7f..d8bc45b3ecab8b80998c40c02e42d2bd8d6667a2 100644 (file)
@@ -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)
     {
index f7d696528be5843e3aba5fbc592f05859fc37da3..435eed16cbf40de37201d6f49e6b818fc02446d7 100644 (file)
@@ -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