Re: Another fix for libltdl (fwd)

Date view Thread view Subject view Author view

From: Parmelan, Edouard (EP510777@exchange.FRANCE.NCR.com)
Date: Wed Jan 13 1999 - 13:32:17 EST


Hi,

> In any event, I really think that the ability to load plain .so files
> in Solaris, Linux, or FreeBSD is essential for making Kaffe an
> alternative to Sun. I just don't see any way around it.

Simply use lt_dlopen("libfoo.so") :)

We may change java.lang.Runtime.loadFileInternal() if it fails with a
library name ending with ".la", re-try with ".so" or ".dll".

May be this could be done by lt_dlopen() directly ?

Let's me try to explain how libtool work :)

Libtool manage libtool objects (*.lo) and old objects (*.o).
 - old object foo.o is the result of the compilation of foo.c
   without option -fPIC.
 - libtool object foo.lo is the result of the compilation of foo.c
   with option -fPIC.

A libtool library (*.la) is a text file with some magic values:
  dlname='libfoo1.so.0'
  old_library='libfoo1.a'
  dl_dependency_libs=' -lm'
  libdir='/home/parmee/gnu/libtool/test/_inst/lib'

This text file is used at compile time and at run time when
we call lt_dlopen().

If you don't have dynamic libraries, libtool create for you a
symbol table called dld_preloaded_symbols and your binary is
transparently linked staticly.

For Kaffe, I think we don't need static libraries at all (convenience
libraries, as libengine.la, only exist for build the real dynamic
library, libkaffevm.os).

I configure Kaffe on GNU/Linux and on NCR with --disable-static.

The current problem is that libtool is more restrictive when it
create a dynamic library linked with others libraries.

The ltconfig script defines the 'deplibs_check_method'.
By default it's 'none', all dependents libraries are removed
before create the real library and save in the libtool text file
(libfoo1.la).

Unfortunary, in ltdl.c load_deplibs() and unload_deplibs() are noop.
These two functions should load all 'dl_dependency_libs' required by
a library opened with lt_dlopen().

The current exemple is libmath.so that need the static library -lgmp.

osf[43]* and NCR MP-RAS use 'pass_all', static and dynamic libraries
are passed to linker when creating a dynamic lib.
*** This is the old build method of Kaffe. ***

GNU/Linux use 'file_magic' and a regexp to check if needed lib is dynamic.

cygwin32 use 'file_magic' and a regexp

Solaris and FreeBSD use 'none' :(
You may use a file_magic and found the correct regexp.
[ try file libkaffevm.so and see how GNU/Linux is configured. ]

Before Kaffe/libtool work as Kaffe before libtool, we need add some
configuration options into libtool.

Hope this help,
Edouard.


Date view Thread view Subject view Author view

This archive was generated by hypermail 2b29 : Sat Sep 23 2000 - 19:57:40 EDT