This is the mail archive of the java-patches@gcc.gnu.org mailing list for the Java project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Patch: RFA: Delay call to lt_dlsetsearchpath


Hi,

_Jv_SetDLLSearchPath was being called before lt_dlinit so it was having
no effect on libltdl's lookup path.  This patch fixes the problem.

OK for mainline?

Tom

2005-09-07  Thomas Fitzsimmons  <fitzsim@redhat.com>

	PR libgcj/23761
	* include/java-props.h (_Jv_Module_Load_Path): Declare variable.
	* java/lang/natRuntime.cc (init): Call lt_dlsetsearchpath after
	lt_dlinit.
	* gnu/classpath/natSystemProperties.cc (_Jv_Module_Load_Path):
	Define variable.
	(_Jv_SetDLLSearchPath): Do not call lt_dlsetsearchpath.  Set
	_Jv_Module_Load_Path.

Index: gnu/classpath/natSystemProperties.cc
===================================================================
RCS file: /cvs/gcc/gcc/libjava/gnu/classpath/natSystemProperties.cc,v
retrieving revision 1.1
diff -u -r1.1 natSystemProperties.cc
--- gnu/classpath/natSystemProperties.cc	25 Apr 2005 19:48:34 -0000	1.1
+++ gnu/classpath/natSystemProperties.cc	7 Sep 2005 13:05:31 -0000
@@ -38,13 +38,15 @@
 #include <java/lang/String.h>
 #include <jni.h>
 
+char *_Jv_Module_Load_Path = NULL;
+
 #ifdef USE_LTDL
 #include <ltdl.h>
 
 void
 _Jv_SetDLLSearchPath (const char *path)
 {
-  lt_dlsetsearchpath (path);
+  _Jv_Module_Load_Path = strdup (path);
 }
 
 #else
Index: include/java-props.h
===================================================================
RCS file: /cvs/gcc/gcc/libjava/include/java-props.h,v
retrieving revision 1.9
diff -u -r1.9 java-props.h
--- include/java-props.h	2 Apr 2005 02:26:51 -0000	1.9
+++ include/java-props.h	7 Sep 2005 13:05:32 -0000
@@ -26,5 +26,8 @@
 // Properties taken from the user's environment.
 extern property_pair *_Jv_Environment_Properties;
 
+// Module load path.
+extern char *_Jv_Module_Load_Path;
+
 #endif
 
Index: java/lang/natRuntime.cc
===================================================================
RCS file: /cvs/gcc/gcc/libjava/java/lang/natRuntime.cc,v
retrieving revision 1.57
diff -u -r1.57 natRuntime.cc
--- java/lang/natRuntime.cc	25 Apr 2005 19:48:35 -0000	1.57
+++ java/lang/natRuntime.cc	7 Sep 2005 13:05:32 -0000
@@ -242,6 +242,8 @@
 {
 #ifdef USE_LTDL
   lt_dlinit ();
+  // Set module load path.
+  lt_dlsetsearchpath (_Jv_Module_Load_Path);
   // Make sure self is opened.
   lt_dlopen (NULL);
 #endif

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]