mips atomicity.h selection

Richard Sandiford rsandifo@redhat.com
Sun May 4 14:11:00 GMT 2003


The mips version of atomicity.h is selected by default for mips-*
targets (but not for other mips* targets).  The problem is,
it uses instructions only available in MIPS II and above.

At one point Eric committed a patch to fix this:

  http://gcc.gnu.org/ml/gcc-patches/2002-07/msg00115.html

but a clean-up seems to have negated its effect:

  http://gcc.gnu.org/ml/gcc-patches/2002-11/msg00064.html

To be honest, I'm not sure why it's suddenly become a problem now.
I've been using a mid-Jan version of libstdc++-v3 on mips-rewrite
branch without problems.

Still, the use of the atomic operations in locale::id::_M_id
is now causing most C++ mips-elf programs to fail during startup.
The patch below is just a variation of Eric's original (the variation
coming about because I tested it before seeing the history).

Perhaps we could move to using the mips atomicity.h for all mips64
targets?  Not done here since I just wanted to fix the mips-elf case.

Tested on mips-elf.  OK to install?

Richard


	* configure.target (mips*): Use the generic atomicity.h by default.

Index: configure.target
===================================================================
RCS file: /cvs/gcc/gcc/libstdc++-v3/configure.target,v
retrieving revision 1.57
diff -c -d -p -F^\([(a-zA-Z0-9_]\|#define\) -r1.57 configure.target
*** configure.target	15 Apr 2003 06:36:25 -0000	1.57
--- configure.target	4 May 2003 12:23:50 -0000
*************** case "${target_cpu}" in
*** 75,80 ****
--- 75,85 ----
    hppa*)
      cpu_include_dir="cpu/hppa"
      ;;
+   mips*)
+     # cpu/mips/atomicity.h needs MIPS II or above.  Only use it
+     # where it is known to be safe.
+     ATOMICITYH="cpu/generic"
+     ;;
    m680[246]0)
      cpu_include_dir="cpu/m68k"
      ;;








More information about the Libstdc++ mailing list