[RFC/RFA]Fix cross build of m68k netbsd target

Pierre Muller muller@ics.u-strasbg.fr
Wed Oct 2 08:01:00 GMT 2002


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



More information about the Gdb-patches mailing list