This is the mail archive of the
java@gcc.gnu.org
mailing list for the Java project.
Library problem in jni.cc on Linux
- To: java at gcc dot gnu dot org
- Subject: Library problem in jni.cc on Linux
- From: Martin Kahlert <martin dot kahlert at infineon dot com>
- Date: Thu, 3 May 2001 16:28:19 +0200
- Reply-To: martin dot kahlert at infineon dot com
Hi!
I need some helping hand on this:
I try to link native methods to be statically linked into an executable on Linux.
This does not work. I used --whole-archive, but that only ensures, that the
needed methods are linked into the executable, which is a good thing.
Then i thought, that --export-dynamic would be good and used that, too.
The real problem seems to be the final line
return lt_dlsym (NULL, symname);
inside java/lang/natRuntime.cc:74
I thought, that would search symname inside the executable, but this is not
the case: The first executable instruction of lt_dlsym inside
libltdl/ltdl.c:1663 is this:
if (!handle)
{
last_error = LT_DLSTRERROR(INVALID_HANDLE);
return 0;
}
So the call in natRuntime.cc is a pure nop.
Unfortunately, i do not have any clue, how to correct this.
I assume, the executable has to be added to the libraries list
using add_library but i do not know, when and how this should be done.
(java::lang::Runtime::init? lt_dlinit?)
Please give me some hints.
Thanks in advance,
Martin
--
The early bird gets the worm. If you want something else for
breakfast, get up later.