This is the mail archive of the java@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]

Don't define JNI_OnLoad in libjava/gnu/gcj/runtime/natFirstThread.cc on cygwin


cygwin doesn't support weak symbols.  This work around gets us going.  


2001-04-22  David Billinghurst  <David.Billinghurst@riotinto.com>

	* gnu/gcj/runtime/natFirstThread.cc:  Avoid JNI_OnLoad for cygwin

Index: natFirstThread.cc
===================================================================
RCS file: /cvs/gcc/gcc/libjava/gnu/gcj/runtime/natFirstThread.cc,v
retrieving revision 1.5
diff -u -r1.5 natFirstThread.cc
--- natFirstThread.cc	2001/03/26 07:05:32	1.5
+++ natFirstThread.cc	2001/04/22 07:17:23
@@ -37,6 +37,7 @@
 extern void (*_Jv_JVMPI_Notify_THREAD_START) (JVMPI_Event *event);
 #endif
 
+#ifndef __CYGWIN__
 /* This will be non-NULL if the user has preloaded a JNI library, or
    linked one into the executable.  */
 extern "C" 
@@ -44,6 +45,7 @@
 #pragma weak JNI_OnLoad
   extern jint JNI_OnLoad (JavaVM *, void *) __attribute__((weak));
 }
+#endif /* __CYGWIN__ */
 
 void
 gnu::gcj::runtime::FirstThread::run (void)
@@ -57,6 +59,7 @@
      environment variable.  We take advatage of this here to allow for
      dynamically loading a JNI library into a fully linked executable.  */
 
+#ifndef __CYGWIN__
   if (JNI_OnLoad != NULL)
     {
       JavaVM *vm = _Jv_GetJavaVM ();
@@ -72,6 +75,7 @@
 	  throw new java::lang::UnsatisfiedLinkError (JvNewStringLatin1
("unrecognized version from preloaded JNI_OnLoad"));
 	}
     }
+#endif __CYGWIN__
 
   if (klass == NULL)
     klass = java::lang::Class::forName (klass_name);


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