Patch: support *-unknown-* targets
Anthony Green
green@cygnus.com
Sat Feb 10 23:23:00 GMT 2001
Here are some miscellaneous changes for better support of unknown targets.
First, we default to `ecos' process support (i.e. none).
Next, we disable GC and networking support by default.
And finally, we work around broken weak symbol support in cases where
it shouldn't really be needed (embedded targets most likely).
I'm not particularly married to how this is done, so any and all
suggestions welcome.
2001-02-10 Anthony Green <green@redhat.com>
* configure.in: Set USING_LIBRARY_PRELOAD.
Obey CONFIGURE_HOST_GC.
* configure: Rebuilt.
* configure.host: Deal with *-unknown-* hosts.
* gnu/gcj/runtime/natFirstThread.cc: Obey USING_LIBRARY_PRELOAD.
Index: libjava/configure.host
===================================================================
RCS file: /cvs/gcc/gcc/libjava/configure.host,v
retrieving revision 1.15
diff -u -r1.15 configure.host
--- configure.host 2001/02/05 05:49:44 1.15
+++ configure.host 2001/02/11 07:14:06
@@ -81,6 +81,17 @@
;;
esac
+case "${host}" in
+ *-unknown-*)
+ # Use "Ecos" processes since they are a no-op.
+ PROCESS=Ecos
+ enable_java_net=no
+ enable_library_preload=no
+ CONFIGURE_HOST_GC=no
+ ;;
+ *) ;;
+esac
+
libgcj_cflags="${libgcj_cflags} ${libgcj_flags}"
libgcj_cxxflags="${libgcj_cxxflags} ${libgcj_flags}"
libgcj_javaflags="${libgcj_javaflags} ${libgcj_flags}"
Index: libjava/configure.in
===================================================================
RCS file: /cvs/gcc/gcc/libjava/configure.in,v
retrieving revision 1.73
diff -u -r1.73 configure.in
--- configure.in 2001/02/05 05:46:15 1.73
+++ configure.in 2001/02/11 07:14:08
@@ -155,6 +155,13 @@
;;
esac
+case "$enable_library_preload" in
+ no) ;;
+ *)
+ AC_DEFINE(USING_LIBRARY_PRELOAD)
+ ;;
+esac
+
AC_EGREP_HEADER(uint32_t, stdint.h, AC_DEFINE(HAVE_INT32_DEFINED))
AC_EGREP_HEADER(uint32_t, inttypes.h, AC_DEFINE(HAVE_INT32_DEFINED))
AC_EGREP_HEADER(u_int32_t, sys/types.h, AC_DEFINE(HAVE_BSD_INT32_DEFINED))
@@ -201,7 +208,7 @@
<< --enable-java-gc=TYPE choose garbage collector [boehm]>>,
changequote([,])
GC=$enableval,
- GC=boehm)
+ GC=${CONFIGURE_HOST_GC-boehm})
GCLIBS=
GCINCS=
GCDEPS=
Index: libjava/gnu/gcj/runtime/natFirstThread.cc
===================================================================
RCS file: /cvs/gcc/gcc/libjava/gnu/gcj/runtime/natFirstThread.cc,v
retrieving revision 1.4
diff -u -r1.4 natFirstThread.cc
--- natFirstThread.cc 2000/04/24 15:07:16 1.4
+++ natFirstThread.cc 2001/02/11 07:14:08
@@ -37,6 +37,7 @@
extern void (*_Jv_JVMPI_Notify_THREAD_START) (JVMPI_Event *event);
#endif
+#ifdef USING_LIBRARY_PRELOAD
/* 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
void
gnu::gcj::runtime::FirstThread::run (void)
@@ -52,9 +54,10 @@
Utf8Const* main_signature = _Jv_makeUtf8Const ("([Ljava.lang.String;)V", 22);
Utf8Const* main_name = _Jv_makeUtf8Const ("main", 4);
+#ifdef USING_LIBRARY_PRELOAD
/* Some systems let you preload shared libraries before running a
program. Under Linux, this is done by setting the LD_PRELOAD
- environment variable. We take advatage of this here to allow for
+ environment variable. We take advantage of this here to allow for
dynamically loading a JNI library into a fully linked executable. */
if (JNI_OnLoad != NULL)
@@ -72,6 +75,7 @@
_Jv_Throw (new java::lang::UnsatisfiedLinkError (JvNewStringLatin1 ("unrecognized version from preloaded JNI_OnLoad")));
}
}
+#endif
if (klass == NULL)
klass = java::lang::Class::forName (klass_name);
More information about the Java-patches
mailing list