summaryrefslogtreecommitdiff
path: root/cross/i386-netbsdpe/patches
diff options
context:
space:
mode:
Diffstat (limited to 'cross/i386-netbsdpe/patches')
-rw-r--r--cross/i386-netbsdpe/patches/binutils-af68
-rw-r--r--cross/i386-netbsdpe/patches/binutils-ag13
-rw-r--r--cross/i386-netbsdpe/patches/binutils-ah14
-rw-r--r--cross/i386-netbsdpe/patches/binutils-ai13
-rw-r--r--cross/i386-netbsdpe/patches/binutils-aj13
-rw-r--r--cross/i386-netbsdpe/patches/binutils-ak12
-rw-r--r--cross/i386-netbsdpe/patches/patch-aa763
-rw-r--r--cross/i386-netbsdpe/patches/patch-ab4
-rw-r--r--cross/i386-netbsdpe/patches/patch-ac13
-rw-r--r--cross/i386-netbsdpe/patches/patch-ad29
-rw-r--r--cross/i386-netbsdpe/patches/patch-ae22
-rw-r--r--cross/i386-netbsdpe/patches/patch-af13
-rw-r--r--cross/i386-netbsdpe/patches/patch-co99
-rw-r--r--cross/i386-netbsdpe/patches/patch-cp44
-rw-r--r--cross/i386-netbsdpe/patches/patch-cq44
-rw-r--r--cross/i386-netbsdpe/patches/patch-de46
-rw-r--r--cross/i386-netbsdpe/patches/patch-ma23
-rw-r--r--cross/i386-netbsdpe/patches/patch-pe610
18 files changed, 277 insertions, 1566 deletions
diff --git a/cross/i386-netbsdpe/patches/binutils-af b/cross/i386-netbsdpe/patches/binutils-af
index 5ef084e586e..a97a4903611 100644
--- a/cross/i386-netbsdpe/patches/binutils-af
+++ b/cross/i386-netbsdpe/patches/binutils-af
@@ -1,8 +1,8 @@
-$NetBSD: binutils-af,v 1.2 2003/04/27 13:50:10 kent Exp $
+$NetBSD: binutils-af,v 1.3 2004/03/09 12:19:12 kent Exp $
---- binutils/dlltool.c.orig Fri Dec 13 06:10:09 2002
+--- binutils/dlltool.c.orig 2003-07-08 12:35:36.000000000 +0900
+++ binutils/dlltool.c
-@@ -1403,6 +1403,8 @@
+@@ -1437,6 +1437,8 @@ match_exclude (string)
for (excl_item = excludes; excl_item; excl_item = excl_item->next)
if (strcmp (string, excl_item->string) == 0)
return TRUE;
@@ -11,3 +11,65 @@ $NetBSD: binutils-af,v 1.2 2003/04/27 13:50:10 kent Exp $
return FALSE;
}
+@@ -2351,6 +2353,7 @@ make_one_lib_file (exp, i)
+ asymbol * exp_label;
+ asymbol * iname = 0;
+ asymbol * iname2;
++ asymbol * iname_nm = 0;
+ asymbol * iname_lab;
+ asymbol ** iname_lab_pp;
+ asymbol ** iname_pp;
+@@ -2362,7 +2365,7 @@ make_one_lib_file (exp, i)
+ #ifndef EXTRA
+ #define EXTRA 0
+ #endif
+- asymbol * ptrs[NSECS + 4 + EXTRA + 1];
++ asymbol * ptrs[NSECS + 5 + EXTRA + 1];
+ flagword applicable;
+
+ char * outname = xmalloc (strlen (TMP_STUB) + 10);
+@@ -2460,6 +2463,15 @@ make_one_lib_file (exp, i)
+ iname2->flags = BSF_GLOBAL;
+ iname2->value = 0;
+
++ if (exp->data)
++ {
++ iname_nm = bfd_make_empty_symbol (abfd);
++ iname_nm->name = make_imp_label ("__nm_", exp->name);
++ iname_nm->section = secdata[IDATA6].sec;
++ iname_nm->flags = BSF_GLOBAL;
++ iname_nm->value = 0;
++ }
++
+ iname_lab = bfd_make_empty_symbol(abfd);
+
+ iname_lab->name = head_label;
+@@ -2471,6 +2483,8 @@ make_one_lib_file (exp, i)
+ if (create_compat_implib)
+ ptrs[oidx++] = iname;
+ ptrs[oidx++] = iname2;
++ if (exp->data)
++ ptrs[oidx++] = iname_nm;
+
+ iname_lab_pp = ptrs + oidx;
+ ptrs[oidx++] = iname_lab;
+@@ -2781,7 +2795,7 @@ make_head ()
+ fprintf (f, "\t%sdoesn't load DLLs when this is set.\n", ASM_C);
+ fprintf (f, "\t%s\t0\t%s loaded time\n", ASM_LONG, ASM_C);
+ fprintf (f, "\t%s\t0\t%s Forwarder chain\n", ASM_LONG, ASM_C);
+- fprintf (f, "\t%s__%s_iname%s\t%s imported dll's name\n",
++ fprintf (f, "\t%s_%s_iname%s\t%s imported dll's name\n",
+ ASM_RVA_BEFORE,
+ imp_name_lab,
+ ASM_RVA_AFTER,
+@@ -2862,8 +2876,8 @@ make_tail ()
+ fprintf (f, "\t.section .idata$7\n");
+ #endif
+
+- fprintf (f, "\t%s\t__%s_iname\n", ASM_GLOBAL, imp_name_lab);
+- fprintf (f, "__%s_iname:\t%s\t\"%s\"\n",
++ fprintf (f, "\t%s\t_%s_iname\n", ASM_GLOBAL, imp_name_lab);
++ fprintf (f, "_%s_iname:\t%s\t\"%s\"\n",
+ imp_name_lab, ASM_TEXT, dll_name);
+
+ fclose (f);
diff --git a/cross/i386-netbsdpe/patches/binutils-ag b/cross/i386-netbsdpe/patches/binutils-ag
new file mode 100644
index 00000000000..de13f969bca
--- /dev/null
+++ b/cross/i386-netbsdpe/patches/binutils-ag
@@ -0,0 +1,13 @@
+$NetBSD: binutils-ag,v 1.1 2004/03/09 12:19:12 kent Exp $
+
+--- binutils/doc/Makefile.in.orig 2003-10-27 00:45:51.000000000 +0900
++++ binutils/doc/Makefile.in
+@@ -552,7 +552,7 @@ $(DEMANGLER_NAME).1: cxxfilt.man Makefil
+
+ # We want install to imply install-info as per GNU standards, despite the
+ # cygnus option.
+-install: install-info
++#install: install-info
+
+ # Maintenance
+
diff --git a/cross/i386-netbsdpe/patches/binutils-ah b/cross/i386-netbsdpe/patches/binutils-ah
new file mode 100644
index 00000000000..a599c2c3b60
--- /dev/null
+++ b/cross/i386-netbsdpe/patches/binutils-ah
@@ -0,0 +1,14 @@
+$NetBSD: binutils-ah,v 1.1 2004/03/09 12:19:12 kent Exp $
+
+--- gas/doc/Makefile.in.orig 2003-11-25 07:01:36.000000000 +0900
++++ gas/doc/Makefile.in
+@@ -521,7 +521,7 @@ as.dvi: $(srcdir)/as.texinfo asconfig.te
+
+ # We want install to imply install-info as per GNU standards, despite the
+ # cygnus option.
+-install: install-info
+-install-info: install-info-am
++install:
++install-info:
+
+ # Maintenance
diff --git a/cross/i386-netbsdpe/patches/binutils-ai b/cross/i386-netbsdpe/patches/binutils-ai
new file mode 100644
index 00000000000..16109c7b9fd
--- /dev/null
+++ b/cross/i386-netbsdpe/patches/binutils-ai
@@ -0,0 +1,13 @@
+$NetBSD: binutils-ai,v 1.1 2004/03/09 12:19:12 kent Exp $
+
+--- ld/Makefile.in.orig 2003-10-27 00:47:14.000000000 +0900
++++ ld/Makefile.in
+@@ -2243,7 +2243,7 @@ install-data-local:
+
+ # We want install to imply install-info as per GNU standards, despite the
+ # cygnus option.
+-install: install-info
++#install: install-info
+ diststuff: info $(EXTRA_DIST)
+ distclean-local:
+ rm -rf ldscripts
diff --git a/cross/i386-netbsdpe/patches/binutils-aj b/cross/i386-netbsdpe/patches/binutils-aj
new file mode 100644
index 00000000000..f034ac2af6a
--- /dev/null
+++ b/cross/i386-netbsdpe/patches/binutils-aj
@@ -0,0 +1,13 @@
+$NetBSD: binutils-aj,v 1.1 2004/03/09 12:19:12 kent Exp $
+
+--- ld/pe-dll.c.orig 2003-11-09 03:47:30.000000000 +0900
++++ ld/pe-dll.c
+@@ -1934,7 +1934,7 @@ make_singleton_name_thunk (const char *i
+ quick_symbol (abfd, U ("_nm_"), import, "", UNDSEC, BSF_GLOBAL, 0);
+
+ bfd_set_section_size (abfd, id4, 8);
+- d4 = xmalloc (4);
++ d4 = xmalloc (8);
+ id4->contents = d4;
+ memset (d4, 0, 8);
+ quick_reloc (abfd, 0, BFD_RELOC_RVA, 2);
diff --git a/cross/i386-netbsdpe/patches/binutils-ak b/cross/i386-netbsdpe/patches/binutils-ak
new file mode 100644
index 00000000000..39f8e67fd0a
--- /dev/null
+++ b/cross/i386-netbsdpe/patches/binutils-ak
@@ -0,0 +1,12 @@
+$NetBSD: binutils-ak,v 1.1 2004/03/09 12:19:12 kent Exp $
+
+--- gas/Makefile.in.orig 2004-03-09 14:46:34.000000000 +0900
++++ gas/Makefile.in
+@@ -2866,6 +2866,7 @@ install-data-am:
+ install-exec-am: install-exec-local
+
+ install-info:
++install-info-am:
+
+ install-man:
+
diff --git a/cross/i386-netbsdpe/patches/patch-aa b/cross/i386-netbsdpe/patches/patch-aa
deleted file mode 100644
index 11dfa8ac410..00000000000
--- a/cross/i386-netbsdpe/patches/patch-aa
+++ /dev/null
@@ -1,763 +0,0 @@
-$NetBSD: patch-aa,v 1.1 2001/01/30 03:08:59 minoura Exp $
-
-diff -urN gcc-2.95.2/gcc/collect2.c gcc-patched/gcc/collect2.c
---- gcc/collect2.c Wed Oct 13 06:16:52 1999
-+++ gcc/collect2.c Thu Dec 14 20:00:19 2000
-@@ -53,7 +53,6 @@
- #define obstack_chunk_alloc xmalloc
- #define obstack_chunk_free free
-
--extern char *make_temp_file PROTO ((char *));
-
- /* On certain systems, we have code that works by scanning the object file
- directly. But this code uses system-specific header files and library
-diff -urN gcc-2.95.2/gcc/config/elfos.h gcc-patched/gcc/config/elfos.h
---- gcc/config/elfos.h Fri Mar 26 19:45:26 1999
-+++ gcc/config/elfos.h Thu Dec 14 20:00:19 2000
-@@ -48,6 +48,7 @@
-
- /* Output #ident as a .ident. */
-
-+#undef ASM_OUTPUT_IDENT
- #define ASM_OUTPUT_IDENT(FILE, NAME) \
- fprintf (FILE, "\t%s\t\"%s\"\n", IDENT_ASM_OP, NAME);
-
-@@ -92,6 +93,10 @@
- #undef SET_ASM_OP
- #define SET_ASM_OP ".set"
-
-+/* We want local labels to start with period if made with asm_fprintf. */
-+#undef LOCAL_LABEL_PREFIX
-+#define LOCAL_LABEL_PREFIX "."
-+
- /* This is how to begin an assembly language file. Most svr4 assemblers want
- at least a .file directive to come first, and some want to see a .version
- directive come right after that. Here we just establish a default
-@@ -130,7 +135,7 @@
- #undef ASM_OUTPUT_INTERNAL_LABEL
- #define ASM_OUTPUT_INTERNAL_LABEL(FILE, PREFIX, NUM) \
- do { \
-- fprintf (FILE, ".%s%d:\n", PREFIX, NUM); \
-+ fprintf (FILE, "%s%s%d:\n", LOCAL_LABEL_PREFIX, PREFIX, NUM); \
- } while (0)
-
- /* This is how to store into the string LABEL
-@@ -144,7 +149,7 @@
- #undef ASM_GENERATE_INTERNAL_LABEL
- #define ASM_GENERATE_INTERNAL_LABEL(LABEL, PREFIX, NUM) \
- do { \
-- sprintf (LABEL, "*.%s%d", PREFIX, NUM); \
-+ sprintf (LABEL, "*%s%s%d", LOCAL_LABEL_PREFIX, PREFIX, NUM); \
- } while (0)
-
- /* Output the label which precedes a jumptable. Note that for all svr4
-@@ -461,6 +466,7 @@
-
- /* This is how we tell the assembler that a symbol is weak. */
-
-+#undef ASM_WEAKEN_LABEL
- #define ASM_WEAKEN_LABEL(FILE,NAME) \
- do { fputs ("\t.weak\t", FILE); assemble_name (FILE, NAME); \
- fputc ('\n', FILE); } while (0)
-diff -urN gcc-2.95.2/gcc/config/i386/netbsd-elf.h gcc-patched/gcc/config/i386/netbsd-elf.h
---- gcc/config/i386/netbsd-elf.h Thu Jan 1 09:00:00 1970
-+++ gcc/config/i386/netbsd-elf.h Thu Dec 14 20:00:18 2000
-@@ -0,0 +1,161 @@
-+/* Definitions of target machine for GNU compiler,
-+ for i386 NetBSD systems.
-+ Copyright (C) 1998 Free Software Foundation, Inc.
-+
-+This file is part of GNU CC.
-+
-+GNU CC is free software; you can redistribute it and/or modify
-+it under the terms of the GNU General Public License as published by
-+the Free Software Foundation; either version 2, or (at your option)
-+any later version.
-+
-+GNU CC is distributed in the hope that it will be useful,
-+but WITHOUT ANY WARRANTY; without even the implied warranty of
-+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+GNU General Public License for more details.
-+
-+You should have received a copy of the GNU General Public License
-+along with GNU CC; see the file COPYING. If not, write to
-+the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
-+
-+/* This is used on i386 platforms that use the ELF format.
-+ This was taken from the NetBSD/alpha configuration, and modified
-+ for NetBSD/i386 by Christos Zoulas <christos@netbsd.org> */
-+
-+/* Get generic i386 definitions. */
-+
-+/* This goes away when the math-emulator is fixed */
-+#define TARGET_CPU_DEFAULT 0400 /* TARGET_NO_FANCY_MATH_387 */
-+
-+#include <i386/gstabs.h>
-+
-+/* Get perform_* macros to build libgcc.a. */
-+#include <i386/perform.h>
-+
-+/* Get generic NetBSD ELF definitions. We will override these if necessary. */
-+
-+#define NETBSD_ELF
-+#include <netbsd.h>
-+
-+#undef ASM_FINAL_SPEC
-+
-+/* Names to predefine in the preprocessor for this target machine. */
-+
-+#undef CPP_PREDEFINES
-+#define CPP_PREDEFINES "\
-+-Dunix -Di386 -D__NetBSD__ -D__ELF__ \
-+-Asystem(unix) -Asystem(NetBSD) -Acpu(i386) -Amachine(i386)"
-+
-+/* Make gcc agree with <machine/ansi.h> */
-+
-+#undef SIZE_TYPE
-+#define SIZE_TYPE "unsigned int"
-+
-+#undef PTRDIFF_TYPE
-+#define PTRDIFF_TYPE "int"
-+
-+#undef WCHAR_TYPE
-+#define WCHAR_TYPE "int"
-+
-+#undef WCHAR_UNSIGNED
-+#define WCHAR_UNSIGNED 0
-+
-+#undef WCHAR_TYPE_SIZE
-+#define WCHAR_TYPE_SIZE 32
-+
-+/* Output assembler code to FILE to increment profiler label # LABELNO
-+ for profiling a function entry. Under NetBSD/i386, the assembler does
-+ nothing special with -pg. */
-+
-+#undef ASM_APP_ON
-+#define ASM_APP_ON "#APP\n"
-+
-+#undef ASM_APP_OFF
-+#define ASM_APP_OFF "#NO_APP\n"
-+
-+#define bsd4_4
-+#undef HAS_INIT_SECTION
-+
-+/* Provide a LINK_SPEC appropriate for a NetBSD/alpha ELF target. Only
-+ the linker emulation is i386-specific. The rest are
-+ common to all ELF targets, except for the name of the start function. */
-+
-+#undef LINK_SPEC
-+#define LINK_SPEC \
-+ "-m elf_i386 \
-+ %{assert*} %{R*} \
-+ %{shared:-shared} \
-+ %{!shared: \
-+ -dc -dp \
-+ %{!nostdlib:%{!r*:%{!e*:-e __start}}} \
-+ %{!static: \
-+ %{rdynamic:-export-dynamic} \
-+ %{!dynamic-linker:-dynamic-linker /usr/libexec/ld.elf_so}} \
-+ %{static:-static}}"
-+
-+#undef DEFAULT_VTABLE_THUNKS
-+#define DEFAULT_VTABLE_THUNKS 1
-+
-+#undef ASM_OUTPUT_ALIGN
-+#define ASM_OUTPUT_ALIGN(FILE,LOG) \
-+ if ((LOG)!=0) fprintf ((FILE), "\t.align %d\n", 1 << (LOG))
-+
-+/* This is how we tell the assembler that two symbols have the same value. */
-+
-+#define ASM_OUTPUT_DEF(FILE,NAME1,NAME2) \
-+ do { assemble_name(FILE, NAME1); \
-+ fputs(" = ", FILE); \
-+ assemble_name(FILE, NAME2); \
-+ fputc('\n', FILE); } while (0)
-+
-+/*
-+ * We always use gas here, so we don't worry about ECOFF assembler problems.
-+ */
-+#undef TARGET_GAS
-+#define TARGET_GAS (1)
-+
-+/* The following macros are stolen from i386v4.h */
-+/* These have to be defined to get PIC code correct */
-+
-+/* This is how to output an element of a case-vector that is relative.
-+ This is only used for PIC code. See comments by the `casesi' insn in
-+ i386.md for an explanation of the expression this outputs. */
-+
-+#undef ASM_OUTPUT_ADDR_DIFF_ELT
-+#define ASM_OUTPUT_ADDR_DIFF_ELT(FILE, BODY, VALUE, REL) \
-+ fprintf (FILE, "\t.long _GLOBAL_OFFSET_TABLE_+[.-%s%d]\n", LPREFIX, VALUE)
-+
-+/* Indicate that jump tables go in the text section. This is
-+ necessary when compiling PIC code. */
-+
-+#define JUMP_TABLES_IN_TEXT_SECTION 1
-+
-+/* Default to pcc-struct-return, because this is the ELF abi and
-+ we don't care about compatibility with older gcc versions. */
-+#define DEFAULT_PCC_STRUCT_RETURN 1
-+
-+/* Profiling routines, partially copied from i386/osfrose.h. */
-+
-+/* Redefine this to use %eax instead of %edx. */
-+#undef FUNCTION_PROFILER
-+#define FUNCTION_PROFILER(FILE, LABELNO) \
-+{ \
-+ if (flag_pic) \
-+ { \
-+ fprintf (FILE, "\tcall __mcount@PLT\n"); \
-+ } \
-+ else \
-+ { \
-+ fprintf (FILE, "\tcall __mcount\n"); \
-+ } \
-+}
-+
-+/* Put relocations in the constant pool in the writable data section. */
-+#undef SELECT_RTX_SECTION
-+#define SELECT_RTX_SECTION(MODE,RTX) \
-+{ \
-+ if (flag_pic && symbolic_operand (RTX)) \
-+ data_section (); \
-+ else \
-+ readonly_data_section (); \
-+}
-diff -urN gcc-2.95.2/gcc/config/i386/xm-netbsd.h gcc-patched/gcc/config/i386/xm-netbsd.h
---- gcc/config/i386/xm-netbsd.h Thu Jan 1 09:00:00 1970
-+++ gcc/config/i386/xm-netbsd.h Thu Dec 14 20:00:18 2000
-@@ -0,0 +1,23 @@
-+/* Configuration file for i386 hosts running NetBSD.
-+ Copyright (C) 1999 Free Software Foundation, Inc.
-+
-+This file is part of GNU CC.
-+
-+GNU CC is free software; you can redistribute it and/or modify
-+it under the terms of the GNU General Public License as published by
-+the Free Software Foundation; either version 2, or (at your option)
-+any later version.
-+
-+GNU CC is distributed in the hope that it will be useful,
-+but WITHOUT ANY WARRANTY; without even the implied warranty of
-+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+GNU General Public License for more details.
-+
-+You should have received a copy of the GNU General Public License
-+along with GNU CC; see the file COPYING. If not, write to
-+the Free Software Foundation, 59 Temple Place - Suite 330,
-+Boston, MA 02111-1307, USA. */
-+
-+#include <xm-netbsd.h>
-+#include <i386/xm-i386.h>
-+
-diff -urN gcc-2.95.2/gcc/config/netbsd.h gcc-patched/gcc/config/netbsd.h
---- gcc/config/netbsd.h Thu Dec 17 05:59:58 1998
-+++ gcc/config/netbsd.h Thu Dec 14 20:00:19 2000
-@@ -48,17 +48,31 @@
- #define ASM_SPEC " %| %{fpic:-k} %{fPIC:-k -K}"
-
- /* Provide a LIB_SPEC appropriate for NetBSD. Just select the appropriate
-- libc, depending on whether we're doing profiling. */
-+ libc, depending on whether we're doing profiling; if `-posix' is specified,
-+ link against the appropriate libposix first. */
-
- #undef LIB_SPEC
--#define LIB_SPEC "%{!p:%{!pg:-lc}}%{p:-lc_p}%{pg:-lc_p}"
-+#define LIB_SPEC \
-+ "%{posix:%{!p:%{!pg:-lposix}}%{p:-lposix_p}%{pg:-lposix_p}} \
-+ %{!p:%{!pg:-lc}}%{p:-lc_p}%{pg:-lc_p}"
-+
-+/* #ifdef NETBSD_AOUT */
-+
-+/* Provide a STARTFILE_SPEC appropriate for NetBSD a.out. Here we
-+ provide support for the special GCC option -static. */
-+
-+#undef STARTFILE_SPEC
-+#define STARTFILE_SPEC \
-+ "%{!shared:%{pg:gcrt0%O%s}%{!pg:%{p:mcrt0%O%s}%{!p:%{!static:crt0%O%s}%{static:scrt0%O%s}}}} %{shared:c++rt0%O%s}"
-
- /* Provide a LINK_SPEC appropriate for NetBSD. Here we provide support
- for the special GCC options -static, -assert, and -nostdlib. */
-
- #undef LINK_SPEC
- #define LINK_SPEC \
-- "%{!nostdlib:%{!r*:%{!e*:-e start}}} -dc -dp %{R*} %{static:-Bstatic} %{assert*}"
-+ "%{nostdlib:-nostdlib} %{!shared:%{!nostdlib:%{!r*:%{!e*:-e start}}} -dc -dp %{static:-Bstatic}} %{shared:-Bshareable} %{R*} %{assert*}"
-+
-+/* #endif NETBSD_AOUT */
-
- /* This defines which switch letters take arguments. */
- #undef SWITCH_TAKES_ARG
-@@ -127,6 +141,9 @@
- entries in an ELF object file under SVR4. These macros also output
- the starting labels for the relevant functions/objects. */
-
-+/* XXX. This is WRONG for alpha. Needs to be verified on other ELF ports. */
-+#ifndef NETBSD_ELF
-+
- /* Write the extra assembler code needed to declare a function properly.
- Some svr4 assemblers need to also have something extra said about the
- function's return value. We allow for that here. */
-@@ -207,3 +224,54 @@
- putc ('\n', FILE); \
- } \
- } while (0)
-+
-+#endif /* ! NETBSD_ELF */
-+
-+/* NetBSD ELF support begins here. */
-+
-+#ifdef NETBSD_ELF
-+
-+/* Start with generic ELF definitions. */
-+#include "elfos.h"
-+
-+#undef DWARF_DEBUGGING_INFO /* XXX */
-+#undef DWARF2_DEBUGGING_INFO /* XXX */
-+
-+/* Provide a STARTFILE_SPEC appropriate for NetBSD ELF targets. Here we
-+ provide support for the special GCC option -static. On ELF targets,
-+ we also add the crtbegin.o file which provides part of the support
-+ for getting C++ file-scope static objects constructed before entering
-+ `main'. */
-+
-+#undef STARTFILE_SPEC
-+#define STARTFILE_SPEC \
-+ "%{!shared: \
-+ %{pg:gcrt0%O%s} \
-+ %{!pg: \
-+ %{p:gcrt0%O%s} \
-+ %{!p:crt0%O%s}}} \
-+ %{!shared:crtbegin%O%s} %{shared:crtbeginS%O%s}"
-+
-+/* Provide an ENDFILE_SPEC appropriate for NetBSD ELF targets. Here we
-+ add crtend.o, which provides part of the support for getting C++
-+ file-scope static objects deconstructed after exiting `main'. */
-+
-+#undef ENDFILE_SPEC
-+#define ENDFILE_SPEC \
-+ "%{!shared:crtend%O%s} %{shared:crtendS%O%s}"
-+
-+/* Provide a LINK_SPEC appropriate for a NetBSD ELF target. */
-+
-+#undef LINK_SPEC
-+#define LINK_SPEC \
-+ "%{assert*} \
-+ %{shared:-shared} \
-+ %{!shared: \
-+ -dc -dp \
-+ %{!nostdlib:%{!r*:%{!e*:-e __start}}} \
-+ %{!static: \
-+ %{rdynamic:-export-dynamic} \
-+ %{!dynamic-linker:-dynamic-linker /usr/libexec/ld.elf_so}} \
-+ %{static:-static}}"
-+
-+#endif /* NETBSD_ELF */
-diff -urN gcc-2.95.2/gcc/config/sparc/netbsd-elf.h gcc-patched/gcc/config/sparc/netbsd-elf.h
---- gcc/config/sparc/netbsd-elf.h Thu Jan 1 09:00:00 1970
-+++ gcc/config/sparc/netbsd-elf.h Thu Dec 14 20:00:18 2000
-@@ -0,0 +1,42 @@
-+/* NetBSD/sparc ELF configuration */
-+
-+/*
-+ * Pull in generic SPARC ELF configuration, and then clean up
-+ * afterwards
-+ */
-+#include <sparc/elf.h>
-+
-+/* Name the target CPU. */
-+#ifndef TARGET_CPU_DEFAULT
-+#define TARGET_CPU_DEFAULT TARGET_CPU_sparc
-+#endif
-+
-+#undef MULDI3_LIBCALL
-+#undef DIVDI3_LIBCALL
-+#undef UDIVDI3_LIBCALL
-+#undef MODDI3_LIBCALL
-+#undef UMODDI3_LIBCALL
-+#undef INIT_SUBTARGET_OPTABS
-+#define INIT_SUBTARGET_OPTABS
-+
-+#undef CPP_SUBTARGET_SPEC
-+#define CPP_SUBTARGET_SPEC "-D__sparc"
-+
-+#include <sparc/netbsd-elf-common.h>
-+
-+#undef LINK_SPEC
-+#define LINK_SPEC \
-+ "-m elf32_sparc \
-+ %{assert*} %{R*} \
-+ %{shared:-shared} \
-+ %{!shared: \
-+ -dy -dc -dp \
-+ %{!nostdlib:%{!r*:%{!e*:-e __start}}} \
-+ %{!static: \
-+ %{rdynamic:-export-dynamic} \
-+ %{!dynamic-linker:-dynamic-linker /usr/libexec/ld.elf_so}} \
-+ %{static:-static}}"
-+
-+/* Name the port. */
-+#undef TARGET_NAME
-+#define TARGET_NAME "sparc-netbsdelf"
-diff -urN gcc-2.95.2/gcc/config/sparc/netbsd64.h gcc-patched/gcc/config/sparc/netbsd64.h
---- gcc/config/sparc/netbsd64.h Thu Jan 1 09:00:00 1970
-+++ gcc/config/sparc/netbsd64.h Thu Dec 14 20:00:18 2000
-@@ -0,0 +1,169 @@
-+/* NetBSD/sparc64 ELF configuration */
-+
-+/*
-+ * Pull in generic SPARC64 ELF configuration, and then clean up
-+ * afterwards
-+ */
-+
-+/* Let us output 32 bit code as well */
-+#define SPARC_BI_ARCH
-+
-+/* Name the target CPU. This must be before <sparc/sparc.h>. */
-+#ifndef TARGET_CPU_DEFAULT
-+#define TARGET_CPU_DEFAULT TARGET_CPU_ultrasparc
-+#endif
-+
-+#include <sparc/sp64-elf.h>
-+
-+#include <sparc/netbsd-elf-common.h>
-+
-+#undef CPP_SUBTARGET_SPEC
-+#define CPP_SUBTARGET_SPEC "-D__sparc64__"
-+
-+#undef LINK_SPEC64
-+#define LINK_SPEC64 \
-+ "-m elf64_sparc \
-+ %{assert*} %{R*} \
-+ %{shared:-shared} \
-+ %{!shared: \
-+ -dy -dc -dp \
-+ %{!nostdlib:%{!r*:%{!e*:-e __start}}} \
-+ %{!static: \
-+ %{rdynamic:-export-dynamic} \
-+ %{!dynamic-linker:-dynamic-linker /usr/libexec/ld.elf_so}} \
-+ %{static:-static}}"
-+
-+#undef LINK_SPEC
-+#define LINK_SPEC LINK_SPEC64
-+
-+#ifdef SPARC_BI_ARCH
-+
-+#undef STARTFILE_SPEC64
-+#define STARTFILE_SPEC64 \
-+ "%{!shared: \
-+ %{pg:gcrt0%O%s} \
-+ %{!pg: \
-+ %{p:gcrt0%O%s} \
-+ %{!p:crt0%O%s}}} \
-+ %{!shared:crtbegin%O%s} %{shared:crtbeginS%O%s}"
-+
-+#undef STARTFILE_SPEC32
-+#define STARTFILE_SPEC32 \
-+ "%{!shared: \
-+ %{pg:/emul/netbsd32/usr/lib/gcrt0%O%s} \
-+ %{!pg: \
-+ %{p:/emul/netbsd32/usr/lib/gcrt0%O%s} \
-+ %{!p:/emul/netbsd32/usr/lib/crt0%O%s}}} \
-+ %{!shared:/emul/netbsd32/usr/lib/crtbegin%O%s} %{shared:/emul/netbsd32/usr/lib/crtbeginS%O%s}"
-+
-+#undef STARTFILE_SPEC
-+#if DEFAULT_ARCH32_P
-+#define STARTFILE_SPEC "\
-+%{m32:" STARTFILE_SPEC32 "} \
-+%{m64:" STARTFILE_SPEC64 "} \
-+%{!m32:%{!m64:" STARTFILE_SPEC32 "}}"
-+#else
-+#define STARTFILE_SPEC "\
-+%{m32:" STARTFILE_SPEC32 "} \
-+%{m64:" STARTFILE_SPEC64 "} \
-+%{!m32:%{!m64:" STARTFILE_SPEC64 "}}"
-+#endif
-+
-+#undef ENDFILE_SPEC64
-+#define ENDFILE_SPEC64 \
-+ "%{!shared:crtend%O%s} %{shared:crtendS%O%s}"
-+
-+#undef ENDFILE_SPEC32
-+#define ENDFILE_SPEC32 \
-+ "%{!shared:/emul/netbsd32/usr/lib/crtend%O%s} %{shared:/emul/netbsd32/usr/lib/crtendS%O%s}"
-+
-+#undef ENDFILE_SPEC
-+#if DEFAULT_ARCH32_P
-+#define ENDFILE_SPEC "\
-+%{m32:" ENDFILE_SPEC32 "} \
-+%{m64:" ENDFILE_SPEC64 "} \
-+%{!m32:%{!m64:" ENDFILE_SPEC32 "}}"
-+#else
-+#define ENDFILE_SPEC "\
-+%{m32:" ENDFILE_SPEC32 "} \
-+%{m64:" ENDFILE_SPEC64 "} \
-+%{!m32:%{!m64:" ENDFILE_SPEC64 "}}"
-+#endif
-+
-+#undef SUBTARGET_EXTRA_SPECS
-+#define SUBTARGET_EXTRA_SPECS \
-+ { "link_arch32", LINK_ARCH32_SPEC }, \
-+ { "link_arch64", LINK_ARCH64_SPEC }, \
-+ { "link_arch_default", LINK_ARCH_DEFAULT_SPEC }, \
-+ { "link_arch", LINK_ARCH_SPEC },
-+
-+#undef LINK_ARCH32_SPEC
-+#define LINK_ARCH32_SPEC \
-+ "-m elf32_sparc \
-+ -Y P,/emul/netbsd32/usr/lib \
-+ %{assert*} %{R*} \
-+ %{shared:-shared} \
-+ %{!shared: \
-+ -dy -dc -dp \
-+ %{!nostdlib:%{!r*:%{!e*:-e __start}}} \
-+ %{!static: \
-+ %{rdynamic:-export-dynamic} \
-+ %{!dynamic-linker:-dynamic-linker /usr/libexec/ld.elf_so}} \
-+ %{static:-static}}"
-+
-+#undef LINK_ARCH64_SPEC
-+#define LINK_ARCH64_SPEC LINK_SPEC64
-+
-+#define LINK_ARCH_SPEC "\
-+%{m32:%(link_arch32)} \
-+%{m64:%(link_arch64)} \
-+%{!m32:%{!m64:%(link_arch_default)}} \
-+"
-+
-+#define LINK_ARCH_DEFAULT_SPEC \
-+(DEFAULT_ARCH32_P ? LINK_ARCH32_SPEC : LINK_ARCH64_SPEC)
-+
-+#undef LINK_SPEC
-+#define LINK_SPEC "\
-+%(link_arch) \
-+%{mlittle-endian:-EL} \
-+"
-+
-+#undef CC1_SPEC
-+#if DEFAULT_ARCH32_P
-+#define CC1_SPEC "\
-+%{sun4:} %{target:} \
-+%{mcypress:-mcpu=cypress} \
-+%{msparclite:-mcpu=sparclite} %{mf930:-mcpu=f930} %{mf934:-mcpu=f934} \
-+%{mv8:-mcpu=v8} %{msupersparc:-mcpu=supersparc} \
-+%{m64:-mptr64 -mcpu=ultrasparc -mstack-bias} \
-+"
-+#else
-+#define CC1_SPEC "\
-+%{sun4:} %{target:} \
-+%{mcypress:-mcpu=cypress} \
-+%{msparclite:-mcpu=sparclite} %{mf930:-mcpu=f930} %{mf934:-mcpu=f934} \
-+%{mv8:-mcpu=v8} %{msupersparc:-mcpu=supersparc} \
-+%{m32:-mptr32 -mcpu=cypress -mno-stack-bias} \
-+"
-+#endif
-+
-+#if DEFAULT_ARCH32_P
-+#define MULTILIB_DEFAULTS { "m32" }
-+#else
-+#define MULTILIB_DEFAULTS { "m64" }
-+#endif
-+
-+#undef CPP_SUBTARGET_SPEC
-+#define CPP_SUBTARGET_SPEC \
-+(DEFAULT_ARCH32_P ? "\
-+%{m64:-D__sparc64__}%{!m64:-D__sparc} \
-+" : "\
-+%{!m32:-D__sparc64__}%{m32:-D__sparc} \
-+")
-+
-+#endif /* SPARC_BI_ARCH */
-+
-+/* Name the port. */
-+#undef TARGET_NAME
-+#define TARGET_NAME "sparc64-netbsd"
-diff -urN gcc-2.95.2/gcc/config/sparc/sparc.md gcc-patched/gcc/config/sparc/sparc.md
---- gcc/config/sparc/sparc.md Thu Oct 21 14:35:40 1999
-+++ gcc/config/sparc/sparc.md Thu Dec 14 20:00:18 2000
-@@ -3472,10 +3472,7 @@
- (define_split
- [(set (match_operand:TF 0 "register_operand" "")
- (match_operand:TF 1 "register_operand" ""))]
-- "reload_completed
-- && (! TARGET_ARCH64
-- || (TARGET_FPU
-- && ! TARGET_HARD_QUAD))"
-+ "reload_completed"
- [(clobber (const_int 0))]
- "
- {
-diff -urN gcc-2.95.2/gcc/config/sparc/sysv4.h gcc-patched/gcc/config/sparc/sysv4.h
---- gcc/config/sparc/sysv4.h Tue Jun 22 02:48:53 1999
-+++ gcc/config/sparc/sysv4.h Thu Dec 14 20:00:19 2000
-@@ -210,6 +210,29 @@
- #define ASM_OUTPUT_ALIGNED_BSS(FILE, DECL, NAME, SIZE, ALIGN) \
- asm_output_aligned_bss (FILE, DECL, NAME, SIZE, ALIGN)
-
-+/* A C statement (sans semicolon) to output an element in the table of
-+ global constructors. */
-+#undef ASM_OUTPUT_CONSTRUCTOR
-+#define ASM_OUTPUT_CONSTRUCTOR(FILE,NAME) \
-+ do { \
-+ ctors_section (); \
-+ fprintf (FILE, "\t%s\t ", TARGET_ARCH64 ? ASM_LONGLONG : INT_ASM_OP); \
-+ assemble_name (FILE, NAME); \
-+ fprintf (FILE, "\n"); \
-+ } while (0)
-+
-+/* A C statement (sans semicolon) to output an element in the table of
-+ global destructors. */
-+#undef ASM_OUTPUT_DESTRUCTOR
-+#define ASM_OUTPUT_DESTRUCTOR(FILE,NAME) \
-+ do { \
-+ dtors_section (); \
-+ fprintf (FILE, "\t%s\t ", TARGET_ARCH64 ? ASM_LONGLONG : INT_ASM_OP); \
-+ assemble_name (FILE, NAME); \
-+ fprintf (FILE, "\n"); \
-+ } while (0)
-+
-+
- /* Override the name of the mcount profiling function. */
-
- #undef MCOUNT_FUNCTION
-diff -urN gcc-2.95.2/gcc/config/sparc/xm-netbsd.h gcc-patched/gcc/config/sparc/xm-netbsd.h
---- gcc/config/sparc/xm-netbsd.h Thu Jan 1 09:00:00 1970
-+++ gcc/config/sparc/xm-netbsd.h Thu Dec 14 20:00:19 2000
-@@ -0,0 +1,4 @@
-+/* Configuration for GCC for Sun SPARC running NetBSD as host. */
-+
-+#include <sparc/xm-sparc.h>
-+#include <xm-netbsd.h>
-diff -urN gcc-2.95.2/gcc/config/sparc/xm-netbsd64.h gcc-patched/gcc/config/sparc/xm-netbsd64.h
---- gcc/config/sparc/xm-netbsd64.h Thu Jan 1 09:00:00 1970
-+++ gcc/config/sparc/xm-netbsd64.h Thu Dec 14 20:00:19 2000
-@@ -0,0 +1,4 @@
-+/* Configuration for GCC for Sun SPARC V9 running NetBSD as host. */
-+
-+#include <xm-netbsd.h>
-+#include <sparc/xm-sp64.h>
-diff -urN gcc-2.95.2/gcc/config/xm-netbsd.h gcc-patched/gcc/config/xm-netbsd.h
---- gcc/config/xm-netbsd.h Thu Jan 1 09:00:00 1970
-+++ gcc/config/xm-netbsd.h Thu Dec 14 20:00:19 2000
-@@ -0,0 +1,32 @@
-+/* Configuration for GNU C-compiler for hosts running NetBSD.
-+ Copyright (C) 1995 Free Software Foundation, Inc.
-+
-+This file is part of GNU CC.
-+
-+GNU CC is free software; you can redistribute it and/or modify
-+it under the terms of the GNU General Public License as published by
-+the Free Software Foundation; either version 2, or (at your option)
-+any later version.
-+
-+GNU CC is distributed in the hope that it will be useful,
-+but WITHOUT ANY WARRANTY; without even the implied warranty of
-+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+GNU General Public License for more details.
-+
-+You should have received a copy of the GNU General Public License
-+along with GNU CC; see the file COPYING. If not, write to
-+the Free Software Foundation, 59 Temple Place - Suite 330,
-+Boston, MA 02111-1307, USA. */
-+
-+/* This file defines machine-independent things specific to a host
-+ running NetBSD. This file should not be specified as $xm_file itself;
-+ instead $xm_file should be CPU/xm-netbsd.h, which should include both
-+ CPU/xm-CPU.h and this file xm-netbsd.h. */
-+
-+#undef POSIX
-+#define POSIX
-+
-+/* Ensure we get gnu C's defaults. */
-+#ifdef __GNUC__
-+#define alloca __builtin_alloca
-+#endif
-diff -urN gcc-2.95.2/gcc/config/xm-target64.h gcc-patched/gcc/config/xm-target64.h
---- gcc/config/xm-target64.h Thu Jan 1 09:00:00 1970
-+++ gcc/config/xm-target64.h Thu Dec 14 20:00:19 2000
-@@ -0,0 +1,6 @@
-+/* Hack to extend HOST_WIDE_INT on 64-bit target cross compilers. */
-+
-+#ifdef __GNUC__
-+#define HOST_WIDE_INT long long
-+#define HOST_BITS_PER_WIDE_INT 64
-+#endif
-diff -urN gcc-2.95.2/gcc/emit-rtl.c gcc-patched/gcc/emit-rtl.c
---- gcc/emit-rtl.c Wed Aug 11 16:28:52 1999
-+++ gcc/emit-rtl.c Thu Dec 14 20:00:20 2000
-@@ -1378,6 +1378,15 @@
- val = ((val & 0xffffffff) ^ 0x80000000) - 0x80000000;
- return GEN_INT (val);
- }
-+#if HOST_BITS_PER_WIDE_INT >= 64
-+ else if (BITS_PER_WORD >= 64 && i <= 1)
-+ {
-+ val = k[i*2 + ! WORDS_BIG_ENDIAN];
-+ val = (((val & 0xffffffff) ^ 0x80000000) - 0x80000000) << 32;
-+ val |= (HOST_WIDE_INT) k[i*2 + WORDS_BIG_ENDIAN] & 0xffffffff;
-+ return GEN_INT (val);
-+ }
-+#endif
- else
- abort ();
- }
-diff -urN gcc-2.95.2/gcc/ginclude/stddef.h gcc-patched/gcc/ginclude/stddef.h
---- gcc/ginclude/stddef.h Thu Dec 17 06:19:25 1998
-+++ gcc/ginclude/stddef.h Thu Dec 14 20:00:20 2000
-@@ -45,6 +45,12 @@
- #define _WCHAR_T
- #endif
- #endif
-+/* On NetBSD, machine/ansi.h defines _BSD_WINT_T_ instead of _WINT_T. */
-+#if !defined(_WINT_T_) && !defined(_BSD_WINT_T_)
-+#ifndef _BSD_WINT_T_
-+#define _WINT_T
-+#endif
-+#endif
- /* Undef _FOO_T_ if we are supposed to define foo_t. */
- #if defined (__need_ptrdiff_t) || defined (_STDDEF_H_)
- #undef _PTRDIFF_T_
-@@ -58,6 +64,10 @@
- #undef _WCHAR_T_
- #undef _BSD_WCHAR_T_
- #endif
-+#if defined (__need_wint_t) || defined (_STDDEF_H_)
-+#undef _WINT_T_
-+#undef _BSD_WINT_T_
-+#endif
- #endif /* defined(_ANSI_H_) || defined(_MACHINE_ANSI_H_) */
-
- /* Sequent's header files use _PTRDIFF_T_ in some conflicting way.
-@@ -272,12 +282,14 @@
-
- #if defined (_STDDEF_H) || defined (__need_wint_t)
- #ifndef _WINT_T
-+#ifndef _BSD_WINT_T_
- #define _WINT_T
-
- #ifndef __WINT_TYPE__
- #define __WINT_TYPE__ unsigned int
- #endif
- typedef __WINT_TYPE__ wint_t;
-+#endif
- #endif
- #undef __need_wint_t
- #endif
-diff -urN gcc-2.95.2/gcc/objc/objc-act.c gcc-patched/gcc/objc/objc-act.c
---- gcc/objc/objc-act.c Thu Apr 15 05:28:54 1999
-+++ gcc/objc/objc-act.c Thu Dec 14 20:00:19 2000
-@@ -8399,8 +8399,11 @@
- pushdecl (decl);
- rest_of_decl_compilation (decl, 0, 0, 0);
-
-- /* Make following constant read-only (why not)? */
-- readonly_data_section ();
-+ /* Make following constant read-only, if not compiling PIC. */
-+ if (flag_pic)
-+ data_section();
-+ else
-+ readonly_data_section ();
-
- exp = build1 (ADDR_EXPR, string_type_node, decl);
-
diff --git a/cross/i386-netbsdpe/patches/patch-ab b/cross/i386-netbsdpe/patches/patch-ab
index 647fafa7634..f8a11427a98 100644
--- a/cross/i386-netbsdpe/patches/patch-ab
+++ b/cross/i386-netbsdpe/patches/patch-ab
@@ -1,6 +1,6 @@
-$NetBSD: patch-ab,v 1.1 2002/03/18 03:04:41 kent Exp $
+$NetBSD: patch-ab,v 1.2 2004/03/09 12:19:12 kent Exp $
---- gcc/config/i386/cygwin.asm.orig Thu Dec 17 06:03:13 1998
+--- gcc/config/i386/cygwin.asm.orig 2001-10-31 23:32:27.000000000 +0900
+++ gcc/config/i386/cygwin.asm
@@ -3,9 +3,9 @@
#ifdef L_chkstk
diff --git a/cross/i386-netbsdpe/patches/patch-ac b/cross/i386-netbsdpe/patches/patch-ac
deleted file mode 100644
index 688a9a01d69..00000000000
--- a/cross/i386-netbsdpe/patches/patch-ac
+++ /dev/null
@@ -1,13 +0,0 @@
-$NetBSD: patch-ac,v 1.1 2002/03/18 03:04:41 kent Exp $
-
---- gcc/config/i386/i386.c.orig Tue Sep 7 16:38:56 1999
-+++ gcc/config/i386/i386.c
-@@ -1922,7 +1922,7 @@
- output_asm_insn (AS2 (mov%L0,%2,%3), xops);
-
- xops[3] = gen_rtx_MEM (FUNCTION_MODE,
-- gen_rtx (SYMBOL_REF, Pmode, "_alloca"));
-+ gen_rtx (SYMBOL_REF, Pmode, "_builtin_alloca_checkstack"));
-
- if (do_rtl)
- emit_call_insn (gen_rtx (CALL, VOIDmode, xops[3], const0_rtx));
diff --git a/cross/i386-netbsdpe/patches/patch-ad b/cross/i386-netbsdpe/patches/patch-ad
index 7595f29227f..1a0c3fcf190 100644
--- a/cross/i386-netbsdpe/patches/patch-ad
+++ b/cross/i386-netbsdpe/patches/patch-ad
@@ -1,13 +1,22 @@
-$NetBSD: patch-ad,v 1.1 2002/03/18 03:04:41 kent Exp $
+$NetBSD: patch-ad,v 1.2 2004/03/09 12:19:12 kent Exp $
---- gcc/config/i386/i386.md.orig Tue Sep 7 16:45:42 1999
+--- gcc/config/i386/i386.md.orig 2003-10-26 04:43:59.000000000 +0900
+++ gcc/config/i386/i386.md
-@@ -8161,7 +8161,7 @@
- (set (reg:SI 7) (minus:SI (reg:SI 7) (match_dup 0)))
- (clobber (match_dup 0))]
- "TARGET_STACK_PROBE"
-- "* return AS1(call,__alloca);"
-+ "* return AS1(call,__builtin_alloca_checkstack);"
- [(set_attr "memory" "none")])
+@@ -16772,7 +16772,7 @@
+ (clobber (match_dup 0))
+ (clobber (reg:CC 17))]
+ "!TARGET_64BIT && TARGET_STACK_PROBE"
+- "call\t__alloca"
++ "call\t__builtin_alloca_checkstack"
+ [(set_attr "type" "multi")
+ (set_attr "length" "5")])
+
+@@ -16782,7 +16782,7 @@
+ (clobber (match_dup 0))
+ (clobber (reg:CC 17))]
+ "TARGET_64BIT && TARGET_STACK_PROBE"
+- "call\t__alloca"
++ "call\t__builtin_alloca_checkstack"
+ [(set_attr "type" "multi")
+ (set_attr "length" "5")])
- (define_expand "allocate_stack"
diff --git a/cross/i386-netbsdpe/patches/patch-ae b/cross/i386-netbsdpe/patches/patch-ae
new file mode 100644
index 00000000000..0d6e85fa980
--- /dev/null
+++ b/cross/i386-netbsdpe/patches/patch-ae
@@ -0,0 +1,22 @@
+$NetBSD: patch-ae,v 1.3 2004/03/09 12:19:12 kent Exp $
+
+--- gcc/config/i386/t-netbsdpe.orig 2003-11-03 01:45:58.000000000 +0900
++++ gcc/config/i386/t-netbsdpe
+@@ -8,14 +8,14 @@ LIMITS_H_TEST = true
+ # If we are building next to winsup, this will let us find the real
+ # limits.h when building libgcc2. Otherwise, winsup must be installed
+ # first.
+-LIBGCC2_INCLUDES = -I$(srcdir)/../winsup/w32api/include
++LIBGCC2_INCLUDES = -I../.. -I/usr/include -D_LIBC_LIMITS_H_
+
+-LIB2FUNCS_EXTRA = $(srcdir)/config/i386/w32-shared-ptr.c
++#LIB2FUNCS_EXTRA = $(srcdir)/config/i386/w32-shared-ptr.c
+
+ winnt.o: $(srcdir)/config/i386/winnt.c $(RTL_H) $(TREE_H) $(CONFIG_H)
+ $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) $(srcdir)/config/i386/winnt.c
+
+ # Don't run fixproto
+ STMP_FIXPROTO=
+-STMP_FIXINC=stmp-fixinc
++STMP_FIXINC=
+
diff --git a/cross/i386-netbsdpe/patches/patch-af b/cross/i386-netbsdpe/patches/patch-af
new file mode 100644
index 00000000000..66a7f3d6f64
--- /dev/null
+++ b/cross/i386-netbsdpe/patches/patch-af
@@ -0,0 +1,13 @@
+$NetBSD: patch-af,v 1.3 2004/03/09 12:19:12 kent Exp $
+
+--- gcc/Makefile.in.orig 2003-11-04 16:19:18.000000000 +0900
++++ gcc/Makefile.in
+@@ -3000,7 +3000,7 @@ install-headers-tar: stmp-int-hdrs $(STM
+ # found in CDPATH, corrupting the output. We could just redirect the
+ # output of `cd', but some shells lose on redirection within `()'s
+ (cd `${PWD_COMMAND}`/include ; \
+- tar -cf - .; exit 0) | (cd $(DESTDIR)$(libsubdir)/include; tar xpf - )
++ tar -cf - mmintrin.h xmmintrin.h; exit 0) | (cd $(DESTDIR)$(libsubdir)/include; tar xpf - )
+ # /bin/sh on some systems returns the status of the first tar,
+ # and that can lose with GNU tar which always writes a full block.
+ # So use `exit 0' to ignore its exit status.
diff --git a/cross/i386-netbsdpe/patches/patch-co b/cross/i386-netbsdpe/patches/patch-co
index 332aee3da39..3db209646d7 100644
--- a/cross/i386-netbsdpe/patches/patch-co
+++ b/cross/i386-netbsdpe/patches/patch-co
@@ -1,78 +1,23 @@
-$NetBSD: patch-co,v 1.1 2001/01/30 03:09:00 minoura Exp $
+$NetBSD: patch-co,v 1.2 2004/03/09 12:19:12 kent Exp $
---- gcc/configure.in.pre-patch Tue Jan 16 21:47:25 2001
-+++ gcc/configure.in
-@@ -1156,9 +1156,34 @@
- tmake_file=t-freebsd
- ;;
- changequote(,)dnl
-+ i[34567]86-*-netbsdelf* | \
-+ i[34567]86-*-netbsd1.4[I-Z]* | \
-+ i[34567]86-*-netbsd1.[5-9]* | \
-+ i[34567]86-*-netbsd2*)
-+changequote([,])dnl
-+ tm_file=i386/netbsd-elf.h
-+ xm_file=i386/xm-netbsd.h
-+ tmake_file=t-netbsd
-+ ;;
-+changequote(,)dnl
-+ i[34567]86-*-netbsdpe* )
-+changequote([,])dnl
-+ xm_file="${xm_file} i386/xm-cygwin.h"
-+ tmake_file=i386/t-cygwin
-+ tm_file=i386/netbsd-pe.h
-+ xmake_file=i386/x-cygwin
-+ extra_objs=winnt.o
-+ fixincludes=Makefile.in
-+ if [[ x$enable_threads = xyes ]]; then
-+ thread_file='posix'
-+ fi
-+ exeext=.exe
-+ ;;
-+changequote(,)dnl
- i[34567]86-*-netbsd*)
- changequote([,])dnl
- tm_file=i386/netbsd.h
-+ xm_file=i386/xm-netbsd.h
- tmake_file=t-netbsd
- use_collect2=yes
- ;;
-@@ -3021,6 +3046,12 @@
- tmake_file=sparc/t-sparcbare
- tm_file="sparc/aout.h libgloss.h"
- ;;
-+ sparc-*-netbsd*elf*)
-+ tm_file=sparc/netbsdelf.h
-+ xm_file=sparc/xm-netbsd.h
-+ tmake_file=t-netbsd
-+ use_collect2=yes
-+ ;;
- sparc-*-netbsd*)
- tm_file=sparc/netbsd.h
- tmake_file=t-netbsd
-@@ -3216,6 +3247,12 @@
- extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o"
- gnu_ld=yes
- ;;
-+ sparc64-*-netbsd*)
-+ tm_file=sparc/netbsd64.h
-+ xm_file=sparc/xm-netbsd64.h
-+ tmake_file=t-netbsd
-+ use_collect2=yes
-+ ;;
- # This hasn't been upgraded to GCC 2.
- # tahoe-harris-*) # Harris tahoe, using COFF.
- # tm_file=tahoe/harris.h
-@@ -3557,6 +3594,12 @@
- esac
- fi
-
-+case $target in
-+ alpha*|sparc64*)
-+ build_xm_file="${build_xm_file} xm-target64.h"
-+ host_xm_file="${host_xm_file} xm-target64.h";;
-+esac
-+
- # Handle cpp installation.
- if test x$enable_cpp != xno
- then
+--- gcc/config.gcc.orig2 2003-10-26 04:46:27.000000000 +0900
++++ gcc/config.gcc
+@@ -1139,6 +1139,18 @@ x86_64-*-freebsd*)
+ i[34567]86-*-netbsdelf*)
+ tm_file="${tm_file} i386/unix.h i386/att.h dbxelf.h elfos.h netbsd.h netbsd-elf.h i386/netbsd-elf.h"
+ ;;
++i[34567]86-*-netbsdpe*)
++ tm_file="i386/cygming.h i386/netbsdpe.h"
++ xm_defines=POSIX
++ xm_file=i386/xm-mingw32.h
++ xmake_file=i386/x-mingw32
++ tmake_file="i386/t-netbsdpe"
++ extra_objs=winnt.o
++ target_cpu_default=TARGET_CPU_DEFAULT_pentiumpro
++ if test x$enable_threads = xyes; then
++ thread_file='posix'
++ fi
++ ;;
+ i[34567]86-*-netbsd*)
+ tm_file="${tm_file} i386/unix.h i386/bsd.h i386/gas.h i386/gstabs.h netbsd.h netbsd-aout.h i386/netbsd.h"
+ tmake_file=t-netbsd
diff --git a/cross/i386-netbsdpe/patches/patch-cp b/cross/i386-netbsdpe/patches/patch-cp
deleted file mode 100644
index df74d2f16ab..00000000000
--- a/cross/i386-netbsdpe/patches/patch-cp
+++ /dev/null
@@ -1,44 +0,0 @@
-$NetBSD: patch-cp,v 1.1 2001/01/30 03:09:00 minoura Exp $
-
---- gcc/cccp.c.orig Wed Jan 17 20:59:27 2001
-+++ gcc/cccp.c
-@@ -393,16 +393,23 @@
- /* Pick up GNU C++ specific include files. */
- { GPLUSPLUS_INCLUDE_DIR, "G++", 1, 1, 0 },
- #ifdef CROSS_COMPILE
-+#if 0
- /* This is the dir for fixincludes. Put it just before
- the files that we fix. */
- { GCC_INCLUDE_DIR, "GCC", 0, 0, 0 },
-- /* For cross-compilation, this dir name is generated
-- automatically in Makefile.in. */
-- { CROSS_INCLUDE_DIR, "GCC", 0, 0, 0 },
-+#endif
- #ifdef TOOL_INCLUDE_DIR
- /* This is another place that the target system's headers might be. */
- { TOOL_INCLUDE_DIR, "BINUTILS", 0, 0, 0 },
- #endif
-+ /* For cross-compilation, this dir name is generated
-+ automatically in Makefile.in. */
-+ { CROSS_INCLUDE_DIR, "GCC", 0, 0, 0 },
-+#ifdef LOCAL_INCLUDE_DIR
-+ /* This should be /usr/local/include and should come before
-+ the fixincludes-fixed header files. */
-+ { LOCAL_INCLUDE_DIR, 0, 0, 1, 0 },
-+#endif
- #else /* not CROSS_COMPILE */
- #ifdef LOCAL_INCLUDE_DIR
- /* This should be /usr/local/include and should come before
-@@ -421,11 +428,11 @@
- #ifdef SYSTEM_INCLUDE_DIR
- { SYSTEM_INCLUDE_DIR, 0, 0, 0, 0 },
- #endif
-+#endif /* not CROSS_COMPILE */
- #ifndef STANDARD_INCLUDE_COMPONENT
- #define STANDARD_INCLUDE_COMPONENT 0
- #endif
- { STANDARD_INCLUDE_DIR, STANDARD_INCLUDE_COMPONENT, 0, 0, 0 },
--#endif /* not CROSS_COMPILE */
- { 0, 0, 0, 0, 0 }
- };
- #endif /* no INCLUDE_DEFAULTS */
diff --git a/cross/i386-netbsdpe/patches/patch-cq b/cross/i386-netbsdpe/patches/patch-cq
deleted file mode 100644
index 8a0e78b4acc..00000000000
--- a/cross/i386-netbsdpe/patches/patch-cq
+++ /dev/null
@@ -1,44 +0,0 @@
-$NetBSD: patch-cq,v 1.1 2001/01/30 03:09:01 minoura Exp $
-
---- gcc/cppinit.c.orig Tue Oct 12 15:31:11 1999
-+++ gcc/cppinit.c
-@@ -129,16 +129,23 @@
- /* Pick up GNU C++ specific include files. */
- { GPLUSPLUS_INCLUDE_DIR, "G++", 1, 1 },
- #ifdef CROSS_COMPILE
-+#if 0
- /* This is the dir for fixincludes. Put it just before
- the files that we fix. */
- { GCC_INCLUDE_DIR, "GCC", 0, 0 },
-- /* For cross-compilation, this dir name is generated
-- automatically in Makefile.in. */
-- { CROSS_INCLUDE_DIR, "GCC", 0, 0 },
-+#endif
- #ifdef TOOL_INCLUDE_DIR
- /* This is another place that the target system's headers might be. */
- { TOOL_INCLUDE_DIR, "BINUTILS", 0, 1 },
- #endif
-+ /* For cross-compilation, this dir name is generated
-+ automatically in Makefile.in. */
-+ { CROSS_INCLUDE_DIR, "GCC", 0, 0 },
-+#ifdef LOCAL_INCLUDE_DIR
-+ /* This should be /usr/local/include and should come before
-+ the fixincludes-fixed header files. */
-+ { LOCAL_INCLUDE_DIR, 0, 0, 1 },
-+#endif
- #else /* not CROSS_COMPILE */
- #ifdef LOCAL_INCLUDE_DIR
- /* This should be /usr/local/include and should come before
-@@ -157,11 +164,11 @@
- #ifdef SYSTEM_INCLUDE_DIR
- { SYSTEM_INCLUDE_DIR, 0, 0, 0 },
- #endif
-+#endif /* not CROSS_COMPILE */
- #ifndef STANDARD_INCLUDE_COMPONENT
- #define STANDARD_INCLUDE_COMPONENT 0
- #endif
- { STANDARD_INCLUDE_DIR, STANDARD_INCLUDE_COMPONENT, 0, 0 },
--#endif /* not CROSS_COMPILE */
- { 0, 0, 0, 0 }
- };
- #endif /* no INCLUDE_DEFAULTS */
diff --git a/cross/i386-netbsdpe/patches/patch-de b/cross/i386-netbsdpe/patches/patch-de
deleted file mode 100644
index 6778f128899..00000000000
--- a/cross/i386-netbsdpe/patches/patch-de
+++ /dev/null
@@ -1,46 +0,0 @@
-$NetBSD: patch-de,v 1.1 2001/10/21 12:24:16 kent Exp $
-
---- gcc/cp/decl.c~ Tue Mar 27 22:17:25 2001
-+++ gcc/cp/decl.c
-@@ -10266,8 +10266,18 @@
- ignore_attrs = 0;
- else if (inner_attrs)
- {
-- decl_attributes (type, inner_attrs, NULL_TREE);
-- inner_attrs = NULL_TREE;
-+ /*decl_attributes (type, inner_attrs, NULL_TREE);*/
-+ /* Create a dummy decl to pass to decl_attributes. The
-+ attributes will be added to a variant of type, and this
-+ new variant type can be retrieved from the dummy decl.
-+ Passing type directly causes the attributes to be added
-+ to type, which is wrong because type may be used
-+ elsewhere without attributes. */
-+
-+ tree dummy = build_decl (TYPE_DECL, NULL_TREE, type);
-+ decl_attributes (dummy, inner_attrs, NULL_TREE);
-+ type = TREE_TYPE (dummy);
-+ inner_attrs = NULL_TREE;
- }
-
- switch (TREE_CODE (declarator))
-@@ -10969,7 +10979,19 @@
- if (inner_attrs)
- {
- if (! ignore_attrs)
-- decl_attributes (type, inner_attrs, NULL_TREE);
-+ /*decl_attributes (type, inner_attrs, NULL_TREE);*/
-+ {
-+ /* Create a dummy decl to pass to decl_attributes. The
-+ attributes will be added to a variant of type, and this
-+ new variant type can be retrieved from the dummy decl.
-+ Passing type directly causes the attributes to be added
-+ to type, which is wrong because type may be used
-+ elsewhere without attributes. */
-+
-+ tree dummy = build_decl (TYPE_DECL, NULL_TREE, type);
-+ decl_attributes (dummy, inner_attrs, NULL_TREE);
-+ type = TREE_TYPE (dummy);
-+ }
- else if (attrlist)
- TREE_VALUE (attrlist) = chainon (inner_attrs, TREE_VALUE (attrlist));
- else
diff --git a/cross/i386-netbsdpe/patches/patch-ma b/cross/i386-netbsdpe/patches/patch-ma
deleted file mode 100644
index ab0ffc952ba..00000000000
--- a/cross/i386-netbsdpe/patches/patch-ma
+++ /dev/null
@@ -1,23 +0,0 @@
-$NetBSD: patch-ma,v 1.2 2002/10/16 05:11:01 kent Exp $
-
---- gcc/Makefile.in.orig Wed Oct 16 14:02:49 2002
-+++ gcc/Makefile.in
-@@ -276,7 +276,8 @@ unlibsubdir = ../../..
- # Directory in which to find other cross-compilation tools and headers.
- dollar = @dollar@
- # Used in install-cross.
--gcc_tooldir = @gcc_tooldir@
-+#gcc_tooldir = @gcc_tooldir@
-+gcc_tooldir = $(prefix)/$(target_alias)
- # Since tooldir does not exist at build-time, use -B$(build_tooldir)/bin/
- build_tooldir = $(exec_prefix)/$(target_alias)
- # Directory in which the compiler finds g++ includes.
-@@ -815,7 +816,7 @@ $(srcdir)/configure: $(srcdir)/configure
- # ??? Newer versions have a maintainer mode that may be useful here.
- $(srcdir)/config.in: $(srcdir)/cstamp-h.in
- $(srcdir)/cstamp-h.in: $(srcdir)/configure.in $(srcdir)/acconfig.h
-- cd $(srcdir) && autoheader
-+ cd $(srcdir) && $(AUTOHEADER)
- @rm -f $(srcdir)/cstamp-h.in
- echo timestamp > $(srcdir)/cstamp-h.in
- auto-host.h: cstamp-h ; @true
diff --git a/cross/i386-netbsdpe/patches/patch-pe b/cross/i386-netbsdpe/patches/patch-pe
index dadb3efbd78..333ef74499e 100644
--- a/cross/i386-netbsdpe/patches/patch-pe
+++ b/cross/i386-netbsdpe/patches/patch-pe
@@ -1,543 +1,71 @@
-$NetBSD: patch-pe,v 1.2 2001/03/01 05:59:47 minoura Exp $
+$NetBSD: patch-pe,v 1.3 2004/03/09 12:19:12 kent Exp $
---- /dev/null Fri Jan 26 01:33:46 2001
-+++ gcc/config/i386/netbsd-pe.h
-@@ -0,0 +1,538 @@
-+/* Operating system specific defines to be used when targeting GCC for
-+ hosting on Windows NT 3.x, using a Unix style C library and tools,
-+ as distinct from winnt.h, which is used to build GCC for use with a
-+ windows style library and tool set and uses the Microsoft tools.
-+ Copyright (C) 1995, 1996, 1997, 1998, 1999 Free Software Foundation, Inc.
-+
-+This file is part of GNU CC.
-+
-+GNU CC is free software; you can redistribute it and/or modify
-+it under the terms of the GNU General Public License as published by
-+the Free Software Foundation; either version 2, or (at your option)
-+any later version.
-+
-+GNU CC is distributed in the hope that it will be useful,
-+but WITHOUT ANY WARRANTY; without even the implied warranty of
-+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-+GNU General Public License for more details.
-+
-+You should have received a copy of the GNU General Public License
-+along with GNU CC; see the file COPYING. If not, write to
-+the Free Software Foundation, 59 Temple Place - Suite 330,
-+Boston, MA 02111-1307, USA. */
-+
-+#define YES_UNDERSCORES
-+
-+#define BIGGEST_FIELD_ALIGNMENT 32
-+
-+#define DBX_DEBUGGING_INFO
-+#define SDB_DEBUGGING_INFO
-+#define PREFERRED_DEBUGGING_TYPE DBX_DEBUG
-+
-+#include "i386/gas.h"
-+#include "dbxcoff.h"
-+
-+/* Augment TARGET_SWITCHES with the cygwin/no-cygwin options. */
-+/*#define MASK_WIN32 0x40000000 Use -lming32 interface */
-+/*#define MASK_CYGWIN 0x20000000 Use -lcygwin interface */
-+#define MASK_WINDOWS 0x10000000 /* Use windows interface */
-+#define MASK_DLL 0x08000000 /* Use dll interface */
-+#define MASK_NOP_FUN_DLLIMPORT 0x20000 /* Ignore dllimport for functions */
-+
-+/*#define TARGET_WIN32 (target_flags & MASK_WIN32)*/
-+/*#define TARGET_CYGWIN (target_flags & MASK_CYGWIN)*/
-+#define TARGET_WINDOWS (target_flags & MASK_WINDOWS)
-+#define TARGET_DLL (target_flags & MASK_DLL)
-+#define TARGET_NOP_FUN_DLLIMPORT (target_flags & MASK_NOP_FUN_DLLIMPORT)
-+
-+#undef SUBTARGET_SWITCHES
-+#define SUBTARGET_SWITCHES \
-+/*{ "cygwin", MASK_CYGWIN, "Use the Cygwin interface" },*/ \
-+/*{ "no-cygwin", MASK_WIN32, "Use the Mingw32 interface" }, */\
-+{ "windows", MASK_WINDOWS, "Create GUI application" }, \
-+{ "console", -MASK_WINDOWS, "Create console application" }, \
-+{ "dll", MASK_DLL, "Generate code for a DLL" }, \
-+{ "nop-fun-dllimport", MASK_NOP_FUN_DLLIMPORT, "Ignore dllimport for functions" }, \
-+{ "no-nop-fun-dllimport", -MASK_NOP_FUN_DLLIMPORT, "" }, \
-+/*{ "threads", 0, "Use Mingw-specific thread support" },*/
-+
-+
-+/* Support the __declspec keyword by turning them into attributes.
-+ We currently only support: dllimport and dllexport.
-+ Note that the current way we do this may result in a collision with
-+ predefined attributes later on. This can be solved by using one attribute,
-+ say __declspec__, and passing args to it. The problem with that approach
-+ is that args are not accumulated: each new appearance would clobber any
-+ existing args. */
-+
-+#ifdef CPP_PREDEFINES
-+#undef CPP_PREDEFINES
-+#endif
-+
-+#define CPP_PREDEFINES "-Di386 -D__PEACE__ -D__CYGWIN32__ \
-+ -D_X86_=1 -D__STDC__=1\
-+ -D__stdcall=__attribute__((__stdcall__)) \
-+ -D__cdecl=__attribute__((__cdecl__)) \
-+ -D__declspec(x)=__attribute__((x)) \
-+ -Asystem(winnt) -Acpu(i386) -Amachine(i386)"
-+
-+/* Normally, -lgcc is not needed since everything in it is in the DLL, but we
-+ want to allow things to be added to it when installing new versions of
-+ GCC without making a new CYGWIN.DLL, so we leave it. Profiling is handled
-+ by calling the init function from the prologue. */
-+
-+#undef STARTFILE_SPEC
+--- gcc/config/i386/netbsdpe.h.orig 2003-11-03 05:34:46.000000000 +0900
++++ gcc/config/i386/netbsdpe.h
+@@ -21,16 +21,11 @@ the Free Software Foundation, 59 Temple
+ Boston, MA 02111-1307, USA. */
+
+ #undef TARGET_VERSION
+-#define TARGET_VERSION fprintf (stderr, " (x86 MinGW)");
++#define TARGET_VERSION fprintf (stderr, " (x86 NetBSD-PE)");
+
+ #define EXTRA_OS_CPP_BUILTINS() \
+ do \
+ { \
+- builtin_define ("__MSVCRT__"); \
+- builtin_define ("__MINGW32__"); \
+- builtin_define ("_WIN32"); \
+- builtin_define_std ("WIN32"); \
+- builtin_define_std ("WINNT"); \
+ } \
+ while (0)
+
+@@ -41,15 +36,19 @@ Boston, MA 02111-1307, USA. */
+ #define STANDARD_INCLUDE_DIR "/mingw/include"
+ #undef STANDARD_INCLUDE_COMPONENT
+ #define STANDARD_INCLUDE_COMPONENT "MINGW"
++#undef GPLUSPLUS_INCLUDE_DIR
++#define GPLUSPLUS_INCLUDE_DIR "/usr/include/g++"
+
+ #undef CPP_SPEC
+-#define CPP_SPEC "%{posix:-D_POSIX_SOURCE} %{mthreads:-D_MT}"
++#define CPP_SPEC "%{posix:-D_POSIX_SOURCE} %{mthreads:-D_MT} \
++%{!mwindows:-D__NetBSD__ -D__PECOFF__ -D__NetBSDPE__} \
++%{mwindows:-D_WIN32 -DWINNT} -idirafter /usr/include"
+
+ /* For Windows applications, include more libraries, but always include
+ kernel32. */
+ #undef LIB_SPEC
+-#define LIB_SPEC "%{pg:-lgmon} %{mwindows:-lgdi32 -lcomdlg32} \
+- -luser32 -lkernel32 -ladvapi32 -lshell32"
++#define LIB_SPEC "%{pg:-lgmon} %{mwindows:-lgdi32 -lcomdlg32 -luser32 -ladvapi32 -lshell32} \
++ -lkernel32 -lpthread -lc %{mdll:-lpeasu}"
+
+ /* Include in the mingw32 libraries with libgcc */
+ #undef LINK_SPEC
+@@ -62,15 +61,13 @@ Boston, MA 02111-1307, USA. */
+
+ /* Include in the mingw32 libraries with libgcc */
+ #undef LIBGCC_SPEC
+-#define LIBGCC_SPEC \
+- "%{mthreads:-lmingwthrd} -lmingw32 -lgcc -lmoldname -lmingwex -lmsvcrt"
++#define LIBGCC_SPEC "-lgcc"
+
+ #undef STARTFILE_SPEC
+-#define STARTFILE_SPEC "%{shared|mdll:dllcrt2%O%s} \
+- %{!shared:%{!mdll:crt2%O%s}} %{pg:gcrt2%O%s} %{!fno-exceptions:crtbegin%O%s}"
+#define STARTFILE_SPEC "%{mdll:crt0dll%O%s} %{!mdll: %{!mwindows:crt0%O%s} %{mwindows:crt0win%O%s}}"
-+
-+
-+
-+#undef CPP_SPEC
-+#define CPP_SPEC "-remap %(cpp_cpu) %{posix:-D_POSIX_SOURCE} \
-+ %{!mwindows:-D__NetBSD__ -D__PECOFF__ -D__NetBSDPE__} \
-+ %{mwindows:-D_WIN32 -DWINNT}"
-+
-+/* This macro defines names of additional specifications to put in the specs
-+ that can be used in various specifications like CC1_SPEC. Its definition
-+ is an initializer with a subgrouping for each command option.
-+
-+ Each subgrouping contains a string constant, that defines the
-+ specification name, and a string constant that used by the GNU CC driver
-+ program.
-+
-+ Do not define this macro if it does not need to do anything. */
-+
-+/*#undef SUBTARGET_EXTRA_SPECS
-+#define SUBTARGET_EXTRA_SPECS \
-+ { "mingw_include_path", DEFAULT_TARGET_MACHINE }*/
-+
-+/* We have to dynamic link to get to the system DLLs. All of libc, libm and
-+ the Unix stuff is in cygwin.dll. The import library is called
-+ 'libcygwin.a'. For Windows applications, include more libraries, but
-+ always include kernel32. We'd like to specific subsystem windows to
-+ ld, but that doesn't work just yet. */
-+
-+#undef LIB_SPEC
-+#define LIB_SPEC "-lkernel32 %{mwindows:-luser32 -lgdi32 -lcomdlg32 -ladvapi32 -lshell32 -lm} \
-+ -lpthread -lc %{mdll:-lpeasu}"
-+
-+
-+#define LINK_SPEC "%{mwindows:--subsystem windows} %{mconsole:--subsystem console} \
-+ %{mdll:--dll -e _DllMainCRTStartup@12 --file-alignment 0x1000}"
-+
-+
-+
-+#define SIZE_TYPE "unsigned int"
-+#define PTRDIFF_TYPE "int"
-+#define WCHAR_UNSIGNED 1
-+#define WCHAR_TYPE_SIZE 16
-+#define WCHAR_TYPE "short unsigned int"
-+
-+#define HAVE_ATEXIT 1
-+
-+
-+/* Enable parsing of #pragma pack(push,<n>) and #pragma pack(pop). */
-+#define HANDLE_PRAGMA_PACK_PUSH_POP 1
-+
-+/* A C expression whose value is nonzero if IDENTIFIER with arguments ARGS
-+ is a valid machine specific attribute for DECL.
-+ The attributes in ATTRIBUTES have previously been assigned to DECL. */
-+extern int i386_pe_valid_decl_attribute_p ();
-+
-+#undef VALID_MACHINE_DECL_ATTRIBUTE
-+#define VALID_MACHINE_DECL_ATTRIBUTE(DECL, ATTRIBUTES, IDENTIFIER, ARGS) \
-+ i386_pe_valid_decl_attribute_p (DECL, ATTRIBUTES, IDENTIFIER, ARGS)
-+
-+/* A C expression whose value is nonzero if IDENTIFIER with arguments ARGS
-+ is a valid machine specific attribute for TYPE.
-+ The attributes in ATTRIBUTES have previously been assigned to TYPE. */
-+
-+#undef VALID_MACHINE_TYPE_ATTRIBUTE
-+#define VALID_MACHINE_TYPE_ATTRIBUTE(TYPE, ATTRIBUTES, IDENTIFIER, ARGS) \
-+ i386_pe_valid_type_attribute_p (TYPE, ATTRIBUTES, IDENTIFIER, ARGS)
-+extern int i386_pe_valid_type_attribute_p ();
-+
-+extern union tree_node *i386_pe_merge_decl_attributes ();
-+#define MERGE_MACHINE_DECL_ATTRIBUTES(OLD, NEW) \
-+ i386_pe_merge_decl_attributes ((OLD), (NEW))
-+
-+/* Used to implement dllexport overriding dllimport semantics. It's also used
-+ to handle vtables - the first pass won't do anything because
-+ DECL_CONTEXT (DECL) will be 0 so i386_pe_dll{ex,im}port_p will return 0.
-+ It's also used to handle dllimport override semantics. */
-+#if 0
-+#define REDO_SECTION_INFO_P(DECL) \
-+ ((DECL_MACHINE_ATTRIBUTES (DECL) != NULL_TREE) \
-+ || (TREE_CODE (DECL) == VAR_DECL && DECL_VIRTUAL_P (DECL)))
-+#else
-+#define REDO_SECTION_INFO_P(DECL) 1
-+#endif
-+
-+
-+#undef EXTRA_SECTIONS
-+#define EXTRA_SECTIONS in_ctor, in_dtor, in_drectve
-+
-+#undef EXTRA_SECTION_FUNCTIONS
-+#define EXTRA_SECTION_FUNCTIONS \
-+ CTOR_SECTION_FUNCTION \
-+ DTOR_SECTION_FUNCTION \
-+ DRECTVE_SECTION_FUNCTION \
-+ SWITCH_TO_SECTION_FUNCTION
-+
-+#define CTOR_SECTION_FUNCTION \
-+void \
-+ctor_section () \
-+{ \
-+ if (in_section != in_ctor) \
-+ { \
-+ fprintf (asm_out_file, "\t.section .ctor\n"); \
-+ in_section = in_ctor; \
-+ } \
-+}
-+
-+#define DTOR_SECTION_FUNCTION \
-+void \
-+dtor_section () \
-+{ \
-+ if (in_section != in_dtor) \
-+ { \
-+ fprintf (asm_out_file, "\t.section .dtor\n"); \
-+ in_section = in_dtor; \
-+ } \
-+}
-+
-+#define DRECTVE_SECTION_FUNCTION \
-+void \
-+drectve_section () \
-+{ \
-+ if (in_section != in_drectve) \
-+ { \
-+ fprintf (asm_out_file, "%s\n", "\t.section .drectve\n"); \
-+ in_section = in_drectve; \
-+ } \
-+}
-+
-+/* Switch to SECTION (an `enum in_section').
-+
-+ ??? This facility should be provided by GCC proper.
-+ The problem is that we want to temporarily switch sections in
-+ ASM_DECLARE_OBJECT_NAME and then switch back to the original section
-+ afterwards. */
-+#define SWITCH_TO_SECTION_FUNCTION \
-+void \
-+switch_to_section (section, decl) \
-+ enum in_section section; \
-+ tree decl; \
-+{ \
-+ switch (section) \
-+ { \
-+ case in_text: text_section (); break; \
-+ case in_data: data_section (); break; \
-+ case in_named: named_section (decl, NULL, 0); break; \
-+ case in_ctor: ctor_section (); break; \
-+ case in_dtor: dtor_section (); break; \
-+ case in_drectve: drectve_section (); break; \
-+ default: abort (); break; \
-+ } \
-+}
-+
-+#define ASM_OUTPUT_CONSTRUCTOR(FILE,NAME) \
-+ do { \
-+ ctor_section (); \
-+ fprintf (FILE, "%s\t", ASM_LONG); \
-+ assemble_name (FILE, NAME); \
-+ fprintf (FILE, "\n"); \
-+ } while (0)
-+
-+#define ASM_OUTPUT_DESTRUCTOR(FILE,NAME) \
-+ do { \
-+ dtor_section (); \
-+ fprintf (FILE, "%s\t", ASM_LONG); \
-+ assemble_name (FILE, NAME); \
-+ fprintf (FILE, "\n"); \
-+ } while (0)
-+
-+/* Don't allow flag_pic to propagate since gas may produce invalid code
-+ otherwise. */
-+
-+#undef SUBTARGET_OVERRIDE_OPTIONS
-+#define SUBTARGET_OVERRIDE_OPTIONS \
-+do { \
-+ if (flag_pic) \
-+ { \
-+ warning ("-f%s ignored for target (all code is position independent)",\
-+ (flag_pic > 1) ? "PIC" : "pic"); \
-+ flag_pic = 0; \
-+ } \
-+} while (0) \
-+
-+/* Define this macro if references to a symbol must be treated
-+ differently depending on something about the variable or
-+ function named by the symbol (such as what section it is in).
-+
-+ On i386 running Windows NT, modify the assembler name with a suffix
-+ consisting of an atsign (@) followed by string of digits that represents
-+ the number of bytes of arguments passed to the function, if it has the
-+ attribute STDCALL.
-+
-+ In addition, we must mark dll symbols specially. Definitions of
-+ dllexport'd objects install some info in the .drectve section.
-+ References to dllimport'd objects are fetched indirectly via
-+ _imp__. If both are declared, dllexport overrides. This is also
-+ needed to implement one-only vtables: they go into their own
-+ section and we need to set DECL_SECTION_NAME so we do that here.
-+ Note that we can be called twice on the same decl. */
-+
-+extern void i386_pe_encode_section_info ();
-+
-+#ifdef ENCODE_SECTION_INFO
-+#undef ENCODE_SECTION_INFO
-+#endif
-+#define ENCODE_SECTION_INFO(DECL) i386_pe_encode_section_info (DECL)
-+
-+/* Utility used only in this file. */
-+#define I386_PE_STRIP_ENCODING(SYM_NAME) \
-+ ((SYM_NAME) + ((SYM_NAME)[0] == '@' ? 3 : 0))
-+
-+/* This macro gets just the user-specified name
-+ out of the string in a SYMBOL_REF. Discard
-+ trailing @[NUM] encoded by ENCODE_SECTION_INFO. */
-+#undef STRIP_NAME_ENCODING
-+#define STRIP_NAME_ENCODING(VAR,SYMBOL_NAME) \
-+do { \
-+ char *_p; \
-+ char *_name = I386_PE_STRIP_ENCODING (SYMBOL_NAME); \
-+ for (_p = _name; *_p && *_p != '@'; ++_p) \
-+ ; \
-+ if (*_p == '@') \
-+ { \
-+ int _len = _p - _name; \
-+ (VAR) = (char *) alloca (_len + 1); \
-+ strncpy ((VAR), _name, _len); \
-+ (VAR)[_len] = '\0'; \
-+ } \
-+ else \
-+ (VAR) = _name; \
-+} while (0)
-+
-+
-+/* Output a reference to a label. */
-+#undef ASM_OUTPUT_LABELREF
-+#define ASM_OUTPUT_LABELREF(STREAM, NAME) \
-+ fprintf (STREAM, "%s%s", USER_LABEL_PREFIX, \
-+ I386_PE_STRIP_ENCODING (NAME)) \
-+
-+/* Output a common block. */
-+#undef ASM_OUTPUT_COMMON
-+#define ASM_OUTPUT_COMMON(STREAM, NAME, SIZE, ROUNDED) \
-+do { \
-+ if (i386_pe_dllexport_name_p (NAME)) \
-+ i386_pe_record_exported_symbol (NAME, 1); \
-+ if (! i386_pe_dllimport_name_p (NAME)) \
-+ { \
-+ fprintf ((STREAM), "\t.comm\t"); \
-+ assemble_name ((STREAM), (NAME)); \
-+ fprintf ((STREAM), ", %d\t%s %d\n", \
-+ (ROUNDED), ASM_COMMENT_START, (SIZE)); \
-+ } \
-+} while (0)
-+
-+/* Output the label for an initialized variable. */
-+#undef ASM_DECLARE_OBJECT_NAME
-+#define ASM_DECLARE_OBJECT_NAME(STREAM, NAME, DECL) \
-+do { \
-+ if (i386_pe_dllexport_name_p (NAME)) \
-+ i386_pe_record_exported_symbol (NAME, 1); \
-+ ASM_OUTPUT_LABEL ((STREAM), (NAME)); \
-+} while (0)
-+
-+
-+/* Emit code to check the stack when allocating more that 4000
-+ bytes in one go. */
-+
-+#define CHECK_STACK_LIMIT 4000
-+
-+/* By default, target has a 80387, uses IEEE compatible arithmetic,
-+ and returns float values in the 387 and needs stack probes */
-+#undef TARGET_DEFAULT
-+
-+#define TARGET_DEFAULT \
-+ (MASK_80387 | MASK_IEEE_FP | MASK_FLOAT_RETURNS | MASK_STACK_PROBE)
-+
-+/* This is how to output an assembler line
-+ that says to advance the location counter
-+ to a multiple of 2**LOG bytes. */
-+
-+#undef ASM_OUTPUT_ALIGN
-+#define ASM_OUTPUT_ALIGN(FILE,LOG) \
-+ if ((LOG)!=0) fprintf ((FILE), "\t.align %d\n", 1<<(LOG))
-+
-+/* Define this macro if in some cases global symbols from one translation
-+ unit may not be bound to undefined symbols in another translation unit
-+ without user intervention. For instance, under Microsoft Windows
-+ symbols must be explicitly imported from shared libraries (DLLs). */
-+#define MULTIPLE_SYMBOL_SPACES
-+
-+#define UNIQUE_SECTION_P(DECL) DECL_ONE_ONLY (DECL)
-+extern void i386_pe_unique_section ();
-+#define UNIQUE_SECTION(DECL,RELOC) i386_pe_unique_section (DECL, RELOC)
-+
-+#define SUPPORTS_ONE_ONLY 1
-+
-+/* A C statement to output something to the assembler file to switch to section
-+ NAME for object DECL which is either a FUNCTION_DECL, a VAR_DECL or
-+ NULL_TREE. Some target formats do not support arbitrary sections. Do not
-+ define this macro in such cases. */
-+#undef ASM_OUTPUT_SECTION_NAME
-+#define ASM_OUTPUT_SECTION_NAME(STREAM, DECL, NAME, RELOC) \
-+do { \
-+ static struct section_info \
-+ { \
-+ struct section_info *next; \
-+ char *name; \
-+ enum sect_enum {SECT_RW, SECT_RO, SECT_EXEC} type; \
-+ } *sections; \
-+ struct section_info *s; \
-+ char *mode; \
-+ enum sect_enum type; \
-+ \
-+ for (s = sections; s; s = s->next) \
-+ if (!strcmp (NAME, s->name)) \
-+ break; \
-+ \
-+ if (DECL && TREE_CODE (DECL) == FUNCTION_DECL) \
-+ type = SECT_EXEC, mode = "x"; \
-+ else if (DECL && DECL_READONLY_SECTION (DECL, RELOC)) \
-+ type = SECT_RO, mode = ""; \
-+ else \
-+ { \
-+ type = SECT_RW; \
-+ if (TREE_CODE (DECL) == VAR_DECL \
-+ && lookup_attribute ("shared", DECL_MACHINE_ATTRIBUTES (DECL))) \
-+ mode = "ws"; \
-+ else \
-+ mode = "w"; \
-+ } \
-+ \
-+ if (s == 0) \
-+ { \
-+ s = (struct section_info *) xmalloc (sizeof (struct section_info)); \
-+ s->name = xmalloc ((strlen (NAME) + 1) * sizeof (*NAME)); \
-+ strcpy (s->name, NAME); \
-+ s->type = type; \
-+ s->next = sections; \
-+ sections = s; \
-+ fprintf (STREAM, ".section\t%s,\"%s\"\n", NAME, mode); \
-+ /* Functions may have been compiled at various levels of \
-+ optimization so we can't use `same_size' here. Instead, \
-+ have the linker pick one. */ \
-+ if ((DECL) && DECL_ONE_ONLY (DECL)) \
-+ fprintf (STREAM, "\t.linkonce %s\n", \
-+ TREE_CODE (DECL) == FUNCTION_DECL \
-+ ? "discard" : "same_size"); \
-+ } \
-+ else \
-+ { \
-+ fprintf (STREAM, ".section\t%s,\"%s\"\n", NAME, mode); \
-+ } \
-+} while (0)
-+
-+/* Write the extra assembler code needed to declare a function
-+ properly. If we are generating SDB debugging information, this
-+ will happen automatically, so we only need to handle other cases. */
-+#undef ASM_DECLARE_FUNCTION_NAME
-+#define ASM_DECLARE_FUNCTION_NAME(FILE, NAME, DECL) \
-+ do \
-+ { \
-+ if (i386_pe_dllexport_name_p (NAME)) \
-+ i386_pe_record_exported_symbol (NAME, 0); \
-+ if (write_symbols != SDB_DEBUG) \
-+ i386_pe_declare_function_type (FILE, NAME, TREE_PUBLIC (DECL)); \
-+ ASM_OUTPUT_LABEL (FILE, NAME); \
-+ } \
-+ while (0)
-+
-+/* Add an external function to the list of functions to be declared at
-+ the end of the file. */
-+#define ASM_OUTPUT_EXTERNAL(FILE, DECL, NAME) \
-+ do \
-+ { \
-+ if (TREE_CODE (DECL) == FUNCTION_DECL) \
-+ i386_pe_record_external_function (NAME); \
-+ } \
-+ while (0)
-+
-+/* Declare the type properly for any external libcall. */
-+#define ASM_OUTPUT_EXTERNAL_LIBCALL(FILE, FUN) \
-+ i386_pe_declare_function_type (FILE, XSTR (FUN, 0), 1)
-+
-+/* This says out to put a global symbol in the BSS section. */
-+#undef ASM_OUTPUT_ALIGNED_BSS
-+#define ASM_OUTPUT_ALIGNED_BSS(FILE, DECL, NAME, SIZE, ALIGN) \
-+ asm_output_aligned_bss ((FILE), (DECL), (NAME), (SIZE), (ALIGN))
-+
-+/* Output function declarations at the end of the file. */
-+#define ASM_FILE_END(FILE) \
-+ i386_pe_asm_file_end (FILE)
-+
-+#undef ASM_COMMENT_START
-+#define ASM_COMMENT_START " #"
-+
-+/* DWARF2 Unwinding doesn't work with exception handling yet. */
-+#define DWARF2_UNWIND_INFO 0
-+
-+/* Don't assume anything about the header files. */
-+#define NO_IMPLICIT_EXTERN_C
-+
-+#define SUBTARGET_PROLOGUE \
-+ if (profile_flag \
-+ && strcmp (IDENTIFIER_POINTER (DECL_NAME (current_function_decl)),\
-+ "main") == 0) \
-+ { \
-+ rtx xops[1]; \
-+ xops[0] = gen_rtx_MEM (FUNCTION_MODE, \
-+ gen_rtx (SYMBOL_REF, Pmode, "_monstartup")); \
-+ if (do_rtl) \
-+ emit_call_insn (gen_rtx (CALL, VOIDmode, xops[0], const0_rtx)); \
-+ else \
-+ output_asm_insn (AS1 (call,%P1), xops); \
-+ }
-+
-+/* External function declarations. */
-+
-+#ifndef PROTO
-+#if defined (USE_PROTOTYPES) ? USE_PROTOTYPES : defined (__STDC__)
-+#define PROTO(ARGS) ARGS
-+#else
-+#define PROTO(ARGS) ()
-+#endif
-+#endif
-+
-+#ifdef BUFSIZ /* stdio.h has been included, ok to use FILE * */
-+#define STDIO_PROTO(ARGS) PROTO(ARGS)
-+#else
-+#define STDIO_PROTO(ARGS) ()
-+#endif
-+
-+extern void i386_pe_record_external_function PROTO((char *));
-+extern void i386_pe_declare_function_type STDIO_PROTO((FILE *, char *, int));
-+extern void i386_pe_record_exported_symbol PROTO((char *, int));
-+extern void i386_pe_asm_file_end STDIO_PROTO((FILE *));
-+
-+/* For Win32 ABI compatibility */
-+#undef DEFAULT_PCC_STRUCT_RETURN
-+#define DEFAULT_PCC_STRUCT_RETURN 0
-+
-+/* No data type wants to be aligned rounder than this. */
-+#undef BIGGEST_ALIGNMENT
-+#define BIGGEST_ALIGNMENT 128
-+
-+/* A bitfield declared as `int' forces `int' alignment for the struct. */
-+#undef PCC_BITFIELD_TYPE_MATTERS
-+#define PCC_BITFIELD_TYPE_MATTERS 1
-+#define GROUP_BITFIELDS_BY_ALIGN TYPE_NATIVE(rec)
-+
-+/* Enable alias attribute support. */
-+#ifndef SET_ASM_OP
-+#define SET_ASM_OP "\t.set"
-+#endif
-+
+
+ #undef ENDFILE_SPEC
+-#define ENDFILE_SPEC "%{!fno-exceptions:crtend%O%s}"
++#define ENDFILE_SPEC ""
+
+ /* An additional prefix to try after the standard prefixes. */
+ #undef MD_STARTFILE_PREFIX
+@@ -111,3 +108,6 @@ do { \
+ /* When we are ready for Dwarf2 EH handling */
+ #undef DWARF2_UNWIND_INFO
+ #define DWARF2_UNWIND_INFO 1
++
++#undef BIGGEST_FIELD_ALIGNMENT
++#define BIGGEST_FIELD_ALIGNMENT 32