libtool-patches
[Top][All Lists]
Advanced

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

Re: cope with dlopen(NULL) failing on AIX (was: support AIX 6.1 in confi


From: Bob Friesenhahn
Subject: Re: cope with dlopen(NULL) failing on AIX (was: support AIX 6.1 in config.rpath)
Date: Sat, 12 Jan 2008 10:30:39 -0600 (CST)

On Sat, 12 Jan 2008, Ralf Wildenhues wrote:

I still don't know why it doesn't "just work".  But here is a somewhat
less crude hack.  OK to apply?  Fixing this could maybe be more nicely
be done in ltdl.c, but I would like to defer that until after 2.2, and
with this I don't see any obvious semantic downsides.

This patch looks ok to me.

Bob


FWIW, this patch requires that LT_INIT is expanded before LTDL_INIT.

Thanks,
Ralf

2008-01-12  Ralf Wildenhues  <address@hidden>

        * 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.

Index: NEWS
===================================================================
RCS file: /cvsroot/libtool/libtool/NEWS,v
retrieving revision 1.213
diff -u -r1.213 NEWS
--- NEWS        11 Jan 2008 07:08:27 -0000      1.213
+++ NEWS        12 Jan 2008 14:38:45 -0000
@@ -116,6 +116,7 @@
  - 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.


Index: libltdl/loaders/dlopen.c
===================================================================
RCS file: /cvsroot/libtool/libtool/libltdl/loaders/dlopen.c,v
retrieving revision 1.11
diff -u -r1.11 dlopen.c
--- libltdl/loaders/dlopen.c    4 Jul 2007 23:05:05 -0000       1.11
+++ libltdl/loaders/dlopen.c    12 Jan 2008 14:38:45 -0000
@@ -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 @@
#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: libltdl/m4/ltdl.m4
===================================================================
RCS file: /cvsroot/libtool/libtool/libltdl/m4/ltdl.m4,v
retrieving revision 1.39
diff -u -r1.39 ltdl.m4
--- libltdl/m4/ltdl.m4  8 Jan 2008 19:39:19 -0000       1.39
+++ libltdl/m4/ltdl.m4  12 Jan 2008 14:38:46 -0000
@@ -338,6 +338,12 @@
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


_______________________________________________
Bug-libtool mailing list
address@hidden
http://lists.gnu.org/mailman/listinfo/bug-libtool


======================================
Bob Friesenhahn
address@hidden, http://www.simplesystems.org/users/bfriesen/
GraphicsMagick Maintainer,    http://www.GraphicsMagick.org/





reply via email to

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