public inbox for java@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] [JAVA] patch for Java on RTEMS
@ 2011-08-10 17:00 Jie Liu
  2011-08-14 13:04 ` Jie Liu
  2011-08-15  9:43 ` Andrew Haley
  0 siblings, 2 replies; 7+ messages in thread
From: Jie Liu @ 2011-08-10 17:00 UTC (permalink / raw)
  To: java-patches, java, gcc-patches; +Cc: Joel Sherrill

[-- Attachment #1: Type: text/plain, Size: 1068 bytes --]

Hi,

For the previous analysis "libjava patches for RTEMS"[1], there are 6
cases need to pay more attention. PR18699, TLtest, Thread_Interrupt,
Thread_Sleep_2, Throw_2 and bclink.

After add patch to bdwgc for RTEMS pthread support[2]:
PR18699                PASS after Modify       [A bug in boehm-gc on
RTEMS, not related to libjava]
TLtest                    PASS
Thread_Interrupt      PASS

For the other 3 cases:
Thread_Sleep_2      PASS                       [After add patch to rtems]
Throw_2                 PASS                       [After add patch to
libjava, still need some work][3]
bclink                    UnSupport
[-findirect-dispatch do not support in this case]

I think it's time to send out the patch for review, because it may
need much time to modify. The patch is attached.

How to mark those unsupported cases as expected failures on *-*-rtems* ?

[1]http://gcc.gnu.org/ml/java-patches/2011-q3/msg00016.html
[2]http://gcc.gnu.org/ml/java-patches/2011-q3/msg00042.html
[3]http://gcc.gnu.org/ml/java-patches/2011-q3/msg00037.html

Thanks,
Jie

[-- Attachment #2: libjava.patch --]
[-- Type: application/octet-stream, Size: 4662 bytes --]

Index: configure.host
===================================================================
--- configure.host	(revision 172224)
+++ configure.host	(working copy)
@@ -347,8 +347,13 @@
 	slow_pthread_self=
 	can_unwind_signal=yes
 	;;
+  *-*-rtems*)
+	can_unwind_signal=no
+	CHECKREFSPEC=-fcheck-references
+	DIVIDESPEC=-fuse-divide-subroutine
+	;;
 esac
 
 case "${host}" in
   *-cygwin* | *-mingw*)
 	fallback_backtrace_h=sysdep/i386/backtrace.h  
Index: configure.ac
===================================================================
--- configure.ac	(revision 172224)
+++ configure.ac	(working copy)
@@ -1048,6 +1048,19 @@
     ;;
  win32)
     ;;
+ rtems)
+    THREADS=posix
+    AC_DEFINE(HAVE_SYS_SOCKET_H, 1, [Required define in rtems.])
+    AC_DEFINE(HAVE_NETINET_IN_H, 1, [Required define in rtems.])
+    AC_DEFINE(HAVE_ARPA_INET_H, 1, [Required define in rtems.])
+    AC_DEFINE(HAVE_NETDB_H, 1, [Required define in rtems.])
+    AC_DEFINE(HAVE_SYS_IOCTL_H, 1, [Required define in rtems.])
+    AC_DEFINE(HAVE_NET_IF_H, 1, [Required define in rtems.])
+    AC_DEFINE(HAVE_IFADDRS_H, 1, [Required define in rtems.])
+    AC_DEFINE(HAVE_GETTIMEOFDAY, 1, [Required define in rtems.])
+    AC_DEFINE(HAVE_GETHOSTNAME_DECL, 1, [Required define in rtems.])
+    AC_DEFINE(RTEMS_PTHREADS, 1, [Required define in rtems.])
+    ;;
  decosf1 | irix | mach | os2 | dce | vxworks)
     AC_MSG_ERROR(thread package $THREADS not yet supported)
     ;;
Index: classpath/native/fdlibm/mprec.c
===================================================================
--- classpath/native/fdlibm/mprec.c	(revision 172224)
+++ classpath/native/fdlibm/mprec.c	(working copy)
@@ -1004,7 +1004,7 @@
 {1e-16, 1e-32};
 #endif
 
-
+#ifdef RTEMS_PTHREADS
 double
 _DEFUN (_mprec_log10, (dig),
 	int dig)
@@ -1019,3 +1019,4 @@
     }
   return v;
 }
+#endif
Index: include/config.h.in
===================================================================
--- include/config.h.in	(revision 172224)
+++ include/config.h.in	(working copy)
@@ -379,6 +379,9 @@
 /* Define if using POSIX threads on Linux. */
 #undef LINUX_THREADS
 
+/* Define if using POSIX threads on RTEMS. */
+#undef RTEMS_PTHREADS
+
 /* Define to the name of the environment variable that determines the dynamic
    library search path. */
 #undef LTDL_SHLIBPATH_VAR
Index: posix-threads.cc
===================================================================
--- posix-threads.cc	(revision 172224)
+++ posix-threads.cc	(working copy)
@@ -62,9 +62,11 @@
 static int non_daemon_count;
 
 // The signal to use when interrupting a thread.
-#if defined(LINUX_THREADS) || defined(FREEBSD_THREADS)
+#if defined(LINUX_THREADS) || defined(FREEBSD_THREADS) \
+    || defined(RTEMS_PTHREADS)
   // LinuxThreads (prior to glibc 2.1) usurps both SIGUSR1 and SIGUSR2.
   // GC on FreeBSD uses both SIGUSR1 and SIGUSR2.
+  // GC on  RTEMS  uses both SIGUSR1 and SIGUSR2.
 #  define INTR SIGHUP
 #else /* LINUX_THREADS */
 #  define INTR SIGUSR2
@@ -672,6 +674,10 @@
   pthread_attr_setschedparam (&attr, &param);
   pthread_attr_setdetachstate (&attr, PTHREAD_CREATE_DETACHED);
   
+#ifdef RTEMS_PTHREADS
+  pthread_attr_setinheritsched(&attr, PTHREAD_EXPLICIT_SCHED);
+  pthread_attr_setschedpolicy(&attr, SCHED_OTHER);
+#endif
   // Set stack size if -Xss option was given.
   if (gcj::stack_size > 0)
     {
Index: configure
===================================================================
--- configure	(revision 172224)
+++ configure	(working copy)
@@ -20704,6 +20704,21 @@
     ;;
  win32)
     ;;
+ rtems)
+    THREADS=posix
+$as_echo "#define HAVE_SYS_SOCKET_H 1" >>confdefs.h
+$as_echo "#define HAVE_NETINET_IN_H 1" >>confdefs.h
+$as_echo "#define HAVE_ARPA_INET_H 1" >>confdefs.h
+$as_echo "#define HAVE_NETDB_H 1" >>confdefs.h
+$as_echo "#define HAVE_SYS_IOCTL_H 1" >>confdefs.h
+$as_echo "#define HAVE_NET_IF_H 1" >>confdefs.h
+$as_echo "#define HAVE_IFADDRS_H 1" >>confdefs.h
+$as_echo "#define HAVE_GETTIMEOFDAY 1" >>confdefs.h
+$as_echo "#define HAVE_GETHOSTNAME_DECL 1" >>confdefs.h
+$as_echo "#define HAVE_MPREC_LOG10 1" >>confdefs.h
+$as_echo "#define NO_TLS 1" >>confdefs.h
+$as_echo "#define RTEMS_PTHREADS 1" >>confdefs.h
+    ;;
  decosf1 | irix | mach | os2 | dce | vxworks)
     as_fn_error "thread package $THREADS not yet supported" "$LINENO" 5
     ;;
Index: java/lang/natClass.cc
===================================================================
--- java/lang/natClass.cc	(revision 172224)
+++ java/lang/natClass.cc	(working copy)
@@ -1679,6 +1679,10 @@
   return NULL;
 }
 
+#ifdef RTEMS_PTHREADS
+# undef HAVE_TLS
+#endif
+
 #ifdef HAVE_TLS
 
 // NOTE: MCACHE_SIZE should be a power of 2 minus one.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] [JAVA] patch for Java on RTEMS
  2011-08-10 17:00 [PATCH] [JAVA] patch for Java on RTEMS Jie Liu
@ 2011-08-14 13:04 ` Jie Liu
  2011-08-26 13:33   ` Ralf Corsepius
  2011-08-15  9:43 ` Andrew Haley
  1 sibling, 1 reply; 7+ messages in thread
From: Jie Liu @ 2011-08-14 13:04 UTC (permalink / raw)
  To: java-patches, java, gcc-patches; +Cc: Joel Sherrill

[-- Attachment #1: Type: text/plain, Size: 166 bytes --]

Hi,

I have add the boehm-gc patch and the configure for gcc patch to the
patch attached. So we can add this patch and then compile gcj for
RTEMS.

Best Regards,
Jie

[-- Attachment #2: gcj-rtems.patch --]
[-- Type: application/octet-stream, Size: 13255 bytes --]

Index: configure.ac
===================================================================
--- configure.ac	(revision 172224)
+++ configure.ac	(working copy)
@@ -623,7 +623,7 @@
     noconfigdirs="$noconfigdirs target-newlib target-libgloss ${libgcj}"
     ;;
   *-*-rtems*)
-    noconfigdirs="$noconfigdirs target-libgloss ${libgcj}"
+    noconfigdirs="$noconfigdirs target-libgloss"
     ;;
     # The tpf target doesn't support gdb yet.
   *-*-tpf*)
Index: boehm-gc/mach_dep.c
===================================================================
--- boehm-gc/mach_dep.c	(revision 172224)
+++ boehm-gc/mach_dep.c	(working copy)
@@ -411,7 +411,8 @@
     word dummy;
 
 #   if defined(USE_GENERIC_PUSH_REGS)
-#     ifdef HAVE_BUILTIN_UNWIND_INIT
+#     if defined(HAVE_BUILTIN_UNWIND_INIT)\
+         &&!(defined(I386) && defined(RTEMS))
         /* This was suggested by Richard Henderson as the way to	*/
         /* force callee-save registers and register windows onto	*/
         /* the stack.						*/
@@ -437,8 +438,8 @@
   	for (; (char *)i < lim; i++) {
   	    *i = 0;
   	}
-#       if defined(MSWIN32) || defined(MSWINCE) \
-                  || defined(UTS4) || defined(LINUX) || defined(EWS4800)
+#       if defined(MSWIN32) || defined(MSWINCE) || defined(UTS4) \
+           || defined(LINUX) || defined(EWS4800) || defined(RTEMS)
   	  (void) setjmp(regs);
 #       else
             (void) _setjmp(regs);
Index: boehm-gc/include/gc_config_macros.h
===================================================================
--- boehm-gc/include/gc_config_macros.h	(revision 172224)
+++ boehm-gc/include/gc_config_macros.h	(working copy)
@@ -20,7 +20,7 @@
 	defined(GC_IRIX_THREADS) || defined(GC_LINUX_THREADS) || \
 	defined(GC_HPUX_THREADS) || defined(GC_OSF1_THREADS) || \
 	defined(GC_DGUX386_THREADS) || defined(GC_DARWIN_THREADS) || \
-	defined(GC_AIX_THREADS) || \
+	defined(GC_AIX_THREADS) || defined(GC_RTEMS_PTHREADS) || \
         (defined(GC_WIN32_THREADS) && defined(__CYGWIN32__))
 #   define GC_PTHREADS
 # endif
Index: boehm-gc/include/gc_config.h.in
===================================================================
--- boehm-gc/include/gc_config.h.in	(revision 172224)
+++ boehm-gc/include/gc_config.h.in	(working copy)
@@ -51,6 +51,9 @@
 /* support for win32 threads */
 #undef GC_WIN32_THREADS
 
+/* Define to support RTEMS pthreads. */
+#undef GC_RTEMS_PTHREADS
+
 /* ppc_thread_state64_t has field r0 */
 #undef HAS_PPC_THREAD_STATE64_R0
 
Index: boehm-gc/include/private/gcconfig.h
===================================================================
--- boehm-gc/include/private/gcconfig.h	(revision 172224)
+++ boehm-gc/include/private/gcconfig.h	(working copy)
@@ -315,6 +315,11 @@
 #    define mach_type_known
 #   endif
 # endif
+# if defined(__rtems__) && (defined(i386) || defined(__i386__))
+#   define I386
+#   define RTEMS
+#   define mach_type_known
+# endif
 # if defined(NeXT) && defined(mc68000)
 #   define M68K
 #   define NEXT
@@ -1297,6 +1302,19 @@
 #	define STACKBOTTOM ((ptr_t)0xc0000000)
 #	define DATAEND	/* not needed */
 #   endif
+#   ifdef RTEMS
+#       define OS_TYPE "RTEMS"
+#       include <sys/unistd.h>
+        extern int etext[];
+        extern int end[];
+        void *rtems_get_stack_bottom();
+#       define InitStackBottom rtems_get_stack_bottom()
+#       define DATASTART ((ptr_t)etext)
+#       define DATAEND ((ptr_t)end)
+#       define STACKBOTTOM ((ptr_t)InitStackBottom)
+#       define SIG_SUSPEND SIGUSR1
+#       define SIG_THR_RESTART SIGUSR2
+#   endif
 #   ifdef DOS4GW
 #     define OS_TYPE "DOS4GW"
       extern long __nullarea;
@@ -2370,7 +2388,8 @@
 #   else
 #     if defined(NEXT) || defined(DOS4GW) || \
 		 (defined(AMIGA) && !defined(GC_AMIGA_FASTALLOC)) || \
-		 (defined(SUNOS5) && !defined(USE_MMAP))
+		 (defined(SUNOS5) && !defined(USE_MMAP)) || \
+                 defined(RTEMS)
 #       define GET_MEM(bytes) HBLKPTR((size_t) \
 					      calloc(1, (size_t)bytes + GC_page_size) \
 					      + GC_page_size-1)
Index: boehm-gc/configure
===================================================================
--- boehm-gc/configure	(revision 172224)
+++ boehm-gc/configure	(working copy)
@@ -14867,6 +14867,11 @@
     $as_echo "#define _REENTRANT 1" >>confdefs.h
 
     ;;
+ rtems)
+    THREADS=posix
+    $as_echo "#define GC_RTEMS_PTHREADS 1" >>confdefs.h
+    $as_echo "#define THREAD_LOCAL_ALLOC 1" >>confdefs.h
+    ;;
  decosf1 | irix | mach | os2 | dce | vxworks)
     as_fn_error "thread package $THREADS not yet supported" "$LINENO" 5
     ;;
Index: boehm-gc/pthread_stop_world.c
===================================================================
--- boehm-gc/pthread_stop_world.c	(revision 172224)
+++ boehm-gc/pthread_stop_world.c	(working copy)
@@ -540,10 +540,19 @@
     if (sem_init(&GC_suspend_ack_sem, 0, 0) != 0)
         ABORT("sem_init failed");
 
+#   ifdef SA_RESTART
     act.sa_flags = SA_RESTART;
+#   else
+    act.sa_flags = 0;
+#   endif
     if (sigfillset(&act.sa_mask) != 0) {
     	ABORT("sigfillset() failed");
     }
+#   ifdef GC_RTEMS_PTHREADS
+    if(sigprocmask(SIG_UNBLOCK,&act.sa_mask,NULL) !=0) {
+        ABORT("rtems sigprocmask() failed\n");
+    }
+#   endif
     GC_remove_allowed_signals(&act.sa_mask);
     /* SIG_THR_RESTART is set in the resulting mask.		*/
     /* It is unmasked by the handler when necessary. 		*/
Index: boehm-gc/pthread_support.c
===================================================================
--- boehm-gc/pthread_support.c	(revision 172224)
+++ boehm-gc/pthread_support.c	(working copy)
@@ -75,8 +75,8 @@
 # endif
 
 # if (defined(GC_DGUX386_THREADS) || defined(GC_OSF1_THREADS) || \
-      defined(GC_DARWIN_THREADS) || defined(GC_AIX_THREADS)) \
-      && !defined(USE_PTHREAD_SPECIFIC)
+      defined(GC_DARWIN_THREADS) || defined(GC_AIX_THREADS) || \
+      defined(GC_RTEMS_PTHREADS)) && !defined(USE_PTHREAD_SPECIFIC)
 #   define USE_PTHREAD_SPECIFIC
 # endif
 
@@ -111,7 +111,9 @@
 # include <time.h>
 # include <errno.h>
 # include <unistd.h>
+#if !defined(GC_RTEMS_PTHREADS)
 # include <sys/mman.h>
+#endif
 # include <sys/time.h>
 # include <sys/types.h>
 # include <sys/stat.h>
@@ -900,6 +902,9 @@
 #       endif
 #	if defined(GC_LINUX_THREADS) || defined(GC_DGUX386_THREADS)
           GC_nprocs = GC_get_nprocs();
+#       endif
+#       if defined(GC_RTEMS_PTHREADS)
+          if (GC_nprocs <= 0) GC_nprocs = 1;
 #	endif
       }
       if (GC_nprocs <= 0) {
Index: boehm-gc/gc_dlopen.c
===================================================================
--- boehm-gc/gc_dlopen.c	(revision 172224)
+++ boehm-gc/gc_dlopen.c	(working copy)
@@ -60,7 +60,9 @@
   /* GC_register_dynamic_libraries.			*/
   /* Should probably happen for other operating	systems, too. */
 
+#if !defined(GC_RTEMS_PTHREADS)
 #include <dlfcn.h>
+#endif
 
 #ifdef GC_USE_LD_WRAP
   void * __wrap_dlopen(const char *path, int mode)
Index: boehm-gc/os_dep.c
===================================================================
--- boehm-gc/os_dep.c	(revision 172224)
+++ boehm-gc/os_dep.c	(working copy)
@@ -1507,7 +1507,7 @@
 
 # if !defined(OS2) && !defined(PCR) && !defined(AMIGA) \
 	&& !defined(MSWIN32) && !defined(MSWINCE) \
-	&& !defined(MACOS) && !defined(DOS4GW)
+	&& !defined(MACOS) && !defined(DOS4GW) && !defined(RTEMS)
 
 # ifdef SUNOS4
     extern caddr_t sbrk();
Index: libjava/configure.host
===================================================================
--- libjava/configure.host	(revision 172224)
+++ libjava/configure.host	(working copy)
@@ -347,6 +347,12 @@
 	slow_pthread_self=
 	can_unwind_signal=yes
 	;;
+  *-*-rtems*)
+        libgcj_javaflags="${libgcj_javaflags} -fcheck-references"
+	can_unwind_signal=no
+	CHECKREFSPEC=-fcheck-references
+	DIVIDESPEC=-fuse-divide-subroutine
+	;;
 esac
 
 case "${host}" in
Index: libjava/configure.ac
===================================================================
--- libjava/configure.ac	(revision 172224)
+++ libjava/configure.ac	(working copy)
@@ -1048,6 +1048,19 @@
     ;;
  win32)
     ;;
+ rtems)
+    THREADS=posix
+    AC_DEFINE(HAVE_SYS_SOCKET_H, 1, [Required define in rtems.])
+    AC_DEFINE(HAVE_NETINET_IN_H, 1, [Required define in rtems.])
+    AC_DEFINE(HAVE_ARPA_INET_H, 1, [Required define in rtems.])
+    AC_DEFINE(HAVE_NETDB_H, 1, [Required define in rtems.])
+    AC_DEFINE(HAVE_SYS_IOCTL_H, 1, [Required define in rtems.])
+    AC_DEFINE(HAVE_NET_IF_H, 1, [Required define in rtems.])
+    AC_DEFINE(HAVE_IFADDRS_H, 1, [Required define in rtems.])
+    AC_DEFINE(HAVE_GETTIMEOFDAY, 1, [Required define in rtems.])
+    AC_DEFINE(HAVE_GETHOSTNAME_DECL, 1, [Required define in rtems.])
+    AC_DEFINE(RTEMS_PTHREADS, 1, [Required define in rtems.])
+    ;;
  decosf1 | irix | mach | os2 | dce | vxworks)
     AC_MSG_ERROR(thread package $THREADS not yet supported)
     ;;
Index: libjava/classpath/native/fdlibm/mprec.c
===================================================================
--- libjava/classpath/native/fdlibm/mprec.c	(revision 172224)
+++ libjava/classpath/native/fdlibm/mprec.c	(working copy)
@@ -1004,7 +1004,7 @@
 {1e-16, 1e-32};
 #endif
 
-
+#ifdef RTEMS_PTHREADS
 double
 _DEFUN (_mprec_log10, (dig),
 	int dig)
@@ -1019,3 +1019,4 @@
     }
   return v;
 }
+#endif
Index: libjava/include/config.h.in
===================================================================
--- libjava/include/config.h.in	(revision 172224)
+++ libjava/include/config.h.in	(working copy)
@@ -379,6 +379,9 @@
 /* Define if using POSIX threads on Linux. */
 #undef LINUX_THREADS
 
+/* Define if using POSIX threads on RTEMS. */
+#undef RTEMS_PTHREADS
+
 /* Define to the name of the environment variable that determines the dynamic
    library search path. */
 #undef LTDL_SHLIBPATH_VAR
Index: libjava/posix-threads.cc
===================================================================
--- libjava/posix-threads.cc	(revision 172224)
+++ libjava/posix-threads.cc	(working copy)
@@ -62,9 +62,11 @@
 static int non_daemon_count;
 
 // The signal to use when interrupting a thread.
-#if defined(LINUX_THREADS) || defined(FREEBSD_THREADS)
+#if defined(LINUX_THREADS) || defined(FREEBSD_THREADS) \
+    || defined(RTEMS_PTHREADS)
   // LinuxThreads (prior to glibc 2.1) usurps both SIGUSR1 and SIGUSR2.
   // GC on FreeBSD uses both SIGUSR1 and SIGUSR2.
+  // GC on  RTEMS  uses both SIGUSR1 and SIGUSR2.
 #  define INTR SIGHUP
 #else /* LINUX_THREADS */
 #  define INTR SIGUSR2
@@ -672,6 +674,10 @@
   pthread_attr_setschedparam (&attr, &param);
   pthread_attr_setdetachstate (&attr, PTHREAD_CREATE_DETACHED);
   
+#ifdef RTEMS_PTHREADS
+  pthread_attr_setinheritsched(&attr, PTHREAD_EXPLICIT_SCHED);
+  pthread_attr_setschedpolicy(&attr, SCHED_OTHER);
+#endif
   // Set stack size if -Xss option was given.
   if (gcj::stack_size > 0)
     {
Index: libjava/configure
===================================================================
--- libjava/configure	(revision 172224)
+++ libjava/configure	(working copy)
@@ -20704,6 +20704,20 @@
     ;;
  win32)
     ;;
+ rtems)
+    THREADS=posix
+$as_echo "#define HAVE_SYS_SOCKET_H 1" >>confdefs.h
+$as_echo "#define HAVE_NETINET_IN_H 1" >>confdefs.h
+$as_echo "#define HAVE_ARPA_INET_H 1" >>confdefs.h
+$as_echo "#define HAVE_NETDB_H 1" >>confdefs.h
+$as_echo "#define HAVE_SYS_IOCTL_H 1" >>confdefs.h
+$as_echo "#define HAVE_NET_IF_H 1" >>confdefs.h
+$as_echo "#define HAVE_IFADDRS_H 1" >>confdefs.h
+$as_echo "#define HAVE_GETTIMEOFDAY 1" >>confdefs.h
+$as_echo "#define HAVE_GETHOSTNAME_DECL 1" >>confdefs.h
+$as_echo "#define HAVE_MPREC_LOG10 1" >>confdefs.h
+$as_echo "#define RTEMS_PTHREADS 1" >>confdefs.h
+    ;;
  decosf1 | irix | mach | os2 | dce | vxworks)
     as_fn_error "thread package $THREADS not yet supported" "$LINENO" 5
     ;;
Index: libjava/java/lang/natClass.cc
===================================================================
--- libjava/java/lang/natClass.cc	(revision 172224)
+++ libjava/java/lang/natClass.cc	(working copy)
@@ -1679,6 +1679,10 @@
   return NULL;
 }
 
+#ifdef RTEMS_PTHREADS
+# undef HAVE_TLS
+#endif
+
 #ifdef HAVE_TLS
 
 // NOTE: MCACHE_SIZE should be a power of 2 minus one.
Index: libjava/java/lang/natVMDouble.cc
===================================================================
--- libjava/java/lang/natVMDouble.cc	(revision 172224)
+++ libjava/java/lang/natVMDouble.cc	(working copy)
@@ -19,6 +19,9 @@
 #include <java/lang/VMDouble.h>
 #include <java/lang/Character.h>
 #include <java/lang/NumberFormatException.h>
+#ifdef RTEMS_PTHREADS
+# include<java/lang/NullPointerException.h>
+#endif
 #include <jvm.h>
 
 #include <stdio.h>
@@ -162,6 +165,11 @@
 jdouble 
 java::lang::VMDouble::parseDouble(jstring str)
 {
+#ifdef RTEMS_PTHREADS
+  if (str == NULL)
+    throw new NullPointerException();
+#endif
+
   int length = str->length();
 
   while (length > 0
Index: configure
===================================================================
--- configure	(revision 172224)
+++ configure	(working copy)
@@ -3176,7 +3176,7 @@
     noconfigdirs="$noconfigdirs target-newlib target-libgloss ${libgcj}"
     ;;
   *-*-rtems*)
-    noconfigdirs="$noconfigdirs target-libgloss ${libgcj}"
+    noconfigdirs="$noconfigdirs target-libgloss"
     ;;
     # The tpf target doesn't support gdb yet.
   *-*-tpf*)

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] [JAVA] patch for Java on RTEMS
  2011-08-10 17:00 [PATCH] [JAVA] patch for Java on RTEMS Jie Liu
  2011-08-14 13:04 ` Jie Liu
@ 2011-08-15  9:43 ` Andrew Haley
  2011-08-15 14:07   ` Jie Liu
  1 sibling, 1 reply; 7+ messages in thread
From: Andrew Haley @ 2011-08-15  9:43 UTC (permalink / raw)
  To: Jie Liu; +Cc: java-patches, java, gcc-patches, Joel Sherrill

On 08/10/2011 06:00 PM, Jie Liu wrote:

> For the previous analysis "libjava patches for RTEMS"[1], there are 6
> cases need to pay more attention. PR18699, TLtest, Thread_Interrupt,
> Thread_Sleep_2, Throw_2 and bclink.
>
> After add patch to bdwgc for RTEMS pthread support[2]:
> PR18699                PASS after Modify       [A bug in boehm-gc on
> RTEMS, not related to libjava]
> TLtest                    PASS
> Thread_Interrupt      PASS
>
> For the other 3 cases:
> Thread_Sleep_2      PASS                       [After add patch to rtems]
> Throw_2                 PASS                       [After add patch to
> libjava, still need some work][3]
> bclink                    UnSupport
> [-findirect-dispatch do not support in this case]
>
> I think it's time to send out the patch for review, because it may
> need much time to modify. The patch is attached.

Looks OK, but there is no ChangeLog.  Do you have copyright
assignment?

Andrew.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] [JAVA] patch for Java on RTEMS
  2011-08-15  9:43 ` Andrew Haley
@ 2011-08-15 14:07   ` Jie Liu
  2011-08-15 14:11     ` Andrew Haley
  2011-08-26 13:20     ` Ralf Wildenhues
  0 siblings, 2 replies; 7+ messages in thread
From: Jie Liu @ 2011-08-15 14:07 UTC (permalink / raw)
  To: Andrew Haley; +Cc: java-patches, java, gcc-patches, Joel Sherrill

[-- Attachment #1: Type: text/plain, Size: 302 bytes --]

> Looks OK, but there is no ChangeLog.  Do you have copyright
> assignment?

Have added ChangeLog to the patch, please see the attachment. And I
think I have copyright assignment, because I have Free Software
Foundation paperwork, as "ASSIGNMENT - GNU GCC ... JIE RT688742"

Best Regards,
Jie

[-- Attachment #2: gcj-rtems.patch --]
[-- Type: application/octet-stream, Size: 14901 bytes --]

Index: configure.ac
===================================================================
--- configure.ac	(revision 172224)
+++ configure.ac	(working copy)
@@ -623,7 +623,7 @@
     noconfigdirs="$noconfigdirs target-newlib target-libgloss ${libgcj}"
     ;;
   *-*-rtems*)
-    noconfigdirs="$noconfigdirs target-libgloss ${libgcj}"
+    noconfigdirs="$noconfigdirs target-libgloss"
     ;;
     # The tpf target doesn't support gdb yet.
   *-*-tpf*)
Index: boehm-gc/mach_dep.c
===================================================================
--- boehm-gc/mach_dep.c	(revision 172224)
+++ boehm-gc/mach_dep.c	(working copy)
@@ -411,7 +411,8 @@
     word dummy;
 
 #   if defined(USE_GENERIC_PUSH_REGS)
-#     ifdef HAVE_BUILTIN_UNWIND_INIT
+#     if defined(HAVE_BUILTIN_UNWIND_INIT)\
+         &&!(defined(I386) && defined(RTEMS))
         /* This was suggested by Richard Henderson as the way to	*/
         /* force callee-save registers and register windows onto	*/
         /* the stack.						*/
@@ -437,8 +438,8 @@
   	for (; (char *)i < lim; i++) {
   	    *i = 0;
   	}
-#       if defined(MSWIN32) || defined(MSWINCE) \
-                  || defined(UTS4) || defined(LINUX) || defined(EWS4800)
+#       if defined(MSWIN32) || defined(MSWINCE) || defined(UTS4) \
+           || defined(LINUX) || defined(EWS4800) || defined(RTEMS)
   	  (void) setjmp(regs);
 #       else
             (void) _setjmp(regs);
Index: boehm-gc/configure.ac
===================================================================
--- boehm-gc/configure.ac	(revision 172224)
+++ boehm-gc/configure.ac	(working copy)
@@ -235,6 +235,11 @@
     AC_DEFINE(GC_AIX_THREADS,1)
     AC_DEFINE(_REENTRANT,1)
     ;;
+ rtems)
+    THREADS=posix
+    AC_DEFINE(GC_RTEMS_PTHREADS,1)
+    AC_DEFINE(THREAD_LOCAL_ALLOC,1);
+    ;;
  decosf1 | irix | mach | os2 | dce | vxworks)
     AC_MSG_ERROR(thread package $THREADS not yet supported)
     ;;
Index: boehm-gc/include/gc_config_macros.h
===================================================================
--- boehm-gc/include/gc_config_macros.h	(revision 172224)
+++ boehm-gc/include/gc_config_macros.h	(working copy)
@@ -20,7 +20,7 @@
 	defined(GC_IRIX_THREADS) || defined(GC_LINUX_THREADS) || \
 	defined(GC_HPUX_THREADS) || defined(GC_OSF1_THREADS) || \
 	defined(GC_DGUX386_THREADS) || defined(GC_DARWIN_THREADS) || \
-	defined(GC_AIX_THREADS) || \
+	defined(GC_AIX_THREADS) || defined(GC_RTEMS_PTHREADS) || \
         (defined(GC_WIN32_THREADS) && defined(__CYGWIN32__))
 #   define GC_PTHREADS
 # endif
Index: boehm-gc/include/gc_config.h.in
===================================================================
--- boehm-gc/include/gc_config.h.in	(revision 172224)
+++ boehm-gc/include/gc_config.h.in	(working copy)
@@ -51,6 +51,9 @@
 /* support for win32 threads */
 #undef GC_WIN32_THREADS
 
+/* Define to support RTEMS pthreads. */
+#undef GC_RTEMS_PTHREADS
+
 /* ppc_thread_state64_t has field r0 */
 #undef HAS_PPC_THREAD_STATE64_R0
 
Index: boehm-gc/include/private/gcconfig.h
===================================================================
--- boehm-gc/include/private/gcconfig.h	(revision 172224)
+++ boehm-gc/include/private/gcconfig.h	(working copy)
@@ -315,6 +315,11 @@
 #    define mach_type_known
 #   endif
 # endif
+# if defined(__rtems__) && (defined(i386) || defined(__i386__))
+#   define I386
+#   define RTEMS
+#   define mach_type_known
+# endif
 # if defined(NeXT) && defined(mc68000)
 #   define M68K
 #   define NEXT
@@ -1297,6 +1302,19 @@
 #	define STACKBOTTOM ((ptr_t)0xc0000000)
 #	define DATAEND	/* not needed */
 #   endif
+#   ifdef RTEMS
+#       define OS_TYPE "RTEMS"
+#       include <sys/unistd.h>
+        extern int etext[];
+        extern int end[];
+        void *rtems_get_stack_bottom();
+#       define InitStackBottom rtems_get_stack_bottom()
+#       define DATASTART ((ptr_t)etext)
+#       define DATAEND ((ptr_t)end)
+#       define STACKBOTTOM ((ptr_t)InitStackBottom)
+#       define SIG_SUSPEND SIGUSR1
+#       define SIG_THR_RESTART SIGUSR2
+#   endif
 #   ifdef DOS4GW
 #     define OS_TYPE "DOS4GW"
       extern long __nullarea;
@@ -2370,7 +2388,8 @@
 #   else
 #     if defined(NEXT) || defined(DOS4GW) || \
 		 (defined(AMIGA) && !defined(GC_AMIGA_FASTALLOC)) || \
-		 (defined(SUNOS5) && !defined(USE_MMAP))
+		 (defined(SUNOS5) && !defined(USE_MMAP)) || \
+                 defined(RTEMS)
 #       define GET_MEM(bytes) HBLKPTR((size_t) \
 					      calloc(1, (size_t)bytes + GC_page_size) \
 					      + GC_page_size-1)
Index: boehm-gc/ChangeLog
===================================================================
--- boehm-gc/ChangeLog	(revision 172224)
+++ boehm-gc/ChangeLog	(working copy)
@@ -1,3 +1,22 @@
+2011-08-15  Jie Liu  <lj8175@gmail.com>
+	* configure.ac: Add configure for RTEMS.
+	* configure: Add configure for RTEMS.
+	* include/gc_config.h.in: Add GC_RTEMS_PTHREADS for RTEMS.
+	* mach_dep.c (GC_with_callee_saves_pushed): Use setjmp for
+	RTEMS.
+	* include/gc_config_macros.h: Define GC_PTHREADS for rtems.
+	* include/private/gcconfig.h: Add configure for RTEMS/i386;
+	Use calloc for RTEMS to GET_MEM.
+	* pthread_stop_world.c (GC_stop_init): Add judge SA_RESTART
+	for operating system; Use sigprocmask unblock the signal
+	for RTEMS.
+	* pthread_support.c: Define USE_PTHREAD_SPECIFIC for RTEMS;
+	Do not include sys/mman.h for RTEMS; Add default GC_nprocs
+	for RTEMS.
+	* gc_dlopen.c: Do not include dlfcn.h for RTEMS.
+	* os_dep.c: Do not use auxiliary routines for obtaining 
+	memory from RTEMS.
+
 2011-04-06  Rainer Orth  <ro@CeBiTec.Uni-Bielefeld.DE>
 
 	PR testsuite/48480
Index: boehm-gc/configure
===================================================================
--- boehm-gc/configure	(revision 172224)
+++ boehm-gc/configure	(working copy)
@@ -14867,6 +14867,11 @@
     $as_echo "#define _REENTRANT 1" >>confdefs.h
 
     ;;
+ rtems)
+    THREADS=posix
+    $as_echo "#define GC_RTEMS_PTHREADS 1" >>confdefs.h
+    $as_echo "#define THREAD_LOCAL_ALLOC 1" >>confdefs.h
+    ;;
  decosf1 | irix | mach | os2 | dce | vxworks)
     as_fn_error "thread package $THREADS not yet supported" "$LINENO" 5
     ;;
Index: boehm-gc/pthread_stop_world.c
===================================================================
--- boehm-gc/pthread_stop_world.c	(revision 172224)
+++ boehm-gc/pthread_stop_world.c	(working copy)
@@ -540,10 +540,19 @@
     if (sem_init(&GC_suspend_ack_sem, 0, 0) != 0)
         ABORT("sem_init failed");
 
+#   ifdef SA_RESTART
     act.sa_flags = SA_RESTART;
+#   else
+    act.sa_flags = 0;
+#   endif
     if (sigfillset(&act.sa_mask) != 0) {
     	ABORT("sigfillset() failed");
     }
+#   ifdef GC_RTEMS_PTHREADS
+    if(sigprocmask(SIG_UNBLOCK,&act.sa_mask,NULL) !=0) {
+        ABORT("rtems sigprocmask() failed\n");
+    }
+#   endif
     GC_remove_allowed_signals(&act.sa_mask);
     /* SIG_THR_RESTART is set in the resulting mask.		*/
     /* It is unmasked by the handler when necessary. 		*/
Index: boehm-gc/pthread_support.c
===================================================================
--- boehm-gc/pthread_support.c	(revision 172224)
+++ boehm-gc/pthread_support.c	(working copy)
@@ -75,8 +75,8 @@
 # endif
 
 # if (defined(GC_DGUX386_THREADS) || defined(GC_OSF1_THREADS) || \
-      defined(GC_DARWIN_THREADS) || defined(GC_AIX_THREADS)) \
-      && !defined(USE_PTHREAD_SPECIFIC)
+      defined(GC_DARWIN_THREADS) || defined(GC_AIX_THREADS) || \
+      defined(GC_RTEMS_PTHREADS)) && !defined(USE_PTHREAD_SPECIFIC)
 #   define USE_PTHREAD_SPECIFIC
 # endif
 
@@ -111,7 +111,9 @@
 # include <time.h>
 # include <errno.h>
 # include <unistd.h>
+#if !defined(GC_RTEMS_PTHREADS)
 # include <sys/mman.h>
+#endif
 # include <sys/time.h>
 # include <sys/types.h>
 # include <sys/stat.h>
@@ -900,6 +902,9 @@
 #       endif
 #	if defined(GC_LINUX_THREADS) || defined(GC_DGUX386_THREADS)
           GC_nprocs = GC_get_nprocs();
+#       endif
+#       if defined(GC_RTEMS_PTHREADS)
+          if (GC_nprocs <= 0) GC_nprocs = 1;
 #	endif
       }
       if (GC_nprocs <= 0) {
Index: boehm-gc/gc_dlopen.c
===================================================================
--- boehm-gc/gc_dlopen.c	(revision 172224)
+++ boehm-gc/gc_dlopen.c	(working copy)
@@ -60,7 +60,9 @@
   /* GC_register_dynamic_libraries.			*/
   /* Should probably happen for other operating	systems, too. */
 
+#if !defined(GC_RTEMS_PTHREADS)
 #include <dlfcn.h>
+#endif
 
 #ifdef GC_USE_LD_WRAP
   void * __wrap_dlopen(const char *path, int mode)
Index: boehm-gc/os_dep.c
===================================================================
--- boehm-gc/os_dep.c	(revision 172224)
+++ boehm-gc/os_dep.c	(working copy)
@@ -1507,7 +1507,7 @@
 
 # if !defined(OS2) && !defined(PCR) && !defined(AMIGA) \
 	&& !defined(MSWIN32) && !defined(MSWINCE) \
-	&& !defined(MACOS) && !defined(DOS4GW)
+	&& !defined(MACOS) && !defined(DOS4GW) && !defined(RTEMS)
 
 # ifdef SUNOS4
     extern caddr_t sbrk();
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 172224)
+++ ChangeLog	(working copy)
@@ -1,3 +1,8 @@
+2011-08-15  Jie Liu  <lj8175@gmail.com>
+
+	* configure.ac (*-*-rtems*): Remove ${libgcj} in nonconfigdirs.
+	* configure: Regenerate.
+
 2011-04-07  Stuart Henderson  <shenders@gcc.gnu.org>
 
 	* MAINTAINERS (Write After Approval): Add myself.
Index: libjava/configure.host
===================================================================
--- libjava/configure.host	(revision 172224)
+++ libjava/configure.host	(working copy)
@@ -347,6 +347,12 @@
 	slow_pthread_self=
 	can_unwind_signal=yes
 	;;
+  *-*-rtems*)
+	libgcj_javaflags="${libgcj_javaflags} -fcheck-references"
+	can_unwind_signal=no
+	CHECKREFSPEC=-fcheck-references
+	DIVIDESPEC=-fuse-divide-subroutine
+	;;
 esac
 
 case "${host}" in
Index: libjava/configure.ac
===================================================================
--- libjava/configure.ac	(revision 172224)
+++ libjava/configure.ac	(working copy)
@@ -1048,6 +1048,19 @@
     ;;
  win32)
     ;;
+ rtems)
+    THREADS=posix
+    AC_DEFINE(HAVE_SYS_SOCKET_H, 1, [Required define in rtems.])
+    AC_DEFINE(HAVE_NETINET_IN_H, 1, [Required define in rtems.])
+    AC_DEFINE(HAVE_ARPA_INET_H, 1, [Required define in rtems.])
+    AC_DEFINE(HAVE_NETDB_H, 1, [Required define in rtems.])
+    AC_DEFINE(HAVE_SYS_IOCTL_H, 1, [Required define in rtems.])
+    AC_DEFINE(HAVE_NET_IF_H, 1, [Required define in rtems.])
+    AC_DEFINE(HAVE_IFADDRS_H, 1, [Required define in rtems.])
+    AC_DEFINE(HAVE_GETTIMEOFDAY, 1, [Required define in rtems.])
+    AC_DEFINE(HAVE_GETHOSTNAME_DECL, 1, [Required define in rtems.])
+    AC_DEFINE(RTEMS_PTHREADS, 1, [Required define in rtems.])
+    ;;
  decosf1 | irix | mach | os2 | dce | vxworks)
     AC_MSG_ERROR(thread package $THREADS not yet supported)
     ;;
Index: libjava/classpath/native/fdlibm/mprec.c
===================================================================
--- libjava/classpath/native/fdlibm/mprec.c	(revision 172224)
+++ libjava/classpath/native/fdlibm/mprec.c	(working copy)
@@ -1004,7 +1004,7 @@
 {1e-16, 1e-32};
 #endif
 
-
+#ifdef RTEMS_PTHREADS
 double
 _DEFUN (_mprec_log10, (dig),
 	int dig)
@@ -1019,3 +1019,4 @@
     }
   return v;
 }
+#endif
Index: libjava/include/config.h.in
===================================================================
--- libjava/include/config.h.in	(revision 172224)
+++ libjava/include/config.h.in	(working copy)
@@ -379,6 +379,9 @@
 /* Define if using POSIX threads on Linux. */
 #undef LINUX_THREADS
 
+/* Define if using POSIX threads on RTEMS. */
+#undef RTEMS_PTHREADS
+
 /* Define to the name of the environment variable that determines the dynamic
    library search path. */
 #undef LTDL_SHLIBPATH_VAR
Index: libjava/ChangeLog
===================================================================
--- libjava/ChangeLog	(revision 172224)
+++ libjava/ChangeLog	(working copy)
@@ -1,3 +1,13 @@
+2011-08-15  Jie Liu  <lj8175@gmail.com>
+
+	* configure.ac (THREADS): Add configuration for RTEMS.
+	* configure.host (host): Add configuration for RTEMS.
+	* include/config.h.in: Add RTEMS_PTHREADS for RTEMS.
+	* configure: Add configure for RTEMS.
+	* classpath/native/fdlibm/mprec.c: Remove _mprec_log10 for RTEMS.
+	* posix-threads.cc: Use SIGHUP for INTR on RTEMS.
+	* java/lang/natClass.cc: Undef HAVE_TLS for RTEMS.
+
 2011-04-08  Kai Tietz  <ktietz@redhat.com>
 
 	* configure.ac (libgcj_ld_export_all): Set for windows
Index: libjava/posix-threads.cc
===================================================================
--- libjava/posix-threads.cc	(revision 172224)
+++ libjava/posix-threads.cc	(working copy)
@@ -62,9 +62,11 @@
 static int non_daemon_count;
 
 // The signal to use when interrupting a thread.
-#if defined(LINUX_THREADS) || defined(FREEBSD_THREADS)
+#if defined(LINUX_THREADS) || defined(FREEBSD_THREADS) \
+    || defined(RTEMS_PTHREADS)
   // LinuxThreads (prior to glibc 2.1) usurps both SIGUSR1 and SIGUSR2.
   // GC on FreeBSD uses both SIGUSR1 and SIGUSR2.
+  // GC on  RTEMS  uses both SIGUSR1 and SIGUSR2.
 #  define INTR SIGHUP
 #else /* LINUX_THREADS */
 #  define INTR SIGUSR2
Index: libjava/configure
===================================================================
--- libjava/configure	(revision 172224)
+++ libjava/configure	(working copy)
@@ -20704,6 +20704,20 @@
     ;;
  win32)
     ;;
+ rtems)
+    THREADS=posix
+$as_echo "#define HAVE_SYS_SOCKET_H 1" >>confdefs.h
+$as_echo "#define HAVE_NETINET_IN_H 1" >>confdefs.h
+$as_echo "#define HAVE_ARPA_INET_H 1" >>confdefs.h
+$as_echo "#define HAVE_NETDB_H 1" >>confdefs.h
+$as_echo "#define HAVE_SYS_IOCTL_H 1" >>confdefs.h
+$as_echo "#define HAVE_NET_IF_H 1" >>confdefs.h
+$as_echo "#define HAVE_IFADDRS_H 1" >>confdefs.h
+$as_echo "#define HAVE_GETTIMEOFDAY 1" >>confdefs.h
+$as_echo "#define HAVE_GETHOSTNAME_DECL 1" >>confdefs.h
+$as_echo "#define HAVE_MPREC_LOG10 1" >>confdefs.h
+$as_echo "#define RTEMS_PTHREADS 1" >>confdefs.h
+    ;;
  decosf1 | irix | mach | os2 | dce | vxworks)
     as_fn_error "thread package $THREADS not yet supported" "$LINENO" 5
     ;;
Index: libjava/java/lang/natClass.cc
===================================================================
--- libjava/java/lang/natClass.cc	(revision 172224)
+++ libjava/java/lang/natClass.cc	(working copy)
@@ -1679,6 +1679,10 @@
   return NULL;
 }
 
+#ifdef RTEMS_PTHREADS
+# undef HAVE_TLS
+#endif
+
 #ifdef HAVE_TLS
 
 // NOTE: MCACHE_SIZE should be a power of 2 minus one.
Index: configure
===================================================================
--- configure	(revision 172224)
+++ configure	(working copy)
@@ -3176,7 +3176,7 @@
     noconfigdirs="$noconfigdirs target-newlib target-libgloss ${libgcj}"
     ;;
   *-*-rtems*)
-    noconfigdirs="$noconfigdirs target-libgloss ${libgcj}"
+    noconfigdirs="$noconfigdirs target-libgloss"
     ;;
     # The tpf target doesn't support gdb yet.
   *-*-tpf*)

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] [JAVA] patch for Java on RTEMS
  2011-08-15 14:07   ` Jie Liu
@ 2011-08-15 14:11     ` Andrew Haley
  2011-08-26 13:20     ` Ralf Wildenhues
  1 sibling, 0 replies; 7+ messages in thread
From: Andrew Haley @ 2011-08-15 14:11 UTC (permalink / raw)
  To: Jie Liu; +Cc: java-patches, java, gcc-patches, Joel Sherrill

On 08/15/2011 03:07 PM, Jie Liu wrote:
>> Looks OK, but there is no ChangeLog.  Do you have copyright
>> assignment?
> 
> Have added ChangeLog to the patch, please see the attachment. And I
> think I have copyright assignment, because I have Free Software
> Foundation paperwork, as "ASSIGNMENT - GNU GCC ... JIE RT688742"

Good.  The libjava parts are OK; I can't approve the top-level part,
but it looks fine.

Andrew.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] [JAVA] patch for Java on RTEMS
  2011-08-15 14:07   ` Jie Liu
  2011-08-15 14:11     ` Andrew Haley
@ 2011-08-26 13:20     ` Ralf Wildenhues
  1 sibling, 0 replies; 7+ messages in thread
From: Ralf Wildenhues @ 2011-08-26 13:20 UTC (permalink / raw)
  To: Jie Liu; +Cc: Andrew Haley, java-patches, java, gcc-patches, Joel Sherrill

* Jie Liu wrote on Mon, Aug 15, 2011 at 04:07:36PM CEST:
> > Looks OK, but there is no ChangeLog.  Do you have copyright
> > assignment?
> 
> Have added ChangeLog to the patch, please see the attachment. And I
> think I have copyright assignment, because I have Free Software
> Foundation paperwork, as "ASSIGNMENT - GNU GCC ... JIE RT688742"

The build-system specific parts of the patch are OK, provided
that they have been sufficiently tested.  When committing
top-level changes, please make sure they are synced to the
src repository; if you don't have write access to src, please
ask someone who has to do that for you.

I think you still need approval for the boehm-gc related changes.

Please also try to send patches with some text MIME type.

Thanks,
Ralf

> --- boehm-gc/ChangeLog	(revision 172224)
> +++ boehm-gc/ChangeLog	(working copy)
> @@ -1,3 +1,22 @@
> +2011-08-15  Jie Liu  <lj8175@gmail.com>
> +	* configure.ac: Add configure for RTEMS.
> +	* configure: Add configure for RTEMS.
> +	* include/gc_config.h.in: Add GC_RTEMS_PTHREADS for RTEMS.
> +	* mach_dep.c (GC_with_callee_saves_pushed): Use setjmp for
> +	RTEMS.
> +	* include/gc_config_macros.h: Define GC_PTHREADS for rtems.
> +	* include/private/gcconfig.h: Add configure for RTEMS/i386;
> +	Use calloc for RTEMS to GET_MEM.
> +	* pthread_stop_world.c (GC_stop_init): Add judge SA_RESTART
> +	for operating system; Use sigprocmask unblock the signal
> +	for RTEMS.
> +	* pthread_support.c: Define USE_PTHREAD_SPECIFIC for RTEMS;
> +	Do not include sys/mman.h for RTEMS; Add default GC_nprocs
> +	for RTEMS.
> +	* gc_dlopen.c: Do not include dlfcn.h for RTEMS.
> +	* os_dep.c: Do not use auxiliary routines for obtaining 
> +	memory from RTEMS.

> --- ChangeLog	(revision 172224)
> +++ ChangeLog	(working copy)
> @@ -1,3 +1,8 @@
> +2011-08-15  Jie Liu  <lj8175@gmail.com>
> +
> +	* configure.ac (*-*-rtems*): Remove ${libgcj} in nonconfigdirs.
> +	* configure: Regenerate.


> --- libjava/ChangeLog	(revision 172224)
> +++ libjava/ChangeLog	(working copy)
> @@ -1,3 +1,13 @@
> +2011-08-15  Jie Liu  <lj8175@gmail.com>
> +
> +	* configure.ac (THREADS): Add configuration for RTEMS.
> +	* configure.host (host): Add configuration for RTEMS.
> +	* include/config.h.in: Add RTEMS_PTHREADS for RTEMS.
> +	* configure: Add configure for RTEMS.
> +	* classpath/native/fdlibm/mprec.c: Remove _mprec_log10 for RTEMS.
> +	* posix-threads.cc: Use SIGHUP for INTR on RTEMS.
> +	* java/lang/natClass.cc: Undef HAVE_TLS for RTEMS.

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] [JAVA] patch for Java on RTEMS
  2011-08-14 13:04 ` Jie Liu
@ 2011-08-26 13:33   ` Ralf Corsepius
  0 siblings, 0 replies; 7+ messages in thread
From: Ralf Corsepius @ 2011-08-26 13:33 UTC (permalink / raw)
  To: Jie Liu; +Cc: java-patches, java, gcc-patches, Joel Sherrill

On 08/14/2011 03:03 PM, Jie Liu wrote:
> Hi,
>
> I have add the boehm-gc patch and the configure for gcc patch to the
> patch attached. So we can add this patch and then compile gcj for
> RTEMS.
>
> Best Regards,
> Jie

--- boehm-gc/include/private/gcconfig.h	(revision 172224)
+++ boehm-gc/include/private/gcconfig.h	(working copy)
..
@@ -1297,6 +1302,19 @@
  #	define STACKBOTTOM ((ptr_t)0xc0000000)
  #	define DATAEND	/* not needed */
  #   endif
+#   ifdef RTEMS
+#       define OS_TYPE "RTEMS"
+#       include <sys/unistd.h>

Why sys/unistd.h?

sys/unistd.h is not supposed to be accessed directly.
This likely should be a plain simple "#include <unistd.h>"

Ralf

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2011-08-26 13:33 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-08-10 17:00 [PATCH] [JAVA] patch for Java on RTEMS Jie Liu
2011-08-14 13:04 ` Jie Liu
2011-08-26 13:33   ` Ralf Corsepius
2011-08-15  9:43 ` Andrew Haley
2011-08-15 14:07   ` Jie Liu
2011-08-15 14:11     ` Andrew Haley
2011-08-26 13:20     ` Ralf Wildenhues

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).