Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [RFC/RFA]Fix cross build of m68k netbsd target
@ 2002-10-02  8:01 Pierre Muller
  2002-10-02  9:12 ` Jason R Thorpe
  0 siblings, 1 reply; 5+ messages in thread
From: Pierre Muller @ 2002-10-02  8:01 UTC (permalink / raw)
  To: gdb-patches


tm-nbsd.h in config/m68k directory
contains 
#include ""
and
#include sys/param.h"

This is totally wrong and should be refused in all cases,
as it totally prevents correct cross-compilation
to that target.

I thus propose the following patch,
which  enables me to cross-compile
with target m68k-uunknown-netbsd.

A simple grep show wthat this problem is not unique:
$ grep -n -i "#include *<" config/tm*.h config/*/tm*.h
config/i386/tm-fbsd.h:27:#include <sys/param.h>
config/i386/tm-i386aix.h:28:// OBSOLETE #include <sys/reg.h>
config/i386/tm-ptx.h:30:#include <sys/reg.h>
config/i386/tm-symmetry.h:32:#include <machine/reg.h>
config/m68k/tm-dpx2.h:34:#include <sys/types.h>
config/mips/tm-mips.h:38:#include <bfd.h>

These should probably also be fixed....



2002-10-02  Pierre Muller  <muller@ics.u-strasbg.fr>

	* config/m68k/tm-nbsd.h:
	(sys/param.h, machine/vmparam.h): Remove wrong includes.
	(PGSHIFT, HIGHPAGES,NBPG, USRSTACK): New macros,
	taken from a native m68k netbsd machine.

$ cvs diff -u -p config/m68k/tm-nbsd.h
Index: config/m68k/tm-nbsd.h
===================================================================
RCS file: /cvs/src/src/gdb/config/m68k/tm-nbsd.h,v
retrieving revision 1.5
diff -u -p -r1.5 tm-nbsd.h
--- config/m68k/tm-nbsd.h       22 May 2002 03:59:54 -0000      1.5
+++ config/m68k/tm-nbsd.h       2 Oct 2002 14:56:53 -0000
@@ -21,8 +21,6 @@
  #ifndef TM_NBSD_H
  #define TM_NBSD_H

-#include <sys/param.h>
-#include <machine/vmparam.h>

  /* Define BPT_VECTOR if it is different than the default.
     This is the vector number used by traps to indicate a breakpoint. */
@@ -30,6 +28,10 @@
  #define REMOTE_BPT_VECTOR      0xf

  /* Address of end of stack space.  */
+#define PGSHIFT 12
+#define HIGHPAGES 3
+#define NBPG (1 << PGSHIFT)
+#define USRSTACK (-HIGHPAGES*NBPG)
  #define STACK_END_ADDR USRSTACK

  /* For NetBSD, sigtramp is 32 bytes before STACK_END_ADDR.  */



Pierre Muller
Institut Charles Sadron
6,rue Boussingault
F 67083 STRASBOURG CEDEX (France)
mailto:muller@ics.u-strasbg.fr
Phone : (33)-3-88-41-40-07  Fax : (33)-3-88-41-40-99


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

end of thread, other threads:[~2002-10-04 15:00 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-10-02  8:01 [RFC/RFA]Fix cross build of m68k netbsd target Pierre Muller
2002-10-02  9:12 ` Jason R Thorpe
2002-10-03  0:22   ` Pierre Muller
2002-10-03  8:09     ` Jason R Thorpe
2002-10-04  8:00       ` Pierre Muller

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