$NetBSD: patch-ac,v 1.8 2000/07/25 05:58:27 jlam Exp $ --- gcconfig.h.orig Tue Apr 25 20:41:01 2000 +++ gcconfig.h Tue Jul 25 01:54:06 2000 @@ -27,6 +27,11 @@ # define LINUX # endif +# if defined(__NetBSD__) +# define NETBSD +# define unix /* symbol unix is no longer defined in NetBSD */ +# endif + /* Determine the machine type: */ # if defined(sun) && defined(mc68000) # define M68K @@ -50,7 +55,10 @@ # endif # if defined(__NetBSD__) && defined(m68k) # define M68K -# define NETBSD +# define mach_type_known +# endif +# if defined(__NetBSD__) && defined(__powerpc__) +# define POWERPC # define mach_type_known # endif # if defined(__NetBSD__) && defined(arm32) @@ -81,6 +89,9 @@ # endif # endif # endif /* !LINUX */ +# if defined(__NetBSD__) && defined(__MIPSEL__) +# undef ULTRIX +# endif # define mach_type_known # endif # if defined(sequent) && defined(i386) @@ -114,7 +125,7 @@ # define mach_type_known # endif # if defined(sparc) && defined(unix) && !defined(sun) && !defined(linux) \ - && !defined(__OpenBSD__) + && !defined(__OpenBSD__) && !(__NetBSD__) # define SPARC # define DRSNX # define mach_type_known @@ -123,6 +134,10 @@ # define RS6000 # define mach_type_known # endif +# if defined(__NetBSD__) && defined(__sparc__) +# define SPARC +# define mach_type_known +# endif # if defined(_M_XENIX) && defined(_M_SYSV) && defined(_M_I386) /* The above test may need refinement */ # define I386 @@ -172,7 +187,7 @@ # endif # if defined(__alpha) || defined(__alpha__) # define ALPHA -# if !defined(LINUX) +# if !defined(LINUX) && !defined(NETBSD) # define OSF1 /* a.k.a Digital Unix */ # endif # define mach_type_known @@ -221,7 +236,6 @@ # endif # if defined(__NetBSD__) && defined(i386) # define I386 -# define NETBSD # define mach_type_known # endif # if defined(bsdi) && defined(i386) @@ -573,6 +587,14 @@ # define STACKBOTTOM ((ptr_t) 0xc0000000) # define DATAEND /* not needed */ # endif +# ifdef NETBSD +# define ALIGNMENT 4 +# define OS_TYPE "NETBSD" +# define HEURISTIC2 + extern char etext; +# define DATASTART GC_data_start +# define DYNAMIC_LOADING +# endif # endif # ifdef VAX @@ -602,7 +624,6 @@ # define MACH_TYPE "SPARC" # define ALIGNMENT 4 /* Required by hardware */ # define ALIGN_DOUBLE - extern int etext; # ifdef SUNOS5 # define OS_TYPE "SUNOS5" extern int _etext; @@ -674,8 +695,20 @@ # ifdef OPENBSD # define OS_TYPE "OPENBSD" # define STACKBOTTOM ((ptr_t) 0xf8000000) + extern int etext; # define DATASTART ((ptr_t)(&etext)) # endif +# ifdef NETBSD +# define OS_TYPE "NETBSD" +# define HEURISTIC2 +# ifdef __ELF__ +# define DATASTART GC_data_start +# define DYNAMIC_LOADING +# else + extern char etext; +# define DATASTART ((ptr_t)(&etext)) +# endif +# endif # endif # ifdef I386 @@ -960,6 +993,21 @@ # endif # define DYNAMIC_LOADING # endif +# if defined(NETBSD) && defined(__MIPSEL__) +# define ALIGNMENT 4 +# define OS_TYPE "NETBSD" +# define HEURISTIC2 +# define USE_GENERIC_PUSH_REGS 1 +# ifdef __ELF__ + extern int etext; +# define DATASTART GC_data_start +# define NEED_FIND_LIMIT +# define DYNAMIC_LOADING +# else +# define DATASTART ((ptr_t) 0x10000000) +# define STACKBOTTOM ((ptr_t) 0x7ffff000) +# endif /* _ELF_ */ +# endif # endif # ifdef RS6000 @@ -1019,6 +1067,16 @@ /* fp registers in some cases when the target is a 21264. The assembly */ /* code doesn't handle that yet, and version dependencies make that a */ /* bit tricky. Do the easy thing for now. */ +# ifdef NETBSD +# define OS_TYPE "NETBSD" +# define HEURISTIC2 +# define DATASTART GC_data_start +# define ELFCLASS32 32 +# define ELFCLASS64 64 +# define ELF_CLASS ELFCLASS64 +# define CPP_WORDSZ 64 +# define DYNAMIC_LOADING +# endif # ifdef OSF1 # define OS_TYPE "OSF1" # define DATASTART ((ptr_t) 0x140000000)