Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [RFA] Sparc/Linux fixes part 1
@ 2002-04-19 14:54 David S. Miller
  2002-04-19 18:37 ` Michael Snyder
  0 siblings, 1 reply; 28+ messages in thread
From: David S. Miller @ 2002-04-19 14:54 UTC (permalink / raw)
  To: gdb-patches


Ok, let's try to split up these changes even more in hopes
someone might be able to start to look at least at the obvious
bits.

32-bit Sparc under Linux does not have a 16-byte long double,
this causes testsuite failures.  Fix this by providing a
SPARC_TARGET_LONG_DOUBLE_BYTES the OS specific target headers
can override.

Tested on sparc-linux-gnu, no regressions, a few new successes
:-)

2002-04-19  David S. Miller  <davem@redhat.com>

	* config/sparc/tm-sparc.h (SPARC_TARGET_LONG_DOUBLE_BYTES): New.
	(TARGET_LONG_DOUBLE_BIT): Define in non-multi-arch case.
	* config/sparc/tm-linux.h (SPARC_TARGET_LONG_DOUBLE_BYTES):
	Override.
	* config/sparc/tm-sp64linux.h (SPARC_TARGET_LONG_DOUBLE_BYTES):
	Override.
	* sparc-tdep.c (sparc_gdbarch_init): Use
	SPARC_TARGET_LONG_DOUBLE_BYTES in set_gdbarch_long_double_bit
	call.  Do it after GDB_TARGET_IS_SPARC64 has stabilized.

--- ./config/sparc/tm-sparc.h.~1~	Mon Jan 28 20:42:44 2002
+++ ./config/sparc/tm-sparc.h	Fri Apr 19 13:55:48 2002
@@ -137,6 +137,8 @@ extern int sparc_intreg_size (void);
 #endif
 #endif
 
+#define SPARC_TARGET_LONG_DOUBLE_BYTES	16
+
 #if !defined (GDB_MULTI_ARCH) || (GDB_MULTI_ARCH == 0)
 /*
  * The following defines must go away for MULTI_ARCH
@@ -175,6 +177,11 @@ extern int sparc_intreg_size (void);
    real way to know how big a register is.  */
 
 #define REGISTER_SIZE 4
+
+/* Say how large a 'long double' is.  */
+
+#define TARGET_LONG_DOUBLE_BIT \
+        (SPARC_TARGET_LONG_DOUBLE_BYTES * TARGET_CHAR_BIT)
 
 /* Number of machine registers */
 
--- ./config/sparc/tm-linux.h.~1~	Sun Feb 24 14:56:07 2002
+++ ./config/sparc/tm-linux.h	Fri Apr 19 13:58:11 2002
@@ -25,6 +25,9 @@
 
 #include "sparc/tm-sparc.h"
 
+#undef SPARC_TARGET_LONG_DOUBLE_BYTES
+#define SPARC_TARGET_LONG_DOUBLE_BYTES 8
+
 #define SIGCONTEXT_PC_OFFSET 12
 
 #include "tm-linux.h"
--- ./config/sparc/tm-sp64linux.h.~1~	Sun Feb 24 14:56:07 2002
+++ ./config/sparc/tm-sp64linux.h	Fri Apr 19 13:58:03 2002
@@ -25,6 +25,10 @@ Foundation, Inc., 59 Temple Place - Suit
 
 #include "sparc/tm-sp64.h"
 
+#undef SPARC_TARGET_LONG_DOUBLE_BYTES
+#define SPARC_TARGET_LONG_DOUBLE_BYTES \
+	(GDB_TARGET_IS_SPARC64 ? 16 : 8)
+
 #define SIGCONTEXT_PC_OFFSET 16  /* See asm-sparc64/sigcontext.h */
 
 /* We always want full V9 + Ultra VIS stuff... */
--- ./sparc-tdep.c.~1~	Fri Apr 12 11:18:57 2002
+++ ./sparc-tdep.c	Fri Apr 19 13:57:40 2002
@@ -2970,7 +2970,6 @@ sparc_gdbarch_init (struct gdbarch_info 
   set_gdbarch_init_extra_frame_info (gdbarch, sparc_init_extra_frame_info);
   set_gdbarch_inner_than (gdbarch, core_addr_lessthan);
   set_gdbarch_int_bit (gdbarch, 4 * TARGET_CHAR_BIT);
-  set_gdbarch_long_double_bit (gdbarch, 16 * TARGET_CHAR_BIT);
   set_gdbarch_long_long_bit (gdbarch, 8 * TARGET_CHAR_BIT);
   set_gdbarch_max_register_raw_size (gdbarch, 8);
   set_gdbarch_max_register_virtual_size (gdbarch, 8);
@@ -3114,6 +3113,11 @@ sparc_gdbarch_init (struct gdbarch_info 
       tdep->call_dummy_call_offset = 148 + 4 * 5;
       break;
     }
+
+  /* Set this after GDB_TARGET_IS_SPARC64 has stabilized.  */
+  set_gdbarch_long_double_bit (gdbarch,
+			       SPARC_TARGET_LONG_DOUBLE_BYTES
+			       * TARGET_CHAR_BIT);
 
   /* 
    * Settings that vary per-architecture:


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

end of thread, other threads:[~2002-04-22 16:24 UTC | newest]

Thread overview: 28+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-04-19 14:54 [RFA] Sparc/Linux fixes part 1 David S. Miller
2002-04-19 18:37 ` Michael Snyder
2002-04-19 18:43   ` David S. Miller
2002-04-19 18:55   ` David S. Miller
2002-04-19 19:13     ` Andrew Cagney
2002-04-19 19:16       ` David S. Miller
2002-04-19 19:18       ` David S. Miller
2002-04-19 19:46         ` Andrew Cagney
2002-04-19 19:53           ` David S. Miller
2002-04-20 19:01             ` David S. Miller
2002-04-20 19:13               ` Jason R Thorpe
2002-04-20 19:44                 ` Andrew Cagney
2002-04-20 20:06               ` Andrew Cagney
2002-04-20 20:18                 ` David S. Miller
2002-04-20 21:24                   ` Jason R Thorpe
2002-04-20 21:32                     ` David S. Miller
2002-04-20 23:41                       ` Andrew Cagney
2002-04-22  9:24               ` Elena Zannoni
2002-04-22  3:55             ` Richard Earnshaw
2002-04-22  4:09               ` David S. Miller
2002-04-19 19:55           ` David S. Miller
2002-04-20 10:00     ` Jason R Thorpe
2002-04-20 17:59       ` David S. Miller
2002-04-20 19:04         ` Jason R Thorpe
2002-04-20 19:19           ` David S. Miller
2002-04-20 19:24             ` Jason R Thorpe
2002-04-20 19:26               ` David S. Miller
2002-04-20 20:32               ` [RFA] Sparc OS abi gdbarch init (was Re: [RFA] Sparc/Linux fixes part 1) David S. Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox