gcc3 status
Eric Norum
eric.norum at usask.ca
Tue Oct 2 14:17:33 UTC 2001
Yacine EL KOLLI wrote:
>
> Hi,
>
> What is the status of gcc-3 ?
> Can any one tell where I can find the rtems patch for gcc-3, just want
> to try it for powerpc targets.
>
The latest snapshot from the gcc CVS repository requires very few
changes to work with RTEMS, but you need to get a version of RTEMS more
recent than the 0816 snapshot. Also, the m68k is now a second-class
citizen in gcc -- the compiler is missing an `atomicity.h' source file,
and crashes whenever it tries to cross-compile a C++ program which uses
exceptions. I've written the missing atomicity.h routines but I have no
idea how to deal with the exception problem.
Have a careful look at the atomicity.h file for the power pc. I don't
know a lot about the assembly language for this architecture, but the
routines in that source file seem to be correct -- as opposed to the
routine for the sparc which can lock up on priority-based,
preemtive-scheduling systems like RTEMS.
Here's the only patch needed to work with RTEMS (you need a very new
version of RTEMS too)
Index: gcc/gthr-rtems.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/gthr-rtems.h,v
retrieving revision 1.1.4.1
diff -u -r1.1.4.1 gthr-rtems.h
--- gthr-rtems.h 2001/07/25 01:46:30 1.1.4.1
+++ gthr-rtems.h 2001/10/02 14:10:49
@@ -30,6 +30,9 @@
#ifndef __gthr_rtems_h
#define __gthr_rtems_h
+#ifdef __cplusplus
+extern "C" {
+#endif
#define __GTHREADS 1
@@ -123,5 +126,9 @@
{
return rtems_gxx_mutex_unlock( mutex );
}
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
#endif /* __gthr_rtems_h */
Index: gcc/config/i386/rtemself.h
===================================================================
RCS file: /cvs/gcc/gcc/gcc/config/i386/rtemself.h,v
retrieving revision 1.9
diff -u -r1.9 rtemself.h
--- rtemself.h 2000/11/02 23:29:10 1.9
+++ rtemself.h 2001/10/02 14:10:50
@@ -84,7 +84,7 @@
#define WCHAR_TYPE_SIZE BITS_PER_WORD
#undef CPP_PREDEFINES
-#define CPP_PREDEFINES "-Drtems -D__rtems__ -Asystem=rtems"
+#define CPP_PREDEFINES "-Drtems -D__rtems__ -Asystem=rtems -D__ELF__
-D__i386__"
/* Get perform_* macros to build libgcc.a. */
#include "i386/perform.h"
--
Eric Norum eric.norum at usask.ca
Department of Electrical Engineering Phone: (306) 966-5394
University of Saskatchewan FAX: (306) 966-5407
Saskatoon, Canada.
More information about the users
mailing list