This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC 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]

Add -enable-threads=gnat


2002-09-17  Vincent Celier <celier at gnat dot com>

        * gthr-gnat.h, gthr-gnat.c: new sources for implementation of
        --enable-threads=gnat.
        * Makefile.in: Add gthr-gnat.c to LIB2ADDEH.
        * configure.in: Add gnat to the list of thread packages
        * configure: Rebuild.
        * config/t-linux: Add gthr-gnat.c to LIB2ADDEH and LIB2ADDEHDEP

*** /dev/null	Fri Feb  7 18:31:29 2003
--- gcc/gthr-gnat.h	Tue Apr 22 17:42:39 2003
***************
*** 0 ****
--- 1,43 ----
+ /* Threads compatibility routines for libgcc2.  */
+ /* Compile this one with gcc.  */
+ /* Copyright (C) 2002 Free Software Foundation, Inc.
+ 
+ This file is part of GCC.
+ 
+ GCC is free software; you can redistribute it and/or modify it under
+ the terms of the GNU General Public License as published by the Free
+ Software Foundation; either version 2, or (at your option) any later
+ version.
+ GCC is distributed in the hope that it will be useful, but WITHOUT ANY
+ WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ for more details.
+ 
+ You should have received a copy of the GNU General Public License
+ along with GCC; see the file COPYING.  If not, write to the Free
+ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
+ 02111-1307, USA.  */
+ 
+ /* As a special exception, if you link this library with other files,
+    some of which are compiled with GCC, to produce an executable,
+    this library does not by itself cause the resulting executable
+    to be covered by the GNU General Public License.
+    This exception does not however invalidate any other reasons why
+    the executable file might be covered by the GNU General Public License.  */
+ 
+ #ifndef GCC_GTHR_GNAT_H
+ #define GCC_GTHR_GNAT_H
+ 
+ /* Just provide compatibility for mutex handling.  */
+ 
+ typedef int __gthread_mutex_t;
+ 
+ #define __GTHREAD_MUTEX_INIT 0
+ 
+ extern void __gnat_install_locks (void (*lock) (), void (*unlock) ());
+ extern int __gthread_active_p (void);
+ extern int __gthread_mutex_lock (__gthread_mutex_t *);
+ extern int __gthread_mutex_unlock (__gthread_mutex_t *);
+ 
+ #endif /* ! GCC_GTHR_GNAT_H */
+ 
*** /dev/null	Fri Feb  7 18:31:29 2003
--- gcc/gthr-gnat.c	Tue Apr 22 17:43:06 2003
***************
*** 0 ****
--- 1,84 ----
+ /* Threads compatibility routines for libgcc2.  */
+ /* Compile this one with gcc.  */
+ /* Copyright (C) 2002 Free Software Foundation, Inc.
+ 
+ This file is part of GCC.
+ 
+ GCC is free software; you can redistribute it and/or modify it under
+ the terms of the GNU General Public License as published by the Free
+ Software Foundation; either version 2, or (at your option) any later
+ version.
+ 
+ GCC is distributed in the hope that it will be useful, but WITHOUT ANY
+ WARRANTY; without even the implied warranty of MERCHANTABILITY or
+ FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+ for more details.
+ 
+ You should have received a copy of the GNU General Public License
+ along with GCC; see the file COPYING.  If not, write to the Free
+ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
+ 02111-1307, USA.  */
+ 
+ /* As a special exception, if you link this library with other files,
+    some of which are compiled with GCC, to produce an executable,
+    this library does not by itself cause the resulting executable
+    to be covered by the GNU General Public License.
+    This exception does not however invalidate any other reasons why
+    the executable file might be covered by the GNU General Public License.  */
+ 
+ 
+ #include "gthr-gnat.h"
+ 
+ #ifdef __cplusplus
+ #define UNUSED(x)
+ #else
+ #define UNUSED(x) x __attribute__((unused))
+ #endif
+ 
+ void
+ __gnat_default_lock (void)
+ {
+   return;
+ }
+ 
+ void
+ __gnat_default_unlock (void)
+ {
+   return;
+ }
+ 
+ static void (*__gnat_task_lock) () = *__gnat_default_lock;
+ static void (*__gnat_task_unlock) () = *__gnat_default_unlock;
+ 
+  void
+ __gnat_install_locks (lock, unlock)
+      void (*lock) ();
+      void (*unlock) ();
+ {
+   __gnat_task_lock = lock;
+   __gnat_task_unlock = unlock;
+ 
+ }
+ 
+ int
+ __gthread_active_p (void)
+ {
+   return 0;
+ }
+ 
+ int
+ __gthread_mutex_lock (__gthread_mutex_t * UNUSED (mutex))
+ {
+   __gnat_task_lock ();
+   return 0;
+ }
+ 
+ int
+ __gthread_mutex_unlock (__gthread_mutex_t * UNUSED (mutex))
+ {
+   __gnat_task_unlock ();
+   return 0;
+ }
+ 
+ #undef UNUSED
+ 
*** gcc/Makefile.in	22 Apr 2003 05:44:04 -0000	1.1039
--- gcc/Makefile.in	22 Apr 2003 21:48:03 -0000
*************** CRTSTUFF_CFLAGS = -O2 $(GCC_CFLAGS) $(IN
*** 472,476 ****
  # Additional sources to handle exceptions; overridden by targets as needed.
  LIB2ADDEH = $(srcdir)/unwind-dw2.c $(srcdir)/unwind-dw2-fde.c \
!   $(srcdir)/unwind-sjlj.c
  LIB2ADDEHDEP = unwind.inc unwind-dw2-fde.h
  
--- 472,476 ----
  # Additional sources to handle exceptions; overridden by targets as needed.
  LIB2ADDEH = $(srcdir)/unwind-dw2.c $(srcdir)/unwind-dw2-fde.c \
!    $(srcdir)/unwind-sjlj.c $(srcdir)/gthr-gnat.c
  LIB2ADDEHDEP = unwind.inc unwind-dw2-fde.h
  
*** gcc/configure.in	16 Apr 2003 06:51:19 -0000	1.660
--- gcc/configure.in	22 Apr 2003 21:48:10 -0000
*************** case x${enable_threads_flag} in
*** 519,523 ****
  		;;
  	xdecosf1 | xirix | xmach | xos2 | xposix | xpthreads | xsingle | \
! 	xsolaris | xwin32 | xdce | xrtems| xvxworks | xaix)
  		target_thread_file=$enable_threads_flag
  		;;
--- 519,523 ----
  		;;
  	xdecosf1 | xirix | xmach | xos2 | xposix | xpthreads | xsingle | \
! 	xsolaris | xwin32 | xdce | xrtems| xvxworks | xaix | xgnat)
  		target_thread_file=$enable_threads_flag
  		;;
*** gcc/configure	16 Apr 2003 06:51:20 -0000	1.675
--- gcc/configure	22 Apr 2003 21:48:16 -0000
*************** case x${enable_threads_flag} in
*** 2306,2310 ****
  		;;
  	xdecosf1 | xirix | xmach | xos2 | xposix | xpthreads | xsingle | \
! 	xsolaris | xwin32 | xdce | xrtems| xvxworks | xaix)
  		target_thread_file=$enable_threads_flag
  		;;
--- 2306,2310 ----
  		;;
  	xdecosf1 | xirix | xmach | xos2 | xposix | xpthreads | xsingle | \
! 	xsolaris | xwin32 | xdce | xrtems| xvxworks | xaix | xgnat)
  		target_thread_file=$enable_threads_flag
  		;;
*** gcc/config/t-linux	28 Nov 2002 14:47:01 -0000	1.13
--- gcc/config/t-linux	22 Apr 2003 21:48:22 -0000
*************** SHLIB_MAPFILES += $(srcdir)/config/libgc
*** 13,16 ****
  # Use unwind-dw2-fde-glibc
  LIB2ADDEH = $(srcdir)/unwind-dw2.c $(srcdir)/unwind-dw2-fde-glibc.c \
!   $(srcdir)/unwind-sjlj.c
! LIB2ADDEHDEP = unwind.inc unwind-dw2-fde.h unwind-dw2-fde.c
--- 13,16 ----
  # Use unwind-dw2-fde-glibc
  LIB2ADDEH = $(srcdir)/unwind-dw2.c $(srcdir)/unwind-dw2-fde-glibc.c \
!   $(srcdir)/unwind-sjlj.c $(srcdir)/gthr-gnat.c
! LIB2ADDEHDEP = unwind.inc unwind-dw2-fde.h unwind-dw2-fde.c gthr-gnat.c


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