This is the mail archive of the java-patches@sourceware.cygnus.com 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]

[IRIX 6.2] Different versions of gc_priv.h break libgcj 2.95 compilation


libjava/boehm.cc fails to compile on IRIX 6.2 with gcj 2.95:

c++ -DHAVE_CONFIG_H -I. -I/vol/gnu/src/libgcj/libgcj/libjava -I./include -Iinclude -I/vol/gnu/src/libgcj/libgcj/libjava/include -I/vol/gnu/src/libgcj/libgcj/libjava/../boehm-gc -I./../boehm-gc -DIRIX_THREADS=1 -DNO_EXECUTE_PERMISSION=1 -DSILENT=1 -DNO_SIGNALS=1 -DNO_DEBUGGING=1 -DJAVA_FINALIZATION=1 -I/vol/gnu/src/libgcj/libgcj/libjava/../compat-include -I/vol/gnu/src/libgcj/libgcj/libjava/../zlib -I/vol/gnu/src/libgcj/libgcj/libjava/../libffi/include -I../libffi/include -fno-rtti -fvtable-thunks -W -Wall -g -O2 -mabi=64 -Wp,-MD,.deps/boehm.pp -c  -DPIC
/vol/gnu/src/libgcj/libgcj/libjava/boehm.cc -o .libs/boehm.lo
/vol/gnu/src/libgcj/libgcj/libjava/boehm.cc: In function `void _Jv_InitGC()':
/vol/gnu/src/libgcj/libgcj/libjava/boehm.cc:400: implicit declaration of function `int __lock_release(...)'

There's already a check for this MIPSpro CC specific function in
boehm-gc/include/private/gc_priv.h, but this (among other changes) hasn't
been merged back into the toplevel gc_priv.h.  The following patch fixes
this.

	Rainer

-----------------------------------------------------------------------------
Rainer Orth, Faculty of Technology, Bielefeld University

Email: ro@TechFak.Uni-Bielefeld.DE


Tue Aug 10 00:08:29 1999  Rainer Orth  <ro@TechFak.Uni-Bielefeld.DE>

	* gc_priv.h: Merged IRIX thread changes from
	include/private/gc_priv.h.

Index: boehm-gc/gc_priv.h
===================================================================
RCS file: /cvs/java/libgcj/boehm-gc/gc_priv.h,v
retrieving revision 1.5
diff -u -p -r1.5 gc_priv.h
--- gc_priv.h	1999/08/04 03:26:15	1.5
+++ gc_priv.h	1999/08/09 22:11:37
@@ -520,14 +520,15 @@ void GC_print_callers (/* struct callinf
 		}
 #    define EXIT_GC() GC_collecting = 0;
 #  endif /* LINUX_THREADS */
-#  ifdef IRIX_THREADS
+#  if defined(IRIX_THREADS) || defined(IRIX_JDK_THREADS)
 #    include <pthread.h>
 #    include <mutex.h>
 
-#    if __mips < 3 || !(defined (_ABIN32) || defined(_ABI64))
+#    if __mips < 3 || !(defined (_ABIN32) || defined(_ABI64)) \
+	|| !defined(_COMPILER_VERSION) || _COMPILER_VERSION < 700
 #        define GC_test_and_set(addr, v) test_and_set(addr,v)
 #    else
-#	  define GC_test_and_set(addr, v) __test_and_set(addr,v)
+#	 define GC_test_and_set(addr, v) __test_and_set(addr,v)
 #    endif
      extern unsigned long GC_allocate_lock;
 	/* This is not a mutex because mutexes that obey the (optional) 	*/
@@ -546,10 +547,17 @@ void GC_print_callers (/* struct callinf
 #    	define UNLOCK() pthread_mutex_unlock(&GC_allocate_ml)
 #    else
 #	define LOCK() { if (GC_test_and_set(&GC_allocate_lock, 1)) GC_lock(); }
-#       if __mips >= 3 && (defined (_ABIN32) || defined(_ABI64))
+#       if __mips >= 3 && (defined (_ABIN32) || defined(_ABI64)) \
+	   && defined(_COMPILER_VERSION) && _COMPILER_VERSION >= 700
 #	    define UNLOCK() __lock_release(&GC_allocate_lock)
 #	else
-#           define UNLOCK() GC_allocate_lock = 0
+	    /* The function call in the following should prevent the	*/
+	    /* compiler from moving assignments to below the UNLOCK.	*/
+	    /* This is probably not necessary for ucode or gcc 2.8.	*/
+	    /* It may be necessary for Ragnarok and future gcc		*/
+	    /* versions.						*/
+#           define UNLOCK() { GC_noop1(&GC_allocate_lock); \
+			*(volatile unsigned long *)(&GC_allocate_lock) = 0; }
 #	endif
 #    endif
      extern GC_bool GC_collecting;
@@ -558,7 +566,7 @@ void GC_print_callers (/* struct callinf
 		    GC_collecting = 1; \
 		}
 #    define EXIT_GC() GC_collecting = 0;
-#  endif /* IRIX_THREADS */
+#  endif /* IRIX_THREADS || IRIX_JDK_THREADS */
 #  ifdef WIN32_THREADS
 #    include <windows.h>
      GC_API CRITICAL_SECTION GC_allocate_ml;
@@ -616,7 +624,7 @@ void GC_print_callers (/* struct callinf
 #   if defined(SRC_M3) || defined(AMIGA) || defined(SOLARIS_THREADS) \
 	|| defined(MSWIN32) || defined(MACOS) || defined(DJGPP) \
 	|| defined(NO_SIGNALS) || defined(IRIX_THREADS) \
-	|| defined(LINUX_THREADS)
+	|| defined(IRIX_JDK_THREADS) || defined(LINUX_THREADS) 
 			/* Also useful for debugging.		*/
 	/* Should probably use thr_sigsetmask for SOLARIS_THREADS. */
 #     define DISABLE_SIGNALS()
@@ -644,7 +652,8 @@ void GC_print_callers (/* struct callinf
  				   PCR_waitForever);
 # else
 #   if defined(SOLARIS_THREADS) || defined(WIN32_THREADS) \
-	|| defined(IRIX_THREADS) || defined(LINUX_THREADS)
+	|| defined(IRIX_THREADS) || defined(LINUX_THREADS) \
+	|| defined(IRIX_JDK_THREADS)
       void GC_stop_world();
       void GC_start_world();
 #     define STOP_WORLD() GC_stop_world()

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