[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: make libltdl work on platforms without loader
From: |
Ralf Wildenhues |
Subject: |
Re: make libltdl work on platforms without loader |
Date: |
Sun, 28 Nov 2004 21:02:35 +0100 |
User-agent: |
Mutt/1.5.6+20040722i |
* Gary V. Vaughan wrote on Sun, Nov 28, 2004 at 01:31:52PM CET:
> Ralf Wildenhues wrote:
>
> > * libltdl/loaders/dummy.c: new file, dummy loader that doesn't
> > do anything and always fails.
> > * m4/ltdl.m4 (LT_LIB_DLLOAD), libltdl/loaders/Makefile.am:
> > In case of no other loader, use the dummy loader to force
> > symfileobj creation.
>
> Yuck! No, I think we should fix this properly from the outset. It
> should only be a matter of #defining it away under the right
> circumstances...
Yup. That turned out to be pretty easy, too. See below.
> I expect we'll need to fix the annoying need-a-.la-file-even-to-dlopen-
> a-preloaded-module bug too :-(
Do you mean the issue that currently prevents libdlloader.la from
being convenience-only? Haven't looked yet, but might soon.
Back to above (rightfully) rejected patch. This one seems to do
the trick. Not beautiful, but much shorter. OK to apply? Does
HAVE_NO_DLLOADER constitute disallowed infringement on autoconf
namespace?
Regards,
Ralf (what about my dietlibc patches?)
* m4/ltdl.m4 (LT_LIB_DLLOAD): Define HAVE_NO_DLLOADER in case
preopen is the only thing we got.
* libltdl/ltdl.c (lt_dlinit): Do not preload if
!HAVE_NO_DLLOADER. Do not declare preloaded_symbols then.
Fixes libltdl on static platforms.
Index: libltdl/ltdl.c
===================================================================
RCS file: /cvsroot/libtool/libtool/libltdl/ltdl.c,v
retrieving revision 1.217.2.3
diff -u -r1.217.2.3 ltdl.c
--- libltdl/ltdl.c 1 Nov 2004 14:05:02 -0000 1.217.2.3
+++ libltdl/ltdl.c 28 Nov 2004 19:01:56 -0000
@@ -189,7 +189,9 @@
#define preloaded_symbols LT_CONC3(lt_, LTDLOPEN, _LTX_preloaded_symbols)
LT_SCOPE const lt_dlvtable * get_vtable (lt_user_data data);
+#ifndef HAVE_NO_DLLOADER
LT_SCOPE lt_dlsymlist preloaded_symbols;
+#endif
/* Initialize libltdl. */
int
@@ -211,6 +213,7 @@
/* Now open all the preloaded module loaders, so the application
can use _them_ to lt_dlopen its own modules. */
+#ifndef HAVE_NO_DLLOADER
if (!errors)
{
errors += lt_dlpreload (&preloaded_symbols);
@@ -220,6 +223,7 @@
{
errors += lt_dlpreload_open (LT_STR(LTDLOPEN), loader_init_callback);
}
+#endif /* !HAVE_NO_DLLOADER */
}
return errors;
Index: m4/ltdl.m4
===================================================================
RCS file: /cvsroot/libtool/libtool/m4/ltdl.m4,v
retrieving revision 1.20.2.2
diff -u -r1.20.2.2 ltdl.m4
--- m4/ltdl.m4 10 Nov 2004 13:20:52 -0000 1.20.2.2
+++ m4/ltdl.m4 28 Nov 2004 19:02:03 -0000
@@ -413,7 +413,9 @@
[AC_DEFINE([HAVE_LIBDL], [1],
[Define if you have the libdl library or equivalent.])
LIBADD_DLOPEN="-lsvld" libltdl_cv_func_dlopen="yes"
- LT_DLLOADERS="$LT_DLLOADERS dlopen.la"])])])
+ LT_DLLOADERS="$LT_DLLOADERS dlopen.la"],
+ [AC_DEFINE([HAVE_NO_DLLOADER], [1],
+ [Define if no native dlloader present on this
platform.])])])])
if test x"$libltdl_cv_func_dlopen" = xyes || test x"$libltdl_cv_lib_dl_dlopen"
= xyes
then
lt_save_LIBS="$LIBS"