From b1e693e40281dc8c451e8892dfcdf55d78a4ade3 Mon Sep 17 00:00:00 2001 From: "Yann E. MORIN\"" Date: Sun, 23 Sep 2007 17:08:09 +0000 Subject: Renamed all patches file names so that locales are now irrelevant to sort the files. Removed the locale check as it is now irrelevant. Removed the experimental binutils 2.17.50.0.xx: 2.18 is here now. diff --git a/config/binutils.in b/config/binutils.in index 62855cf..27939db 100644 --- a/config/binutils.in +++ b/config/binutils.in @@ -27,26 +27,6 @@ config BINUTILS_V_2_17 bool prompt "2.17" -config BINUTILS_V_2_17_50_0_10 - bool - prompt "2.17.50.0.10 (EXPERIMENTAL)" - depends on EXPERIMENTAL - -config BINUTILS_V_2_17_50_0_15 - bool - prompt "2.17.50.0.15 (EXPERIMENTAL)" - depends on EXPERIMENTAL - -config BINUTILS_V_2_17_50_0_17 - bool - prompt "2.17.50.0.17 (EXPERIMENTAL)" - depends on EXPERIMENTAL - -config BINUTILS_V_2_17_50_0_18 - bool - prompt "2.17.50.0.18 (EXPERIMENTAL)" - depends on EXPERIMENTAL - config BINUTILS_V_2_18 bool prompt "2.18" @@ -61,10 +41,6 @@ config BINUTILS_VERSION default "2.15" if BINUTILS_V_2_15 default "2.16.1" if BINUTILS_V_2_16_1 default "2.17" if BINUTILS_V_2_17 - default "2.17.50.0.10" if BINUTILS_V_2_17_50_0_10 - default "2.17.50.0.14" if BINUTILS_V_2_17_50_0_14 - default "2.17.50.0.17" if BINUTILS_V_2_17_50_0_17 - default "2.17.50.0.18" if BINUTILS_V_2_17_50_0_18 default "2.18" if BINUTILS_V_2_18 # CT_INSERT_VERSION_STRING_ABOVE # Don't remove above line! diff --git a/patches/binutils/2.14/100-binutils-sh-relocs.patch b/patches/binutils/2.14/100-binutils-sh-relocs.patch new file mode 100644 index 0000000..ca0f2ac --- /dev/null +++ b/patches/binutils/2.14/100-binutils-sh-relocs.patch @@ -0,0 +1,38 @@ +Message-Id: <200307311239.h6VCdNe27056@r-rr.iij4u.or.jp> +To: dank@kegel.com +Cc: kkojima@rr.iij4u.or.jp +Subject: Re: Writing PIC version of __udivsi3_i4? (was: Re: "make tests" fails + with "libc.so: text relocations used" in glibc-2.3.2 for sh4) +In-Reply-To: Your message of "Wed, 30 Jul 2003 21:55:54 -0700" + <3F28A15A.5010400@kegel.com> +References: <3F28A15A.5010400@kegel.com> +Date: Thu, 31 Jul 2003 21:47:38 +0900 +From: kaz Kojima + +Dan Kegel wrote: +>> I'll give binutils-2.14.90.0.5 a shot, then. +> +> No joy - same problem. Guess I'll take this up on binutils and/or libc-alpha. + +Please try the patch below, though it's a diff against the current +binutils CVS. + +Regards, + kaz +-- +diff -u3p ORIG/src/bfd/elf32-sh.c LOCAL/src/bfd/elf32-sh.c +--- src/bfd/elf32-sh.c.old Fri Jul 25 14:46:58 2003 ++++ src/bfd/elf32-sh.c Thu Jul 31 21:09:38 2003 +@@ -6497,8 +6497,10 @@ sh_elf_check_relocs (bfd *abfd, struct b + sreloc, 2)) + return FALSE; + } ++#if 0 + if (sec->flags & SEC_READONLY) + info->flags |= DF_TEXTREL; ++#endif + elf_section_data (sec)->sreloc = sreloc; + } + + + diff --git a/patches/binutils/2.14/binutils-sh-relocs.patch b/patches/binutils/2.14/binutils-sh-relocs.patch deleted file mode 100644 index ca0f2ac..0000000 --- a/patches/binutils/2.14/binutils-sh-relocs.patch +++ /dev/null @@ -1,38 +0,0 @@ -Message-Id: <200307311239.h6VCdNe27056@r-rr.iij4u.or.jp> -To: dank@kegel.com -Cc: kkojima@rr.iij4u.or.jp -Subject: Re: Writing PIC version of __udivsi3_i4? (was: Re: "make tests" fails - with "libc.so: text relocations used" in glibc-2.3.2 for sh4) -In-Reply-To: Your message of "Wed, 30 Jul 2003 21:55:54 -0700" - <3F28A15A.5010400@kegel.com> -References: <3F28A15A.5010400@kegel.com> -Date: Thu, 31 Jul 2003 21:47:38 +0900 -From: kaz Kojima - -Dan Kegel wrote: ->> I'll give binutils-2.14.90.0.5 a shot, then. -> -> No joy - same problem. Guess I'll take this up on binutils and/or libc-alpha. - -Please try the patch below, though it's a diff against the current -binutils CVS. - -Regards, - kaz --- -diff -u3p ORIG/src/bfd/elf32-sh.c LOCAL/src/bfd/elf32-sh.c ---- src/bfd/elf32-sh.c.old Fri Jul 25 14:46:58 2003 -+++ src/bfd/elf32-sh.c Thu Jul 31 21:09:38 2003 -@@ -6497,8 +6497,10 @@ sh_elf_check_relocs (bfd *abfd, struct b - sreloc, 2)) - return FALSE; - } -+#if 0 - if (sec->flags & SEC_READONLY) - info->flags |= DF_TEXTREL; -+#endif - elf_section_data (sec)->sreloc = sreloc; - } - - - diff --git a/patches/binutils/2.15/700-bfd-hash-tweak.patch b/patches/binutils/2.15/700-bfd-hash-tweak.patch new file mode 100644 index 0000000..6b8fc41 --- /dev/null +++ b/patches/binutils/2.15/700-bfd-hash-tweak.patch @@ -0,0 +1,24 @@ +Signed-off-by: dank@kegel.com + +Raising the size of the hash table is a noticable win when linking +at least one large app. + +There was a patch, +http://sources.redhat.com/ml/binutils/2004-06/msg00165.html +to do this dynamically. No idea why that didn't make it in. +So this tiny change to raise the default size is just +a stopgap for now. + + +--- binutils-2.15/bfd/hash.c.old 2003-12-01 01:33:01.000000000 -0500 ++++ binutils-2.15/bfd/hash.c 2006-03-01 16:26:26.701991000 -0500 +@@ -295,7 +295,7 @@ + */ + + /* The default number of entries to use when creating a hash table. */ +-#define DEFAULT_SIZE (4051) ++#define DEFAULT_SIZE (32749) + + /* Create a new hash table, given a number of entries. */ + + diff --git a/patches/binutils/2.15/710-binutils-2.15-allow-gcc-4.0.patch b/patches/binutils/2.15/710-binutils-2.15-allow-gcc-4.0.patch new file mode 100644 index 0000000..26e5a12 --- /dev/null +++ b/patches/binutils/2.15/710-binutils-2.15-allow-gcc-4.0.patch @@ -0,0 +1,75 @@ +Fix found here: http://www.freelists.org/archives/openbeos/11-2005/msg00090.html + +Fixes: +In file included from ./targ-cpu.h:1, + from /home/dank/crosstool-new/build/i686-unknown-linux-gnu/gcc-2.95.3-glibc-2.2.2/binutils-2.15/gas/config/obj-elf.h:42, + from ./obj-format.h:1, + from /home/dank/crosstool-new/build/i686-unknown-linux-gnu/gcc-2.95.3-glibc-2.2.2/binutils-2.15/gas/config/te-linux.h:4, + from ./targ-env.h:1, + from /home/dank/crosstool-new/build/i686-unknown-linux-gnu/gcc-2.95.3-glibc-2.2.2/binutils-2.15/gas/as.h:626, + from /home/dank/crosstool-new/build/i686-unknown-linux-gnu/gcc-2.95.3-glibc-2.2.2/binutils-2.15/gas/app.c:30: +/home/dank/crosstool-new/build/i686-unknown-linux-gnu/gcc-2.95.3-glibc-2.2.2/binutils-2.15/gas/config/tc-i386.h:451: error: array type has incomplete element type +make[3]: *** [app.o] Error 1 +make[3]: Leaving directory `/home/dank/crosstool-new/build/i686-unknown-linux-gnu/gcc-2.95.3-glibc-2.2.2/build-binutils/gas' + +when building binutils-2.15 with gcc-4.0 + + +diff -ur binutils-2.15.old/gas/as.h binutils-2.15/gas/as.h +--- binutils-2.15.old/gas/as.h 2003-11-22 18:14:21.000000000 -0800 ++++ binutils-2.15/gas/as.h 2006-02-14 22:05:35.000000000 -0800 +@@ -605,7 +605,26 @@ + struct expressionS; + struct fix; + typedef struct symbol symbolS; +-struct relax_type; ++ ++/* JF moved this here from as.h under the theory that nobody except MACHINE.c ++ and write.c care about it anyway. */ ++/* [zooey]: the above no longer holds with gcc4, as it keeps bugging about ++ incomplete element types in arrays, if relax_type isn't defined ++ here. So I moved the definition back from tc.h to here. */ ++struct relax_type ++{ ++ /* Forward reach. Signed number. > 0. */ ++ long rlx_forward; ++ /* Backward reach. Signed number. < 0. */ ++ long rlx_backward; ++ ++ /* Bytes length of this address. */ ++ unsigned char rlx_length; ++ ++ /* Next longer relax-state. 0 means there is no 'next' relax-state. */ ++ relax_substateT rlx_more; ++}; ++ + typedef struct frag fragS; + + #ifdef BFD_ASSEMBLER +diff -ur binutils-2.15.old/gas/tc.h binutils-2.15/gas/tc.h +--- binutils-2.15.old/gas/tc.h 2003-12-03 15:39:38.000000000 -0800 ++++ binutils-2.15/gas/tc.h 2006-02-14 22:03:35.000000000 -0800 +@@ -24,23 +24,6 @@ + + extern const pseudo_typeS md_pseudo_table[]; + +-/* JF moved this here from as.h under the theory that nobody except MACHINE.c +- and write.c care about it anyway. */ +- +-struct relax_type +-{ +- /* Forward reach. Signed number. > 0. */ +- long rlx_forward; +- /* Backward reach. Signed number. < 0. */ +- long rlx_backward; +- +- /* Bytes length of this address. */ +- unsigned char rlx_length; +- +- /* Next longer relax-state. 0 means there is no 'next' relax-state. */ +- relax_substateT rlx_more; +-}; +- + typedef struct relax_type relax_typeS; + + extern const int md_reloc_size; /* Size of a relocation record */ diff --git a/patches/binutils/2.15/720-binutils-2.15-psignal.patch b/patches/binutils/2.15/720-binutils-2.15-psignal.patch new file mode 100644 index 0000000..98fa600 --- /dev/null +++ b/patches/binutils/2.15/720-binutils-2.15-psignal.patch @@ -0,0 +1,40 @@ +Make psignal prototype in libiberty match that in glibc. + +Fixes: + +gcc-2.95.3-glibc-2.1.3/binutils-2.15/libiberty/strsignal.c: In function `psignal': +gcc-2.95.3-glibc-2.1.3/binutils-2.15/libiberty/strsignal.c:563: argument `signo' doesn't match prototype +/usr/include/signal.h:131: prototype declaration +gcc-2.95.3-glibc-2.1.3/binutils-2.15/libiberty/strsignal.c:563: argument `message' doesn't match prototype +/usr/include/signal.h:131: prototype declaration +gcc-2.95.3-glibc-2.1.3/binutils-2.15/libiberty/strsignal.c:568: warning: comparison between signed and unsigned +mprotect... make[1]: *** [strsignal.o] Error 1 +make[1]: Leaving directory `/export/hda3/dkegel/queue/jobdir.produser_cpsm17/crosstool-0.32/build/i686-unknown-linux-gnu/gcc-2.95.3-glibc-2.1.3/build-binutils/libiberty' +make: *** [all-libiberty] Error 2 + +when building on red hat 7.1 +though it's a bit of a mystery why libiberty's psignal is being compiled at +all, since red hat 7.1's glibc supports psignal (hence the error message) + +--- binutils-2.15/libiberty/strsignal.c.old 2005-04-18 13:57:40.000000000 -0700 ++++ binutils-2.15/libiberty/strsignal.c 2005-04-18 13:59:09.000000000 -0700 +@@ -544,7 +544,7 @@ + + /* + +-@deftypefn Supplemental void psignal (unsigned @var{signo}, char *@var{message}) ++@deftypefn Supplemental void psignal (int @var{signo}, const char *@var{message}) + + Print @var{message} to the standard error, followed by a colon, + followed by the description of the signal specified by @var{signo}, +@@ -557,9 +557,7 @@ + #ifndef HAVE_PSIGNAL + + void +-psignal (signo, message) +- unsigned signo; +- char *message; ++psignal (int signo, const char *message) + { + if (signal_names == NULL) + { diff --git a/patches/binutils/2.15/730-binutils-2.15-solaris-qsort.patch b/patches/binutils/2.15/730-binutils-2.15-solaris-qsort.patch new file mode 100644 index 0000000..5fe3623 --- /dev/null +++ b/patches/binutils/2.15/730-binutils-2.15-solaris-qsort.patch @@ -0,0 +1,22 @@ +See http://sources.redhat.com/ml/binutils/2004-06/msg00114.html + +--- src/bfd/elflink.c.org 2004-07-05 09:11:42.920597000 -0400 ++++ src/bfd/elflink.c 2004-07-05 09:12:59.240847000 -0400 +@@ -2700,7 +2700,7 @@ + return vdiff > 0 ? 1 : -1; + else + { +- long sdiff = h1->root.u.def.section - h2->root.u.def.section; ++ long sdiff = h1->root.u.def.section->id - h2->root.u.def.section->id; + if (sdiff != 0) + return sdiff > 0 ? 1 : -1; + } +@@ -3954,7 +3954,7 @@ + i = idx + 1; + else + { +- long sdiff = slook - h->root.u.def.section; ++ long sdiff = slook->id - h->root.u.def.section->id; + if (sdiff < 0) + j = idx; + else if (sdiff > 0) diff --git a/patches/binutils/2.15/740-binutils-2.15-vmx.patch b/patches/binutils/2.15/740-binutils-2.15-vmx.patch new file mode 100644 index 0000000..5ae9efe --- /dev/null +++ b/patches/binutils/2.15/740-binutils-2.15-vmx.patch @@ -0,0 +1,45 @@ +Grabbed with +wget 'http://sources.redhat.com/cgi-bin/cvsweb.cgi/src/opcodes/ppc-opc.c.diff?r1=1.70&r2=1.71&cvsroot=src' +See +http://mail.gnu.org/archive/html/bug-binutils/2004-05/msg00071.html +and +http://sources.redhat.com/ml/binutils-cvs/2004-05/msg00111.html + +This fixes problems like +{standard input}: Assembler messages: +{standard input}:1: Error: Unrecognized opcode: `dssall' +which show up in binutils-2.15 when building the Linux kernel, +or possibly failed compilations when building setjmp/longjmp in glibc. + +An alternative fix would be to pass -many to the assembler. +A patch to do that for glibc is at +wget 'http://sources.redhat.com/cgi-bin/get-raw-msg?listname=libc-alpha&date=2004-05&msgid=40B36E8C.9030609%40us.ibm.com' +Yet another, better, fix would be for gcc to generate assembly +that told the assembler which processor type to use. +Presumably the Linux kernel sources would need a fix, too. +Probably better to just fix binutils to accept sources that it used to. + + +=================================================================== +RCS file: /cvs/src/src/opcodes/ppc-opc.c,v +retrieving revision 1.70 +retrieving revision 1.71 +diff -u -r1.70 -r1.71 +--- src/opcodes/ppc-opc.c 2004/05/05 13:43:36 1.70 ++++ src/opcodes/ppc-opc.c 2004/05/19 05:11:48 1.71 +@@ -1004,8 +1004,13 @@ + + /* If only one bit of the FXM field is set, we can use the new form + of the instruction, which is faster. Unlike the Power4 branch hint +- encoding, this is not backward compatible. */ +- else if ((dialect & PPC_OPCODE_POWER4) != 0 && (value & -value) == value) ++ encoding, this is not backward compatible. Do not generate the ++ new form unless -mpower4 has been given, or -many and the two ++ operand form of mfcr was used. */ ++ else if ((value & -value) == value ++ && ((dialect & PPC_OPCODE_POWER4) != 0 ++ || ((dialect & PPC_OPCODE_ANY) != 0 ++ && (insn & (0x3ff << 1)) == 19 << 1))) + insn |= 1 << 20; + + /* Any other value on mfcr is an error. */ diff --git a/patches/binutils/2.15/750-binutils-arm-undef-imm.patch b/patches/binutils/2.15/750-binutils-arm-undef-imm.patch new file mode 100644 index 0000000..6bf403c --- /dev/null +++ b/patches/binutils/2.15/750-binutils-arm-undef-imm.patch @@ -0,0 +1,51 @@ +From http://sources.redhat.com/cgi-bin/cvsweb.cgi/src/gas/config/tc-arm.c.diff?r1=1.168&r2=1.169&cvsroot=src +See also http://lists.arm.linux.org.uk/pipermail/linux-arm-kernel/2004-July/023128.html, +"[CRITICAL PATCH] 2.6: fix silent build error]" + +Revision 1.169, Fri Jul 2 11:12:29 2004 UTC (19 hours, 4 minutes ago) by nickc +Branch: MAIN +CVS Tags: binutils_latest_snapshot, HEAD +Changes since 1.168: +14 -1 lines + +(md_apply_fix3:BFD_RELOC_ARM_IMMEDIATE): Do not allow values which have come +from undefined symbols. +Always consider this fixup to have been processed as a reloc cannot be +generated for it. + + +=================================================================== +RCS file: /cvs/src/src/gas/config/tc-arm.c,v +retrieving revision 1.168 +retrieving revision 1.169 +diff -u -r1.168 -r1.169 +--- src/gas/config/tc-arm.c 2004/04/30 10:51:12 1.168 ++++ src/gas/config/tc-arm.c 2004/07/02 11:12:29 1.169 +@@ -12186,6 +12186,20 @@ + switch (fixP->fx_r_type) + { + case BFD_RELOC_ARM_IMMEDIATE: ++ /* We claim that this fixup has been processed here, ++ even if in fact we generate an error because we do ++ not have a reloc for it, so tc_gen_reloc will reject it. */ ++ fixP->fx_done = 1; ++ ++ if (fixP->fx_addsy ++ && ! S_IS_DEFINED (fixP->fx_addsy)) ++ { ++ as_bad_where (fixP->fx_file, fixP->fx_line, ++ _("undefined symbol %s used as an immediate value"), ++ S_GET_NAME (fixP->fx_addsy)); ++ break; ++ } ++ + newimm = validate_immediate (value); + temp = md_chars_to_number (buf, INSN_SIZE); + +@@ -12202,7 +12216,6 @@ + + newimm |= (temp & 0xfffff000); + md_number_to_chars (buf, (valueT) newimm, INSN_SIZE); +- fixP->fx_done = 1; + break; + + case BFD_RELOC_ARM_ADRL_IMMEDIATE: diff --git a/patches/binutils/2.15/760-binutils-skip-comments.patch b/patches/binutils/2.15/760-binutils-skip-comments.patch new file mode 100644 index 0000000..804a17e --- /dev/null +++ b/patches/binutils/2.15/760-binutils-skip-comments.patch @@ -0,0 +1,101 @@ +Retrieved from http://sources.redhat.com/ml/binutils/2004-04/msg00646.html +Fixes +localealias.s:544: Error: junk at end of line, first unrecognized character is `,' +when building glibc-2.3.2 with gcc-3.4.0 and binutils-2.15.90.0.3 + +Paths adjusted to match crosstool's patcher. + +Message-Id: m3n052qw2g.fsf@whitebox.m5r.de +From: Andreas Schwab +To: Nathan Sidwell +Cc: Ian Lance Taylor , binutils at sources dot redhat dot com +Date: Fri, 23 Apr 2004 22:27:19 +0200 +Subject: Re: demand_empty_rest_of_line and ignore_rest_of_line + +Nathan Sidwell writes: + +> Index: read.c +> =================================================================== +> RCS file: /cvs/src/src/gas/read.c,v +> retrieving revision 1.76 +> diff -c -3 -p -r1.76 read.c +> *** read.c 12 Mar 2004 17:48:12 -0000 1.76 +> --- read.c 18 Mar 2004 09:56:05 -0000 +> *************** read_a_source_file (char *name) +> *** 1053,1059 **** +> #endif +> input_line_pointer--; +> /* Report unknown char as ignored. */ +> ! ignore_rest_of_line (); +> } +> +> #ifdef md_after_pass_hook +> --- 1053,1059 ---- +> #endif +> input_line_pointer--; +> /* Report unknown char as ignored. */ +> ! demand_empty_rest_of_line (); +> } +> +> #ifdef md_after_pass_hook + +This means that the unknown character is no longer ignored, despite the +comment. As a side effect a line starting with a line comment character +not followed by APP in NO_APP mode now triggers an error instead of just a +warning, breaking builds of glibc on m68k-linux. Earlier in +read_a_source_file where #APP is handled there is another comment that +claims that unknown comments are ignored, when in fact they aren't (only +the initial line comment character is skipped). + +Note that the presence of #APP will mess up the line counters, but +that appears to be difficult to fix. + +Andreas. + +2004-04-23 Andreas Schwab + + * read.c (read_a_source_file): Ignore unknown text after line + comment character. Fix misleading comment. + +--- binutils/gas/read.c.~1.78.~ 2004-04-23 08:58:23.000000000 +0200 ++++ binutils/gas/read.c 2004-04-23 21:49:01.000000000 +0200 +@@ -1,6 +1,6 @@ + /* read.c - read a source file - + Copyright 1986, 1987, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, +- 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. ++ 1998, 1999, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. + + This file is part of GAS, the GNU Assembler. + +@@ -950,10 +950,14 @@ read_a_source_file (char *name) + unsigned int new_length; + char *tmp_buf = 0; + +- bump_line_counters (); + s = input_line_pointer; + if (strncmp (s, "APP\n", 4)) +- continue; /* We ignore it */ ++ { ++ /* We ignore it */ ++ ignore_rest_of_line (); ++ continue; ++ } ++ bump_line_counters (); + s += 4; + + sb_new (&sbuf); +@@ -1052,7 +1056,7 @@ read_a_source_file (char *name) + continue; + #endif + input_line_pointer--; +- /* Report unknown char as ignored. */ ++ /* Report unknown char as error. */ + demand_empty_rest_of_line (); + } + + +-- +Andreas Schwab, SuSE Labs, schwab@suse.de +SuSE Linux AG, MaxfeldstraÃe 5, 90409 NÃrnberg, Germany +Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 +"And now for something completely different." diff --git a/patches/binutils/2.15/770-cross-gprof.patch b/patches/binutils/2.15/770-cross-gprof.patch new file mode 100644 index 0000000..ea6c18f --- /dev/null +++ b/patches/binutils/2.15/770-cross-gprof.patch @@ -0,0 +1,22 @@ +--- binutils-2.15/configure.old 2004-07-21 21:36:47.000000000 -0700 ++++ binutils-2.15/configure 2004-07-21 21:37:08.000000000 -0700 +@@ -999,7 +999,7 @@ + + # Some tools are only suitable for building in a "native" situation. + # Remove these if host!=target. +-native_only="autoconf automake libtool fileutils find gawk gettext gzip hello indent m4 rcs recode sed shellutils tar textutils uudecode wdiff gprof target-groff guile perl time ash bash bzip2 prms gnuserv target-gperf" ++native_only="autoconf automake libtool fileutils find gawk gettext gzip hello indent m4 rcs recode sed shellutils tar textutils uudecode wdiff target-groff guile perl time ash bash bzip2 prms gnuserv target-gperf" + + # Similarly, some are only suitable for cross toolchains. + # Remove these if host=target. +--- binutils-2.15/configure.in.old 2004-07-21 21:37:19.000000000 -0700 ++++ binutils-2.15/configure.in 2004-07-21 21:37:34.000000000 -0700 +@@ -236,7 +236,7 @@ + + # Some tools are only suitable for building in a "native" situation. + # Remove these if host!=target. +-native_only="autoconf automake libtool fileutils find gawk gettext gzip hello indent m4 rcs recode sed shellutils tar textutils uudecode wdiff gprof target-groff guile perl time ash bash bzip2 prms gnuserv target-gperf" ++native_only="autoconf automake libtool fileutils find gawk gettext gzip hello indent m4 rcs recode sed shellutils tar textutils uudecode wdiff target-groff guile perl time ash bash bzip2 prms gnuserv target-gperf" + + # Similarly, some are only suitable for cross toolchains. + # Remove these if host=target. diff --git a/patches/binutils/2.15/780-gccpr15247-fix.patch b/patches/binutils/2.15/780-gccpr15247-fix.patch new file mode 100644 index 0000000..967bf7f --- /dev/null +++ b/patches/binutils/2.15/780-gccpr15247-fix.patch @@ -0,0 +1,192 @@ +See +http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15247 + +Fixes spurious error +/tmp/ccvNi4ou.s: Assembler messages: +/tmp/ccvNi4ou.s:2310: Error: Illegal operands: There are only 32 single precision f registers; [0-31] +make[2]: *** [/home/dank/wk/crosstool-0.28-rc10/build/sparc64-unknown-linux-gnu/gcc-3.4.0-glibc-2.3.2/build-glibc/math/dosincos.o] Error 1 + +when compiling glibc's dosincos.c with gcc-3.4.0 + +=================================================================== +RCS file: /cvs/src/src/opcodes/sparc-opc.c,v +retrieving revision 1.9 +retrieving revision 1.10 +diff -u -r1.9 -r1.10 +--- src/opcodes/sparc-opc.c 2004/01/18 23:46:32 1.9 ++++ src/opcodes/sparc-opc.c 2004/04/20 10:23:51 1.10 +@@ -1273,110 +1273,72 @@ + #define FM_DF 2 /* v9 */ + #define FM_QF 3 /* v9 */ + +-#define fmovicc(opcode, fpsize, cond, flags) /* v9 */ \ +-{ opcode, F3F(2, 0x35, 0x100+fpsize)|MCOND(cond,0), F3F(~2, ~0x35, ~(0x100+fpsize))|MCOND(~cond,~0), "z,f,g", flags, v9 }, \ +-{ opcode, F3F(2, 0x35, 0x180+fpsize)|MCOND(cond,0), F3F(~2, ~0x35, ~(0x180+fpsize))|MCOND(~cond,~0), "Z,f,g", flags, v9 } +- +-#define fmovfcc(opcode, fpsize, fcond, flags) /* v9 */ \ +-{ opcode, F3F(2, 0x35, 0x000+fpsize)|MCOND(fcond,0), F3F(~2, ~0x35, ~(0x000+fpsize))|MCOND(~fcond,~0), "6,f,g", flags, v9 }, \ +-{ opcode, F3F(2, 0x35, 0x040+fpsize)|MCOND(fcond,0), F3F(~2, ~0x35, ~(0x040+fpsize))|MCOND(~fcond,~0), "7,f,g", flags, v9 }, \ +-{ opcode, F3F(2, 0x35, 0x080+fpsize)|MCOND(fcond,0), F3F(~2, ~0x35, ~(0x080+fpsize))|MCOND(~fcond,~0), "8,f,g", flags, v9 }, \ +-{ opcode, F3F(2, 0x35, 0x0c0+fpsize)|MCOND(fcond,0), F3F(~2, ~0x35, ~(0x0c0+fpsize))|MCOND(~fcond,~0), "9,f,g", flags, v9 } ++#define fmoviccx(opcode, fpsize, args, cond, flags) /* v9 */ \ ++{ opcode, F3F(2, 0x35, 0x100+fpsize)|MCOND(cond,0), F3F(~2, ~0x35, ~(0x100+fpsize))|MCOND(~cond,~0), "z," args, flags, v9 }, \ ++{ opcode, F3F(2, 0x35, 0x180+fpsize)|MCOND(cond,0), F3F(~2, ~0x35, ~(0x180+fpsize))|MCOND(~cond,~0), "Z," args, flags, v9 } ++ ++#define fmovfccx(opcode, fpsize, args, fcond, flags) /* v9 */ \ ++{ opcode, F3F(2, 0x35, 0x000+fpsize)|MCOND(fcond,0), F3F(~2, ~0x35, ~(0x000+fpsize))|MCOND(~fcond,~0), "6," args, flags, v9 }, \ ++{ opcode, F3F(2, 0x35, 0x040+fpsize)|MCOND(fcond,0), F3F(~2, ~0x35, ~(0x040+fpsize))|MCOND(~fcond,~0), "7," args, flags, v9 }, \ ++{ opcode, F3F(2, 0x35, 0x080+fpsize)|MCOND(fcond,0), F3F(~2, ~0x35, ~(0x080+fpsize))|MCOND(~fcond,~0), "8," args, flags, v9 }, \ ++{ opcode, F3F(2, 0x35, 0x0c0+fpsize)|MCOND(fcond,0), F3F(~2, ~0x35, ~(0x0c0+fpsize))|MCOND(~fcond,~0), "9," args, flags, v9 } + + /* FIXME: use fmovicc/fmovfcc? */ /* v9 */ +-#define fmovcc(opcode, fpsize, cond, fcond, flags) /* v9 */ \ +-{ opcode, F3F(2, 0x35, 0x100+fpsize)|MCOND(cond,0), F3F(~2, ~0x35, ~(0x100+fpsize))|MCOND(~cond,~0), "z,f,g", flags | F_FLOAT, v9 }, \ +-{ opcode, F3F(2, 0x35, 0x000+fpsize)|MCOND(fcond,0), F3F(~2, ~0x35, ~(0x000+fpsize))|MCOND(~fcond,~0), "6,f,g", flags | F_FLOAT, v9 }, \ +-{ opcode, F3F(2, 0x35, 0x180+fpsize)|MCOND(cond,0), F3F(~2, ~0x35, ~(0x180+fpsize))|MCOND(~cond,~0), "Z,f,g", flags | F_FLOAT, v9 }, \ +-{ opcode, F3F(2, 0x35, 0x040+fpsize)|MCOND(fcond,0), F3F(~2, ~0x35, ~(0x040+fpsize))|MCOND(~fcond,~0), "7,f,g", flags | F_FLOAT, v9 }, \ +-{ opcode, F3F(2, 0x35, 0x080+fpsize)|MCOND(fcond,0), F3F(~2, ~0x35, ~(0x080+fpsize))|MCOND(~fcond,~0), "8,f,g", flags | F_FLOAT, v9 }, \ +-{ opcode, F3F(2, 0x35, 0x0c0+fpsize)|MCOND(fcond,0), F3F(~2, ~0x35, ~(0x0c0+fpsize))|MCOND(~fcond,~0), "9,f,g", flags | F_FLOAT, v9 } +- +-/* v9 */ fmovcc ("fmovda", FM_DF, CONDA, FCONDA, 0), +-/* v9 */ fmovcc ("fmovqa", FM_QF, CONDA, FCONDA, 0), +-/* v9 */ fmovcc ("fmovsa", FM_SF, CONDA, FCONDA, 0), +-/* v9 */ fmovicc ("fmovdcc", FM_DF, CONDCC, 0), +-/* v9 */ fmovicc ("fmovqcc", FM_QF, CONDCC, 0), +-/* v9 */ fmovicc ("fmovscc", FM_SF, CONDCC, 0), +-/* v9 */ fmovicc ("fmovdcs", FM_DF, CONDCS, 0), +-/* v9 */ fmovicc ("fmovqcs", FM_QF, CONDCS, 0), +-/* v9 */ fmovicc ("fmovscs", FM_SF, CONDCS, 0), +-/* v9 */ fmovcc ("fmovde", FM_DF, CONDE, FCONDE, 0), +-/* v9 */ fmovcc ("fmovqe", FM_QF, CONDE, FCONDE, 0), +-/* v9 */ fmovcc ("fmovse", FM_SF, CONDE, FCONDE, 0), +-/* v9 */ fmovcc ("fmovdg", FM_DF, CONDG, FCONDG, 0), +-/* v9 */ fmovcc ("fmovqg", FM_QF, CONDG, FCONDG, 0), +-/* v9 */ fmovcc ("fmovsg", FM_SF, CONDG, FCONDG, 0), +-/* v9 */ fmovcc ("fmovdge", FM_DF, CONDGE, FCONDGE, 0), +-/* v9 */ fmovcc ("fmovqge", FM_QF, CONDGE, FCONDGE, 0), +-/* v9 */ fmovcc ("fmovsge", FM_SF, CONDGE, FCONDGE, 0), +-/* v9 */ fmovicc ("fmovdgeu", FM_DF, CONDGEU, F_ALIAS), +-/* v9 */ fmovicc ("fmovqgeu", FM_QF, CONDGEU, F_ALIAS), +-/* v9 */ fmovicc ("fmovsgeu", FM_SF, CONDGEU, F_ALIAS), +-/* v9 */ fmovicc ("fmovdgu", FM_DF, CONDGU, 0), +-/* v9 */ fmovicc ("fmovqgu", FM_QF, CONDGU, 0), +-/* v9 */ fmovicc ("fmovsgu", FM_SF, CONDGU, 0), +-/* v9 */ fmovcc ("fmovdl", FM_DF, CONDL, FCONDL, 0), +-/* v9 */ fmovcc ("fmovql", FM_QF, CONDL, FCONDL, 0), +-/* v9 */ fmovcc ("fmovsl", FM_SF, CONDL, FCONDL, 0), +-/* v9 */ fmovcc ("fmovdle", FM_DF, CONDLE, FCONDLE, 0), +-/* v9 */ fmovcc ("fmovqle", FM_QF, CONDLE, FCONDLE, 0), +-/* v9 */ fmovcc ("fmovsle", FM_SF, CONDLE, FCONDLE, 0), +-/* v9 */ fmovicc ("fmovdleu", FM_DF, CONDLEU, 0), +-/* v9 */ fmovicc ("fmovqleu", FM_QF, CONDLEU, 0), +-/* v9 */ fmovicc ("fmovsleu", FM_SF, CONDLEU, 0), +-/* v9 */ fmovfcc ("fmovdlg", FM_DF, FCONDLG, 0), +-/* v9 */ fmovfcc ("fmovqlg", FM_QF, FCONDLG, 0), +-/* v9 */ fmovfcc ("fmovslg", FM_SF, FCONDLG, 0), +-/* v9 */ fmovicc ("fmovdlu", FM_DF, CONDLU, F_ALIAS), +-/* v9 */ fmovicc ("fmovqlu", FM_QF, CONDLU, F_ALIAS), +-/* v9 */ fmovicc ("fmovslu", FM_SF, CONDLU, F_ALIAS), +-/* v9 */ fmovcc ("fmovdn", FM_DF, CONDN, FCONDN, 0), +-/* v9 */ fmovcc ("fmovqn", FM_QF, CONDN, FCONDN, 0), +-/* v9 */ fmovcc ("fmovsn", FM_SF, CONDN, FCONDN, 0), +-/* v9 */ fmovcc ("fmovdne", FM_DF, CONDNE, FCONDNE, 0), +-/* v9 */ fmovcc ("fmovqne", FM_QF, CONDNE, FCONDNE, 0), +-/* v9 */ fmovcc ("fmovsne", FM_SF, CONDNE, FCONDNE, 0), +-/* v9 */ fmovicc ("fmovdneg", FM_DF, CONDNEG, 0), +-/* v9 */ fmovicc ("fmovqneg", FM_QF, CONDNEG, 0), +-/* v9 */ fmovicc ("fmovsneg", FM_SF, CONDNEG, 0), +-/* v9 */ fmovcc ("fmovdnz", FM_DF, CONDNZ, FCONDNZ, F_ALIAS), +-/* v9 */ fmovcc ("fmovqnz", FM_QF, CONDNZ, FCONDNZ, F_ALIAS), +-/* v9 */ fmovcc ("fmovsnz", FM_SF, CONDNZ, FCONDNZ, F_ALIAS), +-/* v9 */ fmovfcc ("fmovdo", FM_DF, FCONDO, 0), +-/* v9 */ fmovfcc ("fmovqo", FM_QF, FCONDO, 0), +-/* v9 */ fmovfcc ("fmovso", FM_SF, FCONDO, 0), +-/* v9 */ fmovicc ("fmovdpos", FM_DF, CONDPOS, 0), +-/* v9 */ fmovicc ("fmovqpos", FM_QF, CONDPOS, 0), +-/* v9 */ fmovicc ("fmovspos", FM_SF, CONDPOS, 0), +-/* v9 */ fmovfcc ("fmovdu", FM_DF, FCONDU, 0), +-/* v9 */ fmovfcc ("fmovqu", FM_QF, FCONDU, 0), +-/* v9 */ fmovfcc ("fmovsu", FM_SF, FCONDU, 0), +-/* v9 */ fmovfcc ("fmovdue", FM_DF, FCONDUE, 0), +-/* v9 */ fmovfcc ("fmovque", FM_QF, FCONDUE, 0), +-/* v9 */ fmovfcc ("fmovsue", FM_SF, FCONDUE, 0), +-/* v9 */ fmovfcc ("fmovdug", FM_DF, FCONDUG, 0), +-/* v9 */ fmovfcc ("fmovqug", FM_QF, FCONDUG, 0), +-/* v9 */ fmovfcc ("fmovsug", FM_SF, FCONDUG, 0), +-/* v9 */ fmovfcc ("fmovduge", FM_DF, FCONDUGE, 0), +-/* v9 */ fmovfcc ("fmovquge", FM_QF, FCONDUGE, 0), +-/* v9 */ fmovfcc ("fmovsuge", FM_SF, FCONDUGE, 0), +-/* v9 */ fmovfcc ("fmovdul", FM_DF, FCONDUL, 0), +-/* v9 */ fmovfcc ("fmovqul", FM_QF, FCONDUL, 0), +-/* v9 */ fmovfcc ("fmovsul", FM_SF, FCONDUL, 0), +-/* v9 */ fmovfcc ("fmovdule", FM_DF, FCONDULE, 0), +-/* v9 */ fmovfcc ("fmovqule", FM_QF, FCONDULE, 0), +-/* v9 */ fmovfcc ("fmovsule", FM_SF, FCONDULE, 0), +-/* v9 */ fmovicc ("fmovdvc", FM_DF, CONDVC, 0), +-/* v9 */ fmovicc ("fmovqvc", FM_QF, CONDVC, 0), +-/* v9 */ fmovicc ("fmovsvc", FM_SF, CONDVC, 0), +-/* v9 */ fmovicc ("fmovdvs", FM_DF, CONDVS, 0), +-/* v9 */ fmovicc ("fmovqvs", FM_QF, CONDVS, 0), +-/* v9 */ fmovicc ("fmovsvs", FM_SF, CONDVS, 0), +-/* v9 */ fmovcc ("fmovdz", FM_DF, CONDZ, FCONDZ, F_ALIAS), +-/* v9 */ fmovcc ("fmovqz", FM_QF, CONDZ, FCONDZ, F_ALIAS), +-/* v9 */ fmovcc ("fmovsz", FM_SF, CONDZ, FCONDZ, F_ALIAS), +- ++#define fmovccx(opcode, fpsize, args, cond, fcond, flags) /* v9 */ \ ++{ opcode, F3F(2, 0x35, 0x100+fpsize)|MCOND(cond,0), F3F(~2, ~0x35, ~(0x100+fpsize))|MCOND(~cond,~0), "z," args, flags | F_FLOAT, v9 }, \ ++{ opcode, F3F(2, 0x35, 0x000+fpsize)|MCOND(fcond,0), F3F(~2, ~0x35, ~(0x000+fpsize))|MCOND(~fcond,~0), "6," args, flags | F_FLOAT, v9 }, \ ++{ opcode, F3F(2, 0x35, 0x180+fpsize)|MCOND(cond,0), F3F(~2, ~0x35, ~(0x180+fpsize))|MCOND(~cond,~0), "Z," args, flags | F_FLOAT, v9 }, \ ++{ opcode, F3F(2, 0x35, 0x040+fpsize)|MCOND(fcond,0), F3F(~2, ~0x35, ~(0x040+fpsize))|MCOND(~fcond,~0), "7," args, flags | F_FLOAT, v9 }, \ ++{ opcode, F3F(2, 0x35, 0x080+fpsize)|MCOND(fcond,0), F3F(~2, ~0x35, ~(0x080+fpsize))|MCOND(~fcond,~0), "8," args, flags | F_FLOAT, v9 }, \ ++{ opcode, F3F(2, 0x35, 0x0c0+fpsize)|MCOND(fcond,0), F3F(~2, ~0x35, ~(0x0c0+fpsize))|MCOND(~fcond,~0), "9," args, flags | F_FLOAT, v9 } ++ ++#define fmovicc(suffix, cond, flags) /* v9 */ \ ++fmoviccx("fmovd" suffix, FM_DF, "B,H", cond, flags), \ ++fmoviccx("fmovq" suffix, FM_QF, "R,J", cond, flags), \ ++fmoviccx("fmovs" suffix, FM_SF, "f,g", cond, flags) ++ ++#define fmovfcc(suffix, fcond, flags) /* v9 */ \ ++fmovfccx("fmovd" suffix, FM_DF, "B,H", fcond, flags), \ ++fmovfccx("fmovq" suffix, FM_QF, "R,J", fcond, flags), \ ++fmovfccx("fmovs" suffix, FM_SF, "f,g", fcond, flags) ++ ++#define fmovcc(suffix, cond, fcond, flags) /* v9 */ \ ++fmovccx("fmovd" suffix, FM_DF, "B,H", cond, fcond, flags), \ ++fmovccx("fmovq" suffix, FM_QF, "R,J", cond, fcond, flags), \ ++fmovccx("fmovs" suffix, FM_SF, "f,g", cond, fcond, flags) ++ ++/* v9 */ fmovcc ("a", CONDA, FCONDA, 0), ++/* v9 */ fmovicc ("cc", CONDCC, 0), ++/* v9 */ fmovicc ("cs", CONDCS, 0), ++/* v9 */ fmovcc ("e", CONDE, FCONDE, 0), ++/* v9 */ fmovcc ("g", CONDG, FCONDG, 0), ++/* v9 */ fmovcc ("ge", CONDGE, FCONDGE, 0), ++/* v9 */ fmovicc ("geu", CONDGEU, F_ALIAS), ++/* v9 */ fmovicc ("gu", CONDGU, 0), ++/* v9 */ fmovcc ("l", CONDL, FCONDL, 0), ++/* v9 */ fmovcc ("le", CONDLE, FCONDLE, 0), ++/* v9 */ fmovicc ("leu", CONDLEU, 0), ++/* v9 */ fmovfcc ("lg", FCONDLG, 0), ++/* v9 */ fmovicc ("lu", CONDLU, F_ALIAS), ++/* v9 */ fmovcc ("n", CONDN, FCONDN, 0), ++/* v9 */ fmovcc ("ne", CONDNE, FCONDNE, 0), ++/* v9 */ fmovicc ("neg", CONDNEG, 0), ++/* v9 */ fmovcc ("nz", CONDNZ, FCONDNZ, F_ALIAS), ++/* v9 */ fmovfcc ("o", FCONDO, 0), ++/* v9 */ fmovicc ("pos", CONDPOS, 0), ++/* v9 */ fmovfcc ("u", FCONDU, 0), ++/* v9 */ fmovfcc ("ue", FCONDUE, 0), ++/* v9 */ fmovfcc ("ug", FCONDUG, 0), ++/* v9 */ fmovfcc ("uge", FCONDUGE, 0), ++/* v9 */ fmovfcc ("ul", FCONDUL, 0), ++/* v9 */ fmovfcc ("ule", FCONDULE, 0), ++/* v9 */ fmovicc ("vc", CONDVC, 0), ++/* v9 */ fmovicc ("vs", CONDVS, 0), ++/* v9 */ fmovcc ("z", CONDZ, FCONDZ, F_ALIAS), ++ ++#undef fmoviccx /* v9 */ ++#undef fmovfccx /* v9 */ ++#undef fmovccx /* v9 */ + #undef fmovicc /* v9 */ + #undef fmovfcc /* v9 */ + #undef fmovcc /* v9 */ diff --git a/patches/binutils/2.15/790-ld-2.15-callahan.patch b/patches/binutils/2.15/790-ld-2.15-callahan.patch new file mode 100644 index 0000000..bb4a69c --- /dev/null +++ b/patches/binutils/2.15/790-ld-2.15-callahan.patch @@ -0,0 +1,677 @@ +Signed-off-by: dank@kegel.com +Fixes ld speed issue. +See http://weblogs.mozillazine.org/roc/archives/2005/02/optimizing_gnu.html +See thread "Re: optimizations for 3x speedup in ld", +http://sources.redhat.com/ml/binutils/2005-03/msg00847.html + +Wildcard section matching enhancement, backported from the binutils CVS tree. +Here's the CVS log comment from the original change to ldlang.c: + +revision 1.177 +date: 2005/04/06 15:33:02; author: jakub; state: Exp; lines: +438 -51 +2005-04-06 Jakub Jelinek + + * ldlang.c: Formatting. + (walk_wild_consider_section): Remember return value from wildcardp. + (is_simple_wild): Use strcspn instead of 2 strpbrk calls and strlen. + (wild_spec_can_overlap): Use strcspn instead of strpbrk and strlen. + +2005-04-06 Robert O'Callahan + + * ld.h (lean_section_userdata_type): Remove. + (fat_section_userdata_type): Remove file field. + (SECTION_USERDATA_SIZE): Remove. + * ldlang.c (init_os): Eliminate initialization of unused + lean_section_userdata_type. + + * ldlang.h (callback_t, walk_wild_section_handler_t): New + typedefs. + (struct lang_wild_statement_struct): Add walk_wild_section_handler + and handler_data fields. + * ldlang.c (callback_t): Removed. + (walk_wild_consider_section, walk_wild_section_general, + section_iterator_callback, find_section, is_simple_wild, + match_simple_wild, walk_wild_section_specs1_wild0, + walk_wild_section_specs1_wild1, walk_wild_section_specs2_wild1, + walk_wild_section_specs3_wild2, walk_wild_section_specs4_wild2, + wild_spec_can_overlap, analyze_walk_wild_section_handler): New + functions. + (lang_add_wild): Call analyze_walk_wild_section_handler. + (walk_wild_section): Renamed to walk_wild_section_general and + created a wrapper function. + (section_iterator_callback_data): New typedef. + +Note that bfd_get_section_by_name_if didn't exist in 2.15, so it was backported +as well. + +--- binutils-2.15/bfd/bfd-in2.h.old 2004-05-17 15:35:56.000000000 -0400 ++++ binutils-2.15/bfd/bfd-in2.h 2006-02-09 11:54:45.989940000 -0500 +@@ -1425,6 +1425,10 @@ + + asection *bfd_get_section_by_name (bfd *abfd, const char *name); + ++asection *bfd_get_section_by_name_if (bfd *abfd, const char *name, ++ bfd_boolean (*operation) (bfd *, asection *, void *), ++ void *user_storage); ++ + char *bfd_get_unique_section_name + (bfd *abfd, const char *templat, int *count); + +--- binutils-2.15/bfd/section.c.old 2003-12-01 01:33:01.000000000 -0500 ++++ binutils-2.15/bfd/section.c 2006-01-23 14:16:54.768993000 -0500 +@@ -801,6 +801,57 @@ + + /* + FUNCTION ++ bfd_get_section_by_name_if ++ ++SYNOPSIS ++ asection *bfd_get_section_by_name_if ++ (bfd *abfd, ++ const char *name, ++ bfd_boolean (*func) (bfd *abfd, asection *sect, void *obj), ++ void *obj); ++ ++DESCRIPTION ++ Call the provided function @var{func} for each section ++ attached to the BFD @var{abfd} whose name matches @var{name}, ++ passing @var{obj} as an argument. The function will be called ++ as if by ++ ++| func (abfd, the_section, obj); ++ ++ It returns the first section for which @var{func} returns true, ++ otherwise <>. ++ ++*/ ++ ++asection * ++bfd_get_section_by_name_if (bfd *abfd, const char *name, ++ bfd_boolean (*operation) (bfd *, ++ asection *, ++ void *), ++ void *user_storage) ++{ ++ struct section_hash_entry *sh; ++ unsigned long hash; ++ ++ sh = section_hash_lookup (&abfd->section_htab, name, FALSE, FALSE); ++ if (sh == NULL) ++ return NULL; ++ ++ hash = sh->root.hash; ++ do ++ { ++ if ((*operation) (abfd, &sh->section, user_storage)) ++ return &sh->section; ++ sh = (struct section_hash_entry *) sh->root.next; ++ } ++ while (sh != NULL && sh->root.hash == hash ++ && strcmp (sh->root.string, name) == 0); ++ ++ return NULL; ++} ++ ++/* ++FUNCTION + bfd_get_unique_section_name + + SYNOPSIS +--- binutils-2.15/ld/ldlang.c.old 2004-05-17 15:36:16.000000000 -0400 ++++ binutils-2.15/ld/ldlang.c 2006-01-23 13:40:12.745499000 -0500 +@@ -81,9 +81,6 @@ + static void lang_record_phdrs (void); + static void lang_do_version_exports_section (void); + +-typedef void (*callback_t) (lang_wild_statement_type *, struct wildcard_list *, +- asection *, lang_input_statement_type *, void *); +- + /* Exported variables. */ + lang_output_section_statement_type *abs_output_section; + lang_statement_list_type lang_output_section_statement; +@@ -138,21 +135,71 @@ + + /* Generic traversal routines for finding matching sections. */ + ++/* Try processing a section against a wildcard. This just calls ++ the callback unless the filename exclusion list is present ++ and excludes the file. It's hardly ever present so this ++ function is very fast. */ ++ ++static void ++walk_wild_consider_section (lang_wild_statement_type *ptr, ++ lang_input_statement_type *file, ++ asection *s, ++ struct wildcard_list *sec, ++ callback_t callback, ++ void *data) ++{ ++ bfd_boolean skip = FALSE; ++ struct name_list *list_tmp; ++ ++ /* Don't process sections from files which were ++ excluded. */ ++ for (list_tmp = sec->spec.exclude_name_list; ++ list_tmp; ++ list_tmp = list_tmp->next) ++ { ++ bfd_boolean is_wildcard = wildcardp (list_tmp->name); ++ if (is_wildcard) ++ skip = fnmatch (list_tmp->name, file->filename, 0) == 0; ++ else ++ skip = strcmp (list_tmp->name, file->filename) == 0; ++ ++ /* If this file is part of an archive, and the archive is ++ excluded, exclude this file. */ ++ if (! skip && file->the_bfd != NULL ++ && file->the_bfd->my_archive != NULL ++ && file->the_bfd->my_archive->filename != NULL) ++ { ++ if (is_wildcard) ++ skip = fnmatch (list_tmp->name, ++ file->the_bfd->my_archive->filename, ++ 0) == 0; ++ else ++ skip = strcmp (list_tmp->name, ++ file->the_bfd->my_archive->filename) == 0; ++ } ++ ++ if (skip) ++ break; ++ } ++ ++ if (!skip) ++ (*callback) (ptr, sec, s, file, data); ++} ++ ++/* Lowest common denominator routine that can handle everything correctly, ++ but slowly. */ ++ + static void +-walk_wild_section (lang_wild_statement_type *ptr, +- lang_input_statement_type *file, +- callback_t callback, +- void *data) ++walk_wild_section_general (lang_wild_statement_type *ptr, ++ lang_input_statement_type *file, ++ callback_t callback, ++ void *data) + { + asection *s; +- +- if (file->just_syms_flag) +- return; ++ struct wildcard_list *sec; + + for (s = file->the_bfd->sections; s != NULL; s = s->next) + { +- struct wildcard_list *sec; +- + sec = ptr->section_list; + if (sec == NULL) + (*callback) (ptr, sec, s, file, data); +@@ -160,39 +207,8 @@ + while (sec != NULL) + { + bfd_boolean skip = FALSE; +- struct name_list *list_tmp; +- +- /* Don't process sections from files which were +- excluded. */ +- for (list_tmp = sec->spec.exclude_name_list; +- list_tmp; +- list_tmp = list_tmp->next) +- { +- if (wildcardp (list_tmp->name)) +- skip = fnmatch (list_tmp->name, file->filename, 0) == 0; +- else +- skip = strcmp (list_tmp->name, file->filename) == 0; +- +- /* If this file is part of an archive, and the archive is +- excluded, exclude this file. */ +- if (! skip && file->the_bfd != NULL +- && file->the_bfd->my_archive != NULL +- && file->the_bfd->my_archive->filename != NULL) +- { +- if (wildcardp (list_tmp->name)) +- skip = fnmatch (list_tmp->name, +- file->the_bfd->my_archive->filename, +- 0) == 0; +- else +- skip = strcmp (list_tmp->name, +- file->the_bfd->my_archive->filename) == 0; +- } +- +- if (skip) +- break; +- } + +- if (!skip && sec->spec.name != NULL) ++ if (sec->spec.name != NULL) + { + const char *sname = bfd_get_section_name (file->the_bfd, s); + +@@ -203,13 +219,381 @@ + } + + if (!skip) +- (*callback) (ptr, sec, s, file, data); ++ walk_wild_consider_section (ptr, file, s, sec, callback, data); + + sec = sec->next; + } + } + } + ++/* Routines to find a single section given its name. If there's more ++ than one section with that name, we report that. */ ++ ++typedef struct ++{ ++ asection *found_section; ++ bfd_boolean multiple_sections_found; ++} section_iterator_callback_data; ++ ++static bfd_boolean ++section_iterator_callback (bfd *bfd ATTRIBUTE_UNUSED, asection *s, void *data) ++{ ++ section_iterator_callback_data *d = data; ++ ++ if (d->found_section != NULL) ++ { ++ d->multiple_sections_found = TRUE; ++ return TRUE; ++ } ++ ++ d->found_section = s; ++ return FALSE; ++} ++ ++static asection * ++find_section (lang_input_statement_type *file, ++ struct wildcard_list *sec, ++ bfd_boolean *multiple_sections_found) ++{ ++ section_iterator_callback_data cb_data = { NULL, FALSE }; ++ ++ bfd_get_section_by_name_if (file->the_bfd, sec->spec.name, ++ section_iterator_callback, &cb_data); ++ *multiple_sections_found = cb_data.multiple_sections_found; ++ return cb_data.found_section; ++} ++ ++/* Code for handling simple wildcards without going through fnmatch, ++ which can be expensive because of charset translations etc. */ ++ ++/* A simple wild is a literal string followed by a single '*', ++ where the literal part is at least 4 characters long. */ ++ ++static bfd_boolean ++is_simple_wild (const char *name) ++{ ++ size_t len = strcspn (name, "*?["); ++ return len >= 4 && name[len] == '*' && name[len + 1] == '\0'; ++} ++ ++static bfd_boolean ++match_simple_wild (const char *pattern, const char *name) ++{ ++ /* The first four characters of the pattern are guaranteed valid ++ non-wildcard characters. So we can go faster. */ ++ if (pattern[0] != name[0] || pattern[1] != name[1] ++ || pattern[2] != name[2] || pattern[3] != name[3]) ++ return FALSE; ++ ++ pattern += 4; ++ name += 4; ++ while (*pattern != '*') ++ if (*name++ != *pattern++) ++ return FALSE; ++ ++ return TRUE; ++} ++ ++/* Specialized, optimized routines for handling different kinds of ++ wildcards */ ++ ++static void ++walk_wild_section_specs1_wild0 (lang_wild_statement_type *ptr, ++ lang_input_statement_type *file, ++ callback_t callback, ++ void *data) ++{ ++ /* We can just do a hash lookup for the section with the right name. ++ But if that lookup discovers more than one section with the name ++ (should be rare), we fall back to the general algorithm because ++ we would otherwise have to sort the sections to make sure they ++ get processed in the bfd's order. */ ++ bfd_boolean multiple_sections_found; ++ struct wildcard_list *sec0 = ptr->handler_data[0]; ++ asection *s0 = find_section (file, sec0, &multiple_sections_found); ++ ++ if (multiple_sections_found) ++ walk_wild_section_general (ptr, file, callback, data); ++ else if (s0) ++ walk_wild_consider_section (ptr, file, s0, sec0, callback, data); ++} ++ ++static void ++walk_wild_section_specs1_wild1 (lang_wild_statement_type *ptr, ++ lang_input_statement_type *file, ++ callback_t callback, ++ void *data) ++{ ++ asection *s; ++ struct wildcard_list *wildsec0 = ptr->handler_data[0]; ++ ++ for (s = file->the_bfd->sections; s != NULL; s = s->next) ++ { ++ const char *sname = bfd_get_section_name (file->the_bfd, s); ++ bfd_boolean skip = !match_simple_wild (wildsec0->spec.name, sname); ++ ++ if (!skip) ++ walk_wild_consider_section (ptr, file, s, wildsec0, callback, data); ++ } ++} ++ ++static void ++walk_wild_section_specs2_wild1 (lang_wild_statement_type *ptr, ++ lang_input_statement_type *file, ++ callback_t callback, ++ void *data) ++{ ++ asection *s; ++ struct wildcard_list *sec0 = ptr->handler_data[0]; ++ struct wildcard_list *wildsec1 = ptr->handler_data[1]; ++ bfd_boolean multiple_sections_found; ++ asection *s0 = find_section (file, sec0, &multiple_sections_found); ++ ++ if (multiple_sections_found) ++ { ++ walk_wild_section_general (ptr, file, callback, data); ++ return; ++ } ++ ++ /* Note that if the section was not found, s0 is NULL and ++ we'll simply never succeed the s == s0 test below. */ ++ for (s = file->the_bfd->sections; s != NULL; s = s->next) ++ { ++ /* Recall that in this code path, a section cannot satisfy more ++ than one spec, so if s == s0 then it cannot match ++ wildspec1. */ ++ if (s == s0) ++ walk_wild_consider_section (ptr, file, s, sec0, callback, data); ++ else ++ { ++ const char *sname = bfd_get_section_name (file->the_bfd, s); ++ bfd_boolean skip = !match_simple_wild (wildsec1->spec.name, sname); ++ ++ if (!skip) ++ walk_wild_consider_section (ptr, file, s, wildsec1, callback, ++ data); ++ } ++ } ++} ++ ++static void ++walk_wild_section_specs3_wild2 (lang_wild_statement_type *ptr, ++ lang_input_statement_type *file, ++ callback_t callback, ++ void *data) ++{ ++ asection *s; ++ struct wildcard_list *sec0 = ptr->handler_data[0]; ++ struct wildcard_list *wildsec1 = ptr->handler_data[1]; ++ struct wildcard_list *wildsec2 = ptr->handler_data[2]; ++ bfd_boolean multiple_sections_found; ++ asection *s0 = find_section (file, sec0, &multiple_sections_found); ++ ++ if (multiple_sections_found) ++ { ++ walk_wild_section_general (ptr, file, callback, data); ++ return; ++ } ++ ++ for (s = file->the_bfd->sections; s != NULL; s = s->next) ++ { ++ if (s == s0) ++ walk_wild_consider_section (ptr, file, s, sec0, callback, data); ++ else ++ { ++ const char *sname = bfd_get_section_name (file->the_bfd, s); ++ bfd_boolean skip = !match_simple_wild (wildsec1->spec.name, sname); ++ ++ if (!skip) ++ walk_wild_consider_section (ptr, file, s, wildsec1, callback, data); ++ else ++ { ++ skip = !match_simple_wild (wildsec2->spec.name, sname); ++ if (!skip) ++ walk_wild_consider_section (ptr, file, s, wildsec2, callback, ++ data); ++ } ++ } ++ } ++} ++ ++static void ++walk_wild_section_specs4_wild2 (lang_wild_statement_type *ptr, ++ lang_input_statement_type *file, ++ callback_t callback, ++ void *data) ++{ ++ asection *s; ++ struct wildcard_list *sec0 = ptr->handler_data[0]; ++ struct wildcard_list *sec1 = ptr->handler_data[1]; ++ struct wildcard_list *wildsec2 = ptr->handler_data[2]; ++ struct wildcard_list *wildsec3 = ptr->handler_data[3]; ++ bfd_boolean multiple_sections_found; ++ asection *s0 = find_section (file, sec0, &multiple_sections_found), *s1; ++ ++ if (multiple_sections_found) ++ { ++ walk_wild_section_general (ptr, file, callback, data); ++ return; ++ } ++ ++ s1 = find_section (file, sec1, &multiple_sections_found); ++ if (multiple_sections_found) ++ { ++ walk_wild_section_general (ptr, file, callback, data); ++ return; ++ } ++ ++ for (s = file->the_bfd->sections; s != NULL; s = s->next) ++ { ++ if (s == s0) ++ walk_wild_consider_section (ptr, file, s, sec0, callback, data); ++ else ++ if (s == s1) ++ walk_wild_consider_section (ptr, file, s, sec1, callback, data); ++ else ++ { ++ const char *sname = bfd_get_section_name (file->the_bfd, s); ++ bfd_boolean skip = !match_simple_wild (wildsec2->spec.name, ++ sname); ++ ++ if (!skip) ++ walk_wild_consider_section (ptr, file, s, wildsec2, callback, ++ data); ++ else ++ { ++ skip = !match_simple_wild (wildsec3->spec.name, sname); ++ if (!skip) ++ walk_wild_consider_section (ptr, file, s, wildsec3, ++ callback, data); ++ } ++ } ++ } ++} ++ ++static void ++walk_wild_section (lang_wild_statement_type *ptr, ++ lang_input_statement_type *file, ++ callback_t callback, ++ void *data) ++{ ++ if (file->just_syms_flag) ++ return; ++ ++ (*ptr->walk_wild_section_handler) (ptr, file, callback, data); ++} ++ ++/* Returns TRUE when name1 is a wildcard spec that might match ++ something name2 can match. We're conservative: we return FALSE ++ only if the prefixes of name1 and name2 are different up to the ++ first wildcard character. */ ++ ++static bfd_boolean ++wild_spec_can_overlap (const char *name1, const char *name2) ++{ ++ size_t prefix1_len = strcspn (name1, "?*["); ++ size_t prefix2_len = strcspn (name2, "?*["); ++ size_t min_prefix_len; ++ ++ /* Note that if there is no wildcard character, then we treat the ++ terminating 0 as part of the prefix. Thus ".text" won't match ++ ".text." or ".text.*", for example. */ ++ if (name1[prefix1_len] == '\0') ++ prefix1_len++; ++ if (name2[prefix2_len] == '\0') ++ prefix2_len++; ++ ++ min_prefix_len = prefix1_len < prefix2_len ? prefix1_len : prefix2_len; ++ ++ return memcmp (name1, name2, min_prefix_len) == 0; ++} ++ ++/* Select specialized code to handle various kinds of wildcard ++ statements. */ ++ ++static void ++analyze_walk_wild_section_handler (lang_wild_statement_type *ptr) ++{ ++ int sec_count = 0; ++ int wild_name_count = 0; ++ struct wildcard_list *sec; ++ int signature; ++ int data_counter; ++ ++ ptr->walk_wild_section_handler = walk_wild_section_general; ++ ++ /* Count how many wildcard_specs there are, and how many of those ++ actually use wildcards in the name. Also, bail out if any of the ++ wildcard names are NULL. (Can this actually happen? ++ walk_wild_section used to test for it.) And bail out if any ++ of the wildcards are more complex than a simple string ++ ending in a single '*'. */ ++ for (sec = ptr->section_list; sec != NULL; sec = sec->next) ++ { ++ ++sec_count; ++ if (sec->spec.name == NULL) ++ return; ++ if (wildcardp (sec->spec.name)) ++ { ++ ++wild_name_count; ++ if (!is_simple_wild (sec->spec.name)) ++ return; ++ } ++ } ++ ++ /* The zero-spec case would be easy to optimize but it doesn't ++ happen in practice. Likewise, more than 4 specs doesn't ++ happen in practice. */ ++ if (sec_count == 0 || sec_count > 4) ++ return; ++ ++ /* Check that no two specs can match the same section. */ ++ for (sec = ptr->section_list; sec != NULL; sec = sec->next) ++ { ++ struct wildcard_list *sec2; ++ for (sec2 = sec->next; sec2 != NULL; sec2 = sec2->next) ++ { ++ if (wild_spec_can_overlap (sec->spec.name, sec2->spec.name)) ++ return; ++ } ++ } ++ ++ signature = (sec_count << 8) + wild_name_count; ++ switch (signature) ++ { ++ case 0x0100: ++ ptr->walk_wild_section_handler = walk_wild_section_specs1_wild0; ++ break; ++ case 0x0101: ++ ptr->walk_wild_section_handler = walk_wild_section_specs1_wild1; ++ break; ++ case 0x0201: ++ ptr->walk_wild_section_handler = walk_wild_section_specs2_wild1; ++ break; ++ case 0x0302: ++ ptr->walk_wild_section_handler = walk_wild_section_specs3_wild2; ++ break; ++ case 0x0402: ++ ptr->walk_wild_section_handler = walk_wild_section_specs4_wild2; ++ break; ++ default: ++ return; ++ } ++ ++ /* Now fill the data array with pointers to the specs, first the ++ specs with non-wildcard names, then the specs with wildcard ++ names. It's OK to process the specs in different order from the ++ given order, because we've already determined that no section ++ will match more than one spec. */ ++ data_counter = 0; ++ for (sec = ptr->section_list; sec != NULL; sec = sec->next) ++ if (!wildcardp (sec->spec.name)) ++ ptr->handler_data[data_counter++] = sec; ++ for (sec = ptr->section_list; sec != NULL; sec = sec->next) ++ if (wildcardp (sec->spec.name)) ++ ptr->handler_data[data_counter++] = sec; ++} ++ + /* Handle a wild statement for a single file F. */ + + static void +@@ -4353,6 +4737,7 @@ + new->section_list = section_list; + new->keep_sections = keep_sections; + lang_list_init (&new->children); ++ analyze_walk_wild_section_handler (new); + } + + void +--- binutils-2.15/ld/ldlang.h.old 2004-05-17 15:36:16.000000000 -0400 ++++ binutils-2.15/ld/ldlang.h 2006-01-23 13:32:33.653292000 -0500 +@@ -295,7 +295,17 @@ + union lang_statement_union *file; + } lang_afile_asection_pair_statement_type; + +-typedef struct lang_wild_statement_struct ++typedef struct lang_wild_statement_struct lang_wild_statement_type; ++ ++typedef void (*callback_t) (lang_wild_statement_type *, struct wildcard_list *, ++ asection *, lang_input_statement_type *, void *); ++ ++typedef void (*walk_wild_section_handler_t) (lang_wild_statement_type *, ++ lang_input_statement_type *, ++ callback_t callback, ++ void *data); ++ ++struct lang_wild_statement_struct + { + lang_statement_header_type header; + const char *filename; +@@ -303,7 +313,10 @@ + struct wildcard_list *section_list; + bfd_boolean keep_sections; + lang_statement_list_type children; +-} lang_wild_statement_type; ++ ++ walk_wild_section_handler_t walk_wild_section_handler; ++ struct wildcard_list *handler_data[4]; ++}; + + typedef struct lang_address_statement_struct + { diff --git a/patches/binutils/2.15/800-ld-2.15-stabs-tweak.patch b/patches/binutils/2.15/800-ld-2.15-stabs-tweak.patch new file mode 100644 index 0000000..bd6ae7a --- /dev/null +++ b/patches/binutils/2.15/800-ld-2.15-stabs-tweak.patch @@ -0,0 +1,33 @@ +Signed-off-by: dank@kegel.com + +See http://sourceware.org/ml/binutils/2005-12/msg00270.html +http://sourceware.org/ml/binutils-cvs/2005-12/msg00139.html + +STABS hash table size change, backported from the binutils CVS tree. Here's +the CVS log comment for the original change: + +revision 1.25 +date: 2005/12/29 10:29:23; author: nickc; state: Exp; lines: +2 -3 +(_bfd_link_section_stabs): Use bfd_hash_table_init rather than +bfd_hash_table_init_n(...,251) so that the size of the hash table can be +controlled by the user. + +Note that tunable hash table size changes were added after 2.15. The effect +of this change is to make bfd use its default hash table size for the stabs +hash as well. + + +--- binutils-2.15/bfd/stabs.c.old 2004-05-17 15:36:04.000000000 -0400 ++++ binutils-2.15/bfd/stabs.c 2006-02-09 15:21:56.567014000 -0500 +@@ -241,9 +241,8 @@ + goto error_return; + /* Make sure the first byte is zero. */ + (void) _bfd_stringtab_add (sinfo->strings, "", TRUE, TRUE); +- if (! bfd_hash_table_init_n (&sinfo->includes.root, +- stab_link_includes_newfunc, +- 251)) ++ if (! bfd_hash_table_init (&sinfo->includes.root, ++ stab_link_includes_newfunc)) + goto error_return; + sinfo->stabstr = bfd_make_section_anyway (abfd, ".stabstr"); + sinfo->stabstr->flags |= SEC_HAS_CONTENTS | SEC_READONLY | SEC_DEBUGGING; diff --git a/patches/binutils/2.15/810-s390-invalid-insn-format.patch b/patches/binutils/2.15/810-s390-invalid-insn-format.patch new file mode 100644 index 0000000..3296201 --- /dev/null +++ b/patches/binutils/2.15/810-s390-invalid-insn-format.patch @@ -0,0 +1,42 @@ +Message-ID: <000801c48f60$cec16630$9103a8c0@ULOC5012> +From: "Michael Geiger" +To: +Subject: Patch for cross compiling s/390 kernel on linux host +Date: Tue, 31 Aug 2004 15:45:41 +0200 + +Dear Dan, + +I had big problems compiling a kernel for s/390 on my linux host - I tried +different chains from crosstool-0.28-rc34 and finally succeded with +gcc-3.3.4-glibc-2.3.2 after applying another patch to binutils-2.15 +(attached). +All compilations of the different kernel versions I tried stopped with +"Invalid .insn format" somewhere. I checked the recent cvs version of +binutils and applied the latest diff to gas/config/tc-s390.c and that solved +it. + +Greetings + +Michael Geiger + + +diff -u -r1.39 -r1.40 +--- src/gas/config/tc-s390.c 2004/05/06 11:01:48 1.39 ++++ src/gas/config/tc-s390.c 2004/06/15 12:38:08 1.40 +@@ -1596,13 +1596,13 @@ + if (exp.X_op == O_constant) + { + if ( ( opformat->oplen == 6 +- && exp.X_add_number >= 0 ++ && (addressT) exp.X_add_number >= 0 + && (addressT) exp.X_add_number < (1ULL << 48)) + || ( opformat->oplen == 4 +- && exp.X_add_number >= 0 ++ && (addressT) exp.X_add_number >= 0 + && (addressT) exp.X_add_number < (1ULL << 32)) + || ( opformat->oplen == 2 +- && exp.X_add_number >= 0 ++ && (addressT) exp.X_add_number >= 0 + && (addressT) exp.X_add_number < (1ULL << 16))) + md_number_to_chars (insn, exp.X_add_number, opformat->oplen); + else diff --git a/patches/binutils/2.15/bfd-hash-tweak.patch b/patches/binutils/2.15/bfd-hash-tweak.patch deleted file mode 100644 index 6b8fc41..0000000 --- a/patches/binutils/2.15/bfd-hash-tweak.patch +++ /dev/null @@ -1,24 +0,0 @@ -Signed-off-by: dank@kegel.com - -Raising the size of the hash table is a noticable win when linking -at least one large app. - -There was a patch, -http://sources.redhat.com/ml/binutils/2004-06/msg00165.html -to do this dynamically. No idea why that didn't make it in. -So this tiny change to raise the default size is just -a stopgap for now. - - ---- binutils-2.15/bfd/hash.c.old 2003-12-01 01:33:01.000000000 -0500 -+++ binutils-2.15/bfd/hash.c 2006-03-01 16:26:26.701991000 -0500 -@@ -295,7 +295,7 @@ - */ - - /* The default number of entries to use when creating a hash table. */ --#define DEFAULT_SIZE (4051) -+#define DEFAULT_SIZE (32749) - - /* Create a new hash table, given a number of entries. */ - - diff --git a/patches/binutils/2.15/binutils-2.15-allow-gcc-4.0.patch b/patches/binutils/2.15/binutils-2.15-allow-gcc-4.0.patch deleted file mode 100644 index 26e5a12..0000000 --- a/patches/binutils/2.15/binutils-2.15-allow-gcc-4.0.patch +++ /dev/null @@ -1,75 +0,0 @@ -Fix found here: http://www.freelists.org/archives/openbeos/11-2005/msg00090.html - -Fixes: -In file included from ./targ-cpu.h:1, - from /home/dank/crosstool-new/build/i686-unknown-linux-gnu/gcc-2.95.3-glibc-2.2.2/binutils-2.15/gas/config/obj-elf.h:42, - from ./obj-format.h:1, - from /home/dank/crosstool-new/build/i686-unknown-linux-gnu/gcc-2.95.3-glibc-2.2.2/binutils-2.15/gas/config/te-linux.h:4, - from ./targ-env.h:1, - from /home/dank/crosstool-new/build/i686-unknown-linux-gnu/gcc-2.95.3-glibc-2.2.2/binutils-2.15/gas/as.h:626, - from /home/dank/crosstool-new/build/i686-unknown-linux-gnu/gcc-2.95.3-glibc-2.2.2/binutils-2.15/gas/app.c:30: -/home/dank/crosstool-new/build/i686-unknown-linux-gnu/gcc-2.95.3-glibc-2.2.2/binutils-2.15/gas/config/tc-i386.h:451: error: array type has incomplete element type -make[3]: *** [app.o] Error 1 -make[3]: Leaving directory `/home/dank/crosstool-new/build/i686-unknown-linux-gnu/gcc-2.95.3-glibc-2.2.2/build-binutils/gas' - -when building binutils-2.15 with gcc-4.0 - - -diff -ur binutils-2.15.old/gas/as.h binutils-2.15/gas/as.h ---- binutils-2.15.old/gas/as.h 2003-11-22 18:14:21.000000000 -0800 -+++ binutils-2.15/gas/as.h 2006-02-14 22:05:35.000000000 -0800 -@@ -605,7 +605,26 @@ - struct expressionS; - struct fix; - typedef struct symbol symbolS; --struct relax_type; -+ -+/* JF moved this here from as.h under the theory that nobody except MACHINE.c -+ and write.c care about it anyway. */ -+/* [zooey]: the above no longer holds with gcc4, as it keeps bugging about -+ incomplete element types in arrays, if relax_type isn't defined -+ here. So I moved the definition back from tc.h to here. */ -+struct relax_type -+{ -+ /* Forward reach. Signed number. > 0. */ -+ long rlx_forward; -+ /* Backward reach. Signed number. < 0. */ -+ long rlx_backward; -+ -+ /* Bytes length of this address. */ -+ unsigned char rlx_length; -+ -+ /* Next longer relax-state. 0 means there is no 'next' relax-state. */ -+ relax_substateT rlx_more; -+}; -+ - typedef struct frag fragS; - - #ifdef BFD_ASSEMBLER -diff -ur binutils-2.15.old/gas/tc.h binutils-2.15/gas/tc.h ---- binutils-2.15.old/gas/tc.h 2003-12-03 15:39:38.000000000 -0800 -+++ binutils-2.15/gas/tc.h 2006-02-14 22:03:35.000000000 -0800 -@@ -24,23 +24,6 @@ - - extern const pseudo_typeS md_pseudo_table[]; - --/* JF moved this here from as.h under the theory that nobody except MACHINE.c -- and write.c care about it anyway. */ -- --struct relax_type --{ -- /* Forward reach. Signed number. > 0. */ -- long rlx_forward; -- /* Backward reach. Signed number. < 0. */ -- long rlx_backward; -- -- /* Bytes length of this address. */ -- unsigned char rlx_length; -- -- /* Next longer relax-state. 0 means there is no 'next' relax-state. */ -- relax_substateT rlx_more; --}; -- - typedef struct relax_type relax_typeS; - - extern const int md_reloc_size; /* Size of a relocation record */ diff --git a/patches/binutils/2.15/binutils-2.15-psignal.patch b/patches/binutils/2.15/binutils-2.15-psignal.patch deleted file mode 100644 index 98fa600..0000000 --- a/patches/binutils/2.15/binutils-2.15-psignal.patch +++ /dev/null @@ -1,40 +0,0 @@ -Make psignal prototype in libiberty match that in glibc. - -Fixes: - -gcc-2.95.3-glibc-2.1.3/binutils-2.15/libiberty/strsignal.c: In function `psignal': -gcc-2.95.3-glibc-2.1.3/binutils-2.15/libiberty/strsignal.c:563: argument `signo' doesn't match prototype -/usr/include/signal.h:131: prototype declaration -gcc-2.95.3-glibc-2.1.3/binutils-2.15/libiberty/strsignal.c:563: argument `message' doesn't match prototype -/usr/include/signal.h:131: prototype declaration -gcc-2.95.3-glibc-2.1.3/binutils-2.15/libiberty/strsignal.c:568: warning: comparison between signed and unsigned -mprotect... make[1]: *** [strsignal.o] Error 1 -make[1]: Leaving directory `/export/hda3/dkegel/queue/jobdir.produser_cpsm17/crosstool-0.32/build/i686-unknown-linux-gnu/gcc-2.95.3-glibc-2.1.3/build-binutils/libiberty' -make: *** [all-libiberty] Error 2 - -when building on red hat 7.1 -though it's a bit of a mystery why libiberty's psignal is being compiled at -all, since red hat 7.1's glibc supports psignal (hence the error message) - ---- binutils-2.15/libiberty/strsignal.c.old 2005-04-18 13:57:40.000000000 -0700 -+++ binutils-2.15/libiberty/strsignal.c 2005-04-18 13:59:09.000000000 -0700 -@@ -544,7 +544,7 @@ - - /* - --@deftypefn Supplemental void psignal (unsigned @var{signo}, char *@var{message}) -+@deftypefn Supplemental void psignal (int @var{signo}, const char *@var{message}) - - Print @var{message} to the standard error, followed by a colon, - followed by the description of the signal specified by @var{signo}, -@@ -557,9 +557,7 @@ - #ifndef HAVE_PSIGNAL - - void --psignal (signo, message) -- unsigned signo; -- char *message; -+psignal (int signo, const char *message) - { - if (signal_names == NULL) - { diff --git a/patches/binutils/2.15/binutils-2.15-solaris-qsort.patch b/patches/binutils/2.15/binutils-2.15-solaris-qsort.patch deleted file mode 100644 index 5fe3623..0000000 --- a/patches/binutils/2.15/binutils-2.15-solaris-qsort.patch +++ /dev/null @@ -1,22 +0,0 @@ -See http://sources.redhat.com/ml/binutils/2004-06/msg00114.html - ---- src/bfd/elflink.c.org 2004-07-05 09:11:42.920597000 -0400 -+++ src/bfd/elflink.c 2004-07-05 09:12:59.240847000 -0400 -@@ -2700,7 +2700,7 @@ - return vdiff > 0 ? 1 : -1; - else - { -- long sdiff = h1->root.u.def.section - h2->root.u.def.section; -+ long sdiff = h1->root.u.def.section->id - h2->root.u.def.section->id; - if (sdiff != 0) - return sdiff > 0 ? 1 : -1; - } -@@ -3954,7 +3954,7 @@ - i = idx + 1; - else - { -- long sdiff = slook - h->root.u.def.section; -+ long sdiff = slook->id - h->root.u.def.section->id; - if (sdiff < 0) - j = idx; - else if (sdiff > 0) diff --git a/patches/binutils/2.15/binutils-2.15-vmx.patch b/patches/binutils/2.15/binutils-2.15-vmx.patch deleted file mode 100644 index 5ae9efe..0000000 --- a/patches/binutils/2.15/binutils-2.15-vmx.patch +++ /dev/null @@ -1,45 +0,0 @@ -Grabbed with -wget 'http://sources.redhat.com/cgi-bin/cvsweb.cgi/src/opcodes/ppc-opc.c.diff?r1=1.70&r2=1.71&cvsroot=src' -See -http://mail.gnu.org/archive/html/bug-binutils/2004-05/msg00071.html -and -http://sources.redhat.com/ml/binutils-cvs/2004-05/msg00111.html - -This fixes problems like -{standard input}: Assembler messages: -{standard input}:1: Error: Unrecognized opcode: `dssall' -which show up in binutils-2.15 when building the Linux kernel, -or possibly failed compilations when building setjmp/longjmp in glibc. - -An alternative fix would be to pass -many to the assembler. -A patch to do that for glibc is at -wget 'http://sources.redhat.com/cgi-bin/get-raw-msg?listname=libc-alpha&date=2004-05&msgid=40B36E8C.9030609%40us.ibm.com' -Yet another, better, fix would be for gcc to generate assembly -that told the assembler which processor type to use. -Presumably the Linux kernel sources would need a fix, too. -Probably better to just fix binutils to accept sources that it used to. - - -=================================================================== -RCS file: /cvs/src/src/opcodes/ppc-opc.c,v -retrieving revision 1.70 -retrieving revision 1.71 -diff -u -r1.70 -r1.71 ---- src/opcodes/ppc-opc.c 2004/05/05 13:43:36 1.70 -+++ src/opcodes/ppc-opc.c 2004/05/19 05:11:48 1.71 -@@ -1004,8 +1004,13 @@ - - /* If only one bit of the FXM field is set, we can use the new form - of the instruction, which is faster. Unlike the Power4 branch hint -- encoding, this is not backward compatible. */ -- else if ((dialect & PPC_OPCODE_POWER4) != 0 && (value & -value) == value) -+ encoding, this is not backward compatible. Do not generate the -+ new form unless -mpower4 has been given, or -many and the two -+ operand form of mfcr was used. */ -+ else if ((value & -value) == value -+ && ((dialect & PPC_OPCODE_POWER4) != 0 -+ || ((dialect & PPC_OPCODE_ANY) != 0 -+ && (insn & (0x3ff << 1)) == 19 << 1))) - insn |= 1 << 20; - - /* Any other value on mfcr is an error. */ diff --git a/patches/binutils/2.15/binutils-arm-undef-imm.patch b/patches/binutils/2.15/binutils-arm-undef-imm.patch deleted file mode 100644 index 6bf403c..0000000 --- a/patches/binutils/2.15/binutils-arm-undef-imm.patch +++ /dev/null @@ -1,51 +0,0 @@ -From http://sources.redhat.com/cgi-bin/cvsweb.cgi/src/gas/config/tc-arm.c.diff?r1=1.168&r2=1.169&cvsroot=src -See also http://lists.arm.linux.org.uk/pipermail/linux-arm-kernel/2004-July/023128.html, -"[CRITICAL PATCH] 2.6: fix silent build error]" - -Revision 1.169, Fri Jul 2 11:12:29 2004 UTC (19 hours, 4 minutes ago) by nickc -Branch: MAIN -CVS Tags: binutils_latest_snapshot, HEAD -Changes since 1.168: +14 -1 lines - -(md_apply_fix3:BFD_RELOC_ARM_IMMEDIATE): Do not allow values which have come -from undefined symbols. -Always consider this fixup to have been processed as a reloc cannot be -generated for it. - - -=================================================================== -RCS file: /cvs/src/src/gas/config/tc-arm.c,v -retrieving revision 1.168 -retrieving revision 1.169 -diff -u -r1.168 -r1.169 ---- src/gas/config/tc-arm.c 2004/04/30 10:51:12 1.168 -+++ src/gas/config/tc-arm.c 2004/07/02 11:12:29 1.169 -@@ -12186,6 +12186,20 @@ - switch (fixP->fx_r_type) - { - case BFD_RELOC_ARM_IMMEDIATE: -+ /* We claim that this fixup has been processed here, -+ even if in fact we generate an error because we do -+ not have a reloc for it, so tc_gen_reloc will reject it. */ -+ fixP->fx_done = 1; -+ -+ if (fixP->fx_addsy -+ && ! S_IS_DEFINED (fixP->fx_addsy)) -+ { -+ as_bad_where (fixP->fx_file, fixP->fx_line, -+ _("undefined symbol %s used as an immediate value"), -+ S_GET_NAME (fixP->fx_addsy)); -+ break; -+ } -+ - newimm = validate_immediate (value); - temp = md_chars_to_number (buf, INSN_SIZE); - -@@ -12202,7 +12216,6 @@ - - newimm |= (temp & 0xfffff000); - md_number_to_chars (buf, (valueT) newimm, INSN_SIZE); -- fixP->fx_done = 1; - break; - - case BFD_RELOC_ARM_ADRL_IMMEDIATE: diff --git a/patches/binutils/2.15/binutils-skip-comments.patch b/patches/binutils/2.15/binutils-skip-comments.patch deleted file mode 100644 index 804a17e..0000000 --- a/patches/binutils/2.15/binutils-skip-comments.patch +++ /dev/null @@ -1,101 +0,0 @@ -Retrieved from http://sources.redhat.com/ml/binutils/2004-04/msg00646.html -Fixes -localealias.s:544: Error: junk at end of line, first unrecognized character is `,' -when building glibc-2.3.2 with gcc-3.4.0 and binutils-2.15.90.0.3 - -Paths adjusted to match crosstool's patcher. - -Message-Id: m3n052qw2g.fsf@whitebox.m5r.de -From: Andreas Schwab -To: Nathan Sidwell -Cc: Ian Lance Taylor , binutils at sources dot redhat dot com -Date: Fri, 23 Apr 2004 22:27:19 +0200 -Subject: Re: demand_empty_rest_of_line and ignore_rest_of_line - -Nathan Sidwell writes: - -> Index: read.c -> =================================================================== -> RCS file: /cvs/src/src/gas/read.c,v -> retrieving revision 1.76 -> diff -c -3 -p -r1.76 read.c -> *** read.c 12 Mar 2004 17:48:12 -0000 1.76 -> --- read.c 18 Mar 2004 09:56:05 -0000 -> *************** read_a_source_file (char *name) -> *** 1053,1059 **** -> #endif -> input_line_pointer--; -> /* Report unknown char as ignored. */ -> ! ignore_rest_of_line (); -> } -> -> #ifdef md_after_pass_hook -> --- 1053,1059 ---- -> #endif -> input_line_pointer--; -> /* Report unknown char as ignored. */ -> ! demand_empty_rest_of_line (); -> } -> -> #ifdef md_after_pass_hook - -This means that the unknown character is no longer ignored, despite the -comment. As a side effect a line starting with a line comment character -not followed by APP in NO_APP mode now triggers an error instead of just a -warning, breaking builds of glibc on m68k-linux. Earlier in -read_a_source_file where #APP is handled there is another comment that -claims that unknown comments are ignored, when in fact they aren't (only -the initial line comment character is skipped). - -Note that the presence of #APP will mess up the line counters, but -that appears to be difficult to fix. - -Andreas. - -2004-04-23 Andreas Schwab - - * read.c (read_a_source_file): Ignore unknown text after line - comment character. Fix misleading comment. - ---- binutils/gas/read.c.~1.78.~ 2004-04-23 08:58:23.000000000 +0200 -+++ binutils/gas/read.c 2004-04-23 21:49:01.000000000 +0200 -@@ -1,6 +1,6 @@ - /* read.c - read a source file - - Copyright 1986, 1987, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, -- 1998, 1999, 2000, 2001, 2002, 2003 Free Software Foundation, Inc. -+ 1998, 1999, 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc. - - This file is part of GAS, the GNU Assembler. - -@@ -950,10 +950,14 @@ read_a_source_file (char *name) - unsigned int new_length; - char *tmp_buf = 0; - -- bump_line_counters (); - s = input_line_pointer; - if (strncmp (s, "APP\n", 4)) -- continue; /* We ignore it */ -+ { -+ /* We ignore it */ -+ ignore_rest_of_line (); -+ continue; -+ } -+ bump_line_counters (); - s += 4; - - sb_new (&sbuf); -@@ -1052,7 +1056,7 @@ read_a_source_file (char *name) - continue; - #endif - input_line_pointer--; -- /* Report unknown char as ignored. */ -+ /* Report unknown char as error. */ - demand_empty_rest_of_line (); - } - - --- -Andreas Schwab, SuSE Labs, schwab@suse.de -SuSE Linux AG, MaxfeldstraÃe 5, 90409 NÃrnberg, Germany -Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 -"And now for something completely different." diff --git a/patches/binutils/2.15/cross-gprof.patch b/patches/binutils/2.15/cross-gprof.patch deleted file mode 100644 index ea6c18f..0000000 --- a/patches/binutils/2.15/cross-gprof.patch +++ /dev/null @@ -1,22 +0,0 @@ ---- binutils-2.15/configure.old 2004-07-21 21:36:47.000000000 -0700 -+++ binutils-2.15/configure 2004-07-21 21:37:08.000000000 -0700 -@@ -999,7 +999,7 @@ - - # Some tools are only suitable for building in a "native" situation. - # Remove these if host!=target. --native_only="autoconf automake libtool fileutils find gawk gettext gzip hello indent m4 rcs recode sed shellutils tar textutils uudecode wdiff gprof target-groff guile perl time ash bash bzip2 prms gnuserv target-gperf" -+native_only="autoconf automake libtool fileutils find gawk gettext gzip hello indent m4 rcs recode sed shellutils tar textutils uudecode wdiff target-groff guile perl time ash bash bzip2 prms gnuserv target-gperf" - - # Similarly, some are only suitable for cross toolchains. - # Remove these if host=target. ---- binutils-2.15/configure.in.old 2004-07-21 21:37:19.000000000 -0700 -+++ binutils-2.15/configure.in 2004-07-21 21:37:34.000000000 -0700 -@@ -236,7 +236,7 @@ - - # Some tools are only suitable for building in a "native" situation. - # Remove these if host!=target. --native_only="autoconf automake libtool fileutils find gawk gettext gzip hello indent m4 rcs recode sed shellutils tar textutils uudecode wdiff gprof target-groff guile perl time ash bash bzip2 prms gnuserv target-gperf" -+native_only="autoconf automake libtool fileutils find gawk gettext gzip hello indent m4 rcs recode sed shellutils tar textutils uudecode wdiff target-groff guile perl time ash bash bzip2 prms gnuserv target-gperf" - - # Similarly, some are only suitable for cross toolchains. - # Remove these if host=target. diff --git a/patches/binutils/2.15/gccpr15247-fix.patch b/patches/binutils/2.15/gccpr15247-fix.patch deleted file mode 100644 index 967bf7f..0000000 --- a/patches/binutils/2.15/gccpr15247-fix.patch +++ /dev/null @@ -1,192 +0,0 @@ -See -http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15247 - -Fixes spurious error -/tmp/ccvNi4ou.s: Assembler messages: -/tmp/ccvNi4ou.s:2310: Error: Illegal operands: There are only 32 single precision f registers; [0-31] -make[2]: *** [/home/dank/wk/crosstool-0.28-rc10/build/sparc64-unknown-linux-gnu/gcc-3.4.0-glibc-2.3.2/build-glibc/math/dosincos.o] Error 1 - -when compiling glibc's dosincos.c with gcc-3.4.0 - -=================================================================== -RCS file: /cvs/src/src/opcodes/sparc-opc.c,v -retrieving revision 1.9 -retrieving revision 1.10 -diff -u -r1.9 -r1.10 ---- src/opcodes/sparc-opc.c 2004/01/18 23:46:32 1.9 -+++ src/opcodes/sparc-opc.c 2004/04/20 10:23:51 1.10 -@@ -1273,110 +1273,72 @@ - #define FM_DF 2 /* v9 */ - #define FM_QF 3 /* v9 */ - --#define fmovicc(opcode, fpsize, cond, flags) /* v9 */ \ --{ opcode, F3F(2, 0x35, 0x100+fpsize)|MCOND(cond,0), F3F(~2, ~0x35, ~(0x100+fpsize))|MCOND(~cond,~0), "z,f,g", flags, v9 }, \ --{ opcode, F3F(2, 0x35, 0x180+fpsize)|MCOND(cond,0), F3F(~2, ~0x35, ~(0x180+fpsize))|MCOND(~cond,~0), "Z,f,g", flags, v9 } -- --#define fmovfcc(opcode, fpsize, fcond, flags) /* v9 */ \ --{ opcode, F3F(2, 0x35, 0x000+fpsize)|MCOND(fcond,0), F3F(~2, ~0x35, ~(0x000+fpsize))|MCOND(~fcond,~0), "6,f,g", flags, v9 }, \ --{ opcode, F3F(2, 0x35, 0x040+fpsize)|MCOND(fcond,0), F3F(~2, ~0x35, ~(0x040+fpsize))|MCOND(~fcond,~0), "7,f,g", flags, v9 }, \ --{ opcode, F3F(2, 0x35, 0x080+fpsize)|MCOND(fcond,0), F3F(~2, ~0x35, ~(0x080+fpsize))|MCOND(~fcond,~0), "8,f,g", flags, v9 }, \ --{ opcode, F3F(2, 0x35, 0x0c0+fpsize)|MCOND(fcond,0), F3F(~2, ~0x35, ~(0x0c0+fpsize))|MCOND(~fcond,~0), "9,f,g", flags, v9 } -+#define fmoviccx(opcode, fpsize, args, cond, flags) /* v9 */ \ -+{ opcode, F3F(2, 0x35, 0x100+fpsize)|MCOND(cond,0), F3F(~2, ~0x35, ~(0x100+fpsize))|MCOND(~cond,~0), "z," args, flags, v9 }, \ -+{ opcode, F3F(2, 0x35, 0x180+fpsize)|MCOND(cond,0), F3F(~2, ~0x35, ~(0x180+fpsize))|MCOND(~cond,~0), "Z," args, flags, v9 } -+ -+#define fmovfccx(opcode, fpsize, args, fcond, flags) /* v9 */ \ -+{ opcode, F3F(2, 0x35, 0x000+fpsize)|MCOND(fcond,0), F3F(~2, ~0x35, ~(0x000+fpsize))|MCOND(~fcond,~0), "6," args, flags, v9 }, \ -+{ opcode, F3F(2, 0x35, 0x040+fpsize)|MCOND(fcond,0), F3F(~2, ~0x35, ~(0x040+fpsize))|MCOND(~fcond,~0), "7," args, flags, v9 }, \ -+{ opcode, F3F(2, 0x35, 0x080+fpsize)|MCOND(fcond,0), F3F(~2, ~0x35, ~(0x080+fpsize))|MCOND(~fcond,~0), "8," args, flags, v9 }, \ -+{ opcode, F3F(2, 0x35, 0x0c0+fpsize)|MCOND(fcond,0), F3F(~2, ~0x35, ~(0x0c0+fpsize))|MCOND(~fcond,~0), "9," args, flags, v9 } - - /* FIXME: use fmovicc/fmovfcc? */ /* v9 */ --#define fmovcc(opcode, fpsize, cond, fcond, flags) /* v9 */ \ --{ opcode, F3F(2, 0x35, 0x100+fpsize)|MCOND(cond,0), F3F(~2, ~0x35, ~(0x100+fpsize))|MCOND(~cond,~0), "z,f,g", flags | F_FLOAT, v9 }, \ --{ opcode, F3F(2, 0x35, 0x000+fpsize)|MCOND(fcond,0), F3F(~2, ~0x35, ~(0x000+fpsize))|MCOND(~fcond,~0), "6,f,g", flags | F_FLOAT, v9 }, \ --{ opcode, F3F(2, 0x35, 0x180+fpsize)|MCOND(cond,0), F3F(~2, ~0x35, ~(0x180+fpsize))|MCOND(~cond,~0), "Z,f,g", flags | F_FLOAT, v9 }, \ --{ opcode, F3F(2, 0x35, 0x040+fpsize)|MCOND(fcond,0), F3F(~2, ~0x35, ~(0x040+fpsize))|MCOND(~fcond,~0), "7,f,g", flags | F_FLOAT, v9 }, \ --{ opcode, F3F(2, 0x35, 0x080+fpsize)|MCOND(fcond,0), F3F(~2, ~0x35, ~(0x080+fpsize))|MCOND(~fcond,~0), "8,f,g", flags | F_FLOAT, v9 }, \ --{ opcode, F3F(2, 0x35, 0x0c0+fpsize)|MCOND(fcond,0), F3F(~2, ~0x35, ~(0x0c0+fpsize))|MCOND(~fcond,~0), "9,f,g", flags | F_FLOAT, v9 } -- --/* v9 */ fmovcc ("fmovda", FM_DF, CONDA, FCONDA, 0), --/* v9 */ fmovcc ("fmovqa", FM_QF, CONDA, FCONDA, 0), --/* v9 */ fmovcc ("fmovsa", FM_SF, CONDA, FCONDA, 0), --/* v9 */ fmovicc ("fmovdcc", FM_DF, CONDCC, 0), --/* v9 */ fmovicc ("fmovqcc", FM_QF, CONDCC, 0), --/* v9 */ fmovicc ("fmovscc", FM_SF, CONDCC, 0), --/* v9 */ fmovicc ("fmovdcs", FM_DF, CONDCS, 0), --/* v9 */ fmovicc ("fmovqcs", FM_QF, CONDCS, 0), --/* v9 */ fmovicc ("fmovscs", FM_SF, CONDCS, 0), --/* v9 */ fmovcc ("fmovde", FM_DF, CONDE, FCONDE, 0), --/* v9 */ fmovcc ("fmovqe", FM_QF, CONDE, FCONDE, 0), --/* v9 */ fmovcc ("fmovse", FM_SF, CONDE, FCONDE, 0), --/* v9 */ fmovcc ("fmovdg", FM_DF, CONDG, FCONDG, 0), --/* v9 */ fmovcc ("fmovqg", FM_QF, CONDG, FCONDG, 0), --/* v9 */ fmovcc ("fmovsg", FM_SF, CONDG, FCONDG, 0), --/* v9 */ fmovcc ("fmovdge", FM_DF, CONDGE, FCONDGE, 0), --/* v9 */ fmovcc ("fmovqge", FM_QF, CONDGE, FCONDGE, 0), --/* v9 */ fmovcc ("fmovsge", FM_SF, CONDGE, FCONDGE, 0), --/* v9 */ fmovicc ("fmovdgeu", FM_DF, CONDGEU, F_ALIAS), --/* v9 */ fmovicc ("fmovqgeu", FM_QF, CONDGEU, F_ALIAS), --/* v9 */ fmovicc ("fmovsgeu", FM_SF, CONDGEU, F_ALIAS), --/* v9 */ fmovicc ("fmovdgu", FM_DF, CONDGU, 0), --/* v9 */ fmovicc ("fmovqgu", FM_QF, CONDGU, 0), --/* v9 */ fmovicc ("fmovsgu", FM_SF, CONDGU, 0), --/* v9 */ fmovcc ("fmovdl", FM_DF, CONDL, FCONDL, 0), --/* v9 */ fmovcc ("fmovql", FM_QF, CONDL, FCONDL, 0), --/* v9 */ fmovcc ("fmovsl", FM_SF, CONDL, FCONDL, 0), --/* v9 */ fmovcc ("fmovdle", FM_DF, CONDLE, FCONDLE, 0), --/* v9 */ fmovcc ("fmovqle", FM_QF, CONDLE, FCONDLE, 0), --/* v9 */ fmovcc ("fmovsle", FM_SF, CONDLE, FCONDLE, 0), --/* v9 */ fmovicc ("fmovdleu", FM_DF, CONDLEU, 0), --/* v9 */ fmovicc ("fmovqleu", FM_QF, CONDLEU, 0), --/* v9 */ fmovicc ("fmovsleu", FM_SF, CONDLEU, 0), --/* v9 */ fmovfcc ("fmovdlg", FM_DF, FCONDLG, 0), --/* v9 */ fmovfcc ("fmovqlg", FM_QF, FCONDLG, 0), --/* v9 */ fmovfcc ("fmovslg", FM_SF, FCONDLG, 0), --/* v9 */ fmovicc ("fmovdlu", FM_DF, CONDLU, F_ALIAS), --/* v9 */ fmovicc ("fmovqlu", FM_QF, CONDLU, F_ALIAS), --/* v9 */ fmovicc ("fmovslu", FM_SF, CONDLU, F_ALIAS), --/* v9 */ fmovcc ("fmovdn", FM_DF, CONDN, FCONDN, 0), --/* v9 */ fmovcc ("fmovqn", FM_QF, CONDN, FCONDN, 0), --/* v9 */ fmovcc ("fmovsn", FM_SF, CONDN, FCONDN, 0), --/* v9 */ fmovcc ("fmovdne", FM_DF, CONDNE, FCONDNE, 0), --/* v9 */ fmovcc ("fmovqne", FM_QF, CONDNE, FCONDNE, 0), --/* v9 */ fmovcc ("fmovsne", FM_SF, CONDNE, FCONDNE, 0), --/* v9 */ fmovicc ("fmovdneg", FM_DF, CONDNEG, 0), --/* v9 */ fmovicc ("fmovqneg", FM_QF, CONDNEG, 0), --/* v9 */ fmovicc ("fmovsneg", FM_SF, CONDNEG, 0), --/* v9 */ fmovcc ("fmovdnz", FM_DF, CONDNZ, FCONDNZ, F_ALIAS), --/* v9 */ fmovcc ("fmovqnz", FM_QF, CONDNZ, FCONDNZ, F_ALIAS), --/* v9 */ fmovcc ("fmovsnz", FM_SF, CONDNZ, FCONDNZ, F_ALIAS), --/* v9 */ fmovfcc ("fmovdo", FM_DF, FCONDO, 0), --/* v9 */ fmovfcc ("fmovqo", FM_QF, FCONDO, 0), --/* v9 */ fmovfcc ("fmovso", FM_SF, FCONDO, 0), --/* v9 */ fmovicc ("fmovdpos", FM_DF, CONDPOS, 0), --/* v9 */ fmovicc ("fmovqpos", FM_QF, CONDPOS, 0), --/* v9 */ fmovicc ("fmovspos", FM_SF, CONDPOS, 0), --/* v9 */ fmovfcc ("fmovdu", FM_DF, FCONDU, 0), --/* v9 */ fmovfcc ("fmovqu", FM_QF, FCONDU, 0), --/* v9 */ fmovfcc ("fmovsu", FM_SF, FCONDU, 0), --/* v9 */ fmovfcc ("fmovdue", FM_DF, FCONDUE, 0), --/* v9 */ fmovfcc ("fmovque", FM_QF, FCONDUE, 0), --/* v9 */ fmovfcc ("fmovsue", FM_SF, FCONDUE, 0), --/* v9 */ fmovfcc ("fmovdug", FM_DF, FCONDUG, 0), --/* v9 */ fmovfcc ("fmovqug", FM_QF, FCONDUG, 0), --/* v9 */ fmovfcc ("fmovsug", FM_SF, FCONDUG, 0), --/* v9 */ fmovfcc ("fmovduge", FM_DF, FCONDUGE, 0), --/* v9 */ fmovfcc ("fmovquge", FM_QF, FCONDUGE, 0), --/* v9 */ fmovfcc ("fmovsuge", FM_SF, FCONDUGE, 0), --/* v9 */ fmovfcc ("fmovdul", FM_DF, FCONDUL, 0), --/* v9 */ fmovfcc ("fmovqul", FM_QF, FCONDUL, 0), --/* v9 */ fmovfcc ("fmovsul", FM_SF, FCONDUL, 0), --/* v9 */ fmovfcc ("fmovdule", FM_DF, FCONDULE, 0), --/* v9 */ fmovfcc ("fmovqule", FM_QF, FCONDULE, 0), --/* v9 */ fmovfcc ("fmovsule", FM_SF, FCONDULE, 0), --/* v9 */ fmovicc ("fmovdvc", FM_DF, CONDVC, 0), --/* v9 */ fmovicc ("fmovqvc", FM_QF, CONDVC, 0), --/* v9 */ fmovicc ("fmovsvc", FM_SF, CONDVC, 0), --/* v9 */ fmovicc ("fmovdvs", FM_DF, CONDVS, 0), --/* v9 */ fmovicc ("fmovqvs", FM_QF, CONDVS, 0), --/* v9 */ fmovicc ("fmovsvs", FM_SF, CONDVS, 0), --/* v9 */ fmovcc ("fmovdz", FM_DF, CONDZ, FCONDZ, F_ALIAS), --/* v9 */ fmovcc ("fmovqz", FM_QF, CONDZ, FCONDZ, F_ALIAS), --/* v9 */ fmovcc ("fmovsz", FM_SF, CONDZ, FCONDZ, F_ALIAS), -- -+#define fmovccx(opcode, fpsize, args, cond, fcond, flags) /* v9 */ \ -+{ opcode, F3F(2, 0x35, 0x100+fpsize)|MCOND(cond,0), F3F(~2, ~0x35, ~(0x100+fpsize))|MCOND(~cond,~0), "z," args, flags | F_FLOAT, v9 }, \ -+{ opcode, F3F(2, 0x35, 0x000+fpsize)|MCOND(fcond,0), F3F(~2, ~0x35, ~(0x000+fpsize))|MCOND(~fcond,~0), "6," args, flags | F_FLOAT, v9 }, \ -+{ opcode, F3F(2, 0x35, 0x180+fpsize)|MCOND(cond,0), F3F(~2, ~0x35, ~(0x180+fpsize))|MCOND(~cond,~0), "Z," args, flags | F_FLOAT, v9 }, \ -+{ opcode, F3F(2, 0x35, 0x040+fpsize)|MCOND(fcond,0), F3F(~2, ~0x35, ~(0x040+fpsize))|MCOND(~fcond,~0), "7," args, flags | F_FLOAT, v9 }, \ -+{ opcode, F3F(2, 0x35, 0x080+fpsize)|MCOND(fcond,0), F3F(~2, ~0x35, ~(0x080+fpsize))|MCOND(~fcond,~0), "8," args, flags | F_FLOAT, v9 }, \ -+{ opcode, F3F(2, 0x35, 0x0c0+fpsize)|MCOND(fcond,0), F3F(~2, ~0x35, ~(0x0c0+fpsize))|MCOND(~fcond,~0), "9," args, flags | F_FLOAT, v9 } -+ -+#define fmovicc(suffix, cond, flags) /* v9 */ \ -+fmoviccx("fmovd" suffix, FM_DF, "B,H", cond, flags), \ -+fmoviccx("fmovq" suffix, FM_QF, "R,J", cond, flags), \ -+fmoviccx("fmovs" suffix, FM_SF, "f,g", cond, flags) -+ -+#define fmovfcc(suffix, fcond, flags) /* v9 */ \ -+fmovfccx("fmovd" suffix, FM_DF, "B,H", fcond, flags), \ -+fmovfccx("fmovq" suffix, FM_QF, "R,J", fcond, flags), \ -+fmovfccx("fmovs" suffix, FM_SF, "f,g", fcond, flags) -+ -+#define fmovcc(suffix, cond, fcond, flags) /* v9 */ \ -+fmovccx("fmovd" suffix, FM_DF, "B,H", cond, fcond, flags), \ -+fmovccx("fmovq" suffix, FM_QF, "R,J", cond, fcond, flags), \ -+fmovccx("fmovs" suffix, FM_SF, "f,g", cond, fcond, flags) -+ -+/* v9 */ fmovcc ("a", CONDA, FCONDA, 0), -+/* v9 */ fmovicc ("cc", CONDCC, 0), -+/* v9 */ fmovicc ("cs", CONDCS, 0), -+/* v9 */ fmovcc ("e", CONDE, FCONDE, 0), -+/* v9 */ fmovcc ("g", CONDG, FCONDG, 0), -+/* v9 */ fmovcc ("ge", CONDGE, FCONDGE, 0), -+/* v9 */ fmovicc ("geu", CONDGEU, F_ALIAS), -+/* v9 */ fmovicc ("gu", CONDGU, 0), -+/* v9 */ fmovcc ("l", CONDL, FCONDL, 0), -+/* v9 */ fmovcc ("le", CONDLE, FCONDLE, 0), -+/* v9 */ fmovicc ("leu", CONDLEU, 0), -+/* v9 */ fmovfcc ("lg", FCONDLG, 0), -+/* v9 */ fmovicc ("lu", CONDLU, F_ALIAS), -+/* v9 */ fmovcc ("n", CONDN, FCONDN, 0), -+/* v9 */ fmovcc ("ne", CONDNE, FCONDNE, 0), -+/* v9 */ fmovicc ("neg", CONDNEG, 0), -+/* v9 */ fmovcc ("nz", CONDNZ, FCONDNZ, F_ALIAS), -+/* v9 */ fmovfcc ("o", FCONDO, 0), -+/* v9 */ fmovicc ("pos", CONDPOS, 0), -+/* v9 */ fmovfcc ("u", FCONDU, 0), -+/* v9 */ fmovfcc ("ue", FCONDUE, 0), -+/* v9 */ fmovfcc ("ug", FCONDUG, 0), -+/* v9 */ fmovfcc ("uge", FCONDUGE, 0), -+/* v9 */ fmovfcc ("ul", FCONDUL, 0), -+/* v9 */ fmovfcc ("ule", FCONDULE, 0), -+/* v9 */ fmovicc ("vc", CONDVC, 0), -+/* v9 */ fmovicc ("vs", CONDVS, 0), -+/* v9 */ fmovcc ("z", CONDZ, FCONDZ, F_ALIAS), -+ -+#undef fmoviccx /* v9 */ -+#undef fmovfccx /* v9 */ -+#undef fmovccx /* v9 */ - #undef fmovicc /* v9 */ - #undef fmovfcc /* v9 */ - #undef fmovcc /* v9 */ diff --git a/patches/binutils/2.15/ld-2.15-callahan.patch b/patches/binutils/2.15/ld-2.15-callahan.patch deleted file mode 100644 index bb4a69c..0000000 --- a/patches/binutils/2.15/ld-2.15-callahan.patch +++ /dev/null @@ -1,677 +0,0 @@ -Signed-off-by: dank@kegel.com -Fixes ld speed issue. -See http://weblogs.mozillazine.org/roc/archives/2005/02/optimizing_gnu.html -See thread "Re: optimizations for 3x speedup in ld", -http://sources.redhat.com/ml/binutils/2005-03/msg00847.html - -Wildcard section matching enhancement, backported from the binutils CVS tree. -Here's the CVS log comment from the original change to ldlang.c: - -revision 1.177 -date: 2005/04/06 15:33:02; author: jakub; state: Exp; lines: +438 -51 -2005-04-06 Jakub Jelinek - - * ldlang.c: Formatting. - (walk_wild_consider_section): Remember return value from wildcardp. - (is_simple_wild): Use strcspn instead of 2 strpbrk calls and strlen. - (wild_spec_can_overlap): Use strcspn instead of strpbrk and strlen. - -2005-04-06 Robert O'Callahan - - * ld.h (lean_section_userdata_type): Remove. - (fat_section_userdata_type): Remove file field. - (SECTION_USERDATA_SIZE): Remove. - * ldlang.c (init_os): Eliminate initialization of unused - lean_section_userdata_type. - - * ldlang.h (callback_t, walk_wild_section_handler_t): New - typedefs. - (struct lang_wild_statement_struct): Add walk_wild_section_handler - and handler_data fields. - * ldlang.c (callback_t): Removed. - (walk_wild_consider_section, walk_wild_section_general, - section_iterator_callback, find_section, is_simple_wild, - match_simple_wild, walk_wild_section_specs1_wild0, - walk_wild_section_specs1_wild1, walk_wild_section_specs2_wild1, - walk_wild_section_specs3_wild2, walk_wild_section_specs4_wild2, - wild_spec_can_overlap, analyze_walk_wild_section_handler): New - functions. - (lang_add_wild): Call analyze_walk_wild_section_handler. - (walk_wild_section): Renamed to walk_wild_section_general and - created a wrapper function. - (section_iterator_callback_data): New typedef. - -Note that bfd_get_section_by_name_if didn't exist in 2.15, so it was backported -as well. - ---- binutils-2.15/bfd/bfd-in2.h.old 2004-05-17 15:35:56.000000000 -0400 -+++ binutils-2.15/bfd/bfd-in2.h 2006-02-09 11:54:45.989940000 -0500 -@@ -1425,6 +1425,10 @@ - - asection *bfd_get_section_by_name (bfd *abfd, const char *name); - -+asection *bfd_get_section_by_name_if (bfd *abfd, const char *name, -+ bfd_boolean (*operation) (bfd *, asection *, void *), -+ void *user_storage); -+ - char *bfd_get_unique_section_name - (bfd *abfd, const char *templat, int *count); - ---- binutils-2.15/bfd/section.c.old 2003-12-01 01:33:01.000000000 -0500 -+++ binutils-2.15/bfd/section.c 2006-01-23 14:16:54.768993000 -0500 -@@ -801,6 +801,57 @@ - - /* - FUNCTION -+ bfd_get_section_by_name_if -+ -+SYNOPSIS -+ asection *bfd_get_section_by_name_if -+ (bfd *abfd, -+ const char *name, -+ bfd_boolean (*func) (bfd *abfd, asection *sect, void *obj), -+ void *obj); -+ -+DESCRIPTION -+ Call the provided function @var{func} for each section -+ attached to the BFD @var{abfd} whose name matches @var{name}, -+ passing @var{obj} as an argument. The function will be called -+ as if by -+ -+| func (abfd, the_section, obj); -+ -+ It returns the first section for which @var{func} returns true, -+ otherwise <>. -+ -+*/ -+ -+asection * -+bfd_get_section_by_name_if (bfd *abfd, const char *name, -+ bfd_boolean (*operation) (bfd *, -+ asection *, -+ void *), -+ void *user_storage) -+{ -+ struct section_hash_entry *sh; -+ unsigned long hash; -+ -+ sh = section_hash_lookup (&abfd->section_htab, name, FALSE, FALSE); -+ if (sh == NULL) -+ return NULL; -+ -+ hash = sh->root.hash; -+ do -+ { -+ if ((*operation) (abfd, &sh->section, user_storage)) -+ return &sh->section; -+ sh = (struct section_hash_entry *) sh->root.next; -+ } -+ while (sh != NULL && sh->root.hash == hash -+ && strcmp (sh->root.string, name) == 0); -+ -+ return NULL; -+} -+ -+/* -+FUNCTION - bfd_get_unique_section_name - - SYNOPSIS ---- binutils-2.15/ld/ldlang.c.old 2004-05-17 15:36:16.000000000 -0400 -+++ binutils-2.15/ld/ldlang.c 2006-01-23 13:40:12.745499000 -0500 -@@ -81,9 +81,6 @@ - static void lang_record_phdrs (void); - static void lang_do_version_exports_section (void); - --typedef void (*callback_t) (lang_wild_statement_type *, struct wildcard_list *, -- asection *, lang_input_statement_type *, void *); -- - /* Exported variables. */ - lang_output_section_statement_type *abs_output_section; - lang_statement_list_type lang_output_section_statement; -@@ -138,21 +135,71 @@ - - /* Generic traversal routines for finding matching sections. */ - -+/* Try processing a section against a wildcard. This just calls -+ the callback unless the filename exclusion list is present -+ and excludes the file. It's hardly ever present so this -+ function is very fast. */ -+ -+static void -+walk_wild_consider_section (lang_wild_statement_type *ptr, -+ lang_input_statement_type *file, -+ asection *s, -+ struct wildcard_list *sec, -+ callback_t callback, -+ void *data) -+{ -+ bfd_boolean skip = FALSE; -+ struct name_list *list_tmp; -+ -+ /* Don't process sections from files which were -+ excluded. */ -+ for (list_tmp = sec->spec.exclude_name_list; -+ list_tmp; -+ list_tmp = list_tmp->next) -+ { -+ bfd_boolean is_wildcard = wildcardp (list_tmp->name); -+ if (is_wildcard) -+ skip = fnmatch (list_tmp->name, file->filename, 0) == 0; -+ else -+ skip = strcmp (list_tmp->name, file->filename) == 0; -+ -+ /* If this file is part of an archive, and the archive is -+ excluded, exclude this file. */ -+ if (! skip && file->the_bfd != NULL -+ && file->the_bfd->my_archive != NULL -+ && file->the_bfd->my_archive->filename != NULL) -+ { -+ if (is_wildcard) -+ skip = fnmatch (list_tmp->name, -+ file->the_bfd->my_archive->filename, -+ 0) == 0; -+ else -+ skip = strcmp (list_tmp->name, -+ file->the_bfd->my_archive->filename) == 0; -+ } -+ -+ if (skip) -+ break; -+ } -+ -+ if (!skip) -+ (*callback) (ptr, sec, s, file, data); -+} -+ -+/* Lowest common denominator routine that can handle everything correctly, -+ but slowly. */ -+ - static void --walk_wild_section (lang_wild_statement_type *ptr, -- lang_input_statement_type *file, -- callback_t callback, -- void *data) -+walk_wild_section_general (lang_wild_statement_type *ptr, -+ lang_input_statement_type *file, -+ callback_t callback, -+ void *data) - { - asection *s; -- -- if (file->just_syms_flag) -- return; -+ struct wildcard_list *sec; - - for (s = file->the_bfd->sections; s != NULL; s = s->next) - { -- struct wildcard_list *sec; -- - sec = ptr->section_list; - if (sec == NULL) - (*callback) (ptr, sec, s, file, data); -@@ -160,39 +207,8 @@ - while (sec != NULL) - { - bfd_boolean skip = FALSE; -- struct name_list *list_tmp; -- -- /* Don't process sections from files which were -- excluded. */ -- for (list_tmp = sec->spec.exclude_name_list; -- list_tmp; -- list_tmp = list_tmp->next) -- { -- if (wildcardp (list_tmp->name)) -- skip = fnmatch (list_tmp->name, file->filename, 0) == 0; -- else -- skip = strcmp (list_tmp->name, file->filename) == 0; -- -- /* If this file is part of an archive, and the archive is -- excluded, exclude this file. */ -- if (! skip && file->the_bfd != NULL -- && file->the_bfd->my_archive != NULL -- && file->the_bfd->my_archive->filename != NULL) -- { -- if (wildcardp (list_tmp->name)) -- skip = fnmatch (list_tmp->name, -- file->the_bfd->my_archive->filename, -- 0) == 0; -- else -- skip = strcmp (list_tmp->name, -- file->the_bfd->my_archive->filename) == 0; -- } -- -- if (skip) -- break; -- } - -- if (!skip && sec->spec.name != NULL) -+ if (sec->spec.name != NULL) - { - const char *sname = bfd_get_section_name (file->the_bfd, s); - -@@ -203,13 +219,381 @@ - } - - if (!skip) -- (*callback) (ptr, sec, s, file, data); -+ walk_wild_consider_section (ptr, file, s, sec, callback, data); - - sec = sec->next; - } - } - } - -+/* Routines to find a single section given its name. If there's more -+ than one section with that name, we report that. */ -+ -+typedef struct -+{ -+ asection *found_section; -+ bfd_boolean multiple_sections_found; -+} section_iterator_callback_data; -+ -+static bfd_boolean -+section_iterator_callback (bfd *bfd ATTRIBUTE_UNUSED, asection *s, void *data) -+{ -+ section_iterator_callback_data *d = data; -+ -+ if (d->found_section != NULL) -+ { -+ d->multiple_sections_found = TRUE; -+ return TRUE; -+ } -+ -+ d->found_section = s; -+ return FALSE; -+} -+ -+static asection * -+find_section (lang_input_statement_type *file, -+ struct wildcard_list *sec, -+ bfd_boolean *multiple_sections_found) -+{ -+ section_iterator_callback_data cb_data = { NULL, FALSE }; -+ -+ bfd_get_section_by_name_if (file->the_bfd, sec->spec.name, -+ section_iterator_callback, &cb_data); -+ *multiple_sections_found = cb_data.multiple_sections_found; -+ return cb_data.found_section; -+} -+ -+/* Code for handling simple wildcards without going through fnmatch, -+ which can be expensive because of charset translations etc. */ -+ -+/* A simple wild is a literal string followed by a single '*', -+ where the literal part is at least 4 characters long. */ -+ -+static bfd_boolean -+is_simple_wild (const char *name) -+{ -+ size_t len = strcspn (name, "*?["); -+ return len >= 4 && name[len] == '*' && name[len + 1] == '\0'; -+} -+ -+static bfd_boolean -+match_simple_wild (const char *pattern, const char *name) -+{ -+ /* The first four characters of the pattern are guaranteed valid -+ non-wildcard characters. So we can go faster. */ -+ if (pattern[0] != name[0] || pattern[1] != name[1] -+ || pattern[2] != name[2] || pattern[3] != name[3]) -+ return FALSE; -+ -+ pattern += 4; -+ name += 4; -+ while (*pattern != '*') -+ if (*name++ != *pattern++) -+ return FALSE; -+ -+ return TRUE; -+} -+ -+/* Specialized, optimized routines for handling different kinds of -+ wildcards */ -+ -+static void -+walk_wild_section_specs1_wild0 (lang_wild_statement_type *ptr, -+ lang_input_statement_type *file, -+ callback_t callback, -+ void *data) -+{ -+ /* We can just do a hash lookup for the section with the right name. -+ But if that lookup discovers more than one section with the name -+ (should be rare), we fall back to the general algorithm because -+ we would otherwise have to sort the sections to make sure they -+ get processed in the bfd's order. */ -+ bfd_boolean multiple_sections_found; -+ struct wildcard_list *sec0 = ptr->handler_data[0]; -+ asection *s0 = find_section (file, sec0, &multiple_sections_found); -+ -+ if (multiple_sections_found) -+ walk_wild_section_general (ptr, file, callback, data); -+ else if (s0) -+ walk_wild_consider_section (ptr, file, s0, sec0, callback, data); -+} -+ -+static void -+walk_wild_section_specs1_wild1 (lang_wild_statement_type *ptr, -+ lang_input_statement_type *file, -+ callback_t callback, -+ void *data) -+{ -+ asection *s; -+ struct wildcard_list *wildsec0 = ptr->handler_data[0]; -+ -+ for (s = file->the_bfd->sections; s != NULL; s = s->next) -+ { -+ const char *sname = bfd_get_section_name (file->the_bfd, s); -+ bfd_boolean skip = !match_simple_wild (wildsec0->spec.name, sname); -+ -+ if (!skip) -+ walk_wild_consider_section (ptr, file, s, wildsec0, callback, data); -+ } -+} -+ -+static void -+walk_wild_section_specs2_wild1 (lang_wild_statement_type *ptr, -+ lang_input_statement_type *file, -+ callback_t callback, -+ void *data) -+{ -+ asection *s; -+ struct wildcard_list *sec0 = ptr->handler_data[0]; -+ struct wildcard_list *wildsec1 = ptr->handler_data[1]; -+ bfd_boolean multiple_sections_found; -+ asection *s0 = find_section (file, sec0, &multiple_sections_found); -+ -+ if (multiple_sections_found) -+ { -+ walk_wild_section_general (ptr, file, callback, data); -+ return; -+ } -+ -+ /* Note that if the section was not found, s0 is NULL and -+ we'll simply never succeed the s == s0 test below. */ -+ for (s = file->the_bfd->sections; s != NULL; s = s->next) -+ { -+ /* Recall that in this code path, a section cannot satisfy more -+ than one spec, so if s == s0 then it cannot match -+ wildspec1. */ -+ if (s == s0) -+ walk_wild_consider_section (ptr, file, s, sec0, callback, data); -+ else -+ { -+ const char *sname = bfd_get_section_name (file->the_bfd, s); -+ bfd_boolean skip = !match_simple_wild (wildsec1->spec.name, sname); -+ -+ if (!skip) -+ walk_wild_consider_section (ptr, file, s, wildsec1, callback, -+ data); -+ } -+ } -+} -+ -+static void -+walk_wild_section_specs3_wild2 (lang_wild_statement_type *ptr, -+ lang_input_statement_type *file, -+ callback_t callback, -+ void *data) -+{ -+ asection *s; -+ struct wildcard_list *sec0 = ptr->handler_data[0]; -+ struct wildcard_list *wildsec1 = ptr->handler_data[1]; -+ struct wildcard_list *wildsec2 = ptr->handler_data[2]; -+ bfd_boolean multiple_sections_found; -+ asection *s0 = find_section (file, sec0, &multiple_sections_found); -+ -+ if (multiple_sections_found) -+ { -+ walk_wild_section_general (ptr, file, callback, data); -+ return; -+ } -+ -+ for (s = file->the_bfd->sections; s != NULL; s = s->next) -+ { -+ if (s == s0) -+ walk_wild_consider_section (ptr, file, s, sec0, callback, data); -+ else -+ { -+ const char *sname = bfd_get_section_name (file->the_bfd, s); -+ bfd_boolean skip = !match_simple_wild (wildsec1->spec.name, sname); -+ -+ if (!skip) -+ walk_wild_consider_section (ptr, file, s, wildsec1, callback, data); -+ else -+ { -+ skip = !match_simple_wild (wildsec2->spec.name, sname); -+ if (!skip) -+ walk_wild_consider_section (ptr, file, s, wildsec2, callback, -+ data); -+ } -+ } -+ } -+} -+ -+static void -+walk_wild_section_specs4_wild2 (lang_wild_statement_type *ptr, -+ lang_input_statement_type *file, -+ callback_t callback, -+ void *data) -+{ -+ asection *s; -+ struct wildcard_list *sec0 = ptr->handler_data[0]; -+ struct wildcard_list *sec1 = ptr->handler_data[1]; -+ struct wildcard_list *wildsec2 = ptr->handler_data[2]; -+ struct wildcard_list *wildsec3 = ptr->handler_data[3]; -+ bfd_boolean multiple_sections_found; -+ asection *s0 = find_section (file, sec0, &multiple_sections_found), *s1; -+ -+ if (multiple_sections_found) -+ { -+ walk_wild_section_general (ptr, file, callback, data); -+ return; -+ } -+ -+ s1 = find_section (file, sec1, &multiple_sections_found); -+ if (multiple_sections_found) -+ { -+ walk_wild_section_general (ptr, file, callback, data); -+ return; -+ } -+ -+ for (s = file->the_bfd->sections; s != NULL; s = s->next) -+ { -+ if (s == s0) -+ walk_wild_consider_section (ptr, file, s, sec0, callback, data); -+ else -+ if (s == s1) -+ walk_wild_consider_section (ptr, file, s, sec1, callback, data); -+ else -+ { -+ const char *sname = bfd_get_section_name (file->the_bfd, s); -+ bfd_boolean skip = !match_simple_wild (wildsec2->spec.name, -+ sname); -+ -+ if (!skip) -+ walk_wild_consider_section (ptr, file, s, wildsec2, callback, -+ data); -+ else -+ { -+ skip = !match_simple_wild (wildsec3->spec.name, sname); -+ if (!skip) -+ walk_wild_consider_section (ptr, file, s, wildsec3, -+ callback, data); -+ } -+ } -+ } -+} -+ -+static void -+walk_wild_section (lang_wild_statement_type *ptr, -+ lang_input_statement_type *file, -+ callback_t callback, -+ void *data) -+{ -+ if (file->just_syms_flag) -+ return; -+ -+ (*ptr->walk_wild_section_handler) (ptr, file, callback, data); -+} -+ -+/* Returns TRUE when name1 is a wildcard spec that might match -+ something name2 can match. We're conservative: we return FALSE -+ only if the prefixes of name1 and name2 are different up to the -+ first wildcard character. */ -+ -+static bfd_boolean -+wild_spec_can_overlap (const char *name1, const char *name2) -+{ -+ size_t prefix1_len = strcspn (name1, "?*["); -+ size_t prefix2_len = strcspn (name2, "?*["); -+ size_t min_prefix_len; -+ -+ /* Note that if there is no wildcard character, then we treat the -+ terminating 0 as part of the prefix. Thus ".text" won't match -+ ".text." or ".text.*", for example. */ -+ if (name1[prefix1_len] == '\0') -+ prefix1_len++; -+ if (name2[prefix2_len] == '\0') -+ prefix2_len++; -+ -+ min_prefix_len = prefix1_len < prefix2_len ? prefix1_len : prefix2_len; -+ -+ return memcmp (name1, name2, min_prefix_len) == 0; -+} -+ -+/* Select specialized code to handle various kinds of wildcard -+ statements. */ -+ -+static void -+analyze_walk_wild_section_handler (lang_wild_statement_type *ptr) -+{ -+ int sec_count = 0; -+ int wild_name_count = 0; -+ struct wildcard_list *sec; -+ int signature; -+ int data_counter; -+ -+ ptr->walk_wild_section_handler = walk_wild_section_general; -+ -+ /* Count how many wildcard_specs there are, and how many of those -+ actually use wildcards in the name. Also, bail out if any of the -+ wildcard names are NULL. (Can this actually happen? -+ walk_wild_section used to test for it.) And bail out if any -+ of the wildcards are more complex than a simple string -+ ending in a single '*'. */ -+ for (sec = ptr->section_list; sec != NULL; sec = sec->next) -+ { -+ ++sec_count; -+ if (sec->spec.name == NULL) -+ return; -+ if (wildcardp (sec->spec.name)) -+ { -+ ++wild_name_count; -+ if (!is_simple_wild (sec->spec.name)) -+ return; -+ } -+ } -+ -+ /* The zero-spec case would be easy to optimize but it doesn't -+ happen in practice. Likewise, more than 4 specs doesn't -+ happen in practice. */ -+ if (sec_count == 0 || sec_count > 4) -+ return; -+ -+ /* Check that no two specs can match the same section. */ -+ for (sec = ptr->section_list; sec != NULL; sec = sec->next) -+ { -+ struct wildcard_list *sec2; -+ for (sec2 = sec->next; sec2 != NULL; sec2 = sec2->next) -+ { -+ if (wild_spec_can_overlap (sec->spec.name, sec2->spec.name)) -+ return; -+ } -+ } -+ -+ signature = (sec_count << 8) + wild_name_count; -+ switch (signature) -+ { -+ case 0x0100: -+ ptr->walk_wild_section_handler = walk_wild_section_specs1_wild0; -+ break; -+ case 0x0101: -+ ptr->walk_wild_section_handler = walk_wild_section_specs1_wild1; -+ break; -+ case 0x0201: -+ ptr->walk_wild_section_handler = walk_wild_section_specs2_wild1; -+ break; -+ case 0x0302: -+ ptr->walk_wild_section_handler = walk_wild_section_specs3_wild2; -+ break; -+ case 0x0402: -+ ptr->walk_wild_section_handler = walk_wild_section_specs4_wild2; -+ break; -+ default: -+ return; -+ } -+ -+ /* Now fill the data array with pointers to the specs, first the -+ specs with non-wildcard names, then the specs with wildcard -+ names. It's OK to process the specs in different order from the -+ given order, because we've already determined that no section -+ will match more than one spec. */ -+ data_counter = 0; -+ for (sec = ptr->section_list; sec != NULL; sec = sec->next) -+ if (!wildcardp (sec->spec.name)) -+ ptr->handler_data[data_counter++] = sec; -+ for (sec = ptr->section_list; sec != NULL; sec = sec->next) -+ if (wildcardp (sec->spec.name)) -+ ptr->handler_data[data_counter++] = sec; -+} -+ - /* Handle a wild statement for a single file F. */ - - static void -@@ -4353,6 +4737,7 @@ - new->section_list = section_list; - new->keep_sections = keep_sections; - lang_list_init (&new->children); -+ analyze_walk_wild_section_handler (new); - } - - void ---- binutils-2.15/ld/ldlang.h.old 2004-05-17 15:36:16.000000000 -0400 -+++ binutils-2.15/ld/ldlang.h 2006-01-23 13:32:33.653292000 -0500 -@@ -295,7 +295,17 @@ - union lang_statement_union *file; - } lang_afile_asection_pair_statement_type; - --typedef struct lang_wild_statement_struct -+typedef struct lang_wild_statement_struct lang_wild_statement_type; -+ -+typedef void (*callback_t) (lang_wild_statement_type *, struct wildcard_list *, -+ asection *, lang_input_statement_type *, void *); -+ -+typedef void (*walk_wild_section_handler_t) (lang_wild_statement_type *, -+ lang_input_statement_type *, -+ callback_t callback, -+ void *data); -+ -+struct lang_wild_statement_struct - { - lang_statement_header_type header; - const char *filename; -@@ -303,7 +313,10 @@ - struct wildcard_list *section_list; - bfd_boolean keep_sections; - lang_statement_list_type children; --} lang_wild_statement_type; -+ -+ walk_wild_section_handler_t walk_wild_section_handler; -+ struct wildcard_list *handler_data[4]; -+}; - - typedef struct lang_address_statement_struct - { diff --git a/patches/binutils/2.15/ld-2.15-stabs-tweak.patch b/patches/binutils/2.15/ld-2.15-stabs-tweak.patch deleted file mode 100644 index bd6ae7a..0000000 --- a/patches/binutils/2.15/ld-2.15-stabs-tweak.patch +++ /dev/null @@ -1,33 +0,0 @@ -Signed-off-by: dank@kegel.com - -See http://sourceware.org/ml/binutils/2005-12/msg00270.html -http://sourceware.org/ml/binutils-cvs/2005-12/msg00139.html - -STABS hash table size change, backported from the binutils CVS tree. Here's -the CVS log comment for the original change: - -revision 1.25 -date: 2005/12/29 10:29:23; author: nickc; state: Exp; lines: +2 -3 -(_bfd_link_section_stabs): Use bfd_hash_table_init rather than -bfd_hash_table_init_n(...,251) so that the size of the hash table can be -controlled by the user. - -Note that tunable hash table size changes were added after 2.15. The effect -of this change is to make bfd use its default hash table size for the stabs -hash as well. - - ---- binutils-2.15/bfd/stabs.c.old 2004-05-17 15:36:04.000000000 -0400 -+++ binutils-2.15/bfd/stabs.c 2006-02-09 15:21:56.567014000 -0500 -@@ -241,9 +241,8 @@ - goto error_return; - /* Make sure the first byte is zero. */ - (void) _bfd_stringtab_add (sinfo->strings, "", TRUE, TRUE); -- if (! bfd_hash_table_init_n (&sinfo->includes.root, -- stab_link_includes_newfunc, -- 251)) -+ if (! bfd_hash_table_init (&sinfo->includes.root, -+ stab_link_includes_newfunc)) - goto error_return; - sinfo->stabstr = bfd_make_section_anyway (abfd, ".stabstr"); - sinfo->stabstr->flags |= SEC_HAS_CONTENTS | SEC_READONLY | SEC_DEBUGGING; diff --git a/patches/binutils/2.15/s390-invalid-insn-format.patch b/patches/binutils/2.15/s390-invalid-insn-format.patch deleted file mode 100644 index 3296201..0000000 --- a/patches/binutils/2.15/s390-invalid-insn-format.patch +++ /dev/null @@ -1,42 +0,0 @@ -Message-ID: <000801c48f60$cec16630$9103a8c0@ULOC5012> -From: "Michael Geiger" -To: -Subject: Patch for cross compiling s/390 kernel on linux host -Date: Tue, 31 Aug 2004 15:45:41 +0200 - -Dear Dan, - -I had big problems compiling a kernel for s/390 on my linux host - I tried -different chains from crosstool-0.28-rc34 and finally succeded with -gcc-3.3.4-glibc-2.3.2 after applying another patch to binutils-2.15 -(attached). -All compilations of the different kernel versions I tried stopped with -"Invalid .insn format" somewhere. I checked the recent cvs version of -binutils and applied the latest diff to gas/config/tc-s390.c and that solved -it. - -Greetings - -Michael Geiger - - -diff -u -r1.39 -r1.40 ---- src/gas/config/tc-s390.c 2004/05/06 11:01:48 1.39 -+++ src/gas/config/tc-s390.c 2004/06/15 12:38:08 1.40 -@@ -1596,13 +1596,13 @@ - if (exp.X_op == O_constant) - { - if ( ( opformat->oplen == 6 -- && exp.X_add_number >= 0 -+ && (addressT) exp.X_add_number >= 0 - && (addressT) exp.X_add_number < (1ULL << 48)) - || ( opformat->oplen == 4 -- && exp.X_add_number >= 0 -+ && (addressT) exp.X_add_number >= 0 - && (addressT) exp.X_add_number < (1ULL << 32)) - || ( opformat->oplen == 2 -- && exp.X_add_number >= 0 -+ && (addressT) exp.X_add_number >= 0 - && (addressT) exp.X_add_number < (1ULL << 16))) - md_number_to_chars (insn, exp.X_add_number, opformat->oplen); - else diff --git a/patches/binutils/2.16.1/100-bfd-hash-tweak.patch b/patches/binutils/2.16.1/100-bfd-hash-tweak.patch new file mode 100644 index 0000000..c6de93a --- /dev/null +++ b/patches/binutils/2.16.1/100-bfd-hash-tweak.patch @@ -0,0 +1,23 @@ +Signed-off-by: dank@kegel.com + +Raising the size of the hash table is a noticable win when linking +at least one large app. + +There was a patch, +http://sources.redhat.com/ml/binutils/2004-06/msg00165.html +to do this dynamically. No idea why that didn't make it in. +So this tiny change to raise the default size is just +a stopgap for now. + + +--- binutils-2.16.1/bfd/hash.c.old 2006-03-02 23:01:39.000000000 -0800 ++++ binutils-2.16.1/bfd/hash.c 2006-03-02 23:01:58.000000000 -0800 +@@ -300,7 +300,7 @@ + */ + + /* The default number of entries to use when creating a hash table. */ +-#define DEFAULT_SIZE 4051 ++#define DEFAULT_SIZE 32749 + static size_t bfd_default_hash_table_size = DEFAULT_SIZE; + + /* Create a new hash table, given a number of entries. */ diff --git a/patches/binutils/2.16.1/110-binutils-2.15-psignal.patch b/patches/binutils/2.16.1/110-binutils-2.15-psignal.patch new file mode 100644 index 0000000..98fa600 --- /dev/null +++ b/patches/binutils/2.16.1/110-binutils-2.15-psignal.patch @@ -0,0 +1,40 @@ +Make psignal prototype in libiberty match that in glibc. + +Fixes: + +gcc-2.95.3-glibc-2.1.3/binutils-2.15/libiberty/strsignal.c: In function `psignal': +gcc-2.95.3-glibc-2.1.3/binutils-2.15/libiberty/strsignal.c:563: argument `signo' doesn't match prototype +/usr/include/signal.h:131: prototype declaration +gcc-2.95.3-glibc-2.1.3/binutils-2.15/libiberty/strsignal.c:563: argument `message' doesn't match prototype +/usr/include/signal.h:131: prototype declaration +gcc-2.95.3-glibc-2.1.3/binutils-2.15/libiberty/strsignal.c:568: warning: comparison between signed and unsigned +mprotect... make[1]: *** [strsignal.o] Error 1 +make[1]: Leaving directory `/export/hda3/dkegel/queue/jobdir.produser_cpsm17/crosstool-0.32/build/i686-unknown-linux-gnu/gcc-2.95.3-glibc-2.1.3/build-binutils/libiberty' +make: *** [all-libiberty] Error 2 + +when building on red hat 7.1 +though it's a bit of a mystery why libiberty's psignal is being compiled at +all, since red hat 7.1's glibc supports psignal (hence the error message) + +--- binutils-2.15/libiberty/strsignal.c.old 2005-04-18 13:57:40.000000000 -0700 ++++ binutils-2.15/libiberty/strsignal.c 2005-04-18 13:59:09.000000000 -0700 +@@ -544,7 +544,7 @@ + + /* + +-@deftypefn Supplemental void psignal (unsigned @var{signo}, char *@var{message}) ++@deftypefn Supplemental void psignal (int @var{signo}, const char *@var{message}) + + Print @var{message} to the standard error, followed by a colon, + followed by the description of the signal specified by @var{signo}, +@@ -557,9 +557,7 @@ + #ifndef HAVE_PSIGNAL + + void +-psignal (signo, message) +- unsigned signo; +- char *message; ++psignal (int signo, const char *message) + { + if (signal_names == NULL) + { diff --git a/patches/binutils/2.16.1/120-binutils-skip-comments.patch b/patches/binutils/2.16.1/120-binutils-skip-comments.patch new file mode 100644 index 0000000..0ca9a47 --- /dev/null +++ b/patches/binutils/2.16.1/120-binutils-skip-comments.patch @@ -0,0 +1,95 @@ +[removed first hunk so it would apply to 2.16.1 - copyright date already updated - dank] + +Retrieved from http://sources.redhat.com/ml/binutils/2004-04/msg00646.html +Fixes +localealias.s:544: Error: junk at end of line, first unrecognized character is `,' +when building glibc-2.3.2 with gcc-3.4.0 and binutils-2.15.90.0.3 + +Paths adjusted to match crosstool's patcher. + +Message-Id: m3n052qw2g.fsf@whitebox.m5r.de +From: Andreas Schwab +To: Nathan Sidwell +Cc: Ian Lance Taylor , binutils at sources dot redhat dot com +Date: Fri, 23 Apr 2004 22:27:19 +0200 +Subject: Re: demand_empty_rest_of_line and ignore_rest_of_line + +Nathan Sidwell writes: + +> Index: read.c +> =================================================================== +> RCS file: /cvs/src/src/gas/read.c,v +> retrieving revision 1.76 +> diff -c -3 -p -r1.76 read.c +> *** read.c 12 Mar 2004 17:48:12 -0000 1.76 +> --- read.c 18 Mar 2004 09:56:05 -0000 +> *************** read_a_source_file (char *name) +> *** 1053,1059 **** +> #endif +> input_line_pointer--; +> /* Report unknown char as ignored. */ +> ! ignore_rest_of_line (); +> } +> +> #ifdef md_after_pass_hook +> --- 1053,1059 ---- +> #endif +> input_line_pointer--; +> /* Report unknown char as ignored. */ +> ! demand_empty_rest_of_line (); +> } +> +> #ifdef md_after_pass_hook + +This means that the unknown character is no longer ignored, despite the +comment. As a side effect a line starting with a line comment character +not followed by APP in NO_APP mode now triggers an error instead of just a +warning, breaking builds of glibc on m68k-linux. Earlier in +read_a_source_file where #APP is handled there is another comment that +claims that unknown comments are ignored, when in fact they aren't (only +the initial line comment character is skipped). + +Note that the presence of #APP will mess up the line counters, but +that appears to be difficult to fix. + +Andreas. + +2004-04-23 Andreas Schwab + + * read.c (read_a_source_file): Ignore unknown text after line + comment character. Fix misleading comment. + +--- binutils/gas/read.c.~1.78.~ 2004-04-23 08:58:23.000000000 +0200 ++++ binutils/gas/read.c 2004-04-23 21:49:01.000000000 +0200 +@@ -950,10 +950,14 @@ read_a_source_file (char *name) + unsigned int new_length; + char *tmp_buf = 0; + +- bump_line_counters (); + s = input_line_pointer; + if (strncmp (s, "APP\n", 4)) +- continue; /* We ignore it */ ++ { ++ /* We ignore it */ ++ ignore_rest_of_line (); ++ continue; ++ } ++ bump_line_counters (); + s += 4; + + sb_new (&sbuf); +@@ -1052,7 +1056,7 @@ read_a_source_file (char *name) + continue; + #endif + input_line_pointer--; +- /* Report unknown char as ignored. */ ++ /* Report unknown char as error. */ + demand_empty_rest_of_line (); + } + + +-- +Andreas Schwab, SuSE Labs, schwab@suse.de +SuSE Linux AG, MaxfeldstraÃe 5, 90409 NÃrnberg, Germany +Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 +"And now for something completely different." diff --git a/patches/binutils/2.16.1/130-callahan.patch b/patches/binutils/2.16.1/130-callahan.patch new file mode 100644 index 0000000..a39050f --- /dev/null +++ b/patches/binutils/2.16.1/130-callahan.patch @@ -0,0 +1,693 @@ +Signed-off-by: dank@kegel.com +Fixes ld speed issue. +See http://weblogs.mozillazine.org/roc/archives/2005/02/optimizing_gnu.html +See thread "Re: optimizations for 3x speedup in ld", +http://sources.redhat.com/ml/binutils/2005-03/msg00847.html + +Wildcard section matching enhancement, backported from the binutils CVS tree. +Here's the CVS log comment from the original change to ldlang.c: + +revision 1.177 +date: 2005/04/06 15:33:02; author: jakub; state: Exp; lines: +438 -51 +2005-04-06 Jakub Jelinek + + * ldlang.c: Formatting. + (walk_wild_consider_section): Remember return value from wildcardp. + (is_simple_wild): Use strcspn instead of 2 strpbrk calls and strlen. + (wild_spec_can_overlap): Use strcspn instead of strpbrk and strlen. + +2005-04-06 Robert O'Callahan + + * ld.h (lean_section_userdata_type): Remove. + (fat_section_userdata_type): Remove file field. + (SECTION_USERDATA_SIZE): Remove. + * ldlang.c (init_os): Eliminate initialization of unused + lean_section_userdata_type. + + * ldlang.h (callback_t, walk_wild_section_handler_t): New + typedefs. + (struct lang_wild_statement_struct): Add walk_wild_section_handler + and handler_data fields. + * ldlang.c (callback_t): Removed. + (walk_wild_consider_section, walk_wild_section_general, + section_iterator_callback, find_section, is_simple_wild, + match_simple_wild, walk_wild_section_specs1_wild0, + walk_wild_section_specs1_wild1, walk_wild_section_specs2_wild1, + walk_wild_section_specs3_wild2, walk_wild_section_specs4_wild2, + wild_spec_can_overlap, analyze_walk_wild_section_handler): New + functions. + (lang_add_wild): Call analyze_walk_wild_section_handler. + (walk_wild_section): Renamed to walk_wild_section_general and + created a wrapper function. + (section_iterator_callback_data): New typedef. + + +Index: src/ld/ld.h +=================================================================== +RCS file: /cvs/src/src/ld/ld.h,v +retrieving revision 1.26 +retrieving revision 1.27 +diff -u -r1.26 -r1.27 +--- binutils/ld/ld.h.old 16 Mar 2005 21:52:42 -0000 1.26 ++++ binutils/ld/ld.h 6 Apr 2005 15:33:02 -0000 1.27 +@@ -1,6 +1,6 @@ + /* ld.h -- general linker header file + Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, +- 2001, 2002, 2003, 2004 ++ 2001, 2002, 2003, 2004, 2005 + Free Software Foundation, Inc. + + This file is part of GLD, the Gnu Linker. +@@ -89,28 +89,15 @@ + struct map_symbol_def *next; + }; + +-/* Extra information we hold on sections */ +-typedef struct lean_user_section_struct { +- /* For output sections: pointer to the section where this data will go. */ +- struct lang_input_statement_struct *file; +-} lean_section_userdata_type; +- + /* The initial part of fat_user_section_struct has to be idential with + lean_user_section_struct. */ + typedef struct fat_user_section_struct { +- /* For output sections: pointer to the section where this data will go. */ +- struct lang_input_statement_struct *file; + /* For input sections, when writing a map file: head / tail of a linked + list of hash table entries for symbols defined in this section. */ + struct map_symbol_def *map_symbol_def_head; + struct map_symbol_def **map_symbol_def_tail; + } fat_section_userdata_type; + +-#define SECTION_USERDATA_SIZE \ +- (command_line.reduce_memory_overheads \ +- ? sizeof (lean_section_userdata_type) \ +- : sizeof (fat_section_userdata_type)) +- + #define get_userdata(x) ((x)->userdata) + + #define BYTE_SIZE (1) +Index: src/ld/ldlang.c +=================================================================== +RCS file: /cvs/src/src/ld/ldlang.c,v +retrieving revision 1.176 +retrieving revision 1.177 +diff -u -r1.176 -r1.177 +--- binutils/ld/ldlang.c.old 18 Mar 2005 13:56:26 -0000 1.176 ++++ binutils/ld/ldlang.c 6 Apr 2005 15:33:02 -0000 1.177 +@@ -84,9 +84,6 @@ + static void lang_record_phdrs (void); + static void lang_do_version_exports_section (void); + +-typedef void (*callback_t) (lang_wild_statement_type *, struct wildcard_list *, +- asection *, lang_input_statement_type *, void *); +- + /* Exported variables. */ + lang_output_section_statement_type *abs_output_section; + lang_statement_list_type lang_output_section_statement; +@@ -155,21 +152,71 @@ + + /* Generic traversal routines for finding matching sections. */ + ++/* Try processing a section against a wildcard. This just calls ++ the callback unless the filename exclusion list is present ++ and excludes the file. It's hardly ever present so this ++ function is very fast. */ ++ ++static void ++walk_wild_consider_section (lang_wild_statement_type *ptr, ++ lang_input_statement_type *file, ++ asection *s, ++ struct wildcard_list *sec, ++ callback_t callback, ++ void *data) ++{ ++ bfd_boolean skip = FALSE; ++ struct name_list *list_tmp; ++ ++ /* Don't process sections from files which were ++ excluded. */ ++ for (list_tmp = sec->spec.exclude_name_list; ++ list_tmp; ++ list_tmp = list_tmp->next) ++ { ++ bfd_boolean is_wildcard = wildcardp (list_tmp->name); ++ if (is_wildcard) ++ skip = fnmatch (list_tmp->name, file->filename, 0) == 0; ++ else ++ skip = strcmp (list_tmp->name, file->filename) == 0; ++ ++ /* If this file is part of an archive, and the archive is ++ excluded, exclude this file. */ ++ if (! skip && file->the_bfd != NULL ++ && file->the_bfd->my_archive != NULL ++ && file->the_bfd->my_archive->filename != NULL) ++ { ++ if (is_wildcard) ++ skip = fnmatch (list_tmp->name, ++ file->the_bfd->my_archive->filename, ++ 0) == 0; ++ else ++ skip = strcmp (list_tmp->name, ++ file->the_bfd->my_archive->filename) == 0; ++ } ++ ++ if (skip) ++ break; ++ } ++ ++ if (!skip) ++ (*callback) (ptr, sec, s, file, data); ++} ++ ++/* Lowest common denominator routine that can handle everything correctly, ++ but slowly. */ ++ + static void +-walk_wild_section (lang_wild_statement_type *ptr, +- lang_input_statement_type *file, +- callback_t callback, +- void *data) ++walk_wild_section_general (lang_wild_statement_type *ptr, ++ lang_input_statement_type *file, ++ callback_t callback, ++ void *data) + { + asection *s; +- +- if (file->just_syms_flag) +- return; ++ struct wildcard_list *sec; + + for (s = file->the_bfd->sections; s != NULL; s = s->next) + { +- struct wildcard_list *sec; +- + sec = ptr->section_list; + if (sec == NULL) + (*callback) (ptr, sec, s, file, data); +@@ -177,39 +224,8 @@ + while (sec != NULL) + { + bfd_boolean skip = FALSE; +- struct name_list *list_tmp; + +- /* Don't process sections from files which were +- excluded. */ +- for (list_tmp = sec->spec.exclude_name_list; +- list_tmp; +- list_tmp = list_tmp->next) +- { +- if (wildcardp (list_tmp->name)) +- skip = fnmatch (list_tmp->name, file->filename, 0) == 0; +- else +- skip = strcmp (list_tmp->name, file->filename) == 0; +- +- /* If this file is part of an archive, and the archive is +- excluded, exclude this file. */ +- if (! skip && file->the_bfd != NULL +- && file->the_bfd->my_archive != NULL +- && file->the_bfd->my_archive->filename != NULL) +- { +- if (wildcardp (list_tmp->name)) +- skip = fnmatch (list_tmp->name, +- file->the_bfd->my_archive->filename, +- 0) == 0; +- else +- skip = strcmp (list_tmp->name, +- file->the_bfd->my_archive->filename) == 0; +- } +- +- if (skip) +- break; +- } +- +- if (!skip && sec->spec.name != NULL) ++ if (sec->spec.name != NULL) + { + const char *sname = bfd_get_section_name (file->the_bfd, s); + +@@ -220,13 +236,381 @@ + } + + if (!skip) +- (*callback) (ptr, sec, s, file, data); ++ walk_wild_consider_section (ptr, file, s, sec, callback, data); + + sec = sec->next; + } + } + } + ++/* Routines to find a single section given its name. If there's more ++ than one section with that name, we report that. */ ++ ++typedef struct ++{ ++ asection *found_section; ++ bfd_boolean multiple_sections_found; ++} section_iterator_callback_data; ++ ++static bfd_boolean ++section_iterator_callback (bfd *bfd ATTRIBUTE_UNUSED, asection *s, void *data) ++{ ++ section_iterator_callback_data *d = data; ++ ++ if (d->found_section != NULL) ++ { ++ d->multiple_sections_found = TRUE; ++ return TRUE; ++ } ++ ++ d->found_section = s; ++ return FALSE; ++} ++ ++static asection * ++find_section (lang_input_statement_type *file, ++ struct wildcard_list *sec, ++ bfd_boolean *multiple_sections_found) ++{ ++ section_iterator_callback_data cb_data = { NULL, FALSE }; ++ ++ bfd_get_section_by_name_if (file->the_bfd, sec->spec.name, ++ section_iterator_callback, &cb_data); ++ *multiple_sections_found = cb_data.multiple_sections_found; ++ return cb_data.found_section; ++} ++ ++/* Code for handling simple wildcards without going through fnmatch, ++ which can be expensive because of charset translations etc. */ ++ ++/* A simple wild is a literal string followed by a single '*', ++ where the literal part is at least 4 characters long. */ ++ ++static bfd_boolean ++is_simple_wild (const char *name) ++{ ++ size_t len = strcspn (name, "*?["); ++ return len >= 4 && name[len] == '*' && name[len + 1] == '\0'; ++} ++ ++static bfd_boolean ++match_simple_wild (const char *pattern, const char *name) ++{ ++ /* The first four characters of the pattern are guaranteed valid ++ non-wildcard characters. So we can go faster. */ ++ if (pattern[0] != name[0] || pattern[1] != name[1] ++ || pattern[2] != name[2] || pattern[3] != name[3]) ++ return FALSE; ++ ++ pattern += 4; ++ name += 4; ++ while (*pattern != '*') ++ if (*name++ != *pattern++) ++ return FALSE; ++ ++ return TRUE; ++} ++ ++/* Specialized, optimized routines for handling different kinds of ++ wildcards */ ++ ++static void ++walk_wild_section_specs1_wild0 (lang_wild_statement_type *ptr, ++ lang_input_statement_type *file, ++ callback_t callback, ++ void *data) ++{ ++ /* We can just do a hash lookup for the section with the right name. ++ But if that lookup discovers more than one section with the name ++ (should be rare), we fall back to the general algorithm because ++ we would otherwise have to sort the sections to make sure they ++ get processed in the bfd's order. */ ++ bfd_boolean multiple_sections_found; ++ struct wildcard_list *sec0 = ptr->handler_data[0]; ++ asection *s0 = find_section (file, sec0, &multiple_sections_found); ++ ++ if (multiple_sections_found) ++ walk_wild_section_general (ptr, file, callback, data); ++ else if (s0) ++ walk_wild_consider_section (ptr, file, s0, sec0, callback, data); ++} ++ ++static void ++walk_wild_section_specs1_wild1 (lang_wild_statement_type *ptr, ++ lang_input_statement_type *file, ++ callback_t callback, ++ void *data) ++{ ++ asection *s; ++ struct wildcard_list *wildsec0 = ptr->handler_data[0]; ++ ++ for (s = file->the_bfd->sections; s != NULL; s = s->next) ++ { ++ const char *sname = bfd_get_section_name (file->the_bfd, s); ++ bfd_boolean skip = !match_simple_wild (wildsec0->spec.name, sname); ++ ++ if (!skip) ++ walk_wild_consider_section (ptr, file, s, wildsec0, callback, data); ++ } ++} ++ ++static void ++walk_wild_section_specs2_wild1 (lang_wild_statement_type *ptr, ++ lang_input_statement_type *file, ++ callback_t callback, ++ void *data) ++{ ++ asection *s; ++ struct wildcard_list *sec0 = ptr->handler_data[0]; ++ struct wildcard_list *wildsec1 = ptr->handler_data[1]; ++ bfd_boolean multiple_sections_found; ++ asection *s0 = find_section (file, sec0, &multiple_sections_found); ++ ++ if (multiple_sections_found) ++ { ++ walk_wild_section_general (ptr, file, callback, data); ++ return; ++ } ++ ++ /* Note that if the section was not found, s0 is NULL and ++ we'll simply never succeed the s == s0 test below. */ ++ for (s = file->the_bfd->sections; s != NULL; s = s->next) ++ { ++ /* Recall that in this code path, a section cannot satisfy more ++ than one spec, so if s == s0 then it cannot match ++ wildspec1. */ ++ if (s == s0) ++ walk_wild_consider_section (ptr, file, s, sec0, callback, data); ++ else ++ { ++ const char *sname = bfd_get_section_name (file->the_bfd, s); ++ bfd_boolean skip = !match_simple_wild (wildsec1->spec.name, sname); ++ ++ if (!skip) ++ walk_wild_consider_section (ptr, file, s, wildsec1, callback, ++ data); ++ } ++ } ++} ++ ++static void ++walk_wild_section_specs3_wild2 (lang_wild_statement_type *ptr, ++ lang_input_statement_type *file, ++ callback_t callback, ++ void *data) ++{ ++ asection *s; ++ struct wildcard_list *sec0 = ptr->handler_data[0]; ++ struct wildcard_list *wildsec1 = ptr->handler_data[1]; ++ struct wildcard_list *wildsec2 = ptr->handler_data[2]; ++ bfd_boolean multiple_sections_found; ++ asection *s0 = find_section (file, sec0, &multiple_sections_found); ++ ++ if (multiple_sections_found) ++ { ++ walk_wild_section_general (ptr, file, callback, data); ++ return; ++ } ++ ++ for (s = file->the_bfd->sections; s != NULL; s = s->next) ++ { ++ if (s == s0) ++ walk_wild_consider_section (ptr, file, s, sec0, callback, data); ++ else ++ { ++ const char *sname = bfd_get_section_name (file->the_bfd, s); ++ bfd_boolean skip = !match_simple_wild (wildsec1->spec.name, sname); ++ ++ if (!skip) ++ walk_wild_consider_section (ptr, file, s, wildsec1, callback, data); ++ else ++ { ++ skip = !match_simple_wild (wildsec2->spec.name, sname); ++ if (!skip) ++ walk_wild_consider_section (ptr, file, s, wildsec2, callback, ++ data); ++ } ++ } ++ } ++} ++ ++static void ++walk_wild_section_specs4_wild2 (lang_wild_statement_type *ptr, ++ lang_input_statement_type *file, ++ callback_t callback, ++ void *data) ++{ ++ asection *s; ++ struct wildcard_list *sec0 = ptr->handler_data[0]; ++ struct wildcard_list *sec1 = ptr->handler_data[1]; ++ struct wildcard_list *wildsec2 = ptr->handler_data[2]; ++ struct wildcard_list *wildsec3 = ptr->handler_data[3]; ++ bfd_boolean multiple_sections_found; ++ asection *s0 = find_section (file, sec0, &multiple_sections_found), *s1; ++ ++ if (multiple_sections_found) ++ { ++ walk_wild_section_general (ptr, file, callback, data); ++ return; ++ } ++ ++ s1 = find_section (file, sec1, &multiple_sections_found); ++ if (multiple_sections_found) ++ { ++ walk_wild_section_general (ptr, file, callback, data); ++ return; ++ } ++ ++ for (s = file->the_bfd->sections; s != NULL; s = s->next) ++ { ++ if (s == s0) ++ walk_wild_consider_section (ptr, file, s, sec0, callback, data); ++ else ++ if (s == s1) ++ walk_wild_consider_section (ptr, file, s, sec1, callback, data); ++ else ++ { ++ const char *sname = bfd_get_section_name (file->the_bfd, s); ++ bfd_boolean skip = !match_simple_wild (wildsec2->spec.name, ++ sname); ++ ++ if (!skip) ++ walk_wild_consider_section (ptr, file, s, wildsec2, callback, ++ data); ++ else ++ { ++ skip = !match_simple_wild (wildsec3->spec.name, sname); ++ if (!skip) ++ walk_wild_consider_section (ptr, file, s, wildsec3, ++ callback, data); ++ } ++ } ++ } ++} ++ ++static void ++walk_wild_section (lang_wild_statement_type *ptr, ++ lang_input_statement_type *file, ++ callback_t callback, ++ void *data) ++{ ++ if (file->just_syms_flag) ++ return; ++ ++ (*ptr->walk_wild_section_handler) (ptr, file, callback, data); ++} ++ ++/* Returns TRUE when name1 is a wildcard spec that might match ++ something name2 can match. We're conservative: we return FALSE ++ only if the prefixes of name1 and name2 are different up to the ++ first wildcard character. */ ++ ++static bfd_boolean ++wild_spec_can_overlap (const char *name1, const char *name2) ++{ ++ size_t prefix1_len = strcspn (name1, "?*["); ++ size_t prefix2_len = strcspn (name2, "?*["); ++ size_t min_prefix_len; ++ ++ /* Note that if there is no wildcard character, then we treat the ++ terminating 0 as part of the prefix. Thus ".text" won't match ++ ".text." or ".text.*", for example. */ ++ if (name1[prefix1_len] == '\0') ++ prefix1_len++; ++ if (name2[prefix2_len] == '\0') ++ prefix2_len++; ++ ++ min_prefix_len = prefix1_len < prefix2_len ? prefix1_len : prefix2_len; ++ ++ return memcmp (name1, name2, min_prefix_len) == 0; ++} ++ ++/* Select specialized code to handle various kinds of wildcard ++ statements. */ ++ ++static void ++analyze_walk_wild_section_handler (lang_wild_statement_type *ptr) ++{ ++ int sec_count = 0; ++ int wild_name_count = 0; ++ struct wildcard_list *sec; ++ int signature; ++ int data_counter; ++ ++ ptr->walk_wild_section_handler = walk_wild_section_general; ++ ++ /* Count how many wildcard_specs there are, and how many of those ++ actually use wildcards in the name. Also, bail out if any of the ++ wildcard names are NULL. (Can this actually happen? ++ walk_wild_section used to test for it.) And bail out if any ++ of the wildcards are more complex than a simple string ++ ending in a single '*'. */ ++ for (sec = ptr->section_list; sec != NULL; sec = sec->next) ++ { ++ ++sec_count; ++ if (sec->spec.name == NULL) ++ return; ++ if (wildcardp (sec->spec.name)) ++ { ++ ++wild_name_count; ++ if (!is_simple_wild (sec->spec.name)) ++ return; ++ } ++ } ++ ++ /* The zero-spec case would be easy to optimize but it doesn't ++ happen in practice. Likewise, more than 4 specs doesn't ++ happen in practice. */ ++ if (sec_count == 0 || sec_count > 4) ++ return; ++ ++ /* Check that no two specs can match the same section. */ ++ for (sec = ptr->section_list; sec != NULL; sec = sec->next) ++ { ++ struct wildcard_list *sec2; ++ for (sec2 = sec->next; sec2 != NULL; sec2 = sec2->next) ++ { ++ if (wild_spec_can_overlap (sec->spec.name, sec2->spec.name)) ++ return; ++ } ++ } ++ ++ signature = (sec_count << 8) + wild_name_count; ++ switch (signature) ++ { ++ case 0x0100: ++ ptr->walk_wild_section_handler = walk_wild_section_specs1_wild0; ++ break; ++ case 0x0101: ++ ptr->walk_wild_section_handler = walk_wild_section_specs1_wild1; ++ break; ++ case 0x0201: ++ ptr->walk_wild_section_handler = walk_wild_section_specs2_wild1; ++ break; ++ case 0x0302: ++ ptr->walk_wild_section_handler = walk_wild_section_specs3_wild2; ++ break; ++ case 0x0402: ++ ptr->walk_wild_section_handler = walk_wild_section_specs4_wild2; ++ break; ++ default: ++ return; ++ } ++ ++ /* Now fill the data array with pointers to the specs, first the ++ specs with non-wildcard names, then the specs with wildcard ++ names. It's OK to process the specs in different order from the ++ given order, because we've already determined that no section ++ will match more than one spec. */ ++ data_counter = 0; ++ for (sec = ptr->section_list; sec != NULL; sec = sec->next) ++ if (!wildcardp (sec->spec.name)) ++ ptr->handler_data[data_counter++] = sec; ++ for (sec = ptr->section_list; sec != NULL; sec = sec->next) ++ if (wildcardp (sec->spec.name)) ++ ptr->handler_data[data_counter++] = sec; ++} ++ + /* Handle a wild statement for a single file F. */ + + static void +@@ -1175,17 +1559,12 @@ + static void + init_os (lang_output_section_statement_type *s) + { +- lean_section_userdata_type *new; +- + if (s->bfd_section != NULL) + return; + + if (strcmp (s->name, DISCARD_SECTION_NAME) == 0) + einfo (_("%P%F: Illegal use of `%s' section\n"), DISCARD_SECTION_NAME); + +- new = stat_alloc (SECTION_USERDATA_SIZE); +- memset (new, 0, SECTION_USERDATA_SIZE); +- + s->bfd_section = bfd_get_section_by_name (output_bfd, s->name); + if (s->bfd_section == NULL) + s->bfd_section = bfd_make_section (output_bfd, s->name); +@@ -1199,7 +1578,14 @@ + /* We initialize an output sections output offset to minus its own + vma to allow us to output a section through itself. */ + s->bfd_section->output_offset = 0; +- get_userdata (s->bfd_section) = new; ++ if (!command_line.reduce_memory_overheads) ++ { ++ fat_section_userdata_type *new ++ = stat_alloc (sizeof (fat_section_userdata_type)); ++ memset (new, 0, sizeof (fat_section_userdata_type)); ++ get_userdata (s->bfd_section) = new; ++ } ++ + + /* If there is a base address, make sure that any sections it might + mention are initialized. */ +@@ -4939,6 +5325,7 @@ + new->section_list = section_list; + new->keep_sections = keep_sections; + lang_list_init (&new->children); ++ analyze_walk_wild_section_handler (new); + } + + void +Index: src/ld/ldlang.h +=================================================================== +RCS file: /cvs/src/src/ld/ldlang.h,v +retrieving revision 1.44 +retrieving revision 1.45 +diff -u -r1.44 -r1.45 +--- binutils/ld/ldlang.h.old 3 Mar 2005 11:51:58 -0000 1.44 ++++ binutils/ld/ldlang.h 6 Apr 2005 15:33:03 -0000 1.45 +@@ -298,7 +298,17 @@ + union lang_statement_union *file; + } lang_afile_asection_pair_statement_type; + +-typedef struct lang_wild_statement_struct ++typedef struct lang_wild_statement_struct lang_wild_statement_type; ++ ++typedef void (*callback_t) (lang_wild_statement_type *, struct wildcard_list *, ++ asection *, lang_input_statement_type *, void *); ++ ++typedef void (*walk_wild_section_handler_t) (lang_wild_statement_type *, ++ lang_input_statement_type *, ++ callback_t callback, ++ void *data); ++ ++struct lang_wild_statement_struct + { + lang_statement_header_type header; + const char *filename; +@@ -306,7 +316,10 @@ + struct wildcard_list *section_list; + bfd_boolean keep_sections; + lang_statement_list_type children; +-} lang_wild_statement_type; ++ ++ walk_wild_section_handler_t walk_wild_section_handler; ++ struct wildcard_list *handler_data[4]; ++}; + + typedef struct lang_address_statement_struct + { diff --git a/patches/binutils/2.16.1/140-cross-gprof.patch b/patches/binutils/2.16.1/140-cross-gprof.patch new file mode 100644 index 0000000..ea6c18f --- /dev/null +++ b/patches/binutils/2.16.1/140-cross-gprof.patch @@ -0,0 +1,22 @@ +--- binutils-2.15/configure.old 2004-07-21 21:36:47.000000000 -0700 ++++ binutils-2.15/configure 2004-07-21 21:37:08.000000000 -0700 +@@ -999,7 +999,7 @@ + + # Some tools are only suitable for building in a "native" situation. + # Remove these if host!=target. +-native_only="autoconf automake libtool fileutils find gawk gettext gzip hello indent m4 rcs recode sed shellutils tar textutils uudecode wdiff gprof target-groff guile perl time ash bash bzip2 prms gnuserv target-gperf" ++native_only="autoconf automake libtool fileutils find gawk gettext gzip hello indent m4 rcs recode sed shellutils tar textutils uudecode wdiff target-groff guile perl time ash bash bzip2 prms gnuserv target-gperf" + + # Similarly, some are only suitable for cross toolchains. + # Remove these if host=target. +--- binutils-2.15/configure.in.old 2004-07-21 21:37:19.000000000 -0700 ++++ binutils-2.15/configure.in 2004-07-21 21:37:34.000000000 -0700 +@@ -236,7 +236,7 @@ + + # Some tools are only suitable for building in a "native" situation. + # Remove these if host!=target. +-native_only="autoconf automake libtool fileutils find gawk gettext gzip hello indent m4 rcs recode sed shellutils tar textutils uudecode wdiff gprof target-groff guile perl time ash bash bzip2 prms gnuserv target-gperf" ++native_only="autoconf automake libtool fileutils find gawk gettext gzip hello indent m4 rcs recode sed shellutils tar textutils uudecode wdiff target-groff guile perl time ash bash bzip2 prms gnuserv target-gperf" + + # Similarly, some are only suitable for cross toolchains. + # Remove these if host=target. diff --git a/patches/binutils/2.16.1/150-stabs-tweak.patch b/patches/binutils/2.16.1/150-stabs-tweak.patch new file mode 100644 index 0000000..86e3611 --- /dev/null +++ b/patches/binutils/2.16.1/150-stabs-tweak.patch @@ -0,0 +1,28 @@ +Signed-off-by: dank@kegel.com + +See http://sourceware.org/ml/binutils/2005-12/msg00270.html +http://sourceware.org/ml/binutils-cvs/2005-12/msg00139.html + +STABS hash table size change, backported from the binutils CVS tree. Here's +the CVS log comment for the original change: + +revision 1.25 +date: 2005/12/29 10:29:23; author: nickc; state: Exp; lines: +2 -3 +(_bfd_link_section_stabs): Use bfd_hash_table_init rather than +bfd_hash_table_init_n(...,251) so that the size of the hash table can be +controlled by the user. + +--- binutils/bfd/stabs.c.old 4 May 2005 15:53:39 -0000 1.24 ++++ binutils/bfd/stabs.c 29 Dec 2005 10:29:23 -0000 1.25 +@@ -194,9 +194,8 @@ + goto error_return; + /* Make sure the first byte is zero. */ + (void) _bfd_stringtab_add (sinfo->strings, "", TRUE, TRUE); +- if (! bfd_hash_table_init_n (&sinfo->includes, +- stab_link_includes_newfunc, +- 251)) ++ if (! bfd_hash_table_init (&sinfo->includes, ++ stab_link_includes_newfunc)) + goto error_return; + sinfo->stabstr = bfd_make_section_anyway (abfd, ".stabstr"); + if (sinfo->stabstr == NULL) diff --git a/patches/binutils/2.16.1/bfd-hash-tweak.patch b/patches/binutils/2.16.1/bfd-hash-tweak.patch deleted file mode 100644 index c6de93a..0000000 --- a/patches/binutils/2.16.1/bfd-hash-tweak.patch +++ /dev/null @@ -1,23 +0,0 @@ -Signed-off-by: dank@kegel.com - -Raising the size of the hash table is a noticable win when linking -at least one large app. - -There was a patch, -http://sources.redhat.com/ml/binutils/2004-06/msg00165.html -to do this dynamically. No idea why that didn't make it in. -So this tiny change to raise the default size is just -a stopgap for now. - - ---- binutils-2.16.1/bfd/hash.c.old 2006-03-02 23:01:39.000000000 -0800 -+++ binutils-2.16.1/bfd/hash.c 2006-03-02 23:01:58.000000000 -0800 -@@ -300,7 +300,7 @@ - */ - - /* The default number of entries to use when creating a hash table. */ --#define DEFAULT_SIZE 4051 -+#define DEFAULT_SIZE 32749 - static size_t bfd_default_hash_table_size = DEFAULT_SIZE; - - /* Create a new hash table, given a number of entries. */ diff --git a/patches/binutils/2.16.1/binutils-2.15-psignal.patch b/patches/binutils/2.16.1/binutils-2.15-psignal.patch deleted file mode 100644 index 98fa600..0000000 --- a/patches/binutils/2.16.1/binutils-2.15-psignal.patch +++ /dev/null @@ -1,40 +0,0 @@ -Make psignal prototype in libiberty match that in glibc. - -Fixes: - -gcc-2.95.3-glibc-2.1.3/binutils-2.15/libiberty/strsignal.c: In function `psignal': -gcc-2.95.3-glibc-2.1.3/binutils-2.15/libiberty/strsignal.c:563: argument `signo' doesn't match prototype -/usr/include/signal.h:131: prototype declaration -gcc-2.95.3-glibc-2.1.3/binutils-2.15/libiberty/strsignal.c:563: argument `message' doesn't match prototype -/usr/include/signal.h:131: prototype declaration -gcc-2.95.3-glibc-2.1.3/binutils-2.15/libiberty/strsignal.c:568: warning: comparison between signed and unsigned -mprotect... make[1]: *** [strsignal.o] Error 1 -make[1]: Leaving directory `/export/hda3/dkegel/queue/jobdir.produser_cpsm17/crosstool-0.32/build/i686-unknown-linux-gnu/gcc-2.95.3-glibc-2.1.3/build-binutils/libiberty' -make: *** [all-libiberty] Error 2 - -when building on red hat 7.1 -though it's a bit of a mystery why libiberty's psignal is being compiled at -all, since red hat 7.1's glibc supports psignal (hence the error message) - ---- binutils-2.15/libiberty/strsignal.c.old 2005-04-18 13:57:40.000000000 -0700 -+++ binutils-2.15/libiberty/strsignal.c 2005-04-18 13:59:09.000000000 -0700 -@@ -544,7 +544,7 @@ - - /* - --@deftypefn Supplemental void psignal (unsigned @var{signo}, char *@var{message}) -+@deftypefn Supplemental void psignal (int @var{signo}, const char *@var{message}) - - Print @var{message} to the standard error, followed by a colon, - followed by the description of the signal specified by @var{signo}, -@@ -557,9 +557,7 @@ - #ifndef HAVE_PSIGNAL - - void --psignal (signo, message) -- unsigned signo; -- char *message; -+psignal (int signo, const char *message) - { - if (signal_names == NULL) - { diff --git a/patches/binutils/2.16.1/binutils-skip-comments.patch b/patches/binutils/2.16.1/binutils-skip-comments.patch deleted file mode 100644 index 0ca9a47..0000000 --- a/patches/binutils/2.16.1/binutils-skip-comments.patch +++ /dev/null @@ -1,95 +0,0 @@ -[removed first hunk so it would apply to 2.16.1 - copyright date already updated - dank] - -Retrieved from http://sources.redhat.com/ml/binutils/2004-04/msg00646.html -Fixes -localealias.s:544: Error: junk at end of line, first unrecognized character is `,' -when building glibc-2.3.2 with gcc-3.4.0 and binutils-2.15.90.0.3 - -Paths adjusted to match crosstool's patcher. - -Message-Id: m3n052qw2g.fsf@whitebox.m5r.de -From: Andreas Schwab -To: Nathan Sidwell -Cc: Ian Lance Taylor , binutils at sources dot redhat dot com -Date: Fri, 23 Apr 2004 22:27:19 +0200 -Subject: Re: demand_empty_rest_of_line and ignore_rest_of_line - -Nathan Sidwell writes: - -> Index: read.c -> =================================================================== -> RCS file: /cvs/src/src/gas/read.c,v -> retrieving revision 1.76 -> diff -c -3 -p -r1.76 read.c -> *** read.c 12 Mar 2004 17:48:12 -0000 1.76 -> --- read.c 18 Mar 2004 09:56:05 -0000 -> *************** read_a_source_file (char *name) -> *** 1053,1059 **** -> #endif -> input_line_pointer--; -> /* Report unknown char as ignored. */ -> ! ignore_rest_of_line (); -> } -> -> #ifdef md_after_pass_hook -> --- 1053,1059 ---- -> #endif -> input_line_pointer--; -> /* Report unknown char as ignored. */ -> ! demand_empty_rest_of_line (); -> } -> -> #ifdef md_after_pass_hook - -This means that the unknown character is no longer ignored, despite the -comment. As a side effect a line starting with a line comment character -not followed by APP in NO_APP mode now triggers an error instead of just a -warning, breaking builds of glibc on m68k-linux. Earlier in -read_a_source_file where #APP is handled there is another comment that -claims that unknown comments are ignored, when in fact they aren't (only -the initial line comment character is skipped). - -Note that the presence of #APP will mess up the line counters, but -that appears to be difficult to fix. - -Andreas. - -2004-04-23 Andreas Schwab - - * read.c (read_a_source_file): Ignore unknown text after line - comment character. Fix misleading comment. - ---- binutils/gas/read.c.~1.78.~ 2004-04-23 08:58:23.000000000 +0200 -+++ binutils/gas/read.c 2004-04-23 21:49:01.000000000 +0200 -@@ -950,10 +950,14 @@ read_a_source_file (char *name) - unsigned int new_length; - char *tmp_buf = 0; - -- bump_line_counters (); - s = input_line_pointer; - if (strncmp (s, "APP\n", 4)) -- continue; /* We ignore it */ -+ { -+ /* We ignore it */ -+ ignore_rest_of_line (); -+ continue; -+ } -+ bump_line_counters (); - s += 4; - - sb_new (&sbuf); -@@ -1052,7 +1056,7 @@ read_a_source_file (char *name) - continue; - #endif - input_line_pointer--; -- /* Report unknown char as ignored. */ -+ /* Report unknown char as error. */ - demand_empty_rest_of_line (); - } - - --- -Andreas Schwab, SuSE Labs, schwab@suse.de -SuSE Linux AG, MaxfeldstraÃe 5, 90409 NÃrnberg, Germany -Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 -"And now for something completely different." diff --git a/patches/binutils/2.16.1/callahan.patch b/patches/binutils/2.16.1/callahan.patch deleted file mode 100644 index a39050f..0000000 --- a/patches/binutils/2.16.1/callahan.patch +++ /dev/null @@ -1,693 +0,0 @@ -Signed-off-by: dank@kegel.com -Fixes ld speed issue. -See http://weblogs.mozillazine.org/roc/archives/2005/02/optimizing_gnu.html -See thread "Re: optimizations for 3x speedup in ld", -http://sources.redhat.com/ml/binutils/2005-03/msg00847.html - -Wildcard section matching enhancement, backported from the binutils CVS tree. -Here's the CVS log comment from the original change to ldlang.c: - -revision 1.177 -date: 2005/04/06 15:33:02; author: jakub; state: Exp; lines: +438 -51 -2005-04-06 Jakub Jelinek - - * ldlang.c: Formatting. - (walk_wild_consider_section): Remember return value from wildcardp. - (is_simple_wild): Use strcspn instead of 2 strpbrk calls and strlen. - (wild_spec_can_overlap): Use strcspn instead of strpbrk and strlen. - -2005-04-06 Robert O'Callahan - - * ld.h (lean_section_userdata_type): Remove. - (fat_section_userdata_type): Remove file field. - (SECTION_USERDATA_SIZE): Remove. - * ldlang.c (init_os): Eliminate initialization of unused - lean_section_userdata_type. - - * ldlang.h (callback_t, walk_wild_section_handler_t): New - typedefs. - (struct lang_wild_statement_struct): Add walk_wild_section_handler - and handler_data fields. - * ldlang.c (callback_t): Removed. - (walk_wild_consider_section, walk_wild_section_general, - section_iterator_callback, find_section, is_simple_wild, - match_simple_wild, walk_wild_section_specs1_wild0, - walk_wild_section_specs1_wild1, walk_wild_section_specs2_wild1, - walk_wild_section_specs3_wild2, walk_wild_section_specs4_wild2, - wild_spec_can_overlap, analyze_walk_wild_section_handler): New - functions. - (lang_add_wild): Call analyze_walk_wild_section_handler. - (walk_wild_section): Renamed to walk_wild_section_general and - created a wrapper function. - (section_iterator_callback_data): New typedef. - - -Index: src/ld/ld.h -=================================================================== -RCS file: /cvs/src/src/ld/ld.h,v -retrieving revision 1.26 -retrieving revision 1.27 -diff -u -r1.26 -r1.27 ---- binutils/ld/ld.h.old 16 Mar 2005 21:52:42 -0000 1.26 -+++ binutils/ld/ld.h 6 Apr 2005 15:33:02 -0000 1.27 -@@ -1,6 +1,6 @@ - /* ld.h -- general linker header file - Copyright 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, -- 2001, 2002, 2003, 2004 -+ 2001, 2002, 2003, 2004, 2005 - Free Software Foundation, Inc. - - This file is part of GLD, the Gnu Linker. -@@ -89,28 +89,15 @@ - struct map_symbol_def *next; - }; - --/* Extra information we hold on sections */ --typedef struct lean_user_section_struct { -- /* For output sections: pointer to the section where this data will go. */ -- struct lang_input_statement_struct *file; --} lean_section_userdata_type; -- - /* The initial part of fat_user_section_struct has to be idential with - lean_user_section_struct. */ - typedef struct fat_user_section_struct { -- /* For output sections: pointer to the section where this data will go. */ -- struct lang_input_statement_struct *file; - /* For input sections, when writing a map file: head / tail of a linked - list of hash table entries for symbols defined in this section. */ - struct map_symbol_def *map_symbol_def_head; - struct map_symbol_def **map_symbol_def_tail; - } fat_section_userdata_type; - --#define SECTION_USERDATA_SIZE \ -- (command_line.reduce_memory_overheads \ -- ? sizeof (lean_section_userdata_type) \ -- : sizeof (fat_section_userdata_type)) -- - #define get_userdata(x) ((x)->userdata) - - #define BYTE_SIZE (1) -Index: src/ld/ldlang.c -=================================================================== -RCS file: /cvs/src/src/ld/ldlang.c,v -retrieving revision 1.176 -retrieving revision 1.177 -diff -u -r1.176 -r1.177 ---- binutils/ld/ldlang.c.old 18 Mar 2005 13:56:26 -0000 1.176 -+++ binutils/ld/ldlang.c 6 Apr 2005 15:33:02 -0000 1.177 -@@ -84,9 +84,6 @@ - static void lang_record_phdrs (void); - static void lang_do_version_exports_section (void); - --typedef void (*callback_t) (lang_wild_statement_type *, struct wildcard_list *, -- asection *, lang_input_statement_type *, void *); -- - /* Exported variables. */ - lang_output_section_statement_type *abs_output_section; - lang_statement_list_type lang_output_section_statement; -@@ -155,21 +152,71 @@ - - /* Generic traversal routines for finding matching sections. */ - -+/* Try processing a section against a wildcard. This just calls -+ the callback unless the filename exclusion list is present -+ and excludes the file. It's hardly ever present so this -+ function is very fast. */ -+ -+static void -+walk_wild_consider_section (lang_wild_statement_type *ptr, -+ lang_input_statement_type *file, -+ asection *s, -+ struct wildcard_list *sec, -+ callback_t callback, -+ void *data) -+{ -+ bfd_boolean skip = FALSE; -+ struct name_list *list_tmp; -+ -+ /* Don't process sections from files which were -+ excluded. */ -+ for (list_tmp = sec->spec.exclude_name_list; -+ list_tmp; -+ list_tmp = list_tmp->next) -+ { -+ bfd_boolean is_wildcard = wildcardp (list_tmp->name); -+ if (is_wildcard) -+ skip = fnmatch (list_tmp->name, file->filename, 0) == 0; -+ else -+ skip = strcmp (list_tmp->name, file->filename) == 0; -+ -+ /* If this file is part of an archive, and the archive is -+ excluded, exclude this file. */ -+ if (! skip && file->the_bfd != NULL -+ && file->the_bfd->my_archive != NULL -+ && file->the_bfd->my_archive->filename != NULL) -+ { -+ if (is_wildcard) -+ skip = fnmatch (list_tmp->name, -+ file->the_bfd->my_archive->filename, -+ 0) == 0; -+ else -+ skip = strcmp (list_tmp->name, -+ file->the_bfd->my_archive->filename) == 0; -+ } -+ -+ if (skip) -+ break; -+ } -+ -+ if (!skip) -+ (*callback) (ptr, sec, s, file, data); -+} -+ -+/* Lowest common denominator routine that can handle everything correctly, -+ but slowly. */ -+ - static void --walk_wild_section (lang_wild_statement_type *ptr, -- lang_input_statement_type *file, -- callback_t callback, -- void *data) -+walk_wild_section_general (lang_wild_statement_type *ptr, -+ lang_input_statement_type *file, -+ callback_t callback, -+ void *data) - { - asection *s; -- -- if (file->just_syms_flag) -- return; -+ struct wildcard_list *sec; - - for (s = file->the_bfd->sections; s != NULL; s = s->next) - { -- struct wildcard_list *sec; -- - sec = ptr->section_list; - if (sec == NULL) - (*callback) (ptr, sec, s, file, data); -@@ -177,39 +224,8 @@ - while (sec != NULL) - { - bfd_boolean skip = FALSE; -- struct name_list *list_tmp; - -- /* Don't process sections from files which were -- excluded. */ -- for (list_tmp = sec->spec.exclude_name_list; -- list_tmp; -- list_tmp = list_tmp->next) -- { -- if (wildcardp (list_tmp->name)) -- skip = fnmatch (list_tmp->name, file->filename, 0) == 0; -- else -- skip = strcmp (list_tmp->name, file->filename) == 0; -- -- /* If this file is part of an archive, and the archive is -- excluded, exclude this file. */ -- if (! skip && file->the_bfd != NULL -- && file->the_bfd->my_archive != NULL -- && file->the_bfd->my_archive->filename != NULL) -- { -- if (wildcardp (list_tmp->name)) -- skip = fnmatch (list_tmp->name, -- file->the_bfd->my_archive->filename, -- 0) == 0; -- else -- skip = strcmp (list_tmp->name, -- file->the_bfd->my_archive->filename) == 0; -- } -- -- if (skip) -- break; -- } -- -- if (!skip && sec->spec.name != NULL) -+ if (sec->spec.name != NULL) - { - const char *sname = bfd_get_section_name (file->the_bfd, s); - -@@ -220,13 +236,381 @@ - } - - if (!skip) -- (*callback) (ptr, sec, s, file, data); -+ walk_wild_consider_section (ptr, file, s, sec, callback, data); - - sec = sec->next; - } - } - } - -+/* Routines to find a single section given its name. If there's more -+ than one section with that name, we report that. */ -+ -+typedef struct -+{ -+ asection *found_section; -+ bfd_boolean multiple_sections_found; -+} section_iterator_callback_data; -+ -+static bfd_boolean -+section_iterator_callback (bfd *bfd ATTRIBUTE_UNUSED, asection *s, void *data) -+{ -+ section_iterator_callback_data *d = data; -+ -+ if (d->found_section != NULL) -+ { -+ d->multiple_sections_found = TRUE; -+ return TRUE; -+ } -+ -+ d->found_section = s; -+ return FALSE; -+} -+ -+static asection * -+find_section (lang_input_statement_type *file, -+ struct wildcard_list *sec, -+ bfd_boolean *multiple_sections_found) -+{ -+ section_iterator_callback_data cb_data = { NULL, FALSE }; -+ -+ bfd_get_section_by_name_if (file->the_bfd, sec->spec.name, -+ section_iterator_callback, &cb_data); -+ *multiple_sections_found = cb_data.multiple_sections_found; -+ return cb_data.found_section; -+} -+ -+/* Code for handling simple wildcards without going through fnmatch, -+ which can be expensive because of charset translations etc. */ -+ -+/* A simple wild is a literal string followed by a single '*', -+ where the literal part is at least 4 characters long. */ -+ -+static bfd_boolean -+is_simple_wild (const char *name) -+{ -+ size_t len = strcspn (name, "*?["); -+ return len >= 4 && name[len] == '*' && name[len + 1] == '\0'; -+} -+ -+static bfd_boolean -+match_simple_wild (const char *pattern, const char *name) -+{ -+ /* The first four characters of the pattern are guaranteed valid -+ non-wildcard characters. So we can go faster. */ -+ if (pattern[0] != name[0] || pattern[1] != name[1] -+ || pattern[2] != name[2] || pattern[3] != name[3]) -+ return FALSE; -+ -+ pattern += 4; -+ name += 4; -+ while (*pattern != '*') -+ if (*name++ != *pattern++) -+ return FALSE; -+ -+ return TRUE; -+} -+ -+/* Specialized, optimized routines for handling different kinds of -+ wildcards */ -+ -+static void -+walk_wild_section_specs1_wild0 (lang_wild_statement_type *ptr, -+ lang_input_statement_type *file, -+ callback_t callback, -+ void *data) -+{ -+ /* We can just do a hash lookup for the section with the right name. -+ But if that lookup discovers more than one section with the name -+ (should be rare), we fall back to the general algorithm because -+ we would otherwise have to sort the sections to make sure they -+ get processed in the bfd's order. */ -+ bfd_boolean multiple_sections_found; -+ struct wildcard_list *sec0 = ptr->handler_data[0]; -+ asection *s0 = find_section (file, sec0, &multiple_sections_found); -+ -+ if (multiple_sections_found) -+ walk_wild_section_general (ptr, file, callback, data); -+ else if (s0) -+ walk_wild_consider_section (ptr, file, s0, sec0, callback, data); -+} -+ -+static void -+walk_wild_section_specs1_wild1 (lang_wild_statement_type *ptr, -+ lang_input_statement_type *file, -+ callback_t callback, -+ void *data) -+{ -+ asection *s; -+ struct wildcard_list *wildsec0 = ptr->handler_data[0]; -+ -+ for (s = file->the_bfd->sections; s != NULL; s = s->next) -+ { -+ const char *sname = bfd_get_section_name (file->the_bfd, s); -+ bfd_boolean skip = !match_simple_wild (wildsec0->spec.name, sname); -+ -+ if (!skip) -+ walk_wild_consider_section (ptr, file, s, wildsec0, callback, data); -+ } -+} -+ -+static void -+walk_wild_section_specs2_wild1 (lang_wild_statement_type *ptr, -+ lang_input_statement_type *file, -+ callback_t callback, -+ void *data) -+{ -+ asection *s; -+ struct wildcard_list *sec0 = ptr->handler_data[0]; -+ struct wildcard_list *wildsec1 = ptr->handler_data[1]; -+ bfd_boolean multiple_sections_found; -+ asection *s0 = find_section (file, sec0, &multiple_sections_found); -+ -+ if (multiple_sections_found) -+ { -+ walk_wild_section_general (ptr, file, callback, data); -+ return; -+ } -+ -+ /* Note that if the section was not found, s0 is NULL and -+ we'll simply never succeed the s == s0 test below. */ -+ for (s = file->the_bfd->sections; s != NULL; s = s->next) -+ { -+ /* Recall that in this code path, a section cannot satisfy more -+ than one spec, so if s == s0 then it cannot match -+ wildspec1. */ -+ if (s == s0) -+ walk_wild_consider_section (ptr, file, s, sec0, callback, data); -+ else -+ { -+ const char *sname = bfd_get_section_name (file->the_bfd, s); -+ bfd_boolean skip = !match_simple_wild (wildsec1->spec.name, sname); -+ -+ if (!skip) -+ walk_wild_consider_section (ptr, file, s, wildsec1, callback, -+ data); -+ } -+ } -+} -+ -+static void -+walk_wild_section_specs3_wild2 (lang_wild_statement_type *ptr, -+ lang_input_statement_type *file, -+ callback_t callback, -+ void *data) -+{ -+ asection *s; -+ struct wildcard_list *sec0 = ptr->handler_data[0]; -+ struct wildcard_list *wildsec1 = ptr->handler_data[1]; -+ struct wildcard_list *wildsec2 = ptr->handler_data[2]; -+ bfd_boolean multiple_sections_found; -+ asection *s0 = find_section (file, sec0, &multiple_sections_found); -+ -+ if (multiple_sections_found) -+ { -+ walk_wild_section_general (ptr, file, callback, data); -+ return; -+ } -+ -+ for (s = file->the_bfd->sections; s != NULL; s = s->next) -+ { -+ if (s == s0) -+ walk_wild_consider_section (ptr, file, s, sec0, callback, data); -+ else -+ { -+ const char *sname = bfd_get_section_name (file->the_bfd, s); -+ bfd_boolean skip = !match_simple_wild (wildsec1->spec.name, sname); -+ -+ if (!skip) -+ walk_wild_consider_section (ptr, file, s, wildsec1, callback, data); -+ else -+ { -+ skip = !match_simple_wild (wildsec2->spec.name, sname); -+ if (!skip) -+ walk_wild_consider_section (ptr, file, s, wildsec2, callback, -+ data); -+ } -+ } -+ } -+} -+ -+static void -+walk_wild_section_specs4_wild2 (lang_wild_statement_type *ptr, -+ lang_input_statement_type *file, -+ callback_t callback, -+ void *data) -+{ -+ asection *s; -+ struct wildcard_list *sec0 = ptr->handler_data[0]; -+ struct wildcard_list *sec1 = ptr->handler_data[1]; -+ struct wildcard_list *wildsec2 = ptr->handler_data[2]; -+ struct wildcard_list *wildsec3 = ptr->handler_data[3]; -+ bfd_boolean multiple_sections_found; -+ asection *s0 = find_section (file, sec0, &multiple_sections_found), *s1; -+ -+ if (multiple_sections_found) -+ { -+ walk_wild_section_general (ptr, file, callback, data); -+ return; -+ } -+ -+ s1 = find_section (file, sec1, &multiple_sections_found); -+ if (multiple_sections_found) -+ { -+ walk_wild_section_general (ptr, file, callback, data); -+ return; -+ } -+ -+ for (s = file->the_bfd->sections; s != NULL; s = s->next) -+ { -+ if (s == s0) -+ walk_wild_consider_section (ptr, file, s, sec0, callback, data); -+ else -+ if (s == s1) -+ walk_wild_consider_section (ptr, file, s, sec1, callback, data); -+ else -+ { -+ const char *sname = bfd_get_section_name (file->the_bfd, s); -+ bfd_boolean skip = !match_simple_wild (wildsec2->spec.name, -+ sname); -+ -+ if (!skip) -+ walk_wild_consider_section (ptr, file, s, wildsec2, callback, -+ data); -+ else -+ { -+ skip = !match_simple_wild (wildsec3->spec.name, sname); -+ if (!skip) -+ walk_wild_consider_section (ptr, file, s, wildsec3, -+ callback, data); -+ } -+ } -+ } -+} -+ -+static void -+walk_wild_section (lang_wild_statement_type *ptr, -+ lang_input_statement_type *file, -+ callback_t callback, -+ void *data) -+{ -+ if (file->just_syms_flag) -+ return; -+ -+ (*ptr->walk_wild_section_handler) (ptr, file, callback, data); -+} -+ -+/* Returns TRUE when name1 is a wildcard spec that might match -+ something name2 can match. We're conservative: we return FALSE -+ only if the prefixes of name1 and name2 are different up to the -+ first wildcard character. */ -+ -+static bfd_boolean -+wild_spec_can_overlap (const char *name1, const char *name2) -+{ -+ size_t prefix1_len = strcspn (name1, "?*["); -+ size_t prefix2_len = strcspn (name2, "?*["); -+ size_t min_prefix_len; -+ -+ /* Note that if there is no wildcard character, then we treat the -+ terminating 0 as part of the prefix. Thus ".text" won't match -+ ".text." or ".text.*", for example. */ -+ if (name1[prefix1_len] == '\0') -+ prefix1_len++; -+ if (name2[prefix2_len] == '\0') -+ prefix2_len++; -+ -+ min_prefix_len = prefix1_len < prefix2_len ? prefix1_len : prefix2_len; -+ -+ return memcmp (name1, name2, min_prefix_len) == 0; -+} -+ -+/* Select specialized code to handle various kinds of wildcard -+ statements. */ -+ -+static void -+analyze_walk_wild_section_handler (lang_wild_statement_type *ptr) -+{ -+ int sec_count = 0; -+ int wild_name_count = 0; -+ struct wildcard_list *sec; -+ int signature; -+ int data_counter; -+ -+ ptr->walk_wild_section_handler = walk_wild_section_general; -+ -+ /* Count how many wildcard_specs there are, and how many of those -+ actually use wildcards in the name. Also, bail out if any of the -+ wildcard names are NULL. (Can this actually happen? -+ walk_wild_section used to test for it.) And bail out if any -+ of the wildcards are more complex than a simple string -+ ending in a single '*'. */ -+ for (sec = ptr->section_list; sec != NULL; sec = sec->next) -+ { -+ ++sec_count; -+ if (sec->spec.name == NULL) -+ return; -+ if (wildcardp (sec->spec.name)) -+ { -+ ++wild_name_count; -+ if (!is_simple_wild (sec->spec.name)) -+ return; -+ } -+ } -+ -+ /* The zero-spec case would be easy to optimize but it doesn't -+ happen in practice. Likewise, more than 4 specs doesn't -+ happen in practice. */ -+ if (sec_count == 0 || sec_count > 4) -+ return; -+ -+ /* Check that no two specs can match the same section. */ -+ for (sec = ptr->section_list; sec != NULL; sec = sec->next) -+ { -+ struct wildcard_list *sec2; -+ for (sec2 = sec->next; sec2 != NULL; sec2 = sec2->next) -+ { -+ if (wild_spec_can_overlap (sec->spec.name, sec2->spec.name)) -+ return; -+ } -+ } -+ -+ signature = (sec_count << 8) + wild_name_count; -+ switch (signature) -+ { -+ case 0x0100: -+ ptr->walk_wild_section_handler = walk_wild_section_specs1_wild0; -+ break; -+ case 0x0101: -+ ptr->walk_wild_section_handler = walk_wild_section_specs1_wild1; -+ break; -+ case 0x0201: -+ ptr->walk_wild_section_handler = walk_wild_section_specs2_wild1; -+ break; -+ case 0x0302: -+ ptr->walk_wild_section_handler = walk_wild_section_specs3_wild2; -+ break; -+ case 0x0402: -+ ptr->walk_wild_section_handler = walk_wild_section_specs4_wild2; -+ break; -+ default: -+ return; -+ } -+ -+ /* Now fill the data array with pointers to the specs, first the -+ specs with non-wildcard names, then the specs with wildcard -+ names. It's OK to process the specs in different order from the -+ given order, because we've already determined that no section -+ will match more than one spec. */ -+ data_counter = 0; -+ for (sec = ptr->section_list; sec != NULL; sec = sec->next) -+ if (!wildcardp (sec->spec.name)) -+ ptr->handler_data[data_counter++] = sec; -+ for (sec = ptr->section_list; sec != NULL; sec = sec->next) -+ if (wildcardp (sec->spec.name)) -+ ptr->handler_data[data_counter++] = sec; -+} -+ - /* Handle a wild statement for a single file F. */ - - static void -@@ -1175,17 +1559,12 @@ - static void - init_os (lang_output_section_statement_type *s) - { -- lean_section_userdata_type *new; -- - if (s->bfd_section != NULL) - return; - - if (strcmp (s->name, DISCARD_SECTION_NAME) == 0) - einfo (_("%P%F: Illegal use of `%s' section\n"), DISCARD_SECTION_NAME); - -- new = stat_alloc (SECTION_USERDATA_SIZE); -- memset (new, 0, SECTION_USERDATA_SIZE); -- - s->bfd_section = bfd_get_section_by_name (output_bfd, s->name); - if (s->bfd_section == NULL) - s->bfd_section = bfd_make_section (output_bfd, s->name); -@@ -1199,7 +1578,14 @@ - /* We initialize an output sections output offset to minus its own - vma to allow us to output a section through itself. */ - s->bfd_section->output_offset = 0; -- get_userdata (s->bfd_section) = new; -+ if (!command_line.reduce_memory_overheads) -+ { -+ fat_section_userdata_type *new -+ = stat_alloc (sizeof (fat_section_userdata_type)); -+ memset (new, 0, sizeof (fat_section_userdata_type)); -+ get_userdata (s->bfd_section) = new; -+ } -+ - - /* If there is a base address, make sure that any sections it might - mention are initialized. */ -@@ -4939,6 +5325,7 @@ - new->section_list = section_list; - new->keep_sections = keep_sections; - lang_list_init (&new->children); -+ analyze_walk_wild_section_handler (new); - } - - void -Index: src/ld/ldlang.h -=================================================================== -RCS file: /cvs/src/src/ld/ldlang.h,v -retrieving revision 1.44 -retrieving revision 1.45 -diff -u -r1.44 -r1.45 ---- binutils/ld/ldlang.h.old 3 Mar 2005 11:51:58 -0000 1.44 -+++ binutils/ld/ldlang.h 6 Apr 2005 15:33:03 -0000 1.45 -@@ -298,7 +298,17 @@ - union lang_statement_union *file; - } lang_afile_asection_pair_statement_type; - --typedef struct lang_wild_statement_struct -+typedef struct lang_wild_statement_struct lang_wild_statement_type; -+ -+typedef void (*callback_t) (lang_wild_statement_type *, struct wildcard_list *, -+ asection *, lang_input_statement_type *, void *); -+ -+typedef void (*walk_wild_section_handler_t) (lang_wild_statement_type *, -+ lang_input_statement_type *, -+ callback_t callback, -+ void *data); -+ -+struct lang_wild_statement_struct - { - lang_statement_header_type header; - const char *filename; -@@ -306,7 +316,10 @@ - struct wildcard_list *section_list; - bfd_boolean keep_sections; - lang_statement_list_type children; --} lang_wild_statement_type; -+ -+ walk_wild_section_handler_t walk_wild_section_handler; -+ struct wildcard_list *handler_data[4]; -+}; - - typedef struct lang_address_statement_struct - { diff --git a/patches/binutils/2.16.1/cross-gprof.patch b/patches/binutils/2.16.1/cross-gprof.patch deleted file mode 100644 index ea6c18f..0000000 --- a/patches/binutils/2.16.1/cross-gprof.patch +++ /dev/null @@ -1,22 +0,0 @@ ---- binutils-2.15/configure.old 2004-07-21 21:36:47.000000000 -0700 -+++ binutils-2.15/configure 2004-07-21 21:37:08.000000000 -0700 -@@ -999,7 +999,7 @@ - - # Some tools are only suitable for building in a "native" situation. - # Remove these if host!=target. --native_only="autoconf automake libtool fileutils find gawk gettext gzip hello indent m4 rcs recode sed shellutils tar textutils uudecode wdiff gprof target-groff guile perl time ash bash bzip2 prms gnuserv target-gperf" -+native_only="autoconf automake libtool fileutils find gawk gettext gzip hello indent m4 rcs recode sed shellutils tar textutils uudecode wdiff target-groff guile perl time ash bash bzip2 prms gnuserv target-gperf" - - # Similarly, some are only suitable for cross toolchains. - # Remove these if host=target. ---- binutils-2.15/configure.in.old 2004-07-21 21:37:19.000000000 -0700 -+++ binutils-2.15/configure.in 2004-07-21 21:37:34.000000000 -0700 -@@ -236,7 +236,7 @@ - - # Some tools are only suitable for building in a "native" situation. - # Remove these if host!=target. --native_only="autoconf automake libtool fileutils find gawk gettext gzip hello indent m4 rcs recode sed shellutils tar textutils uudecode wdiff gprof target-groff guile perl time ash bash bzip2 prms gnuserv target-gperf" -+native_only="autoconf automake libtool fileutils find gawk gettext gzip hello indent m4 rcs recode sed shellutils tar textutils uudecode wdiff target-groff guile perl time ash bash bzip2 prms gnuserv target-gperf" - - # Similarly, some are only suitable for cross toolchains. - # Remove these if host=target. diff --git a/patches/binutils/2.16.1/stabs-tweak.patch b/patches/binutils/2.16.1/stabs-tweak.patch deleted file mode 100644 index 86e3611..0000000 --- a/patches/binutils/2.16.1/stabs-tweak.patch +++ /dev/null @@ -1,28 +0,0 @@ -Signed-off-by: dank@kegel.com - -See http://sourceware.org/ml/binutils/2005-12/msg00270.html -http://sourceware.org/ml/binutils-cvs/2005-12/msg00139.html - -STABS hash table size change, backported from the binutils CVS tree. Here's -the CVS log comment for the original change: - -revision 1.25 -date: 2005/12/29 10:29:23; author: nickc; state: Exp; lines: +2 -3 -(_bfd_link_section_stabs): Use bfd_hash_table_init rather than -bfd_hash_table_init_n(...,251) so that the size of the hash table can be -controlled by the user. - ---- binutils/bfd/stabs.c.old 4 May 2005 15:53:39 -0000 1.24 -+++ binutils/bfd/stabs.c 29 Dec 2005 10:29:23 -0000 1.25 -@@ -194,9 +194,8 @@ - goto error_return; - /* Make sure the first byte is zero. */ - (void) _bfd_stringtab_add (sinfo->strings, "", TRUE, TRUE); -- if (! bfd_hash_table_init_n (&sinfo->includes, -- stab_link_includes_newfunc, -- 251)) -+ if (! bfd_hash_table_init (&sinfo->includes, -+ stab_link_includes_newfunc)) - goto error_return; - sinfo->stabstr = bfd_make_section_anyway (abfd, ".stabstr"); - if (sinfo->stabstr == NULL) diff --git a/patches/binutils/2.17.50.0.10/100-uclibc-conf.patch b/patches/binutils/2.17.50.0.10/100-uclibc-conf.patch deleted file mode 100644 index 25222e5..0000000 --- a/patches/binutils/2.17.50.0.10/100-uclibc-conf.patch +++ /dev/null @@ -1,139 +0,0 @@ ---- binutils-2.16.91.0.7/bfd/configure -+++ binutils-2.16.91.0.7/bfd/configure -@@ -3576,7 +3576,7 @@ - ;; - - # This must be Linux ELF. --linux-gnu*) -+linux-gnu*|linux-uclibc*) - lt_cv_deplibs_check_method=pass_all - ;; - ---- binutils-2.16.91.0.7/binutils/configure -+++ binutils-2.16.91.0.7/binutils/configure -@@ -3411,7 +3411,7 @@ - ;; - - # This must be Linux ELF. --linux-gnu*) -+linux-gnu*|linux-uclibc*) - lt_cv_deplibs_check_method=pass_all - ;; - ---- binutils-2.16.91.0.7/configure -+++ binutils-2.16.91.0.7/configure -@@ -1270,7 +1270,7 @@ - am33_2.0-*-linux*) - noconfigdirs="$noconfigdirs ${libgcj} target-newlib target-libgloss" - ;; -- sh-*-linux*) -+ sh*-*-linux*) - noconfigdirs="$noconfigdirs ${libgcj} target-newlib target-libgloss" - ;; - sh*-*-pe|mips*-*-pe|*arm-wince-pe) -@@ -1578,7 +1578,7 @@ - romp-*-*) - noconfigdirs="$noconfigdirs bfd binutils ld gas opcodes target-libgloss ${libgcj}" - ;; -- sh-*-* | sh64-*-*) -+ sh*-*-* | sh64-*-*) - case "${host}" in - i[3456789]86-*-vsta) ;; # don't add gprof back in - i[3456789]86-*-go32*) ;; # don't add gprof back in ---- binutils-2.16.91.0.7/configure.in -+++ binutils-2.16.91.0.7/configure.in -@@ -468,7 +468,7 @@ - am33_2.0-*-linux*) - noconfigdirs="$noconfigdirs ${libgcj} target-newlib target-libgloss" - ;; -- sh-*-linux*) -+ sh*-*-linux*) - noconfigdirs="$noconfigdirs ${libgcj} target-newlib target-libgloss" - ;; - sh*-*-pe|mips*-*-pe|*arm-wince-pe) -@@ -776,7 +776,7 @@ - romp-*-*) - noconfigdirs="$noconfigdirs bfd binutils ld gas opcodes target-libgloss ${libgcj}" - ;; -- sh-*-* | sh64-*-*) -+ sh*-*-* | sh64-*-*) - case "${host}" in - i[[3456789]]86-*-vsta) ;; # don't add gprof back in - i[[3456789]]86-*-go32*) ;; # don't add gprof back in ---- binutils-2.16.91.0.7/gas/configure -+++ binutils-2.16.91.0.7/gas/configure -@@ -3411,7 +3411,7 @@ - ;; - - # This must be Linux ELF. --linux-gnu*) -+linux-gnu*|linux-uclibc*) - lt_cv_deplibs_check_method=pass_all - ;; - ---- binutils-2.16.91.0.7/gprof/configure -+++ binutils-2.16.91.0.7/gprof/configure -@@ -3419,6 +3419,11 @@ - lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so` - ;; - -+linux-uclibc*) -+ lt_cv_deplibs_check_method=pass_all -+ lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so` -+ ;; -+ - netbsd* | knetbsd*-gnu) - if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then - lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$' ---- binutils-2.16.91.0.7/ld/configure -+++ binutils-2.16.91.0.7/ld/configure -@@ -3413,7 +3413,7 @@ - ;; - - # This must be Linux ELF. --linux-gnu*) -+linux-gnu*|linux-uclibc*) - lt_cv_deplibs_check_method=pass_all - ;; - ---- binutils-2.16.91.0.7/libtool.m4 -+++ binutils-2.16.91.0.7/libtool.m4 -@@ -739,7 +739,7 @@ - ;; - - # This must be Linux ELF. --linux-gnu*) -+linux-gnu*|linux-uclibc*) - lt_cv_deplibs_check_method=pass_all - ;; - ---- binutils-2.16.91.0.7/ltconfig -+++ binutils-2.16.91.0.7/ltconfig -@@ -602,6 +602,7 @@ - - # Transform linux* to *-*-linux-gnu*, to support old configure scripts. - case $host_os in -+linux-uclibc*) ;; - linux-gnu*) ;; - linux*) host=`echo $host | sed 's/^\(.*-.*-linux\)\(.*\)$/\1-gnu\2/'` - esac -@@ -1247,7 +1248,7 @@ - ;; - - # This must be Linux ELF. --linux-gnu*) -+linux-gnu*|linux-uclibc*) - version_type=linux - need_lib_prefix=no - need_version=no ---- binutils-2.16.91.0.7/opcodes/configure -+++ binutils-2.16.91.0.7/opcodes/configure -@@ -3579,7 +3579,7 @@ - ;; - - # This must be Linux ELF. --linux-gnu*) -+linux-gnu*|linux-uclibc*) - lt_cv_deplibs_check_method=pass_all - ;; - diff --git a/patches/binutils/2.17.50.0.10/110-arm-eabi-conf.patch b/patches/binutils/2.17.50.0.10/110-arm-eabi-conf.patch deleted file mode 100644 index be85ceb..0000000 --- a/patches/binutils/2.17.50.0.10/110-arm-eabi-conf.patch +++ /dev/null @@ -1,24 +0,0 @@ -diff -urN binutils-2.16.91.0.7.orig/configure binutils-2.16.91.0.7/configure ---- binutils-2.16.91.0.7.orig/configure 2006-05-31 14:54:24.000000000 +0300 -+++ binutils-2.16.91.0.7/configure 2006-05-31 14:55:53.000000000 +0300 -@@ -1299,7 +1299,7 @@ - arm-*-elf* | strongarm-*-elf* | xscale-*-elf* | arm*-*-eabi* ) - noconfigdirs="$noconfigdirs target-libffi target-qthreads" - ;; -- arm*-*-linux-gnueabi) -+ arm*-*-linux-gnueabi | arm*-*-linux-uclibcgnueabi) - noconfigdirs="$noconfigdirs target-libffi target-qthreads" - noconfigdirs="$noconfigdirs target-libjava target-libobjc" - ;; -diff -urN binutils-2.16.91.0.7.orig/configure.in binutils-2.16.91.0.7/configure.in ---- binutils-2.16.91.0.7.orig/configure.in 2006-05-31 14:54:24.000000000 +0300 -+++ binutils-2.16.91.0.7/configure.in 2006-05-31 14:55:53.000000000 +0300 -@@ -497,7 +497,7 @@ - arm-*-elf* | strongarm-*-elf* | xscale-*-elf* | arm*-*-eabi* ) - noconfigdirs="$noconfigdirs target-libffi target-qthreads" - ;; -- arm*-*-linux-gnueabi) -+ arm*-*-linux-gnueabi | arm*-*-linux-uclibcgnueabi) - noconfigdirs="$noconfigdirs target-libffi target-qthreads" - noconfigdirs="$noconfigdirs target-libjava target-libobjc" - ;; diff --git a/patches/binutils/2.17.50.0.10/300-001_ld_makefile_patch.patch b/patches/binutils/2.17.50.0.10/300-001_ld_makefile_patch.patch deleted file mode 100644 index 04a7e61..0000000 --- a/patches/binutils/2.17.50.0.10/300-001_ld_makefile_patch.patch +++ /dev/null @@ -1,50 +0,0 @@ -#!/bin/sh -e -## 001_ld_makefile_patch.dpatch -## -## All lines beginning with `## DP:' are a description of the patch. -## DP: Description: correct where ld scripts are installed -## DP: Author: Chris Chimelis -## DP: Upstream status: N/A -## DP: Date: ?? - -if [ $# -ne 1 ]; then - echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" - exit 1 -fi - -[ -f debian/patches/00patch-opts ] && . debian/patches/00patch-opts -patch_opts="${patch_opts:--f --no-backup-if-mismatch}" - -case "$1" in - -patch) patch $patch_opts -p1 < $0;; - -unpatch) patch $patch_opts -p1 -R < $0;; - *) - echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" - exit 1;; -esac - -exit 0 - -@DPATCH@ ---- binutils-2.16.91.0.1/ld/Makefile.am -+++ binutils-2.16.91.0.1/ld/Makefile.am -@@ -20,7 +20,7 @@ - # We put the scripts in the directory $(scriptdir)/ldscripts. - # We can't put the scripts in $(datadir) because the SEARCH_DIR - # directives need to be different for native and cross linkers. --scriptdir = $(tooldir)/lib -+scriptdir = $(libdir) - - EMUL = @EMUL@ - EMULATION_OFILES = @EMULATION_OFILES@ ---- binutils-2.16.91.0.1/ld/Makefile.in -+++ binutils-2.16.91.0.1/ld/Makefile.in -@@ -268,7 +268,7 @@ - # We put the scripts in the directory $(scriptdir)/ldscripts. - # We can't put the scripts in $(datadir) because the SEARCH_DIR - # directives need to be different for native and cross linkers. --scriptdir = $(tooldir)/lib -+scriptdir = $(libdir) - BASEDIR = $(srcdir)/.. - BFDDIR = $(BASEDIR)/bfd - INCDIR = $(BASEDIR)/include diff --git a/patches/binutils/2.17.50.0.10/300-012_check_ldrunpath_length.patch b/patches/binutils/2.17.50.0.10/300-012_check_ldrunpath_length.patch deleted file mode 100644 index 498651a..0000000 --- a/patches/binutils/2.17.50.0.10/300-012_check_ldrunpath_length.patch +++ /dev/null @@ -1,47 +0,0 @@ -#!/bin/sh -e -## 012_check_ldrunpath_length.dpatch by Chris Chimelis -## -## All lines beginning with `## DP:' are a description of the patch. -## DP: Only generate an RPATH entry if LD_RUN_PATH is not empty, for -## DP: cases where -rpath isn't specified. (#151024) - -if [ $# -ne 1 ]; then - echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" - exit 1 -fi - -[ -f debian/patches/00patch-opts ] && . debian/patches/00patch-opts -patch_opts="${patch_opts:--f --no-backup-if-mismatch}" - -case "$1" in - -patch) patch $patch_opts -p1 < $0;; - -unpatch) patch $patch_opts -p1 -R < $0;; - *) - echo >&2 "`basename $0`: script expects -patch|-unpatch as argument" - exit 1;; -esac - -exit 0 - -@DPATCH@ -diff -urNad /home/james/debian/packages/binutils/new/binutils-2.15/ld/emultempl/elf32.em binutils-2.15/ld/emultempl/elf32.em ---- /home/james/debian/packages/binutils/new/binutils-2.15/ld/emultempl/elf32.em 2004-05-21 23:12:58.000000000 +0100 -+++ binutils-2.15/ld/emultempl/elf32.em 2004-05-21 23:12:59.000000000 +0100 -@@ -692,6 +692,8 @@ - && command_line.rpath == NULL) - { - lib_path = (const char *) getenv ("LD_RUN_PATH"); -+ if ((lib_path) && (strlen (lib_path) == 0)) -+ lib_path = NULL; - if (gld${EMULATION_NAME}_search_needed (lib_path, &n, - force)) - break; -@@ -871,6 +873,8 @@ - rpath = command_line.rpath; - if (rpath == NULL) - rpath = (const char *) getenv ("LD_RUN_PATH"); -+ if ((rpath) && (strlen (rpath) == 0)) -+ rpath = NULL; - if (! (bfd_elf_size_dynamic_sections - (output_bfd, command_line.soname, rpath, - command_line.filter_shlib, diff --git a/patches/binutils/2.17.50.0.14/100-uclibc-conf.patch b/patches/binutils/2.17.50.0.14/100-uclibc-conf.patch deleted file mode 100644 index 70e2f2d..0000000 --- a/patches/binutils/2.17.50.0.14/100-uclibc-conf.patch +++ /dev/null @@ -1,149 +0,0 @@ -diff -dur binutils-2.17.50.0.14.orig/bfd/configure binutils-2.17.50.0.14/bfd/configure ---- binutils-2.17.50.0.14.orig/bfd/configure 2007-03-23 16:41:48.000000000 +0100 -+++ binutils-2.17.50.0.14/bfd/configure 2007-04-10 17:35:41.000000000 +0200 -@@ -3577,7 +3577,7 @@ - ;; - - # This must be Linux ELF. --linux-gnu*) -+linux-gnu*|linux-uclibc*) - lt_cv_deplibs_check_method=pass_all - ;; - -diff -dur binutils-2.17.50.0.14.orig/binutils/configure binutils-2.17.50.0.14/binutils/configure ---- binutils-2.17.50.0.14.orig/binutils/configure 2007-03-16 16:48:29.000000000 +0100 -+++ binutils-2.17.50.0.14/binutils/configure 2007-04-10 17:35:41.000000000 +0200 -@@ -3410,7 +3410,7 @@ - ;; - - # This must be Linux ELF. --linux-gnu*) -+linux-gnu*|linux-uclibc*) - lt_cv_deplibs_check_method=pass_all - ;; - -diff -dur binutils-2.17.50.0.14.orig/configure binutils-2.17.50.0.14/configure ---- binutils-2.17.50.0.14.orig/configure 2007-03-23 16:41:48.000000000 +0100 -+++ binutils-2.17.50.0.14/configure 2007-04-10 17:35:41.000000000 +0200 -@@ -2195,7 +2195,7 @@ - am33_2.0-*-linux*) - noconfigdirs="$noconfigdirs ${libgcj} target-newlib target-libgloss" - ;; -- sh-*-linux*) -+ sh*-*-linux*) - noconfigdirs="$noconfigdirs ${libgcj} target-newlib target-libgloss" - ;; - sh*-*-pe|mips*-*-pe|*arm-wince-pe) -@@ -2490,7 +2490,7 @@ - romp-*-*) - noconfigdirs="$noconfigdirs bfd binutils ld gas opcodes target-libgloss ${libgcj}" - ;; -- sh-*-* | sh64-*-*) -+ sh*-*-* | sh64-*-*) - case "${host}" in - i[3456789]86-*-vsta) ;; # don't add gprof back in - i[3456789]86-*-go32*) ;; # don't add gprof back in -diff -dur binutils-2.17.50.0.14.orig/configure.ac binutils-2.17.50.0.14/configure.ac ---- binutils-2.17.50.0.14.orig/configure.ac 2007-03-23 16:41:48.000000000 +0100 -+++ binutils-2.17.50.0.14/configure.ac 2007-04-10 17:35:41.000000000 +0200 -@@ -484,7 +484,7 @@ - am33_2.0-*-linux*) - noconfigdirs="$noconfigdirs ${libgcj} target-newlib target-libgloss" - ;; -- sh-*-linux*) -+ sh*-*-linux*) - noconfigdirs="$noconfigdirs ${libgcj} target-newlib target-libgloss" - ;; - sh*-*-pe|mips*-*-pe|*arm-wince-pe) -@@ -779,7 +779,7 @@ - romp-*-*) - noconfigdirs="$noconfigdirs bfd binutils ld gas opcodes target-libgloss ${libgcj}" - ;; -- sh-*-* | sh64-*-*) -+ sh*-*-* | sh64-*-*) - case "${host}" in - i[[3456789]]86-*-vsta) ;; # don't add gprof back in - i[[3456789]]86-*-go32*) ;; # don't add gprof back in -diff -dur binutils-2.17.50.0.14.orig/gas/configure binutils-2.17.50.0.14/gas/configure ---- binutils-2.17.50.0.14.orig/gas/configure 2007-03-16 16:48:29.000000000 +0100 -+++ binutils-2.17.50.0.14/gas/configure 2007-04-10 17:35:41.000000000 +0200 -@@ -3410,7 +3410,7 @@ - ;; - - # This must be Linux ELF. --linux-gnu*) -+linux-gnu*|linux-uclibc*) - lt_cv_deplibs_check_method=pass_all - ;; - -diff -dur binutils-2.17.50.0.14.orig/gprof/configure binutils-2.17.50.0.14/gprof/configure ---- binutils-2.17.50.0.14.orig/gprof/configure 2007-01-03 20:49:13.000000000 +0100 -+++ binutils-2.17.50.0.14/gprof/configure 2007-04-10 17:35:41.000000000 +0200 -@@ -3413,6 +3413,11 @@ - lt_cv_deplibs_check_method=pass_all - ;; - -+linux-uclibc*) -+ lt_cv_deplibs_check_method=pass_all -+ lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so` -+ ;; -+ - netbsd* | knetbsd*-gnu) - if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then - lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$' -diff -dur binutils-2.17.50.0.14.orig/ld/configure binutils-2.17.50.0.14/ld/configure ---- binutils-2.17.50.0.14.orig/ld/configure 2007-03-16 16:48:30.000000000 +0100 -+++ binutils-2.17.50.0.14/ld/configure 2007-04-10 17:35:41.000000000 +0200 -@@ -3412,7 +3412,7 @@ - ;; - - # This must be Linux ELF. --linux-gnu*) -+linux-gnu*|linux-uclibc*) - lt_cv_deplibs_check_method=pass_all - ;; - -diff -dur binutils-2.17.50.0.14.orig/libtool.m4 binutils-2.17.50.0.14/libtool.m4 ---- binutils-2.17.50.0.14.orig/libtool.m4 2006-02-14 00:10:15.000000000 +0100 -+++ binutils-2.17.50.0.14/libtool.m4 2007-04-10 17:35:41.000000000 +0200 -@@ -739,7 +739,7 @@ - ;; - - # This must be Linux ELF. --linux-gnu*) -+linux-gnu*|linux-uclibc*) - lt_cv_deplibs_check_method=pass_all - ;; - -diff -dur binutils-2.17.50.0.14.orig/ltconfig binutils-2.17.50.0.14/ltconfig ---- binutils-2.17.50.0.14.orig/ltconfig 2006-07-15 20:23:48.000000000 +0200 -+++ binutils-2.17.50.0.14/ltconfig 2007-04-10 17:35:41.000000000 +0200 -@@ -602,6 +602,7 @@ - - # Transform linux* to *-*-linux-gnu*, to support old configure scripts. - case $host_os in -+linux-uclibc*) ;; - linux-gnu*) ;; - linux*) host=`echo $host | sed 's/^\(.*-.*-linux\)\(.*\)$/\1-gnu\2/'` - esac -@@ -1247,7 +1248,7 @@ - ;; - - # This must be Linux ELF. --linux-gnu*) -+linux-gnu*|linux-uclibc*) - version_type=linux - need_lib_prefix=no - need_version=no -diff -dur binutils-2.17.50.0.14.orig/opcodes/configure binutils-2.17.50.0.14/opcodes/configure ---- binutils-2.17.50.0.14.orig/opcodes/configure 2007-03-16 16:48:30.000000000 +0100 -+++ binutils-2.17.50.0.14/opcodes/configure 2007-04-10 17:35:41.000000000 +0200 -@@ -3578,7 +3578,7 @@ - ;; - - # This must be Linux ELF. --linux-gnu*) -+linux-gnu*|linux-uclibc*) - lt_cv_deplibs_check_method=pass_all - ;; - diff --git a/patches/binutils/2.17.50.0.14/110-arm-eabi-conf.patch b/patches/binutils/2.17.50.0.14/110-arm-eabi-conf.patch deleted file mode 100644 index 14621d8..0000000 --- a/patches/binutils/2.17.50.0.14/110-arm-eabi-conf.patch +++ /dev/null @@ -1,24 +0,0 @@ -diff -dur binutils-2.17.50.0.14.orig/configure binutils-2.17.50.0.14/configure ---- binutils-2.17.50.0.14.orig/configure 2007-04-10 17:38:23.000000000 +0200 -+++ binutils-2.17.50.0.14/configure 2007-04-10 17:38:43.000000000 +0200 -@@ -2224,7 +2224,7 @@ - arm-*-elf* | strongarm-*-elf* | xscale-*-elf* | arm*-*-eabi* ) - noconfigdirs="$noconfigdirs target-libffi target-qthreads" - ;; -- arm*-*-linux-gnueabi) -+ arm*-*-linux-gnueabi | arm*-*-linux-uclibcgnueabi) - noconfigdirs="$noconfigdirs target-libffi target-qthreads" - noconfigdirs="$noconfigdirs target-libjava target-libobjc" - ;; -diff -dur binutils-2.17.50.0.14.orig/configure.ac binutils-2.17.50.0.14/configure.ac ---- binutils-2.17.50.0.14.orig/configure.ac 2007-04-10 17:38:23.000000000 +0200 -+++ binutils-2.17.50.0.14/configure.ac 2007-04-10 17:38:43.000000000 +0200 -@@ -513,7 +513,7 @@ - arm-*-elf* | strongarm-*-elf* | xscale-*-elf* | arm*-*-eabi* ) - noconfigdirs="$noconfigdirs target-libffi target-qthreads" - ;; -- arm*-*-linux-gnueabi) -+ arm*-*-linux-gnueabi | arm*-*-linux-uclibcgnueabi) - noconfigdirs="$noconfigdirs target-libffi target-qthreads" - noconfigdirs="$noconfigdirs target-libjava target-libobjc" - ;; diff --git a/patches/binutils/2.17.50.0.14/300-001_ld_makefile_patch.patch b/patches/binutils/2.17.50.0.14/300-001_ld_makefile_patch.patch deleted file mode 100644 index b919296..0000000 --- a/patches/binutils/2.17.50.0.14/300-001_ld_makefile_patch.patch +++ /dev/null @@ -1,24 +0,0 @@ -diff -dur binutils-2.17.50.0.14.orig/ld/Makefile.am binutils-2.17.50.0.14/ld/Makefile.am ---- binutils-2.17.50.0.14.orig/ld/Makefile.am 2007-03-16 16:48:30.000000000 +0100 -+++ binutils-2.17.50.0.14/ld/Makefile.am 2007-04-10 17:40:16.000000000 +0200 -@@ -17,7 +17,7 @@ - # We put the scripts in the directory $(scriptdir)/ldscripts. - # We can't put the scripts in $(datadir) because the SEARCH_DIR - # directives need to be different for native and cross linkers. --scriptdir = $(tooldir)/lib -+scriptdir = $(libdir) - - EMUL = @EMUL@ - EMULATION_OFILES = @EMULATION_OFILES@ -diff -dur binutils-2.17.50.0.14.orig/ld/Makefile.in binutils-2.17.50.0.14/ld/Makefile.in ---- binutils-2.17.50.0.14.orig/ld/Makefile.in 2007-03-16 16:48:30.000000000 +0100 -+++ binutils-2.17.50.0.14/ld/Makefile.in 2007-04-10 17:40:16.000000000 +0200 -@@ -274,7 +274,7 @@ - # We put the scripts in the directory $(scriptdir)/ldscripts. - # We can't put the scripts in $(datadir) because the SEARCH_DIR - # directives need to be different for native and cross linkers. --scriptdir = $(tooldir)/lib -+scriptdir = $(libdir) - BASEDIR = $(srcdir)/.. - BFDDIR = $(BASEDIR)/bfd - INCDIR = $(BASEDIR)/include diff --git a/patches/binutils/2.17.50.0.14/300-012_check_ldrunpath_length.patch b/patches/binutils/2.17.50.0.14/300-012_check_ldrunpath_length.patch deleted file mode 100644 index 3af193e..0000000 --- a/patches/binutils/2.17.50.0.14/300-012_check_ldrunpath_length.patch +++ /dev/null @@ -1,21 +0,0 @@ -diff -dur binutils-2.17.50.0.14.orig/ld/emultempl/elf32.em binutils-2.17.50.0.14/ld/emultempl/elf32.em ---- binutils-2.17.50.0.14.orig/ld/emultempl/elf32.em 2007-03-23 16:42:51.000000000 +0100 -+++ binutils-2.17.50.0.14/ld/emultempl/elf32.em 2007-04-10 17:41:24.000000000 +0200 -@@ -1007,6 +1007,8 @@ - && command_line.rpath == NULL) - { - lib_path = (const char *) getenv ("LD_RUN_PATH"); -+ if ((lib_path) && (strlen (lib_path) == 0)) -+ lib_path = NULL; - if (gld${EMULATION_NAME}_search_needed (lib_path, &n, - force)) - break; -@@ -1191,6 +1193,8 @@ - rpath = command_line.rpath; - if (rpath == NULL) - rpath = (const char *) getenv ("LD_RUN_PATH"); -+ if ((rpath) && (strlen (rpath) == 0)) -+ rpath = NULL; - if (! (bfd_elf_size_dynamic_sections - (output_bfd, command_line.soname, rpath, - command_line.filter_shlib, diff --git a/patches/binutils/2.17.50.0.17/110-arm-eabi-conf.patch b/patches/binutils/2.17.50.0.17/110-arm-eabi-conf.patch deleted file mode 100644 index 04e19be..0000000 --- a/patches/binutils/2.17.50.0.17/110-arm-eabi-conf.patch +++ /dev/null @@ -1,24 +0,0 @@ -diff -u binutils-2.17.50.0.17.oorig/configure binutils-2.17.50.0.17/configure ---- binutils-2.17.50.0.17.oorig/configure 2007-06-18 19:29:28.000000000 +0200 -+++ binutils-2.17.50.0.17/configure 2007-06-25 09:58:36.000000000 +0200 -@@ -2224,7 +2224,7 @@ - arm-*-elf* | strongarm-*-elf* | xscale-*-elf* | arm*-*-eabi* ) - noconfigdirs="$noconfigdirs target-libffi target-qthreads" - ;; -- arm*-*-linux-gnueabi) -+ arm*-*-linux-gnueabi | arm*-*-linux-uclibcgnueabi) - noconfigdirs="$noconfigdirs target-libffi target-qthreads" - noconfigdirs="$noconfigdirs target-libjava target-libobjc" - ;; -diff -u binutils-2.17.50.0.17.oorig/configure.ac binutils-2.17.50.0.17/configure.ac ---- binutils-2.17.50.0.17.oorig/configure.ac 2007-06-18 19:29:28.000000000 +0200 -+++ binutils-2.17.50.0.17/configure.ac 2007-06-25 09:58:36.000000000 +0200 -@@ -513,7 +513,7 @@ - arm-*-elf* | strongarm-*-elf* | xscale-*-elf* | arm*-*-eabi* ) - noconfigdirs="$noconfigdirs target-libffi target-qthreads" - ;; -- arm*-*-linux-gnueabi) -+ arm*-*-linux-gnueabi | arm*-*-linux-uclibcgnueabi) - noconfigdirs="$noconfigdirs target-libffi target-qthreads" - noconfigdirs="$noconfigdirs target-libjava target-libobjc" - ;; diff --git a/patches/binutils/2.17.50.0.17/300-001_ld_makefile_patch.patch b/patches/binutils/2.17.50.0.17/300-001_ld_makefile_patch.patch deleted file mode 100644 index 5cb0f61..0000000 --- a/patches/binutils/2.17.50.0.17/300-001_ld_makefile_patch.patch +++ /dev/null @@ -1,24 +0,0 @@ -diff -u binutils-2.17.50.0.17.oorig/ld/Makefile.am binutils-2.17.50.0.17/ld/Makefile.am ---- binutils-2.17.50.0.17.oorig/ld/Makefile.am 2007-06-18 19:29:29.000000000 +0200 -+++ binutils-2.17.50.0.17/ld/Makefile.am 2007-06-25 10:00:36.000000000 +0200 -@@ -18,7 +18,7 @@ - # We put the scripts in the directory $(scriptdir)/ldscripts. - # We can't put the scripts in $(datadir) because the SEARCH_DIR - # directives need to be different for native and cross linkers. --scriptdir = $(tooldir)/lib -+scriptdir = $(libdir) - - EMUL = @EMUL@ - EMULATION_OFILES = @EMULATION_OFILES@ -diff -u binutils-2.17.50.0.17.oorig/ld/Makefile.in binutils-2.17.50.0.17/ld/Makefile.in ---- binutils-2.17.50.0.17.oorig/ld/Makefile.in 2007-06-18 19:29:29.000000000 +0200 -+++ binutils-2.17.50.0.17/ld/Makefile.in 2007-06-25 10:00:36.000000000 +0200 -@@ -287,7 +287,7 @@ - # We put the scripts in the directory $(scriptdir)/ldscripts. - # We can't put the scripts in $(datadir) because the SEARCH_DIR - # directives need to be different for native and cross linkers. --scriptdir = $(tooldir)/lib -+scriptdir = $(libdir) - BASEDIR = $(srcdir)/.. - BFDDIR = $(BASEDIR)/bfd - INCDIR = $(BASEDIR)/include diff --git a/patches/binutils/2.17.50.0.17/300-012_check_ldrunpath_length.patch b/patches/binutils/2.17.50.0.17/300-012_check_ldrunpath_length.patch deleted file mode 100644 index 6e80921..0000000 --- a/patches/binutils/2.17.50.0.17/300-012_check_ldrunpath_length.patch +++ /dev/null @@ -1,21 +0,0 @@ -diff -u binutils-2.17.50.0.17.oorig/ld/emultempl/elf32.em binutils-2.17.50.0.17/ld/emultempl/elf32.em ---- binutils-2.17.50.0.17.oorig/ld/emultempl/elf32.em 2007-06-18 19:31:40.000000000 +0200 -+++ binutils-2.17.50.0.17/ld/emultempl/elf32.em 2007-06-25 10:01:25.000000000 +0200 -@@ -1007,6 +1007,8 @@ - && command_line.rpath == NULL) - { - lib_path = (const char *) getenv ("LD_RUN_PATH"); -+ if ((lib_path) && (strlen (lib_path) == 0)) -+ lib_path = NULL; - if (gld${EMULATION_NAME}_search_needed (lib_path, &n, - force)) - break; -@@ -1191,6 +1193,8 @@ - rpath = command_line.rpath; - if (rpath == NULL) - rpath = (const char *) getenv ("LD_RUN_PATH"); -+ if ((rpath) && (strlen (rpath) == 0)) -+ rpath = NULL; - if (! (bfd_elf_size_dynamic_sections - (output_bfd, command_line.soname, rpath, - command_line.filter_shlib, diff --git a/patches/binutils/2.17.50.0.18/110-arm-eabi-conf.patch b/patches/binutils/2.17.50.0.18/110-arm-eabi-conf.patch deleted file mode 100644 index 04e19be..0000000 --- a/patches/binutils/2.17.50.0.18/110-arm-eabi-conf.patch +++ /dev/null @@ -1,24 +0,0 @@ -diff -u binutils-2.17.50.0.17.oorig/configure binutils-2.17.50.0.17/configure ---- binutils-2.17.50.0.17.oorig/configure 2007-06-18 19:29:28.000000000 +0200 -+++ binutils-2.17.50.0.17/configure 2007-06-25 09:58:36.000000000 +0200 -@@ -2224,7 +2224,7 @@ - arm-*-elf* | strongarm-*-elf* | xscale-*-elf* | arm*-*-eabi* ) - noconfigdirs="$noconfigdirs target-libffi target-qthreads" - ;; -- arm*-*-linux-gnueabi) -+ arm*-*-linux-gnueabi | arm*-*-linux-uclibcgnueabi) - noconfigdirs="$noconfigdirs target-libffi target-qthreads" - noconfigdirs="$noconfigdirs target-libjava target-libobjc" - ;; -diff -u binutils-2.17.50.0.17.oorig/configure.ac binutils-2.17.50.0.17/configure.ac ---- binutils-2.17.50.0.17.oorig/configure.ac 2007-06-18 19:29:28.000000000 +0200 -+++ binutils-2.17.50.0.17/configure.ac 2007-06-25 09:58:36.000000000 +0200 -@@ -513,7 +513,7 @@ - arm-*-elf* | strongarm-*-elf* | xscale-*-elf* | arm*-*-eabi* ) - noconfigdirs="$noconfigdirs target-libffi target-qthreads" - ;; -- arm*-*-linux-gnueabi) -+ arm*-*-linux-gnueabi | arm*-*-linux-uclibcgnueabi) - noconfigdirs="$noconfigdirs target-libffi target-qthreads" - noconfigdirs="$noconfigdirs target-libjava target-libobjc" - ;; diff --git a/patches/binutils/2.17.50.0.18/300-001_ld_makefile_patch.patch b/patches/binutils/2.17.50.0.18/300-001_ld_makefile_patch.patch deleted file mode 100644 index 5cb0f61..0000000 --- a/patches/binutils/2.17.50.0.18/300-001_ld_makefile_patch.patch +++ /dev/null @@ -1,24 +0,0 @@ -diff -u binutils-2.17.50.0.17.oorig/ld/Makefile.am binutils-2.17.50.0.17/ld/Makefile.am ---- binutils-2.17.50.0.17.oorig/ld/Makefile.am 2007-06-18 19:29:29.000000000 +0200 -+++ binutils-2.17.50.0.17/ld/Makefile.am 2007-06-25 10:00:36.000000000 +0200 -@@ -18,7 +18,7 @@ - # We put the scripts in the directory $(scriptdir)/ldscripts. - # We can't put the scripts in $(datadir) because the SEARCH_DIR - # directives need to be different for native and cross linkers. --scriptdir = $(tooldir)/lib -+scriptdir = $(libdir) - - EMUL = @EMUL@ - EMULATION_OFILES = @EMULATION_OFILES@ -diff -u binutils-2.17.50.0.17.oorig/ld/Makefile.in binutils-2.17.50.0.17/ld/Makefile.in ---- binutils-2.17.50.0.17.oorig/ld/Makefile.in 2007-06-18 19:29:29.000000000 +0200 -+++ binutils-2.17.50.0.17/ld/Makefile.in 2007-06-25 10:00:36.000000000 +0200 -@@ -287,7 +287,7 @@ - # We put the scripts in the directory $(scriptdir)/ldscripts. - # We can't put the scripts in $(datadir) because the SEARCH_DIR - # directives need to be different for native and cross linkers. --scriptdir = $(tooldir)/lib -+scriptdir = $(libdir) - BASEDIR = $(srcdir)/.. - BFDDIR = $(BASEDIR)/bfd - INCDIR = $(BASEDIR)/include diff --git a/patches/binutils/2.17.50.0.18/300-012_check_ldrunpath_length.patch b/patches/binutils/2.17.50.0.18/300-012_check_ldrunpath_length.patch deleted file mode 100644 index 6e80921..0000000 --- a/patches/binutils/2.17.50.0.18/300-012_check_ldrunpath_length.patch +++ /dev/null @@ -1,21 +0,0 @@ -diff -u binutils-2.17.50.0.17.oorig/ld/emultempl/elf32.em binutils-2.17.50.0.17/ld/emultempl/elf32.em ---- binutils-2.17.50.0.17.oorig/ld/emultempl/elf32.em 2007-06-18 19:31:40.000000000 +0200 -+++ binutils-2.17.50.0.17/ld/emultempl/elf32.em 2007-06-25 10:01:25.000000000 +0200 -@@ -1007,6 +1007,8 @@ - && command_line.rpath == NULL) - { - lib_path = (const char *) getenv ("LD_RUN_PATH"); -+ if ((lib_path) && (strlen (lib_path) == 0)) -+ lib_path = NULL; - if (gld${EMULATION_NAME}_search_needed (lib_path, &n, - force)) - break; -@@ -1191,6 +1193,8 @@ - rpath = command_line.rpath; - if (rpath == NULL) - rpath = (const char *) getenv ("LD_RUN_PATH"); -+ if ((rpath) && (strlen (rpath) == 0)) -+ rpath = NULL; - if (! (bfd_elf_size_dynamic_sections - (output_bfd, command_line.soname, rpath, - command_line.filter_shlib, diff --git a/patches/cygwin/1.5.15-1/100-cygwin-1.5.15-1-crossbuild.patch b/patches/cygwin/1.5.15-1/100-cygwin-1.5.15-1-crossbuild.patch new file mode 100644 index 0000000..d312403 --- /dev/null +++ b/patches/cygwin/1.5.15-1/100-cygwin-1.5.15-1-crossbuild.patch @@ -0,0 +1,40 @@ +Message-ID: <4269173F.7020705@zee2.com> +Date: Fri, 22 Apr 2005 16:24:47 +0100 +From: Steve Papacharalambous +To: "Robert P. J. Day" +CC: crossgcc list +Subject: Re: cygwin source directory has moved +In-Reply-To: + +Hi Robert, + +I've attached two patches: + +1/ For crosstool-0.31 which changes the CYGWIN_URL to one which has the +cygwin source archives. The version of cygwin that is used to build the +cross toolchain has been changed to cygwin-1.5.15-1-src.tar.bz2 since +most of the mirror sites don't seem to have the original archive used. +[created gcc-3.3.2-cygwin-1.5.15-1.dat - dank] + + +2/ The later cygwin source archive fails to cross build with the error: +/opt/crosstool/i686-pc-cygwin/gcc-3.3.2-cygwin-1.5.15-1/lib/gcc-lib/i686-pc-cygwin/bin/ld: +cannot find -luser32 + +unless the second patch is applied, + + +diff -uNr cygwin-1.5.15-1.orig/winsup/mingw/Makefile.in cygwin-1.5.15-1/winsup/mingw/Makefile.in +--- cygwin-1.5.15-1.orig/winsup/mingw/Makefile.in 2005-02-28 22:51:02.000000000 +0000 ++++ cygwin-1.5.15-1/winsup/mingw/Makefile.in 2005-04-22 15:29:18.000000000 +0100 +@@ -71,7 +71,7 @@ + mkinstalldirs = $(SHELL) @MKINSTALLDIRS@ + + CC := @CC@ +-override CC := ${filter-out -L% -B%,${shell echo $(CC) | sed -e 's%\(-isystem\|-iwithprefixbefore\) *[^ ]*\( \|$$\)% %g'}} ++override CC := ${filter-out -B%,${shell echo $(CC) | sed -e 's%\(-isystem\|-iwithprefixbefore\) *[^ ]*\( \|$$\)% %g'}} + # FIXME: Which is it, CC or CC_FOR_TARGET? + CC_FOR_TARGET = $(CC) + AS_FOR_TARGET = $(AS) + + diff --git a/patches/cygwin/1.5.15-1/cygwin-1.5.15-1-crossbuild.patch b/patches/cygwin/1.5.15-1/cygwin-1.5.15-1-crossbuild.patch deleted file mode 100644 index d312403..0000000 --- a/patches/cygwin/1.5.15-1/cygwin-1.5.15-1-crossbuild.patch +++ /dev/null @@ -1,40 +0,0 @@ -Message-ID: <4269173F.7020705@zee2.com> -Date: Fri, 22 Apr 2005 16:24:47 +0100 -From: Steve Papacharalambous -To: "Robert P. J. Day" -CC: crossgcc list -Subject: Re: cygwin source directory has moved -In-Reply-To: - -Hi Robert, - -I've attached two patches: - -1/ For crosstool-0.31 which changes the CYGWIN_URL to one which has the -cygwin source archives. The version of cygwin that is used to build the -cross toolchain has been changed to cygwin-1.5.15-1-src.tar.bz2 since -most of the mirror sites don't seem to have the original archive used. -[created gcc-3.3.2-cygwin-1.5.15-1.dat - dank] - - -2/ The later cygwin source archive fails to cross build with the error: -/opt/crosstool/i686-pc-cygwin/gcc-3.3.2-cygwin-1.5.15-1/lib/gcc-lib/i686-pc-cygwin/bin/ld: -cannot find -luser32 - -unless the second patch is applied, - - -diff -uNr cygwin-1.5.15-1.orig/winsup/mingw/Makefile.in cygwin-1.5.15-1/winsup/mingw/Makefile.in ---- cygwin-1.5.15-1.orig/winsup/mingw/Makefile.in 2005-02-28 22:51:02.000000000 +0000 -+++ cygwin-1.5.15-1/winsup/mingw/Makefile.in 2005-04-22 15:29:18.000000000 +0100 -@@ -71,7 +71,7 @@ - mkinstalldirs = $(SHELL) @MKINSTALLDIRS@ - - CC := @CC@ --override CC := ${filter-out -L% -B%,${shell echo $(CC) | sed -e 's%\(-isystem\|-iwithprefixbefore\) *[^ ]*\( \|$$\)% %g'}} -+override CC := ${filter-out -B%,${shell echo $(CC) | sed -e 's%\(-isystem\|-iwithprefixbefore\) *[^ ]*\( \|$$\)% %g'}} - # FIXME: Which is it, CC or CC_FOR_TARGET? - CC_FOR_TARGET = $(CC) - AS_FOR_TARGET = $(AS) - - diff --git a/patches/gcc/2.95.3/100-arm-linux.patch b/patches/gcc/2.95.3/100-arm-linux.patch new file mode 100644 index 0000000..00974f6 --- /dev/null +++ b/patches/gcc/2.95.3/100-arm-linux.patch @@ -0,0 +1,647 @@ +--------- snip ------- +Downloaded from ftp://ftp.linux.org.uk/pub/armlinux/toolchain/src-2.95.3/gcc-2.95.3.diff.bz2 +Not sure what it fixes, but this appears to be The Patch used with gcc-2.95.3 on arm. +--------- snip ------- + +diff -urN gcc-2.95.3-orig/gcc/config/arm/arm.c gcc-2.95.3/gcc/config/arm/arm.c +--- gcc-2.95.3-orig/gcc/config/arm/arm.c Thu Jan 25 15:03:24 2001 ++++ gcc-2.95.3/gcc/config/arm/arm.c Fri Jul 20 19:39:11 2001 +@@ -1529,27 +1529,34 @@ + return gen_rtx_PLUS (Pmode, base, offset); + } + else if (GET_CODE (orig) == LABEL_REF) +- current_function_uses_pic_offset_table = 1; +- +- return orig; +-} ++ { ++ current_function_uses_pic_offset_table = 1; + +-static rtx pic_rtx; ++ if (NEED_PLT_GOT) ++ { ++ rtx pic_ref, address = gen_reg_rtx (Pmode); ++ ++ emit_insn (gen_pic_load_addr (address, orig)); ++ pic_ref = gen_rtx_PLUS (Pmode, pic_offset_table_rtx, ++ address); ++ emit_move_insn (address, pic_ref); ++ return address; ++ } ++ } + +-int +-is_pic(x) +- rtx x; +-{ +- if (x == pic_rtx) +- return 1; +- return 0; ++ return orig; + } + ++/* Generate code to load the PIC register. PROLOGUE is true if ++ called from arm_expand_prologue (in which case we want the ++ generated insns at the start of the function); false if called ++ by an exception receiver that needs the PIC register reloaded ++ (in which case the insns are just dumped at the current location). */ + void +-arm_finalize_pic () ++arm_finalize_pic (int prologue) + { + #ifndef AOF_ASSEMBLER +- rtx l1, pic_tmp, pic_tmp2, seq; ++ rtx l1, pic_tmp, pic_tmp2, seq, pic_rtx; + rtx global_offset_table; + + if (current_function_uses_pic_offset_table == 0) +@@ -1578,7 +1585,10 @@ + + seq = gen_sequence (); + end_sequence (); +- emit_insn_after (seq, get_insns ()); ++ if (prologue) ++ emit_insn_after (seq, get_insns ()); ++ else ++ emit_insn (seq); + + /* Need to emit this whether or not we obey regdecls, + since setjmp/longjmp can cause life info to screw up. */ +@@ -5327,7 +5337,13 @@ + if (frame_pointer_needed) + live_regs += 4; + +- if (live_regs) ++ if (live_regs == 1 && regs_ever_live[LR_REGNUM] ++ && ! lr_save_eliminated && ! really_return) ++ { ++ output_asm_insn (reverse ? "ldr%?%D0\t%|lr, [%|sp}, #4" ++ : "ldr%?%d0\t%|lr, [%|sp], #4", &operand); ++ } ++ else if (live_regs) + { + if (lr_save_eliminated || ! regs_ever_live[14]) + live_regs++; +@@ -5446,7 +5462,7 @@ + rtx x; + + length = strlen (name); +- alignlength = (length + 1) + 3 & ~3; ++ alignlength = ((length + 1) + 3) & ~3; + + ASM_OUTPUT_ASCII (stream, name, length + 1); + ASM_OUTPUT_ALIGN (stream, 2); +@@ -5838,6 +5854,9 @@ + int store_arg_regs = 0; + int volatile_func = (optimize > 0 + && TREE_THIS_VOLATILE (current_function_decl)); ++ rtx ip_rtx; ++ int fp_offset = 0; ++ rtx insn; + + /* Naked functions don't have prologues. */ + if (arm_naked_function_p (current_function_decl)) +@@ -5859,11 +5878,59 @@ + live_regs_mask |= 0x4000; + } + ++ ip_rtx = gen_rtx_REG (SImode, IP_REGNUM); ++ + if (frame_pointer_needed) + { ++ if (current_function_needs_context) ++ { ++ /* The Static chain register is the same as the IP register ++ used as a scratch register during stack frame creation. ++ To get around this need to find somewhere to store IP ++ whilst the frame is being created. We try the following ++ places in order: ++ ++ 1. An unused argument register. ++ 2. A slot on the stack above the frame. (This only ++ works if the function is not a varargs function). ++ ++ If neither of these places is available, we abort (for now). */ ++ if (regs_ever_live[3] == 0) ++ { ++ insn = gen_rtx_REG (SImode, 3); ++ insn = gen_rtx_SET (SImode, insn, ip_rtx); ++ insn = emit_insn (insn); ++ RTX_FRAME_RELATED_P (insn) = 1; ++ } ++ else if (current_function_pretend_args_size == 0) ++ { ++ insn = gen_rtx_PRE_DEC (SImode, stack_pointer_rtx); ++ insn = gen_rtx_MEM (SImode, insn); ++ insn = gen_rtx_SET (VOIDmode, insn, ip_rtx); ++ insn = emit_insn (insn); ++ RTX_FRAME_RELATED_P (insn) = 1; ++ fp_offset = 4; ++ } ++ else ++ /* FIXME - the way to handle this situation is to allow ++ the pretend args to be dumped onto the stack, then ++ reuse r3 to save IP. This would involve moving the ++ copying os SP into IP until after the pretend args ++ have been dumped, but this is not too hard. */ ++ error ("Unable to find a temporary location for static chanin register"); ++ } ++ + live_regs_mask |= 0xD800; +- emit_insn (gen_movsi (gen_rtx_REG (SImode, 12), +- stack_pointer_rtx)); ++ if (fp_offset) ++ { ++ insn = gen_rtx_PLUS (SImode, stack_pointer_rtx, GEN_INT (fp_offset)); ++ insn = gen_rtx_SET (SImode, ip_rtx, insn); ++ } ++ else ++ insn = gen_movsi (ip_rtx, stack_pointer_rtx); ++ ++ insn = emit_insn (insn); ++ RTX_FRAME_RELATED_P (insn) = 1; + } + + if (current_function_pretend_args_size) +@@ -5927,9 +5994,31 @@ + } + + if (frame_pointer_needed) +- emit_insn (gen_addsi3 (hard_frame_pointer_rtx, gen_rtx_REG (SImode, 12), +- (GEN_INT +- (-(4 + current_function_pretend_args_size))))); ++ { ++ insn = GEN_INT (-(4 + current_function_pretend_args_size + fp_offset)); ++ insn = emit_insn (gen_addsi3 (hard_frame_pointer_rtx, ip_rtx, insn)); ++ RTX_FRAME_RELATED_P (insn) = 1; ++ ++ if (current_function_needs_context) ++ { ++ /* Recover the static chain register. */ ++ if (regs_ever_live [3] == 0) ++ { ++ insn = gen_rtx_REG (SImode, 3); ++ insn = gen_rtx_SET (SImode, ip_rtx, insn); ++ insn = emit_insn (insn); ++ RTX_FRAME_RELATED_P (insn) = 1; ++ } ++ else /* if (current_function_pretend_args_size == 0) */ ++ { ++ insn = gen_rtx_PLUS (SImode, hard_frame_pointer_rtx, GEN_INT (4)); ++ insn = gen_rtx_MEM (SImode, insn); ++ insn = gen_rtx_SET (SImode, ip_rtx, insn); ++ insn = emit_insn (insn); ++ RTX_FRAME_RELATED_P (insn) = 1; ++ } ++ } ++ } + + if (amount != const0_rtx) + { +diff -urN gcc-2.95.3-orig/gcc/config/arm/arm.h gcc-2.95.3/gcc/config/arm/arm.h +--- gcc-2.95.3-orig/gcc/config/arm/arm.h Thu Jan 25 15:03:26 2001 ++++ gcc-2.95.3/gcc/config/arm/arm.h Fri Jul 20 19:39:11 2001 +@@ -601,14 +601,20 @@ + (TREE_CODE (EXP) == STRING_CST \ + && (ALIGN) < BITS_PER_WORD ? BITS_PER_WORD : (ALIGN)) + ++#ifndef STRUCTURE_SIZE_BOUNDARY + /* Every structures size must be a multiple of 32 bits. */ + /* This is for compatibility with ARMCC. ARM SDT Reference Manual + (ARM DUI 0020D) page 2-20 says "Structures are aligned on word + boundaries". */ +-#ifndef STRUCTURE_SIZE_BOUNDARY +-#define STRUCTURE_SIZE_BOUNDARY 32 ++/* Setting this to 32 produces more efficient code, but the value set in previous ++ versions of this toolchain was 8, which produces more compact structures. The ++ command line option -mstructure_size_boundary= can be used to change this ++ value. */ ++#define STRUCTURE_SIZE_BOUNDARY arm_structure_size_boundary + #endif + ++extern int arm_structure_size_boundary; ++ + /* Used when parsing command line option -mstructure_size_boundary. */ + extern const char * structure_size_string; + +@@ -768,6 +774,9 @@ + /* Specify the registers used for certain standard purposes. + The values of these macros are register numbers. */ + ++/* Register which holds return address from a subroutine call. */ ++#define LR_REGNUM 14 ++ + /* Define this if the program counter is overloaded on a register. */ + #define PC_REGNUM 15 + +@@ -777,6 +786,9 @@ + /* Base register for access to local variables of the function. */ + #define FRAME_POINTER_REGNUM 25 + ++/* Scratch register - used in all kinds of places, eg trampolines. */ ++#define IP_REGNUM 12 ++ + /* Define this to be where the real frame pointer is if it is not possible to + work out the offset between the frame pointer and the automatic variables + until after register allocation has taken place. FRAME_POINTER_REGNUM +@@ -798,7 +810,7 @@ + /* The native (Norcroft) Pascal compiler for the ARM passes the static chain + as an invisible last argument (possible since varargs don't exist in + Pascal), so the following is not true. */ +-#define STATIC_CHAIN_REGNUM 8 ++#define STATIC_CHAIN_REGNUM 12 + + /* Register in which address to store a structure value + is passed to a function. */ +@@ -1248,7 +1260,12 @@ + { \ + int volatile_func = arm_volatile_func (); \ + if ((FROM) == ARG_POINTER_REGNUM && (TO) == HARD_FRAME_POINTER_REGNUM)\ +- (OFFSET) = 0; \ ++ { \ ++ if (! current_function_needs_context || ! frame_pointer_needed) \ ++ (OFFSET) = 0; \ ++ else \ ++ (OFFSET) = 4; \ ++ } \ + else if ((FROM) == FRAME_POINTER_REGNUM \ + && (TO) == STACK_POINTER_REGNUM) \ + (OFFSET) = (current_function_outgoing_args_size \ +@@ -1379,8 +1396,10 @@ + + On the ARM, allow any integer (invalid ones are removed later by insn + patterns), nice doubles and symbol_refs which refer to the function's +- constant pool XXX. */ +-#define LEGITIMATE_CONSTANT_P(X) (! label_mentioned_p (X)) ++ constant pool XXX. ++ ++ When generating PIC code, allow anything. */ ++#define LEGITIMATE_CONSTANT_P(X) (flag_pic || ! label_mentioned_p (X)) + + /* Symbols in the text segment can be accessed without indirecting via the + constant pool; it may take an extra binary operation, but this is still +@@ -1496,9 +1515,8 @@ + && INTVAL (op) <= 31) \ + goto LABEL; \ + } \ +- /* NASTY: Since this limits the addressing of unsigned byte loads */ \ + range = ((MODE) == HImode || (MODE) == QImode) \ +- ? (arm_arch4 ? 256 : 4095) : 4096; \ ++ ? (((MODE) == HImode && arm_arch4) ? 256 : 4095) : 4096; \ + if (code == CONST_INT && INTVAL (INDEX) < range \ + && INTVAL (INDEX) > -range) \ + goto LABEL; \ +@@ -1812,14 +1830,15 @@ + data addresses in memory. */ + #define PIC_OFFSET_TABLE_REGNUM arm_pic_register + +-#define FINALIZE_PIC arm_finalize_pic () ++#define FINALIZE_PIC arm_finalize_pic (1) + +-/* We can't directly access anything that contains a symbol, ++/* We can't directly access anything that contains a symbol or label, + nor can we indirect via the constant pool. */ + #define LEGITIMATE_PIC_OPERAND_P(X) \ +- (! symbol_mentioned_p (X) \ ++ (! symbol_mentioned_p (X) && ! label_mentioned_p (X) \ + && (! CONSTANT_POOL_ADDRESS_P (X) \ +- || ! symbol_mentioned_p (get_pool_constant (X)))) ++ || (! symbol_mentioned_p (get_pool_constant (X))) \ ++ && (! label_mentioned_p (get_pool_constant (X))))) + + /* We need to know when we are making a constant pool; this determines + whether data needs to be in the GOT or can be referenced via a GOT +@@ -2046,17 +2065,9 @@ + else output_addr_const(STREAM, X); \ + } + +-/* Handles PIC addr specially */ + #define OUTPUT_INT_ADDR_CONST(STREAM,X) \ + { \ +- if (flag_pic && GET_CODE(X) == CONST && is_pic(X)) \ +- { \ +- output_addr_const(STREAM, XEXP (XEXP (XEXP (X, 0), 0), 0)); \ +- fputs(" - (", STREAM); \ +- output_addr_const(STREAM, XEXP (XEXP (XEXP (X, 0), 1), 0)); \ +- fputs(")", STREAM); \ +- } \ +- else output_addr_const(STREAM, X); \ ++ output_addr_const(STREAM, X); \ + \ + /* Mark symbols as position independent. We only do this in the \ + .text segment, not in the .data segment. */ \ +@@ -2170,8 +2181,7 @@ + int arm_return_in_memory PROTO ((Tree)); + int legitimate_pic_operand_p PROTO ((Rtx)); + Rtx legitimize_pic_address PROTO ((Rtx, Mmode, Rtx)); +-int is_pic PROTO ((Rtx)); +-void arm_finalize_pic PROTO ((void)); ++void arm_finalize_pic PROTO ((int)); + int arm_rtx_costs RTX_CODE_PROTO ((Rtx, Rcode)); + int arm_adjust_cost PROTO ((Rtx, Rtx, Rtx, int)); + int const_double_rtx_ok_for_fpu PROTO ((Rtx)); +diff -urN gcc-2.95.3-orig/gcc/config/arm/arm.md gcc-2.95.3/gcc/config/arm/arm.md +--- gcc-2.95.3-orig/gcc/config/arm/arm.md Thu Jan 25 15:03:27 2001 ++++ gcc-2.95.3/gcc/config/arm/arm.md Fri Jul 20 19:39:11 2001 +@@ -2629,7 +2629,8 @@ + : preserve_subexpressions_p ())); + DONE; + } +- if (CONSTANT_P (operands[1]) && flag_pic) ++ if ((CONSTANT_P (operands[1]) || symbol_mentioned_p (operands[1]) ++ || label_mentioned_p (operands[1])) && flag_pic) + operands[1] = legitimize_pic_address (operands[1], SImode, + ((reload_in_progress + || reload_completed) +@@ -2721,6 +2722,15 @@ + return \"add%?\\t%0, %|pc, %0\"; + ") + ++(define_expand "builtin_setjmp_receiver" ++ [(label_ref (match_operand 0 "" ""))] ++ "flag_pic" ++ " ++{ ++ arm_finalize_pic (0); ++ DONE; ++}") ++ + ;; If copying one reg to another we can set the condition codes according to + ;; its value. Such a move is common after a return from subroutine and the + ;; result is being tested against zero. +@@ -6184,15 +6194,20 @@ + abort (); + return \"\"; + } +- strcpy (pattern, \"stmfd\\t%m0!, {%1\"); +- for (i = 1; i < XVECLEN (operands[2], 0); i++) ++ if (XVECLEN (operands[2], 0) > 1) + { +- strcat (pattern, \", %|\"); +- strcat (pattern, reg_names[REGNO (XEXP (XVECEXP (operands[2], 0, i), ++ strcpy (pattern, \"stmfd\\t%m0!, {%1\"); ++ for (i = 1; i < XVECLEN (operands[2], 0); i++) ++ { ++ strcat (pattern, \", %|\"); ++ strcat (pattern, reg_names[REGNO (XEXP (XVECEXP (operands[2], 0, i), + 0))]); ++ } ++ strcat (pattern, \"}\"); ++ output_asm_insn (pattern, operands); + } +- strcat (pattern, \"}\"); +- output_asm_insn (pattern, operands); ++ else ++ output_asm_insn (\"str\\t%1, [%m0, #-4]!\", operands); + return \"\"; + }" + [(set_attr "type" "store4")]) +diff -urN gcc-2.95.3-orig/gcc/config/arm/elf.h gcc-2.95.3/gcc/config/arm/elf.h +--- gcc-2.95.3-orig/gcc/config/arm/elf.h Mon May 31 10:21:53 1999 ++++ gcc-2.95.3/gcc/config/arm/elf.h Fri Jul 20 19:39:11 2001 +@@ -167,15 +167,6 @@ + #define MULTILIB_DEFAULTS { "mlittle-endian", "msoft-float", "mapcs-32", "mno-thumb-interwork" } + #endif + +-/* Setting this to 32 produces more efficient code, but the value set in previous +- versions of this toolchain was 8, which produces more compact structures. The +- command line option -mstructure_size_boundary= can be used to change this +- value. */ +-#undef STRUCTURE_SIZE_BOUNDARY +-#define STRUCTURE_SIZE_BOUNDARY arm_structure_size_boundary +- +-extern int arm_structure_size_boundary; +- + /* 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. */ +diff -urN gcc-2.95.3-orig/gcc/config/arm/linux-gas.h gcc-2.95.3/gcc/config/arm/linux-gas.h +--- gcc-2.95.3-orig/gcc/config/arm/linux-gas.h Mon Feb 22 17:47:57 1999 ++++ gcc-2.95.3/gcc/config/arm/linux-gas.h Fri Jul 20 19:39:11 2001 +@@ -1,6 +1,6 @@ + /* Definitions of target machine for GNU compiler. + ARM Linux-based GNU systems version. +- Copyright (C) 1997, 1998, 1999 Free Software Foundation, Inc. ++ Copyright (C) 1997, 1998, 1999, 2000 Free Software Foundation, Inc. + Contributed by Russell King . + + This file is part of GNU CC. +@@ -79,5 +79,7 @@ + register unsigned long _beg __asm ("a1") = (unsigned long) (BEG); \ + register unsigned long _end __asm ("a2") = (unsigned long) (END); \ + register unsigned long _flg __asm ("a3") = 0; \ +- __asm __volatile ("swi 0x9f0002"); \ ++ __asm __volatile ("swi 0x9f0002 @ sys_cacheflush" \ ++ : "=r" (_beg) \ ++ : "0" (_beg), "r" (_end), "r" (_flg)); \ + } +diff -urN gcc-2.95.3-orig/gcc/config/arm/t-linux gcc-2.95.3/gcc/config/arm/t-linux +--- gcc-2.95.3-orig/gcc/config/arm/t-linux Fri Mar 26 16:30:20 1999 ++++ gcc-2.95.3/gcc/config/arm/t-linux Fri Jul 20 20:46:19 2001 +@@ -1,6 +1,6 @@ + # Just for these, we omit the frame pointer since it makes such a big + # difference. It is then pointless adding debugging. +-TARGET_LIBGCC2_CFLAGS = -fomit-frame-pointer -fPIC ++TARGET_LIBGCC2_CFLAGS = -fomit-frame-pointer -fPIC + LIBGCC2_DEBUG_CFLAGS = -g0 + + # Don't build enquire +diff -urN gcc-2.95.3-orig/gcc/final.c gcc-2.95.3/gcc/final.c +--- gcc-2.95.3-orig/gcc/final.c Mon Mar 12 13:07:59 2001 ++++ gcc-2.95.3/gcc/final.c Fri Jul 20 19:39:11 2001 +@@ -3652,8 +3652,9 @@ + + output_addr_const (file, XEXP (x, 0)); + fprintf (file, "-"); +- if (GET_CODE (XEXP (x, 1)) == CONST_INT +- && INTVAL (XEXP (x, 1)) < 0) ++ if ((GET_CODE (XEXP (x, 1)) == CONST_INT ++ && INTVAL (XEXP (x, 1)) < 0) ++ || GET_CODE (XEXP (x, 1)) != CONST_INT) + { + fprintf (file, ASM_OPEN_PAREN); + output_addr_const (file, XEXP (x, 1)); +diff -urN gcc-2.95.3-orig/gcc/function.c gcc-2.95.3/gcc/function.c +--- gcc-2.95.3-orig/gcc/function.c Thu Jan 25 15:03:15 2001 ++++ gcc-2.95.3/gcc/function.c Fri Jul 20 19:39:10 2001 +@@ -3053,6 +3053,105 @@ + extracted by usage MEM with narrower mode. */ + static rtx purge_addressof_replacements; + ++/* Return 1 if X and Y are identical-looking rtx's. ++ This is the Lisp function EQUAL for rtx arguments. */ ++ ++int ++rtx_equal_for_addressof_p (x, y) ++ rtx x, y; ++{ ++ register int i; ++ register int j; ++ register enum rtx_code code; ++ register char *fmt; ++ ++ if (x == y) ++ return 1; ++ if (x == 0 || y == 0) ++ return 0; ++ ++ code = GET_CODE (x); ++ /* Rtx's of different codes cannot be equal. */ ++ if (code != GET_CODE (y)) ++ return 0; ++ ++ /* (MULT:SI x y) and (MULT:HI x y) are NOT equivalent. ++ (REG:SI x) and (REG:HI x) are NOT equivalent. ++ But (MEM:SI x) and (MEM:HI x) are equivalent for our purposes. */ ++ ++ if (code != MEM && (GET_MODE (x) != GET_MODE (y))) ++ return 0; ++ ++ /* REG, LABEL_REF, and SYMBOL_REF can be compared nonrecursively. */ ++ ++ if (code == REG) ++ return REGNO (x) == REGNO (y); ++ else if (code == LABEL_REF) ++ return XEXP (x, 0) == XEXP (y, 0); ++ else if (code == SYMBOL_REF) ++ return XSTR (x, 0) == XSTR (y, 0); ++ else if (code == SCRATCH || code == CONST_DOUBLE) ++ return 0; ++ ++ /* Compare the elements. If any pair of corresponding elements ++ fail to match, return 0 for the whole things. */ ++ ++ fmt = GET_RTX_FORMAT (code); ++ for (i = GET_RTX_LENGTH (code) - 1; i >= 0; i--) ++ { ++ switch (fmt[i]) ++ { ++ case 'w': ++ if (XWINT (x, i) != XWINT (y, i)) ++ return 0; ++ break; ++ ++ case 'n': ++ case 'i': ++ if (XINT (x, i) != XINT (y, i)) ++ return 0; ++ break; ++ ++ case 'V': ++ case 'E': ++ /* Two vectors must have the same length. */ ++ if (XVECLEN (x, i) != XVECLEN (y, i)) ++ return 0; ++ ++ /* And the corresponding elements must match. */ ++ for (j = 0; j < XVECLEN (x, i); j++) ++ if (rtx_equal_p (XVECEXP (x, i, j), XVECEXP (y, i, j)) == 0) ++ return 0; ++ break; ++ ++ case 'e': ++ if (rtx_equal_p (XEXP (x, i), XEXP (y, i)) == 0) ++ return 0; ++ break; ++ ++ case 'S': ++ case 's': ++ if (strcmp (XSTR (x, i), XSTR (y, i))) ++ return 0; ++ break; ++ ++ case 'u': ++ /* These are just backpointers, so they don't matter. */ ++ break; ++ ++ case '0': ++ break; ++ ++ /* It is believed that rtx's at this level will never ++ contain anything but integers and other rtx's, ++ except for within LABEL_REFs and SYMBOL_REFs. */ ++ default: ++ abort (); ++ } ++ } ++ return 1; ++} ++ + /* Helper function for purge_addressof. See if the rtx expression at *LOC + in INSN needs to be changed. If FORCE, always put any ADDRESSOFs into + the stack. */ +@@ -3133,7 +3232,7 @@ + for (tem = purge_bitfield_addressof_replacements; + tem != NULL_RTX; + tem = XEXP (XEXP (tem, 1), 1)) +- if (rtx_equal_p (x, XEXP (tem, 0))) ++ if (rtx_equal_for_addressof_p (x, XEXP (tem, 0))) + { + *loc = XEXP (XEXP (tem, 1), 0); + return; +@@ -3143,7 +3242,7 @@ + for (tem = purge_addressof_replacements; + tem != NULL_RTX; + tem = XEXP (XEXP (tem, 1), 1)) +- if (rtx_equal_p (XEXP (x, 0), XEXP (tem, 0))) ++ if (rtx_equal_for_addressof_p (XEXP (x, 0), XEXP (tem, 0))) + { + rtx z = XEXP (XEXP (tem, 1), 0); + +diff -urN gcc-2.95.3-orig/gcc/jump.c gcc-2.95.3/gcc/jump.c +--- gcc-2.95.3-orig/gcc/jump.c Thu Oct 21 08:24:03 1999 ++++ gcc-2.95.3/gcc/jump.c Fri Jul 20 19:39:10 2001 +@@ -115,7 +115,7 @@ + static rtx delete_unreferenced_labels PROTO((rtx)); + static void delete_noop_moves PROTO((rtx)); + static int calculate_can_reach_end PROTO((rtx, int, int)); +-static int duplicate_loop_exit_test PROTO((rtx)); ++static int duplicate_loop_exit_test PROTO((rtx, int)); + static void find_cross_jump PROTO((rtx, rtx, int, rtx *, rtx *)); + static void do_cross_jump PROTO((rtx, rtx, rtx)); + static int jump_back_p PROTO((rtx, rtx)); +@@ -338,7 +338,7 @@ + && simplejump_p (temp1)) + { + temp = PREV_INSN (insn); +- if (duplicate_loop_exit_test (insn)) ++ if (duplicate_loop_exit_test (insn, after_regscan)) + { + changed = 1; + next = NEXT_INSN (temp); +@@ -2548,8 +2548,9 @@ + values of regno_first_uid and regno_last_uid. */ + + static int +-duplicate_loop_exit_test (loop_start) ++duplicate_loop_exit_test (loop_start, after_regscan) + rtx loop_start; ++ int after_regscan; + { + rtx insn, set, reg, p, link; + rtx copy = 0, first_copy = 0; +@@ -2662,6 +2663,9 @@ + reg_map[REGNO (reg)] = gen_reg_rtx (GET_MODE (reg)); + } + } ++ ++ if (after_regscan) ++ reg_scan_update (exitcode, lastexit, max_reg); + + /* Now copy each insn. */ + for (insn = exitcode; insn != lastexit; insn = NEXT_INSN (insn)) +diff -urN gcc-2.95.3-orig/gcc/varasm.c gcc-2.95.3/gcc/varasm.c +--- gcc-2.95.3-orig/gcc/varasm.c Mon Feb 19 15:02:02 2001 ++++ gcc-2.95.3/gcc/varasm.c Fri Jul 20 19:39:11 2001 +@@ -3286,7 +3286,10 @@ + value->un.addr.offset = - INTVAL (XEXP (x, 1)); + } + else +- abort (); ++ { ++ value->un.addr.base = x; ++ value->un.addr.offset = 0; ++ } + break; + + default: diff --git a/patches/gcc/2.95.3/110-backport-config.gcc-1.4.patch b/patches/gcc/2.95.3/110-backport-config.gcc-1.4.patch new file mode 100644 index 0000000..141de0c --- /dev/null +++ b/patches/gcc/2.95.3/110-backport-config.gcc-1.4.patch @@ -0,0 +1,35 @@ +# Taken from http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/config.gcc.diff?r1=1.3&r2=1.4 +# Should fix error +# Configuration powerpc-host_apple-darwin7.3.0 not supported +# when configuring gcc-2.95 on Mac OS X for i686 target +# Also create xm-darwin.h, seems to be required, else we get the error +# In file included from .../gcc-2.95.3/gcc/gencheck.c:21: +# hconfig.h:11:30: rs6000/xm-darwin.h: No such file or directory +# make[1]: *** [gencheck.o] Error 1 + + +--- gcc-2.95.3/gcc/configure.old 2004-03-24 12:17:44.000000000 -0800 ++++ gcc-2.95.3/gcc/configure 2004-03-24 17:14:38.000000000 -0800 +@@ -5079,6 +5079,10 @@ + tmake_file=rs6000/t-beos + xmake_file=rs6000/x-beos + ;; ++ powerpc-*-darwin*) ++ xm_file="rs6000/xm-rs6000.h rs6000/xm-darwin.h" ++ xmake_file=rs6000/x-darwin ++ ;; + powerpc-*-sysv* | powerpc-*-elf*) + tm_file=rs6000/sysv4.h + xm_file="xm-siglist.h rs6000/xm-sysv4.h" +--- /dev/null 2003-01-30 02:24:37.000000000 -0800 ++++ gcc-3.0.4/gcc/config/rs6000/xm-darwin.h 2000-11-20 19:02:09.000000000 -0800 +@@ -0,0 +1,9 @@ ++/* Undo the USG definition in xm-rs6000.h, Darwin is a BSD flavor. */ ++ ++#undef USG ++ ++/* Override the usual setting, since Apple's GCC has lame bugs and ++ can't handle the initializers. Someday the bugs will be fixed and ++ we can get rid of this silliness. */ ++ ++#define HAVE_DESIGNATED_INITIALIZERS 0 diff --git a/patches/gcc/2.95.3/120-backport-config.gcc-1.92.patch b/patches/gcc/2.95.3/120-backport-config.gcc-1.92.patch new file mode 100644 index 0000000..fc55681 --- /dev/null +++ b/patches/gcc/2.95.3/120-backport-config.gcc-1.92.patch @@ -0,0 +1,39 @@ +# Taken from http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/config.gcc.diff?r1=1.91&r2=1.92 +# Should fix error +# Configuration x86_64-host_unknown-linux-gnu not supported +# when configuring gcc-2.95 on x86_64 build for i686 target +# It's a bit silly, since tm_file refers to files that don't exist, +# but as long as x86_64 is just the build machine, that doesn't matter. + +--- gcc-2.95.3/gcc/configure.old 2004-03-24 12:17:44.000000000 -0800 ++++ gcc-2.95.3/gcc/configure 2004-03-24 12:19:30.000000000 -0800 +@@ -2929,6 +2929,9 @@ + i[34567]86-*-*) + cpu_type=i386 + ;; ++ x86_64-*-*) ++ cpu_type=i386 ++ ;; + hppa*-*-*) + cpu_type=pa + ;; +@@ -3643,6 +3646,19 @@ + thread_file='posix' + fi + ;; ++ x86_64-*-linux*) ++ xmake_file=x-linux ++ tm_file="i386/biarch64.h i386/i386.h i386/att.h linux.h i386/x86-64.h \ ++ i386/linux64.h" ++ tmake_file="t-slibgcc-elf-ver t-linux i386/t-crtstuff" ++ extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o" ++ gnu_ld=yes ++ float_format=i386 ++ if test x$enable_threads = xyes; then ++ thread_file='posix' ++ fi ++ ;; ++ + i[34567]86-*-gnu*) + float_format=i386 + ;; diff --git a/patches/gcc/2.95.3/130-config.sub.patch b/patches/gcc/2.95.3/130-config.sub.patch new file mode 100644 index 0000000..c8189b5 --- /dev/null +++ b/patches/gcc/2.95.3/130-config.sub.patch @@ -0,0 +1,1257 @@ +# Backport from gcc-3.3.3 +# Fixes errors like +# Invalid configuration `x86_64-host_unknown-linux-gnu': machine `x86_64-host_unknown' not recognized +# Unrecognized host system name x86_64-host_unknown-linux-gnu. +# when configuring on chip types or operating systems like x86_64 or Darwin +# which are newer than gcc-2.95 + +--- gcc-2.95.3/config.sub.old 1999-08-04 01:09:26.000000000 -0700 ++++ gcc-2.95.3/config.sub 2004-03-24 11:28:24.000000000 -0800 +@@ -1,6 +1,10 @@ + #! /bin/sh +-# Configuration validation subroutine script, version 1.1. +-# Copyright (C) 1991, 92-97, 1998, 1999 Free Software Foundation, Inc. ++# Configuration validation subroutine script. ++# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, ++# 2000, 2001, 2002, 2003 Free Software Foundation, Inc. ++ ++timestamp='2003-01-28' ++ + # This file is (in principle) common to ALL GNU software. + # The presence of a machine in this file suggests that SOME GNU software + # can handle that machine. It does not imply ALL GNU software can. +@@ -25,6 +29,9 @@ + # configuration script generated by Autoconf, you may include it under + # the same distribution terms that you use for the rest of that program. + ++# Please send patches to . Submit a context ++# diff and a properly formatted ChangeLog entry. ++# + # Configuration subroutine to validate and canonicalize a configuration type. + # Supply the specified configuration type as an argument. + # If it is invalid, we print an error message on stderr and exit with code 1. +@@ -45,30 +52,73 @@ + # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM + # It is wrong to echo any other type of specification. + +-if [ x$1 = x ] +-then +- echo Configuration name missing. 1>&2 +- echo "Usage: $0 CPU-MFR-OPSYS" 1>&2 +- echo "or $0 ALIAS" 1>&2 +- echo where ALIAS is a recognized configuration type. 1>&2 +- exit 1 +-fi ++me=`echo "$0" | sed -e 's,.*/,,'` + +-# First pass through any local machine types. +-case $1 in +- *local*) +- echo $1 +- exit 0 +- ;; +- *) +- ;; ++usage="\ ++Usage: $0 [OPTION] CPU-MFR-OPSYS ++ $0 [OPTION] ALIAS ++ ++Canonicalize a configuration name. ++ ++Operation modes: ++ -h, --help print this help, then exit ++ -t, --time-stamp print date of last modification, then exit ++ -v, --version print version number, then exit ++ ++Report bugs and patches to ." ++ ++version="\ ++GNU config.sub ($timestamp) ++ ++Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 ++Free Software Foundation, Inc. ++ ++This is free software; see the source for copying conditions. There is NO ++warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." ++ ++help=" ++Try \`$me --help' for more information." ++ ++# Parse command line ++while test $# -gt 0 ; do ++ case $1 in ++ --time-stamp | --time* | -t ) ++ echo "$timestamp" ; exit 0 ;; ++ --version | -v ) ++ echo "$version" ; exit 0 ;; ++ --help | --h* | -h ) ++ echo "$usage"; exit 0 ;; ++ -- ) # Stop option processing ++ shift; break ;; ++ - ) # Use stdin as input. ++ break ;; ++ -* ) ++ echo "$me: invalid option $1$help" ++ exit 1 ;; ++ ++ *local*) ++ # First pass through any local machine types. ++ echo $1 ++ exit 0;; ++ ++ * ) ++ break ;; ++ esac ++done ++ ++case $# in ++ 0) echo "$me: missing argument$help" >&2 ++ exit 1;; ++ 1) ;; ++ *) echo "$me: too many arguments$help" >&2 ++ exit 1;; + esac + + # Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). + # Here we must recognize all the valid KERNEL-OS combinations. + maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` + case $maybe_os in +- linux-gnu*) ++ nto-qnx* | linux-gnu* | freebsd*-gnu* | netbsd*-gnu* | storm-chaos* | os2-emx* | rtmk-nova*) + os=-$maybe_os + basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` + ;; +@@ -94,20 +144,28 @@ + -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ + -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ + -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ +- -apple) ++ -apple | -axis) + os= + basic_machine=$1 + ;; +- -sim | -cisco | -oki | -wec | -winbond ) # EGCS LOCAL ++ -sim | -cisco | -oki | -wec | -winbond) + os= + basic_machine=$1 + ;; +- -scout) # EGCS LOCAL ++ -scout) + ;; +- -wrs) # EGCS LOCAL ++ -wrs) + os=-vxworks + basic_machine=$1 + ;; ++ -chorusos*) ++ os=-chorusos ++ basic_machine=$1 ++ ;; ++ -chorusrdb) ++ os=-chorusrdb ++ basic_machine=$1 ++ ;; + -hiux*) + os=-hiuxwe2 + ;; +@@ -156,49 +214,72 @@ + -psos*) + os=-psos + ;; ++ -mint | -mint[0-9]*) ++ basic_machine=m68k-atari ++ os=-mint ++ ;; + esac + + # Decode aliases for certain CPU-COMPANY combinations. + case $basic_machine in + # Recognize the basic CPU types without company name. + # Some are omitted here because they have special meanings below. +- tahoe | i860 | m32r | m68k | m68000 | m88k | ns32k | arc | arm \ +- | arme[lb] | pyramid | mn10200 | mn10300 \ +- | tron | a29k | 580 | i960 | h8300 \ +- | hppa | hppa1.0 | hppa1.1 | hppa2.0 | hppa2.0w | hppa2.0n \ +- | alpha | alphaev5 | alphaev56 | alphapca56 | alphaev6 \ +- | we32k | ns16k | clipper | i370 | sh | powerpc | powerpcle \ +- | 1750a | dsp16xx | pdp11 \ +- | mips64 | mipsel | mips64el | mips64orion | mips64orionel \ +- | mipstx39 | mipstx39el \ +- | sparc | sparclet | sparclite | sparc64 | sparcv9 | v850 | c4x) +- basic_machine=$basic_machine-unknown +- ;; +- m88110 | m680[012346]0 | m683?2 | m68360 | m5200 | z8k | v70 \ +- | h8500 | w65) # EGCS LOCAL +- ;; +- thumb) +- basic_machine=$basic_machine-unknown +- ;; +- mips64vr4300 | mips64vr4300el) # EGCS LOCAL jsmith/vr4300 ++ 1750a | 580 \ ++ | a29k \ ++ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ ++ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ ++ | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr \ ++ | clipper \ ++ | d10v | d30v | dlx | dsp16xx \ ++ | fr30 | frv \ ++ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ ++ | i370 | i860 | i960 | ia64 \ ++ | ip2k \ ++ | m32r | m68000 | m68k | m88k | mcore \ ++ | mips | mipsbe | mipseb | mipsel | mipsle \ ++ | mips16 \ ++ | mips64 | mips64el \ ++ | mips64vr | mips64vrel \ ++ | mips64orion | mips64orionel \ ++ | mips64vr4100 | mips64vr4100el \ ++ | mips64vr4300 | mips64vr4300el \ ++ | mips64vr5000 | mips64vr5000el \ ++ | mipsisa32 | mipsisa32el \ ++ | mipsisa32r2 | mipsisa32r2el \ ++ | mipsisa64 | mipsisa64el \ ++ | mipsisa64sb1 | mipsisa64sb1el \ ++ | mipsisa64sr71k | mipsisa64sr71kel \ ++ | mipstx39 | mipstx39el \ ++ | mn10200 | mn10300 \ ++ | msp430 \ ++ | ns16k | ns32k \ ++ | openrisc | or32 \ ++ | pdp10 | pdp11 | pj | pjl \ ++ | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \ ++ | pyramid \ ++ | sh | sh[1234] | sh[23]e | sh[34]eb | shbe | shle | sh[1234]le | sh3ele \ ++ | sh64 | sh64le \ ++ | sparc | sparc64 | sparc86x | sparclet | sparclite | sparcv9 | sparcv9b \ ++ | strongarm \ ++ | tahoe | thumb | tic80 | tron \ ++ | v850 | v850e \ ++ | we32k \ ++ | x86 | xscale | xstormy16 | xtensa \ ++ | z8k) + basic_machine=$basic_machine-unknown + ;; +- mips64vr4100 | mips64vr4100el) # EGCS LOCAL jsmith/vr4100 +- basic_machine=$basic_machine-unknown +- ;; +- mips64vr5000 | mips64vr5000el) # EGCS LOCAL ian/vr5000 +- basic_machine=$basic_machine-unknown +- ;; +- mips16) ++ m6811 | m68hc11 | m6812 | m68hc12) ++ # Motorola 68HC11/12. + basic_machine=$basic_machine-unknown ++ os=-none + ;; +- d10v) +- basic_machine=$basic_machine-unknown ++ m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) + ;; ++ + # We use `pc' rather than `unknown' + # because (1) that's what they normally are, and + # (2) the word "unknown" tends to confuse beginning users. +- i[34567]86) ++ i*86 | x86_64) + basic_machine=$basic_machine-pc + ;; + # Object if more than one company name word. +@@ -207,44 +288,62 @@ + exit 1 + ;; + # Recognize the basic CPU types with company name. +- vax-* | tahoe-* | i[34567]86-* | i860-* | m32r-* | m68k-* | m68000-* \ +- | m88k-* | sparc-* | ns32k-* | fx80-* | arc-* | arm-* | c[123]* \ +- | mips-* | pyramid-* | tron-* | a29k-* | romp-* | rs6000-* \ +- | power-* | none-* | 580-* | cray2-* | h8300-* | i960-* \ +- | xmp-* | ymp-* \ +- | hppa-* | hppa1.0-* | hppa1.1-* \ +- | hppa2.0-* | hppa2.0w-* | hppa2.0n-* \ +- | alpha-* | alphaev5-* | alphaev56-* | alphapca56-* \ +- | alphaev6-* | we32k-* | cydra-* | ns16k-* | pn-* | np1-* \ +- | xps100-* | clipper-* | orion-* \ +- | sparclite-* | pdp11-* | sh-* | powerpc-* | powerpcle-* \ +- | sparc64-* | sparcv9-* | sparc86x-* | mips64-* | mipsel-* \ +- | mips64el-* | mips64orion-* | mips64orionel-* \ +- | mipstx39-* | mipstx39el-* \ +- | f301-* | arm*-*) +- ;; +- m88110-* | m680[01234]0-* | m683?2-* | m68360-* | z8k-* | h8500-* | d10v-*) # EGCS LOCAL +- ;; +- thumb-*) # EGCS LOCAL angela/thumb +- ;; +- v850-*) # EGCS LOCAL +- ;; +- d30v-*) # EGCS LOCAL +- ;; +- mips64vr4300-* | mips64vr4300el-*) # EGCS LOCAL jsmith/vr4300 +- ;; +- mips64vr4100-* | mips64vr4100el-*) # EGCS LOCAL jsmith/vr4100 +- ;; +- mips16-*) # EGCS LOCAL krk/mips16 +- ;; +- tic30-*) # EGCS LOCAL ian/tic30 +- ;; +- c30-*) # EGCS LOCAL ian/tic30 +- basic_machine=tic30-unknown ++ 580-* \ ++ | a29k-* \ ++ | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ ++ | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ ++ | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ ++ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ ++ | avr-* \ ++ | bs2000-* \ ++ | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* \ ++ | clipper-* | cydra-* \ ++ | d10v-* | d30v-* | dlx-* \ ++ | elxsi-* \ ++ | f30[01]-* | f700-* | fr30-* | frv-* | fx80-* \ ++ | h8300-* | h8500-* \ ++ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ ++ | i*86-* | i860-* | i960-* | ia64-* \ ++ | ip2k-* \ ++ | m32r-* \ ++ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ ++ | m88110-* | m88k-* | mcore-* \ ++ | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ ++ | mips16-* \ ++ | mips64-* | mips64el-* \ ++ | mips64vr-* | mips64vrel-* \ ++ | mips64orion-* | mips64orionel-* \ ++ | mips64vr4100-* | mips64vr4100el-* \ ++ | mips64vr4300-* | mips64vr4300el-* \ ++ | mips64vr5000-* | mips64vr5000el-* \ ++ | mipsisa32-* | mipsisa32el-* \ ++ | mipsisa32r2-* | mipsisa32r2el-* \ ++ | mipsisa64-* | mipsisa64el-* \ ++ | mipsisa64sb1-* | mipsisa64sb1el-* \ ++ | mipsisa64sr71k-* | mipsisa64sr71kel-* \ ++ | mipstx39-* | mipstx39el-* \ ++ | msp430-* \ ++ | none-* | np1-* | nv1-* | ns16k-* | ns32k-* \ ++ | orion-* \ ++ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ ++ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \ ++ | pyramid-* \ ++ | romp-* | rs6000-* \ ++ | sh-* | sh[1234]-* | sh[23]e-* | sh[34]eb-* | shbe-* \ ++ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ ++ | sparc-* | sparc64-* | sparc86x-* | sparclet-* | sparclite-* \ ++ | sparcv9-* | sparcv9b-* | strongarm-* | sv1-* | sx?-* \ ++ | tahoe-* | thumb-* | tic30-* | tic4x-* | tic54x-* | tic80-* | tron-* \ ++ | v850-* | v850e-* | vax-* \ ++ | we32k-* \ ++ | x86-* | x86_64-* | xps100-* | xscale-* | xstormy16-* \ ++ | xtensa-* \ ++ | ymp-* \ ++ | z8k-*) + ;; + # Recognize the various machine names and aliases which stand + # for a CPU type and a company and sometimes even an OS. +- 386bsd) # EGCS LOCAL ++ 386bsd) + basic_machine=i386-unknown + os=-bsd + ;; +@@ -254,11 +353,11 @@ + 3b*) + basic_machine=we32k-att + ;; +- a29khif) # EGCS LOCAL ++ a29khif) + basic_machine=a29k-amd + os=-udi + ;; +- adobe68k) # EGCS LOCAL ++ adobe68k) + basic_machine=m68010-adobe + os=-scout + ;; +@@ -277,21 +376,21 @@ + os=-sysv + ;; + amiga | amiga-*) +- basic_machine=m68k-cbm ++ basic_machine=m68k-unknown + ;; + amigaos | amigados) +- basic_machine=m68k-cbm ++ basic_machine=m68k-unknown + os=-amigaos + ;; + amigaunix | amix) +- basic_machine=m68k-cbm ++ basic_machine=m68k-unknown + os=-sysv4 + ;; + apollo68) + basic_machine=m68k-apollo + os=-sysv + ;; +- apollo68bsd) # EGCS LOCAL ++ apollo68bsd) + basic_machine=m68k-apollo + os=-bsd + ;; +@@ -303,6 +402,10 @@ + basic_machine=ns32k-sequent + os=-dynix + ;; ++ c90) ++ basic_machine=c90-cray ++ os=-unicos ++ ;; + convex-c1) + basic_machine=c1-convex + os=-bsd +@@ -323,27 +426,30 @@ + basic_machine=c38-convex + os=-bsd + ;; +- cray | ymp) +- basic_machine=ymp-cray +- os=-unicos +- ;; +- cray2) +- basic_machine=cray2-cray +- os=-unicos +- ;; +- [ctj]90-cray) +- basic_machine=c90-cray ++ cray | j90) ++ basic_machine=j90-cray + os=-unicos + ;; + crds | unos) + basic_machine=m68k-crds + ;; ++ cris | cris-* | etrax*) ++ basic_machine=cris-axis ++ ;; + da30 | da30-*) + basic_machine=m68k-da30 + ;; + decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) + basic_machine=mips-dec + ;; ++ decsystem10* | dec10*) ++ basic_machine=pdp10-dec ++ os=-tops10 ++ ;; ++ decsystem20* | dec20*) ++ basic_machine=pdp10-dec ++ os=-tops20 ++ ;; + delta | 3300 | motorola-3300 | motorola-delta \ + | 3300-motorola | delta-motorola) + basic_machine=m68k-motorola +@@ -371,7 +477,7 @@ + encore | umax | mmax) + basic_machine=ns32k-encore + ;; +- es1800 | OSE68k | ose68k | ose | OSE) # EGCS LOCAL ++ es1800 | OSE68k | ose68k | ose | OSE) + basic_machine=m68k-ericsson + os=-ose + ;; +@@ -385,6 +491,10 @@ + basic_machine=tron-gmicro + os=-sysv + ;; ++ go32) ++ basic_machine=i386-pc ++ os=-go32 ++ ;; + h3050r* | hiux*) + basic_machine=hppa1.1-hitachi + os=-hiuxwe2 +@@ -393,11 +503,11 @@ + basic_machine=h8300-hitachi + os=-hms + ;; +- h8300xray) # EGCS LOCAL ++ h8300xray) + basic_machine=h8300-hitachi + os=-xray + ;; +- h8500hms) # EGCS LOCAL ++ h8500hms) + basic_machine=h8500-hitachi + os=-hms + ;; +@@ -416,22 +526,6 @@ + basic_machine=m68k-hp + os=-hpux + ;; +- w89k-*) # EGCS LOCAL +- basic_machine=hppa1.1-winbond +- os=-proelf +- ;; +- op50n-*) # EGCS LOCAL +- basic_machine=hppa1.1-oki +- os=-proelf +- ;; +- op60c-*) # EGCS LOCAL +- basic_machine=hppa1.1-oki +- os=-proelf +- ;; +- hppro) # EGCS LOCAL +- basic_machine=hppa1.1-hp +- os=-proelf +- ;; + hp3k9[0-9][0-9] | hp9[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; +@@ -441,22 +535,21 @@ + hp9k3[2-9][0-9]) + basic_machine=m68k-hp + ;; +- hp9k6[0-9][0-9] | hp6[0-9][0-9] ) ++ hp9k6[0-9][0-9] | hp6[0-9][0-9]) + basic_machine=hppa1.0-hp + ;; +- hp9k7[0-79][0-9] | hp7[0-79][0-9] ) ++ hp9k7[0-79][0-9] | hp7[0-79][0-9]) + basic_machine=hppa1.1-hp + ;; +- hp9k78[0-9] | hp78[0-9] ) ++ hp9k78[0-9] | hp78[0-9]) + # FIXME: really hppa2.0-hp + basic_machine=hppa1.1-hp + ;; +- hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | \ +- hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893 ) ++ hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) + # FIXME: really hppa2.0-hp + basic_machine=hppa1.1-hp + ;; +- hp9k8[0-9][13679] | hp8[0-9][13679] ) ++ hp9k8[0-9][13679] | hp8[0-9][13679]) + basic_machine=hppa1.1-hp + ;; + hp9k8[0-9][0-9] | hp8[0-9][0-9]) +@@ -465,47 +558,42 @@ + hppa-next) + os=-nextstep3 + ;; +- hppaosf) # EGCS LOCAL ++ hppaosf) + basic_machine=hppa1.1-hp + os=-osf + ;; ++ hppro) ++ basic_machine=hppa1.1-hp ++ os=-proelf ++ ;; + i370-ibm* | ibm*) + basic_machine=i370-ibm +- os=-mvs + ;; + # I'm not sure what "Sysv32" means. Should this be sysv3.2? +- i[34567]86v32) ++ i*86v32) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv32 + ;; +- i[34567]86v4*) ++ i*86v4*) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv4 + ;; +- i[34567]86v) ++ i*86v) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-sysv + ;; +- i[34567]86sol2) ++ i*86sol2) + basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` + os=-solaris2 + ;; +- i386mach) # EGCS LOCAL ++ i386mach) + basic_machine=i386-mach + os=-mach + ;; +- i386-vsta | vsta) # EGCS LOCAL ++ i386-vsta | vsta) + basic_machine=i386-unknown + os=-vsta + ;; +- i386-go32 | go32) # EGCS LOCAL +- basic_machine=i386-unknown +- os=-go32 +- ;; +- i386-mingw32 | mingw32) +- basic_machine=i386-unknown +- os=-mingw32 +- ;; + iris | iris4d) + basic_machine=mips-sgi + case $os in +@@ -531,16 +619,16 @@ + basic_machine=ns32k-utek + os=-sysv + ;; ++ mingw32) ++ basic_machine=i386-pc ++ os=-mingw32 ++ ;; + miniframe) + basic_machine=m68000-convergent + ;; +- mipsel*-linux*) +- basic_machine=mipsel-unknown +- os=-linux-gnu +- ;; +- mips*-linux*) +- basic_machine=mips-unknown +- os=-linux-gnu ++ *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) ++ basic_machine=m68k-atari ++ os=-mint + ;; + mips3*-*) + basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` +@@ -548,24 +636,36 @@ + mips3*) + basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown + ;; +- monitor) # EGCS LOCAL ++ mmix*) ++ basic_machine=mmix-knuth ++ os=-mmixware ++ ;; ++ monitor) + basic_machine=m68k-rom68k + os=-coff + ;; +- msdos) # EGCS LOCAL +- basic_machine=i386-unknown ++ morphos) ++ basic_machine=powerpc-unknown ++ os=-morphos ++ ;; ++ msdos) ++ basic_machine=i386-pc + os=-msdos + ;; ++ mvs) ++ basic_machine=i370-ibm ++ os=-mvs ++ ;; + ncr3000) + basic_machine=i486-ncr + os=-sysv4 + ;; + netbsd386) +- basic_machine=i386-unknown # EGCS LOCAL ++ basic_machine=i386-unknown + os=-netbsd + ;; + netwinder) +- basic_machine=armv4l-corel ++ basic_machine=armv4l-rebel + os=-linux + ;; + news | news700 | news800 | news900) +@@ -580,7 +680,7 @@ + basic_machine=mips-sony + os=-newsos + ;; +- necv70) # EGCS LOCAL ++ necv70) + basic_machine=v70-nec + os=-sysv + ;; +@@ -609,18 +709,37 @@ + basic_machine=i960-intel + os=-nindy + ;; +- mon960) # EGCS LOCAL ++ mon960) + basic_machine=i960-intel + os=-mon960 + ;; ++ nonstopux) ++ basic_machine=mips-compaq ++ os=-nonstopux ++ ;; + np1) + basic_machine=np1-gould + ;; +- OSE68000 | ose68000) # EGCS LOCAL ++ nv1) ++ basic_machine=nv1-cray ++ os=-unicosmp ++ ;; ++ nsr-tandem) ++ basic_machine=nsr-tandem ++ ;; ++ op50n-* | op60c-*) ++ basic_machine=hppa1.1-oki ++ os=-proelf ++ ;; ++ or32 | or32-*) ++ basic_machine=or32-unknown ++ os=-coff ++ ;; ++ OSE68000 | ose68000) + basic_machine=m68000-ericsson + os=-ose + ;; +- os68k) # EGCS LOCAL ++ os68k) + basic_machine=m68k-none + os=-os68k + ;; +@@ -638,46 +757,60 @@ + pbb) + basic_machine=m68k-tti + ;; +- pc532 | pc532-*) ++ pc532 | pc532-*) + basic_machine=ns32k-pc532 + ;; +- pentium | p5 | k5 | k6 | nexen) ++ pentium | p5 | k5 | k6 | nexgen | viac3) + basic_machine=i586-pc + ;; +- pentiumpro | p6 | 6x86) ++ pentiumpro | p6 | 6x86 | athlon | athlon_*) + basic_machine=i686-pc + ;; + pentiumii | pentium2) +- basic_machine=i786-pc ++ basic_machine=i686-pc + ;; +- pentium-* | p5-* | k5-* | k6-* | nexen-*) ++ pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) + basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; +- pentiumpro-* | p6-* | 6x86-*) ++ pentiumpro-* | p6-* | 6x86-* | athlon-*) + basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pentiumii-* | pentium2-*) +- basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` ++ basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + pn) + basic_machine=pn-gould + ;; +- power) basic_machine=rs6000-ibm ++ power) basic_machine=power-ibm + ;; + ppc) basic_machine=powerpc-unknown +- ;; ++ ;; + ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + ppcle | powerpclittle | ppc-le | powerpc-little) + basic_machine=powerpcle-unknown +- ;; ++ ;; + ppcle-* | powerpclittle-*) + basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; ++ ppc64) basic_machine=powerpc64-unknown ++ ;; ++ ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` ++ ;; ++ ppc64le | powerpc64little | ppc64-le | powerpc64-little) ++ basic_machine=powerpc64le-unknown ++ ;; ++ ppc64le-* | powerpc64little-*) ++ basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` ++ ;; + ps2) + basic_machine=i386-ibm + ;; +- rom68k) # EGCS LOCAL ++ pw32) ++ basic_machine=i586-unknown ++ os=-pw32 ++ ;; ++ rom68k) + basic_machine=m68k-rom68k + os=-coff + ;; +@@ -687,10 +820,22 @@ + rtpc | rtpc-*) + basic_machine=romp-ibm + ;; +- sa29200) # EGCS LOCAL ++ s390 | s390-*) ++ basic_machine=s390-ibm ++ ;; ++ s390x | s390x-*) ++ basic_machine=s390x-ibm ++ ;; ++ sa29200) + basic_machine=a29k-amd + os=-udi + ;; ++ sb1) ++ basic_machine=mipsisa64sb1-unknown ++ ;; ++ sb1el) ++ basic_machine=mipsisa64sb1el-unknown ++ ;; + sequent) + basic_machine=i386-sequent + ;; +@@ -698,7 +843,7 @@ + basic_machine=sh-hitachi + os=-hms + ;; +- sparclite-wrs) # EGCS LOCAL ++ sparclite-wrs | simso-wrs) + basic_machine=sparclite-wrs + os=-vxworks + ;; +@@ -709,10 +854,10 @@ + spur) + basic_machine=spur-unknown + ;; +- st2000) # EGCS LOCAL ++ st2000) + basic_machine=m68k-tandem + ;; +- stratus) # EGCS LOCAL ++ stratus) + basic_machine=i860-stratus + os=-sysv4 + ;; +@@ -756,16 +901,40 @@ + sun386 | sun386i | roadrunner) + basic_machine=i386-sun + ;; ++ sv1) ++ basic_machine=sv1-cray ++ os=-unicos ++ ;; + symmetry) + basic_machine=i386-sequent + os=-dynix + ;; ++ t3e) ++ basic_machine=alphaev5-cray ++ os=-unicos ++ ;; ++ t90) ++ basic_machine=t90-cray ++ os=-unicos ++ ;; ++ tic4x | c4x*) ++ basic_machine=tic4x-unknown ++ os=-coff ++ ;; ++ tic54x | c54x*) ++ basic_machine=tic54x-unknown ++ os=-coff ++ ;; + tx39) + basic_machine=mipstx39-unknown + ;; + tx39el) + basic_machine=mipstx39el-unknown + ;; ++ toad1) ++ basic_machine=pdp10-xkl ++ os=-tops20 ++ ;; + tower | tower-32) + basic_machine=m68k-ncr + ;; +@@ -777,7 +946,7 @@ + basic_machine=a29k-nyu + os=-sym1 + ;; +- v810 | necv810) # EGCS LOCAL ++ v810 | necv810) + basic_machine=v810-nec + os=-none + ;; +@@ -790,8 +959,8 @@ + os=-vms + ;; + vpp*|vx|vx-*) +- basic_machine=f301-fujitsu +- ;; ++ basic_machine=f301-fujitsu ++ ;; + vxworks960) + basic_machine=i960-wrs + os=-vxworks +@@ -804,18 +973,22 @@ + basic_machine=a29k-wrs + os=-vxworks + ;; +- w65*) # EGCS LOCAL +- basic_machine=w65-wdc +- os=-none ++ w65*) ++ basic_machine=w65-wdc ++ os=-none + ;; +- xmp) +- basic_machine=xmp-cray +- os=-unicos ++ w89k-*) ++ basic_machine=hppa1.1-winbond ++ os=-proelf + ;; +- xps | xps100) ++ xps | xps100) + basic_machine=xps100-honeywell + ;; +- z8k-*-coff) # EGCS LOCAL ++ ymp) ++ basic_machine=ymp-cray ++ os=-unicos ++ ;; ++ z8k-*-coff) + basic_machine=z8k-unknown + os=-sim + ;; +@@ -826,22 +999,15 @@ + + # Here we handle the default manufacturer of certain CPU types. It is in + # some cases the only manufacturer, in others, it is the most popular. +- w89k) # EGCS LOCAL ++ w89k) + basic_machine=hppa1.1-winbond + ;; +- op50n) # EGCS LOCAL ++ op50n) + basic_machine=hppa1.1-oki + ;; +- op60c) # EGCS LOCAL ++ op60c) + basic_machine=hppa1.1-oki + ;; +- mips) +- if [ x$os = x-linux-gnu ]; then +- basic_machine=mips-unknown +- else +- basic_machine=mips-mips +- fi +- ;; + romp) + basic_machine=romp-ibm + ;; +@@ -851,16 +1017,26 @@ + vax) + basic_machine=vax-dec + ;; ++ pdp10) ++ # there are many clones, so DEC is not a safe bet ++ basic_machine=pdp10-unknown ++ ;; + pdp11) + basic_machine=pdp11-dec + ;; + we32k) + basic_machine=we32k-att + ;; +- sparc | sparcv9) ++ sh3 | sh4 | sh[34]eb | sh[1234]le | sh[23]ele) ++ basic_machine=sh-unknown ++ ;; ++ sh64) ++ basic_machine=sh64-unknown ++ ;; ++ sparc | sparcv9 | sparcv9b) + basic_machine=sparc-sun + ;; +- cydra) ++ cydra) + basic_machine=cydra-cydrome + ;; + orion) +@@ -869,16 +1045,15 @@ + orion105) + basic_machine=clipper-highlevel + ;; +- mac | mpw | mac-mpw) # EGCS LOCAL ++ mac | mpw | mac-mpw) + basic_machine=m68k-apple + ;; +- pmac | pmac-mpw) # EGCS LOCAL ++ pmac | pmac-mpw) + basic_machine=powerpc-apple + ;; +- c4x*) +- basic_machine=c4x-none +- os=-coff +- ;; ++ *-unknown) ++ # Make sure to match an already-canonicalized machine name. ++ ;; + *) + echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 + exit 1 +@@ -935,20 +1110,38 @@ + | -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ + | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ + | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ ++ | -chorusos* | -chorusrdb* \ + | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ + | -mingw32* | -linux-gnu* | -uxpv* | -beos* | -mpeix* | -udk* \ +- | -interix* | -uwin* ) ++ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ ++ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ ++ | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ ++ | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ ++ | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ ++ | -powermax* | -dnix* | -microbsd*) + # Remember, each alternative MUST END IN *, to match a version number. + ;; +- # EGCS LOCAL ++ -qnx*) ++ case $basic_machine in ++ x86-* | i*86-*) ++ ;; ++ *) ++ os=-nto$os ++ ;; ++ esac ++ ;; ++ -nto-qnx*) ++ ;; ++ -nto*) ++ os=`echo $os | sed -e 's|nto|nto-qnx|'` ++ ;; + -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ +- | -windows* | -osx | -abug | -netware* | -os9* | -beos* \ +- | -macos* | -mpw* | -magic* | -mon960* | -lnews* ) ++ | -windows* | -osx | -abug | -netware* | -os9* | -beos* \ ++ | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) + ;; + -mac*) + os=`echo $os | sed -e 's|mac|macos|'` + ;; +- # END EGCS LOCAL + -linux*) + os=`echo $os | sed -e 's|linux|linux-gnu|'` + ;; +@@ -958,6 +1151,12 @@ + -sunos6*) + os=`echo $os | sed -e 's|sunos6|solaris3|'` + ;; ++ -opened*) ++ os=-openedition ++ ;; ++ -wince*) ++ os=-wince ++ ;; + -osfrose*) + os=-osfrose + ;; +@@ -973,14 +1172,23 @@ + -acis*) + os=-aos + ;; +- -386bsd) # EGCS LOCAL ++ -atheos*) ++ os=-atheos ++ ;; ++ -386bsd) + os=-bsd + ;; + -ctix* | -uts*) + os=-sysv + ;; ++ -nova*) ++ os=-rtmk-nova ++ ;; + -ns2 ) +- os=-nextstep2 ++ os=-nextstep2 ++ ;; ++ -nsk*) ++ os=-nsk + ;; + # Preserve the version number of sinix5. + -sinix5.*) +@@ -1007,15 +1215,21 @@ + # This must come after -sysvr4. + -sysv*) + ;; +- -ose*) # EGCS LOCAL ++ -ose*) + os=-ose + ;; +- -es1800*) # EGCS LOCAL ++ -es1800*) + os=-ose + ;; + -xenix) + os=-xenix + ;; ++ -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) ++ os=-mint ++ ;; ++ -aros*) ++ os=-aros ++ ;; + -none) + ;; + *) +@@ -1041,13 +1255,17 @@ + *-acorn) + os=-riscix1.2 + ;; +- arm*-corel) ++ arm*-rebel) + os=-linux + ;; + arm*-semi) + os=-aout + ;; +- pdp11-*) ++ # This must come before the *-dec entry. ++ pdp10-*) ++ os=-tops20 ++ ;; ++ pdp11-*) + os=-none + ;; + *-dec | vax-*) +@@ -1065,15 +1283,18 @@ + # default. + # os=-sunos4 + ;; +- m68*-cisco) # EGCS LOCAL ++ m68*-cisco) + os=-aout + ;; +- mips*-cisco) # EGCS LOCAL ++ mips*-cisco) + os=-elf + ;; +- mips*-*) # EGCS LOCAL +- os=-elf +- ;; ++ mips*-*) ++ os=-elf ++ ;; ++ or32-*) ++ os=-coff ++ ;; + *-tti) # must be before sparc entry or we get the wrong os. + os=-sysv3 + ;; +@@ -1086,13 +1307,13 @@ + *-ibm) + os=-aix + ;; +- *-wec) # EGCS LOCAL ++ *-wec) + os=-proelf + ;; +- *-winbond) # EGCS LOCAL ++ *-winbond) + os=-proelf + ;; +- *-oki) # EGCS LOCAL ++ *-oki) + os=-proelf + ;; + *-hp) +@@ -1137,36 +1358,39 @@ + *-next) + os=-nextstep3 + ;; +- *-gould) ++ *-gould) + os=-sysv + ;; +- *-highlevel) ++ *-highlevel) + os=-bsd + ;; + *-encore) + os=-bsd + ;; +- *-sgi) ++ *-sgi) + os=-irix + ;; +- *-siemens) ++ *-siemens) + os=-sysv4 + ;; + *-masscomp) + os=-rtu + ;; +- f301-fujitsu) ++ f30[01]-fujitsu | f700-fujitsu) + os=-uxpv + ;; +- *-rom68k) # EGCS LOCAL ++ *-rom68k) + os=-coff + ;; +- *-*bug) # EGCS LOCAL ++ *-*bug) + os=-coff + ;; +- *-apple) # EGCS LOCAL ++ *-apple) + os=-macos + ;; ++ *-atari*) ++ os=-mint ++ ;; + *) + os=-none + ;; +@@ -1212,27 +1436,41 @@ + -genix*) + vendor=ns + ;; +- -mvs*) ++ -mvs* | -opened*) + vendor=ibm + ;; + -ptx*) + vendor=sequent + ;; +- -vxsim* | -vxworks*) ++ -vxsim* | -vxworks* | -windiss*) + vendor=wrs + ;; + -aux*) + vendor=apple + ;; +- -hms*) # EGCS LOCAL ++ -hms*) + vendor=hitachi + ;; +- -mpw* | -macos*) # EGCS LOCAL ++ -mpw* | -macos*) + vendor=apple + ;; ++ -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) ++ vendor=atari ++ ;; ++ -vos*) ++ vendor=stratus ++ ;; + esac + basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` + ;; + esac + + echo $basic_machine$os ++exit 0 ++ ++# Local variables: ++# eval: (add-hook 'write-file-hooks 'time-stamp) ++# time-stamp-start: "timestamp='" ++# time-stamp-format: "%:y-%02m-%02d" ++# time-stamp-end: "'" ++# End: diff --git a/patches/gcc/2.95.3/140-deque-leak-fix.patch b/patches/gcc/2.95.3/140-deque-leak-fix.patch new file mode 100644 index 0000000..44d2a01 --- /dev/null +++ b/patches/gcc/2.95.3/140-deque-leak-fix.patch @@ -0,0 +1,31 @@ +[See also http://gcc.gnu.org/ml/libstdc++/2001-11/msg00133.html ] + +Date: Fri, 16 Nov 2001 16:06:22 -0500 +From: Phil Edwards +To: gcc-patches at gcc dot gnu dot org +Subject: [libstdc++ trunk & 3.0] Fix deque memory leak +Message-ID: <20011116160622.A23094@disaster.jaj.com> + + +As discussed on the libstdc++ mailing list. Tested on i686/linux. + + + +2001-11-16 Paolo Carlini + + * include/bits/stl_deque.h (deque::erase()): Fix memory leak. + + +[rediffed against 2.95.3 -- dank] + +--- gcc-2.95.3/libstdc++/stl/stl_deque.h.old 2001-01-01 09:48:22.000000000 -0800 ++++ gcc-2.95.3/libstdc++/stl/stl_deque.h 2006-02-18 15:24:17.000000000 -0800 +@@ -1052,7 +1052,7 @@ + copy_backward(_M_start, __first, __last); + iterator __new_start = _M_start + __n; + destroy(_M_start, __new_start); +- _M_destroy_nodes(__new_start._M_node, _M_start._M_node); ++ _M_destroy_nodes(_M_start._M_node, __new_start._M_node); /* fixed per http://gcc.gnu.org/ml/libstdc++/2001-11/msg00139.html */ + _M_start = __new_start; + } + else { diff --git a/patches/gcc/2.95.3/150-gcc-2.95.3-cygwin-020611.patch b/patches/gcc/2.95.3/150-gcc-2.95.3-cygwin-020611.patch new file mode 100644 index 0000000..fb2b8da --- /dev/null +++ b/patches/gcc/2.95.3/150-gcc-2.95.3-cygwin-020611.patch @@ -0,0 +1,33 @@ +[ Building gcc-2.95.3 on cygwin yields a compiler that sticks a .exe + on the end of every executable, even if they're linux executable. + This is highly annoying, and causes glibc build failures that look like this: + mv: `.../bin/makedb.new' and `.../bin/makedb' are the same file + make[2]: *** [.../bin/makedb] Error 1 + make[2]: Leaving directory `.../gcc-2.95.3-glibc-2.1.3/glibc-2.1.3/db2' + + The mainline solves this with http://gcc.gnu.org/ml/gcc-cvs/2001-04/msg00440.html, + but that doesn't apply cleanly to gcc-2.95.3. + + So, I'm using + http://www.uclinux.org/pub/uClinux/uclinux-elf-tools/tools-20030314/gcc-2.95.3-cygwin-020611.patch + This is the only patch in crosstool that *isn't* suitable for the mainline. + I can live with this patch simply because crosstool does not build + compilers that target cygwin or VAX/VMS. + If that ever changes, I might need to try applying the real patch. +] + + + +# +# This patch can be found at http://www.uclinux.org/pub/uClinux/m68k-elf-tools/ +# +--- gcc-2.95.3/gcc/config/i386/xm-cygwin.h 1999-04-22 16:40:56.000000000 +0200 ++++ gcc-2.95.3-cygwin/gcc/config/i386/xm-cygwin.h 2002-06-11 08:23:18.000000000 +0200 +@@ -19,7 +19,6 @@ + the Free Software Foundation, 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + +-#define EXECUTABLE_SUFFIX ".exe" + #define NO_SYS_SIGLIST 1 + + /* We support both "/" and "\" since everybody tests both but we diff --git a/patches/gcc/2.95.3/160-gcc-2.95.3-trap-posix.patch b/patches/gcc/2.95.3/160-gcc-2.95.3-trap-posix.patch new file mode 100644 index 0000000..1d18055 --- /dev/null +++ b/patches/gcc/2.95.3/160-gcc-2.95.3-trap-posix.patch @@ -0,0 +1,44 @@ +# +# Submitted-By: Marc Kleine-Budde , 2005-04-20 +# +# Error: +# +# creating libintl.h +# Configuring etc... +# loading cache ../config.cache +# checking for a BSD compatible install... (cached) /usr/bin/install -c +# creating ./config.status +# creating Makefile +# trap: usage: trap [-lp] [[arg] signal_spec ...] +# +# Description: +# +# non-posix conform usage of trap causes bash >= 3.0 to fail +# e.g.: http://sourceware.org/ml/crossgcc/2004-12/msg00132.html +# +# Status: +# +# fixed in gcc >= 3.3.5 +# backport of gcc-3.3.5 fix +# +diff -ruN gcc-2.95.3-orig/configure gcc-2.95.3/configure +--- gcc-2.95.3-orig/configure 1999-04-02 16:17:40.000000000 +0200 ++++ gcc-2.95.3/configure 2005-04-20 18:25:45.030488235 +0200 +@@ -687,7 +687,7 @@ + if test -f skip-this-dir; then + # Perform the same cleanup as the trap handler, minus the "exit 1" of course, + # and reset the trap handler. +- trap 0 ++ trap '' 0 + rm -f Makefile* ${tmpfile}.com ${tmpfile}.tgt ${tmpfile}.hst ${tmpfile}.pos + # Execute the final clean-up actions + ${config_shell} skip-this-dir +@@ -1599,7 +1599,7 @@ + # Perform the same cleanup as the trap handler, minus the "exit 1" of course, + # and reset the trap handler. + rm -f ${tmpfile}.com ${tmpfile}.tgt ${tmpfile}.hst ${tmpfile}.pos +-trap 0 ++trap '' 0 + + exit 0 + diff --git a/patches/gcc/2.95.3/170-gcc-pr3106.patch b/patches/gcc/2.95.3/170-gcc-pr3106.patch new file mode 100644 index 0000000..0e077ea --- /dev/null +++ b/patches/gcc/2.95.3/170-gcc-pr3106.patch @@ -0,0 +1,28 @@ +See http://gcc.gnu.org/PR3106 +Backported from gcc-3.0.x + +Fixes error + .../binutils-2.11.2/libiberty/strerror.c:468: error: conflicting types for `sys_nerr' + /usr/include/stdio.h:258: error: previous declaration of `sys_nerr' + make[1]: *** [strerror.o] Error 1 + make: *** [all-libiberty] Error 2 +on Mac OS X. + +--- gcc-2.95.3/libiberty/strerror.c.old 2004-03-24 16:23:19.000000000 -0800 ++++ gcc-2.95.3/libiberty/strerror.c 2004-03-24 16:23:48.000000000 -0800 +@@ -13,6 +13,7 @@ + incompatible with our later declaration, perhaps by using const + attributes. So we hide the declaration in errno.h (if any) using a + macro. */ ++#define sys_nerr sys_nerr__ + #define sys_errlist sys_errlist__ + #endif + +@@ -20,6 +21,7 @@ + #include + + #ifdef HAVE_SYS_ERRLIST ++#undef sys_nerr + #undef sys_errlist + #endif + diff --git a/patches/gcc/2.95.3/180-threads_snafu.patch b/patches/gcc/2.95.3/180-threads_snafu.patch new file mode 100644 index 0000000..2c5297e --- /dev/null +++ b/patches/gcc/2.95.3/180-threads_snafu.patch @@ -0,0 +1,28 @@ +This fixes the error + +In file included from gthr-default.h:1, + from /build/arm-unknown-linux-gnu/gcc-2.95.3-glibc-2.2.2/gcc-2.95.3/gcc/gthr.h:98, + from /build/arm-unknown-linux-gnu/gcc-2.95.3-glibc-2.2.2/gcc-2.95.3/gcc/libgcc2.c:3034: +/build/arm-unknown-linux-gnu/gcc-2.95.3-glibc-2.2.2/gcc-2.95.3/gcc/gthr-posix.h:37: pthread.h: No such file or directory +make[3]: *** [libgcc2.a] Error 1 +make[3]: Leaving directory `/build/arm-unknown-linux-gnu/gcc-2.95.3-glibc-2.2.2/build-gcc-core/gcc' + +in what I think is a nicer way than the patch used by the arm team, +i.e. "perl -pi -e 's/^(TARGET_LIBGCC2_CFLAGS.*)/$1 -Dinhibit_libc -D__gthr_posix_h/' gcc/config/arm/t-linux" +which seems a bit of a kludge. + +--- gcc-2.95.3/gcc/configure.old Fri Mar 16 06:13:48 2001 ++++ gcc-2.95.3/gcc/configure Sun Jun 8 13:02:20 2003 +@@ -853,9 +853,9 @@ + # Check whether --enable-threads or --disable-threads was given. + if test "${enable_threads+set}" = set; then + enableval="$enable_threads" +- if test x$enable_threads = xno; then +- enable_threads='' +-fi ++ #if test x$enable_threads = xno; then ++ #enable_threads='' ++ #fi + else + enable_threads='' + fi diff --git a/patches/gcc/2.95.3/arm-linux.patch b/patches/gcc/2.95.3/arm-linux.patch deleted file mode 100644 index 00974f6..0000000 --- a/patches/gcc/2.95.3/arm-linux.patch +++ /dev/null @@ -1,647 +0,0 @@ ---------- snip ------- -Downloaded from ftp://ftp.linux.org.uk/pub/armlinux/toolchain/src-2.95.3/gcc-2.95.3.diff.bz2 -Not sure what it fixes, but this appears to be The Patch used with gcc-2.95.3 on arm. ---------- snip ------- - -diff -urN gcc-2.95.3-orig/gcc/config/arm/arm.c gcc-2.95.3/gcc/config/arm/arm.c ---- gcc-2.95.3-orig/gcc/config/arm/arm.c Thu Jan 25 15:03:24 2001 -+++ gcc-2.95.3/gcc/config/arm/arm.c Fri Jul 20 19:39:11 2001 -@@ -1529,27 +1529,34 @@ - return gen_rtx_PLUS (Pmode, base, offset); - } - else if (GET_CODE (orig) == LABEL_REF) -- current_function_uses_pic_offset_table = 1; -- -- return orig; --} -+ { -+ current_function_uses_pic_offset_table = 1; - --static rtx pic_rtx; -+ if (NEED_PLT_GOT) -+ { -+ rtx pic_ref, address = gen_reg_rtx (Pmode); -+ -+ emit_insn (gen_pic_load_addr (address, orig)); -+ pic_ref = gen_rtx_PLUS (Pmode, pic_offset_table_rtx, -+ address); -+ emit_move_insn (address, pic_ref); -+ return address; -+ } -+ } - --int --is_pic(x) -- rtx x; --{ -- if (x == pic_rtx) -- return 1; -- return 0; -+ return orig; - } - -+/* Generate code to load the PIC register. PROLOGUE is true if -+ called from arm_expand_prologue (in which case we want the -+ generated insns at the start of the function); false if called -+ by an exception receiver that needs the PIC register reloaded -+ (in which case the insns are just dumped at the current location). */ - void --arm_finalize_pic () -+arm_finalize_pic (int prologue) - { - #ifndef AOF_ASSEMBLER -- rtx l1, pic_tmp, pic_tmp2, seq; -+ rtx l1, pic_tmp, pic_tmp2, seq, pic_rtx; - rtx global_offset_table; - - if (current_function_uses_pic_offset_table == 0) -@@ -1578,7 +1585,10 @@ - - seq = gen_sequence (); - end_sequence (); -- emit_insn_after (seq, get_insns ()); -+ if (prologue) -+ emit_insn_after (seq, get_insns ()); -+ else -+ emit_insn (seq); - - /* Need to emit this whether or not we obey regdecls, - since setjmp/longjmp can cause life info to screw up. */ -@@ -5327,7 +5337,13 @@ - if (frame_pointer_needed) - live_regs += 4; - -- if (live_regs) -+ if (live_regs == 1 && regs_ever_live[LR_REGNUM] -+ && ! lr_save_eliminated && ! really_return) -+ { -+ output_asm_insn (reverse ? "ldr%?%D0\t%|lr, [%|sp}, #4" -+ : "ldr%?%d0\t%|lr, [%|sp], #4", &operand); -+ } -+ else if (live_regs) - { - if (lr_save_eliminated || ! regs_ever_live[14]) - live_regs++; -@@ -5446,7 +5462,7 @@ - rtx x; - - length = strlen (name); -- alignlength = (length + 1) + 3 & ~3; -+ alignlength = ((length + 1) + 3) & ~3; - - ASM_OUTPUT_ASCII (stream, name, length + 1); - ASM_OUTPUT_ALIGN (stream, 2); -@@ -5838,6 +5854,9 @@ - int store_arg_regs = 0; - int volatile_func = (optimize > 0 - && TREE_THIS_VOLATILE (current_function_decl)); -+ rtx ip_rtx; -+ int fp_offset = 0; -+ rtx insn; - - /* Naked functions don't have prologues. */ - if (arm_naked_function_p (current_function_decl)) -@@ -5859,11 +5878,59 @@ - live_regs_mask |= 0x4000; - } - -+ ip_rtx = gen_rtx_REG (SImode, IP_REGNUM); -+ - if (frame_pointer_needed) - { -+ if (current_function_needs_context) -+ { -+ /* The Static chain register is the same as the IP register -+ used as a scratch register during stack frame creation. -+ To get around this need to find somewhere to store IP -+ whilst the frame is being created. We try the following -+ places in order: -+ -+ 1. An unused argument register. -+ 2. A slot on the stack above the frame. (This only -+ works if the function is not a varargs function). -+ -+ If neither of these places is available, we abort (for now). */ -+ if (regs_ever_live[3] == 0) -+ { -+ insn = gen_rtx_REG (SImode, 3); -+ insn = gen_rtx_SET (SImode, insn, ip_rtx); -+ insn = emit_insn (insn); -+ RTX_FRAME_RELATED_P (insn) = 1; -+ } -+ else if (current_function_pretend_args_size == 0) -+ { -+ insn = gen_rtx_PRE_DEC (SImode, stack_pointer_rtx); -+ insn = gen_rtx_MEM (SImode, insn); -+ insn = gen_rtx_SET (VOIDmode, insn, ip_rtx); -+ insn = emit_insn (insn); -+ RTX_FRAME_RELATED_P (insn) = 1; -+ fp_offset = 4; -+ } -+ else -+ /* FIXME - the way to handle this situation is to allow -+ the pretend args to be dumped onto the stack, then -+ reuse r3 to save IP. This would involve moving the -+ copying os SP into IP until after the pretend args -+ have been dumped, but this is not too hard. */ -+ error ("Unable to find a temporary location for static chanin register"); -+ } -+ - live_regs_mask |= 0xD800; -- emit_insn (gen_movsi (gen_rtx_REG (SImode, 12), -- stack_pointer_rtx)); -+ if (fp_offset) -+ { -+ insn = gen_rtx_PLUS (SImode, stack_pointer_rtx, GEN_INT (fp_offset)); -+ insn = gen_rtx_SET (SImode, ip_rtx, insn); -+ } -+ else -+ insn = gen_movsi (ip_rtx, stack_pointer_rtx); -+ -+ insn = emit_insn (insn); -+ RTX_FRAME_RELATED_P (insn) = 1; - } - - if (current_function_pretend_args_size) -@@ -5927,9 +5994,31 @@ - } - - if (frame_pointer_needed) -- emit_insn (gen_addsi3 (hard_frame_pointer_rtx, gen_rtx_REG (SImode, 12), -- (GEN_INT -- (-(4 + current_function_pretend_args_size))))); -+ { -+ insn = GEN_INT (-(4 + current_function_pretend_args_size + fp_offset)); -+ insn = emit_insn (gen_addsi3 (hard_frame_pointer_rtx, ip_rtx, insn)); -+ RTX_FRAME_RELATED_P (insn) = 1; -+ -+ if (current_function_needs_context) -+ { -+ /* Recover the static chain register. */ -+ if (regs_ever_live [3] == 0) -+ { -+ insn = gen_rtx_REG (SImode, 3); -+ insn = gen_rtx_SET (SImode, ip_rtx, insn); -+ insn = emit_insn (insn); -+ RTX_FRAME_RELATED_P (insn) = 1; -+ } -+ else /* if (current_function_pretend_args_size == 0) */ -+ { -+ insn = gen_rtx_PLUS (SImode, hard_frame_pointer_rtx, GEN_INT (4)); -+ insn = gen_rtx_MEM (SImode, insn); -+ insn = gen_rtx_SET (SImode, ip_rtx, insn); -+ insn = emit_insn (insn); -+ RTX_FRAME_RELATED_P (insn) = 1; -+ } -+ } -+ } - - if (amount != const0_rtx) - { -diff -urN gcc-2.95.3-orig/gcc/config/arm/arm.h gcc-2.95.3/gcc/config/arm/arm.h ---- gcc-2.95.3-orig/gcc/config/arm/arm.h Thu Jan 25 15:03:26 2001 -+++ gcc-2.95.3/gcc/config/arm/arm.h Fri Jul 20 19:39:11 2001 -@@ -601,14 +601,20 @@ - (TREE_CODE (EXP) == STRING_CST \ - && (ALIGN) < BITS_PER_WORD ? BITS_PER_WORD : (ALIGN)) - -+#ifndef STRUCTURE_SIZE_BOUNDARY - /* Every structures size must be a multiple of 32 bits. */ - /* This is for compatibility with ARMCC. ARM SDT Reference Manual - (ARM DUI 0020D) page 2-20 says "Structures are aligned on word - boundaries". */ --#ifndef STRUCTURE_SIZE_BOUNDARY --#define STRUCTURE_SIZE_BOUNDARY 32 -+/* Setting this to 32 produces more efficient code, but the value set in previous -+ versions of this toolchain was 8, which produces more compact structures. The -+ command line option -mstructure_size_boundary= can be used to change this -+ value. */ -+#define STRUCTURE_SIZE_BOUNDARY arm_structure_size_boundary - #endif - -+extern int arm_structure_size_boundary; -+ - /* Used when parsing command line option -mstructure_size_boundary. */ - extern const char * structure_size_string; - -@@ -768,6 +774,9 @@ - /* Specify the registers used for certain standard purposes. - The values of these macros are register numbers. */ - -+/* Register which holds return address from a subroutine call. */ -+#define LR_REGNUM 14 -+ - /* Define this if the program counter is overloaded on a register. */ - #define PC_REGNUM 15 - -@@ -777,6 +786,9 @@ - /* Base register for access to local variables of the function. */ - #define FRAME_POINTER_REGNUM 25 - -+/* Scratch register - used in all kinds of places, eg trampolines. */ -+#define IP_REGNUM 12 -+ - /* Define this to be where the real frame pointer is if it is not possible to - work out the offset between the frame pointer and the automatic variables - until after register allocation has taken place. FRAME_POINTER_REGNUM -@@ -798,7 +810,7 @@ - /* The native (Norcroft) Pascal compiler for the ARM passes the static chain - as an invisible last argument (possible since varargs don't exist in - Pascal), so the following is not true. */ --#define STATIC_CHAIN_REGNUM 8 -+#define STATIC_CHAIN_REGNUM 12 - - /* Register in which address to store a structure value - is passed to a function. */ -@@ -1248,7 +1260,12 @@ - { \ - int volatile_func = arm_volatile_func (); \ - if ((FROM) == ARG_POINTER_REGNUM && (TO) == HARD_FRAME_POINTER_REGNUM)\ -- (OFFSET) = 0; \ -+ { \ -+ if (! current_function_needs_context || ! frame_pointer_needed) \ -+ (OFFSET) = 0; \ -+ else \ -+ (OFFSET) = 4; \ -+ } \ - else if ((FROM) == FRAME_POINTER_REGNUM \ - && (TO) == STACK_POINTER_REGNUM) \ - (OFFSET) = (current_function_outgoing_args_size \ -@@ -1379,8 +1396,10 @@ - - On the ARM, allow any integer (invalid ones are removed later by insn - patterns), nice doubles and symbol_refs which refer to the function's -- constant pool XXX. */ --#define LEGITIMATE_CONSTANT_P(X) (! label_mentioned_p (X)) -+ constant pool XXX. -+ -+ When generating PIC code, allow anything. */ -+#define LEGITIMATE_CONSTANT_P(X) (flag_pic || ! label_mentioned_p (X)) - - /* Symbols in the text segment can be accessed without indirecting via the - constant pool; it may take an extra binary operation, but this is still -@@ -1496,9 +1515,8 @@ - && INTVAL (op) <= 31) \ - goto LABEL; \ - } \ -- /* NASTY: Since this limits the addressing of unsigned byte loads */ \ - range = ((MODE) == HImode || (MODE) == QImode) \ -- ? (arm_arch4 ? 256 : 4095) : 4096; \ -+ ? (((MODE) == HImode && arm_arch4) ? 256 : 4095) : 4096; \ - if (code == CONST_INT && INTVAL (INDEX) < range \ - && INTVAL (INDEX) > -range) \ - goto LABEL; \ -@@ -1812,14 +1830,15 @@ - data addresses in memory. */ - #define PIC_OFFSET_TABLE_REGNUM arm_pic_register - --#define FINALIZE_PIC arm_finalize_pic () -+#define FINALIZE_PIC arm_finalize_pic (1) - --/* We can't directly access anything that contains a symbol, -+/* We can't directly access anything that contains a symbol or label, - nor can we indirect via the constant pool. */ - #define LEGITIMATE_PIC_OPERAND_P(X) \ -- (! symbol_mentioned_p (X) \ -+ (! symbol_mentioned_p (X) && ! label_mentioned_p (X) \ - && (! CONSTANT_POOL_ADDRESS_P (X) \ -- || ! symbol_mentioned_p (get_pool_constant (X)))) -+ || (! symbol_mentioned_p (get_pool_constant (X))) \ -+ && (! label_mentioned_p (get_pool_constant (X))))) - - /* We need to know when we are making a constant pool; this determines - whether data needs to be in the GOT or can be referenced via a GOT -@@ -2046,17 +2065,9 @@ - else output_addr_const(STREAM, X); \ - } - --/* Handles PIC addr specially */ - #define OUTPUT_INT_ADDR_CONST(STREAM,X) \ - { \ -- if (flag_pic && GET_CODE(X) == CONST && is_pic(X)) \ -- { \ -- output_addr_const(STREAM, XEXP (XEXP (XEXP (X, 0), 0), 0)); \ -- fputs(" - (", STREAM); \ -- output_addr_const(STREAM, XEXP (XEXP (XEXP (X, 0), 1), 0)); \ -- fputs(")", STREAM); \ -- } \ -- else output_addr_const(STREAM, X); \ -+ output_addr_const(STREAM, X); \ - \ - /* Mark symbols as position independent. We only do this in the \ - .text segment, not in the .data segment. */ \ -@@ -2170,8 +2181,7 @@ - int arm_return_in_memory PROTO ((Tree)); - int legitimate_pic_operand_p PROTO ((Rtx)); - Rtx legitimize_pic_address PROTO ((Rtx, Mmode, Rtx)); --int is_pic PROTO ((Rtx)); --void arm_finalize_pic PROTO ((void)); -+void arm_finalize_pic PROTO ((int)); - int arm_rtx_costs RTX_CODE_PROTO ((Rtx, Rcode)); - int arm_adjust_cost PROTO ((Rtx, Rtx, Rtx, int)); - int const_double_rtx_ok_for_fpu PROTO ((Rtx)); -diff -urN gcc-2.95.3-orig/gcc/config/arm/arm.md gcc-2.95.3/gcc/config/arm/arm.md ---- gcc-2.95.3-orig/gcc/config/arm/arm.md Thu Jan 25 15:03:27 2001 -+++ gcc-2.95.3/gcc/config/arm/arm.md Fri Jul 20 19:39:11 2001 -@@ -2629,7 +2629,8 @@ - : preserve_subexpressions_p ())); - DONE; - } -- if (CONSTANT_P (operands[1]) && flag_pic) -+ if ((CONSTANT_P (operands[1]) || symbol_mentioned_p (operands[1]) -+ || label_mentioned_p (operands[1])) && flag_pic) - operands[1] = legitimize_pic_address (operands[1], SImode, - ((reload_in_progress - || reload_completed) -@@ -2721,6 +2722,15 @@ - return \"add%?\\t%0, %|pc, %0\"; - ") - -+(define_expand "builtin_setjmp_receiver" -+ [(label_ref (match_operand 0 "" ""))] -+ "flag_pic" -+ " -+{ -+ arm_finalize_pic (0); -+ DONE; -+}") -+ - ;; If copying one reg to another we can set the condition codes according to - ;; its value. Such a move is common after a return from subroutine and the - ;; result is being tested against zero. -@@ -6184,15 +6194,20 @@ - abort (); - return \"\"; - } -- strcpy (pattern, \"stmfd\\t%m0!, {%1\"); -- for (i = 1; i < XVECLEN (operands[2], 0); i++) -+ if (XVECLEN (operands[2], 0) > 1) - { -- strcat (pattern, \", %|\"); -- strcat (pattern, reg_names[REGNO (XEXP (XVECEXP (operands[2], 0, i), -+ strcpy (pattern, \"stmfd\\t%m0!, {%1\"); -+ for (i = 1; i < XVECLEN (operands[2], 0); i++) -+ { -+ strcat (pattern, \", %|\"); -+ strcat (pattern, reg_names[REGNO (XEXP (XVECEXP (operands[2], 0, i), - 0))]); -+ } -+ strcat (pattern, \"}\"); -+ output_asm_insn (pattern, operands); - } -- strcat (pattern, \"}\"); -- output_asm_insn (pattern, operands); -+ else -+ output_asm_insn (\"str\\t%1, [%m0, #-4]!\", operands); - return \"\"; - }" - [(set_attr "type" "store4")]) -diff -urN gcc-2.95.3-orig/gcc/config/arm/elf.h gcc-2.95.3/gcc/config/arm/elf.h ---- gcc-2.95.3-orig/gcc/config/arm/elf.h Mon May 31 10:21:53 1999 -+++ gcc-2.95.3/gcc/config/arm/elf.h Fri Jul 20 19:39:11 2001 -@@ -167,15 +167,6 @@ - #define MULTILIB_DEFAULTS { "mlittle-endian", "msoft-float", "mapcs-32", "mno-thumb-interwork" } - #endif - --/* Setting this to 32 produces more efficient code, but the value set in previous -- versions of this toolchain was 8, which produces more compact structures. The -- command line option -mstructure_size_boundary= can be used to change this -- value. */ --#undef STRUCTURE_SIZE_BOUNDARY --#define STRUCTURE_SIZE_BOUNDARY arm_structure_size_boundary -- --extern int arm_structure_size_boundary; -- - /* 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. */ -diff -urN gcc-2.95.3-orig/gcc/config/arm/linux-gas.h gcc-2.95.3/gcc/config/arm/linux-gas.h ---- gcc-2.95.3-orig/gcc/config/arm/linux-gas.h Mon Feb 22 17:47:57 1999 -+++ gcc-2.95.3/gcc/config/arm/linux-gas.h Fri Jul 20 19:39:11 2001 -@@ -1,6 +1,6 @@ - /* Definitions of target machine for GNU compiler. - ARM Linux-based GNU systems version. -- Copyright (C) 1997, 1998, 1999 Free Software Foundation, Inc. -+ Copyright (C) 1997, 1998, 1999, 2000 Free Software Foundation, Inc. - Contributed by Russell King . - - This file is part of GNU CC. -@@ -79,5 +79,7 @@ - register unsigned long _beg __asm ("a1") = (unsigned long) (BEG); \ - register unsigned long _end __asm ("a2") = (unsigned long) (END); \ - register unsigned long _flg __asm ("a3") = 0; \ -- __asm __volatile ("swi 0x9f0002"); \ -+ __asm __volatile ("swi 0x9f0002 @ sys_cacheflush" \ -+ : "=r" (_beg) \ -+ : "0" (_beg), "r" (_end), "r" (_flg)); \ - } -diff -urN gcc-2.95.3-orig/gcc/config/arm/t-linux gcc-2.95.3/gcc/config/arm/t-linux ---- gcc-2.95.3-orig/gcc/config/arm/t-linux Fri Mar 26 16:30:20 1999 -+++ gcc-2.95.3/gcc/config/arm/t-linux Fri Jul 20 20:46:19 2001 -@@ -1,6 +1,6 @@ - # Just for these, we omit the frame pointer since it makes such a big - # difference. It is then pointless adding debugging. --TARGET_LIBGCC2_CFLAGS = -fomit-frame-pointer -fPIC -+TARGET_LIBGCC2_CFLAGS = -fomit-frame-pointer -fPIC - LIBGCC2_DEBUG_CFLAGS = -g0 - - # Don't build enquire -diff -urN gcc-2.95.3-orig/gcc/final.c gcc-2.95.3/gcc/final.c ---- gcc-2.95.3-orig/gcc/final.c Mon Mar 12 13:07:59 2001 -+++ gcc-2.95.3/gcc/final.c Fri Jul 20 19:39:11 2001 -@@ -3652,8 +3652,9 @@ - - output_addr_const (file, XEXP (x, 0)); - fprintf (file, "-"); -- if (GET_CODE (XEXP (x, 1)) == CONST_INT -- && INTVAL (XEXP (x, 1)) < 0) -+ if ((GET_CODE (XEXP (x, 1)) == CONST_INT -+ && INTVAL (XEXP (x, 1)) < 0) -+ || GET_CODE (XEXP (x, 1)) != CONST_INT) - { - fprintf (file, ASM_OPEN_PAREN); - output_addr_const (file, XEXP (x, 1)); -diff -urN gcc-2.95.3-orig/gcc/function.c gcc-2.95.3/gcc/function.c ---- gcc-2.95.3-orig/gcc/function.c Thu Jan 25 15:03:15 2001 -+++ gcc-2.95.3/gcc/function.c Fri Jul 20 19:39:10 2001 -@@ -3053,6 +3053,105 @@ - extracted by usage MEM with narrower mode. */ - static rtx purge_addressof_replacements; - -+/* Return 1 if X and Y are identical-looking rtx's. -+ This is the Lisp function EQUAL for rtx arguments. */ -+ -+int -+rtx_equal_for_addressof_p (x, y) -+ rtx x, y; -+{ -+ register int i; -+ register int j; -+ register enum rtx_code code; -+ register char *fmt; -+ -+ if (x == y) -+ return 1; -+ if (x == 0 || y == 0) -+ return 0; -+ -+ code = GET_CODE (x); -+ /* Rtx's of different codes cannot be equal. */ -+ if (code != GET_CODE (y)) -+ return 0; -+ -+ /* (MULT:SI x y) and (MULT:HI x y) are NOT equivalent. -+ (REG:SI x) and (REG:HI x) are NOT equivalent. -+ But (MEM:SI x) and (MEM:HI x) are equivalent for our purposes. */ -+ -+ if (code != MEM && (GET_MODE (x) != GET_MODE (y))) -+ return 0; -+ -+ /* REG, LABEL_REF, and SYMBOL_REF can be compared nonrecursively. */ -+ -+ if (code == REG) -+ return REGNO (x) == REGNO (y); -+ else if (code == LABEL_REF) -+ return XEXP (x, 0) == XEXP (y, 0); -+ else if (code == SYMBOL_REF) -+ return XSTR (x, 0) == XSTR (y, 0); -+ else if (code == SCRATCH || code == CONST_DOUBLE) -+ return 0; -+ -+ /* Compare the elements. If any pair of corresponding elements -+ fail to match, return 0 for the whole things. */ -+ -+ fmt = GET_RTX_FORMAT (code); -+ for (i = GET_RTX_LENGTH (code) - 1; i >= 0; i--) -+ { -+ switch (fmt[i]) -+ { -+ case 'w': -+ if (XWINT (x, i) != XWINT (y, i)) -+ return 0; -+ break; -+ -+ case 'n': -+ case 'i': -+ if (XINT (x, i) != XINT (y, i)) -+ return 0; -+ break; -+ -+ case 'V': -+ case 'E': -+ /* Two vectors must have the same length. */ -+ if (XVECLEN (x, i) != XVECLEN (y, i)) -+ return 0; -+ -+ /* And the corresponding elements must match. */ -+ for (j = 0; j < XVECLEN (x, i); j++) -+ if (rtx_equal_p (XVECEXP (x, i, j), XVECEXP (y, i, j)) == 0) -+ return 0; -+ break; -+ -+ case 'e': -+ if (rtx_equal_p (XEXP (x, i), XEXP (y, i)) == 0) -+ return 0; -+ break; -+ -+ case 'S': -+ case 's': -+ if (strcmp (XSTR (x, i), XSTR (y, i))) -+ return 0; -+ break; -+ -+ case 'u': -+ /* These are just backpointers, so they don't matter. */ -+ break; -+ -+ case '0': -+ break; -+ -+ /* It is believed that rtx's at this level will never -+ contain anything but integers and other rtx's, -+ except for within LABEL_REFs and SYMBOL_REFs. */ -+ default: -+ abort (); -+ } -+ } -+ return 1; -+} -+ - /* Helper function for purge_addressof. See if the rtx expression at *LOC - in INSN needs to be changed. If FORCE, always put any ADDRESSOFs into - the stack. */ -@@ -3133,7 +3232,7 @@ - for (tem = purge_bitfield_addressof_replacements; - tem != NULL_RTX; - tem = XEXP (XEXP (tem, 1), 1)) -- if (rtx_equal_p (x, XEXP (tem, 0))) -+ if (rtx_equal_for_addressof_p (x, XEXP (tem, 0))) - { - *loc = XEXP (XEXP (tem, 1), 0); - return; -@@ -3143,7 +3242,7 @@ - for (tem = purge_addressof_replacements; - tem != NULL_RTX; - tem = XEXP (XEXP (tem, 1), 1)) -- if (rtx_equal_p (XEXP (x, 0), XEXP (tem, 0))) -+ if (rtx_equal_for_addressof_p (XEXP (x, 0), XEXP (tem, 0))) - { - rtx z = XEXP (XEXP (tem, 1), 0); - -diff -urN gcc-2.95.3-orig/gcc/jump.c gcc-2.95.3/gcc/jump.c ---- gcc-2.95.3-orig/gcc/jump.c Thu Oct 21 08:24:03 1999 -+++ gcc-2.95.3/gcc/jump.c Fri Jul 20 19:39:10 2001 -@@ -115,7 +115,7 @@ - static rtx delete_unreferenced_labels PROTO((rtx)); - static void delete_noop_moves PROTO((rtx)); - static int calculate_can_reach_end PROTO((rtx, int, int)); --static int duplicate_loop_exit_test PROTO((rtx)); -+static int duplicate_loop_exit_test PROTO((rtx, int)); - static void find_cross_jump PROTO((rtx, rtx, int, rtx *, rtx *)); - static void do_cross_jump PROTO((rtx, rtx, rtx)); - static int jump_back_p PROTO((rtx, rtx)); -@@ -338,7 +338,7 @@ - && simplejump_p (temp1)) - { - temp = PREV_INSN (insn); -- if (duplicate_loop_exit_test (insn)) -+ if (duplicate_loop_exit_test (insn, after_regscan)) - { - changed = 1; - next = NEXT_INSN (temp); -@@ -2548,8 +2548,9 @@ - values of regno_first_uid and regno_last_uid. */ - - static int --duplicate_loop_exit_test (loop_start) -+duplicate_loop_exit_test (loop_start, after_regscan) - rtx loop_start; -+ int after_regscan; - { - rtx insn, set, reg, p, link; - rtx copy = 0, first_copy = 0; -@@ -2662,6 +2663,9 @@ - reg_map[REGNO (reg)] = gen_reg_rtx (GET_MODE (reg)); - } - } -+ -+ if (after_regscan) -+ reg_scan_update (exitcode, lastexit, max_reg); - - /* Now copy each insn. */ - for (insn = exitcode; insn != lastexit; insn = NEXT_INSN (insn)) -diff -urN gcc-2.95.3-orig/gcc/varasm.c gcc-2.95.3/gcc/varasm.c ---- gcc-2.95.3-orig/gcc/varasm.c Mon Feb 19 15:02:02 2001 -+++ gcc-2.95.3/gcc/varasm.c Fri Jul 20 19:39:11 2001 -@@ -3286,7 +3286,10 @@ - value->un.addr.offset = - INTVAL (XEXP (x, 1)); - } - else -- abort (); -+ { -+ value->un.addr.base = x; -+ value->un.addr.offset = 0; -+ } - break; - - default: diff --git a/patches/gcc/2.95.3/backport-config.gcc-1.4.patch b/patches/gcc/2.95.3/backport-config.gcc-1.4.patch deleted file mode 100644 index 141de0c..0000000 --- a/patches/gcc/2.95.3/backport-config.gcc-1.4.patch +++ /dev/null @@ -1,35 +0,0 @@ -# Taken from http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/config.gcc.diff?r1=1.3&r2=1.4 -# Should fix error -# Configuration powerpc-host_apple-darwin7.3.0 not supported -# when configuring gcc-2.95 on Mac OS X for i686 target -# Also create xm-darwin.h, seems to be required, else we get the error -# In file included from .../gcc-2.95.3/gcc/gencheck.c:21: -# hconfig.h:11:30: rs6000/xm-darwin.h: No such file or directory -# make[1]: *** [gencheck.o] Error 1 - - ---- gcc-2.95.3/gcc/configure.old 2004-03-24 12:17:44.000000000 -0800 -+++ gcc-2.95.3/gcc/configure 2004-03-24 17:14:38.000000000 -0800 -@@ -5079,6 +5079,10 @@ - tmake_file=rs6000/t-beos - xmake_file=rs6000/x-beos - ;; -+ powerpc-*-darwin*) -+ xm_file="rs6000/xm-rs6000.h rs6000/xm-darwin.h" -+ xmake_file=rs6000/x-darwin -+ ;; - powerpc-*-sysv* | powerpc-*-elf*) - tm_file=rs6000/sysv4.h - xm_file="xm-siglist.h rs6000/xm-sysv4.h" ---- /dev/null 2003-01-30 02:24:37.000000000 -0800 -+++ gcc-3.0.4/gcc/config/rs6000/xm-darwin.h 2000-11-20 19:02:09.000000000 -0800 -@@ -0,0 +1,9 @@ -+/* Undo the USG definition in xm-rs6000.h, Darwin is a BSD flavor. */ -+ -+#undef USG -+ -+/* Override the usual setting, since Apple's GCC has lame bugs and -+ can't handle the initializers. Someday the bugs will be fixed and -+ we can get rid of this silliness. */ -+ -+#define HAVE_DESIGNATED_INITIALIZERS 0 diff --git a/patches/gcc/2.95.3/backport-config.gcc-1.92.patch b/patches/gcc/2.95.3/backport-config.gcc-1.92.patch deleted file mode 100644 index fc55681..0000000 --- a/patches/gcc/2.95.3/backport-config.gcc-1.92.patch +++ /dev/null @@ -1,39 +0,0 @@ -# Taken from http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/config.gcc.diff?r1=1.91&r2=1.92 -# Should fix error -# Configuration x86_64-host_unknown-linux-gnu not supported -# when configuring gcc-2.95 on x86_64 build for i686 target -# It's a bit silly, since tm_file refers to files that don't exist, -# but as long as x86_64 is just the build machine, that doesn't matter. - ---- gcc-2.95.3/gcc/configure.old 2004-03-24 12:17:44.000000000 -0800 -+++ gcc-2.95.3/gcc/configure 2004-03-24 12:19:30.000000000 -0800 -@@ -2929,6 +2929,9 @@ - i[34567]86-*-*) - cpu_type=i386 - ;; -+ x86_64-*-*) -+ cpu_type=i386 -+ ;; - hppa*-*-*) - cpu_type=pa - ;; -@@ -3643,6 +3646,19 @@ - thread_file='posix' - fi - ;; -+ x86_64-*-linux*) -+ xmake_file=x-linux -+ tm_file="i386/biarch64.h i386/i386.h i386/att.h linux.h i386/x86-64.h \ -+ i386/linux64.h" -+ tmake_file="t-slibgcc-elf-ver t-linux i386/t-crtstuff" -+ extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o" -+ gnu_ld=yes -+ float_format=i386 -+ if test x$enable_threads = xyes; then -+ thread_file='posix' -+ fi -+ ;; -+ - i[34567]86-*-gnu*) - float_format=i386 - ;; diff --git a/patches/gcc/2.95.3/config.sub.patch b/patches/gcc/2.95.3/config.sub.patch deleted file mode 100644 index c8189b5..0000000 --- a/patches/gcc/2.95.3/config.sub.patch +++ /dev/null @@ -1,1257 +0,0 @@ -# Backport from gcc-3.3.3 -# Fixes errors like -# Invalid configuration `x86_64-host_unknown-linux-gnu': machine `x86_64-host_unknown' not recognized -# Unrecognized host system name x86_64-host_unknown-linux-gnu. -# when configuring on chip types or operating systems like x86_64 or Darwin -# which are newer than gcc-2.95 - ---- gcc-2.95.3/config.sub.old 1999-08-04 01:09:26.000000000 -0700 -+++ gcc-2.95.3/config.sub 2004-03-24 11:28:24.000000000 -0800 -@@ -1,6 +1,10 @@ - #! /bin/sh --# Configuration validation subroutine script, version 1.1. --# Copyright (C) 1991, 92-97, 1998, 1999 Free Software Foundation, Inc. -+# Configuration validation subroutine script. -+# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, -+# 2000, 2001, 2002, 2003 Free Software Foundation, Inc. -+ -+timestamp='2003-01-28' -+ - # This file is (in principle) common to ALL GNU software. - # The presence of a machine in this file suggests that SOME GNU software - # can handle that machine. It does not imply ALL GNU software can. -@@ -25,6 +29,9 @@ - # configuration script generated by Autoconf, you may include it under - # the same distribution terms that you use for the rest of that program. - -+# Please send patches to . Submit a context -+# diff and a properly formatted ChangeLog entry. -+# - # Configuration subroutine to validate and canonicalize a configuration type. - # Supply the specified configuration type as an argument. - # If it is invalid, we print an error message on stderr and exit with code 1. -@@ -45,30 +52,73 @@ - # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM - # It is wrong to echo any other type of specification. - --if [ x$1 = x ] --then -- echo Configuration name missing. 1>&2 -- echo "Usage: $0 CPU-MFR-OPSYS" 1>&2 -- echo "or $0 ALIAS" 1>&2 -- echo where ALIAS is a recognized configuration type. 1>&2 -- exit 1 --fi -+me=`echo "$0" | sed -e 's,.*/,,'` - --# First pass through any local machine types. --case $1 in -- *local*) -- echo $1 -- exit 0 -- ;; -- *) -- ;; -+usage="\ -+Usage: $0 [OPTION] CPU-MFR-OPSYS -+ $0 [OPTION] ALIAS -+ -+Canonicalize a configuration name. -+ -+Operation modes: -+ -h, --help print this help, then exit -+ -t, --time-stamp print date of last modification, then exit -+ -v, --version print version number, then exit -+ -+Report bugs and patches to ." -+ -+version="\ -+GNU config.sub ($timestamp) -+ -+Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001 -+Free Software Foundation, Inc. -+ -+This is free software; see the source for copying conditions. There is NO -+warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." -+ -+help=" -+Try \`$me --help' for more information." -+ -+# Parse command line -+while test $# -gt 0 ; do -+ case $1 in -+ --time-stamp | --time* | -t ) -+ echo "$timestamp" ; exit 0 ;; -+ --version | -v ) -+ echo "$version" ; exit 0 ;; -+ --help | --h* | -h ) -+ echo "$usage"; exit 0 ;; -+ -- ) # Stop option processing -+ shift; break ;; -+ - ) # Use stdin as input. -+ break ;; -+ -* ) -+ echo "$me: invalid option $1$help" -+ exit 1 ;; -+ -+ *local*) -+ # First pass through any local machine types. -+ echo $1 -+ exit 0;; -+ -+ * ) -+ break ;; -+ esac -+done -+ -+case $# in -+ 0) echo "$me: missing argument$help" >&2 -+ exit 1;; -+ 1) ;; -+ *) echo "$me: too many arguments$help" >&2 -+ exit 1;; - esac - - # Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). - # Here we must recognize all the valid KERNEL-OS combinations. - maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` - case $maybe_os in -- linux-gnu*) -+ nto-qnx* | linux-gnu* | freebsd*-gnu* | netbsd*-gnu* | storm-chaos* | os2-emx* | rtmk-nova*) - os=-$maybe_os - basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` - ;; -@@ -94,20 +144,28 @@ - -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ - -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ - -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ -- -apple) -+ -apple | -axis) - os= - basic_machine=$1 - ;; -- -sim | -cisco | -oki | -wec | -winbond ) # EGCS LOCAL -+ -sim | -cisco | -oki | -wec | -winbond) - os= - basic_machine=$1 - ;; -- -scout) # EGCS LOCAL -+ -scout) - ;; -- -wrs) # EGCS LOCAL -+ -wrs) - os=-vxworks - basic_machine=$1 - ;; -+ -chorusos*) -+ os=-chorusos -+ basic_machine=$1 -+ ;; -+ -chorusrdb) -+ os=-chorusrdb -+ basic_machine=$1 -+ ;; - -hiux*) - os=-hiuxwe2 - ;; -@@ -156,49 +214,72 @@ - -psos*) - os=-psos - ;; -+ -mint | -mint[0-9]*) -+ basic_machine=m68k-atari -+ os=-mint -+ ;; - esac - - # Decode aliases for certain CPU-COMPANY combinations. - case $basic_machine in - # Recognize the basic CPU types without company name. - # Some are omitted here because they have special meanings below. -- tahoe | i860 | m32r | m68k | m68000 | m88k | ns32k | arc | arm \ -- | arme[lb] | pyramid | mn10200 | mn10300 \ -- | tron | a29k | 580 | i960 | h8300 \ -- | hppa | hppa1.0 | hppa1.1 | hppa2.0 | hppa2.0w | hppa2.0n \ -- | alpha | alphaev5 | alphaev56 | alphapca56 | alphaev6 \ -- | we32k | ns16k | clipper | i370 | sh | powerpc | powerpcle \ -- | 1750a | dsp16xx | pdp11 \ -- | mips64 | mipsel | mips64el | mips64orion | mips64orionel \ -- | mipstx39 | mipstx39el \ -- | sparc | sparclet | sparclite | sparc64 | sparcv9 | v850 | c4x) -- basic_machine=$basic_machine-unknown -- ;; -- m88110 | m680[012346]0 | m683?2 | m68360 | m5200 | z8k | v70 \ -- | h8500 | w65) # EGCS LOCAL -- ;; -- thumb) -- basic_machine=$basic_machine-unknown -- ;; -- mips64vr4300 | mips64vr4300el) # EGCS LOCAL jsmith/vr4300 -+ 1750a | 580 \ -+ | a29k \ -+ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ -+ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ -+ | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr \ -+ | clipper \ -+ | d10v | d30v | dlx | dsp16xx \ -+ | fr30 | frv \ -+ | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ -+ | i370 | i860 | i960 | ia64 \ -+ | ip2k \ -+ | m32r | m68000 | m68k | m88k | mcore \ -+ | mips | mipsbe | mipseb | mipsel | mipsle \ -+ | mips16 \ -+ | mips64 | mips64el \ -+ | mips64vr | mips64vrel \ -+ | mips64orion | mips64orionel \ -+ | mips64vr4100 | mips64vr4100el \ -+ | mips64vr4300 | mips64vr4300el \ -+ | mips64vr5000 | mips64vr5000el \ -+ | mipsisa32 | mipsisa32el \ -+ | mipsisa32r2 | mipsisa32r2el \ -+ | mipsisa64 | mipsisa64el \ -+ | mipsisa64sb1 | mipsisa64sb1el \ -+ | mipsisa64sr71k | mipsisa64sr71kel \ -+ | mipstx39 | mipstx39el \ -+ | mn10200 | mn10300 \ -+ | msp430 \ -+ | ns16k | ns32k \ -+ | openrisc | or32 \ -+ | pdp10 | pdp11 | pj | pjl \ -+ | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \ -+ | pyramid \ -+ | sh | sh[1234] | sh[23]e | sh[34]eb | shbe | shle | sh[1234]le | sh3ele \ -+ | sh64 | sh64le \ -+ | sparc | sparc64 | sparc86x | sparclet | sparclite | sparcv9 | sparcv9b \ -+ | strongarm \ -+ | tahoe | thumb | tic80 | tron \ -+ | v850 | v850e \ -+ | we32k \ -+ | x86 | xscale | xstormy16 | xtensa \ -+ | z8k) - basic_machine=$basic_machine-unknown - ;; -- mips64vr4100 | mips64vr4100el) # EGCS LOCAL jsmith/vr4100 -- basic_machine=$basic_machine-unknown -- ;; -- mips64vr5000 | mips64vr5000el) # EGCS LOCAL ian/vr5000 -- basic_machine=$basic_machine-unknown -- ;; -- mips16) -+ m6811 | m68hc11 | m6812 | m68hc12) -+ # Motorola 68HC11/12. - basic_machine=$basic_machine-unknown -+ os=-none - ;; -- d10v) -- basic_machine=$basic_machine-unknown -+ m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) - ;; -+ - # We use `pc' rather than `unknown' - # because (1) that's what they normally are, and - # (2) the word "unknown" tends to confuse beginning users. -- i[34567]86) -+ i*86 | x86_64) - basic_machine=$basic_machine-pc - ;; - # Object if more than one company name word. -@@ -207,44 +288,62 @@ - exit 1 - ;; - # Recognize the basic CPU types with company name. -- vax-* | tahoe-* | i[34567]86-* | i860-* | m32r-* | m68k-* | m68000-* \ -- | m88k-* | sparc-* | ns32k-* | fx80-* | arc-* | arm-* | c[123]* \ -- | mips-* | pyramid-* | tron-* | a29k-* | romp-* | rs6000-* \ -- | power-* | none-* | 580-* | cray2-* | h8300-* | i960-* \ -- | xmp-* | ymp-* \ -- | hppa-* | hppa1.0-* | hppa1.1-* \ -- | hppa2.0-* | hppa2.0w-* | hppa2.0n-* \ -- | alpha-* | alphaev5-* | alphaev56-* | alphapca56-* \ -- | alphaev6-* | we32k-* | cydra-* | ns16k-* | pn-* | np1-* \ -- | xps100-* | clipper-* | orion-* \ -- | sparclite-* | pdp11-* | sh-* | powerpc-* | powerpcle-* \ -- | sparc64-* | sparcv9-* | sparc86x-* | mips64-* | mipsel-* \ -- | mips64el-* | mips64orion-* | mips64orionel-* \ -- | mipstx39-* | mipstx39el-* \ -- | f301-* | arm*-*) -- ;; -- m88110-* | m680[01234]0-* | m683?2-* | m68360-* | z8k-* | h8500-* | d10v-*) # EGCS LOCAL -- ;; -- thumb-*) # EGCS LOCAL angela/thumb -- ;; -- v850-*) # EGCS LOCAL -- ;; -- d30v-*) # EGCS LOCAL -- ;; -- mips64vr4300-* | mips64vr4300el-*) # EGCS LOCAL jsmith/vr4300 -- ;; -- mips64vr4100-* | mips64vr4100el-*) # EGCS LOCAL jsmith/vr4100 -- ;; -- mips16-*) # EGCS LOCAL krk/mips16 -- ;; -- tic30-*) # EGCS LOCAL ian/tic30 -- ;; -- c30-*) # EGCS LOCAL ian/tic30 -- basic_machine=tic30-unknown -+ 580-* \ -+ | a29k-* \ -+ | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ -+ | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ -+ | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ -+ | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ -+ | avr-* \ -+ | bs2000-* \ -+ | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* \ -+ | clipper-* | cydra-* \ -+ | d10v-* | d30v-* | dlx-* \ -+ | elxsi-* \ -+ | f30[01]-* | f700-* | fr30-* | frv-* | fx80-* \ -+ | h8300-* | h8500-* \ -+ | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ -+ | i*86-* | i860-* | i960-* | ia64-* \ -+ | ip2k-* \ -+ | m32r-* \ -+ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ -+ | m88110-* | m88k-* | mcore-* \ -+ | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ -+ | mips16-* \ -+ | mips64-* | mips64el-* \ -+ | mips64vr-* | mips64vrel-* \ -+ | mips64orion-* | mips64orionel-* \ -+ | mips64vr4100-* | mips64vr4100el-* \ -+ | mips64vr4300-* | mips64vr4300el-* \ -+ | mips64vr5000-* | mips64vr5000el-* \ -+ | mipsisa32-* | mipsisa32el-* \ -+ | mipsisa32r2-* | mipsisa32r2el-* \ -+ | mipsisa64-* | mipsisa64el-* \ -+ | mipsisa64sb1-* | mipsisa64sb1el-* \ -+ | mipsisa64sr71k-* | mipsisa64sr71kel-* \ -+ | mipstx39-* | mipstx39el-* \ -+ | msp430-* \ -+ | none-* | np1-* | nv1-* | ns16k-* | ns32k-* \ -+ | orion-* \ -+ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ -+ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \ -+ | pyramid-* \ -+ | romp-* | rs6000-* \ -+ | sh-* | sh[1234]-* | sh[23]e-* | sh[34]eb-* | shbe-* \ -+ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ -+ | sparc-* | sparc64-* | sparc86x-* | sparclet-* | sparclite-* \ -+ | sparcv9-* | sparcv9b-* | strongarm-* | sv1-* | sx?-* \ -+ | tahoe-* | thumb-* | tic30-* | tic4x-* | tic54x-* | tic80-* | tron-* \ -+ | v850-* | v850e-* | vax-* \ -+ | we32k-* \ -+ | x86-* | x86_64-* | xps100-* | xscale-* | xstormy16-* \ -+ | xtensa-* \ -+ | ymp-* \ -+ | z8k-*) - ;; - # Recognize the various machine names and aliases which stand - # for a CPU type and a company and sometimes even an OS. -- 386bsd) # EGCS LOCAL -+ 386bsd) - basic_machine=i386-unknown - os=-bsd - ;; -@@ -254,11 +353,11 @@ - 3b*) - basic_machine=we32k-att - ;; -- a29khif) # EGCS LOCAL -+ a29khif) - basic_machine=a29k-amd - os=-udi - ;; -- adobe68k) # EGCS LOCAL -+ adobe68k) - basic_machine=m68010-adobe - os=-scout - ;; -@@ -277,21 +376,21 @@ - os=-sysv - ;; - amiga | amiga-*) -- basic_machine=m68k-cbm -+ basic_machine=m68k-unknown - ;; - amigaos | amigados) -- basic_machine=m68k-cbm -+ basic_machine=m68k-unknown - os=-amigaos - ;; - amigaunix | amix) -- basic_machine=m68k-cbm -+ basic_machine=m68k-unknown - os=-sysv4 - ;; - apollo68) - basic_machine=m68k-apollo - os=-sysv - ;; -- apollo68bsd) # EGCS LOCAL -+ apollo68bsd) - basic_machine=m68k-apollo - os=-bsd - ;; -@@ -303,6 +402,10 @@ - basic_machine=ns32k-sequent - os=-dynix - ;; -+ c90) -+ basic_machine=c90-cray -+ os=-unicos -+ ;; - convex-c1) - basic_machine=c1-convex - os=-bsd -@@ -323,27 +426,30 @@ - basic_machine=c38-convex - os=-bsd - ;; -- cray | ymp) -- basic_machine=ymp-cray -- os=-unicos -- ;; -- cray2) -- basic_machine=cray2-cray -- os=-unicos -- ;; -- [ctj]90-cray) -- basic_machine=c90-cray -+ cray | j90) -+ basic_machine=j90-cray - os=-unicos - ;; - crds | unos) - basic_machine=m68k-crds - ;; -+ cris | cris-* | etrax*) -+ basic_machine=cris-axis -+ ;; - da30 | da30-*) - basic_machine=m68k-da30 - ;; - decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) - basic_machine=mips-dec - ;; -+ decsystem10* | dec10*) -+ basic_machine=pdp10-dec -+ os=-tops10 -+ ;; -+ decsystem20* | dec20*) -+ basic_machine=pdp10-dec -+ os=-tops20 -+ ;; - delta | 3300 | motorola-3300 | motorola-delta \ - | 3300-motorola | delta-motorola) - basic_machine=m68k-motorola -@@ -371,7 +477,7 @@ - encore | umax | mmax) - basic_machine=ns32k-encore - ;; -- es1800 | OSE68k | ose68k | ose | OSE) # EGCS LOCAL -+ es1800 | OSE68k | ose68k | ose | OSE) - basic_machine=m68k-ericsson - os=-ose - ;; -@@ -385,6 +491,10 @@ - basic_machine=tron-gmicro - os=-sysv - ;; -+ go32) -+ basic_machine=i386-pc -+ os=-go32 -+ ;; - h3050r* | hiux*) - basic_machine=hppa1.1-hitachi - os=-hiuxwe2 -@@ -393,11 +503,11 @@ - basic_machine=h8300-hitachi - os=-hms - ;; -- h8300xray) # EGCS LOCAL -+ h8300xray) - basic_machine=h8300-hitachi - os=-xray - ;; -- h8500hms) # EGCS LOCAL -+ h8500hms) - basic_machine=h8500-hitachi - os=-hms - ;; -@@ -416,22 +526,6 @@ - basic_machine=m68k-hp - os=-hpux - ;; -- w89k-*) # EGCS LOCAL -- basic_machine=hppa1.1-winbond -- os=-proelf -- ;; -- op50n-*) # EGCS LOCAL -- basic_machine=hppa1.1-oki -- os=-proelf -- ;; -- op60c-*) # EGCS LOCAL -- basic_machine=hppa1.1-oki -- os=-proelf -- ;; -- hppro) # EGCS LOCAL -- basic_machine=hppa1.1-hp -- os=-proelf -- ;; - hp3k9[0-9][0-9] | hp9[0-9][0-9]) - basic_machine=hppa1.0-hp - ;; -@@ -441,22 +535,21 @@ - hp9k3[2-9][0-9]) - basic_machine=m68k-hp - ;; -- hp9k6[0-9][0-9] | hp6[0-9][0-9] ) -+ hp9k6[0-9][0-9] | hp6[0-9][0-9]) - basic_machine=hppa1.0-hp - ;; -- hp9k7[0-79][0-9] | hp7[0-79][0-9] ) -+ hp9k7[0-79][0-9] | hp7[0-79][0-9]) - basic_machine=hppa1.1-hp - ;; -- hp9k78[0-9] | hp78[0-9] ) -+ hp9k78[0-9] | hp78[0-9]) - # FIXME: really hppa2.0-hp - basic_machine=hppa1.1-hp - ;; -- hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | \ -- hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893 ) -+ hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) - # FIXME: really hppa2.0-hp - basic_machine=hppa1.1-hp - ;; -- hp9k8[0-9][13679] | hp8[0-9][13679] ) -+ hp9k8[0-9][13679] | hp8[0-9][13679]) - basic_machine=hppa1.1-hp - ;; - hp9k8[0-9][0-9] | hp8[0-9][0-9]) -@@ -465,47 +558,42 @@ - hppa-next) - os=-nextstep3 - ;; -- hppaosf) # EGCS LOCAL -+ hppaosf) - basic_machine=hppa1.1-hp - os=-osf - ;; -+ hppro) -+ basic_machine=hppa1.1-hp -+ os=-proelf -+ ;; - i370-ibm* | ibm*) - basic_machine=i370-ibm -- os=-mvs - ;; - # I'm not sure what "Sysv32" means. Should this be sysv3.2? -- i[34567]86v32) -+ i*86v32) - basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` - os=-sysv32 - ;; -- i[34567]86v4*) -+ i*86v4*) - basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` - os=-sysv4 - ;; -- i[34567]86v) -+ i*86v) - basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` - os=-sysv - ;; -- i[34567]86sol2) -+ i*86sol2) - basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` - os=-solaris2 - ;; -- i386mach) # EGCS LOCAL -+ i386mach) - basic_machine=i386-mach - os=-mach - ;; -- i386-vsta | vsta) # EGCS LOCAL -+ i386-vsta | vsta) - basic_machine=i386-unknown - os=-vsta - ;; -- i386-go32 | go32) # EGCS LOCAL -- basic_machine=i386-unknown -- os=-go32 -- ;; -- i386-mingw32 | mingw32) -- basic_machine=i386-unknown -- os=-mingw32 -- ;; - iris | iris4d) - basic_machine=mips-sgi - case $os in -@@ -531,16 +619,16 @@ - basic_machine=ns32k-utek - os=-sysv - ;; -+ mingw32) -+ basic_machine=i386-pc -+ os=-mingw32 -+ ;; - miniframe) - basic_machine=m68000-convergent - ;; -- mipsel*-linux*) -- basic_machine=mipsel-unknown -- os=-linux-gnu -- ;; -- mips*-linux*) -- basic_machine=mips-unknown -- os=-linux-gnu -+ *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) -+ basic_machine=m68k-atari -+ os=-mint - ;; - mips3*-*) - basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` -@@ -548,24 +636,36 @@ - mips3*) - basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown - ;; -- monitor) # EGCS LOCAL -+ mmix*) -+ basic_machine=mmix-knuth -+ os=-mmixware -+ ;; -+ monitor) - basic_machine=m68k-rom68k - os=-coff - ;; -- msdos) # EGCS LOCAL -- basic_machine=i386-unknown -+ morphos) -+ basic_machine=powerpc-unknown -+ os=-morphos -+ ;; -+ msdos) -+ basic_machine=i386-pc - os=-msdos - ;; -+ mvs) -+ basic_machine=i370-ibm -+ os=-mvs -+ ;; - ncr3000) - basic_machine=i486-ncr - os=-sysv4 - ;; - netbsd386) -- basic_machine=i386-unknown # EGCS LOCAL -+ basic_machine=i386-unknown - os=-netbsd - ;; - netwinder) -- basic_machine=armv4l-corel -+ basic_machine=armv4l-rebel - os=-linux - ;; - news | news700 | news800 | news900) -@@ -580,7 +680,7 @@ - basic_machine=mips-sony - os=-newsos - ;; -- necv70) # EGCS LOCAL -+ necv70) - basic_machine=v70-nec - os=-sysv - ;; -@@ -609,18 +709,37 @@ - basic_machine=i960-intel - os=-nindy - ;; -- mon960) # EGCS LOCAL -+ mon960) - basic_machine=i960-intel - os=-mon960 - ;; -+ nonstopux) -+ basic_machine=mips-compaq -+ os=-nonstopux -+ ;; - np1) - basic_machine=np1-gould - ;; -- OSE68000 | ose68000) # EGCS LOCAL -+ nv1) -+ basic_machine=nv1-cray -+ os=-unicosmp -+ ;; -+ nsr-tandem) -+ basic_machine=nsr-tandem -+ ;; -+ op50n-* | op60c-*) -+ basic_machine=hppa1.1-oki -+ os=-proelf -+ ;; -+ or32 | or32-*) -+ basic_machine=or32-unknown -+ os=-coff -+ ;; -+ OSE68000 | ose68000) - basic_machine=m68000-ericsson - os=-ose - ;; -- os68k) # EGCS LOCAL -+ os68k) - basic_machine=m68k-none - os=-os68k - ;; -@@ -638,46 +757,60 @@ - pbb) - basic_machine=m68k-tti - ;; -- pc532 | pc532-*) -+ pc532 | pc532-*) - basic_machine=ns32k-pc532 - ;; -- pentium | p5 | k5 | k6 | nexen) -+ pentium | p5 | k5 | k6 | nexgen | viac3) - basic_machine=i586-pc - ;; -- pentiumpro | p6 | 6x86) -+ pentiumpro | p6 | 6x86 | athlon | athlon_*) - basic_machine=i686-pc - ;; - pentiumii | pentium2) -- basic_machine=i786-pc -+ basic_machine=i686-pc - ;; -- pentium-* | p5-* | k5-* | k6-* | nexen-*) -+ pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) - basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; -- pentiumpro-* | p6-* | 6x86-*) -+ pentiumpro-* | p6-* | 6x86-* | athlon-*) - basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - pentiumii-* | pentium2-*) -- basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` -+ basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - pn) - basic_machine=pn-gould - ;; -- power) basic_machine=rs6000-ibm -+ power) basic_machine=power-ibm - ;; - ppc) basic_machine=powerpc-unknown -- ;; -+ ;; - ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - ppcle | powerpclittle | ppc-le | powerpc-little) - basic_machine=powerpcle-unknown -- ;; -+ ;; - ppcle-* | powerpclittle-*) - basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; -+ ppc64) basic_machine=powerpc64-unknown -+ ;; -+ ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` -+ ;; -+ ppc64le | powerpc64little | ppc64-le | powerpc64-little) -+ basic_machine=powerpc64le-unknown -+ ;; -+ ppc64le-* | powerpc64little-*) -+ basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` -+ ;; - ps2) - basic_machine=i386-ibm - ;; -- rom68k) # EGCS LOCAL -+ pw32) -+ basic_machine=i586-unknown -+ os=-pw32 -+ ;; -+ rom68k) - basic_machine=m68k-rom68k - os=-coff - ;; -@@ -687,10 +820,22 @@ - rtpc | rtpc-*) - basic_machine=romp-ibm - ;; -- sa29200) # EGCS LOCAL -+ s390 | s390-*) -+ basic_machine=s390-ibm -+ ;; -+ s390x | s390x-*) -+ basic_machine=s390x-ibm -+ ;; -+ sa29200) - basic_machine=a29k-amd - os=-udi - ;; -+ sb1) -+ basic_machine=mipsisa64sb1-unknown -+ ;; -+ sb1el) -+ basic_machine=mipsisa64sb1el-unknown -+ ;; - sequent) - basic_machine=i386-sequent - ;; -@@ -698,7 +843,7 @@ - basic_machine=sh-hitachi - os=-hms - ;; -- sparclite-wrs) # EGCS LOCAL -+ sparclite-wrs | simso-wrs) - basic_machine=sparclite-wrs - os=-vxworks - ;; -@@ -709,10 +854,10 @@ - spur) - basic_machine=spur-unknown - ;; -- st2000) # EGCS LOCAL -+ st2000) - basic_machine=m68k-tandem - ;; -- stratus) # EGCS LOCAL -+ stratus) - basic_machine=i860-stratus - os=-sysv4 - ;; -@@ -756,16 +901,40 @@ - sun386 | sun386i | roadrunner) - basic_machine=i386-sun - ;; -+ sv1) -+ basic_machine=sv1-cray -+ os=-unicos -+ ;; - symmetry) - basic_machine=i386-sequent - os=-dynix - ;; -+ t3e) -+ basic_machine=alphaev5-cray -+ os=-unicos -+ ;; -+ t90) -+ basic_machine=t90-cray -+ os=-unicos -+ ;; -+ tic4x | c4x*) -+ basic_machine=tic4x-unknown -+ os=-coff -+ ;; -+ tic54x | c54x*) -+ basic_machine=tic54x-unknown -+ os=-coff -+ ;; - tx39) - basic_machine=mipstx39-unknown - ;; - tx39el) - basic_machine=mipstx39el-unknown - ;; -+ toad1) -+ basic_machine=pdp10-xkl -+ os=-tops20 -+ ;; - tower | tower-32) - basic_machine=m68k-ncr - ;; -@@ -777,7 +946,7 @@ - basic_machine=a29k-nyu - os=-sym1 - ;; -- v810 | necv810) # EGCS LOCAL -+ v810 | necv810) - basic_machine=v810-nec - os=-none - ;; -@@ -790,8 +959,8 @@ - os=-vms - ;; - vpp*|vx|vx-*) -- basic_machine=f301-fujitsu -- ;; -+ basic_machine=f301-fujitsu -+ ;; - vxworks960) - basic_machine=i960-wrs - os=-vxworks -@@ -804,18 +973,22 @@ - basic_machine=a29k-wrs - os=-vxworks - ;; -- w65*) # EGCS LOCAL -- basic_machine=w65-wdc -- os=-none -+ w65*) -+ basic_machine=w65-wdc -+ os=-none - ;; -- xmp) -- basic_machine=xmp-cray -- os=-unicos -+ w89k-*) -+ basic_machine=hppa1.1-winbond -+ os=-proelf - ;; -- xps | xps100) -+ xps | xps100) - basic_machine=xps100-honeywell - ;; -- z8k-*-coff) # EGCS LOCAL -+ ymp) -+ basic_machine=ymp-cray -+ os=-unicos -+ ;; -+ z8k-*-coff) - basic_machine=z8k-unknown - os=-sim - ;; -@@ -826,22 +999,15 @@ - - # Here we handle the default manufacturer of certain CPU types. It is in - # some cases the only manufacturer, in others, it is the most popular. -- w89k) # EGCS LOCAL -+ w89k) - basic_machine=hppa1.1-winbond - ;; -- op50n) # EGCS LOCAL -+ op50n) - basic_machine=hppa1.1-oki - ;; -- op60c) # EGCS LOCAL -+ op60c) - basic_machine=hppa1.1-oki - ;; -- mips) -- if [ x$os = x-linux-gnu ]; then -- basic_machine=mips-unknown -- else -- basic_machine=mips-mips -- fi -- ;; - romp) - basic_machine=romp-ibm - ;; -@@ -851,16 +1017,26 @@ - vax) - basic_machine=vax-dec - ;; -+ pdp10) -+ # there are many clones, so DEC is not a safe bet -+ basic_machine=pdp10-unknown -+ ;; - pdp11) - basic_machine=pdp11-dec - ;; - we32k) - basic_machine=we32k-att - ;; -- sparc | sparcv9) -+ sh3 | sh4 | sh[34]eb | sh[1234]le | sh[23]ele) -+ basic_machine=sh-unknown -+ ;; -+ sh64) -+ basic_machine=sh64-unknown -+ ;; -+ sparc | sparcv9 | sparcv9b) - basic_machine=sparc-sun - ;; -- cydra) -+ cydra) - basic_machine=cydra-cydrome - ;; - orion) -@@ -869,16 +1045,15 @@ - orion105) - basic_machine=clipper-highlevel - ;; -- mac | mpw | mac-mpw) # EGCS LOCAL -+ mac | mpw | mac-mpw) - basic_machine=m68k-apple - ;; -- pmac | pmac-mpw) # EGCS LOCAL -+ pmac | pmac-mpw) - basic_machine=powerpc-apple - ;; -- c4x*) -- basic_machine=c4x-none -- os=-coff -- ;; -+ *-unknown) -+ # Make sure to match an already-canonicalized machine name. -+ ;; - *) - echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 - exit 1 -@@ -935,20 +1110,38 @@ - | -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ - | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ - | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ -+ | -chorusos* | -chorusrdb* \ - | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ - | -mingw32* | -linux-gnu* | -uxpv* | -beos* | -mpeix* | -udk* \ -- | -interix* | -uwin* ) -+ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ -+ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ -+ | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ -+ | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ -+ | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ -+ | -powermax* | -dnix* | -microbsd*) - # Remember, each alternative MUST END IN *, to match a version number. - ;; -- # EGCS LOCAL -+ -qnx*) -+ case $basic_machine in -+ x86-* | i*86-*) -+ ;; -+ *) -+ os=-nto$os -+ ;; -+ esac -+ ;; -+ -nto-qnx*) -+ ;; -+ -nto*) -+ os=`echo $os | sed -e 's|nto|nto-qnx|'` -+ ;; - -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ -- | -windows* | -osx | -abug | -netware* | -os9* | -beos* \ -- | -macos* | -mpw* | -magic* | -mon960* | -lnews* ) -+ | -windows* | -osx | -abug | -netware* | -os9* | -beos* \ -+ | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) - ;; - -mac*) - os=`echo $os | sed -e 's|mac|macos|'` - ;; -- # END EGCS LOCAL - -linux*) - os=`echo $os | sed -e 's|linux|linux-gnu|'` - ;; -@@ -958,6 +1151,12 @@ - -sunos6*) - os=`echo $os | sed -e 's|sunos6|solaris3|'` - ;; -+ -opened*) -+ os=-openedition -+ ;; -+ -wince*) -+ os=-wince -+ ;; - -osfrose*) - os=-osfrose - ;; -@@ -973,14 +1172,23 @@ - -acis*) - os=-aos - ;; -- -386bsd) # EGCS LOCAL -+ -atheos*) -+ os=-atheos -+ ;; -+ -386bsd) - os=-bsd - ;; - -ctix* | -uts*) - os=-sysv - ;; -+ -nova*) -+ os=-rtmk-nova -+ ;; - -ns2 ) -- os=-nextstep2 -+ os=-nextstep2 -+ ;; -+ -nsk*) -+ os=-nsk - ;; - # Preserve the version number of sinix5. - -sinix5.*) -@@ -1007,15 +1215,21 @@ - # This must come after -sysvr4. - -sysv*) - ;; -- -ose*) # EGCS LOCAL -+ -ose*) - os=-ose - ;; -- -es1800*) # EGCS LOCAL -+ -es1800*) - os=-ose - ;; - -xenix) - os=-xenix - ;; -+ -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) -+ os=-mint -+ ;; -+ -aros*) -+ os=-aros -+ ;; - -none) - ;; - *) -@@ -1041,13 +1255,17 @@ - *-acorn) - os=-riscix1.2 - ;; -- arm*-corel) -+ arm*-rebel) - os=-linux - ;; - arm*-semi) - os=-aout - ;; -- pdp11-*) -+ # This must come before the *-dec entry. -+ pdp10-*) -+ os=-tops20 -+ ;; -+ pdp11-*) - os=-none - ;; - *-dec | vax-*) -@@ -1065,15 +1283,18 @@ - # default. - # os=-sunos4 - ;; -- m68*-cisco) # EGCS LOCAL -+ m68*-cisco) - os=-aout - ;; -- mips*-cisco) # EGCS LOCAL -+ mips*-cisco) - os=-elf - ;; -- mips*-*) # EGCS LOCAL -- os=-elf -- ;; -+ mips*-*) -+ os=-elf -+ ;; -+ or32-*) -+ os=-coff -+ ;; - *-tti) # must be before sparc entry or we get the wrong os. - os=-sysv3 - ;; -@@ -1086,13 +1307,13 @@ - *-ibm) - os=-aix - ;; -- *-wec) # EGCS LOCAL -+ *-wec) - os=-proelf - ;; -- *-winbond) # EGCS LOCAL -+ *-winbond) - os=-proelf - ;; -- *-oki) # EGCS LOCAL -+ *-oki) - os=-proelf - ;; - *-hp) -@@ -1137,36 +1358,39 @@ - *-next) - os=-nextstep3 - ;; -- *-gould) -+ *-gould) - os=-sysv - ;; -- *-highlevel) -+ *-highlevel) - os=-bsd - ;; - *-encore) - os=-bsd - ;; -- *-sgi) -+ *-sgi) - os=-irix - ;; -- *-siemens) -+ *-siemens) - os=-sysv4 - ;; - *-masscomp) - os=-rtu - ;; -- f301-fujitsu) -+ f30[01]-fujitsu | f700-fujitsu) - os=-uxpv - ;; -- *-rom68k) # EGCS LOCAL -+ *-rom68k) - os=-coff - ;; -- *-*bug) # EGCS LOCAL -+ *-*bug) - os=-coff - ;; -- *-apple) # EGCS LOCAL -+ *-apple) - os=-macos - ;; -+ *-atari*) -+ os=-mint -+ ;; - *) - os=-none - ;; -@@ -1212,27 +1436,41 @@ - -genix*) - vendor=ns - ;; -- -mvs*) -+ -mvs* | -opened*) - vendor=ibm - ;; - -ptx*) - vendor=sequent - ;; -- -vxsim* | -vxworks*) -+ -vxsim* | -vxworks* | -windiss*) - vendor=wrs - ;; - -aux*) - vendor=apple - ;; -- -hms*) # EGCS LOCAL -+ -hms*) - vendor=hitachi - ;; -- -mpw* | -macos*) # EGCS LOCAL -+ -mpw* | -macos*) - vendor=apple - ;; -+ -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) -+ vendor=atari -+ ;; -+ -vos*) -+ vendor=stratus -+ ;; - esac - basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` - ;; - esac - - echo $basic_machine$os -+exit 0 -+ -+# Local variables: -+# eval: (add-hook 'write-file-hooks 'time-stamp) -+# time-stamp-start: "timestamp='" -+# time-stamp-format: "%:y-%02m-%02d" -+# time-stamp-end: "'" -+# End: diff --git a/patches/gcc/2.95.3/deque-leak-fix.patch b/patches/gcc/2.95.3/deque-leak-fix.patch deleted file mode 100644 index 44d2a01..0000000 --- a/patches/gcc/2.95.3/deque-leak-fix.patch +++ /dev/null @@ -1,31 +0,0 @@ -[See also http://gcc.gnu.org/ml/libstdc++/2001-11/msg00133.html ] - -Date: Fri, 16 Nov 2001 16:06:22 -0500 -From: Phil Edwards -To: gcc-patches at gcc dot gnu dot org -Subject: [libstdc++ trunk & 3.0] Fix deque memory leak -Message-ID: <20011116160622.A23094@disaster.jaj.com> - - -As discussed on the libstdc++ mailing list. Tested on i686/linux. - - - -2001-11-16 Paolo Carlini - - * include/bits/stl_deque.h (deque::erase()): Fix memory leak. - - -[rediffed against 2.95.3 -- dank] - ---- gcc-2.95.3/libstdc++/stl/stl_deque.h.old 2001-01-01 09:48:22.000000000 -0800 -+++ gcc-2.95.3/libstdc++/stl/stl_deque.h 2006-02-18 15:24:17.000000000 -0800 -@@ -1052,7 +1052,7 @@ - copy_backward(_M_start, __first, __last); - iterator __new_start = _M_start + __n; - destroy(_M_start, __new_start); -- _M_destroy_nodes(__new_start._M_node, _M_start._M_node); -+ _M_destroy_nodes(_M_start._M_node, __new_start._M_node); /* fixed per http://gcc.gnu.org/ml/libstdc++/2001-11/msg00139.html */ - _M_start = __new_start; - } - else { diff --git a/patches/gcc/2.95.3/gcc-2.95.3-cygwin-020611.patch b/patches/gcc/2.95.3/gcc-2.95.3-cygwin-020611.patch deleted file mode 100644 index fb2b8da..0000000 --- a/patches/gcc/2.95.3/gcc-2.95.3-cygwin-020611.patch +++ /dev/null @@ -1,33 +0,0 @@ -[ Building gcc-2.95.3 on cygwin yields a compiler that sticks a .exe - on the end of every executable, even if they're linux executable. - This is highly annoying, and causes glibc build failures that look like this: - mv: `.../bin/makedb.new' and `.../bin/makedb' are the same file - make[2]: *** [.../bin/makedb] Error 1 - make[2]: Leaving directory `.../gcc-2.95.3-glibc-2.1.3/glibc-2.1.3/db2' - - The mainline solves this with http://gcc.gnu.org/ml/gcc-cvs/2001-04/msg00440.html, - but that doesn't apply cleanly to gcc-2.95.3. - - So, I'm using - http://www.uclinux.org/pub/uClinux/uclinux-elf-tools/tools-20030314/gcc-2.95.3-cygwin-020611.patch - This is the only patch in crosstool that *isn't* suitable for the mainline. - I can live with this patch simply because crosstool does not build - compilers that target cygwin or VAX/VMS. - If that ever changes, I might need to try applying the real patch. -] - - - -# -# This patch can be found at http://www.uclinux.org/pub/uClinux/m68k-elf-tools/ -# ---- gcc-2.95.3/gcc/config/i386/xm-cygwin.h 1999-04-22 16:40:56.000000000 +0200 -+++ gcc-2.95.3-cygwin/gcc/config/i386/xm-cygwin.h 2002-06-11 08:23:18.000000000 +0200 -@@ -19,7 +19,6 @@ - the Free Software Foundation, 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - --#define EXECUTABLE_SUFFIX ".exe" - #define NO_SYS_SIGLIST 1 - - /* We support both "/" and "\" since everybody tests both but we diff --git a/patches/gcc/2.95.3/gcc-2.95.3-trap-posix.patch b/patches/gcc/2.95.3/gcc-2.95.3-trap-posix.patch deleted file mode 100644 index 1d18055..0000000 --- a/patches/gcc/2.95.3/gcc-2.95.3-trap-posix.patch +++ /dev/null @@ -1,44 +0,0 @@ -# -# Submitted-By: Marc Kleine-Budde , 2005-04-20 -# -# Error: -# -# creating libintl.h -# Configuring etc... -# loading cache ../config.cache -# checking for a BSD compatible install... (cached) /usr/bin/install -c -# creating ./config.status -# creating Makefile -# trap: usage: trap [-lp] [[arg] signal_spec ...] -# -# Description: -# -# non-posix conform usage of trap causes bash >= 3.0 to fail -# e.g.: http://sourceware.org/ml/crossgcc/2004-12/msg00132.html -# -# Status: -# -# fixed in gcc >= 3.3.5 -# backport of gcc-3.3.5 fix -# -diff -ruN gcc-2.95.3-orig/configure gcc-2.95.3/configure ---- gcc-2.95.3-orig/configure 1999-04-02 16:17:40.000000000 +0200 -+++ gcc-2.95.3/configure 2005-04-20 18:25:45.030488235 +0200 -@@ -687,7 +687,7 @@ - if test -f skip-this-dir; then - # Perform the same cleanup as the trap handler, minus the "exit 1" of course, - # and reset the trap handler. -- trap 0 -+ trap '' 0 - rm -f Makefile* ${tmpfile}.com ${tmpfile}.tgt ${tmpfile}.hst ${tmpfile}.pos - # Execute the final clean-up actions - ${config_shell} skip-this-dir -@@ -1599,7 +1599,7 @@ - # Perform the same cleanup as the trap handler, minus the "exit 1" of course, - # and reset the trap handler. - rm -f ${tmpfile}.com ${tmpfile}.tgt ${tmpfile}.hst ${tmpfile}.pos --trap 0 -+trap '' 0 - - exit 0 - diff --git a/patches/gcc/2.95.3/gcc-pr3106.patch b/patches/gcc/2.95.3/gcc-pr3106.patch deleted file mode 100644 index 0e077ea..0000000 --- a/patches/gcc/2.95.3/gcc-pr3106.patch +++ /dev/null @@ -1,28 +0,0 @@ -See http://gcc.gnu.org/PR3106 -Backported from gcc-3.0.x - -Fixes error - .../binutils-2.11.2/libiberty/strerror.c:468: error: conflicting types for `sys_nerr' - /usr/include/stdio.h:258: error: previous declaration of `sys_nerr' - make[1]: *** [strerror.o] Error 1 - make: *** [all-libiberty] Error 2 -on Mac OS X. - ---- gcc-2.95.3/libiberty/strerror.c.old 2004-03-24 16:23:19.000000000 -0800 -+++ gcc-2.95.3/libiberty/strerror.c 2004-03-24 16:23:48.000000000 -0800 -@@ -13,6 +13,7 @@ - incompatible with our later declaration, perhaps by using const - attributes. So we hide the declaration in errno.h (if any) using a - macro. */ -+#define sys_nerr sys_nerr__ - #define sys_errlist sys_errlist__ - #endif - -@@ -20,6 +21,7 @@ - #include - - #ifdef HAVE_SYS_ERRLIST -+#undef sys_nerr - #undef sys_errlist - #endif - diff --git a/patches/gcc/2.95.3/threads_snafu.patch b/patches/gcc/2.95.3/threads_snafu.patch deleted file mode 100644 index 2c5297e..0000000 --- a/patches/gcc/2.95.3/threads_snafu.patch +++ /dev/null @@ -1,28 +0,0 @@ -This fixes the error - -In file included from gthr-default.h:1, - from /build/arm-unknown-linux-gnu/gcc-2.95.3-glibc-2.2.2/gcc-2.95.3/gcc/gthr.h:98, - from /build/arm-unknown-linux-gnu/gcc-2.95.3-glibc-2.2.2/gcc-2.95.3/gcc/libgcc2.c:3034: -/build/arm-unknown-linux-gnu/gcc-2.95.3-glibc-2.2.2/gcc-2.95.3/gcc/gthr-posix.h:37: pthread.h: No such file or directory -make[3]: *** [libgcc2.a] Error 1 -make[3]: Leaving directory `/build/arm-unknown-linux-gnu/gcc-2.95.3-glibc-2.2.2/build-gcc-core/gcc' - -in what I think is a nicer way than the patch used by the arm team, -i.e. "perl -pi -e 's/^(TARGET_LIBGCC2_CFLAGS.*)/$1 -Dinhibit_libc -D__gthr_posix_h/' gcc/config/arm/t-linux" -which seems a bit of a kludge. - ---- gcc-2.95.3/gcc/configure.old Fri Mar 16 06:13:48 2001 -+++ gcc-2.95.3/gcc/configure Sun Jun 8 13:02:20 2003 -@@ -853,9 +853,9 @@ - # Check whether --enable-threads or --disable-threads was given. - if test "${enable_threads+set}" = set; then - enableval="$enable_threads" -- if test x$enable_threads = xno; then -- enable_threads='' --fi -+ #if test x$enable_threads = xno; then -+ #enable_threads='' -+ #fi - else - enable_threads='' - fi diff --git a/patches/gcc/3.2.3/100-config.sub.patch b/patches/gcc/3.2.3/100-config.sub.patch new file mode 100644 index 0000000..928f911 --- /dev/null +++ b/patches/gcc/3.2.3/100-config.sub.patch @@ -0,0 +1,72 @@ +When configuring a s390->s390 or cris->cris crosscompiler +(ok, I haven't hit this yet, but one of these days I'll get me an account +on an s390, and then I'll need this patch :-), you'll get the +following error: + ++ /build/s390-unknown-linux-gnu/gcc-3.3-glibc-2.3.2/gcc-3.3/configure +--target=s390-unknown-linux-gnu --host=s390-host_unknown-linux-gnu +--prefix=/result/s390-unknown-linux-gnu/gcc-3.3-glibc-2.3.2 +--enable-languages=c +--with-local-prefix=/result/s390-unknown-linux-gnu/gcc-3.3-glibc-2.3.2/s390- +unknown-linux-gnu --enable-threads=no --without-headers --with-newlib +--disable-shared +... +*** --with-headers is only supported when cross compiling + +This error pops up only when you're using Daniel Jacobowitz's technique +of slightly changing the target and host tuples to make them different +enough to force gcc's build system to not try to pull in system libraries +or headers. This technique is needed e.g. to build an x86 -> x86 +cross-compiler. +(The LFS developers ran into the same bug that prompted me to use +this technique; they point people who run into it to +http://linuxfromscratch.org/~greg/pure_lfs.txt, which is a different +way of avoiding this problem. I think the tuple tweak is the way to go, though.) + +config-patches@gnu.org rejected this patch, on the grounds that there +is only one vendor of each of those two architectures, so the +canonicalization is by definition correct. When I pointed out the +difficulty this causes for people building s390 -> s390 or +cris -> cris compilers that are incompatible with the system +libraries and thus must be built like cross-compilers, he grumped and said +"autoconf should let you specify a cross-compiler in some other way than +comparing tuple strings". + + + +--- gcc-3.3/config.sub.old Sun Jun 8 20:38:47 2003 ++++ gcc-3.3/config.sub Sun Jun 8 20:40:34 2003 +@@ -433,9 +433,12 @@ + crds | unos) + basic_machine=m68k-crds + ;; +- cris | cris-* | etrax*) ++ cris | etrax*) + basic_machine=cris-axis + ;; ++ cris-*) ++ basic_machine=cris-`echo $basic_machine | sed 's/^[^-]*-//'` ++ ;; + da30 | da30-*) + basic_machine=m68k-da30 + ;; +@@ -820,11 +823,17 @@ + rtpc | rtpc-*) + basic_machine=romp-ibm + ;; +- s390 | s390-*) ++ s390) + basic_machine=s390-ibm + ;; +- s390x | s390x-*) ++ s390-*) ++ basic_machine=s390-`echo $basic_machine | sed 's/^[^-]*-//'` ++ ;; ++ s390x) + basic_machine=s390x-ibm ++ ;; ++ s390x-*) ++ basic_machine=s390x-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + sa29200) + basic_machine=a29k-amd diff --git a/patches/gcc/3.2.3/110-gcc-20020722-ppc405erratum77.patch b/patches/gcc/3.2.3/110-gcc-20020722-ppc405erratum77.patch new file mode 100644 index 0000000..bd717f5 --- /dev/null +++ b/patches/gcc/3.2.3/110-gcc-20020722-ppc405erratum77.patch @@ -0,0 +1,105 @@ +# See http://gcc.gnu.org/PR7383, http://www.kegel.com/xgcc3/ppc405erratum77.html +# Fixed in gcc-3.3 + +diff -aur gcc-20020722.orig/gcc/config/rs6000/rs6000.h gcc-20020722/gcc/config/rs6000/rs6000.h +--- gcc-20020722.orig/gcc/config/rs6000/rs6000.h Thu Jul 25 09:32:21 2002 ++++ gcc-20020722/gcc/config/rs6000/rs6000.h Thu Jul 25 09:34:45 2002 +@@ -66,7 +66,7 @@ + %{mcpu=rsc1: -D_ARCH_PWR} \ + %{mcpu=401: -D_ARCH_PPC} \ + %{mcpu=403: -D_ARCH_PPC} \ +-%{mcpu=405: -D_ARCH_PPC} \ ++%{mcpu=405: -D_ARCH_PPC -D__PPC405__} \ + %{mcpu=505: -D_ARCH_PPC} \ + %{mcpu=601: -D_ARCH_PPC -D_ARCH_PWR} \ + %{mcpu=602: -D_ARCH_PPC} \ +diff -aur gcc-20020722.orig/libjava/sysdep/powerpc/locks.h gcc-20020722/libjava/sysdep/powerpc/locks.h +--- gcc-20020722.orig/libjava/sysdep/powerpc/locks.h Thu Jul 25 09:32:30 2002 ++++ gcc-20020722/libjava/sysdep/powerpc/locks.h Thu Jul 25 11:39:13 2002 +@@ -11,6 +11,17 @@ + #ifndef __SYSDEP_LOCKS_H__ + #define __SYSDEP_LOCKS_H__ + ++#ifdef __PPC405__ ++// workaround for PPC405 erratum #77 - 07/18/02 JRO, dank, NN. References: ++// http://www-3.ibm.com/chips/techlib/techlib.nsf/techdocs/89DED00DEBFF54BF87256A8000491BA2/$file/405CR_C_errata_1_2.pdf ++// http://ppc.bkbits.net:8080/linuxppc_2_4_devel/cset@1.489 ++// http://www.kegel.com/xgcc3/ppc405erratum77.html ++// FIXME: using dbct instead of sync would be faster ++#define __LIBGCJ_PPC405_ERR77_SYNC "sync \n\t" ++#else ++#define __LIBGCJ_PPC405_ERR77_SYNC ++#endif ++ + typedef size_t obj_addr_t; /* Integer type big enough for object */ + /* address. */ + +@@ -25,6 +36,7 @@ + "0: lwarx %0,0,%1 ;" + " xor. %0,%3,%0;" + " bne 1f;" ++ __LIBGCJ_PPC405_ERR77_SYNC + " stwcx. %2,0,%1;" + " bne- 0b;" + "1: " +@@ -58,6 +70,7 @@ + "0: lwarx %0,0,%1 ;" + " xor. %0,%3,%0;" + " bne 1f;" ++ __LIBGCJ_PPC405_ERR77_SYNC + " stwcx. %2,0,%1;" + " bne- 0b;" + "1: " +diff -aur gcc-20020722.orig/libstdc++-v3/config/cpu/powerpc/bits/atomicity.h gcc-20020722/libstdc++-v3/config/cpu/powerpc/bits/atomicity.h +--- gcc-20020722.orig/libstdc++-v3/config/cpu/powerpc/bits/atomicity.h Thu Jul 25 09:32:31 2002 ++++ gcc-20020722/libstdc++-v3/config/cpu/powerpc/bits/atomicity.h Thu Jul 25 09:34:45 2002 +@@ -32,6 +32,17 @@ + + typedef int _Atomic_word; + ++#ifdef __PPC405__ ++// workaround for PPC405 erratum #77 - 07/18/02 JRO & dank. References: ++// http://www-3.ibm.com/chips/techlib/techlib.nsf/techdocs/89DED00DEBFF54BF87256A8000491BA2/$file/405CR_C_errata_1_2.pdf ++// http://ppc.bkbits.net:8080/linuxppc_2_4_devel/cset@1.489 ++// http://www.kegel.com/xgcc3/ppc405erratum77.html ++// FIXME: using dbct instead of sync would be faster ++#define __LIBSTDCPP_PPC405_ERR77_SYNC "sync \n\t" ++#else ++#define __LIBSTDCPP_PPC405_ERR77_SYNC ++#endif ++ + static inline _Atomic_word + __attribute__ ((__unused__)) + __exchange_and_add (volatile _Atomic_word* __mem, int __val) +@@ -42,6 +53,7 @@ + "0:\t" + "lwarx %0,0,%2 \n\t" + "add%I3 %1,%0,%3 \n\t" ++ __LIBSTDCPP_PPC405_ERR77_SYNC + "stwcx. %1,0,%2 \n\t" + "bne- 0b \n\t" + "/* End exchange & add */" +@@ -61,6 +73,7 @@ + "0:\t" + "lwarx %0,0,%1 \n\t" + "add%I2 %0,%0,%2 \n\t" ++ __LIBSTDCPP_PPC405_ERR77_SYNC + "stwcx. %0,0,%1 \n\t" + "bne- 0b \n\t" + "/* End atomic add */" +@@ -78,6 +91,7 @@ + "/* Inline always swap */\n" + "0:\t" + "lwarx %0,0,%1 \n\t" ++ __LIBSTDCPP_PPC405_ERR77_SYNC + "stwcx. %2,0,%1 \n\t" + "bne- 0b \n\t" + "/* End always swap */" +@@ -98,6 +112,7 @@ + "lwarx %0,0,%1 \n\t" + "cmpwi %0,0 \n\t" + "bne- 1f \n\t" ++ __LIBSTDCPP_PPC405_ERR77_SYNC + "stwcx. %2,0,%1 \n\t" + "bne- 0b \n" + "1:\n\t" diff --git a/patches/gcc/3.2.3/120-gcc-20030210-sh-linux-1.patch b/patches/gcc/3.2.3/120-gcc-20030210-sh-linux-1.patch new file mode 100644 index 0000000..4393078 --- /dev/null +++ b/patches/gcc/3.2.3/120-gcc-20030210-sh-linux-1.patch @@ -0,0 +1,1761 @@ +diff -ruN gcc-20030210.orig/boehm-gc/configure gcc-20030210/boehm-gc/configure +--- gcc-20030210.orig/boehm-gc/configure Fri Jan 31 19:17:00 2003 ++++ gcc-20030210/boehm-gc/configure Sat Feb 22 01:40:14 2003 +@@ -1922,7 +1922,7 @@ + # This must be Linux ELF. + linux-gnu*) + case $host_cpu in +- alpha* | hppa* | i*86 | powerpc* | sparc* | ia64* ) ++ alpha* | hppa* | i*86 | powerpc* | sparc* | ia64* | sh* ) + lt_cv_deplibs_check_method=pass_all ;; + *) + # glibc up to 2.1.1 does not perform some relocations on ARM +diff -ruN gcc-20030210.orig/config-ml.in gcc-20030210/config-ml.in +--- gcc-20030210.orig/config-ml.in Fri Jan 31 19:16:59 2003 ++++ gcc-20030210/config-ml.in Sat Feb 22 01:40:14 2003 +@@ -545,6 +545,7 @@ + if [ -d ../$${dir}/$${lib} ]; then \ + flags=`echo $$i | sed -e 's/^[^;]*;//' -e 's/@/ -/g'`; \ + if (cd ../$${dir}/$${lib}; $(MAKE) $(FLAGS_TO_PASS) \ ++ DESTDIR="$(DESTDIR)" \ + CFLAGS="$(CFLAGS) $${flags}" \ + prefix="$(prefix)" \ + exec_prefix="$(exec_prefix)" \ +diff -ruN gcc-20030210.orig/debian/edit-specs.in gcc-20030210/debian/edit-specs.in +--- gcc-20030210.orig/debian/edit-specs.in Thu Jan 1 09:00:00 1970 ++++ gcc-20030210/debian/edit-specs.in Sat Feb 22 01:40:14 2003 +@@ -0,0 +1,45 @@ ++/^*asm:$/ { ++n ++c\ ++@AS_ENDIAN_FLAG@ %{mrelax:-relax} ++} ++/^*cpp:$/ { ++n ++c\ ++%(cpp_default_cpu_spec) %(subtarget_cpp_spec) %(subtarget_cpp_ptr_spec) %(subtarget_cpp_endian_spec) ++} ++/^*cc1:$/ { ++n ++c\ ++-musermode @CC1_CPU_ENDIAN_FLAGS@ %{profile:-p} ++} ++/^*link:$/ { ++n ++c\ ++%{!static:--eh-frame-hdr} @LINKER_CPU_ENDIAN_FLAGS@ @LINKER_RPATH_LINK_FLAG@ %{mrelax:-relax} %{shared:-shared} %{!static: %{rdynamic:-export-dynamic} %{!dynamic-linker:-dynamic-linker /lib/ld-linux.so.2}} %{static:-static} ++} ++/^*multilib:$/ { ++n ++c\ ++. ; ++} ++/^*multilib_matches:$/ { ++n ++c\ ++ ++} ++/^*multilib_options:$/ { ++n ++c\ ++ ++} ++/^*subtarget_cpp_endian_spec:$/ { ++n ++c\ ++@CPP_ENDIAN_DEF@ ++} ++/^*cpp_default_cpu_spec:$/ { ++n ++c\ ++@CPP_CPU_DEFS@ ++} +diff -ruN gcc-20030210.orig/debian/install-CPU-linux gcc-20030210/debian/install-CPU-linux +--- gcc-20030210.orig/debian/install-CPU-linux Thu Jan 1 09:00:00 1970 ++++ gcc-20030210/debian/install-CPU-linux Sat Feb 22 01:40:14 2003 +@@ -0,0 +1,111 @@ ++#! /bin/sh ++ ++VERSION=$1; shift ++CPU=$1 ++ ++# literally (binary-ly) same ++PROGS_C="cpp gcc" ++PROGS_ADDITIONAL="c++ g++ g77 gcj" ++ ++DRIVERS_C="cc1 cpp0 tradcpp0" ++DRIVERS_ADDITIONAL="cc1obj cc1plus collect2 f771 jc1 jvgenmain" ++if [ -z "$STEP1_COMPILER_BUILD" ]; then ++ PROGS="$PROGS_C $PROGS_ADDITIONAL" ++ DRIVERS="$DRIVERS_C $DRIVERSADDITIONAL" ++ INITIAL="" ++else ++ PROGS=$PROGS_C ++ DRIVERS=$DRIVERS_C ++ INITIAL="-initial" ++fi ++ ++OBJS="crtbegin.o crtbeginS.o crtend.o crtendS.o" ++LIBS_C="libgcc.a" ++LIBS_1="libgcc_s.so libgcc_s.so.1 libstdc++.so libstdc++.so.3 libstdc++.so.3.0.2" ++LIBS_2="libobjc.a libstdc++.a libsupc++.a" ++INCLUDE="include" ++ ++cd debian/gcc-sh-linux-others${INITIAL} || exit 1 ++ ++# Make directories. ++mkdir -p usr/bin usr/share usr/share/man usr/share/man/man1 usr/lib \ ++ usr/lib/gcc-lib usr/lib/gcc-lib/${CPU}-linux \ ++ usr/lib/gcc-lib/${CPU}-linux/${VERSION} \ ++ usr/${CPU}-linux usr/${CPU}-linux/lib ++ ++# Make symbolic links for include dir. ++(cd usr/${CPU}-linux; ln -s ../sh-linux/include .) ++ ++# Make symbolic links for executables. ++(cd usr/bin; ++ for p in ${PROGS}; do ++ ln -s shCPU-linux-GCC ${CPU}-linux-$p ++ done) ++ ++case "${CPU}" in ++ sh3) ++ MULTILIBDIR= ++ AS_ENDIAN_FLAG="-little" ++ CPP_ENDIAN_DEF="-D__LITTLE_ENDIAN__" ++ CPP_CPU_DEFS="-D__SH3__ -D__sh3__" ++ CC1_CPU_ENDIAN_FLAGS="-ml -m3" ++ LINKER_CPU_ENDIAN_FLAGS="-m shlelf_linux -EL --architecture sh3" ++ LINKER_RPATH_LINK_FLAG="-rpath-link /usr/sh3-linux/lib" ++ ;; ++ sh3eb) ++ MULTILIBDIR=/mb ++ AS_ENDIAN_FLAG="-big" ++ CPP_ENDIAN_DEF="-D__BIG_ENDIAN__" ++ CPP_CPU_DEFS="-D__SH3__ -D__sh3__" ++ CC1_CPU_ENDIAN_FLAGS="-mb -m3" ++ LINKER_CPU_ENDIAN_FLAGS="-m shelf_linux -EB --architecture sh3" ++ LINKER_RPATH_LINK_FLAG="-rpath-link /usr/sh3eb-linux/lib" ++ ;; ++ sh4) ++ MULTILIBDIR=/m4 ++ AS_ENDIAN_FLAG="-little" ++ CPP_ENDIAN_DEF="-D__LITTLE_ENDIAN__" ++ CPP_CPU_DEFS="-D__SH4__" ++ CC1_CPU_ENDIAN_FLAGS="-ml -m4" ++ LINKER_CPU_ENDIAN_FLAGS="-m shlelf_linux -EL --architecture sh4" ++ LINKER_RPATH_LINK_FLAG="-rpath-link /usr/sh4-linux/lib" ++ ;; ++ sh4eb) ++ MULTILIBDIR=/mb/m4 ++ AS_ENDIAN_FLAG="-big" ++ CPP_ENDIAN_DEF="-D__BIG_ENDIAN__" ++ CPP_CPU_DEFS="-D__SH4__" ++ CC1_CPU_ENDIAN_FLAGS="-mb -m4" ++ LINKER_CPU_ENDIAN_FLAGS="-m shelf_linux -EB --architecture sh4" ++ LINKER_RPATH_LINK_FLAG="-rpath-link /usr/sh4eb-linux/lib" ++ ;; ++esac ++ ++# Make symbolic links for GCC drivers, objects, libraries, and include dir. ++(cd usr/lib/gcc-lib/${CPU}-linux/${VERSION}; ++ for f in ${DRIVERS} ${INCLUDE}; do ++ ln -s ../../sh-linux/${VERSION}/$f $f; ++ done ++ for f in ${OBJS} ${LIBS_C}; do ++ ln -s ../../sh-linux/${VERSION}${MULTILIBDIR}/$f $f; ++ done) ++ ++if [ -z "$STEP1_COMPILER_BUILD" ]; then ++ for f in ${LIBS_1} ${LIBS_2}; do ++ mv ../gcc-sh-linux/usr/sh-linux/lib${MULTILIBDIR}/$f usr/${CPU}-linux/lib/; ++ done ++fi ++ ++sed -e "s+@AS_ENDIAN_FLAG@+${AS_ENDIAN_FLAG}+" \ ++ -e "s+@CPP_ENDIAN_DEF@+${CPP_ENDIAN_DEF}+" \ ++ -e "s+@CPP_CPU_DEFS@+${CPP_CPU_DEFS}+" \ ++ -e "s+@CC1_CPU_ENDIAN_FLAGS@+${CC1_CPU_ENDIAN_FLAGS}+" \ ++ -e "s+@LINKER_CPU_ENDIAN_FLAGS@+${LINKER_CPU_ENDIAN_FLAGS}+" \ ++ -e "s+@LINKER_RPATH_LINK_FLAG@+${LINKER_RPATH_LINK_FLAG}+" \ ++ ../edit-specs.in >../edit-specs-${CPU}.sed ++ ++sed -f ../edit-specs-${CPU}.sed \ ++ ../gcc-sh-linux${INITIAL}/usr/lib/gcc-lib/sh-linux/${VERSION}/specs \ ++ > usr/lib/gcc-lib/${CPU}-linux/${VERSION}/specs ++ ++exit 0 +diff -ruN gcc-20030210.orig/debian/multilib-symlink gcc-20030210/debian/multilib-symlink +--- gcc-20030210.orig/debian/multilib-symlink Thu Jan 1 09:00:00 1970 ++++ gcc-20030210/debian/multilib-symlink Sat Feb 22 01:40:14 2003 +@@ -0,0 +1,10 @@ ++#! /bin/sh ++ ++cd /usr/sh-linux/lib ++ln -s ../../sh3-linux/lib/{*.a,*.so*,*.o} . ++cd m4 ++ln -s ../../../sh4-linux/lib/{*.a,*.so*,*.o} . ++cd ../mb ++ln -s ../../../sh3eb-linux/lib/{*.a,*.so*,*.o} . ++cd m4 ++ln -s ../../../../sh4eb-linux/lib/{*.a,*.so*,*.o} . +diff -ruN gcc-20030210.orig/debian/shCPU-linux-GCC gcc-20030210/debian/shCPU-linux-GCC +--- gcc-20030210.orig/debian/shCPU-linux-GCC Thu Jan 1 09:00:00 1970 ++++ gcc-20030210/debian/shCPU-linux-GCC Sat Feb 22 01:40:14 2003 +@@ -0,0 +1,59 @@ ++#! /bin/bash ++ ++BASENAME=${0##*/} ++PROG=${BASENAME##*-} ++CPU=${BASENAME%%-*} ++ ++if [ "$PROG" = gcc ]; then ++ if [ "$1" = "-b" -a "$2" = "i386-linux" ]; then ++ shift 2 ++ exec /usr/bin/gcc "$@" ++ elif [ "$1" = "-print-multi-lib" -o "$1" = "--print-multi-lib" ]; then ++ echo ".;" ++ exit 0 ++ elif [ "$1" = "-print-multi-os-directory" -o "$1" = "--print-multi-os-directory" ]; then ++ echo "." ++ exit 0 ++ elif [ "$1" = "-dumpspecs" ]; then ++ cat /usr/lib/gcc-lib/${CPU}-linux/@@VERSION@@/specs ++ exit 0 ++ fi ++fi ++ ++case "${CPU}" in ++ sh3) ++ ARCH=m3 ++ DEFINES="-D__sh3__ -D__SH3__ -D__LITTLE_ENDIAN__" ++ ENDIAN=ml ++ ;; ++ sh3eb) ++ ARCH=m3 ++ DEFINES="-D__sh3__ -D__SH3__ -D__BIG_ENDIAN__" ++ ENDIAN=mb ++ ;; ++ sh4) ++ ARCH=m4 ++ DEFINES="-D__SH4__ -D__LITTLE_ENDIAN__" ++ ENDIAN=ml ++ ;; ++ sh4eb) ++ ARCH=m4 ++ DEFINES="-D__SH4__ -D__BIG_ENDIAN__" ++ ENDIAN=mb ++ ;; ++esac ++ ++# Prepend the appropriate options ++# If user specifies some options, it will be overridden ++ ++case "${PROG}" in ++ cpp) ++ exec sh-linux-${PROG} $DEFINES "$@" ++ ;; ++ c++|g++|g77|gcc|gcj) ++ exec sh-linux-${PROG} -$ARCH -$ENDIAN "$@" ++ ;; ++esac ++ ++echo "Something wrong..." ++exit 1 +diff -ruN gcc-20030210.orig/gcc/config/sh/elf.h gcc-20030210/gcc/config/sh/elf.h +--- gcc-20030210.orig/gcc/config/sh/elf.h Fri Feb 22 01:42:28 2002 ++++ gcc-20030210/gcc/config/sh/elf.h Sat Feb 22 01:40:14 2003 +@@ -170,3 +170,7 @@ + #undef ENDFILE_SPEC + #define ENDFILE_SPEC \ + "%{!shared:crtend.o%s} %{shared:crtendS.o%s} crtn.o%s" ++ ++/* ASM_OUTPUT_CASE_LABEL is defined in elfos.h. With it, ++ redundant .align will be generated. */ ++#undef ASM_OUTPUT_CASE_LABEL +diff -ruN gcc-20030210.orig/gcc/config/sh/lib1funcs.asm gcc-20030210/gcc/config/sh/lib1funcs.asm +--- gcc-20030210.orig/gcc/config/sh/lib1funcs.asm Fri Feb 22 01:42:28 2002 ++++ gcc-20030210/gcc/config/sh/lib1funcs.asm Sat Feb 22 01:40:14 2003 +@@ -39,8 +39,13 @@ + + #ifdef __ELF__ + #define LOCAL(X) .L_##X ++#define FUNC(X) .type X,@function; .hidden X ++#define _ENDFUNC(X) .Lfe_##X: .size X,.Lfe_##X-X ++#define ENDFUNC(X) _ENDFUNC(X) + #else + #define LOCAL(X) L_##X ++#define FUNC(X) ++#define ENDFUNC(X) + #endif + + #ifdef __linux__ +@@ -91,6 +96,40 @@ + .global GLOBAL(ashiftrt_r4_31) + .global GLOBAL(ashiftrt_r4_32) + ++ FUNC(GLOBAL(ashiftrt_r4_0)) ++ FUNC(GLOBAL(ashiftrt_r4_1)) ++ FUNC(GLOBAL(ashiftrt_r4_2)) ++ FUNC(GLOBAL(ashiftrt_r4_3)) ++ FUNC(GLOBAL(ashiftrt_r4_4)) ++ FUNC(GLOBAL(ashiftrt_r4_5)) ++ FUNC(GLOBAL(ashiftrt_r4_6)) ++ FUNC(GLOBAL(ashiftrt_r4_7)) ++ FUNC(GLOBAL(ashiftrt_r4_8)) ++ FUNC(GLOBAL(ashiftrt_r4_9)) ++ FUNC(GLOBAL(ashiftrt_r4_10)) ++ FUNC(GLOBAL(ashiftrt_r4_11)) ++ FUNC(GLOBAL(ashiftrt_r4_12)) ++ FUNC(GLOBAL(ashiftrt_r4_13)) ++ FUNC(GLOBAL(ashiftrt_r4_14)) ++ FUNC(GLOBAL(ashiftrt_r4_15)) ++ FUNC(GLOBAL(ashiftrt_r4_16)) ++ FUNC(GLOBAL(ashiftrt_r4_17)) ++ FUNC(GLOBAL(ashiftrt_r4_18)) ++ FUNC(GLOBAL(ashiftrt_r4_19)) ++ FUNC(GLOBAL(ashiftrt_r4_20)) ++ FUNC(GLOBAL(ashiftrt_r4_21)) ++ FUNC(GLOBAL(ashiftrt_r4_22)) ++ FUNC(GLOBAL(ashiftrt_r4_23)) ++ FUNC(GLOBAL(ashiftrt_r4_24)) ++ FUNC(GLOBAL(ashiftrt_r4_25)) ++ FUNC(GLOBAL(ashiftrt_r4_26)) ++ FUNC(GLOBAL(ashiftrt_r4_27)) ++ FUNC(GLOBAL(ashiftrt_r4_28)) ++ FUNC(GLOBAL(ashiftrt_r4_29)) ++ FUNC(GLOBAL(ashiftrt_r4_30)) ++ FUNC(GLOBAL(ashiftrt_r4_31)) ++ FUNC(GLOBAL(ashiftrt_r4_32)) ++ + .align 1 + GLOBAL(ashiftrt_r4_32): + GLOBAL(ashiftrt_r4_31): +@@ -170,6 +209,41 @@ + GLOBAL(ashiftrt_r4_0): + rts + nop ++ ++ ENDFUNC(GLOBAL(ashiftrt_r4_0)) ++ ENDFUNC(GLOBAL(ashiftrt_r4_1)) ++ ENDFUNC(GLOBAL(ashiftrt_r4_2)) ++ ENDFUNC(GLOBAL(ashiftrt_r4_3)) ++ ENDFUNC(GLOBAL(ashiftrt_r4_4)) ++ ENDFUNC(GLOBAL(ashiftrt_r4_5)) ++ ENDFUNC(GLOBAL(ashiftrt_r4_6)) ++ ENDFUNC(GLOBAL(ashiftrt_r4_7)) ++ ENDFUNC(GLOBAL(ashiftrt_r4_8)) ++ ENDFUNC(GLOBAL(ashiftrt_r4_9)) ++ ENDFUNC(GLOBAL(ashiftrt_r4_10)) ++ ENDFUNC(GLOBAL(ashiftrt_r4_11)) ++ ENDFUNC(GLOBAL(ashiftrt_r4_12)) ++ ENDFUNC(GLOBAL(ashiftrt_r4_13)) ++ ENDFUNC(GLOBAL(ashiftrt_r4_14)) ++ ENDFUNC(GLOBAL(ashiftrt_r4_15)) ++ ENDFUNC(GLOBAL(ashiftrt_r4_16)) ++ ENDFUNC(GLOBAL(ashiftrt_r4_17)) ++ ENDFUNC(GLOBAL(ashiftrt_r4_18)) ++ ENDFUNC(GLOBAL(ashiftrt_r4_19)) ++ ENDFUNC(GLOBAL(ashiftrt_r4_20)) ++ ENDFUNC(GLOBAL(ashiftrt_r4_21)) ++ ENDFUNC(GLOBAL(ashiftrt_r4_22)) ++ ENDFUNC(GLOBAL(ashiftrt_r4_23)) ++ ENDFUNC(GLOBAL(ashiftrt_r4_24)) ++ ENDFUNC(GLOBAL(ashiftrt_r4_25)) ++ ENDFUNC(GLOBAL(ashiftrt_r4_26)) ++ ENDFUNC(GLOBAL(ashiftrt_r4_27)) ++ ENDFUNC(GLOBAL(ashiftrt_r4_28)) ++ ENDFUNC(GLOBAL(ashiftrt_r4_29)) ++ ENDFUNC(GLOBAL(ashiftrt_r4_30)) ++ ENDFUNC(GLOBAL(ashiftrt_r4_31)) ++ ENDFUNC(GLOBAL(ashiftrt_r4_32)) ++ + #endif + + #ifdef L_ashiftrt_n +@@ -192,6 +266,7 @@ + ! + + .global GLOBAL(ashrsi3) ++ FUNC(GLOBAL(ashrsi3)) + .align 2 + GLOBAL(ashrsi3): + mov #31,r0 +@@ -319,6 +394,8 @@ + rts + nop + ++ ENDFUNC(GLOBAL(ashrsi3)) ++ + #endif + + #ifdef L_ashiftlt +@@ -340,6 +417,7 @@ + ! (none) + ! + .global GLOBAL(ashlsi3) ++ FUNC(GLOBAL(ashlsi3)) + .align 2 + GLOBAL(ashlsi3): + mov #31,r0 +@@ -476,6 +554,8 @@ + rts + nop + ++ ENDFUNC(GLOBAL(ashlsi3)) ++ + #endif + + #ifdef L_lshiftrt +@@ -497,6 +577,7 @@ + ! (none) + ! + .global GLOBAL(lshrsi3) ++ FUNC(GLOBAL(lshrsi3)) + .align 2 + GLOBAL(lshrsi3): + mov #31,r0 +@@ -633,6 +714,8 @@ + rts + nop + ++ ENDFUNC(GLOBAL(lshrsi3)) ++ + #endif + + #ifdef L_movstr +@@ -649,76 +732,113 @@ + add #64,r4 + .align 4 + .global GLOBAL(movstrSI64) ++ FUNC(GLOBAL(movstrSI64)) + GLOBAL(movstrSI64): + mov.l @(60,r5),r0 + mov.l r0,@(60,r4) + .global GLOBAL(movstrSI60) ++ FUNC(GLOBAL(movstrSI60)) + GLOBAL(movstrSI60): + mov.l @(56,r5),r0 + mov.l r0,@(56,r4) + .global GLOBAL(movstrSI56) ++ FUNC(GLOBAL(movstrSI56)) + GLOBAL(movstrSI56): + mov.l @(52,r5),r0 + mov.l r0,@(52,r4) + .global GLOBAL(movstrSI52) ++ FUNC(GLOBAL(movstrSI52)) + GLOBAL(movstrSI52): + mov.l @(48,r5),r0 + mov.l r0,@(48,r4) + .global GLOBAL(movstrSI48) ++ FUNC(GLOBAL(movstrSI48)) + GLOBAL(movstrSI48): + mov.l @(44,r5),r0 + mov.l r0,@(44,r4) + .global GLOBAL(movstrSI44) ++ FUNC(GLOBAL(movstrSI44)) + GLOBAL(movstrSI44): + mov.l @(40,r5),r0 + mov.l r0,@(40,r4) + .global GLOBAL(movstrSI40) ++ FUNC(GLOBAL(movstrSI40)) + GLOBAL(movstrSI40): + mov.l @(36,r5),r0 + mov.l r0,@(36,r4) + .global GLOBAL(movstrSI36) ++ FUNC(GLOBAL(movstrSI36)) + GLOBAL(movstrSI36): + mov.l @(32,r5),r0 + mov.l r0,@(32,r4) + .global GLOBAL(movstrSI32) ++ FUNC(GLOBAL(movstrSI32)) + GLOBAL(movstrSI32): + mov.l @(28,r5),r0 + mov.l r0,@(28,r4) + .global GLOBAL(movstrSI28) ++ FUNC(GLOBAL(movstrSI28)) + GLOBAL(movstrSI28): + mov.l @(24,r5),r0 + mov.l r0,@(24,r4) + .global GLOBAL(movstrSI24) ++ FUNC(GLOBAL(movstrSI24)) + GLOBAL(movstrSI24): + mov.l @(20,r5),r0 + mov.l r0,@(20,r4) + .global GLOBAL(movstrSI20) ++ FUNC(GLOBAL(movstrSI20)) + GLOBAL(movstrSI20): + mov.l @(16,r5),r0 + mov.l r0,@(16,r4) + .global GLOBAL(movstrSI16) ++ FUNC(GLOBAL(movstrSI16)) + GLOBAL(movstrSI16): + mov.l @(12,r5),r0 + mov.l r0,@(12,r4) + .global GLOBAL(movstrSI12) ++ FUNC(GLOBAL(movstrSI12)) + GLOBAL(movstrSI12): + mov.l @(8,r5),r0 + mov.l r0,@(8,r4) + .global GLOBAL(movstrSI8) ++ FUNC(GLOBAL(movstrSI8)) + GLOBAL(movstrSI8): + mov.l @(4,r5),r0 + mov.l r0,@(4,r4) + .global GLOBAL(movstrSI4) ++ FUNC(GLOBAL(movstrSI4)) + GLOBAL(movstrSI4): + mov.l @(0,r5),r0 + mov.l r0,@(0,r4) ++ .global GLOBAL(movstrSI0) ++ FUNC(GLOBAL(movstrSI0)) + GLOBAL(movstrSI0): + rts + nop + ++ ENDFUNC(GLOBAL(movstrSI64)) ++ ENDFUNC(GLOBAL(movstrSI60)) ++ ENDFUNC(GLOBAL(movstrSI56)) ++ ENDFUNC(GLOBAL(movstrSI52)) ++ ENDFUNC(GLOBAL(movstrSI48)) ++ ENDFUNC(GLOBAL(movstrSI44)) ++ ENDFUNC(GLOBAL(movstrSI40)) ++ ENDFUNC(GLOBAL(movstrSI36)) ++ ENDFUNC(GLOBAL(movstrSI32)) ++ ENDFUNC(GLOBAL(movstrSI28)) ++ ENDFUNC(GLOBAL(movstrSI24)) ++ ENDFUNC(GLOBAL(movstrSI20)) ++ ENDFUNC(GLOBAL(movstrSI16)) ++ ENDFUNC(GLOBAL(movstrSI12)) ++ ENDFUNC(GLOBAL(movstrSI8)) ++ ENDFUNC(GLOBAL(movstrSI4)) ++ ENDFUNC(GLOBAL(movstrSI0)) ++ + .align 4 + + .global GLOBAL(movstr) ++ FUNC(GLOBAL(movstr)) + GLOBAL(movstr): + mov.l @(60,r5),r0 + mov.l r0,@(60,r4) +@@ -775,6 +895,8 @@ + add #64,r5 + bra GLOBAL(movstr) + add #64,r4 ++ ++ FUNC(GLOBAL(movstr)) + #endif + + #ifdef L_movstr_i4 +@@ -783,6 +905,10 @@ + .global GLOBAL(movstr_i4_odd) + .global GLOBAL(movstrSI12_i4) + ++ FUNC(GLOBAL(movstr_i4_even)) ++ FUNC(GLOBAL(movstr_i4_odd)) ++ FUNC(GLOBAL(movstrSI12_i4)) ++ + .p2align 5 + L_movstr_2mod4_end: + mov.l r0,@(16,r4) +@@ -791,6 +917,11 @@ + + .p2align 2 + ++GLOBAL(movstr_i4_even): ++ mov.l @r5+,r0 ++ bra L_movstr_start_even ++ mov.l @r5+,r1 ++ + GLOBAL(movstr_i4_odd): + mov.l @r5+,r1 + add #-4,r4 +@@ -817,10 +948,8 @@ + rts + mov.l r3,@(12,r4) + +-GLOBAL(movstr_i4_even): +- mov.l @r5+,r0 +- bra L_movstr_start_even +- mov.l @r5+,r1 ++ ENDFUNC(GLOBAL(movstr_i4_even)) ++ ENDFUNC(GLOBAL(movstr_i4_odd)) + + .p2align 4 + GLOBAL(movstrSI12_i4): +@@ -831,12 +960,16 @@ + mov.l r1,@(4,r4) + rts + mov.l r2,@(8,r4) ++ ++ ENDFUNC(GLOBAL(movstrSI12_i4)) ++ + #endif + + #ifdef L_mulsi3 + + + .global GLOBAL(mulsi3) ++ FUNC(GLOBAL(mulsi3)) + + ! r4 = aabb + ! r5 = ccdd +@@ -869,7 +1002,7 @@ + rts + add r2,r0 + +- ++ FUNC(GLOBAL(mulsi3)) + #endif + #endif /* ! __SH5__ */ + #ifdef L_sdivsi3_i4 +@@ -879,6 +1012,7 @@ + !! args in r4 and r5, result in fpul, clobber dr0, dr2 + + .global GLOBAL(sdivsi3_i4) ++ FUNC(GLOBAL(sdivsi3_i4)) + GLOBAL(sdivsi3_i4): + lds r4,fpul + float fpul,dr0 +@@ -888,6 +1022,8 @@ + rts + ftrc dr0,fpul + ++ ENDFUNC(GLOBAL(sdivsi3_i4)) ++ + #elif defined(__SH4_SINGLE__) || defined(__SH4_SINGLE_ONLY__) || (defined (__SH5__) && ! defined __SH4_NOFPU__) + !! args in r4 and r5, result in fpul, clobber r2, dr0, dr2 + +@@ -896,6 +1032,7 @@ + .mode SHcompact + #endif + .global GLOBAL(sdivsi3_i4) ++ FUNC(GLOBAL(sdivsi3_i4)) + GLOBAL(sdivsi3_i4): + sts.l fpscr,@-r15 + mov #8,r2 +@@ -910,6 +1047,8 @@ + rts + lds.l @r15+,fpscr + ++ ENDFUNC(GLOBAL(sdivsi3_i4)) ++ + #endif /* ! __SH5__ || __SH5__ == 32 */ + #endif /* ! __SH4__ */ + #endif +@@ -924,9 +1063,10 @@ + !! + !! + +-!! args in r4 and r5, result in r0 clobber r1,r2,r3 ++!! args in r4 and r5, result in r0 clobber r1, r2, r3, and t bit + + .global GLOBAL(sdivsi3) ++ FUNC(GLOBAL(sdivsi3)) + #if __SHMEDIA__ + #if __SH5__ == 32 + .section .text..SHmedia32,"ax" +@@ -1076,6 +1216,7 @@ + div0: rts + mov #0,r0 + ++ ENDFUNC(GLOBAL(sdivsi3)) + #endif /* ! __SHMEDIA__ */ + #endif /* ! __SH4__ */ + #endif +@@ -1084,9 +1225,11 @@ + .title "SH DIVIDE" + !! 4 byte integer Divide code for the Hitachi SH + #ifdef __SH4__ +-!! args in r4 and r5, result in fpul, clobber r0, r1, r4, r5, dr0, dr2, dr4 ++!! args in r4 and r5, result in fpul, clobber r0, r1, r4, r5, dr0, dr2, dr4, ++!! and t bit + + .global GLOBAL(udivsi3_i4) ++ FUNC(GLOBAL(udivsi3_i4)) + GLOBAL(udivsi3_i4): + mov #1,r1 + cmp/hi r1,r5 +@@ -1127,6 +1270,8 @@ + L1: + .double 2147483648 + ++ ENDFUNC(GLOBAL(udivsi3_i4)) ++ + #elif defined(__SH4_SINGLE__) || defined(__SH4_SINGLE_ONLY__) || (defined (__SH5__) && ! defined __SH4_NOFPU__) + !! args in r4 and r5, result in fpul, clobber r0, r1, r4, r5, dr0, dr2, dr4 + +@@ -1135,6 +1280,7 @@ + .mode SHcompact + #endif + .global GLOBAL(udivsi3_i4) ++ FUNC(GLOBAL(udivsi3_i4)) + GLOBAL(udivsi3_i4): + mov #1,r1 + cmp/hi r1,r5 +@@ -1183,6 +1329,8 @@ + #endif + .double 2147483648 + ++ ENDFUNC(GLOBAL(udivsi3_i4)) ++ + #endif /* ! __SH5__ || __SH5__ == 32 */ + #endif /* ! __SH4__ */ + #endif +@@ -1199,6 +1347,7 @@ + + !! args in r4 and r5, result in r0, clobbers r4, pr, and t bit + .global GLOBAL(udivsi3) ++ FUNC(GLOBAL(udivsi3)) + + #if __SHMEDIA__ + #if __SH5__ == 32 +@@ -1299,6 +1448,8 @@ + ret: rts + mov r4,r0 + ++ ENDFUNC(GLOBAL(udivsi3)) ++ + #endif /* ! __SHMEDIA__ */ + #endif /* __SH4__ */ + #endif +@@ -1308,6 +1459,7 @@ + .mode SHcompact + #endif + .global GLOBAL(set_fpscr) ++ FUNC(GLOBAL(set_fpscr)) + GLOBAL(set_fpscr): + lds r4,fpscr + mov.l LOCAL(set_fpscr_L1),r1 +@@ -1340,11 +1492,16 @@ + .align 2 + LOCAL(set_fpscr_L1): + .long GLOBAL(fpscr_values) ++ ++ ENDFUNC(GLOBAL(set_fpscr)) ++ ++#ifndef NO_FPSCR_VALUES + #ifdef __ELF__ + .comm GLOBAL(fpscr_values),8,4 + #else + .comm GLOBAL(fpscr_values),8 + #endif /* ELF */ ++#endif /* NO_FPSCR_VALUES */ + #endif /* SH3E / SH4 */ + #endif /* L_set_fpscr */ + #ifdef L_ic_invalidate +@@ -1360,6 +1517,7 @@ + blink tr0, r63 + #elif defined(__SH4_SINGLE__) || defined(__SH4__) || defined(__SH4_SINGLE_ONLY__) + .global GLOBAL(ic_invalidate) ++ FUNC(GLOBAL(ic_invalidate)) + GLOBAL(ic_invalidate): + ocbwb @r4 + mova 0f,r0 +@@ -1382,6 +1540,9 @@ + nop + .endr + .endr ++ ++ ENDFUNC(GLOBAL(ic_invalidate)) ++ + #endif /* SH4 */ + #endif /* L_ic_invalidate */ + +diff -ruN gcc-20030210.orig/gcc/config/sh/libgcc-glibc.ver gcc-20030210/gcc/config/sh/libgcc-glibc.ver +--- gcc-20030210.orig/gcc/config/sh/libgcc-glibc.ver Thu Jan 1 09:00:00 1970 ++++ gcc-20030210/gcc/config/sh/libgcc-glibc.ver Sat Feb 22 01:40:14 2003 +@@ -0,0 +1,21 @@ ++# In order to work around the very problems that force us to now generally ++# create a libgcc.so, glibc reexported a number of routines from libgcc.a. ++# By now choosing the same version tags for these specific routines, we ++# maintain enough binary compatibility to allow future versions of glibc ++# to defer implementation of these routines to libgcc.so via DT_AUXILIARY. ++ ++# Note that we cannot use the default libgcc-glibc.ver file on sh, ++# because GLIBC_2.0 does not exist on this architecture, as the first ++# ever glibc release on the platform was GLIBC_2.2. ++ ++%inherit GCC_3.0 GLIBC_2.2 ++GLIBC_2.2 { ++ __register_frame ++ __register_frame_table ++ __deregister_frame ++ __register_frame_info ++ __deregister_frame_info ++ __frame_state_for ++ __register_frame_info_table ++} ++ +diff -ruN gcc-20030210.orig/gcc/config/sh/linux.h gcc-20030210/gcc/config/sh/linux.h +--- gcc-20030210.orig/gcc/config/sh/linux.h Tue Apr 16 05:27:42 2002 ++++ gcc-20030210/gcc/config/sh/linux.h Sat Feb 22 01:40:14 2003 +@@ -19,6 +19,10 @@ + the Free Software Foundation, 59 Temple Place - Suite 330, + Boston, MA 02111-1307, USA. */ + ++/* We're not SYSVR4, not having /usr/ccs */ ++#undef MD_EXEC_PREFIX ++#undef MD_STARTFILE_PREFIX ++ + /* Run-time Target Specification. */ + #undef TARGET_VERSION + #define TARGET_VERSION fputs (" (SH GNU/Linux with ELF)", stderr); +@@ -39,6 +43,28 @@ + #undef WCHAR_TYPE_SIZE + #define WCHAR_TYPE_SIZE BITS_PER_WORD + ++/* This was defined in linux.h. Define it here also. */ ++#undef DEFAULT_VTABLE_THUNKS ++#define DEFAULT_VTABLE_THUNKS 1 ++ ++/* Likewise. */ ++#define HANDLE_PRAGMA_PACK_PUSH_POP ++ ++/* Pick up the return address upon entry to a procedure. Used for ++ dwarf2 unwind information. This also enables the table driven ++ mechanism. */ ++ ++#define INCOMING_RETURN_ADDR_RTX gen_rtx_REG (Pmode, PR_REG) ++#define DWARF_FRAME_RETURN_COLUMN DWARF_FRAME_REGNUM (PR_REG) ++ ++#undef CPP_SPEC ++#define CPP_SPEC "\ ++ %{m4:-D__SH4__} \ ++ %{!m4:%(cpp_default_cpu_spec)} \ ++ %(subtarget_cpp_spec) \ ++ %(subtarget_cpp_ptr_spec) \ ++ %(subtarget_cpp_endian_spec) " ++ + #undef SUBTARGET_CPP_SPEC + #define SUBTARGET_CPP_SPEC "\ + %{fPIC:-D__PIC__ -D__pic__} \ +@@ -55,36 +81,45 @@ + #undef CPP_DEFAULT_CPU_SPEC + #define CPP_DEFAULT_CPU_SPEC "-D__SH3__ -D__sh3__" + +- + #undef CPP_PREDEFINES + #define CPP_PREDEFINES "-D__ELF__ -Dunix -D__sh__ -D__gnu_linux__ -Dlinux -Asystem=posix" + ++/* The GNU C++ standard library requires that these macros be defined. */ ++#undef CPLUSPLUS_CPP_SPEC ++#define CPLUSPLUS_CPP_SPEC "-D_GNU_SOURCE %(cpp)" ++ + #undef ASM_SPEC +-#define ASM_SPEC "%{!mb:-little} %{mrelax:-relax}" ++#define ASM_SPEC "%{mb:-big} %{!mb:-little} %{mrelax:-relax}" + + #undef CC1_SPEC + #define CC1_SPEC \ +- "-musermode %{!mb:-ml} %{!m3e:%{!m4:-m3}}" +- +-#undef CC1PLUS_SPEC +-#define CC1PLUS_SPEC \ +- "-musermode %{!mb:-ml} %{!m3e:%{!m4:-m3}}" ++ "-musermode %{!mb:-ml} %{!m4:-m3} %{profile:-p}" + ++/* XXX: It's wrong if prefix != /usr */ + #undef LINK_SPEC + #define LINK_SPEC \ +- "%{!mb:-m shlelf_linux} %{mrelax:-relax} \ ++ "%{!mb:-m shlelf_linux -EL} %{mb:-m shelf_linux -EB} %{mrelax:-relax} \ + %{shared:-shared} \ + %{!static: \ + %{rdynamic:-export-dynamic} \ + %{!dynamic-linker:-dynamic-linker /lib/ld-linux.so.2} \ +- %{!rpath:-rpath /lib}} \ ++ %{!mb:%{!m4:-rpath-link /usr/sh-linux/lib }} \ ++ %{!mb:%{m4:-rpath-link /usr/sh-linux/lib/m4 }} \ ++ %{mb:%{!m4:-rpath-link /usr/sh-linux/lib/mb }} \ ++ %{mb:%{m4:-rpath-link /usr/sh-linux/lib/mb/m4 }}} \ + %{static:-static}" + + #undef LIB_SPEC ++#undef LIB_SPEC + #define LIB_SPEC \ + "%{shared: -lc} \ +- %{!shared: %{pthread:-lthread} \ +- %{profile:-lc_p} %{!profile: -lc}}" ++ %{!shared: %{mieee:-lieee} %{pthread:-lpthread} \ ++ %{profile:-lc_p} %{!profile: -lc}}" ++ ++#if defined(HAVE_LD_EH_FRAME_HDR) ++#undef LINK_EH_SPEC ++#define LINK_EH_SPEC "%{!static:--eh-frame-hdr} " ++#endif + + #undef STARTFILE_SPEC + #define STARTFILE_SPEC \ +@@ -92,4 +127,40 @@ + %{pg:gcrt1.o%s} %{!pg:%{p:gcrt1.o%s} \ + %{!p:%{profile:gcrt1.o%s} \ + %{!profile:crt1.o%s}}}} \ +- crti.o%s %{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s}" ++ crti.o%s %{static:crtbeginT.o%s}\ ++ %{!static:%{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s}}" ++ ++#undef FUNCTION_PROFILER ++#define FUNCTION_PROFILER(STREAM,LABELNO) \ ++do \ ++{ \ ++ if (flag_pic) \ ++ { \ ++ fprintf (STREAM, " mov.l 3f,r1\n"); \ ++ fprintf (STREAM, " mova 3f,r0\n"); \ ++ fprintf (STREAM, " add r1,r0\n"); \ ++ fprintf (STREAM, " mov.l 1f,r1\n"); \ ++ fprintf (STREAM, " mov.l @(r0,r1),r1\n"); \ ++ } \ ++ else \ ++ { \ ++ fprintf (STREAM, " mov.l 1f,r1\n"); \ ++ } \ ++ fprintf (STREAM, " sts.l pr,@-r15\n"); \ ++ fprintf (STREAM, " mova 2f,r0\n"); \ ++ fprintf (STREAM, " jmp @r1\n"); \ ++ fprintf (STREAM, " lds r0,pr\n"); \ ++ fprintf (STREAM, " .align 2\n"); \ ++ if (flag_pic) \ ++ { \ ++ fprintf (STREAM, "1: .long mcount@GOT\n"); \ ++ fprintf (STREAM, "3: .long _GLOBAL_OFFSET_TABLE_\n"); \ ++ } \ ++ else \ ++ { \ ++ fprintf (STREAM, "1: .long mcount\n"); \ ++ } \ ++ fprintf (STREAM, "2: lds.l @r15+,pr\n"); \ ++} while (0) ++ ++#define NO_SHARED_LIBGCC_MULTILIB +diff -ruN gcc-20030210.orig/gcc/config/sh/sh-protos.h gcc-20030210/gcc/config/sh/sh-protos.h +--- gcc-20030210.orig/gcc/config/sh/sh-protos.h Fri Feb 22 01:42:28 2002 ++++ gcc-20030210/gcc/config/sh/sh-protos.h Sat Feb 22 01:40:14 2003 +@@ -74,6 +74,7 @@ + extern int shl_sext_length PARAMS ((rtx)); + extern int gen_shl_sext PARAMS ((rtx, rtx, rtx, rtx)); + extern rtx gen_datalabel_ref PARAMS ((rtx)); ++extern int shl_casesi_worker_length PARAMS ((rtx)); + extern int regs_used PARAMS ((rtx, int)); + extern void fixup_addr_diff_vecs PARAMS ((rtx)); + extern int get_dest_uid PARAMS ((rtx, int)); +diff -ruN gcc-20030210.orig/gcc/config/sh/sh.c gcc-20030210/gcc/config/sh/sh.c +--- gcc-20030210.orig/gcc/config/sh/sh.c Fri Feb 22 01:42:28 2002 ++++ gcc-20030210/gcc/config/sh/sh.c Sat Feb 22 01:40:14 2003 +@@ -2143,6 +2143,48 @@ + return sym; + } + ++ ++/* Function to be used in the length attribute of the casesi_worker ++ instruction. Returns number of instructions, which is half of the ++ length of bytes. */ ++ ++int ++shl_casesi_worker_length (insn) ++ rtx insn; ++{ ++ rtx set_src, label; ++ rtx diff_vec; ++ ++ set_src = SET_SRC (XVECEXP (PATTERN (insn), 0, 0)); ++ if (!(GET_CODE (set_src) == UNSPEC ++ && XINT (set_src, 1) == UNSPEC_CASESI)) ++ abort (); ++ ++ label = XVECEXP (set_src, 0, 2); ++ if (GET_CODE (label) != LABEL_REF) ++ abort (); ++ ++ diff_vec = PATTERN (next_real_insn (XEXP (label, 0))); ++ ++ if (GET_CODE (diff_vec) != ADDR_DIFF_VEC) ++ abort (); ++ ++ switch (GET_MODE (diff_vec)) ++ { ++ case SImode: ++ return 2; ++ case HImode: ++ if (ADDR_DIFF_VEC_FLAGS (diff_vec).offset_unsigned) ++ return 3; ++ return 2; ++ case QImode: ++ if (ADDR_DIFF_VEC_FLAGS (diff_vec).offset_unsigned) ++ return 2; ++ return 1; ++ default: ++ abort (); ++ } ++} + + /* The SH cannot load a large constant into a register, constants have to + come from a pc relative load. The reference of a pc relative load +@@ -3190,7 +3232,7 @@ + vec_lab = XEXP (XEXP (pat, 0), 0); + + /* Search the matching casesi_jump_2. */ +- for (prev = vec_lab; ; prev = PREV_INSN (prev)) ++ for (prev = vec_lab; prev; prev = PREV_INSN (prev)) + { + if (GET_CODE (prev) != JUMP_INSN) + continue; +@@ -3205,6 +3247,13 @@ + break; + } + ++ if (prev == NULL) ++ { /* Switch statement has been optimized out. */ ++ delete_insn (PREV_INSN (insn)); ++ delete_insn (insn); ++ continue; ++ } ++ + /* Emit the reference label of the braf where it belongs, right after + the casesi_jump_2 (i.e. braf). */ + braf_label = XEXP (XEXP (SET_SRC (XVECEXP (prevpat, 0, 0)), 1), 0); +@@ -3223,7 +3272,7 @@ + rtx barrier_or_label; + { + rtx next = next_real_insn (barrier_or_label), pat, prev; +- int slot, credit, jump_to_next; ++ int slot, credit, jump_to_next = 0; + + if (! next) + return 0; +@@ -4507,7 +4556,8 @@ + if (current_function_varargs || current_function_stdarg) + { + /* This is not used by the SH3E calling convention */ +- if (TARGET_SH1 && ! TARGET_SH3E && ! TARGET_SH5 && ! TARGET_HITACHI) ++ if (TARGET_SH1 && ! TARGET_SH3E && ! TARGET_SH5 && ! TARGET_HITACHI ++ || TARGET_NO_IMPLICIT_FP) + { + /* Push arg regs as if they'd been provided by caller in stack. */ + for (i = 0; i < NPARM_REGS(SImode); i++) +@@ -5149,7 +5199,8 @@ + tree f_next_o, f_next_o_limit, f_next_fp, f_next_fp_limit, f_next_stack; + tree record; + +- if (TARGET_SH5 || (! TARGET_SH3E && ! TARGET_SH4) || TARGET_HITACHI) ++ if (TARGET_SH5 || (! TARGET_SH3E && ! TARGET_SH4) || TARGET_HITACHI ++ || TARGET_NO_IMPLICIT_FP) + return ptr_type_node; + + record = make_node (RECORD_TYPE); +@@ -5211,7 +5262,8 @@ + return; + } + +- if ((! TARGET_SH3E && ! TARGET_SH4) || TARGET_HITACHI) ++ if ((! TARGET_SH3E && ! TARGET_SH4) ++ || TARGET_HITACHI || TARGET_NO_IMPLICIT_FP) + { + std_expand_builtin_va_start (stdarg_p, valist, nextarg); + return; +@@ -5289,7 +5341,8 @@ + rsize = (size + UNITS_PER_WORD - 1) & -UNITS_PER_WORD; + pptr_type_node = build_pointer_type (ptr_type_node); + +- if (! TARGET_SH5 && (TARGET_SH3E || TARGET_SH4) && ! TARGET_HITACHI) ++ if (! TARGET_SH5 && (TARGET_SH3E || TARGET_SH4) ++ && ! TARGET_HITACHI && ! TARGET_NO_IMPLICIT_FP) + { + tree f_next_o, f_next_o_limit, f_next_fp, f_next_fp_limit, f_next_stack; + tree next_o, next_o_limit, next_fp, next_fp_limit, next_stack; +diff -ruN gcc-20030210.orig/gcc/config/sh/sh.h gcc-20030210/gcc/config/sh/sh.h +--- gcc-20030210.orig/gcc/config/sh/sh.h Fri Feb 22 01:42:28 2002 ++++ gcc-20030210/gcc/config/sh/sh.h Sat Feb 22 01:40:14 2003 +@@ -147,10 +147,10 @@ + #define HARD_SH4_BIT (1<<5) + #define FPU_SINGLE_BIT (1<<7) + #define SH4_BIT (1<<12) ++#define NO_IMPLICIT_FP_BIT (1<<3) + #define FMOVD_BIT (1<<4) + #define SH5_BIT (1<<0) + #define SPACE_BIT (1<<13) +-#define BIGTABLE_BIT (1<<14) + #define RELAX_BIT (1<<15) + #define USERMODE_BIT (1<<16) + #define HITACHI_BIT (1<<22) +@@ -205,6 +205,9 @@ + /* Nonzero if we should generate code for a SH5 CPU (either ISA). */ + #define TARGET_SH5 (target_flags & SH5_BIT) + ++/* Nonzero if we should not use FPU implicitly. */ ++#define TARGET_NO_IMPLICIT_FP (target_flags & NO_IMPLICIT_FP_BIT) ++ + /* Nonzero if we should generate code using the SHcompact instruction + set and 32-bit ABI. */ + #define TARGET_SHCOMPACT (TARGET_SH5 && TARGET_SH1) +@@ -225,6 +228,7 @@ + + /* Nonzero if we should generate code using SHmedia FPU instructions. */ + #define TARGET_SHMEDIA_FPU (TARGET_SHMEDIA && TARGET_FPU_DOUBLE) ++ + /* Nonzero if we should generate fmovd. */ + #define TARGET_FMOVD (target_flags & FMOVD_BIT) + +@@ -234,9 +238,6 @@ + /* Nonzero if we should generate smaller code rather than faster code. */ + #define TARGET_SMALLCODE (target_flags & SPACE_BIT) + +-/* Nonzero to use long jump tables. */ +-#define TARGET_BIGTABLE (target_flags & BIGTABLE_BIT) +- + /* Nonzero to generate pseudo-ops needed by the assembler and linker + to do function call relaxing. */ + #define TARGET_RELAX (target_flags & RELAX_BIT) +@@ -297,7 +298,6 @@ + {"5-compact-nofpu", TARGET_NONE, "" }, \ + {"5-compact-nofpu", SH5_BIT|SH3_BIT|SH2_BIT|SH1_BIT, "Generate FPU-less SHcompact code" }, \ + {"b", -LITTLE_ENDIAN_BIT, "" }, \ +- {"bigtable", BIGTABLE_BIT, "" }, \ + {"dalign", DALIGN_BIT, "" }, \ + {"fmovd", FMOVD_BIT, "" }, \ + {"hitachi", HITACHI_BIT, "" }, \ +@@ -306,6 +306,7 @@ + {"isize", ISIZE_BIT, "" }, \ + {"l", LITTLE_ENDIAN_BIT, "" }, \ + {"no-ieee", -IEEE_BIT, "" }, \ ++ {"no-implicit-fp", NO_IMPLICIT_FP_BIT, "" }, \ + {"padstruct", PADSTRUCT_BIT, "" }, \ + {"prefergot", PREFERGOT_BIT, "" }, \ + {"relax", RELAX_BIT, "" }, \ +@@ -2493,16 +2494,22 @@ + goto LABEL; \ + } + ++extern int optimize; /* needed for gen_casesi. */ ++extern int optimize_size; ++ + /* Specify the machine mode that this machine uses + for the index in the tablejump instruction. */ +-#define CASE_VECTOR_MODE (TARGET_BIGTABLE ? SImode : HImode) ++#define CASE_VECTOR_MODE SImode + + #define CASE_VECTOR_SHORTEN_MODE(MIN_OFFSET, MAX_OFFSET, BODY) \ + ((MIN_OFFSET) >= 0 && (MAX_OFFSET) <= 127 \ + ? (ADDR_DIFF_VEC_FLAGS (BODY).offset_unsigned = 0, QImode) \ + : (MIN_OFFSET) >= 0 && (MAX_OFFSET) <= 255 \ + ? (ADDR_DIFF_VEC_FLAGS (BODY).offset_unsigned = 1, QImode) \ +- : (MIN_OFFSET) >= -32768 && (MAX_OFFSET) <= 32767 ? HImode \ ++ : (MIN_OFFSET) >= -32768 && (MAX_OFFSET) <= 32767 \ ++ ? (ADDR_DIFF_VEC_FLAGS (BODY).offset_unsigned = 0, HImode) \ ++ : optimize_size && (MIN_OFFSET) >= 0 && (MAX_OFFSET) <= 65535 \ ++ ? (ADDR_DIFF_VEC_FLAGS (BODY).offset_unsigned = 1, HImode) \ + : SImode) + + /* Define as C expression which evaluates to nonzero if the tablejump +@@ -3038,10 +3045,7 @@ + /* Output an absolute table element. */ + + #define ASM_OUTPUT_ADDR_VEC_ELT(STREAM,VALUE) \ +- if (TARGET_BIGTABLE) \ +- asm_fprintf ((STREAM), "\t.long\t%LL%d\n", (VALUE)); \ +- else \ +- asm_fprintf ((STREAM), "\t.word\t%LL%d\n", (VALUE)); \ ++ asm_fprintf ((STREAM), "\t.long\t%LL%d\n", (VALUE)) + + /* Output various types of constants. */ + +@@ -3167,8 +3171,6 @@ + #define sh_cpu_attr ((enum attr_cpu)sh_cpu) + extern enum processor_type sh_cpu; + +-extern int optimize; /* needed for gen_casesi. */ +- + enum mdep_reorg_phase_e + { + SH_BEFORE_MDEP_REORG, +diff -ruN gcc-20030210.orig/gcc/config/sh/sh.md gcc-20030210/gcc/config/sh/sh.md +--- gcc-20030210.orig/gcc/config/sh/sh.md Sat Nov 23 04:58:06 2002 ++++ gcc-20030210/gcc/config/sh/sh.md Sat Feb 22 01:40:14 2003 +@@ -1242,7 +1242,7 @@ + (clobber (reg:SI PR_REG)) + (clobber (reg:SI R4_REG)) + (use (match_operand:SI 1 "arith_reg_operand" "r"))] +- "TARGET_SH1 && ! TARGET_SH4" ++ "TARGET_SH1 && ! TARGET_SH4 || TARGET_NO_IMPLICIT_FP" + "jsr @%1%#" + [(set_attr "type" "sfunc") + (set_attr "needs_delay_slot" "yes")]) +@@ -1336,7 +1336,7 @@ + + operands[3] = gen_reg_rtx (Pmode); + /* Emit the move of the address to a pseudo outside of the libcall. */ +- if (TARGET_HARD_SH4 && TARGET_SH3E) ++ if (TARGET_HARD_SH4 && TARGET_SH3E && !TARGET_NO_IMPLICIT_FP) + { + emit_move_insn (operands[3], + gen_rtx_SYMBOL_REF (SImode, \"__udivsi3_i4\")); +@@ -1391,7 +1391,7 @@ + (clobber (reg:SI R2_REG)) + (clobber (reg:SI R3_REG)) + (use (match_operand:SI 1 "arith_reg_operand" "r"))] +- "TARGET_SH1 && ! TARGET_SH4" ++ "TARGET_SH1 && ! TARGET_SH4 || TARGET_NO_IMPLICIT_FP" + "jsr @%1%#" + [(set_attr "type" "sfunc") + (set_attr "needs_delay_slot" "yes")]) +@@ -1476,7 +1476,7 @@ + + operands[3] = gen_reg_rtx (Pmode); + /* Emit the move of the address to a pseudo outside of the libcall. */ +- if (TARGET_HARD_SH4 && TARGET_SH3E) ++ if (TARGET_HARD_SH4 && TARGET_SH3E && !TARGET_NO_IMPLICIT_FP) + { + emit_move_insn (operands[3], + gen_rtx_SYMBOL_REF (SImode, \"__sdivsi3_i4\")); +@@ -6446,6 +6446,8 @@ + case SImode: + return \"shll2 %1\;mov.l @(r0,%1),%0\"; + case HImode: ++ if (ADDR_DIFF_VEC_FLAGS (diff_vec).offset_unsigned) ++ return \"add %1,%1\;mov.w @(r0,%1),%0\;extu.w %0,%0\"; + return \"add %1,%1\;mov.w @(r0,%1),%0\"; + case QImode: + if (ADDR_DIFF_VEC_FLAGS (diff_vec).offset_unsigned) +@@ -6455,7 +6457,15 @@ + abort (); + } + }" +- [(set_attr "length" "4")]) ++ [(set (attr "length") ++ (cond [(eq (symbol_ref "shl_casesi_worker_length (insn)") (const_int 1)) ++ (const_string "2") ++ (eq (symbol_ref "shl_casesi_worker_length (insn)") (const_int 2)) ++ (const_string "4") ++ ;; Put "match_dup" here so that insn_variable_length_p return 1. ++ (ne (match_dup 2) (match_dup 2)) ++ (const_string "4")] ++ (const_string "6")))]) + + (define_insn "casesi_shift_media" + [(set (match_operand 0 "arith_reg_operand" "=r") +diff -ruN gcc-20030210.orig/gcc/config/sh/sh3-linux.h gcc-20030210/gcc/config/sh/sh3-linux.h +--- gcc-20030210.orig/gcc/config/sh/sh3-linux.h Thu Jan 1 09:00:00 1970 ++++ gcc-20030210/gcc/config/sh/sh3-linux.h Sat Feb 22 01:40:14 2003 +@@ -0,0 +1,29 @@ ++#undef TARGET_VERSION ++#define TARGET_VERSION fputs (" (SH3 GNU/Linux with ELF)", stderr); ++ ++#undef CPP_SPEC ++#define CPP_SPEC \ ++ "-D__LITTLE_ENDIAN__ \ ++ -D__SH3__ -D__sh3__ \ ++ -D__SIZE_TYPE__=unsigned\\ int \ ++ -D__PTRDIFF_TYPE__=int \ ++ %{fPIC:-D__PIC__ -D__pic__} \ ++ %{fpic:-D__PIC__ -D__pic__} \ ++ %{posix:-D_POSIX_SOURCE} \ ++ %{pthread:-D_REENTRANT -D_PTHREADS}" ++ ++#undef ASM_SPEC ++#define ASM_SPEC "%{mrelax:-relax}" ++ ++#undef CC1_SPEC ++#define CC1_SPEC \ ++ "-musermode -ml -m3 %{profile:-p}" ++ ++#undef LINK_SPEC ++#define LINK_SPEC \ ++ "%{mrelax:-relax} \ ++ %{shared:-shared} \ ++ %{!static: \ ++ %{rdynamic:-export-dynamic} \ ++ %{!dynamic-linker:-dynamic-linker /lib/ld-linux.so.2}} \ ++ %{static:-static}" +diff -ruN gcc-20030210.orig/gcc/config/sh/sh3eb-linux.h gcc-20030210/gcc/config/sh/sh3eb-linux.h +--- gcc-20030210.orig/gcc/config/sh/sh3eb-linux.h Thu Jan 1 09:00:00 1970 ++++ gcc-20030210/gcc/config/sh/sh3eb-linux.h Sat Feb 22 01:40:14 2003 +@@ -0,0 +1,29 @@ ++#undef TARGET_VERSION ++#define TARGET_VERSION fputs (" (SH3EB GNU/Linux with ELF)", stderr); ++ ++#undef CPP_SPEC ++#define CPP_SPEC \ ++ "-D__BIG_ENDIAN__ \ ++ -D__SH3__ -D__sh3__ \ ++ -D__SIZE_TYPE__=unsigned\\ int \ ++ -D__PTRDIFF_TYPE__=int \ ++ %{fPIC:-D__PIC__ -D__pic__} \ ++ %{fpic:-D__PIC__ -D__pic__} \ ++ %{posix:-D_POSIX_SOURCE} \ ++ %{pthread:-D_REENTRANT -D_PTHREADS}" ++ ++#undef ASM_SPEC ++#define ASM_SPEC "%{mrelax:-relax}" ++ ++#undef CC1_SPEC ++#define CC1_SPEC \ ++ "-musermode -mb -m3 %{profile:-p}" ++ ++#undef LINK_SPEC ++#define LINK_SPEC \ ++ "%{mrelax:-relax} \ ++ %{shared:-shared} \ ++ %{!static: \ ++ %{rdynamic:-export-dynamic} \ ++ %{!dynamic-linker:-dynamic-linker /lib/ld-linux.so.2}} \ ++ %{static:-static}" +diff -ruN gcc-20030210.orig/gcc/config/sh/sh4-linux.h gcc-20030210/gcc/config/sh/sh4-linux.h +--- gcc-20030210.orig/gcc/config/sh/sh4-linux.h Thu Jan 1 09:00:00 1970 ++++ gcc-20030210/gcc/config/sh/sh4-linux.h Sat Feb 22 01:40:14 2003 +@@ -0,0 +1,29 @@ ++#undef TARGET_VERSION ++#define TARGET_VERSION fputs (" (SH4 GNU/Linux with ELF)", stderr); ++ ++#undef CPP_SPEC ++#define CPP_SPEC \ ++ "-D__LITTLE_ENDIAN__ \ ++ -D__SH4__ \ ++ -D__SIZE_TYPE__=unsigned\\ int \ ++ -D__PTRDIFF_TYPE__=int \ ++ %{fPIC:-D__PIC__ -D__pic__} \ ++ %{fpic:-D__PIC__ -D__pic__} \ ++ %{posix:-D_POSIX_SOURCE} \ ++ %{pthread:-D_REENTRANT -D_PTHREADS}" ++ ++#undef ASM_SPEC ++#define ASM_SPEC "%{mrelax:-relax}" ++ ++#undef CC1_SPEC ++#define CC1_SPEC \ ++ "-musermode -ml -m4 %{profile:-p}" ++ ++#undef LINK_SPEC ++#define LINK_SPEC \ ++ "%{mrelax:-relax} \ ++ %{shared:-shared} \ ++ %{!static: \ ++ %{rdynamic:-export-dynamic} \ ++ %{!dynamic-linker:-dynamic-linker /lib/ld-linux.so.2}} \ ++ %{static:-static}" +diff -ruN gcc-20030210.orig/gcc/config/sh/sh4eb-linux.h gcc-20030210/gcc/config/sh/sh4eb-linux.h +--- gcc-20030210.orig/gcc/config/sh/sh4eb-linux.h Thu Jan 1 09:00:00 1970 ++++ gcc-20030210/gcc/config/sh/sh4eb-linux.h Sat Feb 22 01:40:14 2003 +@@ -0,0 +1,29 @@ ++#undef TARGET_VERSION ++#define TARGET_VERSION fputs (" (SH4EB GNU/Linux with ELF)", stderr); ++ ++#undef CPP_SPEC ++#define CPP_SPEC \ ++ "-D__BIG_ENDIAN__ \ ++ -D__SH4__ \ ++ -D__SIZE_TYPE__=unsigned\\ int \ ++ -D__PTRDIFF_TYPE__=int \ ++ %{fPIC:-D__PIC__ -D__pic__} \ ++ %{fpic:-D__PIC__ -D__pic__} \ ++ %{posix:-D_POSIX_SOURCE} \ ++ %{pthread:-D_REENTRANT -D_PTHREADS}" ++ ++#undef ASM_SPEC ++#define ASM_SPEC "%{mrelax:-relax}" ++ ++#undef CC1_SPEC ++#define CC1_SPEC \ ++ "-musermode -mb -m4 %{profile:-p}" ++ ++#undef LINK_SPEC ++#define LINK_SPEC \ ++ "%{mrelax:-relax} \ ++ %{shared:-shared} \ ++ %{!static: \ ++ %{rdynamic:-export-dynamic} \ ++ %{!dynamic-linker:-dynamic-linker /lib/ld-linux.so.2}} \ ++ %{static:-static}" +diff -ruN gcc-20030210.orig/gcc/config/sh/t-linux gcc-20030210/gcc/config/sh/t-linux +--- gcc-20030210.orig/gcc/config/sh/t-linux Thu May 17 12:16:12 2001 ++++ gcc-20030210/gcc/config/sh/t-linux Sat Feb 22 01:40:14 2003 +@@ -1,10 +1,20 @@ +-TARGET_LIBGCC2_CFLAGS = -fpic ++TARGET_LIBGCC2_CFLAGS = -fpic -DNO_FPSCR_VALUES ++LIBGCC1 = libgcc1-asm.a ++CROSS_LIBGCC1 = libgcc1-asm.a ++LIBGCC1_TEST = libgcc1-test + LIB1ASMFUNCS = _ashiftrt _ashiftrt_n _ashiftlt _lshiftrt _movstr \ + _movstr_i4 _mulsi3 _sdivsi3 _sdivsi3_i4 _udivsi3 _udivsi3_i4 _set_fpscr \ + _ic_invalidate ++LIB2ADDEH = $(srcdir)/unwind-sjlj.c ++LIB2ADDEHDEP = unwind.inc unwind-sjlj.c + +-MULTILIB_OPTIONS= mb m3e/m4 ++MULTILIB_OPTIONS= mb m4 + MULTILIB_DIRNAMES= + MULTILIB_MATCHES = + +-EXTRA_MULTILIB_PARTS= crtbegin.o crtend.o crtbeginS.o crtendS.o ++EXTRA_MULTILIB_PARTS= crtbegin.o crtend.o crtbeginS.o crtendS.o crtbeginT.o ++ ++# Override t-slibgcc-elf-ver to export some libgcc symbols with ++# the symbol versions that glibc used and SH specific. ++SHLIB_MAPFILES = $(srcdir)/libgcc-std.ver \ ++ $(srcdir)/config/sh/libgcc-glibc.ver +diff -ruN gcc-20030210.orig/gcc/config/sh/t-linux-nomulti gcc-20030210/gcc/config/sh/t-linux-nomulti +--- gcc-20030210.orig/gcc/config/sh/t-linux-nomulti Thu Jan 1 09:00:00 1970 ++++ gcc-20030210/gcc/config/sh/t-linux-nomulti Sat Feb 22 01:40:14 2003 +@@ -0,0 +1,9 @@ ++LIBGCC = libgcc.a ++EXTRA_PARTS = crtbegin.o crtbeginS.o crtend.o crtendS.o crtbeginT.o ++ ++INSTALL_LIBGCC = install-libgcc ++ ++MULTILIB_OPTIONS= ++MULTILIB_DIRNAMES= ++MULTILIB_MATCHES = ++EXTRA_MULTILIB_PARTS= +diff -ruN gcc-20030210.orig/gcc/config.gcc gcc-20030210/gcc/config.gcc +--- gcc-20030210.orig/gcc/config.gcc Fri Jan 31 19:17:13 2003 ++++ gcc-20030210/gcc/config.gcc Sat Feb 22 01:40:14 2003 +@@ -337,9 +337,9 @@ + sparc*-*-*) + cpu_type=sparc + ;; +-sh64-*-*) +- cpu_type=sh +- ;; ++sh*-*-*) ++ cpu_type=sh ++ ;; + esac + + tm_file=${cpu_type}/${cpu_type}.h +@@ -3018,9 +3018,31 @@ + thread_file='rtems' + fi + ;; +-sh-*-linux*) ++sh*-*-linux*) + tm_file="${tm_file} sh/elf.h sh/linux.h" +- tmake_file="sh/t-sh sh/t-elf sh/t-linux" ++ tmake_file="sh/t-sh sh/t-elf t-slibgcc-elf-ver t-linux sh/t-linux" ++ extra_parts="crtbegin.o crtend.o crtbeginS.o crtendS.o crtbeginT.o" ++ case $machine in ++ sh3eb-*) ++ tm_file="${tm_file} sh/sh3eb-linux.h" ++ tmake_file="${tmake_file} sh/t-linux-nomulti" ++ ;; ++ sh4eb-*) ++ tm_file="${tm_file} sh/sh4eb-linux.h" ++ tmake_file="${tmake_file} sh/t-linux-nomulti" ++ ;; ++ sh3-*) ++ tm_file="${tm_file} sh/sh3-linux.h" ++ tmake_file="${tmake_file} sh/t-linux-nomulti" ++ ;; ++ sh4-*) ++ tm_file="${tm_file} sh/sh4-linux.h" ++ tmake_file="${tmake_file} sh/t-linux-nomulti" ++ ;; ++ *) ++ ;; ++ esac ++ xmake_file=x-linux + gas=yes gnu_ld=yes + float_format=sh + ;; +diff -ruN gcc-20030210.orig/gcc/dwarf2out.c gcc-20030210/gcc/dwarf2out.c +--- gcc-20030210.orig/gcc/dwarf2out.c Mon Feb 10 19:36:25 2003 ++++ gcc-20030210/gcc/dwarf2out.c Sat Feb 22 01:40:14 2003 +@@ -10224,7 +10224,9 @@ + /* We can have a normal definition following an inline one in the + case of redefinition of GNU C extern inlines. + It seems reasonable to use AT_specification in this case. */ +- && !get_AT_unsigned (old_die, DW_AT_inline)) ++ && !get_AT_unsigned (old_die, DW_AT_inline) ++ /* Skip the nested function. */ ++ && !decl_function_context (decl)) + { + /* ??? This can happen if there is a bug in the program, for + instance, if it has duplicate function definitions. Ideally, +diff -ruN gcc-20030210.orig/gcc/final.c gcc-20030210/gcc/final.c +--- gcc-20030210.orig/gcc/final.c Fri Jan 31 19:17:20 2003 ++++ gcc-20030210/gcc/final.c Sat Feb 22 01:40:14 2003 +@@ -1128,7 +1128,7 @@ + } + } + +- INSN_ADDRESSES (uid) = insn_current_address; ++ INSN_ADDRESSES (uid) = insn_current_address + insn_lengths[uid]; + + if (GET_CODE (insn) == NOTE || GET_CODE (insn) == BARRIER + || GET_CODE (insn) == CODE_LABEL) +diff -ruN gcc-20030210.orig/gcc/mkmap-symver.awk gcc-20030210/gcc/mkmap-symver.awk +--- gcc-20030210.orig/gcc/mkmap-symver.awk Fri Jan 31 19:17:26 2003 ++++ gcc-20030210/gcc/mkmap-symver.awk Sat Feb 22 01:40:14 2003 +@@ -89,7 +89,11 @@ + output(inherit[lib]); + + printf("%s {\n", lib); +- printf(" global:\n"); ++ for (sym in ver) ++ if ((ver[sym] == lib) && (sym in def)) ++ count++; ++ if (count > 0) ++ printf(" global:\n"); + for (sym in ver) + if ((ver[sym] == lib) && (sym in def)) + { +diff -ruN gcc-20030210.orig/gcc/reload1.c gcc-20030210/gcc/reload1.c +--- gcc-20030210.orig/gcc/reload1.c Fri Jan 31 19:17:29 2003 ++++ gcc-20030210/gcc/reload1.c Sat Feb 22 01:40:14 2003 +@@ -6103,6 +6103,7 @@ + for (j = 0; j < n_reloads; j++) + if (rld[j].in != 0 + && rld[j].when_needed != RELOAD_OTHER ++ && rld[j].when_needed != RELOAD_FOR_OUTPUT_ADDRESS + && reg_overlap_mentioned_for_reload_p (rld[j].in, + rld[i].in)) + rld[j].when_needed +diff -ruN gcc-20030210.orig/gcc/reorg.c gcc-20030210/gcc/reorg.c +--- gcc-20030210.orig/gcc/reorg.c Fri Jan 31 19:17:30 2003 ++++ gcc-20030210/gcc/reorg.c Sat Feb 22 01:40:14 2003 +@@ -3265,6 +3265,14 @@ + || condjump_in_parallel_p (XVECEXP (PATTERN (insn), 0, 0)))) + continue; + ++#ifdef MD_CAN_REDIRECT_BRANCH ++ /* On some targets, branches with delay slots can have a limited ++ displacement. Give the back end a chance to tell us we can't do ++ this. */ ++ if (! MD_CAN_REDIRECT_BRANCH (insn, delay_insn)) ++ continue; ++#endif ++ + target_label = JUMP_LABEL (delay_insn); + + if (target_label) +diff -ruN gcc-20030210.orig/gcc/tree-inline.c gcc-20030210/gcc/tree-inline.c +--- gcc-20030210.orig/gcc/tree-inline.c Fri Jan 31 19:17:33 2003 ++++ gcc-20030210/gcc/tree-inline.c Sat Feb 22 01:40:14 2003 +@@ -836,11 +836,17 @@ + + /* Don't try to inline functions that are not well-suited to + inlining. */ +- if (!inlinable_function_p (fn, id)) +- return NULL_TREE; ++ if (! inlinable_function_p (fn, id) ++ || ! (*lang_hooks.tree_inlining.start_inlining) (fn)) ++ { ++ if (DECL_INLINE (fn) && warn_inline && ! flag_really_no_inline) ++ { ++ warning_with_decl (fn, "inlining failed in call to `%s'"); ++ warning ("called from here"); ++ } + +- if (! (*lang_hooks.tree_inlining.start_inlining) (fn)) +- return NULL_TREE; ++ return NULL_TREE; ++ } + + /* Set the current filename and line number to the function we are + inlining so that when we create new _STMT nodes here they get +diff -ruN gcc-20030210.orig/libjava/Makefile.in gcc-20030210/libjava/Makefile.in +--- gcc-20030210.orig/libjava/Makefile.in Tue Jan 28 10:44:37 2003 ++++ gcc-20030210/libjava/Makefile.in Sat Feb 22 01:40:14 2003 +@@ -1637,6 +1637,7 @@ + "AS=$(AS)" \ + "CC=$(CC)" \ + "CXX=$(CXX)" \ ++ "GCJ=$(GCJ)" \ + "LD=$(LD)" \ + "LIBCFLAGS=$(LIBCFLAGS)" \ + "NM=$(NM)" \ +diff -ruN gcc-20030210.orig/libjava/configure gcc-20030210/libjava/configure +--- gcc-20030210.orig/libjava/configure Tue Jan 28 10:44:37 2003 ++++ gcc-20030210/libjava/configure Sat Feb 22 01:42:11 2003 +@@ -2031,7 +2031,7 @@ + # This must be Linux ELF. + linux-gnu*) + case $host_cpu in +- alpha* | hppa* | i*86 | powerpc* | sparc* | ia64* ) ++ alpha* | hppa* | i*86 | powerpc* | sparc* | ia64* | sh* ) + lt_cv_deplibs_check_method=pass_all ;; + *) + # glibc up to 2.1.1 does not perform some relocations on ARM +diff -ruN gcc-20030210.orig/libjava/java/net/natInetAddress.cc gcc-20030210/libjava/java/net/natInetAddress.cc +--- gcc-20030210.orig/libjava/java/net/natInetAddress.cc Tue Mar 5 05:02:19 2002 ++++ gcc-20030210/libjava/java/net/natInetAddress.cc Sat Feb 22 01:40:14 2003 +@@ -56,7 +56,7 @@ + #endif + + #ifndef HAVE_GETHOSTNAME_DECL +-extern "C" int gethostname (char *name, int namelen); ++extern "C" int gethostname (char *name, unsigned int namelen); + #endif + + #ifdef DISABLE_JAVA_NET +diff -ruN gcc-20030210.orig/libjava/libltdl/aclocal.m4 gcc-20030210/libjava/libltdl/aclocal.m4 +--- gcc-20030210.orig/libjava/libltdl/aclocal.m4 Sun Sep 10 17:04:40 2000 ++++ gcc-20030210/libjava/libltdl/aclocal.m4 Sat Feb 22 01:40:14 2003 +@@ -573,7 +573,7 @@ + # This must be Linux ELF. + linux-gnu*) + case "$host_cpu" in +- alpha* | i*86 | powerpc* | sparc* | ia64* ) ++ alpha* | i*86 | powerpc* | sparc* | ia64* | sh*) + lt_cv_deplibs_check_method=pass_all ;; + *) + # glibc up to 2.1.1 does not perform some relocations on ARM +diff -ruN gcc-20030210.orig/libjava/sysdep/sh/locks.h gcc-20030210/libjava/sysdep/sh/locks.h +--- gcc-20030210.orig/libjava/sysdep/sh/locks.h Thu Jan 1 09:00:00 1970 ++++ gcc-20030210/libjava/sysdep/sh/locks.h Sat Feb 22 01:40:14 2003 +@@ -0,0 +1,72 @@ ++// locks.h - Thread synchronization primitives. SuperH implementation. ++ ++/* Copyright (C) 2002 Free Software Foundation ++ ++ This file is part of libgcj. ++ ++This software is copyrighted work licensed under the terms of the ++Libgcj License. Please consult the file "LIBGCJ_LICENSE" for ++details. */ ++ ++#ifndef __SYSDEP_LOCKS_H__ ++#define __SYSDEP_LOCKS_H__ ++ ++typedef size_t obj_addr_t; /* Integer type big enough for object */ ++ /* address. */ ++ ++static unsigned char __cas_lock = 0; ++ ++inline static void ++__cas_start_atomic (void) ++{ ++ unsigned int val; ++ ++ do ++ __asm__ __volatile__ ("tas.b @%1; movt %0" ++ : "=r" (val) ++ : "r" (&__cas_lock) ++ : "memory"); ++ while (val == 0); ++} ++ ++inline static void ++__cas_end_atomic (void) ++{ ++ __asm__ __volatile__ (" " : : : "memory"); ++ __cas_lock = 0; ++} ++ ++inline static bool ++compare_and_swap (volatile obj_addr_t *addr, obj_addr_t old, ++ obj_addr_t new_val) ++{ ++ bool ret; ++ ++ __cas_start_atomic (); ++ if (*addr != old) ++ ret = false; ++ else ++ { ++ *addr = new_val; ++ ret = true; ++ } ++ __cas_end_atomic (); ++ ++ return ret; ++} ++ ++inline static void ++release_set (volatile obj_addr_t *addr, obj_addr_t new_val) ++{ ++ __asm__ __volatile__ (" " : : : "memory"); ++ *(addr) = new_val; ++} ++ ++inline static bool ++compare_and_swap_release (volatile obj_addr_t *addr, obj_addr_t old, ++ obj_addr_t new_val) ++{ ++ return compare_and_swap (addr, old, new_val); ++} ++ ++#endif /* ! __SYSDEP_LOCKS_H__ */ +diff -ruN gcc-20030210.orig/libstdc++-v3/acinclude.m4 gcc-20030210/libstdc++-v3/acinclude.m4 +--- gcc-20030210.orig/libstdc++-v3/acinclude.m4 Tue Jan 28 02:30:41 2003 ++++ gcc-20030210/libstdc++-v3/acinclude.m4 Sat Feb 22 01:40:14 2003 +@@ -1828,9 +1828,10 @@ + GLIBCPP_INCLUDES="-I${glibcpp_builddir}/include/${target_alias} -I${glibcpp_builddir}/include" + + # Passed down for canadian crosses. +- if test x"$CANADIAN" = xyes; then +- TOPLEVEL_INCLUDES='-I$(includedir)' +- fi ++ #if test x"$CANADIAN" = xyes; then ++ # TOPLEVEL_INCLUDES='-I$(includedir)' ++ #fi ++ TOPLEVEL_INCLUDES='' + + LIBMATH_INCLUDES='-I$(top_srcdir)/libmath' + +diff -ruN gcc-20030210.orig/libstdc++-v3/aclocal.m4 gcc-20030210/libstdc++-v3/aclocal.m4 +--- gcc-20030210.orig/libstdc++-v3/aclocal.m4 Mon Feb 10 19:36:47 2003 ++++ gcc-20030210/libstdc++-v3/aclocal.m4 Sat Feb 22 01:40:14 2003 +@@ -1840,9 +1840,10 @@ + GLIBCPP_INCLUDES="-I${glibcpp_builddir}/include/${target_alias} -I${glibcpp_builddir}/include" + + # Passed down for canadian crosses. +- if test x"$CANADIAN" = xyes; then +- TOPLEVEL_INCLUDES='-I$(includedir)' +- fi ++ #if test x"$CANADIAN" = xyes; then ++ # TOPLEVEL_INCLUDES='-I$(includedir)' ++ #fi ++ TOPLEVEL_INCLUDES='' + + LIBMATH_INCLUDES='-I$(top_srcdir)/libmath' + +diff -ruN gcc-20030210.orig/libstdc++-v3/configure gcc-20030210/libstdc++-v3/configure +--- gcc-20030210.orig/libstdc++-v3/configure Mon Feb 10 19:37:17 2003 ++++ gcc-20030210/libstdc++-v3/configure Sat Feb 22 01:40:14 2003 +@@ -1982,7 +1982,7 @@ + # This must be Linux ELF. + linux-gnu*) + case $host_cpu in +- alpha* | hppa* | i*86 | powerpc* | sparc* | ia64* ) ++ alpha* | hppa* | i*86 | powerpc* | sparc* | ia64* | sh*) + lt_cv_deplibs_check_method=pass_all ;; + *) + # glibc up to 2.1.1 does not perform some relocations on ARM +@@ -22340,9 +22340,10 @@ + GLIBCPP_INCLUDES="-I${glibcpp_builddir}/include/${target_alias} -I${glibcpp_builddir}/include" + + # Passed down for canadian crosses. +- if test x"$CANADIAN" = xyes; then +- TOPLEVEL_INCLUDES='-I$(includedir)' +- fi ++ #if test x"$CANADIAN" = xyes; then ++ # TOPLEVEL_INCLUDES='-I$(includedir)' ++ #fi ++ TOPLEVEL_INCLUDES='' + + LIBMATH_INCLUDES='-I$(top_srcdir)/libmath' + +diff -ruN gcc-20030210.orig/libtool.m4 gcc-20030210/libtool.m4 +--- gcc-20030210.orig/libtool.m4 Fri Jan 31 19:16:59 2003 ++++ gcc-20030210/libtool.m4 Sat Feb 22 01:40:14 2003 +@@ -597,7 +597,7 @@ + # This must be Linux ELF. + linux-gnu*) + case $host_cpu in +- alpha* | hppa* | i*86 | powerpc* | sparc* | ia64* ) ++ alpha* | hppa* | i*86 | powerpc* | sparc* | ia64* | sh* ) + lt_cv_deplibs_check_method=pass_all ;; + *) + # glibc up to 2.1.1 does not perform some relocations on ARM +diff -ruN gcc-20030210.orig/zlib/configure gcc-20030210/zlib/configure +--- gcc-20030210.orig/zlib/configure Tue Jan 28 10:44:15 2003 ++++ gcc-20030210/zlib/configure Sat Feb 22 01:40:14 2003 +@@ -1571,7 +1571,7 @@ + # This must be Linux ELF. + linux-gnu*) + case $host_cpu in +- alpha* | hppa* | i*86 | powerpc* | sparc* | ia64* ) ++ alpha* | hppa* | i*86 | powerpc* | sparc* | ia64* | sh* ) + lt_cv_deplibs_check_method=pass_all ;; + *) + # glibc up to 2.1.1 does not perform some relocations on ARM diff --git a/patches/gcc/3.2.3/130-gcc-3.2.3-g++.exp.patch b/patches/gcc/3.2.3/130-gcc-3.2.3-g++.exp.patch new file mode 100644 index 0000000..0de46fc --- /dev/null +++ b/patches/gcc/3.2.3/130-gcc-3.2.3-g++.exp.patch @@ -0,0 +1,98 @@ +g++ testsuite fixes for cross-compilers, Dan Kegel, Ixia Communications, 12 July 2003 + +The first hunk fixes the error + +/testsuite_flags: /testsuite_flags: No such file or directory + while executing +"exec sh ${odir_v3}/testsuite_flags --build-includes" + (procedure "g++_include_flags" line 21) + invoked from within +"g++_include_flags [get_multilibs] " + (procedure "g++_init" line 63) + invoked from within +"${tool}_init $test_file_name" + (procedure "runtest" line 19) + invoked from within +"runtest $test_name" + ("foreach" body line 42) + invoked from within +... +make[1]: [check-g++] Error 1 (ignored) + +The fix isn't especially pretty, but it worked for me, and can't hurt the +more common native compiler case. Maybe someone who knows the code better +can come up with a better fix. + +The second hunk fixes the error + +sh: error while loading shared libraries: /opt/cegl-2.0/powerpc-405-linux-gnu/gcc-3.2.3-glibc-2.2.5/powerpc-405-linux-gnu/./lib/libdl.so.2: ELF file data encoding not little-endian + +when trying to compile g++ testcases (!); setting up +the shared library environment when running crosstests of g++ +should either be done by a special board file, or by +setting up a remote chroot environment (see http://kegel.com/crosstool), +not by blithely setting LD_LIBRARY_PATH on the local system. + +--- gcc-3.2.3/gcc/testsuite/lib/g++.exp.old Fri Jul 11 15:42:47 2003 ++++ gcc-3.2.3/gcc/testsuite/lib/g++.exp Sat Jul 12 12:57:07 2003 +@@ -72,6 +72,8 @@ + # + proc g++_include_flags { paths } { + global srcdir ++ global objdir ++ global target_triplet + global HAVE_LIBSTDCXX_V3 + global TESTING_IN_BUILD_TREE + +@@ -90,6 +92,20 @@ + + if { ${HAVE_LIBSTDCXX_V3} } { + set odir_v3 [lookfor_file ${gccpath} libstdc++-v3] ++ if { $odir_v3 == "" } { ++ verbose "g++_include_flags: couldn't find libstdc++-v3 on first try, now looking in build directory $objdir" ++ # first assume no multilibs ++ set odir_v3 [lookfor_file ${objdir} "$target_triplet/libstdc++-v3"] ++ } ++ if { $odir_v3 == "" } { ++ verbose "g++_include_flags: couldn't find libstdc++-v3 on second try, trying multilib" ++ # assume multilib only one level deep ++ set multisub [file tail $gccpath] ++ set odir_v3 [lookfor_file ${objdir} "$target_triplet/$multisub/libstdc++-v3"] ++ } ++ if { $odir_v3 == "" } { ++ error "Can't find libstdc++-v3" ++ } + append flags [exec sh ${odir_v3}/testsuite_flags --build-includes] + } else { + set odir_v2 [lookfor_file ${gccpath} libstdc++] +@@ -192,16 +192,20 @@ + } + } + +- # On IRIX 6, we have to set variables akin to LD_LIBRARY_PATH, but +- # called LD_LIBRARYN32_PATH (for the N32 ABI) and LD_LIBRARY64_PATH +- # (for the 64-bit ABI). The right way to do this would be to modify +- # unix.exp -- but that's not an option since it's part of DejaGNU +- # proper, so we do it here. We really only need to do +- # this on IRIX, but it shouldn't hurt to do it anywhere else. +- setenv LD_LIBRARY_PATH $ld_library_path +- setenv SHLIB_PATH $ld_library_path +- setenv LD_LIBRARYN32_PATH $ld_library_path +- setenv LD_LIBRARY64_PATH $ld_library_path ++ if {![is_remote target]} { ++ # On IRIX 6, we have to set variables akin to LD_LIBRARY_PATH, but ++ # called LD_LIBRARYN32_PATH (for the N32 ABI) and LD_LIBRARY64_PATH ++ # (for the 64-bit ABI). The right way to do this would be to modify ++ # unix.exp -- but that's not an option since it's part of DejaGNU ++ # proper, so we do it here. We really only need to do ++ # this on IRIX, but it shouldn't hurt to do it anywhere else. ++ ++ # Doing this causes us to be unable to run cross-compilers. ++ setenv LD_LIBRARY_PATH $ld_library_path ++ setenv SHLIB_PATH $ld_library_path ++ setenv LD_LIBRARYN32_PATH $ld_library_path ++ setenv LD_LIBRARY64_PATH $ld_library_path ++ } + + return "$flags" + } diff --git a/patches/gcc/3.2.3/140-gcc-3.2.3-libffi-1.patch b/patches/gcc/3.2.3/140-gcc-3.2.3-libffi-1.patch new file mode 100644 index 0000000..db78ba1 --- /dev/null +++ b/patches/gcc/3.2.3/140-gcc-3.2.3-libffi-1.patch @@ -0,0 +1,6864 @@ +diff -ruN --exclude=CVS gcc-3.2.2.orig/libffi/Makefile.am gcc/libffi/Makefile.am +--- gcc-3.2.2.orig/libffi/Makefile.am Tue Jan 28 10:43:56 2003 ++++ gcc/libffi/Makefile.am Tue Jan 28 10:48:33 2003 +@@ -8,14 +8,17 @@ + src/mips/n32.s src/mips/o32.S src/mips/o32.s \ + src/sparc/ffi.c src/sparc/v8.S src/sparc/v9.S \ + src/x86/ffi.c src/x86/sysv.S src/x86/win32.S \ ++ src/x86/ffi64.c src/x86/unix64.S \ + src/alpha/ffi.c src/alpha/osf.S \ + src/m68k/ffi.c src/m68k/sysv.S \ + src/powerpc/ffi.c src/powerpc/sysv.S \ + src/powerpc/ppc_closure.S src/powerpc/asm.h \ + src/powerpc/ffi_darwin.c \ + src/powerpc/darwin.S src/powerpc/aix.S \ +- src/powerpc/darwin_closure.S src/powerpc/aix_closures.S \ +- src/arm/ffi.c src/arm/sysv.S ++ src/powerpc/darwin_closure.S src/powerpc/aix_closure.S \ ++ src/arm/ffi.c src/arm/sysv.S \ ++ src/s390/ffi.c src/s390/sysv.S \ ++ src/sh/ffi.c src/sh/sysv.S + + VPATH = @srcdir@:@srcdir@/src:@srcdir@/src/@TARGETDIR@ + +@@ -83,6 +86,7 @@ + ffitest_LDFLAGS = -shared-libgcc + + TARGET_SRC_MIPS_GCC = src/mips/ffi.c src/mips/o32.S src/mips/n32.S ++TARGET_SRC_MIPS_LINUX = src/mips/ffi.c src/mips/o32.S + TARGET_SRC_MIPS_SGI = src/mips/ffi.c src/mips/o32.s src/mips/n32.s + TARGET_SRC_X86 = src/x86/ffi.c src/x86/sysv.S + TARGET_SRC_X86_WIN32 = src/x86/ffi.c src/x86/win32.S +@@ -91,9 +95,12 @@ + TARGET_SRC_IA64 = src/ia64/ffi.c src/ia64/unix.S + TARGET_SRC_M68K = src/m68k/ffi.c src/m68k/sysv.S + TARGET_SRC_POWERPC = src/powerpc/ffi.c src/powerpc/sysv.S src/powerpc/ppc_closure.S +-TARGET_SRC_POWERPC_AIX = src/powerpc/ffi_darwin.c src/powerpc/aix.S src/powerpc/aix_closures.S ++TARGET_SRC_POWERPC_AIX = src/powerpc/ffi_darwin.c src/powerpc/aix.S src/powerpc/aix_closure.S + TARGET_SRC_POWERPC_DARWIN = src/powerpc/ffi_darwin.c src/powerpc/darwin.S src/powerpc/darwin_closure.S + TARGET_SRC_ARM = src/arm/sysv.S src/arm/ffi.c ++TARGET_SRC_S390 = src/s390/sysv.S src/s390/ffi.c ++TARGET_SRC_X86_64 = src/x86/ffi64.c src/x86/unix64.S src/x86/ffi.c src/x86/sysv.S ++TARGET_SRC_SH = src/sh/sysv.S src/sh/ffi.c + + ##libffi_la_SOURCES = src/debug.c src/prep_cif.c src/types.c $(TARGET_SRC_@TARGET@) + ## Work around automake deficiency +@@ -103,6 +110,10 @@ + libffi_la_SOURCES = $(libffi_la_common_SOURCES) $(TARGET_SRC_MIPS_GCC) + libffi_convenience_la_SOURCES = $(libffi_la_common_SOURCES) $(TARGET_SRC_MIPS_GCC) + endif ++if MIPS_LINUX ++libffi_la_SOURCES = $(libffi_la_common_SOURCES) $(TARGET_SRC_MIPS_LINUX) ++libffi_convenience_la_SOURCES = $(libffi_la_common_SOURCES) $(TARGET_SRC_MIPS_LINUX) ++endif + if MIPS_SGI + libffi_la_SOURCES = $(libffi_la_common_SOURCES) $(TARGET_SRC_MIPS_SGI) + libffi_convenience_la_SOURCES = $(libffi_la_common_SOURCES) $(TARGET_SRC_MIPS_SGI) +@@ -147,6 +158,18 @@ + libffi_la_SOURCES = $(libffi_la_common_SOURCES) $(TARGET_SRC_ARM) + libffi_convenience_la_SOURCES = $(libffi_la_common_SOURCES) $(TARGET_SRC_ARM) + endif ++if S390 ++libffi_la_SOURCES = $(libffi_la_common_SOURCES) $(TARGET_SRC_S390) ++libffi_convenience_la_SOURCES = $(libffi_la_common_SOURCES) $(TARGET_SRC_S390) ++endif ++if X86_64 ++libffi_la_SOURCES = $(libffi_la_common_SOURCES) $(TARGET_SRC_X86_64) ++libffi_convenience_la_SOURCES = $(libffi_la_common_SOURCES) $(TARGET_SRC_X86_64) ++endif ++if SH ++libffi_la_SOURCES = $(libffi_la_common_SOURCES) $(TARGET_SRC_SH) ++libfficonvenience_la_SOURCES = $(libffi_la_common_SOURCES) $(TARGET_SRC_SH) ++endif + + AM_CFLAGS = -fexceptions + +diff -ruN --exclude=CVS gcc-3.2.2.orig/libffi/Makefile.in gcc/libffi/Makefile.in +--- gcc-3.2.2.orig/libffi/Makefile.in Wed Jan 29 07:59:05 2003 ++++ gcc/libffi/Makefile.in Wed Jan 29 07:58:58 2003 +@@ -91,14 +91,17 @@ + src/mips/n32.s src/mips/o32.S src/mips/o32.s \ + src/sparc/ffi.c src/sparc/v8.S src/sparc/v9.S \ + src/x86/ffi.c src/x86/sysv.S src/x86/win32.S \ ++ src/x86/ffi64.c src/x86/unix64.S \ + src/alpha/ffi.c src/alpha/osf.S \ + src/m68k/ffi.c src/m68k/sysv.S \ + src/powerpc/ffi.c src/powerpc/sysv.S \ + src/powerpc/ppc_closure.S src/powerpc/asm.h \ + src/powerpc/ffi_darwin.c \ + src/powerpc/darwin.S src/powerpc/aix.S \ +- src/powerpc/darwin_closure.S src/powerpc/aix_closures.S \ +- src/arm/ffi.c src/arm/sysv.S ++ src/powerpc/darwin_closure.S src/powerpc/aix_closure.S \ ++ src/arm/ffi.c src/arm/sysv.S \ ++ src/s390/ffi.c src/s390/sysv.S \ ++ src/sh/ffi.c src/sh/sysv.S + + + VPATH = @srcdir@:@srcdir@/src:@srcdir@/src/@TARGETDIR@ +@@ -162,6 +165,7 @@ + ffitest_LDFLAGS = -shared-libgcc + + TARGET_SRC_MIPS_GCC = src/mips/ffi.c src/mips/o32.S src/mips/n32.S ++TARGET_SRC_MIPS_LINUX = src/mips/ffi.c src/mips/o32.S + TARGET_SRC_MIPS_SGI = src/mips/ffi.c src/mips/o32.s src/mips/n32.s + TARGET_SRC_X86 = src/x86/ffi.c src/x86/sysv.S + TARGET_SRC_X86_WIN32 = src/x86/ffi.c src/x86/win32.S +@@ -170,14 +174,18 @@ + TARGET_SRC_IA64 = src/ia64/ffi.c src/ia64/unix.S + TARGET_SRC_M68K = src/m68k/ffi.c src/m68k/sysv.S + TARGET_SRC_POWERPC = src/powerpc/ffi.c src/powerpc/sysv.S src/powerpc/ppc_closure.S +-TARGET_SRC_POWERPC_AIX = src/powerpc/ffi_darwin.c src/powerpc/aix.S src/powerpc/aix_closures.S ++TARGET_SRC_POWERPC_AIX = src/powerpc/ffi_darwin.c src/powerpc/aix.S src/powerpc/aix_closure.S + TARGET_SRC_POWERPC_DARWIN = src/powerpc/ffi_darwin.c src/powerpc/darwin.S src/powerpc/darwin_closure.S + TARGET_SRC_ARM = src/arm/sysv.S src/arm/ffi.c ++TARGET_SRC_S390 = src/s390/sysv.S src/s390/ffi.c ++TARGET_SRC_X86_64 = src/x86/ffi64.c src/x86/unix64.S src/x86/ffi.c src/x86/sysv.S ++TARGET_SRC_SH = src/sh/sysv.S src/sh/ffi.c + + libffi_la_common_SOURCES = src/debug.c src/prep_cif.c src/types.c \ + src/raw_api.c src/java_raw_api.c + + @MIPS_GCC_TRUE@libffi_la_SOURCES = @MIPS_GCC_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_MIPS_GCC) ++@MIPS_LINUX_TRUE@libffi_la_SOURCES = @MIPS_LINUX_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_MIPS_LINUX) + @MIPS_SGI_TRUE@libffi_la_SOURCES = @MIPS_SGI_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_MIPS_SGI) + @X86_TRUE@libffi_la_SOURCES = @X86_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_X86) + @X86_WIN32_TRUE@libffi_la_SOURCES = @X86_WIN32_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_X86_WIN32) +@@ -189,7 +197,11 @@ + @POWERPC_AIX_TRUE@libffi_la_SOURCES = @POWERPC_AIX_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_POWERPC_AIX) + @POWERPC_DARWIN_TRUE@libffi_la_SOURCES = @POWERPC_DARWIN_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_POWERPC_DARWIN) + @ARM_TRUE@libffi_la_SOURCES = @ARM_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_ARM) ++@S390_TRUE@libffi_la_SOURCES = @S390_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_S390) ++@X86_64_TRUE@libffi_la_SOURCES = @X86_64_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_X86_64) ++@SH_TRUE@libffi_la_SOURCES = @SH_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_SH) + @MIPS_GCC_TRUE@libffi_convenience_la_SOURCES = @MIPS_GCC_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_MIPS_GCC) ++@MIPS_LINUX_TRUE@libffi_convenience_la_SOURCES = @MIPS_LINUX_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_MIPS_LINUX) + @MIPS_SGI_TRUE@libffi_convenience_la_SOURCES = @MIPS_SGI_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_MIPS_SGI) + @X86_TRUE@libffi_convenience_la_SOURCES = @X86_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_X86) + @X86_WIN32_TRUE@libffi_convenience_la_SOURCES = @X86_WIN32_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_X86_WIN32) +@@ -201,6 +213,9 @@ + @POWERPC_AIX_TRUE@libffi_convenience_la_SOURCES = @POWERPC_AIX_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_POWERPC_AIX) + @POWERPC_DARWIN_TRUE@libffi_convenience_la_SOURCES = @POWERPC_DARWIN_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_POWERPC_DARWIN) + @ARM_TRUE@libffi_convenience_la_SOURCES = @ARM_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_ARM) ++@S390_TRUE@libffi_convenience_la_SOURCES = @S390_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_S390) ++@X86_64_TRUE@libffi_convenience_la_SOURCES = @X86_64_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_X86_64) ++@SH_TRUE@libfficonvenience_la_SOURCES = @SH_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_SH) + + AM_CFLAGS = -fexceptions + +@@ -208,7 +223,7 @@ + + INCLUDES = -I$(top_srcdir)/include -Iinclude -I$(top_srcdir)/src + ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 +-mkinstalldirs = $(SHELL) $(top_srcdir)/../mkinstalldirs ++mkinstalldirs = $(SHELL) $(top_srcdir)/${libffi_basedir}/../mkinstalldirs + CONFIG_HEADER = fficonfig.h + CONFIG_CLEAN_FILES = + LTLIBRARIES = $(noinst_LTLIBRARIES) $(toolexeclib_LTLIBRARIES) +@@ -220,10 +235,6 @@ + LIBS = @LIBS@ + libffi_convenience_la_LDFLAGS = + libffi_convenience_la_LIBADD = +-@POWERPC_TRUE@libffi_convenience_la_OBJECTS = src/debug.lo \ +-@POWERPC_TRUE@src/prep_cif.lo src/types.lo src/raw_api.lo \ +-@POWERPC_TRUE@src/java_raw_api.lo src/powerpc/ffi.lo \ +-@POWERPC_TRUE@src/powerpc/sysv.lo src/powerpc/ppc_closure.lo + @ALPHA_TRUE@libffi_convenience_la_OBJECTS = src/debug.lo \ + @ALPHA_TRUE@src/prep_cif.lo src/types.lo src/raw_api.lo \ + @ALPHA_TRUE@src/java_raw_api.lo src/alpha/ffi.lo src/alpha/osf.lo +@@ -234,12 +245,29 @@ + @MIPS_GCC_TRUE@src/prep_cif.lo src/types.lo src/raw_api.lo \ + @MIPS_GCC_TRUE@src/java_raw_api.lo src/mips/ffi.lo src/mips/o32.lo \ + @MIPS_GCC_TRUE@src/mips/n32.lo +-@X86_WIN32_TRUE@libffi_convenience_la_OBJECTS = src/debug.lo \ +-@X86_WIN32_TRUE@src/prep_cif.lo src/types.lo src/raw_api.lo \ +-@X86_WIN32_TRUE@src/java_raw_api.lo src/x86/ffi.lo src/x86/win32.lo ++@S390_TRUE@libffi_convenience_la_OBJECTS = src/debug.lo src/prep_cif.lo \ ++@S390_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \ ++@S390_TRUE@src/s390/sysv.lo src/s390/ffi.lo + @M68K_TRUE@libffi_convenience_la_OBJECTS = src/debug.lo src/prep_cif.lo \ + @M68K_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \ + @M68K_TRUE@src/m68k/ffi.lo src/m68k/sysv.lo ++@X86_TRUE@libffi_convenience_la_OBJECTS = src/debug.lo src/prep_cif.lo \ ++@X86_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \ ++@X86_TRUE@src/x86/ffi.lo src/x86/sysv.lo ++@POWERPC_TRUE@libffi_convenience_la_OBJECTS = src/debug.lo \ ++@POWERPC_TRUE@src/prep_cif.lo src/types.lo src/raw_api.lo \ ++@POWERPC_TRUE@src/java_raw_api.lo src/powerpc/ffi.lo \ ++@POWERPC_TRUE@src/powerpc/sysv.lo src/powerpc/ppc_closure.lo ++@MIPS_LINUX_TRUE@libffi_convenience_la_OBJECTS = src/debug.lo \ ++@MIPS_LINUX_TRUE@src/prep_cif.lo src/types.lo src/raw_api.lo \ ++@MIPS_LINUX_TRUE@src/java_raw_api.lo src/mips/ffi.lo src/mips/o32.lo ++@X86_WIN32_TRUE@libffi_convenience_la_OBJECTS = src/debug.lo \ ++@X86_WIN32_TRUE@src/prep_cif.lo src/types.lo src/raw_api.lo \ ++@X86_WIN32_TRUE@src/java_raw_api.lo src/x86/ffi.lo src/x86/win32.lo ++@X86_64_TRUE@libffi_convenience_la_OBJECTS = src/debug.lo \ ++@X86_64_TRUE@src/prep_cif.lo src/types.lo src/raw_api.lo \ ++@X86_64_TRUE@src/java_raw_api.lo src/x86/ffi64.lo src/x86/unix64.lo \ ++@X86_64_TRUE@src/x86/ffi.lo src/x86/sysv.lo + @SPARC_TRUE@libffi_convenience_la_OBJECTS = src/debug.lo \ + @SPARC_TRUE@src/prep_cif.lo src/types.lo src/raw_api.lo \ + @SPARC_TRUE@src/java_raw_api.lo src/sparc/ffi.lo src/sparc/v8.lo \ +@@ -247,62 +275,75 @@ + @POWERPC_AIX_TRUE@libffi_convenience_la_OBJECTS = src/debug.lo \ + @POWERPC_AIX_TRUE@src/prep_cif.lo src/types.lo src/raw_api.lo \ + @POWERPC_AIX_TRUE@src/java_raw_api.lo src/powerpc/ffi_darwin.lo \ +-@POWERPC_AIX_TRUE@src/powerpc/aix.lo src/powerpc/aix_closures.lo +-@X86_TRUE@libffi_convenience_la_OBJECTS = src/debug.lo src/prep_cif.lo \ +-@X86_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \ +-@X86_TRUE@src/x86/ffi.lo src/x86/sysv.lo +-@ARM_TRUE@libffi_convenience_la_OBJECTS = src/debug.lo src/prep_cif.lo \ +-@ARM_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \ +-@ARM_TRUE@src/arm/sysv.lo src/arm/ffi.lo ++@POWERPC_AIX_TRUE@src/powerpc/aix.lo src/powerpc/aix_closure.lo ++@MIPS_SGI_TRUE@libffi_convenience_la_OBJECTS = src/debug.lo \ ++@MIPS_SGI_TRUE@src/prep_cif.lo src/types.lo src/raw_api.lo \ ++@MIPS_SGI_TRUE@src/java_raw_api.lo src/mips/ffi.lo src/mips/o32.lo \ ++@MIPS_SGI_TRUE@src/mips/n32.lo + @POWERPC_DARWIN_TRUE@libffi_convenience_la_OBJECTS = src/debug.lo \ + @POWERPC_DARWIN_TRUE@src/prep_cif.lo src/types.lo src/raw_api.lo \ + @POWERPC_DARWIN_TRUE@src/java_raw_api.lo src/powerpc/ffi_darwin.lo \ + @POWERPC_DARWIN_TRUE@src/powerpc/darwin.lo \ + @POWERPC_DARWIN_TRUE@src/powerpc/darwin_closure.lo +-@MIPS_SGI_TRUE@libffi_convenience_la_OBJECTS = src/debug.lo \ +-@MIPS_SGI_TRUE@src/prep_cif.lo src/types.lo src/raw_api.lo \ +-@MIPS_SGI_TRUE@src/java_raw_api.lo src/mips/ffi.lo src/mips/o32.lo \ +-@MIPS_SGI_TRUE@src/mips/n32.lo ++@ARM_TRUE@libffi_convenience_la_OBJECTS = src/debug.lo src/prep_cif.lo \ ++@ARM_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \ ++@ARM_TRUE@src/arm/sysv.lo src/arm/ffi.lo ++@SH_TRUE@libffi_convenience_la_OBJECTS = src/debug.lo src/prep_cif.lo \ ++@SH_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \ ++@SH_TRUE@src/sh/sysv.lo src/sh/ffi.lo + libffi_la_LIBADD = ++@SH_TRUE@libffi_la_OBJECTS = src/debug.lo src/prep_cif.lo src/types.lo \ ++@SH_TRUE@src/raw_api.lo src/java_raw_api.lo src/sh/sysv.lo \ ++@SH_TRUE@src/sh/ffi.lo ++@IA64_TRUE@libffi_la_OBJECTS = src/debug.lo src/prep_cif.lo \ ++@IA64_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \ ++@IA64_TRUE@src/ia64/ffi.lo src/ia64/unix.lo ++@X86_TRUE@libffi_la_OBJECTS = src/debug.lo src/prep_cif.lo src/types.lo \ ++@X86_TRUE@src/raw_api.lo src/java_raw_api.lo src/x86/ffi.lo \ ++@X86_TRUE@src/x86/sysv.lo + @POWERPC_TRUE@libffi_la_OBJECTS = src/debug.lo src/prep_cif.lo \ + @POWERPC_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \ + @POWERPC_TRUE@src/powerpc/ffi.lo src/powerpc/sysv.lo \ + @POWERPC_TRUE@src/powerpc/ppc_closure.lo +-@ALPHA_TRUE@libffi_la_OBJECTS = src/debug.lo src/prep_cif.lo \ +-@ALPHA_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \ +-@ALPHA_TRUE@src/alpha/ffi.lo src/alpha/osf.lo +-@IA64_TRUE@libffi_la_OBJECTS = src/debug.lo src/prep_cif.lo \ +-@IA64_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \ +-@IA64_TRUE@src/ia64/ffi.lo src/ia64/unix.lo +-@MIPS_GCC_TRUE@libffi_la_OBJECTS = src/debug.lo src/prep_cif.lo \ +-@MIPS_GCC_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \ +-@MIPS_GCC_TRUE@src/mips/ffi.lo src/mips/o32.lo src/mips/n32.lo +-@X86_WIN32_TRUE@libffi_la_OBJECTS = src/debug.lo src/prep_cif.lo \ +-@X86_WIN32_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \ +-@X86_WIN32_TRUE@src/x86/ffi.lo src/x86/win32.lo +-@M68K_TRUE@libffi_la_OBJECTS = src/debug.lo src/prep_cif.lo \ +-@M68K_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \ +-@M68K_TRUE@src/m68k/ffi.lo src/m68k/sysv.lo ++@MIPS_LINUX_TRUE@libffi_la_OBJECTS = src/debug.lo src/prep_cif.lo \ ++@MIPS_LINUX_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \ ++@MIPS_LINUX_TRUE@src/mips/ffi.lo src/mips/o32.lo + @SPARC_TRUE@libffi_la_OBJECTS = src/debug.lo src/prep_cif.lo \ + @SPARC_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \ + @SPARC_TRUE@src/sparc/ffi.lo src/sparc/v8.lo src/sparc/v9.lo + @POWERPC_AIX_TRUE@libffi_la_OBJECTS = src/debug.lo src/prep_cif.lo \ + @POWERPC_AIX_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \ + @POWERPC_AIX_TRUE@src/powerpc/ffi_darwin.lo src/powerpc/aix.lo \ +-@POWERPC_AIX_TRUE@src/powerpc/aix_closures.lo +-@X86_TRUE@libffi_la_OBJECTS = src/debug.lo src/prep_cif.lo src/types.lo \ +-@X86_TRUE@src/raw_api.lo src/java_raw_api.lo src/x86/ffi.lo \ +-@X86_TRUE@src/x86/sysv.lo ++@POWERPC_AIX_TRUE@src/powerpc/aix_closure.lo ++@MIPS_SGI_TRUE@libffi_la_OBJECTS = src/debug.lo src/prep_cif.lo \ ++@MIPS_SGI_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \ ++@MIPS_SGI_TRUE@src/mips/ffi.lo src/mips/o32.lo src/mips/n32.lo + @ARM_TRUE@libffi_la_OBJECTS = src/debug.lo src/prep_cif.lo src/types.lo \ + @ARM_TRUE@src/raw_api.lo src/java_raw_api.lo src/arm/sysv.lo \ + @ARM_TRUE@src/arm/ffi.lo ++@ALPHA_TRUE@libffi_la_OBJECTS = src/debug.lo src/prep_cif.lo \ ++@ALPHA_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \ ++@ALPHA_TRUE@src/alpha/ffi.lo src/alpha/osf.lo ++@MIPS_GCC_TRUE@libffi_la_OBJECTS = src/debug.lo src/prep_cif.lo \ ++@MIPS_GCC_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \ ++@MIPS_GCC_TRUE@src/mips/ffi.lo src/mips/o32.lo src/mips/n32.lo ++@S390_TRUE@libffi_la_OBJECTS = src/debug.lo src/prep_cif.lo \ ++@S390_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \ ++@S390_TRUE@src/s390/sysv.lo src/s390/ffi.lo ++@M68K_TRUE@libffi_la_OBJECTS = src/debug.lo src/prep_cif.lo \ ++@M68K_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \ ++@M68K_TRUE@src/m68k/ffi.lo src/m68k/sysv.lo ++@X86_WIN32_TRUE@libffi_la_OBJECTS = src/debug.lo src/prep_cif.lo \ ++@X86_WIN32_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \ ++@X86_WIN32_TRUE@src/x86/ffi.lo src/x86/win32.lo ++@X86_64_TRUE@libffi_la_OBJECTS = src/debug.lo src/prep_cif.lo \ ++@X86_64_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \ ++@X86_64_TRUE@src/x86/ffi64.lo src/x86/unix64.lo src/x86/ffi.lo \ ++@X86_64_TRUE@src/x86/sysv.lo + @POWERPC_DARWIN_TRUE@libffi_la_OBJECTS = src/debug.lo src/prep_cif.lo \ + @POWERPC_DARWIN_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \ + @POWERPC_DARWIN_TRUE@src/powerpc/ffi_darwin.lo src/powerpc/darwin.lo \ + @POWERPC_DARWIN_TRUE@src/powerpc/darwin_closure.lo +-@MIPS_SGI_TRUE@libffi_la_OBJECTS = src/debug.lo src/prep_cif.lo \ +-@MIPS_SGI_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \ +-@MIPS_SGI_TRUE@src/mips/ffi.lo src/mips/o32.lo src/mips/n32.lo + noinst_PROGRAMS = ffitest$(EXEEXT) + PROGRAMS = $(noinst_PROGRAMS) + +@@ -578,8 +616,8 @@ + -chmod 777 $(distdir) + $(mkinstalldirs) $(distdir)/src/alpha $(distdir)/src/arm \ + $(distdir)/src/m68k $(distdir)/src/mips \ +- $(distdir)/src/powerpc $(distdir)/src/sparc \ +- $(distdir)/src/x86 ++ $(distdir)/src/powerpc $(distdir)/src/s390 $(distdir)/src/sh \ ++ $(distdir)/src/sparc $(distdir)/src/x86 + @for file in $(DISTFILES); do \ + if test -f $$file; then d=.; else d=$(srcdir); fi; \ + if test -d $$d/$$file; then \ +diff -ruN --exclude=CVS gcc-3.2.2.orig/libffi/acinclude.m4 gcc/libffi/acinclude.m4 +--- gcc-3.2.2.orig/libffi/acinclude.m4 Sun Sep 10 16:43:14 2000 ++++ gcc/libffi/acinclude.m4 Tue Dec 17 03:22:47 2002 +@@ -4,5 +4,8 @@ + dnl to add a definition of LIBTOOL to Makefile.in. + ifelse(yes,no,[ + AC_DEFUN([AC_PROG_LIBTOOL],) ++AC_DEFUN([AM_PROG_LIBTOOL],) + AC_SUBST(LIBTOOL) + ]) ++ ++sinclude(../config/accross.m4) +diff -ruN --exclude=CVS gcc-3.2.2.orig/libffi/aclocal.m4 gcc/libffi/aclocal.m4 +--- gcc-3.2.2.orig/libffi/aclocal.m4 Fri Feb 1 07:25:31 2002 ++++ gcc/libffi/aclocal.m4 Tue Dec 17 03:22:47 2002 +@@ -1,6 +1,6 @@ +-dnl aclocal.m4 generated automatically by aclocal 1.4 ++dnl aclocal.m4 generated automatically by aclocal 1.4-p5 + +-dnl Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc. ++dnl Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc. + dnl This file is free software; the Free Software Foundation + dnl gives unlimited permission to copy and/or distribute it, + dnl with or without modifications, as long as this notice is preserved. +@@ -16,108 +16,15 @@ + dnl to add a definition of LIBTOOL to Makefile.in. + ifelse(yes,no,[ + AC_DEFUN([AC_PROG_LIBTOOL],) ++AC_DEFUN([AM_PROG_LIBTOOL],) + AC_SUBST(LIBTOOL) + ]) + +-AC_DEFUN([AC_COMPILE_CHECK_SIZEOF], +-[changequote(<<, >>)dnl +-dnl The name to #define. +-define(<>, translit(sizeof_$1, [a-z *], [A-Z_P]))dnl +-dnl The cache variable name. +-define(<>, translit(ac_cv_sizeof_$1, [ *], [_p]))dnl +-changequote([, ])dnl +-AC_MSG_CHECKING(size of $1) +-AC_CACHE_VAL(AC_CV_NAME, +-[for ac_size in 4 8 1 2 16 12 $2 ; do # List sizes in rough order of prevalence. +- AC_TRY_COMPILE([#include "confdefs.h" +-#include +-$2 +-], [switch (0) case 0: case (sizeof ($1) == $ac_size):;], AC_CV_NAME=$ac_size) +- if test x$AC_CV_NAME != x ; then break; fi +-done +-]) +-if test x$AC_CV_NAME = x ; then +- AC_MSG_ERROR([cannot determine a size for $1]) +-fi +-AC_MSG_RESULT($AC_CV_NAME) +-AC_DEFINE_UNQUOTED(AC_TYPE_NAME, $AC_CV_NAME, [The number of bytes in type $1]) +-undefine([AC_TYPE_NAME])dnl +-undefine([AC_CV_NAME])dnl +-]) +- +-AC_DEFUN([AC_C_BIGENDIAN_CROSS], +-[AC_CACHE_CHECK(whether byte ordering is bigendian, ac_cv_c_bigendian, +-[ac_cv_c_bigendian=unknown +-# See if sys/param.h defines the BYTE_ORDER macro. +-AC_TRY_COMPILE([#include +-#include ], [ +-#if !BYTE_ORDER || !BIG_ENDIAN || !LITTLE_ENDIAN +- bogus endian macros +-#endif], [# It does; now see whether it defined to BIG_ENDIAN or not. +-AC_TRY_COMPILE([#include +-#include ], [ +-#if BYTE_ORDER != BIG_ENDIAN +- not big endian +-#endif], ac_cv_c_bigendian=yes, ac_cv_c_bigendian=no)]) +-if test $ac_cv_c_bigendian = unknown; then +-AC_TRY_RUN([main () { +- /* Are we little or big endian? From Harbison&Steele. */ +- union +- { +- long l; +- char c[sizeof (long)]; +- } u; +- u.l = 1; +- exit (u.c[sizeof (long) - 1] == 1); +-}], ac_cv_c_bigendian=no, ac_cv_c_bigendian=yes, +-[ echo $ac_n "cross-compiling... " 2>&AC_FD_MSG ]) +-fi]) +-if test $ac_cv_c_bigendian = unknown; then +-AC_MSG_CHECKING(to probe for byte ordering) +-[ +-cat >conftest.c <&AC_FD_MSG +- ac_cv_c_bigendian=yes +- fi +- if test `grep -l LiTTleEnDian conftest.o` ; then +- echo $ac_n ' little endian probe OK, ' 1>&AC_FD_MSG +- if test $ac_cv_c_bigendian = yes ; then +- ac_cv_c_bigendian=unknown; +- else +- ac_cv_c_bigendian=no +- fi +- fi +- echo $ac_n 'guessing bigendian ... ' >&AC_FD_MSG +- fi +- fi +-AC_MSG_RESULT($ac_cv_c_bigendian) +-fi +-if test $ac_cv_c_bigendian = yes; then +- AC_DEFINE(WORDS_BIGENDIAN, 1, [whether byteorder is bigendian]) +- BYTEORDER=4321 +-else +- BYTEORDER=1234 +-fi +-AC_DEFINE_UNQUOTED(BYTEORDER, $BYTEORDER, [1234 = LIL_ENDIAN, 4321 = BIGENDIAN]) +-if test $ac_cv_c_bigendian = unknown; then +- AC_MSG_ERROR(unknown endianess - sorry, please pre-set ac_cv_c_bigendian) +-fi +-]) ++sinclude(../config/accross.m4) + + # Like AC_CONFIG_HEADER, but automatically create stamp file. + +-AC_DEFUN(AM_CONFIG_HEADER, ++AC_DEFUN([AM_CONFIG_HEADER], + [AC_PREREQ([2.12]) + AC_CONFIG_HEADER([$1]) + dnl When config.status generates a header, we must update the stamp-h file. +@@ -147,7 +54,7 @@ + dnl Usage: + dnl AM_INIT_AUTOMAKE(package,version, [no-define]) + +-AC_DEFUN(AM_INIT_AUTOMAKE, ++AC_DEFUN([AM_INIT_AUTOMAKE], + [AC_REQUIRE([AC_PROG_INSTALL]) + PACKAGE=[$1] + AC_SUBST(PACKAGE) +@@ -175,7 +82,7 @@ + # Check to make sure that the build environment is sane. + # + +-AC_DEFUN(AM_SANITY_CHECK, ++AC_DEFUN([AM_SANITY_CHECK], + [AC_MSG_CHECKING([whether build environment is sane]) + # Just in case + sleep 1 +@@ -216,7 +123,7 @@ + + dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY) + dnl The program must properly implement --version. +-AC_DEFUN(AM_MISSING_PROG, ++AC_DEFUN([AM_MISSING_PROG], + [AC_MSG_CHECKING(for working $2) + # Run test in a subshell; some versions of sh will print an error if + # an executable is not found, even if stderr is redirected. +@@ -235,7 +142,7 @@ + + # serial 1 + +-AC_DEFUN(AM_MAINTAINER_MODE, ++AC_DEFUN([AM_MAINTAINER_MODE], + [AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles]) + dnl maintainer-mode is disabled by default + AC_ARG_ENABLE(maintainer-mode, +@@ -252,7 +159,7 @@ + + # Define a conditional. + +-AC_DEFUN(AM_CONDITIONAL, ++AC_DEFUN([AM_CONDITIONAL], + [AC_SUBST($1_TRUE) + AC_SUBST($1_FALSE) + if $2; then +diff -ruN --exclude=CVS gcc-3.2.2.orig/libffi/configure gcc/libffi/configure +--- gcc-3.2.2.orig/libffi/configure Wed Jan 29 07:59:05 2003 ++++ gcc/libffi/configure Sat Feb 1 20:16:19 2003 +@@ -633,17 +633,16 @@ + + if test "${srcdir}" = "."; then + if test "${with_target_subdir}" != "."; then +- libffi_basedir="${srcdir}/${with_multisrctop}.." ++ libffi_basedir="${with_multisrctop}../" + else +- libffi_basedir="${srcdir}/${with_multisrctop}" ++ libffi_basedir="${with_multisrctop}" + fi + else +- libffi_basedir="${srcdir}" ++ libffi_basedir= + fi + +- + ac_aux_dir= +-for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do ++for ac_dir in ${libffi_basedir}.. $srcdir/${libffi_basedir}..; do + if test -f $ac_dir/install-sh; then + ac_aux_dir=$ac_dir + ac_install_sh="$ac_aux_dir/install-sh -c" +@@ -655,13 +654,14 @@ + fi + done + if test -z "$ac_aux_dir"; then +- { echo "configure: error: can not find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." 1>&2; exit 1; } ++ { echo "configure: error: can not find install-sh or install.sh in ${libffi_basedir}.. $srcdir/${libffi_basedir}.." 1>&2; exit 1; } + fi + ac_config_guess=$ac_aux_dir/config.guess + ac_config_sub=$ac_aux_dir/config.sub + ac_configure=$ac_aux_dir/configure # This should be Cygnus configure. + + ++ + # Make sure we can run config.sub. + if ${CONFIG_SHELL-/bin/sh} $ac_config_sub sun4 >/dev/null 2>&1; then : + else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; } +@@ -1238,9 +1238,18 @@ + ;; + + hpux10.20*|hpux11*) +- lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9].[0-9]) shared library' +- lt_cv_file_magic_cmd=/usr/bin/file +- lt_cv_file_magic_test_file=/usr/lib/libc.sl ++ case $host_cpu in ++ hppa*) ++ lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9].[0-9]) shared library' ++ lt_cv_file_magic_cmd=/usr/bin/file ++ lt_cv_file_magic_test_file=/usr/lib/libc.sl ++ ;; ++ ia64*) ++ lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64' ++ lt_cv_file_magic_cmd=/usr/bin/file ++ lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so ++ ;; ++ esac + ;; + + irix5* | irix6*) +@@ -1267,7 +1276,7 @@ + # This must be Linux ELF. + linux-gnu*) + case $host_cpu in +- alpha* | hppa* | i*86 | powerpc* | sparc* | ia64* ) ++ alpha* | hppa* | i*86 | powerpc* | sparc* | ia64* | sh* ) + lt_cv_deplibs_check_method=pass_all ;; + *) + # glibc up to 2.1.1 does not perform some relocations on ARM +@@ -1330,13 +1339,13 @@ + deplibs_check_method=$lt_cv_deplibs_check_method + + echo $ac_n "checking for object suffix""... $ac_c" 1>&6 +-echo "configure:1334: checking for object suffix" >&5 ++echo "configure:1343: checking for object suffix" >&5 + if eval "test \"`echo '$''{'ac_cv_objext'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + rm -f conftest* + echo 'int i = 1;' > conftest.$ac_ext +-if { (eval echo configure:1340: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then ++if { (eval echo configure:1349: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + for ac_file in conftest.*; do + case $ac_file in + *.c) ;; +@@ -1356,7 +1365,7 @@ + + + echo $ac_n "checking for executable suffix""... $ac_c" 1>&6 +-echo "configure:1360: checking for executable suffix" >&5 ++echo "configure:1369: checking for executable suffix" >&5 + if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else +@@ -1366,7 +1375,7 @@ + rm -f conftest* + echo 'int main () { return 0; }' > conftest.$ac_ext + ac_cv_exeext= +- if { (eval echo configure:1370: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then ++ if { (eval echo configure:1379: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then + for file in conftest.*; do + case $file in + *.c | *.o | *.obj) ;; +@@ -1399,7 +1408,7 @@ + file_magic*) + if test "$file_magic_cmd" = '$MAGIC_CMD'; then + echo $ac_n "checking for ${ac_tool_prefix}file""... $ac_c" 1>&6 +-echo "configure:1403: checking for ${ac_tool_prefix}file" >&5 ++echo "configure:1412: checking for ${ac_tool_prefix}file" >&5 + if eval "test \"`echo '$''{'lt_cv_path_MAGIC_CMD'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else +@@ -1461,7 +1470,7 @@ + if test -z "$lt_cv_path_MAGIC_CMD"; then + if test -n "$ac_tool_prefix"; then + echo $ac_n "checking for file""... $ac_c" 1>&6 +-echo "configure:1465: checking for file" >&5 ++echo "configure:1474: checking for file" >&5 + if eval "test \"`echo '$''{'lt_cv_path_MAGIC_CMD'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else +@@ -1532,7 +1541,7 @@ + # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. + set dummy ${ac_tool_prefix}ranlib; ac_word=$2 + echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +-echo "configure:1536: checking for $ac_word" >&5 ++echo "configure:1545: checking for $ac_word" >&5 + if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else +@@ -1564,7 +1573,7 @@ + # Extract the first word of "ranlib", so it can be a program name with args. + set dummy ranlib; ac_word=$2 + echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +-echo "configure:1568: checking for $ac_word" >&5 ++echo "configure:1577: checking for $ac_word" >&5 + if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else +@@ -1599,7 +1608,7 @@ + # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. + set dummy ${ac_tool_prefix}strip; ac_word=$2 + echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +-echo "configure:1603: checking for $ac_word" >&5 ++echo "configure:1612: checking for $ac_word" >&5 + if eval "test \"`echo '$''{'ac_cv_prog_STRIP'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else +@@ -1631,7 +1640,7 @@ + # Extract the first word of "strip", so it can be a program name with args. + set dummy strip; ac_word=$2 + echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +-echo "configure:1635: checking for $ac_word" >&5 ++echo "configure:1644: checking for $ac_word" >&5 + if eval "test \"`echo '$''{'ac_cv_prog_STRIP'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else +@@ -1698,8 +1707,8 @@ + case $host in + *-*-irix6*) + # Find out which ABI we are using. +- echo '#line 1702 "configure"' > conftest.$ac_ext +- if { (eval echo configure:1703: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then ++ echo '#line 1711 "configure"' > conftest.$ac_ext ++ if { (eval echo configure:1712: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + case `/usr/bin/file conftest.$ac_objext` in + *32-bit*) + LD="${LD-ld} -32" +@@ -1715,12 +1724,70 @@ + rm -rf conftest* + ;; + ++ia64-*-hpux*) ++ # Find out which ABI we are using. ++ echo 'int i;' > conftest.$ac_ext ++ if { (eval echo configure:1731: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then ++ case "`/usr/bin/file conftest.o`" in ++ *ELF-32*) ++ HPUX_IA64_MODE="32" ++ ;; ++ *ELF-64*) ++ HPUX_IA64_MODE="64" ++ ;; ++ esac ++ fi ++ rm -rf conftest* ++ ;; ++ ++x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*|s390*-*linux*|sparc*-*linux*) ++ # Find out which ABI we are using. ++ echo 'int i;' > conftest.$ac_ext ++ if { (eval echo configure:1747: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then ++ case "`/usr/bin/file conftest.o`" in ++ *32-bit*) ++ case $host in ++ x86_64-*linux*) ++ LD="${LD-ld} -m elf_i386" ++ ;; ++ ppc64-*linux*) ++ LD="${LD-ld} -m elf32ppclinux" ++ ;; ++ s390x-*linux*) ++ LD="${LD-ld} -m elf_s390" ++ ;; ++ sparc64-*linux*) ++ LD="${LD-ld} -m elf32_sparc" ++ ;; ++ esac ++ ;; ++ *64-bit*) ++ case $host in ++ x86_64-*linux*) ++ LD="${LD-ld} -m elf_x86_64" ++ ;; ++ ppc*-*linux*|powerpc*-*linux*) ++ LD="${LD-ld} -m elf64ppc" ++ ;; ++ s390*-*linux*) ++ LD="${LD-ld} -m elf64_s390" ++ ;; ++ sparc*-*linux*) ++ LD="${LD-ld} -m elf64_sparc" ++ ;; ++ esac ++ ;; ++ esac ++ fi ++ rm -rf conftest* ++ ;; ++ + *-*-sco3.2v5*) + # On SCO OpenServer 5, we need -belf to get full-featured binaries. + SAVE_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS -belf" + echo $ac_n "checking whether the C compiler needs -belf""... $ac_c" 1>&6 +-echo "configure:1724: checking whether the C compiler needs -belf" >&5 ++echo "configure:1791: checking whether the C compiler needs -belf" >&5 + if eval "test \"`echo '$''{'lt_cv_cc_needs_belf'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else +@@ -1733,14 +1800,14 @@ + cross_compiling=$ac_cv_prog_cc_cross + + cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:1811: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + lt_cv_cc_needs_belf=yes + else +@@ -1868,7 +1935,7 @@ + # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" + # ./install, which can be erroneously created by make from ./install.sh. + echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 +-echo "configure:1872: checking for a BSD compatible install" >&5 ++echo "configure:1939: checking for a BSD compatible install" >&5 + if test -z "$INSTALL"; then + if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +@@ -1921,7 +1988,7 @@ + test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + + echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6 +-echo "configure:1925: checking whether build environment is sane" >&5 ++echo "configure:1992: checking whether build environment is sane" >&5 + # Just in case + sleep 1 + echo timestamp > conftestfile +@@ -1978,7 +2045,7 @@ + test "$program_transform_name" = "" && program_transform_name="s,x,x," + + echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6 +-echo "configure:1982: checking whether ${MAKE-make} sets \${MAKE}" >&5 ++echo "configure:2049: checking whether ${MAKE-make} sets \${MAKE}" >&5 + set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'` + if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +@@ -2017,7 +2084,7 @@ + + missing_dir=`cd $ac_aux_dir && pwd` + echo $ac_n "checking for working aclocal""... $ac_c" 1>&6 +-echo "configure:2021: checking for working aclocal" >&5 ++echo "configure:2088: checking for working aclocal" >&5 + # Run test in a subshell; some versions of sh will print an error if + # an executable is not found, even if stderr is redirected. + # Redirect stdin to placate older versions of autoconf. Sigh. +@@ -2030,7 +2097,7 @@ + fi + + echo $ac_n "checking for working autoconf""... $ac_c" 1>&6 +-echo "configure:2034: checking for working autoconf" >&5 ++echo "configure:2101: checking for working autoconf" >&5 + # Run test in a subshell; some versions of sh will print an error if + # an executable is not found, even if stderr is redirected. + # Redirect stdin to placate older versions of autoconf. Sigh. +@@ -2043,7 +2110,7 @@ + fi + + echo $ac_n "checking for working automake""... $ac_c" 1>&6 +-echo "configure:2047: checking for working automake" >&5 ++echo "configure:2114: checking for working automake" >&5 + # Run test in a subshell; some versions of sh will print an error if + # an executable is not found, even if stderr is redirected. + # Redirect stdin to placate older versions of autoconf. Sigh. +@@ -2056,7 +2123,7 @@ + fi + + echo $ac_n "checking for working autoheader""... $ac_c" 1>&6 +-echo "configure:2060: checking for working autoheader" >&5 ++echo "configure:2127: checking for working autoheader" >&5 + # Run test in a subshell; some versions of sh will print an error if + # an executable is not found, even if stderr is redirected. + # Redirect stdin to placate older versions of autoconf. Sigh. +@@ -2069,7 +2136,7 @@ + fi + + echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6 +-echo "configure:2073: checking for working makeinfo" >&5 ++echo "configure:2140: checking for working makeinfo" >&5 + # Run test in a subshell; some versions of sh will print an error if + # an executable is not found, even if stderr is redirected. + # Redirect stdin to placate older versions of autoconf. Sigh. +@@ -2086,7 +2153,7 @@ + + + echo $ac_n "checking for executable suffix""... $ac_c" 1>&6 +-echo "configure:2090: checking for executable suffix" >&5 ++echo "configure:2157: checking for executable suffix" >&5 + if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else +@@ -2096,7 +2163,7 @@ + rm -f conftest* + echo 'int main () { return 0; }' > conftest.$ac_ext + ac_cv_exeext= +- if { (eval echo configure:2100: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then ++ if { (eval echo configure:2167: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then + for file in conftest.*; do + case $file in + *.c | *.o | *.obj) ;; +@@ -2117,7 +2184,7 @@ + ac_exeext=$EXEEXT + + echo $ac_n "checking whether to enable maintainer-specific portions of Makefiles""... $ac_c" 1>&6 +-echo "configure:2121: checking whether to enable maintainer-specific portions of Makefiles" >&5 ++echo "configure:2188: checking whether to enable maintainer-specific portions of Makefiles" >&5 + # Check whether --enable-maintainer-mode or --disable-maintainer-mode was given. + if test "${enable_maintainer_mode+set}" = set; then + enableval="$enable_maintainer_mode" +@@ -2143,7 +2210,7 @@ + # Extract the first word of "gcc", so it can be a program name with args. + set dummy gcc; ac_word=$2 + echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +-echo "configure:2147: checking for $ac_word" >&5 ++echo "configure:2214: checking for $ac_word" >&5 + if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else +@@ -2173,7 +2240,7 @@ + # Extract the first word of "cc", so it can be a program name with args. + set dummy cc; ac_word=$2 + echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +-echo "configure:2177: checking for $ac_word" >&5 ++echo "configure:2244: checking for $ac_word" >&5 + if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else +@@ -2224,7 +2291,7 @@ + # Extract the first word of "cl", so it can be a program name with args. + set dummy cl; ac_word=$2 + echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +-echo "configure:2228: checking for $ac_word" >&5 ++echo "configure:2295: checking for $ac_word" >&5 + if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else +@@ -2256,7 +2323,7 @@ + fi + + echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 +-echo "configure:2260: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 ++echo "configure:2327: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 + + ac_ext=c + # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. +@@ -2267,12 +2334,12 @@ + + cat > conftest.$ac_ext << EOF + +-#line 2271 "configure" ++#line 2338 "configure" + #include "confdefs.h" + + main(){return(0);} + EOF +-if { (eval echo configure:2276: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:2343: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + ac_cv_prog_cc_works=yes + # If we can't run a trivial program, we are probably using a cross compiler. + if (./conftest; exit) 2>/dev/null; then +@@ -2298,12 +2365,12 @@ + { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; } + fi + echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 +-echo "configure:2302: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 ++echo "configure:2369: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 + echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6 + cross_compiling=$ac_cv_prog_cc_cross + + echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 +-echo "configure:2307: checking whether we are using GNU C" >&5 ++echo "configure:2374: checking whether we are using GNU C" >&5 + if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else +@@ -2312,7 +2379,7 @@ + yes; + #endif + EOF +-if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:2316: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then ++if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:2383: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then + ac_cv_prog_gcc=yes + else + ac_cv_prog_gcc=no +@@ -2331,7 +2398,7 @@ + ac_save_CFLAGS="$CFLAGS" + CFLAGS= + echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 +-echo "configure:2335: checking whether ${CC-cc} accepts -g" >&5 ++echo "configure:2402: checking whether ${CC-cc} accepts -g" >&5 + if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else +@@ -2381,17 +2448,23 @@ + i*86-*-mingw*) TARGET=X86_WIN32; TARGETDIR=x86;; + sparc-sun-4*) TARGET=SPARC; TARGETDIR=sparc;; + sparc*-sun-*) TARGET=SPARC; TARGETDIR=sparc;; +-sparc-*-linux*) TARGET=SPARC; TARGETDIR=sparc;; +-sparc64-*-linux*) TARGET=SPARC; TARGETDIR=sparc;; +-alpha*-*-linux* | alpha*-*-osf* | alpha*-*-freebsd*) TARGET=ALPHA; TARGETDIR=alpha;; ++sparc-*-linux* | sparc-*-netbsdelf*) TARGET=SPARC; TARGETDIR=sparc;; ++sparc64-*-linux* | sparc64-*-netbsd*) TARGET=SPARC; TARGETDIR=sparc;; ++alpha*-*-linux* | alpha*-*-osf* | alpha*-*-freebsd* | alpha*-*-netbsd*) TARGET=ALPHA; TARGETDIR=alpha;; + ia64*-*-*) TARGET=IA64; TARGETDIR=ia64;; + m68k-*-linux*) TARGET=M68K; TARGETDIR=m68k;; ++mips64*-*);; ++mips*-*-linux*) TARGET=MIPS_LINUX; TARGETDIR=mips;; + powerpc-*-linux* | powerpc-*-sysv*) TARGET=POWERPC; TARGETDIR=powerpc;; + powerpc-*-beos*) TARGET=POWERPC; TARGETDIR=powerpc;; + powerpc-*-darwin*) TARGET=POWERPC_DARWIN; TARGETDIR=powerpc;; + powerpc-*-aix*) TARGET=POWERPC_AIX; TARGETDIR=powerpc;; + rs6000-*-aix*) TARGET=POWERPC_AIX; TARGETDIR=powerpc;; + arm*-*-linux-*) TARGET=ARM; TARGETDIR=arm;; ++s390-*-linux-*) TARGET=S390; TARGETDIR=s390;; ++s390x-*-linux-*) TARGET=S390; TARGETDIR=s390;; ++x86_64-*-linux*) TARGET=X86_64; TARGETDIR=x86;; ++sh-*-linux* | sh[34]*-*-linux*) TARGET=SH; TARGETDIR=sh;; + esac + + if test $TARGETDIR = unknown; then +@@ -2418,6 +2491,15 @@ + fi + + ++if test x$TARGET = xMIPS_LINUX; then ++ MIPS_LINUX_TRUE= ++ MIPS_LINUX_FALSE='#' ++else ++ MIPS_LINUX_TRUE='#' ++ MIPS_LINUX_FALSE= ++fi ++ ++ + if test x$TARGET = xSPARC; then + SPARC_TRUE= + SPARC_FALSE='#' +@@ -2507,8 +2589,39 @@ + ARM_FALSE= + fi + ++ ++if test x$TARGET = xS390; then ++ S390_TRUE= ++ S390_FALSE='#' ++else ++ S390_TRUE='#' ++ S390_FALSE= ++fi ++ ++ ++if test x$TARGET = xX86_64; then ++ X86_64_TRUE= ++ X86_64_FALSE='#' ++else ++ X86_64_TRUE='#' ++ X86_64_FALSE= ++fi ++ ++ ++if test x$TARGET = xSH; then ++ SH_TRUE= ++ SH_FALSE='#' ++else ++ SH_TRUE='#' ++ SH_FALSE= ++fi ++ ++if test x$TARGET = xMIPS_LINUX; then ++ TARGET=MIPS ++fi ++ + echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 +-echo "configure:2512: checking how to run the C preprocessor" >&5 ++echo "configure:2625: checking how to run the C preprocessor" >&5 + # On Suns, sometimes $CPP names a directory. + if test -n "$CPP" && test -d "$CPP"; then + CPP= +@@ -2523,13 +2636,13 @@ + # On the NeXT, cc -E runs the code through the compiler's parser, + # not just through cpp. + cat > conftest.$ac_ext < + Syntax Error + EOF + ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +-{ (eval echo configure:2533: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ++{ (eval echo configure:2646: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } + ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` + if test -z "$ac_err"; then + : +@@ -2540,13 +2653,13 @@ + rm -rf conftest* + CPP="${CC-cc} -E -traditional-cpp" + cat > conftest.$ac_ext < + Syntax Error + EOF + ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +-{ (eval echo configure:2550: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ++{ (eval echo configure:2663: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } + ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` + if test -z "$ac_err"; then + : +@@ -2557,13 +2670,13 @@ + rm -rf conftest* + CPP="${CC-cc} -nologo -E" + cat > conftest.$ac_ext < + Syntax Error + EOF + ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +-{ (eval echo configure:2567: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ++{ (eval echo configure:2680: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } + ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` + if test -z "$ac_err"; then + : +@@ -2588,12 +2701,12 @@ + echo "$ac_t""$CPP" 1>&6 + + echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 +-echo "configure:2592: checking for ANSI C header files" >&5 ++echo "configure:2705: checking for ANSI C header files" >&5 + if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + cat > conftest.$ac_ext < + #include +@@ -2601,7 +2714,7 @@ + #include + EOF + ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" +-{ (eval echo configure:2605: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ++{ (eval echo configure:2718: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } + ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` + if test -z "$ac_err"; then + rm -rf conftest* +@@ -2618,7 +2731,7 @@ + if test $ac_cv_header_stdc = yes; then + # SunOS 4.x string.h does not declare mem*, contrary to ANSI. + cat > conftest.$ac_ext < + EOF +@@ -2636,7 +2749,7 @@ + if test $ac_cv_header_stdc = yes; then + # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. + cat > conftest.$ac_ext < + EOF +@@ -2657,7 +2770,7 @@ + : + else + cat > conftest.$ac_ext < + #define ISLOWER(c) ('a' <= (c) && (c) <= 'z') +@@ -2668,7 +2781,7 @@ + exit (0); } + + EOF +-if { (eval echo configure:2672: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null ++if { (eval echo configure:2785: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null + then + : + else +@@ -2694,12 +2807,12 @@ + for ac_func in memcpy + do + echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 +-echo "configure:2698: checking for $ac_func" >&5 ++echo "configure:2811: checking for $ac_func" >&5 + if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:2839: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_func_$ac_func=yes" + else +@@ -2749,19 +2862,19 @@ + # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works + # for constant arguments. Useless! + echo $ac_n "checking for working alloca.h""... $ac_c" 1>&6 +-echo "configure:2753: checking for working alloca.h" >&5 ++echo "configure:2866: checking for working alloca.h" >&5 + if eval "test \"`echo '$''{'ac_cv_header_alloca_h'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + cat > conftest.$ac_ext < + int main() { + char *p = alloca(2 * sizeof(int)); + ; return 0; } + EOF +-if { (eval echo configure:2765: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:2878: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + ac_cv_header_alloca_h=yes + else +@@ -2782,12 +2895,12 @@ + fi + + echo $ac_n "checking for alloca""... $ac_c" 1>&6 +-echo "configure:2786: checking for alloca" >&5 ++echo "configure:2899: checking for alloca" >&5 + if eval "test \"`echo '$''{'ac_cv_func_alloca_works'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:2932: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + ac_cv_func_alloca_works=yes + else +@@ -2847,12 +2960,12 @@ + + + echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6 +-echo "configure:2851: checking whether alloca needs Cray hooks" >&5 ++echo "configure:2964: checking whether alloca needs Cray hooks" >&5 + if eval "test \"`echo '$''{'ac_cv_os_cray'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + cat > conftest.$ac_ext <&6 +-echo "configure:2881: checking for $ac_func" >&5 ++echo "configure:2994: checking for $ac_func" >&5 + if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:3022: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_func_$ac_func=yes" + else +@@ -2932,7 +3045,7 @@ + fi + + echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6 +-echo "configure:2936: checking stack direction for C alloca" >&5 ++echo "configure:3049: checking stack direction for C alloca" >&5 + if eval "test \"`echo '$''{'ac_cv_c_stack_direction'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else +@@ -2940,7 +3053,7 @@ + ac_cv_c_stack_direction=0 + else + cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null ++if { (eval echo configure:3076: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null + then + ac_cv_c_stack_direction=1 + else +@@ -2982,13 +3095,13 @@ + + + echo $ac_n "checking size of short""... $ac_c" 1>&6 +-echo "configure:2986: checking size of short" >&5 ++echo "configure:3099: checking size of short" >&5 + if eval "test \"`echo '$''{'ac_cv_sizeof_short'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + for ac_size in 4 8 1 2 16 12 ; do # List sizes in rough order of prevalence. + cat > conftest.$ac_ext < +@@ -2998,7 +3111,7 @@ + switch (0) case 0: case (sizeof (short) == $ac_size):; + ; return 0; } + EOF +-if { (eval echo configure:3002: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then ++if { (eval echo configure:3115: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_sizeof_short=$ac_size + else +@@ -3021,13 +3134,13 @@ + + + echo $ac_n "checking size of int""... $ac_c" 1>&6 +-echo "configure:3025: checking size of int" >&5 ++echo "configure:3138: checking size of int" >&5 + if eval "test \"`echo '$''{'ac_cv_sizeof_int'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + for ac_size in 4 8 1 2 16 12 ; do # List sizes in rough order of prevalence. + cat > conftest.$ac_ext < +@@ -3037,7 +3150,7 @@ + switch (0) case 0: case (sizeof (int) == $ac_size):; + ; return 0; } + EOF +-if { (eval echo configure:3041: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then ++if { (eval echo configure:3154: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_sizeof_int=$ac_size + else +@@ -3060,13 +3173,13 @@ + + + echo $ac_n "checking size of long""... $ac_c" 1>&6 +-echo "configure:3064: checking size of long" >&5 ++echo "configure:3177: checking size of long" >&5 + if eval "test \"`echo '$''{'ac_cv_sizeof_long'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + for ac_size in 4 8 1 2 16 12 ; do # List sizes in rough order of prevalence. + cat > conftest.$ac_ext < +@@ -3076,7 +3189,7 @@ + switch (0) case 0: case (sizeof (long) == $ac_size):; + ; return 0; } + EOF +-if { (eval echo configure:3080: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then ++if { (eval echo configure:3193: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_sizeof_long=$ac_size + else +@@ -3099,13 +3212,13 @@ + + + echo $ac_n "checking size of long long""... $ac_c" 1>&6 +-echo "configure:3103: checking size of long long" >&5 ++echo "configure:3216: checking size of long long" >&5 + if eval "test \"`echo '$''{'ac_cv_sizeof_long_long'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + for ac_size in 4 8 1 2 16 12 ; do # List sizes in rough order of prevalence. + cat > conftest.$ac_ext < +@@ -3115,7 +3228,7 @@ + switch (0) case 0: case (sizeof (long long) == $ac_size):; + ; return 0; } + EOF +-if { (eval echo configure:3119: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then ++if { (eval echo configure:3232: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_sizeof_long_long=$ac_size + else +@@ -3138,13 +3251,13 @@ + + + echo $ac_n "checking size of float""... $ac_c" 1>&6 +-echo "configure:3142: checking size of float" >&5 ++echo "configure:3255: checking size of float" >&5 + if eval "test \"`echo '$''{'ac_cv_sizeof_float'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + for ac_size in 4 8 1 2 16 12 ; do # List sizes in rough order of prevalence. + cat > conftest.$ac_ext < +@@ -3154,7 +3267,7 @@ + switch (0) case 0: case (sizeof (float) == $ac_size):; + ; return 0; } + EOF +-if { (eval echo configure:3158: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then ++if { (eval echo configure:3271: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_sizeof_float=$ac_size + else +@@ -3177,13 +3290,13 @@ + + + echo $ac_n "checking size of double""... $ac_c" 1>&6 +-echo "configure:3181: checking size of double" >&5 ++echo "configure:3294: checking size of double" >&5 + if eval "test \"`echo '$''{'ac_cv_sizeof_double'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + for ac_size in 4 8 1 2 16 12 ; do # List sizes in rough order of prevalence. + cat > conftest.$ac_ext < +@@ -3193,7 +3306,7 @@ + switch (0) case 0: case (sizeof (double) == $ac_size):; + ; return 0; } + EOF +-if { (eval echo configure:3197: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then ++if { (eval echo configure:3310: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_sizeof_double=$ac_size + else +@@ -3216,13 +3329,13 @@ + + + echo $ac_n "checking size of long double""... $ac_c" 1>&6 +-echo "configure:3220: checking size of long double" >&5 ++echo "configure:3333: checking size of long double" >&5 + if eval "test \"`echo '$''{'ac_cv_sizeof_long_double'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + for ac_size in 4 8 1 2 16 12 ; do # List sizes in rough order of prevalence. + cat > conftest.$ac_ext < +@@ -3232,7 +3345,7 @@ + switch (0) case 0: case (sizeof (long double) == $ac_size):; + ; return 0; } + EOF +-if { (eval echo configure:3236: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then ++if { (eval echo configure:3349: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_sizeof_long_double=$ac_size + else +@@ -3256,13 +3369,13 @@ + + + echo $ac_n "checking size of void *""... $ac_c" 1>&6 +-echo "configure:3260: checking size of void *" >&5 ++echo "configure:3373: checking size of void *" >&5 + if eval "test \"`echo '$''{'ac_cv_sizeof_void_p'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + for ac_size in 4 8 1 2 16 12 ; do # List sizes in rough order of prevalence. + cat > conftest.$ac_ext < +@@ -3272,7 +3385,7 @@ + switch (0) case 0: case (sizeof (void *) == $ac_size):; + ; return 0; } + EOF +-if { (eval echo configure:3276: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then ++if { (eval echo configure:3389: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_sizeof_void_p=$ac_size + else +@@ -3295,14 +3408,14 @@ + + + echo $ac_n "checking whether byte ordering is bigendian""... $ac_c" 1>&6 +-echo "configure:3299: checking whether byte ordering is bigendian" >&5 ++echo "configure:3412: checking whether byte ordering is bigendian" >&5 + if eval "test \"`echo '$''{'ac_cv_c_bigendian'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else + ac_cv_c_bigendian=unknown + # See if sys/param.h defines the BYTE_ORDER macro. + cat > conftest.$ac_ext < + #include +@@ -3313,11 +3426,11 @@ + #endif + ; return 0; } + EOF +-if { (eval echo configure:3317: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then ++if { (eval echo configure:3430: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + # It does; now see whether it defined to BIG_ENDIAN or not. + cat > conftest.$ac_ext < + #include +@@ -3328,7 +3441,7 @@ + #endif + ; return 0; } + EOF +-if { (eval echo configure:3332: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then ++if { (eval echo configure:3445: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + ac_cv_c_bigendian=yes + else +@@ -3348,7 +3461,7 @@ + echo $ac_n "cross-compiling... " 2>&6 + else + cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null ++if { (eval echo configure:3478: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null + then + ac_cv_c_bigendian=no + else +@@ -3379,7 +3492,7 @@ + echo "$ac_t""$ac_cv_c_bigendian" 1>&6 + if test $ac_cv_c_bigendian = unknown; then + echo $ac_n "checking to probe for byte ordering""... $ac_c" 1>&6 +-echo "configure:3383: checking to probe for byte ordering" >&5 ++echo "configure:3496: checking to probe for byte ordering" >&5 + + cat >conftest.c <> confdefs.h <<\EOF ++#define HOST_WORDS_BIG_ENDIAN 1 ++EOF ++ + BYTEORDER=4321 + else + BYTEORDER=1234 +@@ -3429,7 +3546,7 @@ + + if test x$TARGET = xSPARC; then + echo $ac_n "checking assembler and linker support unaligned pc related relocs""... $ac_c" 1>&6 +-echo "configure:3433: checking assembler and linker support unaligned pc related relocs" >&5 ++echo "configure:3550: checking assembler and linker support unaligned pc related relocs" >&5 + if eval "test \"`echo '$''{'libffi_cv_as_sparc_ua_pcrel'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 + else +@@ -3439,14 +3556,14 @@ + CFLAGS="$CFLAGS -fpic" + LDFLAGS="$LDFLAGS -shared" + cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++if { (eval echo configure:3567: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + libffi_cv_as_sparc_ua_pcrel=yes + else +@@ -3709,6 +3826,8 @@ + s%@MIPS_GCC_FALSE@%$MIPS_GCC_FALSE%g + s%@MIPS_SGI_TRUE@%$MIPS_SGI_TRUE%g + s%@MIPS_SGI_FALSE@%$MIPS_SGI_FALSE%g ++s%@MIPS_LINUX_TRUE@%$MIPS_LINUX_TRUE%g ++s%@MIPS_LINUX_FALSE@%$MIPS_LINUX_FALSE%g + s%@SPARC_TRUE@%$SPARC_TRUE%g + s%@SPARC_FALSE@%$SPARC_FALSE%g + s%@X86_TRUE@%$X86_TRUE%g +@@ -3729,6 +3848,12 @@ + s%@POWERPC_DARWIN_FALSE@%$POWERPC_DARWIN_FALSE%g + s%@ARM_TRUE@%$ARM_TRUE%g + s%@ARM_FALSE@%$ARM_FALSE%g ++s%@S390_TRUE@%$S390_TRUE%g ++s%@S390_FALSE@%$S390_FALSE%g ++s%@X86_64_TRUE@%$X86_64_TRUE%g ++s%@X86_64_FALSE@%$X86_64_FALSE%g ++s%@SH_TRUE@%$SH_TRUE%g ++s%@SH_FALSE@%$SH_FALSE%g + s%@CPP@%$CPP%g + s%@ALLOCA@%$ALLOCA%g + s%@TARGET@%$TARGET%g +@@ -3969,7 +4094,7 @@ + + if test -n "$CONFIG_FILES"; then + LD="${ORIGINAL_LD_FOR_MULTILIBS}" +- ac_file=Makefile . ${libffi_basedir}/../config-ml.in ++ ac_file=Makefile . ${srcdir}/${libffi_basedir}../config-ml.in + fi + + exit 0 +diff -ruN --exclude=CVS gcc-3.2.2.orig/libffi/configure.in gcc/libffi/configure.in +--- gcc-3.2.2.orig/libffi/configure.in Tue Jan 28 10:43:56 2003 ++++ gcc/libffi/configure.in Sat Feb 1 20:16:19 2003 +@@ -22,14 +22,15 @@ + + if test "${srcdir}" = "."; then + if test "${with_target_subdir}" != "."; then +- libffi_basedir="${srcdir}/${with_multisrctop}.." ++ libffi_basedir="${with_multisrctop}../" + else +- libffi_basedir="${srcdir}/${with_multisrctop}" ++ libffi_basedir="${with_multisrctop}" + fi + else +- libffi_basedir="${srcdir}" ++ libffi_basedir= + fi + AC_SUBST(libffi_basedir) ++AC_CONFIG_AUX_DIR(${libffi_basedir}..) + + AC_CANONICAL_HOST + +@@ -56,17 +57,23 @@ + i*86-*-mingw*) TARGET=X86_WIN32; TARGETDIR=x86;; + sparc-sun-4*) TARGET=SPARC; TARGETDIR=sparc;; + sparc*-sun-*) TARGET=SPARC; TARGETDIR=sparc;; +-sparc-*-linux*) TARGET=SPARC; TARGETDIR=sparc;; +-sparc64-*-linux*) TARGET=SPARC; TARGETDIR=sparc;; +-alpha*-*-linux* | alpha*-*-osf* | alpha*-*-freebsd*) TARGET=ALPHA; TARGETDIR=alpha;; ++sparc-*-linux* | sparc-*-netbsdelf*) TARGET=SPARC; TARGETDIR=sparc;; ++sparc64-*-linux* | sparc64-*-netbsd*) TARGET=SPARC; TARGETDIR=sparc;; ++alpha*-*-linux* | alpha*-*-osf* | alpha*-*-freebsd* | alpha*-*-netbsd*) TARGET=ALPHA; TARGETDIR=alpha;; + ia64*-*-*) TARGET=IA64; TARGETDIR=ia64;; + m68k-*-linux*) TARGET=M68K; TARGETDIR=m68k;; ++mips64*-*);; ++mips*-*-linux*) TARGET=MIPS_LINUX; TARGETDIR=mips;; + powerpc-*-linux* | powerpc-*-sysv*) TARGET=POWERPC; TARGETDIR=powerpc;; + powerpc-*-beos*) TARGET=POWERPC; TARGETDIR=powerpc;; + powerpc-*-darwin*) TARGET=POWERPC_DARWIN; TARGETDIR=powerpc;; + powerpc-*-aix*) TARGET=POWERPC_AIX; TARGETDIR=powerpc;; + rs6000-*-aix*) TARGET=POWERPC_AIX; TARGETDIR=powerpc;; + arm*-*-linux-*) TARGET=ARM; TARGETDIR=arm;; ++s390-*-linux-*) TARGET=S390; TARGETDIR=s390;; ++s390x-*-linux-*) TARGET=S390; TARGETDIR=s390;; ++x86_64-*-linux*) TARGET=X86_64; TARGETDIR=x86;; ++sh-*-linux* | sh[[34]]*-*-linux*) TARGET=SH; TARGETDIR=sh;; + esac + + if test $TARGETDIR = unknown; then +@@ -75,6 +82,7 @@ + + AM_CONDITIONAL(MIPS_GCC, test ${TARGET}${ac_cv_prog_gcc} = MIPSyes) + AM_CONDITIONAL(MIPS_SGI, test ${TARGET}${ac_cv_prog_gcc} = MIPSno) ++AM_CONDITIONAL(MIPS_LINUX, test x$TARGET = xMIPS_LINUX) + AM_CONDITIONAL(SPARC, test x$TARGET = xSPARC) + AM_CONDITIONAL(X86, test x$TARGET = xX86) + AM_CONDITIONAL(X86_WIN32, test x$TARGET = xX86_WIN32) +@@ -85,6 +93,13 @@ + AM_CONDITIONAL(POWERPC_AIX, test x$TARGET = xPOWERPC_AIX) + AM_CONDITIONAL(POWERPC_DARWIN, test x$TARGET = xPOWERPC_DARWIN) + AM_CONDITIONAL(ARM, test x$TARGET = xARM) ++AM_CONDITIONAL(S390, test x$TARGET = xS390) ++AM_CONDITIONAL(X86_64, test x$TARGET = xX86_64) ++AM_CONDITIONAL(SH, test x$TARGET = xSH) ++ ++if test x$TARGET = xMIPS_LINUX; then ++ TARGET=MIPS ++fi + + AC_HEADER_STDC + AC_CHECK_FUNCS(memcpy) +@@ -171,7 +186,7 @@ + [ + if test -n "$CONFIG_FILES"; then + LD="${ORIGINAL_LD_FOR_MULTILIBS}" +- ac_file=Makefile . ${libffi_basedir}/../config-ml.in ++ ac_file=Makefile . ${srcdir}/${libffi_basedir}../config-ml.in + fi + ], + srcdir=${srcdir} +diff -ruN --exclude=CVS gcc-3.2.2.orig/libffi/include/Makefile.in gcc/libffi/include/Makefile.in +--- gcc-3.2.2.orig/libffi/include/Makefile.in Tue Oct 9 14:32:16 2001 ++++ gcc/libffi/include/Makefile.in Mon Apr 29 13:14:44 2002 +@@ -99,7 +99,7 @@ + + DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) + +-TAR = gnutar ++TAR = gtar + GZIP_ENV = --best + all: all-redirect + .SUFFIXES: +diff -ruN --exclude=CVS gcc-3.2.2.orig/libffi/include/ffi.h.in gcc/libffi/include/ffi.h.in +--- gcc-3.2.2.orig/libffi/include/ffi.h.in Wed Mar 13 07:35:56 2002 ++++ gcc/libffi/include/ffi.h.in Wed Jan 29 00:54:28 2003 +@@ -1,5 +1,5 @@ + /* -----------------------------------------------------------------*-C-*- +- libffi @VERSION@ - Copyright (c) 1996-2002 Cygnus Solutions ++ libffi @VERSION@ - Copyright (c) 1996-2003 Cygnus Solutions + + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the +@@ -164,6 +164,12 @@ + #endif + #endif + ++#ifdef S390 ++#if defined (__s390x__) ++#define S390X ++#endif ++#endif ++ + #ifndef LIBFFI_ASM + + /* ---- Generic type definitions ----------------------------------------- */ +@@ -189,16 +195,23 @@ + #endif + #endif + +- /* ---- Intel x86 ---------------- */ +-#ifdef X86 ++ /* ---- Intel x86 Win32 ---------- */ ++#ifdef X86_WIN32 + FFI_SYSV, ++ FFI_STDCALL, ++ /* TODO: Add fastcall support for the sake of completeness */ + FFI_DEFAULT_ABI = FFI_SYSV, + #endif + +- /* ---- Intel x86 Win32 ---------- */ +-#ifdef X86_WIN32 ++ /* ---- Intel x86 and AMD x86-64 - */ ++#if !defined(X86_WIN32) && (defined(__i386__) || defined(__x86_64__)) + FFI_SYSV, ++ FFI_UNIX64, /* Unix variants all use the same ABI for x86-64 */ ++#ifdef __i386__ + FFI_DEFAULT_ABI = FFI_SYSV, ++#else ++ FFI_DEFAULT_ABI = FFI_UNIX64, ++#endif + #endif + + /* ---- Intel ia64 ---------------- */ +@@ -251,6 +264,18 @@ + FFI_DEFAULT_ABI = FFI_SYSV, + #endif + ++ /* ---- S390 --------------------- */ ++#ifdef S390 ++ FFI_SYSV, ++ FFI_DEFAULT_ABI = FFI_SYSV, ++#endif ++ ++ /* ---- SuperH ------------------- */ ++#ifdef SH ++ FFI_SYSV, ++ FFI_DEFAULT_ABI = FFI_SYSV, ++#endif ++ + /* Leave this for debugging purposes */ + FFI_LAST_ABI + +@@ -264,7 +289,7 @@ + /*@null@*/ struct _ffi_type **elements; + } ffi_type; + +-/* These are defined in ffi.c */ ++/* These are defined in types.c */ + extern ffi_type ffi_type_void; + extern ffi_type ffi_type_uint8; + extern ffi_type ffi_type_sint8; +@@ -373,13 +398,7 @@ + + /* ---- Definitions for closures ----------------------------------------- */ + +-#ifdef X86 +- +-#define FFI_CLOSURES 1 /* x86 supports closures */ +-#define FFI_TRAMPOLINE_SIZE 10 +-#define FFI_NATIVE_RAW_API 1 /* and has native raw api support */ +- +-#elif defined(X86_WIN32) ++#ifdef __i386__ + + #define FFI_CLOSURES 1 /* x86 supports closures */ + #define FFI_TRAMPOLINE_SIZE 10 +@@ -424,6 +443,40 @@ + #define FFI_TRAMPOLINE_SIZE 24 /* see struct below */ + #define FFI_NATIVE_RAW_API 0 + ++#elif defined(SPARC64) ++ ++#define FFI_CLOSURES 1 ++#define FFI_TRAMPOLINE_SIZE 24 ++#define FFI_NATIVE_RAW_API 0 ++ ++#elif defined(SPARC) ++ ++#define FFI_CLOSURES 1 ++#define FFI_TRAMPOLINE_SIZE 16 ++#define FFI_NATIVE_RAW_API 0 ++ ++#elif defined(S390) ++ ++#define FFI_CLOSURES 1 ++#ifdef S390X ++#define FFI_TRAMPOLINE_SIZE 32 ++#else ++#define FFI_TRAMPOLINE_SIZE 16 ++#endif ++#define FFI_NATIVE_RAW_API 0 ++ ++#elif defined(SH) ++ ++#define FFI_CLOSURES 1 ++#define FFI_TRAMPOLINE_SIZE 16 ++#define FFI_NATIVE_RAW_API 0 ++ ++#elif defined(__x86_64__) ++ ++#define FFI_CLOSURES 1 ++#define FFI_TRAMPOLINE_SIZE 24 ++#define FFI_NATIVE_RAW_API 0 ++ + #else + + #define FFI_CLOSURES 0 +diff -ruN --exclude=CVS gcc-3.2.2.orig/libffi/src/arm/ffi.c gcc/libffi/src/arm/ffi.c +--- gcc-3.2.2.orig/libffi/src/arm/ffi.c Sat Mar 3 07:21:23 2001 ++++ gcc/libffi/src/arm/ffi.c Fri Jul 19 08:08:30 2002 +@@ -36,13 +36,10 @@ + /*@=exportheader@*/ + { + register unsigned int i; +- register int tmp; +- register unsigned int avn; + register void **p_argv; + register char *argp; + register ffi_type **p_arg; + +- tmp = 0; + argp = stack; + + if ( ecif->cif->rtype->type == FFI_TYPE_STRUCT ) { +@@ -50,11 +47,10 @@ + argp += 4; + } + +- avn = ecif->cif->nargs; + p_argv = ecif->avalue; + + for (i = ecif->cif->nargs, p_arg = ecif->cif->arg_types; +- (i != 0) && (avn != 0); ++ (i != 0); + i--, p_arg++) + { + size_t z; +@@ -64,9 +60,6 @@ + argp = (char *) ALIGN(argp, (*p_arg)->alignment); + } + +- if (avn != 0) +- { +- avn--; + z = (*p_arg)->size; + if (z < sizeof(int)) + { +@@ -107,7 +100,6 @@ + } + p_argv++; + argp += z; +- } + } + + return; +diff -ruN --exclude=CVS gcc-3.2.2.orig/libffi/src/arm/sysv.S gcc/libffi/src/arm/sysv.S +--- gcc-3.2.2.orig/libffi/src/arm/sysv.S Sat Mar 3 07:21:23 2001 ++++ gcc/libffi/src/arm/sysv.S Mon Sep 30 03:08:58 2002 +@@ -28,8 +28,15 @@ + #ifdef HAVE_MACHINE_ASM_H + #include + #else +-/* XXX these lose for some platforms, I'm sure. */ ++#ifdef __USER_LABEL_PREFIX__ ++#define CONCAT1(a, b) CONCAT2(a, b) ++#define CONCAT2(a, b) a ## b ++ ++/* Use the right prefix for global labels. */ ++#define CNAME(x) CONCAT1 (__USER_LABEL_PREFIX__, x) ++#else + #define CNAME(x) x ++#endif + #define ENTRY(x) .globl CNAME(x); .type CNAME(x),%function; CNAME(x): + #endif + +@@ -96,12 +103,20 @@ + + # return FLOAT + cmp a4, #FFI_TYPE_FLOAT ++#ifdef __SOFTFP__ ++ streq a1, [a3] ++#else + stfeqs f0, [a3] ++#endif + beq epilogue + + # return DOUBLE or LONGDOUBLE + cmp a4, #FFI_TYPE_DOUBLE ++#ifdef __SOFTFP__ ++ stmeqia a3, {a1, a2} ++#else + stfeqd f0, [a3] ++#endif + + epilogue: + ldmfd sp!, {a1-a4, fp, pc} +diff -ruN --exclude=CVS gcc-3.2.2.orig/libffi/src/java_raw_api.c gcc/libffi/src/java_raw_api.c +--- gcc-3.2.2.orig/libffi/src/java_raw_api.c Tue Apr 9 07:31:14 2002 ++++ gcc/libffi/src/java_raw_api.c Tue Oct 8 23:55:02 2002 +@@ -81,21 +81,14 @@ + { + case FFI_TYPE_UINT8: + case FFI_TYPE_SINT8: +- *args = (void*) ((char*)(raw++) + SIZEOF_ARG - 1); ++ *args = (void*) ((char*)(raw++) + 3); + break; + + case FFI_TYPE_UINT16: + case FFI_TYPE_SINT16: +- *args = (void*) ((char*)(raw++) + SIZEOF_ARG - 2); ++ *args = (void*) ((char*)(raw++) + 2); + break; + +-#if SIZEOF_ARG >= 4 +- case FFI_TYPE_UINT32: +- case FFI_TYPE_SINT32: +- *args = (void*) ((char*)(raw++) + SIZEOF_ARG - 4); +- break; +-#endif +- + #if SIZEOF_ARG == 8 + case FFI_TYPE_UINT64: + case FFI_TYPE_SINT64: +@@ -157,31 +150,54 @@ + switch ((*tp)->type) + { + case FFI_TYPE_UINT8: ++#if WORDS_BIGENDIAN ++ *(UINT32*)(raw++) = *(UINT8*) (*args); ++#else + (raw++)->uint = *(UINT8*) (*args); ++#endif + break; + + case FFI_TYPE_SINT8: ++#if WORDS_BIGENDIAN ++ *(SINT32*)(raw++) = *(SINT8*) (*args); ++#else + (raw++)->sint = *(SINT8*) (*args); ++#endif + break; + + case FFI_TYPE_UINT16: ++#if WORDS_BIGENDIAN ++ *(UINT32*)(raw++) = *(UINT16*) (*args); ++#else + (raw++)->uint = *(UINT16*) (*args); ++#endif + break; + + case FFI_TYPE_SINT16: ++#if WORDS_BIGENDIAN ++ *(SINT32*)(raw++) = *(SINT16*) (*args); ++#else + (raw++)->sint = *(SINT16*) (*args); ++#endif + break; + +-#if SIZEOF_ARG >= 4 + case FFI_TYPE_UINT32: ++#if WORDS_BIGENDIAN ++ *(UINT32*)(raw++) = *(UINT32*) (*args); ++#else + (raw++)->uint = *(UINT32*) (*args); ++#endif + break; + + case FFI_TYPE_SINT32: ++#if WORDS_BIGENDIAN ++ *(SINT32*)(raw++) = *(SINT32*) (*args); ++#else + (raw++)->sint = *(SINT32*) (*args); +- break; + #endif +- case FFI_TYPE_FLOAT: ++ break; ++ ++ case FFI_TYPE_FLOAT: + (raw++)->flt = *(FLOAT32*) (*args); + break; + +@@ -211,6 +227,55 @@ + + #if !FFI_NATIVE_RAW_API + ++static void ++ffi_java_rvalue_to_raw (ffi_cif *cif, void *rvalue) ++{ ++#if WORDS_BIGENDIAN && SIZEOF_ARG == 8 ++ switch (cif->rtype->type) ++ { ++ case FFI_TYPE_UINT8: ++ case FFI_TYPE_UINT16: ++ case FFI_TYPE_UINT32: ++ *(UINT64 *)rvalue <<= 32; ++ break; ++ ++ case FFI_TYPE_SINT8: ++ case FFI_TYPE_SINT16: ++ case FFI_TYPE_SINT32: ++ case FFI_TYPE_INT: ++ *(SINT64 *)rvalue <<= 32; ++ break; ++ ++ default: ++ break; ++ } ++#endif ++} ++ ++static void ++ffi_java_raw_to_rvalue (ffi_cif *cif, void *rvalue) ++{ ++#if WORDS_BIGENDIAN && SIZEOF_ARG == 8 ++ switch (cif->rtype->type) ++ { ++ case FFI_TYPE_UINT8: ++ case FFI_TYPE_UINT16: ++ case FFI_TYPE_UINT32: ++ *(UINT64 *)rvalue >>= 32; ++ break; ++ ++ case FFI_TYPE_SINT8: ++ case FFI_TYPE_SINT16: ++ case FFI_TYPE_SINT32: ++ case FFI_TYPE_INT: ++ *(SINT64 *)rvalue >>= 32; ++ break; ++ ++ default: ++ break; ++ } ++#endif ++} + + /* This is a generic definition of ffi_raw_call, to be used if the + * native system does not provide a machine-specific implementation. +@@ -227,6 +292,7 @@ + void **avalue = (void**) alloca (cif->nargs * sizeof (void*)); + ffi_java_raw_to_ptrarray (cif, raw, avalue); + ffi_call (cif, fn, rvalue, avalue); ++ ffi_java_rvalue_to_raw (cif, rvalue); + } + + #if FFI_CLOSURES /* base system provides closures */ +@@ -240,6 +306,7 @@ + + ffi_java_ptrarray_to_raw (cif, avalue, raw); + (*cl->fun) (cif, rvalue, raw, cl->user_data); ++ ffi_java_raw_to_rvalue (cif, rvalue); + } + + /* Again, here is the generic version of ffi_prep_raw_closure, which +diff -ruN --exclude=CVS gcc-3.2.2.orig/libffi/src/m68k/ffi.c gcc/libffi/src/m68k/ffi.c +--- gcc-3.2.2.orig/libffi/src/m68k/ffi.c Sun Aug 8 22:27:19 1999 ++++ gcc/libffi/src/m68k/ffi.c Fri Jul 19 08:08:30 2002 +@@ -16,14 +16,11 @@ + ffi_prep_args (void *stack, extended_cif *ecif) + { + unsigned int i; +- int tmp; +- unsigned int avn; + void **p_argv; + char *argp; + ffi_type **p_arg; + void *struct_value_ptr; + +- tmp = 0; + argp = stack; + + if (ecif->cif->rtype->type == FFI_TYPE_STRUCT +@@ -32,11 +29,10 @@ + else + struct_value_ptr = NULL; + +- avn = ecif->cif->nargs; + p_argv = ecif->avalue; + + for (i = ecif->cif->nargs, p_arg = ecif->cif->arg_types; +- i != 0 && avn != 0; ++ i != 0; + i--, p_arg++) + { + size_t z; +@@ -45,9 +41,6 @@ + if (((*p_arg)->alignment - 1) & (unsigned) argp) + argp = (char *) ALIGN (argp, (*p_arg)->alignment); + +- if (avn != 0) +- { +- avn--; + z = (*p_arg)->size; + if (z < sizeof (int)) + { +@@ -82,7 +75,6 @@ + memcpy (argp, *p_argv, z); + p_argv++; + argp += z; +- } + } + + return struct_value_ptr; +diff -ruN --exclude=CVS gcc-3.2.2.orig/libffi/src/mips/ffi.c gcc/libffi/src/mips/ffi.c +--- gcc-3.2.2.orig/libffi/src/mips/ffi.c Sat Mar 3 07:21:23 2001 ++++ gcc/libffi/src/mips/ffi.c Fri Jul 19 08:08:31 2002 +@@ -23,6 +23,7 @@ + OTHER DEALINGS IN THE SOFTWARE. + ----------------------------------------------------------------------- */ + ++#include + #include + #include + +@@ -50,7 +51,6 @@ + int flags) + { + register int i; +- register int avn; + register void **p_argv; + register char *argp; + register ffi_type **p_arg; +@@ -80,12 +80,9 @@ + FIX_ARGP; + } + +- avn = ecif->cif->nargs; + p_argv = ecif->avalue; + +- for (i = ecif->cif->nargs, p_arg = ecif->cif->arg_types; +- i && avn; +- i--, p_arg++) ++ for (i = ecif->cif->nargs, p_arg = ecif->cif->arg_types; i; i--, p_arg++) + { + size_t z; + +@@ -101,9 +98,6 @@ + #define OFFSET sizeof(int) + #endif + +- if (avn) +- { +- avn--; + z = (*p_arg)->size; + if (z < sizeof(SLOT_TYPE_UNSIGNED)) + { +@@ -179,7 +173,6 @@ + p_argv++; + argp += z; + FIX_ARGP; +- } + } + + return; +diff -ruN --exclude=CVS gcc-3.2.2.orig/libffi/src/powerpc/darwin.S gcc/libffi/src/powerpc/darwin.S +--- gcc-3.2.2.orig/libffi/src/powerpc/darwin.S Sat Jan 19 01:22:34 2002 ++++ gcc/libffi/src/powerpc/darwin.S Thu Jan 23 03:21:55 2003 +@@ -3,8 +3,6 @@ + + PowerPC Assembly glue. + +- $Id: darwin.S,v 1.2 2002/01/18 16:22:34 dje Exp $ +- + Permission is hereby granted, free of charge, to any person obtaining + a copy of this software and associated documentation files (the + ``Software''), to deal in the Software without restriction, including +@@ -39,30 +37,34 @@ + .text + .align 2 + _ffi_call_DARWIN: +- mr r12,r8 // We only need r12 until the call, so it doesn't have to be saved... ++LFB0: ++ mr r12,r8 /* We only need r12 until the call, ++ so it doesn't have to be saved... */ ++LFB1: + /* Save the old stack pointer as AP. */ + mr r8,r1 +- ++LCFI0: + /* Allocate the stack space we need. */ + stwux r1,r1,r4 + + /* Save registers we use. */ + mflr r9 + +- stw r28,-16(r8) ++ stw r28,-16(r8) + stw r29,-12(r8) + stw r30, -8(r8) + stw r31, -4(r8) +- +- stw r9, 8(r8) ++ ++ stw r9, 8(r8) + stw r2, 20(r1) ++LCFI1: + + /* Save arguments over call... */ +- mr r31,r5 /* flags, */ +- mr r30,r6 /* rvalue, */ +- mr r29,r7 /* function address, */ +- mr r28,r8 /* our AP. */ +- ++ mr r31,r5 /* flags, */ ++ mr r30,r6 /* rvalue, */ ++ mr r29,r7 /* function address, */ ++ mr r28,r8 /* our AP. */ ++LCFI2: + /* Call ffi_prep_args. */ + mr r4,r1 + li r9,0 +@@ -145,7 +147,8 @@ + L(float_return_value): + stfs f1,0(r30) + b L(done_return_value) +-//END(_ffi_call_DARWIN) ++LFE1: ++/* END(_ffi_call_DARWIN) */ + + /* Provide a null definition of _ffi_call_AIX. */ + .text +@@ -155,5 +158,61 @@ + .align 2 + _ffi_call_AIX: + blr +-//END(_ffi_call_AIX) ++/* END(_ffi_call_AIX) */ + ++.data ++.section __TEXT,__eh_frame ++Lframe1: ++ .set L$set$0,LECIE1-LSCIE1 ++ .long L$set$0 ; Length of Common Information Entry ++LSCIE1: ++ .long 0x0 ; CIE Identifier Tag ++ .byte 0x1 ; CIE Version ++ .ascii "zR\0" ; CIE Augmentation ++ .byte 0x1 ; uleb128 0x1; CIE Code Alignment Factor ++ .byte 0x7c ; sleb128 -4; CIE Data Alignment Factor ++ .byte 0x41 ; CIE RA Column ++ .byte 0x1 ; uleb128 0x1; Augmentation size ++ .byte 0x10 ; FDE Encoding (pcrel) ++ .byte 0xc ; DW_CFA_def_cfa ++ .byte 0x1 ; uleb128 0x1 ++ .byte 0x0 ; uleb128 0x0 ++ .align 2 ++LECIE1: ++LSFDE1: ++ .set L$set$1,LEFDE1-LASFDE1 ++ .long L$set$1 ; FDE Length ++LASFDE1: ++ .set L$set$2,LASFDE1-Lframe1 ++ .long L$set$2 ; FDE CIE offset ++ .long LFB0-. ; FDE initial location ++ .set L$set$3,LFE1-LFB0 ++ .long L$set$3 ; FDE address range ++ .byte 0x0 ; uleb128 0x0; Augmentation size ++ .byte 0x4 ; DW_CFA_advance_loc4 ++ .set L$set$4,LCFI0-LFB1 ++ .long L$set$4 ++ .byte 0xd ; DW_CFA_def_cfa_register ++ .byte 0x08 ; uleb128 0x08 ++ .byte 0x4 ; DW_CFA_advance_loc4 ++ .set L$set$5,LCFI1-LCFI0 ++ .long L$set$5 ++ .byte 0x11 ; DW_CFA_offset_extended_sf ++ .byte 0x41 ; uleb128 0x41 ++ .byte 0x7e ; sleb128 -2 ++ .byte 0x9f ; DW_CFA_offset, column 0x1f ++ .byte 0x1 ; uleb128 0x1 ++ .byte 0x9e ; DW_CFA_offset, column 0x1e ++ .byte 0x2 ; uleb128 0x2 ++ .byte 0x9d ; DW_CFA_offset, column 0x1d ++ .byte 0x3 ; uleb128 0x3 ++ .byte 0x9c ; DW_CFA_offset, column 0x1c ++ .byte 0x4 ; uleb128 0x4 ++ .byte 0x4 ; DW_CFA_advance_loc4 ++ .set L$set$6,LCFI2-LCFI1 ++ .long L$set$6 ++ .byte 0xd ; DW_CFA_def_cfa_register ++ .byte 0x1c ; uleb128 0x1c ++ .align 2 ++LEFDE1: ++ +diff -ruN --exclude=CVS gcc-3.2.2.orig/libffi/src/prep_cif.c gcc/libffi/src/prep_cif.c +--- gcc-3.2.2.orig/libffi/src/prep_cif.c Sat Mar 3 07:21:22 2001 ++++ gcc/libffi/src/prep_cif.c Mon Sep 30 20:59:42 2002 +@@ -103,7 +103,8 @@ + /* Perform a sanity check on the return type */ + FFI_ASSERT(ffi_type_test(cif->rtype)); + +-#ifndef M68K ++ /* x86-64 and s390 stack space allocation is handled in prep_machdep. */ ++#if !defined M68K && !defined __x86_64__ && !defined S390 + /* Make space for the return structure pointer */ + if (cif->rtype->type == FFI_TYPE_STRUCT + #ifdef SPARC +@@ -122,6 +123,7 @@ + if (((*ptr)->size == 0) && (initialize_aggregate((*ptr)) != FFI_OK)) + return FFI_BAD_TYPEDEF; + ++#if !defined __x86_64__ && !defined S390 + #ifdef SPARC + if (((*ptr)->type == FFI_TYPE_STRUCT + && ((*ptr)->size > 16 || cif->abi != FFI_V9)) +@@ -137,6 +139,7 @@ + + bytes += STACK_ARG_SIZE((*ptr)->size); + } ++#endif + } + + cif->bytes = bytes; +diff -ruN --exclude=CVS gcc-3.2.2.orig/libffi/src/s390/ffi.c gcc/libffi/src/s390/ffi.c +--- gcc-3.2.2.orig/libffi/src/s390/ffi.c Thu Jan 1 09:00:00 1970 ++++ gcc/libffi/src/s390/ffi.c Thu Feb 6 08:58:57 2003 +@@ -0,0 +1,753 @@ ++/* ----------------------------------------------------------------------- ++ ffi.c - Copyright (c) 2000 Software AG ++ ++ S390 Foreign Function Interface ++ ++ Permission is hereby granted, free of charge, to any person obtaining ++ a copy of this software and associated documentation files (the ++ ``Software''), to deal in the Software without restriction, including ++ without limitation the rights to use, copy, modify, merge, publish, ++ distribute, sublicense, and/or sell copies of the Software, and to ++ permit persons to whom the Software is furnished to do so, subject to ++ the following conditions: ++ ++ The above copyright notice and this permission notice shall be included ++ in all copies or substantial portions of the Software. ++ ++ THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS ++ OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF ++ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. ++ IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR ++ OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ++ ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR ++ OTHER DEALINGS IN THE SOFTWARE. ++ ----------------------------------------------------------------------- */ ++/*====================================================================*/ ++/* Includes */ ++/* -------- */ ++/*====================================================================*/ ++ ++#include ++#include ++ ++#include ++#include ++ ++/*====================== End of Includes =============================*/ ++ ++/*====================================================================*/ ++/* Defines */ ++/* ------- */ ++/*====================================================================*/ ++ ++/* Maximum number of GPRs available for argument passing. */ ++#define MAX_GPRARGS 5 ++ ++/* Maximum number of FPRs available for argument passing. */ ++#ifdef __s390x__ ++#define MAX_FPRARGS 4 ++#else ++#define MAX_FPRARGS 2 ++#endif ++ ++/* Round to multiple of 16. */ ++#define ROUND_SIZE(size) (((size) + 15) & ~15) ++ ++/* If these values change, sysv.S must be adapted! */ ++#define FFI390_RET_VOID 0 ++#define FFI390_RET_STRUCT 1 ++#define FFI390_RET_FLOAT 2 ++#define FFI390_RET_DOUBLE 3 ++#define FFI390_RET_INT32 4 ++#define FFI390_RET_INT64 5 ++ ++/*===================== End of Defines ===============================*/ ++ ++/*====================================================================*/ ++/* Prototypes */ ++/* ---------- */ ++/*====================================================================*/ ++ ++static void ffi_prep_args (unsigned char *, extended_cif *); ++static int ffi_check_float_struct (ffi_type *); ++void ++#if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ > 2) ++__attribute__ ((visibility ("hidden"))) ++#endif ++ffi_closure_helper_SYSV (ffi_closure *, unsigned long *, ++ unsigned long long *, unsigned long *); ++ ++/*====================== End of Prototypes ===========================*/ ++ ++/*====================================================================*/ ++/* Externals */ ++/* --------- */ ++/*====================================================================*/ ++ ++extern void ffi_call_SYSV(unsigned, ++ extended_cif *, ++ void (*)(unsigned char *, extended_cif *), ++ unsigned, ++ void *, ++ void (*fn)()); ++ ++extern void ffi_closure_SYSV(void); ++ ++/*====================== End of Externals ============================*/ ++ ++/*====================================================================*/ ++/* */ ++/* Name - ffi_check_struct_type. */ ++/* */ ++/* Function - Determine if a structure can be passed within a */ ++/* general purpose or floating point register. */ ++/* */ ++/*====================================================================*/ ++ ++static int ++ffi_check_struct_type (ffi_type *arg) ++{ ++ size_t size = arg->size; ++ ++ /* If the struct has just one element, look at that element ++ to find out whether to consider the struct as floating point. */ ++ while (arg->type == FFI_TYPE_STRUCT ++ && arg->elements[0] && !arg->elements[1]) ++ arg = arg->elements[0]; ++ ++ /* Structs of size 1, 2, 4, and 8 are passed in registers, ++ just like the corresponding int/float types. */ ++ switch (size) ++ { ++ case 1: ++ return FFI_TYPE_UINT8; ++ ++ case 2: ++ return FFI_TYPE_UINT16; ++ ++ case 4: ++ if (arg->type == FFI_TYPE_FLOAT) ++ return FFI_TYPE_FLOAT; ++ else ++ return FFI_TYPE_UINT32; ++ ++ case 8: ++ if (arg->type == FFI_TYPE_DOUBLE) ++ return FFI_TYPE_DOUBLE; ++ else ++ return FFI_TYPE_UINT64; ++ ++ default: ++ break; ++ } ++ ++ /* Other structs are passed via a pointer to the data. */ ++ return FFI_TYPE_POINTER; ++} ++ ++/*======================== End of Routine ============================*/ ++ ++/*====================================================================*/ ++/* */ ++/* Name - ffi_prep_args. */ ++/* */ ++/* Function - Prepare parameters for call to function. */ ++/* */ ++/* ffi_prep_args is called by the assembly routine once stack space */ ++/* has been allocated for the function's arguments. */ ++/* */ ++/*====================================================================*/ ++ ++static void ++ffi_prep_args (unsigned char *stack, extended_cif *ecif) ++{ ++ /* The stack space will be filled with those areas: ++ ++ FPR argument register save area (highest addresses) ++ GPR argument register save area ++ temporary struct copies ++ overflow argument area (lowest addresses) ++ ++ We set up the following pointers: ++ ++ p_fpr: bottom of the FPR area (growing upwards) ++ p_gpr: bottom of the GPR area (growing upwards) ++ p_ov: bottom of the overflow area (growing upwards) ++ p_struct: top of the struct copy area (growing downwards) ++ ++ All areas are kept aligned to twice the word size. */ ++ ++ int gpr_off = ecif->cif->bytes; ++ int fpr_off = gpr_off + ROUND_SIZE (MAX_GPRARGS * sizeof (long)); ++ ++ unsigned long long *p_fpr = (unsigned long long *)(stack + fpr_off); ++ unsigned long *p_gpr = (unsigned long *)(stack + gpr_off); ++ unsigned char *p_struct = (unsigned char *)p_gpr; ++ unsigned long *p_ov = (unsigned long *)stack; ++ ++ int n_fpr = 0; ++ int n_gpr = 0; ++ int n_ov = 0; ++ ++ ffi_type **ptr; ++ void **p_argv = ecif->avalue; ++ int i; ++ ++ /* If we returning a structure then we set the first parameter register ++ to the address of where we are returning this structure. */ ++ ++ if (ecif->cif->flags == FFI390_RET_STRUCT) ++ p_gpr[n_gpr++] = (unsigned long) ecif->rvalue; ++ ++ /* Now for the arguments. */ ++ ++ for (ptr = ecif->cif->arg_types, i = ecif->cif->nargs; ++ i > 0; ++ i--, ptr++, p_argv++) ++ { ++ void *arg = *p_argv; ++ int type = (*ptr)->type; ++ ++ /* Check how a structure type is passed. */ ++ if (type == FFI_TYPE_STRUCT) ++ { ++ type = ffi_check_struct_type (*ptr); ++ ++ /* If we pass the struct via pointer, copy the data. */ ++ if (type == FFI_TYPE_POINTER) ++ { ++ p_struct -= ROUND_SIZE ((*ptr)->size); ++ memcpy (p_struct, (char *)arg, (*ptr)->size); ++ arg = &p_struct; ++ } ++ } ++ ++ /* Pointers are passed like UINTs of the same size. */ ++ if (type == FFI_TYPE_POINTER) ++#ifdef __s390x__ ++ type = FFI_TYPE_UINT64; ++#else ++ type = FFI_TYPE_UINT32; ++#endif ++ ++ /* Now handle all primitive int/float data types. */ ++ switch (type) ++ { ++ case FFI_TYPE_DOUBLE: ++ if (n_fpr < MAX_FPRARGS) ++ p_fpr[n_fpr++] = *(unsigned long long *) arg; ++ else ++#ifdef __s390x__ ++ p_ov[n_ov++] = *(unsigned long *) arg; ++#else ++ p_ov[n_ov++] = ((unsigned long *) arg)[0], ++ p_ov[n_ov++] = ((unsigned long *) arg)[1]; ++#endif ++ break; ++ ++ case FFI_TYPE_FLOAT: ++ if (n_fpr < MAX_FPRARGS) ++ p_fpr[n_fpr++] = (long long) *(unsigned int *) arg << 32; ++ else ++ p_ov[n_ov++] = *(unsigned int *) arg; ++ break; ++ ++ case FFI_TYPE_UINT64: ++ case FFI_TYPE_SINT64: ++#ifdef __s390x__ ++ if (n_gpr < MAX_GPRARGS) ++ p_gpr[n_gpr++] = *(unsigned long *) arg; ++ else ++ p_ov[n_ov++] = *(unsigned long *) arg; ++#else ++ if (n_gpr == MAX_GPRARGS-1) ++ n_gpr = MAX_GPRARGS; ++ if (n_gpr < MAX_GPRARGS) ++ p_gpr[n_gpr++] = ((unsigned long *) arg)[0], ++ p_gpr[n_gpr++] = ((unsigned long *) arg)[1]; ++ else ++ p_ov[n_ov++] = ((unsigned long *) arg)[0], ++ p_ov[n_ov++] = ((unsigned long *) arg)[1]; ++#endif ++ break; ++ ++ case FFI_TYPE_UINT32: ++ if (n_gpr < MAX_GPRARGS) ++ p_gpr[n_gpr++] = *(unsigned int *) arg; ++ else ++ p_ov[n_ov++] = *(unsigned int *) arg; ++ break; ++ ++ case FFI_TYPE_INT: ++ case FFI_TYPE_SINT32: ++ if (n_gpr < MAX_GPRARGS) ++ p_gpr[n_gpr++] = *(signed int *) arg; ++ else ++ p_ov[n_ov++] = *(signed int *) arg; ++ break; ++ ++ case FFI_TYPE_UINT16: ++ if (n_gpr < MAX_GPRARGS) ++ p_gpr[n_gpr++] = *(unsigned short *) arg; ++ else ++ p_ov[n_ov++] = *(unsigned short *) arg; ++ break; ++ ++ case FFI_TYPE_SINT16: ++ if (n_gpr < MAX_GPRARGS) ++ p_gpr[n_gpr++] = *(signed short *) arg; ++ else ++ p_ov[n_ov++] = *(signed short *) arg; ++ break; ++ ++ case FFI_TYPE_UINT8: ++ if (n_gpr < MAX_GPRARGS) ++ p_gpr[n_gpr++] = *(unsigned char *) arg; ++ else ++ p_ov[n_ov++] = *(unsigned char *) arg; ++ break; ++ ++ case FFI_TYPE_SINT8: ++ if (n_gpr < MAX_GPRARGS) ++ p_gpr[n_gpr++] = *(signed char *) arg; ++ else ++ p_ov[n_ov++] = *(signed char *) arg; ++ break; ++ ++ default: ++ FFI_ASSERT (0); ++ break; ++ } ++ } ++} ++ ++/*======================== End of Routine ============================*/ ++ ++/*====================================================================*/ ++/* */ ++/* Name - ffi_prep_cif_machdep. */ ++/* */ ++/* Function - Perform machine dependent CIF processing. */ ++/* */ ++/*====================================================================*/ ++ ++ffi_status ++ffi_prep_cif_machdep(ffi_cif *cif) ++{ ++ size_t struct_size = 0; ++ int n_gpr = 0; ++ int n_fpr = 0; ++ int n_ov = 0; ++ ++ ffi_type **ptr; ++ int i; ++ ++ /* Determine return value handling. */ ++ ++ switch (cif->rtype->type) ++ { ++ /* Void is easy. */ ++ case FFI_TYPE_VOID: ++ cif->flags = FFI390_RET_VOID; ++ break; ++ ++ /* Structures are returned via a hidden pointer. */ ++ case FFI_TYPE_STRUCT: ++ cif->flags = FFI390_RET_STRUCT; ++ n_gpr++; /* We need one GPR to pass the pointer. */ ++ break; ++ ++ /* Floating point values are returned in fpr 0. */ ++ case FFI_TYPE_FLOAT: ++ cif->flags = FFI390_RET_FLOAT; ++ break; ++ ++ case FFI_TYPE_DOUBLE: ++ cif->flags = FFI390_RET_DOUBLE; ++ break; ++ ++ /* Integer values are returned in gpr 2 (and gpr 3 ++ for 64-bit values on 31-bit machines). */ ++ case FFI_TYPE_UINT64: ++ case FFI_TYPE_SINT64: ++ cif->flags = FFI390_RET_INT64; ++ break; ++ ++ case FFI_TYPE_POINTER: ++ case FFI_TYPE_INT: ++ case FFI_TYPE_UINT32: ++ case FFI_TYPE_SINT32: ++ case FFI_TYPE_UINT16: ++ case FFI_TYPE_SINT16: ++ case FFI_TYPE_UINT8: ++ case FFI_TYPE_SINT8: ++ /* These are to be extended to word size. */ ++#ifdef __s390x__ ++ cif->flags = FFI390_RET_INT64; ++#else ++ cif->flags = FFI390_RET_INT32; ++#endif ++ break; ++ ++ default: ++ FFI_ASSERT (0); ++ break; ++ } ++ ++ /* Now for the arguments. */ ++ ++ for (ptr = cif->arg_types, i = cif->nargs; ++ i > 0; ++ i--, ptr++) ++ { ++ int type = (*ptr)->type; ++ ++ /* Check how a structure type is passed. */ ++ if (type == FFI_TYPE_STRUCT) ++ { ++ type = ffi_check_struct_type (*ptr); ++ ++ /* If we pass the struct via pointer, we must reserve space ++ to copy its data for proper call-by-value semantics. */ ++ if (type == FFI_TYPE_POINTER) ++ struct_size += ROUND_SIZE ((*ptr)->size); ++ } ++ ++ /* Now handle all primitive int/float data types. */ ++ switch (type) ++ { ++ /* The first MAX_FPRARGS floating point arguments ++ go in FPRs, the rest overflow to the stack. */ ++ ++ case FFI_TYPE_DOUBLE: ++ if (n_fpr < MAX_FPRARGS) ++ n_fpr++; ++ else ++ n_ov += sizeof (double) / sizeof (long); ++ break; ++ ++ case FFI_TYPE_FLOAT: ++ if (n_fpr < MAX_FPRARGS) ++ n_fpr++; ++ else ++ n_ov++; ++ break; ++ ++ /* On 31-bit machines, 64-bit integers are passed in GPR pairs, ++ if one is still available, or else on the stack. If only one ++ register is free, skip the register (it won't be used for any ++ subsequent argument either). */ ++ ++#ifndef __s390x__ ++ case FFI_TYPE_UINT64: ++ case FFI_TYPE_SINT64: ++ if (n_gpr == MAX_GPRARGS-1) ++ n_gpr = MAX_GPRARGS; ++ if (n_gpr < MAX_GPRARGS) ++ n_gpr += 2; ++ else ++ n_ov += 2; ++ break; ++#endif ++ ++ /* Everything else is passed in GPRs (until MAX_GPRARGS ++ have been used) or overflows to the stack. */ ++ ++ default: ++ if (n_gpr < MAX_GPRARGS) ++ n_gpr++; ++ else ++ n_ov++; ++ break; ++ } ++ } ++ ++ /* Total stack space as required for overflow arguments ++ and temporary structure copies. */ ++ ++ cif->bytes = ROUND_SIZE (n_ov * sizeof (long)) + struct_size; ++ ++ return FFI_OK; ++} ++ ++/*======================== End of Routine ============================*/ ++ ++/*====================================================================*/ ++/* */ ++/* Name - ffi_call. */ ++/* */ ++/* Function - Call the FFI routine. */ ++/* */ ++/*====================================================================*/ ++ ++void ++ffi_call(ffi_cif *cif, ++ void (*fn)(), ++ void *rvalue, ++ void **avalue) ++{ ++ int ret_type = cif->flags; ++ extended_cif ecif; ++ ++ ecif.cif = cif; ++ ecif.avalue = avalue; ++ ecif.rvalue = rvalue; ++ ++ /* If we don't have a return value, we need to fake one. */ ++ if (rvalue == NULL) ++ { ++ if (ret_type == FFI390_RET_STRUCT) ++ ecif.rvalue = alloca (cif->rtype->size); ++ else ++ ret_type = FFI390_RET_VOID; ++ } ++ ++ switch (cif->abi) ++ { ++ case FFI_SYSV: ++ ffi_call_SYSV (cif->bytes, &ecif, ffi_prep_args, ++ ret_type, ecif.rvalue, fn); ++ break; ++ ++ default: ++ FFI_ASSERT (0); ++ break; ++ } ++} ++ ++/*======================== End of Routine ============================*/ ++ ++/*====================================================================*/ ++/* */ ++/* Name - ffi_closure_helper_SYSV. */ ++/* */ ++/* Function - Call a FFI closure target function. */ ++/* */ ++/*====================================================================*/ ++ ++void ++ffi_closure_helper_SYSV (ffi_closure *closure, ++ unsigned long *p_gpr, ++ unsigned long long *p_fpr, ++ unsigned long *p_ov) ++{ ++ unsigned long long ret_buffer; ++ ++ void *rvalue = &ret_buffer; ++ void **avalue; ++ void **p_arg; ++ ++ int n_gpr = 0; ++ int n_fpr = 0; ++ int n_ov = 0; ++ ++ ffi_type **ptr; ++ int i; ++ ++ /* Allocate buffer for argument list pointers. */ ++ ++ p_arg = avalue = alloca (closure->cif->nargs * sizeof (void *)); ++ ++ /* If we returning a structure, pass the structure address ++ directly to the target function. Otherwise, have the target ++ function store the return value to the GPR save area. */ ++ ++ if (closure->cif->flags == FFI390_RET_STRUCT) ++ rvalue = (void *) p_gpr[n_gpr++]; ++ ++ /* Now for the arguments. */ ++ ++ for (ptr = closure->cif->arg_types, i = closure->cif->nargs; ++ i > 0; ++ i--, p_arg++, ptr++) ++ { ++ int deref_struct_pointer = 0; ++ int type = (*ptr)->type; ++ ++ /* Check how a structure type is passed. */ ++ if (type == FFI_TYPE_STRUCT) ++ { ++ type = ffi_check_struct_type (*ptr); ++ ++ /* If we pass the struct via pointer, remember to ++ retrieve the pointer later. */ ++ if (type == FFI_TYPE_POINTER) ++ deref_struct_pointer = 1; ++ } ++ ++ /* Pointers are passed like UINTs of the same size. */ ++ if (type == FFI_TYPE_POINTER) ++#ifdef __s390x__ ++ type = FFI_TYPE_UINT64; ++#else ++ type = FFI_TYPE_UINT32; ++#endif ++ ++ /* Now handle all primitive int/float data types. */ ++ switch (type) ++ { ++ case FFI_TYPE_DOUBLE: ++ if (n_fpr < MAX_FPRARGS) ++ *p_arg = &p_fpr[n_fpr++]; ++ else ++ *p_arg = &p_ov[n_ov], ++ n_ov += sizeof (double) / sizeof (long); ++ break; ++ ++ case FFI_TYPE_FLOAT: ++ if (n_fpr < MAX_FPRARGS) ++ *p_arg = &p_fpr[n_fpr++]; ++ else ++ *p_arg = (char *)&p_ov[n_ov++] + sizeof (long) - 4; ++ break; ++ ++ case FFI_TYPE_UINT64: ++ case FFI_TYPE_SINT64: ++#ifdef __s390x__ ++ if (n_gpr < MAX_GPRARGS) ++ *p_arg = &p_gpr[n_gpr++]; ++ else ++ *p_arg = &p_ov[n_ov++]; ++#else ++ if (n_gpr == MAX_GPRARGS-1) ++ n_gpr = MAX_GPRARGS; ++ if (n_gpr < MAX_GPRARGS) ++ *p_arg = &p_gpr[n_gpr], n_gpr += 2; ++ else ++ *p_arg = &p_ov[n_ov], n_ov += 2; ++#endif ++ break; ++ ++ case FFI_TYPE_INT: ++ case FFI_TYPE_UINT32: ++ case FFI_TYPE_SINT32: ++ if (n_gpr < MAX_GPRARGS) ++ *p_arg = (char *)&p_gpr[n_gpr++] + sizeof (long) - 4; ++ else ++ *p_arg = (char *)&p_ov[n_ov++] + sizeof (long) - 4; ++ break; ++ ++ case FFI_TYPE_UINT16: ++ case FFI_TYPE_SINT16: ++ if (n_gpr < MAX_GPRARGS) ++ *p_arg = (char *)&p_gpr[n_gpr++] + sizeof (long) - 2; ++ else ++ *p_arg = (char *)&p_ov[n_ov++] + sizeof (long) - 2; ++ break; ++ ++ case FFI_TYPE_UINT8: ++ case FFI_TYPE_SINT8: ++ if (n_gpr < MAX_GPRARGS) ++ *p_arg = (char *)&p_gpr[n_gpr++] + sizeof (long) - 1; ++ else ++ *p_arg = (char *)&p_ov[n_ov++] + sizeof (long) - 1; ++ break; ++ ++ default: ++ FFI_ASSERT (0); ++ break; ++ } ++ ++ /* If this is a struct passed via pointer, we need to ++ actually retrieve that pointer. */ ++ if (deref_struct_pointer) ++ *p_arg = *(void **)*p_arg; ++ } ++ ++ ++ /* Call the target function. */ ++ (closure->fun) (closure->cif, rvalue, avalue, closure->user_data); ++ ++ /* Convert the return value. */ ++ switch (closure->cif->rtype->type) ++ { ++ /* Void is easy, and so is struct. */ ++ case FFI_TYPE_VOID: ++ case FFI_TYPE_STRUCT: ++ break; ++ ++ /* Floating point values are returned in fpr 0. */ ++ case FFI_TYPE_FLOAT: ++ p_fpr[0] = (long long) *(unsigned int *) rvalue << 32; ++ break; ++ ++ case FFI_TYPE_DOUBLE: ++ p_fpr[0] = *(unsigned long long *) rvalue; ++ break; ++ ++ /* Integer values are returned in gpr 2 (and gpr 3 ++ for 64-bit values on 31-bit machines). */ ++ case FFI_TYPE_UINT64: ++ case FFI_TYPE_SINT64: ++#ifdef __s390x__ ++ p_gpr[0] = *(unsigned long *) rvalue; ++#else ++ p_gpr[0] = ((unsigned long *) rvalue)[0], ++ p_gpr[1] = ((unsigned long *) rvalue)[1]; ++#endif ++ break; ++ ++ case FFI_TYPE_POINTER: ++ case FFI_TYPE_UINT32: ++ case FFI_TYPE_UINT16: ++ case FFI_TYPE_UINT8: ++ p_gpr[0] = *(unsigned long *) rvalue; ++ break; ++ ++ case FFI_TYPE_INT: ++ case FFI_TYPE_SINT32: ++ case FFI_TYPE_SINT16: ++ case FFI_TYPE_SINT8: ++ p_gpr[0] = *(signed long *) rvalue; ++ break; ++ ++ default: ++ FFI_ASSERT (0); ++ break; ++ } ++} ++ ++/*======================== End of Routine ============================*/ ++ ++/*====================================================================*/ ++/* */ ++/* Name - ffi_prep_closure. */ ++/* */ ++/* Function - Prepare a FFI closure. */ ++/* */ ++/*====================================================================*/ ++ ++ffi_status ++ffi_prep_closure (ffi_closure *closure, ++ ffi_cif *cif, ++ void (*fun) (ffi_cif *, void *, void **, void *), ++ void *user_data) ++{ ++ FFI_ASSERT (cif->abi == FFI_SYSV); ++ ++#ifndef __s390x__ ++ *(short *)&closure->tramp [0] = 0x0d10; /* basr %r1,0 */ ++ *(short *)&closure->tramp [2] = 0x9801; /* lm %r0,%r1,6(%r1) */ ++ *(short *)&closure->tramp [4] = 0x1006; ++ *(short *)&closure->tramp [6] = 0x07f1; /* br %r1 */ ++ *(long *)&closure->tramp [8] = (long)closure; ++ *(long *)&closure->tramp[12] = (long)&ffi_closure_SYSV; ++#else ++ *(short *)&closure->tramp [0] = 0x0d10; /* basr %r1,0 */ ++ *(short *)&closure->tramp [2] = 0xeb01; /* lmg %r0,%r1,14(%r1) */ ++ *(short *)&closure->tramp [4] = 0x100e; ++ *(short *)&closure->tramp [6] = 0x0004; ++ *(short *)&closure->tramp [8] = 0x07f1; /* br %r1 */ ++ *(long *)&closure->tramp[16] = (long)closure; ++ *(long *)&closure->tramp[24] = (long)&ffi_closure_SYSV; ++#endif ++ ++ closure->cif = cif; ++ closure->user_data = user_data; ++ closure->fun = fun; ++ ++ return FFI_OK; ++} ++ ++/*======================== End of Routine ============================*/ ++ +diff -ruN --exclude=CVS gcc-3.2.2.orig/libffi/src/s390/sysv.S gcc/libffi/src/s390/sysv.S +--- gcc-3.2.2.orig/libffi/src/s390/sysv.S Thu Jan 1 09:00:00 1970 ++++ gcc/libffi/src/s390/sysv.S Thu Nov 28 01:44:35 2002 +@@ -0,0 +1,425 @@ ++/* ----------------------------------------------------------------------- ++ sysv.S - Copyright (c) 2000 Software AG ++ ++ S390 Foreign Function Interface ++ ++ Permission is hereby granted, free of charge, to any person obtaining ++ a copy of this software and associated documentation files (the ++ ``Software''), to deal in the Software without restriction, including ++ without limitation the rights to use, copy, modify, merge, publish, ++ distribute, sublicense, and/or sell copies of the Software, and to ++ permit persons to whom the Software is furnished to do so, subject to ++ the following conditions: ++ ++ The above copyright notice and this permission notice shall be included ++ in all copies or substantial portions of the Software. ++ ++ THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS ++ OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF ++ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. ++ IN NO EVENT SHALL CYGNUS SOLUTIONS BE LIABLE FOR ANY CLAIM, DAMAGES OR ++ OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ++ ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR ++ OTHER DEALINGS IN THE SOFTWARE. ++ ----------------------------------------------------------------------- */ ++ ++#ifndef __s390x__ ++ ++.text ++ ++ # r2: cif->bytes ++ # r3: &ecif ++ # r4: ffi_prep_args ++ # r5: ret_type ++ # r6: ecif.rvalue ++ # ov: fn ++ ++ # This assumes we are using gas. ++ .globl ffi_call_SYSV ++ .type ffi_call_SYSV,%function ++ffi_call_SYSV: ++.LFB1: ++ stm %r6,%r15,24(%r15) # Save registers ++.LCFI0: ++ basr %r13,0 # Set up base register ++.Lbase: ++ lr %r11,%r15 # Set up frame pointer ++.LCFI1: ++ sr %r15,%r2 ++ ahi %r15,-96-48 # Allocate stack ++ lr %r8,%r6 # Save ecif.rvalue ++ sr %r9,%r9 ++ ic %r9,.Ltable-.Lbase(%r13,%r5) # Load epilog address ++ l %r7,96(%r11) # Load function address ++ st %r11,0(%r15) # Set up back chain ++ ahi %r11,-48 # Register save area ++.LCFI2: ++ ++ la %r2,96(%r15) # Save area ++ # r3 already holds &ecif ++ basr %r14,%r4 # Call ffi_prep_args ++ ++ lm %r2,%r6,0(%r11) # Load arguments ++ ld %f0,32(%r11) ++ ld %f2,40(%r11) ++ la %r14,0(%r13,%r9) # Set return address ++ br %r7 # ... and call function ++ ++.LretNone: # Return void ++ l %r4,48+56(%r11) ++ lm %r6,%r15,48+24(%r11) ++ br %r4 ++ ++.LretFloat: ++ l %r4,48+56(%r11) ++ ste %f0,0(%r8) # Return float ++ lm %r6,%r15,48+24(%r11) ++ br %r4 ++ ++.LretDouble: ++ l %r4,48+56(%r11) ++ std %f0,0(%r8) # Return double ++ lm %r6,%r15,48+24(%r11) ++ br %r4 ++ ++.LretInt32: ++ l %r4,48+56(%r11) ++ st %r2,0(%r8) # Return int ++ lm %r6,%r15,48+24(%r11) ++ br %r4 ++ ++.LretInt64: ++ l %r4,48+56(%r11) ++ stm %r2,%r3,0(%r8) # Return long long ++ lm %r6,%r15,48+24(%r11) ++ br %r4 ++ ++.Ltable: ++ .byte .LretNone-.Lbase # FFI390_RET_VOID ++ .byte .LretNone-.Lbase # FFI390_RET_STRUCT ++ .byte .LretFloat-.Lbase # FFI390_RET_FLOAT ++ .byte .LretDouble-.Lbase # FFI390_RET_DOUBLE ++ .byte .LretInt32-.Lbase # FFI390_RET_INT32 ++ .byte .LretInt64-.Lbase # FFI390_RET_INT64 ++ ++.LFE1: ++.ffi_call_SYSV_end: ++ .size ffi_call_SYSV,.ffi_call_SYSV_end-ffi_call_SYSV ++ ++ ++ .globl ffi_closure_SYSV ++ .type ffi_closure_SYSV,%function ++ffi_closure_SYSV: ++.LFB2: ++ stm %r12,%r15,48(%r15) # Save registers ++.LCFI10: ++ basr %r13,0 # Set up base register ++.Lcbase: ++ stm %r2,%r6,8(%r15) # Save arguments ++ std %f0,64(%r15) ++ std %f2,72(%r15) ++ lr %r1,%r15 # Set up stack frame ++ ahi %r15,-96 ++.LCFI11: ++ l %r12,.Lchelper-.Lcbase(%r13) # Get helper function ++ lr %r2,%r0 # Closure ++ la %r3,8(%r1) # GPRs ++ la %r4,64(%r1) # FPRs ++ la %r5,96(%r1) # Overflow ++ st %r1,0(%r15) # Set up back chain ++ ++ bas %r14,0(%r12,%r13) # Call helper ++ ++ l %r4,96+56(%r15) ++ ld %f0,96+64(%r15) # Load return registers ++ lm %r2,%r3,96+8(%r15) ++ lm %r12,%r15,96+48(%r15) ++ br %r4 ++ ++ .align 4 ++.Lchelper: ++ .long ffi_closure_helper_SYSV-.Lcbase ++ ++.LFE2: ++ ++.ffi_closure_SYSV_end: ++ .size ffi_closure_SYSV,.ffi_closure_SYSV_end-ffi_closure_SYSV ++ ++ ++ .section .eh_frame,"a",@progbits ++.Lframe1: ++ .4byte .LECIE1-.LSCIE1 # Length of Common Information Entry ++.LSCIE1: ++ .4byte 0x0 # CIE Identifier Tag ++ .byte 0x1 # CIE Version ++ .ascii "zR\0" # CIE Augmentation ++ .uleb128 0x1 # CIE Code Alignment Factor ++ .sleb128 -4 # CIE Data Alignment Factor ++ .byte 0xe # CIE RA Column ++ .uleb128 0x1 # Augmentation size ++ .byte 0x1b # FDE Encoding (pcrel sdata4) ++ .byte 0xc # DW_CFA_def_cfa ++ .uleb128 0xf ++ .uleb128 0x60 ++ .align 4 ++.LECIE1: ++.LSFDE1: ++ .4byte .LEFDE1-.LASFDE1 # FDE Length ++.LASFDE1: ++ .4byte .LASFDE1-.Lframe1 # FDE CIE offset ++ .4byte .LFB1-. # FDE initial location ++ .4byte .LFE1-.LFB1 # FDE address range ++ .uleb128 0x0 # Augmentation size ++ .byte 0x4 # DW_CFA_advance_loc4 ++ .4byte .LCFI0-.LFB1 ++ .byte 0x8f # DW_CFA_offset, column 0xf ++ .uleb128 0x9 ++ .byte 0x8e # DW_CFA_offset, column 0xe ++ .uleb128 0xa ++ .byte 0x8d # DW_CFA_offset, column 0xd ++ .uleb128 0xb ++ .byte 0x8c # DW_CFA_offset, column 0xc ++ .uleb128 0xc ++ .byte 0x8b # DW_CFA_offset, column 0xb ++ .uleb128 0xd ++ .byte 0x8a # DW_CFA_offset, column 0xa ++ .uleb128 0xe ++ .byte 0x89 # DW_CFA_offset, column 0x9 ++ .uleb128 0xf ++ .byte 0x88 # DW_CFA_offset, column 0x8 ++ .uleb128 0x10 ++ .byte 0x87 # DW_CFA_offset, column 0x7 ++ .uleb128 0x11 ++ .byte 0x86 # DW_CFA_offset, column 0x6 ++ .uleb128 0x12 ++ .byte 0x4 # DW_CFA_advance_loc4 ++ .4byte .LCFI1-.LCFI0 ++ .byte 0xd # DW_CFA_def_cfa_register ++ .uleb128 0xb ++ .byte 0x4 # DW_CFA_advance_loc4 ++ .4byte .LCFI2-.LCFI1 ++ .byte 0xe # DW_CFA_def_cfa_offset ++ .uleb128 0x90 ++ .align 4 ++.LEFDE1: ++.LSFDE2: ++ .4byte .LEFDE2-.LASFDE2 # FDE Length ++.LASFDE2: ++ .4byte .LASFDE2-.Lframe1 # FDE CIE offset ++ .4byte .LFB2-. # FDE initial location ++ .4byte .LFE2-.LFB2 # FDE address range ++ .uleb128 0x0 # Augmentation size ++ .byte 0x4 # DW_CFA_advance_loc4 ++ .4byte .LCFI10-.LFB2 ++ .byte 0x8f # DW_CFA_offset, column 0xf ++ .uleb128 0x9 ++ .byte 0x8e # DW_CFA_offset, column 0xe ++ .uleb128 0xa ++ .byte 0x8d # DW_CFA_offset, column 0xd ++ .uleb128 0xb ++ .byte 0x8c # DW_CFA_offset, column 0xc ++ .uleb128 0xc ++ .byte 0x4 # DW_CFA_advance_loc4 ++ .4byte .LCFI11-.LCFI10 ++ .byte 0xe # DW_CFA_def_cfa_offset ++ .uleb128 0xc0 ++ .align 4 ++.LEFDE2: ++ ++#else ++ ++.text ++ ++ # r2: cif->bytes ++ # r3: &ecif ++ # r4: ffi_prep_args ++ # r5: ret_type ++ # r6: ecif.rvalue ++ # ov: fn ++ ++ # This assumes we are using gas. ++ .globl ffi_call_SYSV ++ .type ffi_call_SYSV,%function ++ffi_call_SYSV: ++.LFB1: ++ stmg %r6,%r15,48(%r15) # Save registers ++.LCFI0: ++ larl %r13,.Lbase # Set up base register ++ lgr %r11,%r15 # Set up frame pointer ++.LCFI1: ++ sgr %r15,%r2 ++ aghi %r15,-160-80 # Allocate stack ++ lgr %r8,%r6 # Save ecif.rvalue ++ llgc %r9,.Ltable-.Lbase(%r13,%r5) # Load epilog address ++ lg %r7,160(%r11) # Load function address ++ stg %r11,0(%r15) # Set up back chain ++ aghi %r11,-80 # Register save area ++.LCFI2: ++ ++ la %r2,160(%r15) # Save area ++ # r3 already holds &ecif ++ basr %r14,%r4 # Call ffi_prep_args ++ ++ lmg %r2,%r6,0(%r11) # Load arguments ++ ld %f0,48(%r11) ++ ld %f2,56(%r11) ++ ld %f4,64(%r11) ++ ld %f6,72(%r11) ++ la %r14,0(%r13,%r9) # Set return address ++ br %r7 # ... and call function ++ ++.Lbase: ++.LretNone: # Return void ++ lg %r4,80+112(%r11) ++ lmg %r6,%r15,80+48(%r11) ++ br %r4 ++ ++.LretFloat: ++ lg %r4,80+112(%r11) ++ ste %f0,0(%r8) # Return float ++ lmg %r6,%r15,80+48(%r11) ++ br %r4 ++ ++.LretDouble: ++ lg %r4,80+112(%r11) ++ std %f0,0(%r8) # Return double ++ lmg %r6,%r15,80+48(%r11) ++ br %r4 ++ ++.LretInt32: ++ lg %r4,80+112(%r11) ++ st %r2,0(%r8) # Return int ++ lmg %r6,%r15,80+48(%r11) ++ br %r4 ++ ++.LretInt64: ++ lg %r4,80+112(%r11) ++ stg %r2,0(%r8) # Return long ++ lmg %r6,%r15,80+48(%r11) ++ br %r4 ++ ++.Ltable: ++ .byte .LretNone-.Lbase # FFI390_RET_VOID ++ .byte .LretNone-.Lbase # FFI390_RET_STRUCT ++ .byte .LretFloat-.Lbase # FFI390_RET_FLOAT ++ .byte .LretDouble-.Lbase # FFI390_RET_DOUBLE ++ .byte .LretInt32-.Lbase # FFI390_RET_INT32 ++ .byte .LretInt64-.Lbase # FFI390_RET_INT64 ++ ++.LFE1: ++.ffi_call_SYSV_end: ++ .size ffi_call_SYSV,.ffi_call_SYSV_end-ffi_call_SYSV ++ ++ ++ .globl ffi_closure_SYSV ++ .type ffi_closure_SYSV,%function ++ffi_closure_SYSV: ++.LFB2: ++ stmg %r14,%r15,112(%r15) # Save registers ++.LCFI10: ++ stmg %r2,%r6,16(%r15) # Save arguments ++ std %f0,128(%r15) ++ std %f2,136(%r15) ++ std %f4,144(%r15) ++ std %f6,152(%r15) ++ lgr %r1,%r15 # Set up stack frame ++ aghi %r15,-160 ++.LCFI11: ++ lgr %r2,%r0 # Closure ++ la %r3,16(%r1) # GPRs ++ la %r4,128(%r1) # FPRs ++ la %r5,160(%r1) # Overflow ++ stg %r1,0(%r15) # Set up back chain ++ ++ brasl %r14,ffi_closure_helper_SYSV # Call helper ++ ++ lg %r14,160+112(%r15) ++ ld %f0,160+128(%r15) # Load return registers ++ lg %r2,160+16(%r15) ++ la %r15,160(%r15) ++ br %r14 ++.LFE2: ++ ++.ffi_closure_SYSV_end: ++ .size ffi_closure_SYSV,.ffi_closure_SYSV_end-ffi_closure_SYSV ++ ++ ++ ++ .section .eh_frame,"a",@progbits ++.Lframe1: ++ .4byte .LECIE1-.LSCIE1 # Length of Common Information Entry ++.LSCIE1: ++ .4byte 0x0 # CIE Identifier Tag ++ .byte 0x1 # CIE Version ++ .ascii "zR\0" # CIE Augmentation ++ .uleb128 0x1 # CIE Code Alignment Factor ++ .sleb128 -8 # CIE Data Alignment Factor ++ .byte 0xe # CIE RA Column ++ .uleb128 0x1 # Augmentation size ++ .byte 0x1b # FDE Encoding (pcrel sdata4) ++ .byte 0xc # DW_CFA_def_cfa ++ .uleb128 0xf ++ .uleb128 0xa0 ++ .align 8 ++.LECIE1: ++.LSFDE1: ++ .4byte .LEFDE1-.LASFDE1 # FDE Length ++.LASFDE1: ++ .4byte .LASFDE1-.Lframe1 # FDE CIE offset ++ .4byte .LFB1-. # FDE initial location ++ .4byte .LFE1-.LFB1 # FDE address range ++ .uleb128 0x0 # Augmentation size ++ .byte 0x4 # DW_CFA_advance_loc4 ++ .4byte .LCFI0-.LFB1 ++ .byte 0x8f # DW_CFA_offset, column 0xf ++ .uleb128 0x5 ++ .byte 0x8e # DW_CFA_offset, column 0xe ++ .uleb128 0x6 ++ .byte 0x8d # DW_CFA_offset, column 0xd ++ .uleb128 0x7 ++ .byte 0x8c # DW_CFA_offset, column 0xc ++ .uleb128 0x8 ++ .byte 0x8b # DW_CFA_offset, column 0xb ++ .uleb128 0x9 ++ .byte 0x8a # DW_CFA_offset, column 0xa ++ .uleb128 0xa ++ .byte 0x89 # DW_CFA_offset, column 0x9 ++ .uleb128 0xb ++ .byte 0x88 # DW_CFA_offset, column 0x8 ++ .uleb128 0xc ++ .byte 0x87 # DW_CFA_offset, column 0x7 ++ .uleb128 0xd ++ .byte 0x86 # DW_CFA_offset, column 0x6 ++ .uleb128 0xe ++ .byte 0x4 # DW_CFA_advance_loc4 ++ .4byte .LCFI1-.LCFI0 ++ .byte 0xd # DW_CFA_def_cfa_register ++ .uleb128 0xb ++ .byte 0x4 # DW_CFA_advance_loc4 ++ .4byte .LCFI2-.LCFI1 ++ .byte 0xe # DW_CFA_def_cfa_offset ++ .uleb128 0xf0 ++ .align 8 ++.LEFDE1: ++.LSFDE2: ++ .4byte .LEFDE2-.LASFDE2 # FDE Length ++.LASFDE2: ++ .4byte .LASFDE2-.Lframe1 # FDE CIE offset ++ .4byte .LFB2-. # FDE initial location ++ .4byte .LFE2-.LFB2 # FDE address range ++ .uleb128 0x0 # Augmentation size ++ .byte 0x4 # DW_CFA_advance_loc4 ++ .4byte .LCFI10-.LFB2 ++ .byte 0x8f # DW_CFA_offset, column 0xf ++ .uleb128 0x5 ++ .byte 0x8e # DW_CFA_offset, column 0xe ++ .uleb128 0x6 ++ .byte 0x4 # DW_CFA_advance_loc4 ++ .4byte .LCFI11-.LCFI10 ++ .byte 0xe # DW_CFA_def_cfa_offset ++ .uleb128 0x140 ++ .align 8 ++.LEFDE2: ++ ++#endif ++ +diff -ruN --exclude=CVS gcc-3.2.2.orig/libffi/src/sh/ffi.c gcc/libffi/src/sh/ffi.c +--- gcc-3.2.2.orig/libffi/src/sh/ffi.c Thu Jan 1 09:00:00 1970 ++++ gcc/libffi/src/sh/ffi.c Fri Jul 19 10:08:43 2002 +@@ -0,0 +1,722 @@ ++/* ----------------------------------------------------------------------- ++ ffi.c - Copyright (c) 2002 Kaz Kojima ++ ++ SuperH Foreign Function Interface ++ ++ Permission is hereby granted, free of charge, to any person obtaining ++ a copy of this software and associated documentation files (the ++ ``Software''), to deal in the Software without restriction, including ++ without limitation the rights to use, copy, modify, merge, publish, ++ distribute, sublicense, and/or sell copies of the Software, and to ++ permit persons to whom the Software is furnished to do so, subject to ++ the following conditions: ++ ++ The above copyright notice and this permission notice shall be included ++ in all copies or substantial portions of the Software. ++ ++ THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS ++ OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF ++ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. ++ IN NO EVENT SHALL CYGNUS SOLUTIONS BE LIABLE FOR ANY CLAIM, DAMAGES OR ++ OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ++ ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR ++ OTHER DEALINGS IN THE SOFTWARE. ++ ----------------------------------------------------------------------- */ ++ ++#include ++#include ++ ++#include ++ ++#define NGREGARG 4 ++#if defined(__SH4__) ++#define NFREGARG 8 ++#endif ++ ++#if defined(__HITACHI__) ++#define STRUCT_VALUE_ADDRESS_WITH_ARG 1 ++#else ++#define STRUCT_VALUE_ADDRESS_WITH_ARG 0 ++#endif ++ ++/* If the structure has essentialy an unique element, return its type. */ ++static int ++simple_type (ffi_type *arg) ++{ ++ if (arg->type != FFI_TYPE_STRUCT) ++ return arg->type; ++ else if (arg->elements[1]) ++ return FFI_TYPE_STRUCT; ++ ++ return simple_type (arg->elements[0]); ++} ++ ++static int ++return_type (ffi_type *arg) ++{ ++ unsigned short type; ++ ++ if (arg->type != FFI_TYPE_STRUCT) ++ return arg->type; ++ ++ type = simple_type (arg->elements[0]); ++ if (! arg->elements[1]) ++ { ++ switch (type) ++ { ++ case FFI_TYPE_SINT8: ++ case FFI_TYPE_UINT8: ++ case FFI_TYPE_SINT16: ++ case FFI_TYPE_UINT16: ++ case FFI_TYPE_SINT32: ++ case FFI_TYPE_UINT32: ++ return FFI_TYPE_INT; ++ ++ default: ++ return type; ++ } ++ } ++ ++ /* gcc uses r0/r1 pair for some kind of structures. */ ++ if (arg->size <= 2 * sizeof (int)) ++ { ++ int i = 0; ++ ffi_type *e; ++ ++ while ((e = arg->elements[i++])) ++ { ++ type = simple_type (e); ++ switch (type) ++ { ++ case FFI_TYPE_SINT32: ++ case FFI_TYPE_UINT32: ++ case FFI_TYPE_INT: ++ case FFI_TYPE_FLOAT: ++ return FFI_TYPE_UINT64; ++ ++ default: ++ break; ++ } ++ } ++ } ++ ++ return FFI_TYPE_STRUCT; ++} ++ ++/* ffi_prep_args is called by the assembly routine once stack space ++ has been allocated for the function's arguments */ ++ ++/*@-exportheader@*/ ++void ffi_prep_args(char *stack, extended_cif *ecif) ++/*@=exportheader@*/ ++{ ++ register unsigned int i; ++ register int tmp; ++ register unsigned int avn; ++ register void **p_argv; ++ register char *argp; ++ register ffi_type **p_arg; ++ int greg, ireg; ++#if defined(__SH4__) ++ int freg = 0; ++#endif ++ ++ tmp = 0; ++ argp = stack; ++ ++ if (return_type (ecif->cif->rtype) == FFI_TYPE_STRUCT) ++ { ++ *(void **) argp = ecif->rvalue; ++ argp += 4; ++ ireg = STRUCT_VALUE_ADDRESS_WITH_ARG ? 1 : 0; ++ } ++ else ++ ireg = 0; ++ ++ /* Set arguments for registers. */ ++ greg = ireg; ++ avn = ecif->cif->nargs; ++ p_argv = ecif->avalue; ++ ++ for (i = 0, p_arg = ecif->cif->arg_types; i < avn; i++, p_arg++, p_argv++) ++ { ++ size_t z; ++ ++ z = (*p_arg)->size; ++ if (z < sizeof(int)) ++ { ++ if (greg++ >= NGREGARG) ++ continue; ++ ++ z = sizeof(int); ++ switch ((*p_arg)->type) ++ { ++ case FFI_TYPE_SINT8: ++ *(signed int *) argp = (signed int)*(SINT8 *)(* p_argv); ++ break; ++ ++ case FFI_TYPE_UINT8: ++ *(unsigned int *) argp = (unsigned int)*(UINT8 *)(* p_argv); ++ break; ++ ++ case FFI_TYPE_SINT16: ++ *(signed int *) argp = (signed int)*(SINT16 *)(* p_argv); ++ break; ++ ++ case FFI_TYPE_UINT16: ++ *(unsigned int *) argp = (unsigned int)*(UINT16 *)(* p_argv); ++ break; ++ ++ case FFI_TYPE_STRUCT: ++ *(unsigned int *) argp = (unsigned int)*(UINT32 *)(* p_argv); ++ break; ++ ++ default: ++ FFI_ASSERT(0); ++ } ++ argp += z; ++ } ++ else if (z == sizeof(int)) ++ { ++#if defined(__SH4__) ++ if ((*p_arg)->type == FFI_TYPE_FLOAT) ++ { ++ if (freg++ >= NFREGARG) ++ continue; ++ } ++ else ++#endif ++ { ++ if (greg++ >= NGREGARG) ++ continue; ++ } ++ *(unsigned int *) argp = (unsigned int)*(UINT32 *)(* p_argv); ++ argp += z; ++ } ++#if defined(__SH4__) ++ else if ((*p_arg)->type == FFI_TYPE_DOUBLE) ++ { ++ if (freg + 1 >= NFREGARG) ++ continue; ++ freg = (freg + 1) & ~1; ++ freg += 2; ++ memcpy (argp, *p_argv, z); ++ argp += z; ++ } ++#endif ++ else ++ { ++ int n = (z + sizeof (int) - 1) / sizeof (int); ++#if defined(__SH4__) ++ if (greg + n - 1 >= NGREGARG) ++ continue; ++ greg += n; ++#else ++ if (greg >= NGREGARG) ++ continue; ++ else if (greg + n - 1 >= NGREGARG) ++ greg = NGREGARG; ++ else ++ greg += n; ++#endif ++ memcpy (argp, *p_argv, z); ++ argp += z; ++ } ++ } ++ ++ /* Set arguments on stack. */ ++ greg = ireg; ++#if defined(__SH4__) ++ freg = 0; ++#endif ++ p_argv = ecif->avalue; ++ ++ for (i = 0, p_arg = ecif->cif->arg_types; i < avn; i++, p_arg++, p_argv++) ++ { ++ size_t z; ++ ++ z = (*p_arg)->size; ++ if (z < sizeof(int)) ++ { ++ if (greg++ < NGREGARG) ++ continue; ++ ++ z = sizeof(int); ++ switch ((*p_arg)->type) ++ { ++ case FFI_TYPE_SINT8: ++ *(signed int *) argp = (signed int)*(SINT8 *)(* p_argv); ++ break; ++ ++ case FFI_TYPE_UINT8: ++ *(unsigned int *) argp = (unsigned int)*(UINT8 *)(* p_argv); ++ break; ++ ++ case FFI_TYPE_SINT16: ++ *(signed int *) argp = (signed int)*(SINT16 *)(* p_argv); ++ break; ++ ++ case FFI_TYPE_UINT16: ++ *(unsigned int *) argp = (unsigned int)*(UINT16 *)(* p_argv); ++ break; ++ ++ case FFI_TYPE_STRUCT: ++ *(unsigned int *) argp = (unsigned int)*(UINT32 *)(* p_argv); ++ break; ++ ++ default: ++ FFI_ASSERT(0); ++ } ++ argp += z; ++ } ++ else if (z == sizeof(int)) ++ { ++#if defined(__SH4__) ++ if ((*p_arg)->type == FFI_TYPE_FLOAT) ++ { ++ if (freg++ < NFREGARG) ++ continue; ++ } ++ else ++#endif ++ { ++ if (greg++ < NGREGARG) ++ continue; ++ } ++ *(unsigned int *) argp = (unsigned int)*(UINT32 *)(* p_argv); ++ argp += z; ++ } ++#if defined(__SH4__) ++ else if ((*p_arg)->type == FFI_TYPE_DOUBLE) ++ { ++ if (freg + 1 < NFREGARG) ++ { ++ freg = (freg + 1) & ~1; ++ freg += 2; ++ continue; ++ } ++ memcpy (argp, *p_argv, z); ++ argp += z; ++ } ++#endif ++ else ++ { ++ int n = (z + sizeof (int) - 1) / sizeof (int); ++ if (greg + n - 1 < NGREGARG) ++ { ++ greg += n; ++ continue; ++ } ++#if (! defined(__SH4__)) ++ else if (greg < NGREGARG) ++ { ++ greg = NGREGARG; ++ continue; ++ } ++#endif ++ memcpy (argp, *p_argv, z); ++ argp += z; ++ } ++ } ++ ++ return; ++} ++ ++/* Perform machine dependent cif processing */ ++ffi_status ffi_prep_cif_machdep(ffi_cif *cif) ++{ ++ int i, j; ++ int size, type; ++ int n, m; ++ int greg; ++#if defined(__SH4__) ++ int freg = 0; ++#endif ++ ++ cif->flags = 0; ++ ++ greg = ((return_type (cif->rtype) == FFI_TYPE_STRUCT) && ++ STRUCT_VALUE_ADDRESS_WITH_ARG) ? 1 : 0; ++ ++#if defined(__SH4__) ++ for (i = j = 0; i < cif->nargs && j < 12; i++) ++ { ++ type = (cif->arg_types)[i]->type; ++ switch (type) ++ { ++ case FFI_TYPE_FLOAT: ++ if (freg >= NFREGARG) ++ continue; ++ freg++; ++ cif->flags += ((cif->arg_types)[i]->type) << (2 * j); ++ j++; ++ break; ++ ++ case FFI_TYPE_DOUBLE: ++ if ((freg + 1) >= NFREGARG) ++ continue; ++ freg = (freg + 1) & ~1; ++ freg += 2; ++ cif->flags += ((cif->arg_types)[i]->type) << (2 * j); ++ j++; ++ break; ++ ++ default: ++ size = (cif->arg_types)[i]->size; ++ n = (size + sizeof (int) - 1) / sizeof (int); ++ if (greg + n - 1 >= NGREGARG) ++ continue; ++ greg += n; ++ for (m = 0; m < n; m++) ++ cif->flags += FFI_TYPE_INT << (2 * j++); ++ break; ++ } ++ } ++#else ++ for (i = j = 0; i < cif->nargs && j < 4; i++) ++ { ++ size = (cif->arg_types)[i]->size; ++ n = (size + sizeof (int) - 1) / sizeof (int); ++ if (greg >= NGREGARG) ++ continue; ++ else if (greg + n - 1 >= NGREGARG) ++ greg = NGREGARG; ++ else ++ greg += n; ++ for (m = 0; m < n; m++) ++ cif->flags += FFI_TYPE_INT << (2 * j++); ++ } ++#endif ++ ++ /* Set the return type flag */ ++ switch (cif->rtype->type) ++ { ++ case FFI_TYPE_STRUCT: ++ cif->flags += (unsigned) (return_type (cif->rtype)) << 24; ++ break; ++ ++ case FFI_TYPE_VOID: ++ case FFI_TYPE_FLOAT: ++ case FFI_TYPE_DOUBLE: ++ case FFI_TYPE_SINT64: ++ case FFI_TYPE_UINT64: ++ cif->flags += (unsigned) cif->rtype->type << 24; ++ break; ++ ++ default: ++ cif->flags += FFI_TYPE_INT << 24; ++ break; ++ } ++ ++ return FFI_OK; ++} ++ ++/*@-declundef@*/ ++/*@-exportheader@*/ ++extern void ffi_call_SYSV(void (*)(char *, extended_cif *), ++ /*@out@*/ extended_cif *, ++ unsigned, unsigned, ++ /*@out@*/ unsigned *, ++ void (*fn)()); ++/*@=declundef@*/ ++/*@=exportheader@*/ ++ ++void ffi_call(/*@dependent@*/ ffi_cif *cif, ++ void (*fn)(), ++ /*@out@*/ void *rvalue, ++ /*@dependent@*/ void **avalue) ++{ ++ extended_cif ecif; ++ ++ ecif.cif = cif; ++ ecif.avalue = avalue; ++ ++ /* If the return value is a struct and we don't have a return */ ++ /* value address then we need to make one */ ++ ++ if ((rvalue == NULL) && ++ (cif->rtype->type == FFI_TYPE_STRUCT)) ++ { ++ /*@-sysunrecog@*/ ++ ecif.rvalue = alloca(cif->rtype->size); ++ /*@=sysunrecog@*/ ++ } ++ else ++ ecif.rvalue = rvalue; ++ ++ ++ switch (cif->abi) ++ { ++ case FFI_SYSV: ++ /*@-usedef@*/ ++ ffi_call_SYSV(ffi_prep_args, &ecif, cif->bytes, ++ cif->flags, ecif.rvalue, fn); ++ /*@=usedef@*/ ++ break; ++ default: ++ FFI_ASSERT(0); ++ break; ++ } ++} ++ ++extern void ffi_closure_SYSV (void); ++#if defined(__SH4__) ++extern void __ic_invalidate (void *line); ++#endif ++ ++ffi_status ++ffi_prep_closure (ffi_closure* closure, ++ ffi_cif* cif, ++ void (*fun)(ffi_cif*, void*, void**, void*), ++ void *user_data) ++{ ++ unsigned int *tramp; ++ ++ FFI_ASSERT (cif->abi == FFI_GCC_SYSV); ++ ++ tramp = (unsigned int *) &closure->tramp[0]; ++#ifdef __LITTLE_ENDIAN__ ++ tramp[0] = 0xd301d202; ++ tramp[1] = 0x0009422b; ++#else ++ tramp[0] = 0xd202d301; ++ tramp[1] = 0x422b0009; ++#endif ++ *(void **) &tramp[2] = (void *)closure; /* ctx */ ++ *(void **) &tramp[3] = (void *)ffi_closure_SYSV; /* funaddr */ ++ ++ closure->cif = cif; ++ closure->fun = fun; ++ closure->user_data = user_data; ++ ++#if defined(__SH4__) ++ /* Flush the icache. */ ++ __ic_invalidate(&closure->tramp[0]); ++#endif ++ ++ return FFI_OK; ++} ++ ++/* Basically the trampoline invokes ffi_closure_SYSV, and on ++ * entry, r3 holds the address of the closure. ++ * After storing the registers that could possibly contain ++ * parameters to be passed into the stack frame and setting ++ * up space for a return value, ffi_closure_SYSV invokes the ++ * following helper function to do most of the work. ++ */ ++ ++#ifdef __LITTLE_ENDIAN__ ++#define OFS_INT8 0 ++#define OFS_INT16 2 ++#else ++#define OFS_INT8 3 ++#define OFS_INT16 2 ++#endif ++ ++int ++ffi_closure_helper_SYSV (ffi_closure *closure, void *rvalue, ++ unsigned long *pgr, unsigned long *pfr, ++ unsigned long *pst) ++{ ++ void **avalue; ++ ffi_type **p_arg; ++ int i, avn; ++ int ireg, greg = 0; ++#if defined(__SH4__) ++ int freg = 0; ++#endif ++ ffi_cif *cif; ++ double temp; ++ ++ cif = closure->cif; ++ avalue = alloca(cif->nargs * sizeof(void *)); ++ ++ /* Copy the caller's structure return value address so that the closure ++ returns the data directly to the caller. */ ++ if (cif->rtype->type == FFI_TYPE_STRUCT) ++ { ++ rvalue = *pgr++; ++ ireg = STRUCT_VALUE_ADDRESS_WITH_ARG ? 1 : 0; ++ } ++ else ++ ireg = 0; ++ ++ cif = closure->cif; ++ greg = ireg; ++ avn = cif->nargs; ++ ++ /* Grab the addresses of the arguments from the stack frame. */ ++ for (i = 0, p_arg = cif->arg_types; i < avn; i++, p_arg++) ++ { ++ size_t z; ++ ++ z = (*p_arg)->size; ++ if (z < sizeof(int)) ++ { ++ if (greg++ >= NGREGARG) ++ continue; ++ ++ z = sizeof(int); ++ switch ((*p_arg)->type) ++ { ++ case FFI_TYPE_SINT8: ++ case FFI_TYPE_UINT8: ++ avalue[i] = (((char *)pgr) + OFS_INT8); ++ break; ++ ++ case FFI_TYPE_SINT16: ++ case FFI_TYPE_UINT16: ++ avalue[i] = (((char *)pgr) + OFS_INT16); ++ break; ++ ++ case FFI_TYPE_STRUCT: ++ avalue[i] = pgr; ++ break; ++ ++ default: ++ FFI_ASSERT(0); ++ } ++ pgr++; ++ } ++ else if (z == sizeof(int)) ++ { ++#if defined(__SH4__) ++ if ((*p_arg)->type == FFI_TYPE_FLOAT) ++ { ++ if (freg++ >= NFREGARG) ++ continue; ++ avalue[i] = pfr; ++ pfr++; ++ } ++ else ++#endif ++ { ++ if (greg++ >= NGREGARG) ++ continue; ++ avalue[i] = pgr; ++ pgr++; ++ } ++ } ++#if defined(__SH4__) ++ else if ((*p_arg)->type == FFI_TYPE_DOUBLE) ++ { ++ if (freg + 1 >= NFREGARG) ++ continue; ++ freg = (freg + 1) & ~1; ++ freg += 2; ++ avalue[i] = pfr; ++ pfr += 2; ++ } ++#endif ++ else ++ { ++ int n = (z + sizeof (int) - 1) / sizeof (int); ++#if defined(__SH4__) ++ if (greg + n - 1 >= NGREGARG) ++ continue; ++ greg += n; ++#else ++ if (greg >= NGREGARG) ++ continue; ++ else if (greg + n - 1 >= NGREGARG) ++ greg = NGREGARG; ++ else ++ greg += n; ++#endif ++ avalue[i] = pgr; ++ pgr += n; ++ } ++ } ++ ++ greg = ireg; ++#if defined(__SH4__) ++ freg = 0; ++#endif ++ ++ for (i = 0, p_arg = cif->arg_types; i < avn; i++, p_arg++) ++ { ++ size_t z; ++ ++ z = (*p_arg)->size; ++ if (z < sizeof(int)) ++ { ++ if (greg++ < NGREGARG) ++ continue; ++ ++ z = sizeof(int); ++ switch ((*p_arg)->type) ++ { ++ case FFI_TYPE_SINT8: ++ case FFI_TYPE_UINT8: ++ avalue[i] = (((char *)pst) + OFS_INT8); ++ break; ++ ++ case FFI_TYPE_SINT16: ++ case FFI_TYPE_UINT16: ++ avalue[i] = (((char *)pst) + OFS_INT16); ++ break; ++ ++ case FFI_TYPE_STRUCT: ++ avalue[i] = pst; ++ break; ++ ++ default: ++ FFI_ASSERT(0); ++ } ++ pst++; ++ } ++ else if (z == sizeof(int)) ++ { ++#if defined(__SH4__) ++ if ((*p_arg)->type == FFI_TYPE_FLOAT) ++ { ++ if (freg++ < NFREGARG) ++ continue; ++ } ++ else ++#endif ++ { ++ if (greg++ < NGREGARG) ++ continue; ++ } ++ avalue[i] = pst; ++ pst++; ++ } ++#if defined(__SH4__) ++ else if ((*p_arg)->type == FFI_TYPE_DOUBLE) ++ { ++ if (freg + 1 < NFREGARG) ++ { ++ freg = (freg + 1) & ~1; ++ freg += 2; ++ continue; ++ } ++ avalue[i] = pst; ++ pst += 2; ++ } ++#endif ++ else ++ { ++ int n = (z + sizeof (int) - 1) / sizeof (int); ++ if (greg + n - 1 < NGREGARG) ++ { ++ greg += n; ++ continue; ++ } ++#if (! defined(__SH4__)) ++ else if (greg < NGREGARG) ++ { ++ greg = NGREGARG; ++ continue; ++ } ++#endif ++ avalue[i] = pst; ++ pst += n; ++ } ++ } ++ ++ (closure->fun) (cif, rvalue, avalue, closure->user_data); ++ ++ /* Tell ffi_closure_osf how to perform return type promotions. */ ++ return cif->rtype->type; ++} +diff -ruN --exclude=CVS gcc-3.2.2.orig/libffi/src/sh/sysv.S gcc/libffi/src/sh/sysv.S +--- gcc-3.2.2.orig/libffi/src/sh/sysv.S Thu Jan 1 09:00:00 1970 ++++ gcc/libffi/src/sh/sysv.S Tue Dec 17 03:22:48 2002 +@@ -0,0 +1,773 @@ ++/* ----------------------------------------------------------------------- ++ sysv.S - Copyright (c) 2002 Kaz Kojima ++ ++ SuperH Foreign Function Interface ++ ++ Permission is hereby granted, free of charge, to any person obtaining ++ a copy of this software and associated documentation files (the ++ ``Software''), to deal in the Software without restriction, including ++ without limitation the rights to use, copy, modify, merge, publish, ++ distribute, sublicense, and/or sell copies of the Software, and to ++ permit persons to whom the Software is furnished to do so, subject to ++ the following conditions: ++ ++ The above copyright notice and this permission notice shall be included ++ in all copies or substantial portions of the Software. ++ ++ THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS ++ OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF ++ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. ++ IN NO EVENT SHALL CYGNUS SOLUTIONS BE LIABLE FOR ANY CLAIM, DAMAGES OR ++ OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ++ ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR ++ OTHER DEALINGS IN THE SOFTWARE. ++ ----------------------------------------------------------------------- */ ++ ++#define LIBFFI_ASM ++#include ++#ifdef HAVE_MACHINE_ASM_H ++#include ++#else ++/* XXX these lose for some platforms, I'm sure. */ ++#define CNAME(x) x ++#define ENTRY(x) .globl CNAME(x); .type CNAME(x),%function; CNAME(x): ++#endif ++ ++#if defined(__HITACHI__) ++#define STRUCT_VALUE_ADDRESS_WITH_ARG 1 ++#else ++#define STRUCT_VALUE_ADDRESS_WITH_ARG 0 ++#endif ++ ++.text ++ ++ # r4: ffi_prep_args ++ # r5: &ecif ++ # r6: bytes ++ # r7: flags ++ # sp+0: rvalue ++ # sp+4: fn ++ ++ # This assumes we are using gas. ++ENTRY(ffi_call_SYSV) ++ # Save registers ++.LFB1: ++ mov.l r8,@-r15 ++.LCFI0: ++ mov.l r9,@-r15 ++.LCFI1: ++ mov.l r10,@-r15 ++.LCFI2: ++ mov.l r12,@-r15 ++.LCFI3: ++ mov.l r14,@-r15 ++.LCFI4: ++ sts.l pr,@-r15 ++.LCFI5: ++ mov r15,r14 ++.LCFI6: ++#if defined(__SH4__) ++ mov r6,r8 ++ mov r7,r9 ++ ++ sub r6,r15 ++ add #-16,r15 ++ mov #~7,r0 ++ and r0,r15 ++ ++ mov r4,r0 ++ jsr @r0 ++ mov r15,r4 ++ ++ mov r9,r1 ++ shlr8 r9 ++ shlr8 r9 ++ shlr8 r9 ++ ++ mov #FFI_TYPE_STRUCT,r2 ++ cmp/eq r2,r9 ++ bf 1f ++#if STRUCT_VALUE_ADDRESS_WITH_ARG ++ mov.l @r15+,r4 ++ bra 2f ++ mov #5,r2 ++#else ++ mov.l @r15+,r10 ++#endif ++1: ++ mov #4,r2 ++2: ++ mov #4,r3 ++ ++L_pass: ++ cmp/pl r8 ++ bf L_call_it ++ ++ mov r1,r0 ++ and #3,r0 ++ ++L_pass_d: ++ cmp/eq #FFI_TYPE_DOUBLE,r0 ++ bf L_pass_f ++ ++ mov r3,r0 ++ and #1,r0 ++ tst r0,r0 ++ bt 1f ++ add #1,r3 ++1: ++ mov r15,r0 ++ and #7,r0 ++ tst r0,r0 ++ bt 2f ++ add #4,r15 ++2: ++ mov #12,r0 ++ cmp/hs r0,r3 ++ bt/s 3f ++ shlr2 r1 ++ bsr L_pop_d ++ nop ++3: ++ add #2,r3 ++ bra L_pass ++ add #-8,r8 ++ ++L_pop_d: ++ mov r3,r0 ++ add r0,r0 ++ add r3,r0 ++ add #-12,r0 ++ braf r0 ++ nop ++#ifdef __LITTLE_ENDIAN__ ++ fmov.s @r15+,fr5 ++ rts ++ fmov.s @r15+,fr4 ++ fmov.s @r15+,fr7 ++ rts ++ fmov.s @r15+,fr6 ++ fmov.s @r15+,fr9 ++ rts ++ fmov.s @r15+,fr8 ++ fmov.s @r15+,fr11 ++ rts ++ fmov.s @r15+,fr10 ++#else ++ fmov.s @r15+,fr4 ++ rts ++ fmov.s @r15+,fr5 ++ fmov.s @r15+,fr6 ++ rts ++ fmov.s @r15+,fr7 ++ fmov.s @r15+,fr8 ++ rts ++ fmov.s @r15+,fr9 ++ fmov.s @r15+,fr10 ++ rts ++ fmov.s @r15+,fr11 ++#endif ++ ++L_pass_f: ++ cmp/eq #FFI_TYPE_FLOAT,r0 ++ bf L_pass_i ++ ++ mov #12,r0 ++ cmp/hs r0,r3 ++ bt/s 2f ++ shlr2 r1 ++ bsr L_pop_f ++ nop ++2: ++ add #1,r3 ++ bra L_pass ++ add #-4,r8 ++ ++L_pop_f: ++ mov r3,r0 ++ shll2 r0 ++ add #-16,r0 ++ braf r0 ++ nop ++#ifdef __LITTLE_ENDIAN__ ++ rts ++ fmov.s @r15+,fr5 ++ rts ++ fmov.s @r15+,fr4 ++ rts ++ fmov.s @r15+,fr7 ++ rts ++ fmov.s @r15+,fr6 ++ rts ++ fmov.s @r15+,fr9 ++ rts ++ fmov.s @r15+,fr8 ++ rts ++ fmov.s @r15+,fr11 ++ rts ++ fmov.s @r15+,fr10 ++#else ++ rts ++ fmov.s @r15+,fr4 ++ rts ++ fmov.s @r15+,fr5 ++ rts ++ fmov.s @r15+,fr6 ++ rts ++ fmov.s @r15+,fr7 ++ rts ++ fmov.s @r15+,fr8 ++ rts ++ fmov.s @r15+,fr9 ++ rts ++ fmov.s @r15+,fr10 ++ rts ++ fmov.s @r15+,fr11 ++#endif ++ ++L_pass_i: ++ cmp/eq #FFI_TYPE_INT,r0 ++ bf L_call_it ++ ++ mov #8,r0 ++ cmp/hs r0,r2 ++ bt/s 2f ++ shlr2 r1 ++ bsr L_pop_i ++ nop ++2: ++ add #1,r2 ++ bra L_pass ++ add #-4,r8 ++ ++L_pop_i: ++ mov r2,r0 ++ shll2 r0 ++ add #-16,r0 ++ braf r0 ++ nop ++ rts ++ mov.l @r15+,r4 ++ rts ++ mov.l @r15+,r5 ++ rts ++ mov.l @r15+,r6 ++ rts ++ mov.l @r15+,r7 ++ ++L_call_it: ++ # call function ++#if (! STRUCT_VALUE_ADDRESS_WITH_ARG) ++ mov r10, r2 ++#endif ++ mov.l @(28,r14),r1 ++ jsr @r1 ++ nop ++ ++L_ret_d: ++ mov #FFI_TYPE_DOUBLE,r2 ++ cmp/eq r2,r9 ++ bf L_ret_ll ++ ++ mov.l @(24,r14),r1 ++#ifdef __LITTLE_ENDIAN__ ++ fmov.s fr1,@r1 ++ add #4,r1 ++ bra L_epilogue ++ fmov.s fr0,@r1 ++#else ++ fmov.s fr0,@r1 ++ add #4,r1 ++ bra L_epilogue ++ fmov.s fr1,@r1 ++#endif ++ ++L_ret_ll: ++ mov #FFI_TYPE_SINT64,r2 ++ cmp/eq r2,r9 ++ bt/s 1f ++ mov #FFI_TYPE_UINT64,r2 ++ cmp/eq r2,r9 ++ bf L_ret_f ++ ++1: ++ mov.l @(24,r14),r2 ++ mov.l r0,@r2 ++ bra L_epilogue ++ mov.l r1,@(4,r2) ++ ++L_ret_f: ++ mov #FFI_TYPE_FLOAT,r2 ++ cmp/eq r2,r9 ++ bf L_ret_i ++ ++ mov.l @(24,r14),r1 ++ bra L_epilogue ++ fmov.s fr0,@r1 ++ ++L_ret_i: ++ mov #FFI_TYPE_INT,r2 ++ cmp/eq r2,r9 ++ bf L_epilogue ++ ++ mov.l @(24,r14),r1 ++ bra L_epilogue ++ mov.l r0,@r1 ++ ++L_epilogue: ++ # Remove the space we pushed for the args ++ mov r14,r15 ++ ++ lds.l @r15+,pr ++ mov.l @r15+,r14 ++ mov.l @r15+,r12 ++ mov.l @r15+,r10 ++ mov.l @r15+,r9 ++ rts ++ mov.l @r15+,r8 ++#else ++ mov r6,r8 ++ mov r7,r9 ++ ++ sub r6,r15 ++ add #-16,r15 ++ mov #~7,r0 ++ and r0,r15 ++ ++ mov r4,r0 ++ jsr @r0 ++ mov r15,r4 ++ ++ mov r9,r3 ++ shlr8 r9 ++ shlr8 r9 ++ shlr8 r9 ++ ++ mov #FFI_TYPE_STRUCT,r2 ++ cmp/eq r2,r9 ++ bf 1f ++#if STRUCT_VALUE_ADDRESS_WITH_ARG ++ mov.l @r15+,r4 ++ bra 2f ++ mov #5,r2 ++#else ++ mov.l @r15+,r10 ++#endif ++1: ++ mov #4,r2 ++2: ++ ++L_pass: ++ cmp/pl r8 ++ bf L_call_it ++ ++ mov r3,r0 ++ and #3,r0 ++ ++L_pass_d: ++ cmp/eq #FFI_TYPE_DOUBLE,r0 ++ bf L_pass_i ++ ++ mov r15,r0 ++ and #7,r0 ++ tst r0,r0 ++ bt 1f ++ add #4,r15 ++1: ++ mov #8,r0 ++ cmp/hs r0,r2 ++ bt/s 2f ++ shlr2 r3 ++ bsr L_pop_d ++ nop ++2: ++ add #2,r2 ++ bra L_pass ++ add #-8,r8 ++ ++L_pop_d: ++ mov r2,r0 ++ add r0,r0 ++ add r2,r0 ++ add #-12,r0 ++ add r0,r0 ++ braf r0 ++ nop ++ mov.l @r15+,r4 ++ rts ++ mov.l @r15+,r5 ++ mov.l @r15+,r5 ++ rts ++ mov.l @r15+,r6 ++ mov.l @r15+,r6 ++ rts ++ mov.l @r15+,r7 ++ rts ++ mov.l @r15+,r7 ++ ++L_pass_i: ++ mov #8,r0 ++ cmp/hs r0,r2 ++ bt/s 2f ++ shlr2 r3 ++ bsr L_pop_i ++ nop ++2: ++ add #1,r2 ++ bra L_pass ++ add #-4,r8 ++ ++L_pop_i: ++ mov r2,r0 ++ shll2 r0 ++ add #-16,r0 ++ braf r0 ++ nop ++ rts ++ mov.l @r15+,r4 ++ rts ++ mov.l @r15+,r5 ++ rts ++ mov.l @r15+,r6 ++ rts ++ mov.l @r15+,r7 ++ ++L_call_it: ++ # call function ++#if (! STRUCT_VALUE_ADDRESS_WITH_ARG) ++ mov r10, r2 ++#endif ++ mov.l @(28,r14),r1 ++ jsr @r1 ++ nop ++ ++L_ret_d: ++ mov #FFI_TYPE_DOUBLE,r2 ++ cmp/eq r2,r9 ++ bf L_ret_ll ++ ++ mov.l @(24,r14),r2 ++ mov.l r0,@r2 ++ bra L_epilogue ++ mov.l r1,@(4,r2) ++ ++L_ret_ll: ++ mov #FFI_TYPE_SINT64,r2 ++ cmp/eq r2,r9 ++ bt/s 1f ++ mov #FFI_TYPE_UINT64,r2 ++ cmp/eq r2,r9 ++ bf L_ret_i ++ ++1: ++ mov.l @(24,r14),r2 ++ mov.l r0,@r2 ++ bra L_epilogue ++ mov.l r1,@(4,r2) ++ ++L_ret_i: ++ mov #FFI_TYPE_FLOAT,r2 ++ cmp/eq r2,r9 ++ bt 1f ++ mov #FFI_TYPE_INT,r2 ++ cmp/eq r2,r9 ++ bf L_epilogue ++1: ++ mov.l @(24,r14),r1 ++ bra L_epilogue ++ mov.l r0,@r1 ++ ++L_epilogue: ++ # Remove the space we pushed for the args ++ mov r14,r15 ++ ++ lds.l @r15+,pr ++ mov.l @r15+,r14 ++ mov.l @r15+,r12 ++ mov.l @r15+,r10 ++ mov.l @r15+,r9 ++ rts ++ mov.l @r15+,r8 ++#endif ++.LFE1: ++.ffi_call_SYSV_end: ++ .size CNAME(ffi_call_SYSV),.ffi_call_SYSV_end-CNAME(ffi_call_SYSV) ++ ++.globl ffi_closure_helper_SYSV ++ ++ENTRY(ffi_closure_SYSV) ++.LFB2: ++ mov.l r14,@-r15 ++.LCFI7: ++ sts.l pr,@-r15 ++ ++ /* Stack layout: ++ ... ++ 32 bytes (floating register parameters, SH-4 only) ++ 16 bytes (register parameters) ++ 4 bytes (result) ++ 4 bytes (5th arg) ++ <- new stack pointer ++ */ ++.LCFI8: ++#if defined(__SH4__) ++ add #-56,r15 ++#else ++ add #-24,r15 ++#endif ++.LCFI9: ++ mov r15,r14 ++.LCFIA: ++ mov r14,r1 ++ add #24,r1 ++ mov.l r7,@-r1 ++ mov.l r6,@-r1 ++ mov.l r5,@-r1 ++ mov.l r4,@-r1 ++ mov r1,r6 ++ ++#if defined(__SH4__) ++ mov r14,r1 ++ add #56,r1 ++#ifdef __LITTLE_ENDIAN__ ++ fmov.s fr10,@-r1 ++ fmov.s fr11,@-r1 ++ fmov.s fr8,@-r1 ++ fmov.s fr9,@-r1 ++ fmov.s fr6,@-r1 ++ fmov.s fr7,@-r1 ++ fmov.s fr4,@-r1 ++ fmov.s fr5,@-r1 ++#else ++ fmov.s fr11,@-r1 ++ fmov.s fr10,@-r1 ++ fmov.s fr9,@-r1 ++ fmov.s fr8,@-r1 ++ fmov.s fr7,@-r1 ++ fmov.s fr6,@-r1 ++ fmov.s fr5,@-r1 ++ fmov.s fr4,@-r1 ++#endif ++ mov r1,r7 ++#endif ++ ++ mov r14,r1 ++ add #4,r1 ++ mov r1,r5 ++ ++ mov r14,r1 ++#if defined(__SH4__) ++ add #64,r1 ++#else ++ add #32,r1 ++#endif ++ mov.l r1,@r14 ++ ++ mov.l L_helper,r0 ++ jsr @r0 ++ mov r3,r4 ++ ++ shll r0 ++ mov r0,r1 ++ mova L_table,r0 ++ add r1,r0 ++ mov.w @r0,r0 ++ mov r14,r2 ++ braf r0 ++ add #4,r2 ++0: ++ .align 2 ++L_helper: ++ .long ffi_closure_helper_SYSV ++L_table: ++ .short L_case_v - 0b /* FFI_TYPE_VOID */ ++ .short L_case_i - 0b /* FFI_TYPE_INT */ ++#if defined(__SH4__) ++ .short L_case_f - 0b /* FFI_TYPE_FLOAT */ ++ .short L_case_d - 0b /* FFI_TYPE_DOUBLE */ ++ .short L_case_d - 0b /* FFI_TYPE_LONGDOUBLE */ ++#else ++ .short L_case_i - 0b /* FFI_TYPE_FLOAT */ ++ .short L_case_ll - 0b /* FFI_TYPE_DOUBLE */ ++ .short L_case_ll - 0b /* FFI_TYPE_LONGDOUBLE */ ++#endif ++ .short L_case_uq - 0b /* FFI_TYPE_UINT8 */ ++ .short L_case_q - 0b /* FFI_TYPE_SINT8 */ ++ .short L_case_uh - 0b /* FFI_TYPE_UINT16 */ ++ .short L_case_h - 0b /* FFI_TYPE_SINT16 */ ++ .short L_case_i - 0b /* FFI_TYPE_UINT32 */ ++ .short L_case_i - 0b /* FFI_TYPE_SINT32 */ ++ .short L_case_ll - 0b /* FFI_TYPE_UINT64 */ ++ .short L_case_ll - 0b /* FFI_TYPE_SINT64 */ ++ .short L_case_v - 0b /* FFI_TYPE_STRUCT */ ++ .short L_case_i - 0b /* FFI_TYPE_POINTER */ ++ ++#if defined(__SH4__) ++L_case_d: ++#ifdef __LITTLE_ENDIAN__ ++ fmov.s @r2+,fr1 ++ bra L_case_v ++ fmov.s @r2,fr0 ++#else ++ fmov.s @r2+,fr0 ++ bra L_case_v ++ fmov.s @r2,fr1 ++#endif ++ ++L_case_f: ++ bra L_case_v ++ fmov.s @r2,fr0 ++#endif ++ ++L_case_ll: ++ mov.l @r2+,r0 ++ bra L_case_v ++ mov.l @r2,r1 ++ ++L_case_i: ++ bra L_case_v ++ mov.l @r2,r0 ++ ++L_case_q: ++#ifdef __LITTLE_ENDIAN__ ++#else ++ add #3,r2 ++#endif ++ bra L_case_v ++ mov.b @r2,r0 ++ ++L_case_uq: ++#ifdef __LITTLE_ENDIAN__ ++#else ++ add #3,r2 ++#endif ++ mov.b @r2,r0 ++ bra L_case_v ++ extu.b r0,r0 ++ ++L_case_h: ++#ifdef __LITTLE_ENDIAN__ ++#else ++ add #2,r2 ++#endif ++ bra L_case_v ++ mov.w @r2,r0 ++ ++L_case_uh: ++#ifdef __LITTLE_ENDIAN__ ++#else ++ add #2,r2 ++#endif ++ mov.w @r2,r0 ++ extu.w r0,r0 ++ /* fall through */ ++ ++L_case_v: ++#if defined(__SH4__) ++ add #56,r15 ++#else ++ add #24,r15 ++#endif ++ lds.l @r15+,pr ++ rts ++ mov.l @r15+,r14 ++.LFE2: ++.ffi_closure_SYSV_end: ++ .size CNAME(ffi_closure_SYSV),.ffi_closure_SYSV_end-CNAME(ffi_closure_SYSV) ++ ++ .section ".eh_frame","aw",@progbits ++__FRAME_BEGIN__: ++ .4byte .LECIE1-.LSCIE1 /* Length of Common Information Entry */ ++.LSCIE1: ++ .4byte 0x0 /* CIE Identifier Tag */ ++ .byte 0x1 /* CIE Version */ ++ .byte 0x0 /* CIE Augmentation */ ++ .byte 0x1 /* uleb128 0x1; CIE Code Alignment Factor */ ++ .byte 0x7c /* sleb128 -4; CIE Data Alignment Factor */ ++ .byte 0x11 /* CIE RA Column */ ++ .byte 0xc /* DW_CFA_def_cfa */ ++ .byte 0xf /* uleb128 0xf */ ++ .byte 0x0 /* uleb128 0x0 */ ++ .align 2 ++.LECIE1: ++.LSFDE1: ++ .4byte .LEFDE1-.LASFDE1 /* FDE Length */ ++.LASFDE1: ++ .4byte .LASFDE1-__FRAME_BEGIN__ /* FDE CIE offset */ ++ .4byte .LFB1 /* FDE initial location */ ++ .4byte .LFE1-.LFB1 /* FDE address range */ ++ .byte 0x4 /* DW_CFA_advance_loc4 */ ++ .4byte .LCFI0-.LFB1 ++ .byte 0xe /* DW_CFA_def_cfa_offset */ ++ .byte 0x4 /* uleb128 0x4 */ ++ .byte 0x4 /* DW_CFA_advance_loc4 */ ++ .4byte .LCFI1-.LCFI0 ++ .byte 0xe /* DW_CFA_def_cfa_offset */ ++ .byte 0x8 /* uleb128 0x4 */ ++ .byte 0x4 /* DW_CFA_advance_loc4 */ ++ .4byte .LCFI2-.LCFI1 ++ .byte 0xe /* DW_CFA_def_cfa_offset */ ++ .byte 0xc /* uleb128 0x4 */ ++ .byte 0x4 /* DW_CFA_advance_loc4 */ ++ .4byte .LCFI3-.LCFI2 ++ .byte 0xe /* DW_CFA_def_cfa_offset */ ++ .byte 0x10 /* uleb128 0x4 */ ++ .byte 0x4 /* DW_CFA_advance_loc4 */ ++ .4byte .LCFI4-.LCFI3 ++ .byte 0xe /* DW_CFA_def_cfa_offset */ ++ .byte 0x14 /* uleb128 0x4 */ ++ .byte 0x4 /* DW_CFA_advance_loc4 */ ++ .4byte .LCFI5-.LCFI4 ++ .byte 0xe /* DW_CFA_def_cfa_offset */ ++ .byte 0x18 /* uleb128 0x4 */ ++ .byte 0x91 /* DW_CFA_offset, column 0x11 */ ++ .byte 0x6 /* uleb128 0x6 */ ++ .byte 0x8e /* DW_CFA_offset, column 0xe */ ++ .byte 0x5 /* uleb128 0x5 */ ++ .byte 0x8c /* DW_CFA_offset, column 0xc */ ++ .byte 0x4 /* uleb128 0x4 */ ++ .byte 0x8a /* DW_CFA_offset, column 0xa */ ++ .byte 0x3 /* uleb128 0x3 */ ++ .byte 0x89 /* DW_CFA_offset, column 0x9 */ ++ .byte 0x2 /* uleb128 0x2 */ ++ .byte 0x88 /* DW_CFA_offset, column 0x8 */ ++ .byte 0x1 /* uleb128 0x1 */ ++ .byte 0x4 /* DW_CFA_advance_loc4 */ ++ .4byte .LCFI6-.LCFI5 ++ .byte 0xd /* DW_CFA_def_cfa_register */ ++ .byte 0xe /* uleb128 0xe */ ++ .align 2 ++.LEFDE1: ++ ++.LSFDE3: ++ .4byte .LEFDE3-.LASFDE3 /* FDE Length */ ++.LASFDE3: ++ .4byte .LASFDE3-__FRAME_BEGIN__ /* FDE CIE offset */ ++ .4byte .LFB2 /* FDE initial location */ ++ .4byte .LFE2-.LFB2 /* FDE address range */ ++ .byte 0x4 /* DW_CFA_advance_loc4 */ ++ .4byte .LCFI7-.LFB2 ++ .byte 0xe /* DW_CFA_def_cfa_offset */ ++ .byte 0x4 /* uleb128 0x4 */ ++ .byte 0x4 /* DW_CFA_advance_loc4 */ ++ .4byte .LCFI8-.LCFI7 ++ .byte 0xe /* DW_CFA_def_cfa_offset */ ++ .byte 0x8 /* uleb128 0x8 */ ++ .byte 0x4 /* DW_CFA_advance_loc4 */ ++ .4byte .LCFI9-.LCFI8 ++ .byte 0xe /* DW_CFA_def_cfa_offset */ ++#if defined(__SH4__) ++ .byte 8+56 /* uleb128 8+56 */ ++#else ++ .byte 8+24 /* uleb128 8+24 */ ++#endif ++ .byte 0x91 /* DW_CFA_offset, column 0x11 */ ++ .byte 0x2 ++ .byte 0x8e /* DW_CFA_offset, column 0xe */ ++ .byte 0x1 ++ .byte 0x4 /* DW_CFA_advance_loc4 */ ++ .4byte .LCFIA-.LCFI9 ++ .byte 0xd /* DW_CFA_def_cfa_register */ ++ .byte 0xe /* uleb128 0xe */ ++ .align 2 ++.LEFDE3: +diff -ruN --exclude=CVS gcc-3.2.2.orig/libffi/src/sparc/ffi.c gcc/libffi/src/sparc/ffi.c +--- gcc-3.2.2.orig/libffi/src/sparc/ffi.c Sat Mar 3 07:21:23 2001 ++++ gcc/libffi/src/sparc/ffi.c Sat Jan 4 08:08:56 2003 +@@ -1,5 +1,5 @@ + /* ----------------------------------------------------------------------- +- ffi.c - Copyright (c) 1996 Cygnus Solutions ++ ffi.c - Copyright (c) 1996, 2003 Cygnus Solutions + + Sparc Foreign Function Interface + +@@ -28,20 +28,22 @@ + + #include + ++#ifdef SPARC64 ++extern void ffi_closure_v9(void); ++#else ++extern void ffi_closure_v8(void); ++#endif ++ + /* ffi_prep_args is called by the assembly routine once stack space + has been allocated for the function's arguments */ + + void ffi_prep_args_v8(char *stack, extended_cif *ecif) + { + int i; +- int tmp; +- int avn; + void **p_argv; + char *argp; + ffi_type **p_arg; + +- tmp = 0; +- + /* Skip 16 words for the window save area */ + argp = stack + 16*sizeof(int); + +@@ -66,18 +68,12 @@ + ((int*)argp)[5] = 0; + #endif + +- avn = ecif->cif->nargs; + p_argv = ecif->avalue; + +- for (i = ecif->cif->nargs, p_arg = ecif->cif->arg_types; +- i && avn; +- i--, p_arg++) ++ for (i = ecif->cif->nargs, p_arg = ecif->cif->arg_types; i; i--, p_arg++) + { + size_t z; + +- if (avn) +- { +- avn--; + if ((*p_arg)->type == FFI_TYPE_STRUCT + #if FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE + || (*p_arg)->type == FFI_TYPE_LONGDOUBLE +@@ -122,7 +118,6 @@ + } + p_argv++; + argp += z; +- } + } + + return; +@@ -420,3 +415,101 @@ + } + + } ++ ++ffi_status ++ffi_prep_closure (ffi_closure* closure, ++ ffi_cif* cif, ++ void (*fun)(ffi_cif*, void*, void**, void*), ++ void *user_data) ++{ ++ unsigned int *tramp = (unsigned int *) &closure->tramp[0]; ++ unsigned long fn; ++ unsigned long ctx = (unsigned long) closure; ++ ++#ifdef SPARC64 ++ /* Trampoline address is equal to the closure address. We take advantage ++ of that to reduce the trampoline size by 8 bytes. */ ++ FFI_ASSERT (cif->abi == FFI_V9); ++ fn = (unsigned long) ffi_closure_v9; ++ tramp[0] = 0x83414000; /* rd %pc, %g1 */ ++ tramp[1] = 0xca586010; /* ldx [%g1+16], %g5 */ ++ tramp[2] = 0x81c14000; /* jmp %g5 */ ++ tramp[3] = 0x01000000; /* nop */ ++ *((unsigned long *) &tramp[4]) = fn; ++#else ++ FFI_ASSERT (cif->abi == FFI_V8); ++ fn = (unsigned long) ffi_closure_v8; ++ tramp[0] = 0x03000000 | fn >> 10; /* sethi %hi(fn), %g1 */ ++ tramp[1] = 0x05000000 | ctx >> 10; /* sethi %hi(ctx), %g2 */ ++ tramp[2] = 0x81c06000 | (fn & 0x3ff); /* jmp %g1+%lo(fn) */ ++ tramp[3] = 0x8410a000 | (ctx & 0x3ff);/* or %g2, %lo(ctx) */ ++#endif ++ ++ closure->cif = cif; ++ closure->fun = fun; ++ closure->user_data = user_data; ++ ++ /* Flush the Icache. FIXME: alignment isn't certain, assume 8 bytes */ ++#ifdef SPARC64 ++ asm volatile ("flush %0" : : "r" (closure) : "memory"); ++ asm volatile ("flush %0" : : "r" (((char *) closure) + 8) : "memory"); ++#else ++ asm volatile ("iflush %0" : : "r" (closure) : "memory"); ++ asm volatile ("iflush %0" : : "r" (((char *) closure) + 8) : "memory"); ++#endif ++ ++ return FFI_OK; ++} ++ ++int ++ffi_closure_sparc_inner(ffi_closure *closure, ++ void *rvalue, unsigned long *gpr, double *fpr) ++{ ++ ffi_cif *cif; ++ void **avalue; ++ ffi_type **arg_types; ++ int i, avn, argn; ++ ++ cif = closure->cif; ++ avalue = alloca(cif->nargs * sizeof(void *)); ++ ++ argn = 0; ++ ++ /* Copy the caller's structure return address to that the closure ++ returns the data directly to the caller. */ ++ if (cif->flags == FFI_TYPE_STRUCT) ++ { ++ rvalue = (void *) gpr[0]; ++ argn = 1; ++ } ++ ++ i = 0; ++ avn = cif->nargs; ++ arg_types = cif->arg_types; ++ ++ /* Grab the addresses of the arguments from the stack frame. */ ++ while (i < avn) ++ { ++ /* Assume big-endian. FIXME */ ++ argn += ALIGN(arg_types[i]->size, SIZEOF_ARG) / SIZEOF_ARG; ++ ++#ifdef SPARC64 ++ if (i < 6 && (arg_types[i]->type == FFI_TYPE_FLOAT ++ || arg_types[i]->type == FFI_TYPE_DOUBLE ++#if FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE ++ || arg_types[i]->type == FFI_TYPE_LONGDOUBLE ++#endif ++ )) ++ avalue[i] = ((char *) &fpr[argn]) - arg_types[i]->size; ++ else ++#endif ++ avalue[i] = ((char *) &gpr[argn]) - arg_types[i]->size; ++ i++; ++ } ++ ++ /* Invoke the closure. */ ++ (closure->fun) (cif, rvalue, avalue, closure->user_data); ++ ++ /* Tell ffi_closure_sparc how to perform return type promotions. */ ++ return cif->rtype->type; ++} +diff -ruN --exclude=CVS gcc-3.2.2.orig/libffi/src/sparc/v8.S gcc/libffi/src/sparc/v8.S +--- gcc-3.2.2.orig/libffi/src/sparc/v8.S Mon Apr 29 05:12:04 2002 ++++ gcc/libffi/src/sparc/v8.S Sat Jan 4 08:08:56 2003 +@@ -1,5 +1,5 @@ + /* ----------------------------------------------------------------------- +- v8.S - Copyright (c) 1996, 1997 Cygnus Solutions ++ v8.S - Copyright (c) 1996, 1997, 2003 Cygnus Solutions + + Sparc Foreign Function Interface + +@@ -94,6 +94,72 @@ + .ffi_call_V8_end: + .size ffi_call_V8,.ffi_call_V8_end-ffi_call_V8 + ++ ++#define STACKFRAME 104 /* 16*4 register window + ++ 1*4 struct return + ++ 6*4 args backing store + ++ 3*4 locals */ ++ ++/* ffi_closure_v8(...) ++ ++ Receives the closure argument in %g2. */ ++ ++ .text ++ .align 8 ++ .globl ffi_closure_v8 ++ ++ffi_closure_v8: ++ .register %g2, #scratch ++.LLFB2: ++ save %sp, -STACKFRAME, %sp ++.LLCFI1: ++ ++ ! Store all of the potential argument registers in va_list format. ++ st %i0, [%fp+68+0] ++ st %i1, [%fp+68+4] ++ st %i2, [%fp+68+8] ++ st %i3, [%fp+68+12] ++ st %i4, [%fp+68+16] ++ st %i5, [%fp+68+20] ++ ++ ! Call ffi_closure_sparc_inner to do the bulk of the work. ++ mov %g2, %o0 ++ add %fp, -8, %o1 ++ add %fp, 68, %o2 ++ call ffi_closure_sparc_inner ++ mov 0, %o3 ++ ++ ! Load up the return value in the proper type. ++ cmp %o0, FFI_TYPE_VOID ++ be done1 ++ ++ cmp %o0, FFI_TYPE_FLOAT ++ be,a done1 ++ ld [%fp-8], %f0 ++ ++ cmp %o0, FFI_TYPE_DOUBLE ++ be,a done1 ++ ldd [%fp-8], %f0 ++ ++ cmp %o0, FFI_TYPE_SINT64 ++ be,a integer ++ ld [%fp-4], %i1 ++ ++ cmp %o0, FFI_TYPE_UINT64 ++ be,a integer ++ ld [%fp-4], %i1 ++ ++integer: ++ ld [%fp-8], %i0 ++ ++done1: ++ ret ++ restore ++.LLFE2: ++ ++.ffi_closure_v8_end: ++ .size ffi_closure_v8,.ffi_closure_v8_end-ffi_closure_v8 ++ + #ifdef SPARC64 + #define WS 8 + #define nword xword +@@ -148,3 +214,26 @@ + .byte 0x1f ! uleb128 0x1f + .align WS + .LLEFDE1: ++.LLSFDE2: ++ .uaword .LLEFDE2-.LLASFDE2 ! FDE Length ++.LLASFDE2: ++ .uaword .LLASFDE2-.LLframe1 ! FDE CIE offset ++#ifdef HAVE_AS_SPARC_UA_PCREL ++ .uaword %r_disp32(.LLFB2) ++ .uaword .LLFE2-.LLFB2 ! FDE address range ++#else ++ .align WS ++ .nword .LLFB2 ++ .uanword .LLFE2-.LLFB2 ! FDE address range ++#endif ++ .byte 0x0 ! uleb128 0x0; Augmentation size ++ .byte 0x4 ! DW_CFA_advance_loc4 ++ .uaword .LLCFI1-.LLFB2 ++ .byte 0xd ! DW_CFA_def_cfa_register ++ .byte 0x1e ! uleb128 0x1e ++ .byte 0x2d ! DW_CFA_GNU_window_save ++ .byte 0x9 ! DW_CFA_register ++ .byte 0xf ! uleb128 0xf ++ .byte 0x1f ! uleb128 0x1f ++ .align WS ++.LLEFDE2: +diff -ruN --exclude=CVS gcc-3.2.2.orig/libffi/src/sparc/v9.S gcc/libffi/src/sparc/v9.S +--- gcc-3.2.2.orig/libffi/src/sparc/v9.S Mon Apr 29 05:12:04 2002 ++++ gcc/libffi/src/sparc/v9.S Sat Jan 4 08:08:56 2003 +@@ -1,5 +1,5 @@ + /* ----------------------------------------------------------------------- +- v9.S - Copyright (c) 2000 Cygnus Solutions ++ v9.S - Copyright (c) 2000, 2003 Cygnus Solutions + + Sparc 64bit Foreign Function Interface + +@@ -99,7 +99,7 @@ + cmp %i3, FFI_TYPE_STRUCT + be,pn %icc, dostruct + +- cmp %i3, FFI_TYPE_LONGDOUBLE ++ cmp %i3, FFI_TYPE_LONGDOUBLE + bne,pt %icc, done + nop + std %f0, [%i4+0] +@@ -125,6 +125,88 @@ + .ffi_call_V9_end: + .size ffi_call_V9,.ffi_call_V9_end-ffi_call_V9 + ++ ++#define STACKFRAME 240 /* 16*8 register window + ++ 6*8 args backing store + ++ 8*8 locals */ ++#define FP %fp+STACK_BIAS ++ ++/* ffi_closure_v9(...) ++ ++ Receives the closure argument in %g1. */ ++ ++ .text ++ .align 8 ++ .globl ffi_closure_v9 ++ ++ffi_closure_v9: ++.LLFB2: ++ save %sp, -STACKFRAME, %sp ++.LLCFI1: ++ ++ ! Store all of the potential argument registers in va_list format. ++ stx %i0, [FP+128+0] ++ stx %i1, [FP+128+8] ++ stx %i2, [FP+128+16] ++ stx %i3, [FP+128+24] ++ stx %i4, [FP+128+32] ++ stx %i5, [FP+128+40] ++ ++ ! Store possible floating point argument registers too. ++ std %f0, [FP-48] ++ std %f2, [FP-40] ++ std %f4, [FP-32] ++ std %f6, [FP-24] ++ std %f8, [FP-16] ++ std %f10, [FP-8] ++ ++ ! Call ffi_closure_sparc_inner to do the bulk of the work. ++ mov %g1, %o0 ++ add %fp, STACK_BIAS-64, %o1 ++ add %fp, STACK_BIAS+128, %o2 ++ call ffi_closure_sparc_inner ++ add %fp, STACK_BIAS-48, %o3 ++ ++ ! Load up the return value in the proper type. ++ cmp %o0, FFI_TYPE_VOID ++ be,pn %icc, done1 ++ ++ cmp %o0, FFI_TYPE_FLOAT ++ be,a,pn %icc, done1 ++ ld [FP-64], %f0 ++ ++ cmp %o0, FFI_TYPE_DOUBLE ++ be,a,pn %icc, done1 ++ ldd [FP-64], %f0 ++ ++ cmp %o0, FFI_TYPE_LONGDOUBLE ++ be,a,pn %icc, longdouble1 ++ ldd [FP-64], %f0 ++ ++ cmp %o0, FFI_TYPE_STRUCT ++ be,pn %icc, struct1 ++ ++ ! FFI_TYPE_UINT64 | FFI_TYPE_SINT64 | FFI_TYPE_POINTER ++ ldx [FP-64], %i0 ++ ++done1: ++ ret ++ restore ++ ++struct1: ++ ldx [FP-56], %i2 ++ ret ++ restore ++ ++longdouble1: ++ ldd [FP-56], %f2 ++ ret ++ restore ++.LLFE2: ++ ++.ffi_closure_v9_end: ++ .size ffi_closure_v9,.ffi_closure_v9_end-ffi_closure_v9 ++ + .section ".eh_frame",#alloc,#write + .LLframe1: + .uaword .LLECIE1-.LLSCIE1 ! Length of Common Information Entry +@@ -169,5 +251,27 @@ + .byte 0x1f ! uleb128 0x1f + .align 8 + .LLEFDE1: +- ++.LLSFDE2: ++ .uaword .LLEFDE2-.LLASFDE2 ! FDE Length ++.LLASFDE2: ++ .uaword .LLASFDE2-.LLframe1 ! FDE CIE offset ++#ifdef HAVE_AS_SPARC_UA_PCREL ++ .uaword %r_disp32(.LLFB2) ++ .uaword .LLFE2-.LLFB2 ! FDE address range ++#else ++ .align 8 ++ .xword .LLFB2 ++ .uaxword .LLFE2-.LLFB2 ! FDE address range ++#endif ++ .byte 0x0 ! uleb128 0x0; Augmentation size ++ .byte 0x4 ! DW_CFA_advance_loc4 ++ .uaword .LLCFI1-.LLFB2 ++ .byte 0xd ! DW_CFA_def_cfa_register ++ .byte 0x1e ! uleb128 0x1e ++ .byte 0x2d ! DW_CFA_GNU_window_save ++ .byte 0x9 ! DW_CFA_register ++ .byte 0xf ! uleb128 0xf ++ .byte 0x1f ! uleb128 0x1f ++ .align 8 ++.LLEFDE2: + #endif +diff -ruN --exclude=CVS gcc-3.2.2.orig/libffi/src/types.c gcc/libffi/src/types.c +--- gcc-3.2.2.orig/libffi/src/types.c Tue Mar 27 11:39:16 2001 ++++ gcc/libffi/src/types.c Wed Nov 27 07:24:05 2002 +@@ -42,7 +42,8 @@ + FFI_INTEGRAL_TYPEDEF(sint32, 4, 4, FFI_TYPE_SINT32); + FFI_INTEGRAL_TYPEDEF(float, 4, 4, FFI_TYPE_FLOAT); + +-#if defined ALPHA || defined SPARC64 ++#if defined ALPHA || defined SPARC64 || defined X86_64 || defined S390X \ ++ || defined IA64 + + FFI_INTEGRAL_TYPEDEF(pointer, 8, 8, FFI_TYPE_POINTER); + +@@ -52,22 +53,12 @@ + + #endif + +-#ifdef X86 ++#if defined X86 || defined X86_WIN32 || defined ARM || defined M68K + + FFI_INTEGRAL_TYPEDEF(uint64, 8, 4, FFI_TYPE_UINT64); + FFI_INTEGRAL_TYPEDEF(sint64, 8, 4, FFI_TYPE_SINT64); + +-#elif defined X86_WIN32 +- +-FFI_INTEGRAL_TYPEDEF(uint64, 8, 4, FFI_TYPE_UINT64); +-FFI_INTEGRAL_TYPEDEF(sint64, 8, 4, FFI_TYPE_SINT64); +- +-#elif defined ARM +- +-FFI_INTEGRAL_TYPEDEF(uint64, 8, 4, FFI_TYPE_UINT64); +-FFI_INTEGRAL_TYPEDEF(sint64, 8, 4, FFI_TYPE_SINT64); +- +-#elif defined M68K ++#elif defined SH + + FFI_INTEGRAL_TYPEDEF(uint64, 8, 4, FFI_TYPE_UINT64); + FFI_INTEGRAL_TYPEDEF(sint64, 8, 4, FFI_TYPE_SINT64); +@@ -80,12 +71,7 @@ + #endif + + +-#ifdef X86 +- +-FFI_INTEGRAL_TYPEDEF(double, 8, 4, FFI_TYPE_DOUBLE); +-FFI_INTEGRAL_TYPEDEF(longdouble, 12, 4, FFI_TYPE_LONGDOUBLE); +- +-#elif defined X86_WIN32 ++#if defined X86 || defined X86_WIN32 || defined M68K + + FFI_INTEGRAL_TYPEDEF(double, 8, 4, FFI_TYPE_DOUBLE); + FFI_INTEGRAL_TYPEDEF(longdouble, 12, 4, FFI_TYPE_LONGDOUBLE); +@@ -95,25 +81,25 @@ + FFI_INTEGRAL_TYPEDEF(double, 8, 4, FFI_TYPE_DOUBLE); + FFI_INTEGRAL_TYPEDEF(longdouble, 8, 4, FFI_TYPE_LONGDOUBLE); + +-#elif defined M68K ++#elif defined SH + + FFI_INTEGRAL_TYPEDEF(double, 8, 4, FFI_TYPE_DOUBLE); +-FFI_INTEGRAL_TYPEDEF(longdouble, 12, 4, FFI_TYPE_LONGDOUBLE); ++FFI_INTEGRAL_TYPEDEF(longdouble, 8, 4, FFI_TYPE_LONGDOUBLE); + + #elif defined SPARC + + FFI_INTEGRAL_TYPEDEF(double, 8, 8, FFI_TYPE_DOUBLE); +- + #ifdef SPARC64 +- + FFI_INTEGRAL_TYPEDEF(longdouble, 16, 16, FFI_TYPE_LONGDOUBLE); +- + #else +- + FFI_INTEGRAL_TYPEDEF(longdouble, 16, 8, FFI_TYPE_LONGDOUBLE); +- + #endif + ++#elif defined X86_64 ++ ++FFI_INTEGRAL_TYPEDEF(double, 8, 8, FFI_TYPE_DOUBLE); ++FFI_INTEGRAL_TYPEDEF(longdouble, 16, 16, FFI_TYPE_LONGDOUBLE); ++ + #else + + FFI_INTEGRAL_TYPEDEF(double, 8, 8, FFI_TYPE_DOUBLE); +diff -ruN --exclude=CVS gcc-3.2.2.orig/libffi/src/x86/ffi.c gcc/libffi/src/x86/ffi.c +--- gcc-3.2.2.orig/libffi/src/x86/ffi.c Tue May 28 18:22:08 2002 ++++ gcc/libffi/src/x86/ffi.c Fri Dec 6 10:16:45 2002 +@@ -1,5 +1,8 @@ + /* ----------------------------------------------------------------------- +- ffi.c - Copyright (c) 1996, 1998, 1999 Cygnus Solutions ++ ffi.c - Copyright (c) 1996, 1998, 1999, 2001 Red Hat, Inc. ++ Copyright (c) 2002 Ranjit Mathew ++ Copyright (c) 2002 Bo Thorsen ++ Copyright (c) 2002 Roger Sayle + + x86 Foreign Function Interface + +@@ -23,6 +26,8 @@ + OTHER DEALINGS IN THE SOFTWARE. + ----------------------------------------------------------------------- */ + ++#ifndef __x86_64__ ++ + #include + #include + +@@ -36,12 +41,10 @@ + /*@=exportheader@*/ + { + register unsigned int i; +- register int tmp; + register void **p_argv; + register char *argp; + register ffi_type **p_arg; + +- tmp = 0; + argp = stack; + + if (ecif->cif->rtype->type == FFI_TYPE_STRUCT) +@@ -148,6 +151,18 @@ + /*@=declundef@*/ + /*@=exportheader@*/ + ++#ifdef X86_WIN32 ++/*@-declundef@*/ ++/*@-exportheader@*/ ++extern void ffi_call_STDCALL(void (*)(char *, extended_cif *), ++ /*@out@*/ extended_cif *, ++ unsigned, unsigned, ++ /*@out@*/ unsigned *, ++ void (*fn)()); ++/*@=declundef@*/ ++/*@=exportheader@*/ ++#endif /* X86_WIN32 */ ++ + void ffi_call(/*@dependent@*/ ffi_cif *cif, + void (*fn)(), + /*@out@*/ void *rvalue, +@@ -180,6 +195,14 @@ + cif->flags, ecif.rvalue, fn); + /*@=usedef@*/ + break; ++#ifdef X86_WIN32 ++ case FFI_STDCALL: ++ /*@-usedef@*/ ++ ffi_call_STDCALL(ffi_prep_args, &ecif, cif->bytes, ++ cif->flags, ecif.rvalue, fn); ++ /*@=usedef@*/ ++ break; ++#endif /* X86_WIN32 */ + default: + FFI_ASSERT(0); + break; +@@ -266,12 +289,10 @@ + /*@=exportheader@*/ + { + register unsigned int i; +- register int tmp; + register void **p_argv; + register char *argp; + register ffi_type **p_arg; + +- tmp = 0; + argp = stack; + + if ( cif->rtype->type == FFI_TYPE_STRUCT ) { +@@ -281,13 +302,14 @@ + + p_argv = avalue; + +- for (i = cif->nargs, p_arg = cif->arg_types; i != 0; i--, p_arg++) ++ for (i = cif->nargs, p_arg = cif->arg_types; (i != 0); i--, p_arg++) + { + size_t z; + + /* Align if necessary */ +- if (((*p_arg)->alignment - 1) & (unsigned) argp) ++ if (((*p_arg)->alignment - 1) & (unsigned) argp) { + argp = (char *) ALIGN(argp, (*p_arg)->alignment); ++ } + + z = (*p_arg)->size; + +@@ -298,7 +320,7 @@ + p_argv++; + argp += z; + } +- ++ + return; + } + +@@ -449,6 +471,15 @@ + /*@out@*/ unsigned *, + void (*fn)()); + ++#ifdef X86_WIN32 ++extern void ++ffi_call_STDCALL(void (*)(char *, extended_cif *), ++ /*@out@*/ extended_cif *, ++ unsigned, unsigned, ++ /*@out@*/ unsigned *, ++ void (*fn)()); ++#endif /* X86_WIN32 */ ++ + void + ffi_raw_call(/*@dependent@*/ ffi_cif *cif, + void (*fn)(), +@@ -483,6 +514,14 @@ + cif->flags, ecif.rvalue, fn); + /*@=usedef@*/ + break; ++#ifdef X86_WIN32 ++ case FFI_STDCALL: ++ /*@-usedef@*/ ++ ffi_call_STDCALL(ffi_prep_args_raw, &ecif, cif->bytes, ++ cif->flags, ecif.rvalue, fn); ++ /*@=usedef@*/ ++ break; ++#endif /* X86_WIN32 */ + default: + FFI_ASSERT(0); + break; +@@ -490,3 +529,5 @@ + } + + #endif ++ ++#endif /* __x86_64__ */ +diff -ruN --exclude=CVS gcc-3.2.2.orig/libffi/src/x86/ffi64.c gcc/libffi/src/x86/ffi64.c +--- gcc-3.2.2.orig/libffi/src/x86/ffi64.c Thu Jan 1 09:00:00 1970 ++++ gcc/libffi/src/x86/ffi64.c Wed Jan 29 00:54:28 2003 +@@ -0,0 +1,706 @@ ++/* ----------------------------------------------------------------------- ++ ffi.c - Copyright (c) 2002 Bo Thorsen ++ ++ x86-64 Foreign Function Interface ++ ++ Permission is hereby granted, free of charge, to any person obtaining ++ a copy of this software and associated documentation files (the ++ ``Software''), to deal in the Software without restriction, including ++ without limitation the rights to use, copy, modify, merge, publish, ++ distribute, sublicense, and/or sell copies of the Software, and to ++ permit persons to whom the Software is furnished to do so, subject to ++ the following conditions: ++ ++ The above copyright notice and this permission notice shall be included ++ in all copies or substantial portions of the Software. ++ ++ THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS ++ OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF ++ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. ++ IN NO EVENT SHALL CYGNUS SOLUTIONS BE LIABLE FOR ANY CLAIM, DAMAGES OR ++ OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ++ ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR ++ OTHER DEALINGS IN THE SOFTWARE. ++ ----------------------------------------------------------------------- */ ++ ++#include ++#include ++ ++#include ++#include ++ ++/* ffi_prep_args is called by the assembly routine once stack space ++ has been allocated for the function's arguments */ ++ ++#ifdef __x86_64__ ++ ++#define MAX_GPR_REGS 6 ++#define MAX_SSE_REGS 8 ++typedef struct ++{ ++ /* Registers for argument passing. */ ++ long gpr[MAX_GPR_REGS]; ++ __int128_t sse[MAX_SSE_REGS]; ++ ++ /* Stack space for arguments. */ ++ char argspace[0]; ++} stackLayout; ++ ++/* All reference to register classes here is identical to the code in ++ gcc/config/i386/i386.c. Do *not* change one without the other. */ ++ ++/* Register class used for passing given 64bit part of the argument. ++ These represent classes as documented by the PS ABI, with the exception ++ of SSESF, SSEDF classes, that are basically SSE class, just gcc will ++ use SF or DFmode move instead of DImode to avoid reformating penalties. ++ ++ Similary we play games with INTEGERSI_CLASS to use cheaper SImode moves ++ whenever possible (upper half does contain padding). ++ */ ++enum x86_64_reg_class ++ { ++ X86_64_NO_CLASS, ++ X86_64_INTEGER_CLASS, ++ X86_64_INTEGERSI_CLASS, ++ X86_64_SSE_CLASS, ++ X86_64_SSESF_CLASS, ++ X86_64_SSEDF_CLASS, ++ X86_64_SSEUP_CLASS, ++ X86_64_X87_CLASS, ++ X86_64_X87UP_CLASS, ++ X86_64_MEMORY_CLASS ++ }; ++ ++#define MAX_CLASSES 4 ++ ++/* x86-64 register passing implementation. See x86-64 ABI for details. Goal ++ of this code is to classify each 8bytes of incoming argument by the register ++ class and assign registers accordingly. */ ++ ++/* Return the union class of CLASS1 and CLASS2. ++ See the x86-64 PS ABI for details. */ ++ ++static enum x86_64_reg_class ++merge_classes (enum x86_64_reg_class class1, enum x86_64_reg_class class2) ++{ ++ /* Rule #1: If both classes are equal, this is the resulting class. */ ++ if (class1 == class2) ++ return class1; ++ ++ /* Rule #2: If one of the classes is NO_CLASS, the resulting class is ++ the other class. */ ++ if (class1 == X86_64_NO_CLASS) ++ return class2; ++ if (class2 == X86_64_NO_CLASS) ++ return class1; ++ ++ /* Rule #3: If one of the classes is MEMORY, the result is MEMORY. */ ++ if (class1 == X86_64_MEMORY_CLASS || class2 == X86_64_MEMORY_CLASS) ++ return X86_64_MEMORY_CLASS; ++ ++ /* Rule #4: If one of the classes is INTEGER, the result is INTEGER. */ ++ if ((class1 == X86_64_INTEGERSI_CLASS && class2 == X86_64_SSESF_CLASS) ++ || (class2 == X86_64_INTEGERSI_CLASS && class1 == X86_64_SSESF_CLASS)) ++ return X86_64_INTEGERSI_CLASS; ++ if (class1 == X86_64_INTEGER_CLASS || class1 == X86_64_INTEGERSI_CLASS ++ || class2 == X86_64_INTEGER_CLASS || class2 == X86_64_INTEGERSI_CLASS) ++ return X86_64_INTEGER_CLASS; ++ ++ /* Rule #5: If one of the classes is X87 or X87UP class, MEMORY is used. */ ++ if (class1 == X86_64_X87_CLASS || class1 == X86_64_X87UP_CLASS ++ || class2 == X86_64_X87_CLASS || class2 == X86_64_X87UP_CLASS) ++ return X86_64_MEMORY_CLASS; ++ ++ /* Rule #6: Otherwise class SSE is used. */ ++ return X86_64_SSE_CLASS; ++} ++ ++/* Classify the argument of type TYPE and mode MODE. ++ CLASSES will be filled by the register class used to pass each word ++ of the operand. The number of words is returned. In case the parameter ++ should be passed in memory, 0 is returned. As a special case for zero ++ sized containers, classes[0] will be NO_CLASS and 1 is returned. ++ ++ See the x86-64 PS ABI for details. ++*/ ++static int ++classify_argument (ffi_type *type, enum x86_64_reg_class classes[], ++ int *byte_offset) ++{ ++ /* First, align to the right place. */ ++ *byte_offset = ALIGN(*byte_offset, type->alignment); ++ ++ switch (type->type) ++ { ++ case FFI_TYPE_UINT8: ++ case FFI_TYPE_SINT8: ++ case FFI_TYPE_UINT16: ++ case FFI_TYPE_SINT16: ++ case FFI_TYPE_UINT32: ++ case FFI_TYPE_SINT32: ++ case FFI_TYPE_UINT64: ++ case FFI_TYPE_SINT64: ++ case FFI_TYPE_POINTER: ++ if (((*byte_offset) % 8 + type->size) <= 4) ++ classes[0] = X86_64_INTEGERSI_CLASS; ++ else ++ classes[0] = X86_64_INTEGER_CLASS; ++ return 1; ++ case FFI_TYPE_FLOAT: ++ if (((*byte_offset) % 8) == 0) ++ classes[0] = X86_64_SSESF_CLASS; ++ else ++ classes[0] = X86_64_SSE_CLASS; ++ return 1; ++ case FFI_TYPE_DOUBLE: ++ classes[0] = X86_64_SSEDF_CLASS; ++ return 1; ++ case FFI_TYPE_LONGDOUBLE: ++ classes[0] = X86_64_X87_CLASS; ++ classes[1] = X86_64_X87UP_CLASS; ++ return 2; ++ case FFI_TYPE_STRUCT: ++ { ++ const int UNITS_PER_WORD = 8; ++ int words = (type->size + UNITS_PER_WORD - 1) / UNITS_PER_WORD; ++ ffi_type **ptr; ++ int i; ++ enum x86_64_reg_class subclasses[MAX_CLASSES]; ++ ++ /* If the struct is larger than 16 bytes, pass it on the stack. */ ++ if (type->size > 16) ++ return 0; ++ ++ for (i = 0; i < words; i++) ++ classes[i] = X86_64_NO_CLASS; ++ ++ /* Merge the fields of structure. */ ++ for (ptr=type->elements; (*ptr)!=NULL; ptr++) ++ { ++ int num; ++ ++ num = classify_argument (*ptr, subclasses, byte_offset); ++ if (num == 0) ++ return 0; ++ for (i = 0; i < num; i++) ++ { ++ int pos = *byte_offset / 8; ++ classes[i + pos] = ++ merge_classes (subclasses[i], classes[i + pos]); ++ } ++ ++ if ((*ptr)->type != FFI_TYPE_STRUCT) ++ *byte_offset += (*ptr)->size; ++ } ++ ++ /* Final merger cleanup. */ ++ for (i = 0; i < words; i++) ++ { ++ /* If one class is MEMORY, everything should be passed in ++ memory. */ ++ if (classes[i] == X86_64_MEMORY_CLASS) ++ return 0; ++ ++ /* The X86_64_SSEUP_CLASS should be always preceded by ++ X86_64_SSE_CLASS. */ ++ if (classes[i] == X86_64_SSEUP_CLASS ++ && (i == 0 || classes[i - 1] != X86_64_SSE_CLASS)) ++ classes[i] = X86_64_SSE_CLASS; ++ ++ /* X86_64_X87UP_CLASS should be preceded by X86_64_X87_CLASS. */ ++ if (classes[i] == X86_64_X87UP_CLASS ++ && (i == 0 || classes[i - 1] != X86_64_X87_CLASS)) ++ classes[i] = X86_64_SSE_CLASS; ++ } ++ return words; ++ } ++ ++ default: ++ FFI_ASSERT(0); ++ } ++ return 0; /* Never reached. */ ++} ++ ++/* Examine the argument and return set number of register required in each ++ class. Return 0 iff parameter should be passed in memory. */ ++static int ++examine_argument (ffi_type *type, int in_return, int *int_nregs,int *sse_nregs) ++{ ++ enum x86_64_reg_class class[MAX_CLASSES]; ++ int offset = 0; ++ int n; ++ ++ n = classify_argument (type, class, &offset); ++ ++ if (n == 0) ++ return 0; ++ ++ *int_nregs = 0; ++ *sse_nregs = 0; ++ for (n--; n>=0; n--) ++ switch (class[n]) ++ { ++ case X86_64_INTEGER_CLASS: ++ case X86_64_INTEGERSI_CLASS: ++ (*int_nregs)++; ++ break; ++ case X86_64_SSE_CLASS: ++ case X86_64_SSESF_CLASS: ++ case X86_64_SSEDF_CLASS: ++ (*sse_nregs)++; ++ break; ++ case X86_64_NO_CLASS: ++ case X86_64_SSEUP_CLASS: ++ break; ++ case X86_64_X87_CLASS: ++ case X86_64_X87UP_CLASS: ++ if (!in_return) ++ return 0; ++ break; ++ default: ++ abort (); ++ } ++ return 1; ++} ++ ++/* Functions to load floats and double to an SSE register placeholder. */ ++extern void float2sse (float, __int128_t *); ++extern void double2sse (double, __int128_t *); ++extern void floatfloat2sse (void *, __int128_t *); ++ ++/* Functions to put the floats and doubles back. */ ++extern float sse2float (__int128_t *); ++extern double sse2double (__int128_t *); ++extern void sse2floatfloat(__int128_t *, void *); ++ ++/*@-exportheader@*/ ++void ++ffi_prep_args (stackLayout *stack, extended_cif *ecif) ++/*@=exportheader@*/ ++{ ++ int gprcount, ssecount, i, g, s; ++ void **p_argv; ++ void *argp = &stack->argspace; ++ ffi_type **p_arg; ++ ++ /* First check if the return value should be passed in memory. If so, ++ pass the pointer as the first argument. */ ++ gprcount = ssecount = 0; ++ if (ecif->cif->rtype->type != FFI_TYPE_VOID ++ && examine_argument (ecif->cif->rtype, 1, &g, &s) == 0) ++ (void *)stack->gpr[gprcount++] = ecif->rvalue; ++ ++ for (i=ecif->cif->nargs, p_arg=ecif->cif->arg_types, p_argv = ecif->avalue; ++ i!=0; i--, p_arg++, p_argv++) ++ { ++ int in_register = 0; ++ ++ switch ((*p_arg)->type) ++ { ++ case FFI_TYPE_SINT8: ++ case FFI_TYPE_SINT16: ++ case FFI_TYPE_SINT32: ++ case FFI_TYPE_SINT64: ++ case FFI_TYPE_UINT8: ++ case FFI_TYPE_UINT16: ++ case FFI_TYPE_UINT32: ++ case FFI_TYPE_UINT64: ++ case FFI_TYPE_POINTER: ++ if (gprcount < MAX_GPR_REGS) ++ { ++ stack->gpr[gprcount] = 0; ++ stack->gpr[gprcount++] = *(long long *)(*p_argv); ++ in_register = 1; ++ } ++ break; ++ ++ case FFI_TYPE_FLOAT: ++ if (ssecount < MAX_SSE_REGS) ++ { ++ float2sse (*(float *)(*p_argv), &stack->sse[ssecount++]); ++ in_register = 1; ++ } ++ break; ++ ++ case FFI_TYPE_DOUBLE: ++ if (ssecount < MAX_SSE_REGS) ++ { ++ double2sse (*(double *)(*p_argv), &stack->sse[ssecount++]); ++ in_register = 1; ++ } ++ break; ++ } ++ ++ if (in_register) ++ continue; ++ ++ /* Either all places in registers where filled, or this is a ++ type that potentially goes into a memory slot. */ ++ if (examine_argument (*p_arg, 0, &g, &s) == 0 ++ || gprcount + g > MAX_GPR_REGS || ssecount + s > MAX_SSE_REGS) ++ { ++ /* Pass this argument in memory. */ ++ argp = (void *)ALIGN(argp, (*p_arg)->alignment); ++ memcpy (argp, *p_argv, (*p_arg)->size); ++ argp += (*p_arg)->size; ++ } ++ else ++ { ++ /* All easy cases are eliminated. Now fire the big guns. */ ++ ++ enum x86_64_reg_class classes[MAX_CLASSES]; ++ int offset = 0, j, num; ++ void *a; ++ ++ num = classify_argument (*p_arg, classes, &offset); ++ for (j=0, a=*p_argv; jgpr[gprcount++] = *(long long *)a; ++ break; ++ case X86_64_SSE_CLASS: ++ floatfloat2sse (a, &stack->sse[ssecount++]); ++ break; ++ case X86_64_SSESF_CLASS: ++ float2sse (*(float *)a, &stack->sse[ssecount++]); ++ break; ++ case X86_64_SSEDF_CLASS: ++ double2sse (*(double *)a, &stack->sse[ssecount++]); ++ break; ++ default: ++ abort(); ++ } ++ } ++ } ++ } ++} ++ ++/* Perform machine dependent cif processing. */ ++ffi_status ++ffi_prep_cif_machdep (ffi_cif *cif) ++{ ++ int gprcount, ssecount, i, g, s; ++ ++ gprcount = ssecount = 0; ++ ++ /* Reset the byte count. We handle this size estimation here. */ ++ cif->bytes = 0; ++ ++ /* If the return value should be passed in memory, pass the pointer ++ as the first argument. The actual memory isn't allocated here. */ ++ if (cif->rtype->type != FFI_TYPE_VOID ++ && examine_argument (cif->rtype, 1, &g, &s) == 0) ++ gprcount = 1; ++ ++ /* Go over all arguments and determine the way they should be passed. ++ If it's in a register and there is space for it, let that be so. If ++ not, add it's size to the stack byte count. */ ++ for (i=0; inargs; i++) ++ { ++ if (examine_argument (cif->arg_types[i], 0, &g, &s) == 0 ++ || gprcount + g > MAX_GPR_REGS || ssecount + s > MAX_SSE_REGS) ++ { ++ /* This is passed in memory. First align to the basic type. */ ++ cif->bytes = ALIGN(cif->bytes, cif->arg_types[i]->alignment); ++ ++ /* Stack arguments are *always* at least 8 byte aligned. */ ++ cif->bytes = ALIGN(cif->bytes, 8); ++ ++ /* Now add the size of this argument. */ ++ cif->bytes += cif->arg_types[i]->size; ++ } ++ else ++ { ++ gprcount += g; ++ ssecount += s; ++ } ++ } ++ ++ /* Set the flag for the closures return. */ ++ switch (cif->rtype->type) ++ { ++ case FFI_TYPE_VOID: ++ case FFI_TYPE_STRUCT: ++ case FFI_TYPE_SINT64: ++ case FFI_TYPE_FLOAT: ++ case FFI_TYPE_DOUBLE: ++ case FFI_TYPE_LONGDOUBLE: ++ cif->flags = (unsigned) cif->rtype->type; ++ break; ++ ++ case FFI_TYPE_UINT64: ++ cif->flags = FFI_TYPE_SINT64; ++ break; ++ ++ default: ++ cif->flags = FFI_TYPE_INT; ++ break; ++ } ++ ++ return FFI_OK; ++} ++ ++typedef struct ++{ ++ long gpr[2]; ++ __int128_t sse[2]; ++ long double st0; ++} return_value; ++ ++void ++ffi_fill_return_value (return_value *rv, extended_cif *ecif) ++{ ++ enum x86_64_reg_class classes[MAX_CLASSES]; ++ int i = 0, num; ++ long *gpr = rv->gpr; ++ __int128_t *sse = rv->sse; ++ signed char sc; ++ signed short ss; ++ ++ /* This is needed because of the way x86-64 handles signed short ++ integers. */ ++ switch (ecif->cif->rtype->type) ++ { ++ case FFI_TYPE_SINT8: ++ sc = *(signed char *)gpr; ++ *(long long *)ecif->rvalue = (long long)sc; ++ return; ++ case FFI_TYPE_SINT16: ++ ss = *(signed short *)gpr; ++ *(long long *)ecif->rvalue = (long long)ss; ++ return; ++ default: ++ /* Just continue. */ ++ ; ++ } ++ ++ num = classify_argument (ecif->cif->rtype, classes, &i); ++ ++ if (num == 0) ++ /* Return in memory. */ ++ ecif->rvalue = (void *) rv->gpr[0]; ++ else if (num == 2 && classes[0] == X86_64_X87_CLASS && ++ classes[1] == X86_64_X87UP_CLASS) ++ /* This is a long double (this is easiest to handle this way instead ++ of an eightbyte at a time as in the loop below. */ ++ *((long double *)ecif->rvalue) = rv->st0; ++ else ++ { ++ void *a; ++ ++ for (i=0, a=ecif->rvalue; irtype, 1, &dummy, &dummy) == 0)) ++ { ++ /*@-sysunrecog@*/ ++ ecif.rvalue = alloca(cif->rtype->size); ++ /*@=sysunrecog@*/ ++ } ++ else ++ ecif.rvalue = rvalue; ++ ++ /* Stack must always be 16byte aligned. Make it so. */ ++ cif->bytes = ALIGN(cif->bytes, 16); ++ ++ switch (cif->abi) ++ { ++ case FFI_SYSV: ++ /* Calling 32bit code from 64bit is not possible */ ++ FFI_ASSERT(0); ++ break; ++ ++ case FFI_UNIX64: ++ /*@-usedef@*/ ++ ffi_call_UNIX64 (ffi_prep_args, ffi_fill_return_value, &ecif, ++ cif->bytes, ecif.rvalue, fn); ++ /*@=usedef@*/ ++ break; ++ ++ default: ++ FFI_ASSERT(0); ++ break; ++ } ++} ++ ++extern void ffi_closure_UNIX64(void); ++ ++ffi_status ++ffi_prep_closure (ffi_closure* closure, ++ ffi_cif* cif, ++ void (*fun)(ffi_cif*, void*, void**, void*), ++ void *user_data) ++{ ++ volatile unsigned short *tramp; ++ ++ /* FFI_ASSERT (cif->abi == FFI_OSF); */ ++ ++ tramp = (volatile unsigned short *) &closure->tramp[0]; ++ tramp[0] = 0xbb49; /* mov , %r11 */ ++ tramp[5] = 0xba49; /* mov , %r10 */ ++ tramp[10] = 0xff49; /* jmp *%r11 */ ++ tramp[11] = 0x00e3; ++ *(void * volatile *) &tramp[1] = ffi_closure_UNIX64; ++ *(void * volatile *) &tramp[6] = closure; ++ ++ closure->cif = cif; ++ closure->fun = fun; ++ closure->user_data = user_data; ++ ++ return FFI_OK; ++} ++ ++int ++ffi_closure_UNIX64_inner(ffi_closure *closure, va_list l, void *rp) ++{ ++ ffi_cif *cif; ++ void **avalue; ++ ffi_type **arg_types; ++ long i, avn, argn; ++ ++ cif = closure->cif; ++ avalue = alloca(cif->nargs * sizeof(void *)); ++ ++ argn = 0; ++ ++ i = 0; ++ avn = cif->nargs; ++ arg_types = cif->arg_types; ++ ++ /* Grab the addresses of the arguments from the stack frame. */ ++ while (i < avn) ++ { ++ switch (arg_types[i]->type) ++ { ++ case FFI_TYPE_SINT8: ++ case FFI_TYPE_UINT8: ++ case FFI_TYPE_SINT16: ++ case FFI_TYPE_UINT16: ++ case FFI_TYPE_SINT32: ++ case FFI_TYPE_UINT32: ++ case FFI_TYPE_SINT64: ++ case FFI_TYPE_UINT64: ++ case FFI_TYPE_POINTER: ++ { ++ if (l->gp_offset > 48-8) ++ { ++ avalue[i] = l->overflow_arg_area; ++ l->overflow_arg_area = (char *)l->overflow_arg_area + 8; ++ } ++ else ++ { ++ avalue[i] = (char *)l->reg_save_area + l->gp_offset; ++ l->gp_offset += 8; ++ } ++ } ++ break; ++ ++ case FFI_TYPE_STRUCT: ++ /* FIXME */ ++ FFI_ASSERT(0); ++ break; ++ ++ case FFI_TYPE_DOUBLE: ++ { ++ if (l->fp_offset > 176-16) ++ { ++ avalue[i] = l->overflow_arg_area; ++ l->overflow_arg_area = (char *)l->overflow_arg_area + 8; ++ } ++ else ++ { ++ avalue[i] = (char *)l->reg_save_area + l->fp_offset; ++ l->fp_offset += 16; ++ } ++ } ++#if DEBUG_FFI ++ fprintf (stderr, "double arg %d = %g\n", i, *(double *)avalue[i]); ++#endif ++ break; ++ ++ case FFI_TYPE_FLOAT: ++ { ++ if (l->fp_offset > 176-16) ++ { ++ avalue[i] = l->overflow_arg_area; ++ l->overflow_arg_area = (char *)l->overflow_arg_area + 8; ++ } ++ else ++ { ++ avalue[i] = (char *)l->reg_save_area + l->fp_offset; ++ l->fp_offset += 16; ++ } ++ } ++#if DEBUG_FFI ++ fprintf (stderr, "float arg %d = %g\n", i, *(float *)avalue[i]); ++#endif ++ break; ++ ++ default: ++ FFI_ASSERT(0); ++ } ++ ++ argn += ALIGN(arg_types[i]->size, SIZEOF_ARG) / SIZEOF_ARG; ++ i++; ++ } ++ ++ /* Invoke the closure. */ ++ (closure->fun) (cif, rp, avalue, closure->user_data); ++ ++ /* FIXME: Structs not supported. */ ++ FFI_ASSERT(cif->rtype->type != FFI_TYPE_STRUCT); ++ ++ /* Tell ffi_closure_UNIX64 how to perform return type promotions. */ ++ ++ return cif->rtype->type; ++} ++#endif /* ifndef __x86_64__ */ +diff -ruN --exclude=CVS gcc-3.2.2.orig/libffi/src/x86/sysv.S gcc/libffi/src/x86/sysv.S +--- gcc-3.2.2.orig/libffi/src/x86/sysv.S Tue Jul 17 02:10:53 2001 ++++ gcc/libffi/src/x86/sysv.S Fri Jul 19 08:08:31 2002 +@@ -1,5 +1,5 @@ + /* ----------------------------------------------------------------------- +- sysv.S - Copyright (c) 1996, 1998, 2001 Cygnus Solutions ++ sysv.S - Copyright (c) 1996, 1998, 2001, 2002 Cygnus Solutions + + X86 Foreign Function Interface + +@@ -23,6 +23,8 @@ + OTHER DEALINGS IN THE SOFTWARE. + ----------------------------------------------------------------------- */ + ++#ifndef __x86_64__ ++ + #define LIBFFI_ASM + #include + +@@ -163,3 +165,5 @@ + .align 4 + .LEFDE1: + .set .LLFDE1,.LEFDE1-.LSFDE1 ++ ++#endif /* ifndef __x86_64__ */ +diff -ruN --exclude=CVS gcc-3.2.2.orig/libffi/src/x86/unix64.S gcc/libffi/src/x86/unix64.S +--- gcc-3.2.2.orig/libffi/src/x86/unix64.S Thu Jan 1 09:00:00 1970 ++++ gcc/libffi/src/x86/unix64.S Wed Jan 29 00:54:28 2003 +@@ -0,0 +1,302 @@ ++/* ----------------------------------------------------------------------- ++ unix64.S - Copyright (c) 2002 Bo Thorsen ++ ++ x86-64 Foreign Function Interface ++ ++ Permission is hereby granted, free of charge, to any person obtaining ++ a copy of this software and associated documentation files (the ++ ``Software''), to deal in the Software without restriction, including ++ without limitation the rights to use, copy, modify, merge, publish, ++ distribute, sublicense, and/or sell copies of the Software, and to ++ permit persons to whom the Software is furnished to do so, subject to ++ the following conditions: ++ ++ The above copyright notice and this permission notice shall be included ++ in all copies or substantial portions of the Software. ++ ++ THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS ++ OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF ++ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. ++ IN NO EVENT SHALL CYGNUS SOLUTIONS BE LIABLE FOR ANY CLAIM, DAMAGES OR ++ OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ++ ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR ++ OTHER DEALINGS IN THE SOFTWARE. ++ ----------------------------------------------------------------------- */ ++ ++#ifdef __x86_64__ ++#define LIBFFI_ASM ++#include ++ ++ .section .rodata ++.LC0: ++ .string "asm in progress %lld\n" ++.LC1: ++ .string "asm in progress\n" ++.text ++ .align 2 ++.globl ffi_call_UNIX64 ++ .type ffi_call_UNIX64,@function ++ ++ffi_call_UNIX64: ++.LFB1: ++ pushq %rbp ++.LCFI0: ++ movq %rsp, %rbp ++.LCFI1: ++ /* Save all arguments */ ++ subq $48, %rsp ++.LCFI2: ++ movq %rdi, -8(%rbp) /* ffi_prep_args */ ++ movq %rsi, -16(%rbp) /* ffi_fill_return_value */ ++ movq %rdx, -24(%rbp) /* ecif */ ++ movq %rcx, -32(%rbp) /* cif->bytes */ ++ movq %r8, -40(%rbp) /* ecif.rvalue */ ++ movq %r9, -48(%rbp) /* fn */ ++ ++ /* Make room for all of the new args and the register args */ ++ addl $176, %ecx ++.LCFI3: ++ subq %rcx, %rsp ++.LCFI4: ++ /* Setup the call to ffi_prep_args. */ ++ movq %rdi, %rax /* &ffi_prep_args */ ++ movq %rsp, %rdi /* stackLayout */ ++ movq %rdx, %rsi /* ecif */ ++ call *%rax /* ffi_prep_args(stackLayout, ecif);*/ ++ ++ /* ffi_prep_args have put all the register contents into the */ ++ /* stackLayout struct. Now put the register values in place. */ ++ movq (%rsp), %rdi ++ movq 8(%rsp), %rsi ++ movq 16(%rsp), %rdx ++ movq 24(%rsp), %rcx ++ movq 32(%rsp), %r8 ++ movq 40(%rsp), %r9 ++ movaps 48(%rsp), %xmm0 ++ movaps 64(%rsp), %xmm1 ++ movaps 80(%rsp), %xmm2 ++ movaps 96(%rsp), %xmm3 ++ movaps 112(%rsp), %xmm4 ++ movaps 128(%rsp), %xmm5 ++ movaps 144(%rsp), %xmm6 ++ movaps 160(%rsp), %xmm7 ++ ++ /* Remove space for stackLayout so stack arguments are placed ++ correctly for the call. */ ++.LCFI5: ++ addq $176, %rsp ++.LCFI6: ++ /* Call the user function. */ ++ call *-48(%rbp) ++ ++ /* Make stack space for the return_value struct. */ ++ subq $64, %rsp ++ ++ /* Fill in all potential return values to this struct. */ ++ movq %rax, (%rsp) ++ movq %rdx, 8(%rsp) ++ movaps %xmm0, 16(%rsp) ++ movaps %xmm1, 32(%rsp) ++ fstpt 48(%rsp) ++ ++ /* Now call ffi_fill_return_value. */ ++ movq %rsp, %rdi /* struct return_value */ ++ movq -24(%rbp), %rsi /* ecif */ ++ movq -16(%rbp), %rax /* &ffi_fill_return_value */ ++ call *%rax /* call it */ ++ ++ /* And the work is done. */ ++ leave ++ ret ++.LFE1: ++.ffi_call_UNIX64_end: ++ .size ffi_call_UNIX64,.ffi_call_UNIX64_end-ffi_call_UNIX64 ++ ++.text ++ .align 2 ++.globl float2sse ++ .type float2sse,@function ++float2sse: ++ /* Save the contents of this sse-float in a pointer. */ ++ movaps %xmm0, (%rdi) ++ ret ++ ++ .align 2 ++.globl floatfloat2sse ++ .type floatfloat2sse,@function ++floatfloat2sse: ++ /* Save the contents of these two sse-floats in a pointer. */ ++ movq (%rdi), %xmm0 ++ movaps %xmm0, (%rsi) ++ ret ++ ++ .align 2 ++.globl double2sse ++ .type double2sse,@function ++double2sse: ++ /* Save the contents of this sse-double in a pointer. */ ++ movaps %xmm0, (%rdi) ++ ret ++ ++ .align 2 ++.globl sse2float ++ .type sse2float,@function ++sse2float: ++ /* Save the contents of this sse-float in a pointer. */ ++ movaps (%rdi), %xmm0 ++ ret ++ ++ .align 2 ++.globl sse2double ++ .type sse2double,@function ++sse2double: ++ /* Save the contents of this pointer in a sse-double. */ ++ movaps (%rdi), %xmm0 ++ ret ++ ++ .align 2 ++.globl sse2floatfloat ++ .type sse2floatfloat,@function ++sse2floatfloat: ++ /* Save the contents of this pointer in two sse-floats. */ ++ movaps (%rdi), %xmm0 ++ movq %xmm0, (%rsi) ++ ret ++ ++ .align 2 ++.globl ffi_closure_UNIX64 ++ .type ffi_closure_UNIX64,@function ++ ++ffi_closure_UNIX64: ++.LFB2: ++ pushq %rbp ++.LCFI10: ++ movq %rsp, %rbp ++.LCFI11: ++ subq $240, %rsp ++.LCFI12: ++ movq %rdi, -176(%rbp) ++ movq %rsi, -168(%rbp) ++ movq %rdx, -160(%rbp) ++ movq %rcx, -152(%rbp) ++ movq %r8, -144(%rbp) ++ movq %r9, -136(%rbp) ++ /* FIXME: We can avoid all this stashing of XMM registers by ++ (in ffi_prep_closure) computing the number of ++ floating-point args and moving it into %rax before calling ++ this function. Once this is done, uncomment the next few ++ lines and only the essential XMM registers will be written ++ to memory. This is a significant saving. */ ++/* movzbl %al, %eax */ ++/* movq %rax, %rdx */ ++/* leaq 0(,%rdx,4), %rax */ ++/* leaq 2f(%rip), %rdx */ ++/* subq %rax, %rdx */ ++ leaq -1(%rbp), %rax ++/* jmp *%rdx */ ++ movaps %xmm7, -15(%rax) ++ movaps %xmm6, -31(%rax) ++ movaps %xmm5, -47(%rax) ++ movaps %xmm4, -63(%rax) ++ movaps %xmm3, -79(%rax) ++ movaps %xmm2, -95(%rax) ++ movaps %xmm1, -111(%rax) ++ movaps %xmm0, -127(%rax) ++2: ++ movl %edi, -180(%rbp) ++ movl $0, -224(%rbp) ++ movl $48, -220(%rbp) ++ leaq 16(%rbp), %rax ++ movq %rax, -216(%rbp) ++ leaq -176(%rbp), %rdx ++ movq %rdx, -208(%rbp) ++ leaq -224(%rbp), %rsi ++ movq %r10, %rdi ++ movq %rsp, %rdx ++ call ffi_closure_UNIX64_inner@PLT ++ ++ cmpl $FFI_TYPE_FLOAT, %eax ++ je 1f ++ cmpl $FFI_TYPE_DOUBLE, %eax ++ je 2f ++ cmpl $FFI_TYPE_LONGDOUBLE, %eax ++ je 3f ++ cmpl $FFI_TYPE_STRUCT, %eax ++ je 4f ++ popq %rax ++ leave ++ ret ++1: ++2: ++3: ++ movaps -240(%rbp), %xmm0 ++ leave ++ ret ++4: ++ leave ++ ret ++.LFE2: ++ ++ .section .eh_frame,"a",@progbits ++.Lframe0: ++ .long .LECIE1-.LSCIE1 ++.LSCIE1: ++ .long 0x0 ++ .byte 0x1 ++ .string "zR" ++ .uleb128 0x1 ++ .sleb128 -8 ++ .byte 0x10 ++ .uleb128 0x1 ++ .byte 0x1b ++ .byte 0xc ++ .uleb128 0x7 ++ .uleb128 0x8 ++ .byte 0x90 ++ .uleb128 0x1 ++ .align 8 ++.LECIE1: ++.LSFDE1: ++ .long .LEFDE1-.LASFDE1 ++.LASFDE1: ++ .long .LASFDE1-.Lframe0 ++ ++ .long .LFB1-. ++ .long .LFE1-.LFB1 ++ .uleb128 0x0 ++ .byte 0x4 # DW_CFA_advance_loc4 ++ .long .LCFI0-.LFB1 ++ .byte 0xe # DW_CFA_def_cfa_offset ++ .uleb128 0x10 ++ .byte 0x86 # DW_CFA_offset: r6 at cfa-16 ++ .uleb128 0x2 ++ .byte 0x4 # DW_CFA_advance_loc4 ++ .long .LCFI1-.LCFI0 ++ .byte 0x86 # DW_CFA_offset: r6 at cfa-16 ++ .uleb128 0x2 ++ .byte 0xd # DW_CFA_def_cfa_reg: r6 ++ .uleb128 0x6 ++ .align 8 ++.LEFDE1: ++.LSFDE3: ++ .long .LEFDE3-.LASFDE3 # FDE Length ++.LASFDE3: ++ .long .LASFDE3-.Lframe0 # FDE CIE offset ++ ++ .long .LFB2-. # FDE initial location ++ .long .LFE2-.LFB2 # FDE address range ++ .uleb128 0x0 # Augmentation size ++ .byte 0x4 # DW_CFA_advance_loc4 ++ .long .LCFI10-.LFB2 ++ .byte 0xe # DW_CFA_def_cfa_offset ++ .uleb128 0x10 ++ .byte 0x86 # DW_CFA_offset, column 0x6 ++ .uleb128 0x2 ++ .byte 0x4 # DW_CFA_advance_loc4 ++ .long .LCFI11-.LCFI10 ++ .byte 0xd # DW_CFA_def_cfa_register ++ .uleb128 0x6 ++ .align 8 ++.LEFDE3: ++ ++#endif /* __x86_64__ */ +diff -ruN --exclude=CVS gcc-3.2.2.orig/libffi/src/x86/win32.S gcc/libffi/src/x86/win32.S +--- gcc-3.2.2.orig/libffi/src/x86/win32.S Tue Mar 27 11:39:16 2001 ++++ gcc/libffi/src/x86/win32.S Fri Dec 6 10:16:45 2002 +@@ -1,5 +1,8 @@ + /* ----------------------------------------------------------------------- +- win32.S - Copyright (c) 1996, 1998, 2001 Cygnus Solutions ++ win32.S - Copyright (c) 1996, 1998, 2001, 2002 Red Hat, Inc. ++ Copyright (c) 2001 John Beniton ++ Copyright (c) 2002 Ranjit Mathew ++ + + X86 Foreign Function Interface + +@@ -52,7 +55,10 @@ + # Return stack to previous state and call the function + addl $8,%esp + +- call *28(%ebp) ++ # FIXME: Align the stack to a 128-bit boundary to avoid ++ # potential performance hits. ++ ++ call *28(%ebp) + + # Remove the space we pushed for the args + movl 16(%ebp),%ecx +@@ -123,3 +129,98 @@ + ret + + .ffi_call_SYSV_end: ++ ++ # This assumes we are using gas. ++ .balign 16 ++.globl _ffi_call_STDCALL ++ ++_ffi_call_STDCALL: ++ pushl %ebp ++ movl %esp,%ebp ++ ++ # Make room for all of the new args. ++ movl 16(%ebp),%ecx ++ subl %ecx,%esp ++ ++ movl %esp,%eax ++ ++ # Place all of the ffi_prep_args in position ++ pushl 12(%ebp) ++ pushl %eax ++ call *8(%ebp) ++ ++ # Return stack to previous state and call the function ++ addl $8,%esp ++ ++ # FIXME: Align the stack to a 128-bit boundary to avoid ++ # potential performance hits. ++ ++ call *28(%ebp) ++ ++ # stdcall functions pop arguments off the stack themselves ++ ++ # Load %ecx with the return type code ++ movl 20(%ebp),%ecx ++ ++ # If the return value pointer is NULL, assume no return value. ++ cmpl $0,24(%ebp) ++ jne sc_retint ++ ++ # Even if there is no space for the return value, we are ++ # obliged to handle floating-point values. ++ cmpl $FFI_TYPE_FLOAT,%ecx ++ jne sc_noretval ++ fstp %st(0) ++ ++ jmp sc_epilogue ++ ++sc_retint: ++ cmpl $FFI_TYPE_INT,%ecx ++ jne sc_retfloat ++ # Load %ecx with the pointer to storage for the return value ++ movl 24(%ebp),%ecx ++ movl %eax,0(%ecx) ++ jmp sc_epilogue ++ ++sc_retfloat: ++ cmpl $FFI_TYPE_FLOAT,%ecx ++ jne sc_retdouble ++ # Load %ecx with the pointer to storage for the return value ++ movl 24(%ebp),%ecx ++ fstps (%ecx) ++ jmp sc_epilogue ++ ++sc_retdouble: ++ cmpl $FFI_TYPE_DOUBLE,%ecx ++ jne sc_retlongdouble ++ # Load %ecx with the pointer to storage for the return value ++ movl 24(%ebp),%ecx ++ fstpl (%ecx) ++ jmp sc_epilogue ++ ++sc_retlongdouble: ++ cmpl $FFI_TYPE_LONGDOUBLE,%ecx ++ jne sc_retint64 ++ # Load %ecx with the pointer to storage for the return value ++ movl 24(%ebp),%ecx ++ fstpt (%ecx) ++ jmp sc_epilogue ++ ++sc_retint64: ++ cmpl $FFI_TYPE_SINT64,%ecx ++ jne sc_retstruct ++ # Load %ecx with the pointer to storage for the return value ++ movl 24(%ebp),%ecx ++ movl %eax,0(%ecx) ++ movl %edx,4(%ecx) ++ ++sc_retstruct: ++ # Nothing to do! ++ ++sc_noretval: ++sc_epilogue: ++ movl %ebp,%esp ++ popl %ebp ++ ret ++ ++.ffi_call_STDCALL_end: +--- gcc-3.2.2.orig/libjava/configure.host Mon Jun 10 13:15:26 2002 ++++ gcc-3.2.2/libjava/configure.host Sat Feb 15 19:57:25 2003 +@@ -115,6 +115,12 @@ + enable_getenv_properties_default=no + enable_main_args_default=no + ;; ++ sh-* | sh[34]*-*) ++ sysdeps_dir=sh ++ libgcj_flags="${libgcj_flags} -mieee" ++ libgcj_interpreter=yes ++ enable_hash_synchronization_default=yes ++ ;; + esac + + # This case statement supports generic port properties and may refine +@@ -126,7 +132,8 @@ + powerpc*-linux* | \ + alpha*-linux* | \ + sparc*-linux* | \ +- ia64-*) ++ ia64-* | \ ++ sh-linux* | sh[34]*-linux*) + can_unwind_signal=yes + ;; + *-*-darwin*) diff --git a/patches/gcc/3.2.3/150-gcc-3.2.3-ppc-asm-spec.patch b/patches/gcc/3.2.3/150-gcc-3.2.3-ppc-asm-spec.patch new file mode 100644 index 0000000..e0ccd9f --- /dev/null +++ b/patches/gcc/3.2.3/150-gcc-3.2.3-ppc-asm-spec.patch @@ -0,0 +1,54 @@ +Based on gcc-3.4.0/gcc-3.3.3h-ppc-asm-spec.patch + +Fixes the following errors when building gcc for ppc7450: + +/tmp/ccYph3gd.s: Assembler messages: +/tmp/ccYph3gd.s:3823: Error: Unrecognized opcode: `mfvrsave' +/tmp/ccYph3gd.s:3857: Error: Unrecognized opcode: `stvx' +/tmp/ccYph3gd.s:4026: Error: Unrecognized opcode: `lvx' +/tmp/ccYph3gd.s:4027: Error: Unrecognized opcode: `mtvrsave' +make[2]: *** [libgcc/./unwind-dw2.o] Error 1 +make[2]: Leaving directory `/opt/crosstool-0.28-rc35/build/powerpc-7450-linux-gnu/gcc-3.2.3-glibc-2.3.2/build-gcc-core/gcc' +make[1]: *** [stmp-multilib] Error 2 +make[1]: Leaving directory `/opt/crosstool-0.28-rc35/build/powerpc-7450-linux-gnu/gcc-3.2.3-glibc-2.3.2/build-gcc-core/gcc' +make: *** [all-gcc] Error 2 + +Note that the "-mcpu=7450" option must appear on the "gcc" command line in +order for "-maltivec" to be passed to the assembler. Or, "-maltivec" itself +may be passed to the "gcc" command. + +Contributed by Tom Warzeka + +=================================================================== +--- gcc-3.2.3/gcc/config/rs6000/rs6000.h~ 2003-03-29 07:39:20.000000000 -0500 ++++ gcc-3.2.3/gcc/config/rs6000/rs6000.h 2004-08-23 16:33:21.000000000 -0400 +@@ -77,8 +77,8 @@ + %{mcpu=604e: -D_ARCH_PPC} \ + %{mcpu=620: -D_ARCH_PPC} \ + %{mcpu=740: -D_ARCH_PPC} \ +-%{mcpu=7400: -D_ARCH_PPC} \ +-%{mcpu=7450: -D_ARCH_PPC} \ ++%{mcpu=7400: -D_ARCH_PPC -D__ALTIVEC__} \ ++%{mcpu=7450: -D_ARCH_PPC -D__ALTIVEC__} \ + %{mcpu=750: -D_ARCH_PPC} \ + %{mcpu=801: -D_ARCH_PPC} \ + %{mcpu=821: -D_ARCH_PPC} \ +@@ -117,14 +117,15 @@ + %{mcpu=604e: -mppc} \ + %{mcpu=620: -mppc} \ + %{mcpu=740: -mppc} \ +-%{mcpu=7400: -mppc} \ +-%{mcpu=7450: -mppc} \ ++%{mcpu=7400: -mppc -maltivec} \ ++%{mcpu=7450: -mppc -maltivec} \ + %{mcpu=750: -mppc} \ + %{mcpu=801: -mppc} \ + %{mcpu=821: -mppc} \ + %{mcpu=823: -mppc} \ + %{mcpu=860: -mppc} \ +-%{maltivec: -maltivec}" ++%{maltivec: -maltivec} \ ++-many" + + #define CPP_DEFAULT_SPEC "" + diff --git a/patches/gcc/3.2.3/160-gcc-3.2.3-trap-posix.patch b/patches/gcc/3.2.3/160-gcc-3.2.3-trap-posix.patch new file mode 100644 index 0000000..4751e9d --- /dev/null +++ b/patches/gcc/3.2.3/160-gcc-3.2.3-trap-posix.patch @@ -0,0 +1,45 @@ +# +# Submitted-By: Marc Kleine-Budde , 2005-04-20 +# +# Error: +# +# creating libintl.h +# Configuring etc... +# loading cache ../config.cache +# checking for a BSD compatible install... (cached) /usr/bin/install -c +# creating ./config.status +# creating Makefile +# trap: usage: trap [-lp] [[arg] signal_spec ...] +# +# Description: +# +# non-posix conform usage of trap causes bash >= 3.0 to fail +# +# e.g.: http://sourceware.org/ml/crossgcc/2004-12/msg00132.html +# +# Status: +# +# fixed in gcc >= 3.3.5 +# backport of gcc-3.3.5 fix +# +diff -ruN gcc-3.2.3-orig/configure gcc-3.2.3/configure +--- gcc-3.2.3-orig/configure 2002-06-24 18:14:28.000000000 +0200 ++++ gcc-3.2.3/configure 2005-04-20 18:42:49.000000000 +0200 +@@ -697,7 +697,7 @@ + if test -f skip-this-dir; then + # Perform the same cleanup as the trap handler, minus the "exit 1" of course, + # and reset the trap handler. +- trap 0 ++ trap '' 0 + rm -rf Makefile* ${tmpdir} + # Execute the final clean-up actions + ${config_shell} skip-this-dir +@@ -1615,7 +1615,7 @@ + # Perform the same cleanup as the trap handler, minus the "exit 1" of course, + # and reset the trap handler. + rm -rf ${tmpdir} +-trap 0 ++trap '' 0 + + exit 0 + diff --git a/patches/gcc/3.2.3/170-gcc-3.3-libstdc++-v3-dg.exp.patch b/patches/gcc/3.2.3/170-gcc-3.3-libstdc++-v3-dg.exp.patch new file mode 100644 index 0000000..aafc130 --- /dev/null +++ b/patches/gcc/3.2.3/170-gcc-3.3-libstdc++-v3-dg.exp.patch @@ -0,0 +1,54 @@ +Without this patch, the command + +RUNTESTFLAGS=--target=powerpc-750-linux-gnu -v -v -v -v make check-target-libstdc++-v3 + +fails in two ways: +1. the -L option meant to locate the testsuite directory is incorrect, and +2. the wrong compiler is invoked, causing all sorts of havoc, not least of which +is the native compiler is invoked when we really wanted to invoke the cross-compiler +we just built. + +Here's an example log of the problem in action. Every testcase fails, this shows just one: +------------- +Invoking the compiler as g++ -ggdb3 -DDEBUG_ASSERT -I/home3/dank/wk/ixos/dap_interim/linux/3rdParty/crosstool/crosstool-0.12/build/powerpc-750-linux-gnu/gcc-3.3-glibc-2.2.5/gcc-3.3/libstdc++-v3/testsuite /home3/dank/wk/ixos/dap_interim/linux/3rdParty/crosstool/crosstool-0.12/build/powerpc-750-linux-gnu/gcc-3.3-glibc-2.2.5/gcc-3.3/libstdc++-v3/testsuite/20_util/binders.cc -g -O2 -DDEBUG_ASSERT -L/testsuite -lv3test -lm -o ./binders.exe +compiler exited with status 1 +output is: +/usr/lib/gcc-lib/i386-linux/2.95.4/../../../../include/g++-3/stl_function.h: In method `void binder2nd >::operator ()(const Elem &) const':^M +/usr/lib/gcc-lib/i386-linux/2.95.4/../../../../include/g++-3/stl_algo.h:83: instantiated from `for_each > >(Elem *, Elem *, binder2nd >)'^M +/home3/dank/wk/ixos/dap_interim/linux/3rdParty/crosstool/crosstool-0.12/build/powerpc-750-linux-gnu/gcc-3.3-glibc-2.2.5/gcc-3.3/libstdc++-v3/testsuite/20_util/binders.cc:43: instantiated from here^M +/usr/lib/gcc-lib/i386-linux/2.95.4/../../../../include/g++-3/stl_function.h:224: conversion from `const Elem' to `Elem &' discards qualifiers^M +/usr/lib/gcc-lib/i386-linux/2.95.4/../../../../include/g++-3/stl_function.h:622: in passing argument 1 of `mem_fun1_ref_t::operator ()(Elem &, int) const'^M +... +FAIL: 20_util/binders.cc (test for excess errors) +WARNING: 20_util/binders.cc compilation failed to produce executable +------------- + +And here's the patch. I'm not happy with it, and it probably gets some cases wrong, +but it seems to work for the common native case and for my cross-compiler case. + +--- gcc-3.3/libstdc++-v3/testsuite/lib/libstdc++-v3-dg.exp.old Sun Jul 13 10:42:01 2003 ++++ gcc-3.3/libstdc++-v3/testsuite/lib/libstdc++-v3-dg.exp Sun Jul 13 11:39:54 2003 +@@ -46,8 +46,23 @@ + global gluefile wrap_flags + global ld_library_path + global tool_root_dir ++ global target_triplet + + set blddir [lookfor_file [get_multilibs] libstdc++-v3] ++ if { $blddir == "" } { ++ set multilibs [get_multilibs] ++ # FIXME: assume multilib only one level deep ++ set multisub [file tail $multilibs] ++ verbose "libstdc++-v3-init: couldn't find libstdc++-v3 in $multilibs, trying $objdir" ++ set blddir [lookfor_file ${objdir} "$target_triplet/$multisub/libstdc++-v3"] ++ } ++ if { $blddir == "" } { ++ verbose "libstdc++-v3-init: couldn't find libstdc++-v3, trying $objdir without multilibs" ++ set blddir [lookfor_file ${objdir} "$target_triplet/libstdc++-v3"] ++ } ++ if { $blddir == "" } { ++ error "Can't find libstdc++-v3" ++ } + + # By default, we assume we want to run program images. + global dg-do-what-default diff --git a/patches/gcc/3.2.3/config.sub.patch b/patches/gcc/3.2.3/config.sub.patch deleted file mode 100644 index 928f911..0000000 --- a/patches/gcc/3.2.3/config.sub.patch +++ /dev/null @@ -1,72 +0,0 @@ -When configuring a s390->s390 or cris->cris crosscompiler -(ok, I haven't hit this yet, but one of these days I'll get me an account -on an s390, and then I'll need this patch :-), you'll get the -following error: - -+ /build/s390-unknown-linux-gnu/gcc-3.3-glibc-2.3.2/gcc-3.3/configure ---target=s390-unknown-linux-gnu --host=s390-host_unknown-linux-gnu ---prefix=/result/s390-unknown-linux-gnu/gcc-3.3-glibc-2.3.2 ---enable-languages=c ---with-local-prefix=/result/s390-unknown-linux-gnu/gcc-3.3-glibc-2.3.2/s390- -unknown-linux-gnu --enable-threads=no --without-headers --with-newlib ---disable-shared -... -*** --with-headers is only supported when cross compiling - -This error pops up only when you're using Daniel Jacobowitz's technique -of slightly changing the target and host tuples to make them different -enough to force gcc's build system to not try to pull in system libraries -or headers. This technique is needed e.g. to build an x86 -> x86 -cross-compiler. -(The LFS developers ran into the same bug that prompted me to use -this technique; they point people who run into it to -http://linuxfromscratch.org/~greg/pure_lfs.txt, which is a different -way of avoiding this problem. I think the tuple tweak is the way to go, though.) - -config-patches@gnu.org rejected this patch, on the grounds that there -is only one vendor of each of those two architectures, so the -canonicalization is by definition correct. When I pointed out the -difficulty this causes for people building s390 -> s390 or -cris -> cris compilers that are incompatible with the system -libraries and thus must be built like cross-compilers, he grumped and said -"autoconf should let you specify a cross-compiler in some other way than -comparing tuple strings". - - - ---- gcc-3.3/config.sub.old Sun Jun 8 20:38:47 2003 -+++ gcc-3.3/config.sub Sun Jun 8 20:40:34 2003 -@@ -433,9 +433,12 @@ - crds | unos) - basic_machine=m68k-crds - ;; -- cris | cris-* | etrax*) -+ cris | etrax*) - basic_machine=cris-axis - ;; -+ cris-*) -+ basic_machine=cris-`echo $basic_machine | sed 's/^[^-]*-//'` -+ ;; - da30 | da30-*) - basic_machine=m68k-da30 - ;; -@@ -820,11 +823,17 @@ - rtpc | rtpc-*) - basic_machine=romp-ibm - ;; -- s390 | s390-*) -+ s390) - basic_machine=s390-ibm - ;; -- s390x | s390x-*) -+ s390-*) -+ basic_machine=s390-`echo $basic_machine | sed 's/^[^-]*-//'` -+ ;; -+ s390x) - basic_machine=s390x-ibm -+ ;; -+ s390x-*) -+ basic_machine=s390x-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - sa29200) - basic_machine=a29k-amd diff --git a/patches/gcc/3.2.3/gcc-20020722-ppc405erratum77.patch b/patches/gcc/3.2.3/gcc-20020722-ppc405erratum77.patch deleted file mode 100644 index bd717f5..0000000 --- a/patches/gcc/3.2.3/gcc-20020722-ppc405erratum77.patch +++ /dev/null @@ -1,105 +0,0 @@ -# See http://gcc.gnu.org/PR7383, http://www.kegel.com/xgcc3/ppc405erratum77.html -# Fixed in gcc-3.3 - -diff -aur gcc-20020722.orig/gcc/config/rs6000/rs6000.h gcc-20020722/gcc/config/rs6000/rs6000.h ---- gcc-20020722.orig/gcc/config/rs6000/rs6000.h Thu Jul 25 09:32:21 2002 -+++ gcc-20020722/gcc/config/rs6000/rs6000.h Thu Jul 25 09:34:45 2002 -@@ -66,7 +66,7 @@ - %{mcpu=rsc1: -D_ARCH_PWR} \ - %{mcpu=401: -D_ARCH_PPC} \ - %{mcpu=403: -D_ARCH_PPC} \ --%{mcpu=405: -D_ARCH_PPC} \ -+%{mcpu=405: -D_ARCH_PPC -D__PPC405__} \ - %{mcpu=505: -D_ARCH_PPC} \ - %{mcpu=601: -D_ARCH_PPC -D_ARCH_PWR} \ - %{mcpu=602: -D_ARCH_PPC} \ -diff -aur gcc-20020722.orig/libjava/sysdep/powerpc/locks.h gcc-20020722/libjava/sysdep/powerpc/locks.h ---- gcc-20020722.orig/libjava/sysdep/powerpc/locks.h Thu Jul 25 09:32:30 2002 -+++ gcc-20020722/libjava/sysdep/powerpc/locks.h Thu Jul 25 11:39:13 2002 -@@ -11,6 +11,17 @@ - #ifndef __SYSDEP_LOCKS_H__ - #define __SYSDEP_LOCKS_H__ - -+#ifdef __PPC405__ -+// workaround for PPC405 erratum #77 - 07/18/02 JRO, dank, NN. References: -+// http://www-3.ibm.com/chips/techlib/techlib.nsf/techdocs/89DED00DEBFF54BF87256A8000491BA2/$file/405CR_C_errata_1_2.pdf -+// http://ppc.bkbits.net:8080/linuxppc_2_4_devel/cset@1.489 -+// http://www.kegel.com/xgcc3/ppc405erratum77.html -+// FIXME: using dbct instead of sync would be faster -+#define __LIBGCJ_PPC405_ERR77_SYNC "sync \n\t" -+#else -+#define __LIBGCJ_PPC405_ERR77_SYNC -+#endif -+ - typedef size_t obj_addr_t; /* Integer type big enough for object */ - /* address. */ - -@@ -25,6 +36,7 @@ - "0: lwarx %0,0,%1 ;" - " xor. %0,%3,%0;" - " bne 1f;" -+ __LIBGCJ_PPC405_ERR77_SYNC - " stwcx. %2,0,%1;" - " bne- 0b;" - "1: " -@@ -58,6 +70,7 @@ - "0: lwarx %0,0,%1 ;" - " xor. %0,%3,%0;" - " bne 1f;" -+ __LIBGCJ_PPC405_ERR77_SYNC - " stwcx. %2,0,%1;" - " bne- 0b;" - "1: " -diff -aur gcc-20020722.orig/libstdc++-v3/config/cpu/powerpc/bits/atomicity.h gcc-20020722/libstdc++-v3/config/cpu/powerpc/bits/atomicity.h ---- gcc-20020722.orig/libstdc++-v3/config/cpu/powerpc/bits/atomicity.h Thu Jul 25 09:32:31 2002 -+++ gcc-20020722/libstdc++-v3/config/cpu/powerpc/bits/atomicity.h Thu Jul 25 09:34:45 2002 -@@ -32,6 +32,17 @@ - - typedef int _Atomic_word; - -+#ifdef __PPC405__ -+// workaround for PPC405 erratum #77 - 07/18/02 JRO & dank. References: -+// http://www-3.ibm.com/chips/techlib/techlib.nsf/techdocs/89DED00DEBFF54BF87256A8000491BA2/$file/405CR_C_errata_1_2.pdf -+// http://ppc.bkbits.net:8080/linuxppc_2_4_devel/cset@1.489 -+// http://www.kegel.com/xgcc3/ppc405erratum77.html -+// FIXME: using dbct instead of sync would be faster -+#define __LIBSTDCPP_PPC405_ERR77_SYNC "sync \n\t" -+#else -+#define __LIBSTDCPP_PPC405_ERR77_SYNC -+#endif -+ - static inline _Atomic_word - __attribute__ ((__unused__)) - __exchange_and_add (volatile _Atomic_word* __mem, int __val) -@@ -42,6 +53,7 @@ - "0:\t" - "lwarx %0,0,%2 \n\t" - "add%I3 %1,%0,%3 \n\t" -+ __LIBSTDCPP_PPC405_ERR77_SYNC - "stwcx. %1,0,%2 \n\t" - "bne- 0b \n\t" - "/* End exchange & add */" -@@ -61,6 +73,7 @@ - "0:\t" - "lwarx %0,0,%1 \n\t" - "add%I2 %0,%0,%2 \n\t" -+ __LIBSTDCPP_PPC405_ERR77_SYNC - "stwcx. %0,0,%1 \n\t" - "bne- 0b \n\t" - "/* End atomic add */" -@@ -78,6 +91,7 @@ - "/* Inline always swap */\n" - "0:\t" - "lwarx %0,0,%1 \n\t" -+ __LIBSTDCPP_PPC405_ERR77_SYNC - "stwcx. %2,0,%1 \n\t" - "bne- 0b \n\t" - "/* End always swap */" -@@ -98,6 +112,7 @@ - "lwarx %0,0,%1 \n\t" - "cmpwi %0,0 \n\t" - "bne- 1f \n\t" -+ __LIBSTDCPP_PPC405_ERR77_SYNC - "stwcx. %2,0,%1 \n\t" - "bne- 0b \n" - "1:\n\t" diff --git a/patches/gcc/3.2.3/gcc-20030210-sh-linux-1.patch b/patches/gcc/3.2.3/gcc-20030210-sh-linux-1.patch deleted file mode 100644 index 4393078..0000000 --- a/patches/gcc/3.2.3/gcc-20030210-sh-linux-1.patch +++ /dev/null @@ -1,1761 +0,0 @@ -diff -ruN gcc-20030210.orig/boehm-gc/configure gcc-20030210/boehm-gc/configure ---- gcc-20030210.orig/boehm-gc/configure Fri Jan 31 19:17:00 2003 -+++ gcc-20030210/boehm-gc/configure Sat Feb 22 01:40:14 2003 -@@ -1922,7 +1922,7 @@ - # This must be Linux ELF. - linux-gnu*) - case $host_cpu in -- alpha* | hppa* | i*86 | powerpc* | sparc* | ia64* ) -+ alpha* | hppa* | i*86 | powerpc* | sparc* | ia64* | sh* ) - lt_cv_deplibs_check_method=pass_all ;; - *) - # glibc up to 2.1.1 does not perform some relocations on ARM -diff -ruN gcc-20030210.orig/config-ml.in gcc-20030210/config-ml.in ---- gcc-20030210.orig/config-ml.in Fri Jan 31 19:16:59 2003 -+++ gcc-20030210/config-ml.in Sat Feb 22 01:40:14 2003 -@@ -545,6 +545,7 @@ - if [ -d ../$${dir}/$${lib} ]; then \ - flags=`echo $$i | sed -e 's/^[^;]*;//' -e 's/@/ -/g'`; \ - if (cd ../$${dir}/$${lib}; $(MAKE) $(FLAGS_TO_PASS) \ -+ DESTDIR="$(DESTDIR)" \ - CFLAGS="$(CFLAGS) $${flags}" \ - prefix="$(prefix)" \ - exec_prefix="$(exec_prefix)" \ -diff -ruN gcc-20030210.orig/debian/edit-specs.in gcc-20030210/debian/edit-specs.in ---- gcc-20030210.orig/debian/edit-specs.in Thu Jan 1 09:00:00 1970 -+++ gcc-20030210/debian/edit-specs.in Sat Feb 22 01:40:14 2003 -@@ -0,0 +1,45 @@ -+/^*asm:$/ { -+n -+c\ -+@AS_ENDIAN_FLAG@ %{mrelax:-relax} -+} -+/^*cpp:$/ { -+n -+c\ -+%(cpp_default_cpu_spec) %(subtarget_cpp_spec) %(subtarget_cpp_ptr_spec) %(subtarget_cpp_endian_spec) -+} -+/^*cc1:$/ { -+n -+c\ -+-musermode @CC1_CPU_ENDIAN_FLAGS@ %{profile:-p} -+} -+/^*link:$/ { -+n -+c\ -+%{!static:--eh-frame-hdr} @LINKER_CPU_ENDIAN_FLAGS@ @LINKER_RPATH_LINK_FLAG@ %{mrelax:-relax} %{shared:-shared} %{!static: %{rdynamic:-export-dynamic} %{!dynamic-linker:-dynamic-linker /lib/ld-linux.so.2}} %{static:-static} -+} -+/^*multilib:$/ { -+n -+c\ -+. ; -+} -+/^*multilib_matches:$/ { -+n -+c\ -+ -+} -+/^*multilib_options:$/ { -+n -+c\ -+ -+} -+/^*subtarget_cpp_endian_spec:$/ { -+n -+c\ -+@CPP_ENDIAN_DEF@ -+} -+/^*cpp_default_cpu_spec:$/ { -+n -+c\ -+@CPP_CPU_DEFS@ -+} -diff -ruN gcc-20030210.orig/debian/install-CPU-linux gcc-20030210/debian/install-CPU-linux ---- gcc-20030210.orig/debian/install-CPU-linux Thu Jan 1 09:00:00 1970 -+++ gcc-20030210/debian/install-CPU-linux Sat Feb 22 01:40:14 2003 -@@ -0,0 +1,111 @@ -+#! /bin/sh -+ -+VERSION=$1; shift -+CPU=$1 -+ -+# literally (binary-ly) same -+PROGS_C="cpp gcc" -+PROGS_ADDITIONAL="c++ g++ g77 gcj" -+ -+DRIVERS_C="cc1 cpp0 tradcpp0" -+DRIVERS_ADDITIONAL="cc1obj cc1plus collect2 f771 jc1 jvgenmain" -+if [ -z "$STEP1_COMPILER_BUILD" ]; then -+ PROGS="$PROGS_C $PROGS_ADDITIONAL" -+ DRIVERS="$DRIVERS_C $DRIVERSADDITIONAL" -+ INITIAL="" -+else -+ PROGS=$PROGS_C -+ DRIVERS=$DRIVERS_C -+ INITIAL="-initial" -+fi -+ -+OBJS="crtbegin.o crtbeginS.o crtend.o crtendS.o" -+LIBS_C="libgcc.a" -+LIBS_1="libgcc_s.so libgcc_s.so.1 libstdc++.so libstdc++.so.3 libstdc++.so.3.0.2" -+LIBS_2="libobjc.a libstdc++.a libsupc++.a" -+INCLUDE="include" -+ -+cd debian/gcc-sh-linux-others${INITIAL} || exit 1 -+ -+# Make directories. -+mkdir -p usr/bin usr/share usr/share/man usr/share/man/man1 usr/lib \ -+ usr/lib/gcc-lib usr/lib/gcc-lib/${CPU}-linux \ -+ usr/lib/gcc-lib/${CPU}-linux/${VERSION} \ -+ usr/${CPU}-linux usr/${CPU}-linux/lib -+ -+# Make symbolic links for include dir. -+(cd usr/${CPU}-linux; ln -s ../sh-linux/include .) -+ -+# Make symbolic links for executables. -+(cd usr/bin; -+ for p in ${PROGS}; do -+ ln -s shCPU-linux-GCC ${CPU}-linux-$p -+ done) -+ -+case "${CPU}" in -+ sh3) -+ MULTILIBDIR= -+ AS_ENDIAN_FLAG="-little" -+ CPP_ENDIAN_DEF="-D__LITTLE_ENDIAN__" -+ CPP_CPU_DEFS="-D__SH3__ -D__sh3__" -+ CC1_CPU_ENDIAN_FLAGS="-ml -m3" -+ LINKER_CPU_ENDIAN_FLAGS="-m shlelf_linux -EL --architecture sh3" -+ LINKER_RPATH_LINK_FLAG="-rpath-link /usr/sh3-linux/lib" -+ ;; -+ sh3eb) -+ MULTILIBDIR=/mb -+ AS_ENDIAN_FLAG="-big" -+ CPP_ENDIAN_DEF="-D__BIG_ENDIAN__" -+ CPP_CPU_DEFS="-D__SH3__ -D__sh3__" -+ CC1_CPU_ENDIAN_FLAGS="-mb -m3" -+ LINKER_CPU_ENDIAN_FLAGS="-m shelf_linux -EB --architecture sh3" -+ LINKER_RPATH_LINK_FLAG="-rpath-link /usr/sh3eb-linux/lib" -+ ;; -+ sh4) -+ MULTILIBDIR=/m4 -+ AS_ENDIAN_FLAG="-little" -+ CPP_ENDIAN_DEF="-D__LITTLE_ENDIAN__" -+ CPP_CPU_DEFS="-D__SH4__" -+ CC1_CPU_ENDIAN_FLAGS="-ml -m4" -+ LINKER_CPU_ENDIAN_FLAGS="-m shlelf_linux -EL --architecture sh4" -+ LINKER_RPATH_LINK_FLAG="-rpath-link /usr/sh4-linux/lib" -+ ;; -+ sh4eb) -+ MULTILIBDIR=/mb/m4 -+ AS_ENDIAN_FLAG="-big" -+ CPP_ENDIAN_DEF="-D__BIG_ENDIAN__" -+ CPP_CPU_DEFS="-D__SH4__" -+ CC1_CPU_ENDIAN_FLAGS="-mb -m4" -+ LINKER_CPU_ENDIAN_FLAGS="-m shelf_linux -EB --architecture sh4" -+ LINKER_RPATH_LINK_FLAG="-rpath-link /usr/sh4eb-linux/lib" -+ ;; -+esac -+ -+# Make symbolic links for GCC drivers, objects, libraries, and include dir. -+(cd usr/lib/gcc-lib/${CPU}-linux/${VERSION}; -+ for f in ${DRIVERS} ${INCLUDE}; do -+ ln -s ../../sh-linux/${VERSION}/$f $f; -+ done -+ for f in ${OBJS} ${LIBS_C}; do -+ ln -s ../../sh-linux/${VERSION}${MULTILIBDIR}/$f $f; -+ done) -+ -+if [ -z "$STEP1_COMPILER_BUILD" ]; then -+ for f in ${LIBS_1} ${LIBS_2}; do -+ mv ../gcc-sh-linux/usr/sh-linux/lib${MULTILIBDIR}/$f usr/${CPU}-linux/lib/; -+ done -+fi -+ -+sed -e "s+@AS_ENDIAN_FLAG@+${AS_ENDIAN_FLAG}+" \ -+ -e "s+@CPP_ENDIAN_DEF@+${CPP_ENDIAN_DEF}+" \ -+ -e "s+@CPP_CPU_DEFS@+${CPP_CPU_DEFS}+" \ -+ -e "s+@CC1_CPU_ENDIAN_FLAGS@+${CC1_CPU_ENDIAN_FLAGS}+" \ -+ -e "s+@LINKER_CPU_ENDIAN_FLAGS@+${LINKER_CPU_ENDIAN_FLAGS}+" \ -+ -e "s+@LINKER_RPATH_LINK_FLAG@+${LINKER_RPATH_LINK_FLAG}+" \ -+ ../edit-specs.in >../edit-specs-${CPU}.sed -+ -+sed -f ../edit-specs-${CPU}.sed \ -+ ../gcc-sh-linux${INITIAL}/usr/lib/gcc-lib/sh-linux/${VERSION}/specs \ -+ > usr/lib/gcc-lib/${CPU}-linux/${VERSION}/specs -+ -+exit 0 -diff -ruN gcc-20030210.orig/debian/multilib-symlink gcc-20030210/debian/multilib-symlink ---- gcc-20030210.orig/debian/multilib-symlink Thu Jan 1 09:00:00 1970 -+++ gcc-20030210/debian/multilib-symlink Sat Feb 22 01:40:14 2003 -@@ -0,0 +1,10 @@ -+#! /bin/sh -+ -+cd /usr/sh-linux/lib -+ln -s ../../sh3-linux/lib/{*.a,*.so*,*.o} . -+cd m4 -+ln -s ../../../sh4-linux/lib/{*.a,*.so*,*.o} . -+cd ../mb -+ln -s ../../../sh3eb-linux/lib/{*.a,*.so*,*.o} . -+cd m4 -+ln -s ../../../../sh4eb-linux/lib/{*.a,*.so*,*.o} . -diff -ruN gcc-20030210.orig/debian/shCPU-linux-GCC gcc-20030210/debian/shCPU-linux-GCC ---- gcc-20030210.orig/debian/shCPU-linux-GCC Thu Jan 1 09:00:00 1970 -+++ gcc-20030210/debian/shCPU-linux-GCC Sat Feb 22 01:40:14 2003 -@@ -0,0 +1,59 @@ -+#! /bin/bash -+ -+BASENAME=${0##*/} -+PROG=${BASENAME##*-} -+CPU=${BASENAME%%-*} -+ -+if [ "$PROG" = gcc ]; then -+ if [ "$1" = "-b" -a "$2" = "i386-linux" ]; then -+ shift 2 -+ exec /usr/bin/gcc "$@" -+ elif [ "$1" = "-print-multi-lib" -o "$1" = "--print-multi-lib" ]; then -+ echo ".;" -+ exit 0 -+ elif [ "$1" = "-print-multi-os-directory" -o "$1" = "--print-multi-os-directory" ]; then -+ echo "." -+ exit 0 -+ elif [ "$1" = "-dumpspecs" ]; then -+ cat /usr/lib/gcc-lib/${CPU}-linux/@@VERSION@@/specs -+ exit 0 -+ fi -+fi -+ -+case "${CPU}" in -+ sh3) -+ ARCH=m3 -+ DEFINES="-D__sh3__ -D__SH3__ -D__LITTLE_ENDIAN__" -+ ENDIAN=ml -+ ;; -+ sh3eb) -+ ARCH=m3 -+ DEFINES="-D__sh3__ -D__SH3__ -D__BIG_ENDIAN__" -+ ENDIAN=mb -+ ;; -+ sh4) -+ ARCH=m4 -+ DEFINES="-D__SH4__ -D__LITTLE_ENDIAN__" -+ ENDIAN=ml -+ ;; -+ sh4eb) -+ ARCH=m4 -+ DEFINES="-D__SH4__ -D__BIG_ENDIAN__" -+ ENDIAN=mb -+ ;; -+esac -+ -+# Prepend the appropriate options -+# If user specifies some options, it will be overridden -+ -+case "${PROG}" in -+ cpp) -+ exec sh-linux-${PROG} $DEFINES "$@" -+ ;; -+ c++|g++|g77|gcc|gcj) -+ exec sh-linux-${PROG} -$ARCH -$ENDIAN "$@" -+ ;; -+esac -+ -+echo "Something wrong..." -+exit 1 -diff -ruN gcc-20030210.orig/gcc/config/sh/elf.h gcc-20030210/gcc/config/sh/elf.h ---- gcc-20030210.orig/gcc/config/sh/elf.h Fri Feb 22 01:42:28 2002 -+++ gcc-20030210/gcc/config/sh/elf.h Sat Feb 22 01:40:14 2003 -@@ -170,3 +170,7 @@ - #undef ENDFILE_SPEC - #define ENDFILE_SPEC \ - "%{!shared:crtend.o%s} %{shared:crtendS.o%s} crtn.o%s" -+ -+/* ASM_OUTPUT_CASE_LABEL is defined in elfos.h. With it, -+ redundant .align will be generated. */ -+#undef ASM_OUTPUT_CASE_LABEL -diff -ruN gcc-20030210.orig/gcc/config/sh/lib1funcs.asm gcc-20030210/gcc/config/sh/lib1funcs.asm ---- gcc-20030210.orig/gcc/config/sh/lib1funcs.asm Fri Feb 22 01:42:28 2002 -+++ gcc-20030210/gcc/config/sh/lib1funcs.asm Sat Feb 22 01:40:14 2003 -@@ -39,8 +39,13 @@ - - #ifdef __ELF__ - #define LOCAL(X) .L_##X -+#define FUNC(X) .type X,@function; .hidden X -+#define _ENDFUNC(X) .Lfe_##X: .size X,.Lfe_##X-X -+#define ENDFUNC(X) _ENDFUNC(X) - #else - #define LOCAL(X) L_##X -+#define FUNC(X) -+#define ENDFUNC(X) - #endif - - #ifdef __linux__ -@@ -91,6 +96,40 @@ - .global GLOBAL(ashiftrt_r4_31) - .global GLOBAL(ashiftrt_r4_32) - -+ FUNC(GLOBAL(ashiftrt_r4_0)) -+ FUNC(GLOBAL(ashiftrt_r4_1)) -+ FUNC(GLOBAL(ashiftrt_r4_2)) -+ FUNC(GLOBAL(ashiftrt_r4_3)) -+ FUNC(GLOBAL(ashiftrt_r4_4)) -+ FUNC(GLOBAL(ashiftrt_r4_5)) -+ FUNC(GLOBAL(ashiftrt_r4_6)) -+ FUNC(GLOBAL(ashiftrt_r4_7)) -+ FUNC(GLOBAL(ashiftrt_r4_8)) -+ FUNC(GLOBAL(ashiftrt_r4_9)) -+ FUNC(GLOBAL(ashiftrt_r4_10)) -+ FUNC(GLOBAL(ashiftrt_r4_11)) -+ FUNC(GLOBAL(ashiftrt_r4_12)) -+ FUNC(GLOBAL(ashiftrt_r4_13)) -+ FUNC(GLOBAL(ashiftrt_r4_14)) -+ FUNC(GLOBAL(ashiftrt_r4_15)) -+ FUNC(GLOBAL(ashiftrt_r4_16)) -+ FUNC(GLOBAL(ashiftrt_r4_17)) -+ FUNC(GLOBAL(ashiftrt_r4_18)) -+ FUNC(GLOBAL(ashiftrt_r4_19)) -+ FUNC(GLOBAL(ashiftrt_r4_20)) -+ FUNC(GLOBAL(ashiftrt_r4_21)) -+ FUNC(GLOBAL(ashiftrt_r4_22)) -+ FUNC(GLOBAL(ashiftrt_r4_23)) -+ FUNC(GLOBAL(ashiftrt_r4_24)) -+ FUNC(GLOBAL(ashiftrt_r4_25)) -+ FUNC(GLOBAL(ashiftrt_r4_26)) -+ FUNC(GLOBAL(ashiftrt_r4_27)) -+ FUNC(GLOBAL(ashiftrt_r4_28)) -+ FUNC(GLOBAL(ashiftrt_r4_29)) -+ FUNC(GLOBAL(ashiftrt_r4_30)) -+ FUNC(GLOBAL(ashiftrt_r4_31)) -+ FUNC(GLOBAL(ashiftrt_r4_32)) -+ - .align 1 - GLOBAL(ashiftrt_r4_32): - GLOBAL(ashiftrt_r4_31): -@@ -170,6 +209,41 @@ - GLOBAL(ashiftrt_r4_0): - rts - nop -+ -+ ENDFUNC(GLOBAL(ashiftrt_r4_0)) -+ ENDFUNC(GLOBAL(ashiftrt_r4_1)) -+ ENDFUNC(GLOBAL(ashiftrt_r4_2)) -+ ENDFUNC(GLOBAL(ashiftrt_r4_3)) -+ ENDFUNC(GLOBAL(ashiftrt_r4_4)) -+ ENDFUNC(GLOBAL(ashiftrt_r4_5)) -+ ENDFUNC(GLOBAL(ashiftrt_r4_6)) -+ ENDFUNC(GLOBAL(ashiftrt_r4_7)) -+ ENDFUNC(GLOBAL(ashiftrt_r4_8)) -+ ENDFUNC(GLOBAL(ashiftrt_r4_9)) -+ ENDFUNC(GLOBAL(ashiftrt_r4_10)) -+ ENDFUNC(GLOBAL(ashiftrt_r4_11)) -+ ENDFUNC(GLOBAL(ashiftrt_r4_12)) -+ ENDFUNC(GLOBAL(ashiftrt_r4_13)) -+ ENDFUNC(GLOBAL(ashiftrt_r4_14)) -+ ENDFUNC(GLOBAL(ashiftrt_r4_15)) -+ ENDFUNC(GLOBAL(ashiftrt_r4_16)) -+ ENDFUNC(GLOBAL(ashiftrt_r4_17)) -+ ENDFUNC(GLOBAL(ashiftrt_r4_18)) -+ ENDFUNC(GLOBAL(ashiftrt_r4_19)) -+ ENDFUNC(GLOBAL(ashiftrt_r4_20)) -+ ENDFUNC(GLOBAL(ashiftrt_r4_21)) -+ ENDFUNC(GLOBAL(ashiftrt_r4_22)) -+ ENDFUNC(GLOBAL(ashiftrt_r4_23)) -+ ENDFUNC(GLOBAL(ashiftrt_r4_24)) -+ ENDFUNC(GLOBAL(ashiftrt_r4_25)) -+ ENDFUNC(GLOBAL(ashiftrt_r4_26)) -+ ENDFUNC(GLOBAL(ashiftrt_r4_27)) -+ ENDFUNC(GLOBAL(ashiftrt_r4_28)) -+ ENDFUNC(GLOBAL(ashiftrt_r4_29)) -+ ENDFUNC(GLOBAL(ashiftrt_r4_30)) -+ ENDFUNC(GLOBAL(ashiftrt_r4_31)) -+ ENDFUNC(GLOBAL(ashiftrt_r4_32)) -+ - #endif - - #ifdef L_ashiftrt_n -@@ -192,6 +266,7 @@ - ! - - .global GLOBAL(ashrsi3) -+ FUNC(GLOBAL(ashrsi3)) - .align 2 - GLOBAL(ashrsi3): - mov #31,r0 -@@ -319,6 +394,8 @@ - rts - nop - -+ ENDFUNC(GLOBAL(ashrsi3)) -+ - #endif - - #ifdef L_ashiftlt -@@ -340,6 +417,7 @@ - ! (none) - ! - .global GLOBAL(ashlsi3) -+ FUNC(GLOBAL(ashlsi3)) - .align 2 - GLOBAL(ashlsi3): - mov #31,r0 -@@ -476,6 +554,8 @@ - rts - nop - -+ ENDFUNC(GLOBAL(ashlsi3)) -+ - #endif - - #ifdef L_lshiftrt -@@ -497,6 +577,7 @@ - ! (none) - ! - .global GLOBAL(lshrsi3) -+ FUNC(GLOBAL(lshrsi3)) - .align 2 - GLOBAL(lshrsi3): - mov #31,r0 -@@ -633,6 +714,8 @@ - rts - nop - -+ ENDFUNC(GLOBAL(lshrsi3)) -+ - #endif - - #ifdef L_movstr -@@ -649,76 +732,113 @@ - add #64,r4 - .align 4 - .global GLOBAL(movstrSI64) -+ FUNC(GLOBAL(movstrSI64)) - GLOBAL(movstrSI64): - mov.l @(60,r5),r0 - mov.l r0,@(60,r4) - .global GLOBAL(movstrSI60) -+ FUNC(GLOBAL(movstrSI60)) - GLOBAL(movstrSI60): - mov.l @(56,r5),r0 - mov.l r0,@(56,r4) - .global GLOBAL(movstrSI56) -+ FUNC(GLOBAL(movstrSI56)) - GLOBAL(movstrSI56): - mov.l @(52,r5),r0 - mov.l r0,@(52,r4) - .global GLOBAL(movstrSI52) -+ FUNC(GLOBAL(movstrSI52)) - GLOBAL(movstrSI52): - mov.l @(48,r5),r0 - mov.l r0,@(48,r4) - .global GLOBAL(movstrSI48) -+ FUNC(GLOBAL(movstrSI48)) - GLOBAL(movstrSI48): - mov.l @(44,r5),r0 - mov.l r0,@(44,r4) - .global GLOBAL(movstrSI44) -+ FUNC(GLOBAL(movstrSI44)) - GLOBAL(movstrSI44): - mov.l @(40,r5),r0 - mov.l r0,@(40,r4) - .global GLOBAL(movstrSI40) -+ FUNC(GLOBAL(movstrSI40)) - GLOBAL(movstrSI40): - mov.l @(36,r5),r0 - mov.l r0,@(36,r4) - .global GLOBAL(movstrSI36) -+ FUNC(GLOBAL(movstrSI36)) - GLOBAL(movstrSI36): - mov.l @(32,r5),r0 - mov.l r0,@(32,r4) - .global GLOBAL(movstrSI32) -+ FUNC(GLOBAL(movstrSI32)) - GLOBAL(movstrSI32): - mov.l @(28,r5),r0 - mov.l r0,@(28,r4) - .global GLOBAL(movstrSI28) -+ FUNC(GLOBAL(movstrSI28)) - GLOBAL(movstrSI28): - mov.l @(24,r5),r0 - mov.l r0,@(24,r4) - .global GLOBAL(movstrSI24) -+ FUNC(GLOBAL(movstrSI24)) - GLOBAL(movstrSI24): - mov.l @(20,r5),r0 - mov.l r0,@(20,r4) - .global GLOBAL(movstrSI20) -+ FUNC(GLOBAL(movstrSI20)) - GLOBAL(movstrSI20): - mov.l @(16,r5),r0 - mov.l r0,@(16,r4) - .global GLOBAL(movstrSI16) -+ FUNC(GLOBAL(movstrSI16)) - GLOBAL(movstrSI16): - mov.l @(12,r5),r0 - mov.l r0,@(12,r4) - .global GLOBAL(movstrSI12) -+ FUNC(GLOBAL(movstrSI12)) - GLOBAL(movstrSI12): - mov.l @(8,r5),r0 - mov.l r0,@(8,r4) - .global GLOBAL(movstrSI8) -+ FUNC(GLOBAL(movstrSI8)) - GLOBAL(movstrSI8): - mov.l @(4,r5),r0 - mov.l r0,@(4,r4) - .global GLOBAL(movstrSI4) -+ FUNC(GLOBAL(movstrSI4)) - GLOBAL(movstrSI4): - mov.l @(0,r5),r0 - mov.l r0,@(0,r4) -+ .global GLOBAL(movstrSI0) -+ FUNC(GLOBAL(movstrSI0)) - GLOBAL(movstrSI0): - rts - nop - -+ ENDFUNC(GLOBAL(movstrSI64)) -+ ENDFUNC(GLOBAL(movstrSI60)) -+ ENDFUNC(GLOBAL(movstrSI56)) -+ ENDFUNC(GLOBAL(movstrSI52)) -+ ENDFUNC(GLOBAL(movstrSI48)) -+ ENDFUNC(GLOBAL(movstrSI44)) -+ ENDFUNC(GLOBAL(movstrSI40)) -+ ENDFUNC(GLOBAL(movstrSI36)) -+ ENDFUNC(GLOBAL(movstrSI32)) -+ ENDFUNC(GLOBAL(movstrSI28)) -+ ENDFUNC(GLOBAL(movstrSI24)) -+ ENDFUNC(GLOBAL(movstrSI20)) -+ ENDFUNC(GLOBAL(movstrSI16)) -+ ENDFUNC(GLOBAL(movstrSI12)) -+ ENDFUNC(GLOBAL(movstrSI8)) -+ ENDFUNC(GLOBAL(movstrSI4)) -+ ENDFUNC(GLOBAL(movstrSI0)) -+ - .align 4 - - .global GLOBAL(movstr) -+ FUNC(GLOBAL(movstr)) - GLOBAL(movstr): - mov.l @(60,r5),r0 - mov.l r0,@(60,r4) -@@ -775,6 +895,8 @@ - add #64,r5 - bra GLOBAL(movstr) - add #64,r4 -+ -+ FUNC(GLOBAL(movstr)) - #endif - - #ifdef L_movstr_i4 -@@ -783,6 +905,10 @@ - .global GLOBAL(movstr_i4_odd) - .global GLOBAL(movstrSI12_i4) - -+ FUNC(GLOBAL(movstr_i4_even)) -+ FUNC(GLOBAL(movstr_i4_odd)) -+ FUNC(GLOBAL(movstrSI12_i4)) -+ - .p2align 5 - L_movstr_2mod4_end: - mov.l r0,@(16,r4) -@@ -791,6 +917,11 @@ - - .p2align 2 - -+GLOBAL(movstr_i4_even): -+ mov.l @r5+,r0 -+ bra L_movstr_start_even -+ mov.l @r5+,r1 -+ - GLOBAL(movstr_i4_odd): - mov.l @r5+,r1 - add #-4,r4 -@@ -817,10 +948,8 @@ - rts - mov.l r3,@(12,r4) - --GLOBAL(movstr_i4_even): -- mov.l @r5+,r0 -- bra L_movstr_start_even -- mov.l @r5+,r1 -+ ENDFUNC(GLOBAL(movstr_i4_even)) -+ ENDFUNC(GLOBAL(movstr_i4_odd)) - - .p2align 4 - GLOBAL(movstrSI12_i4): -@@ -831,12 +960,16 @@ - mov.l r1,@(4,r4) - rts - mov.l r2,@(8,r4) -+ -+ ENDFUNC(GLOBAL(movstrSI12_i4)) -+ - #endif - - #ifdef L_mulsi3 - - - .global GLOBAL(mulsi3) -+ FUNC(GLOBAL(mulsi3)) - - ! r4 = aabb - ! r5 = ccdd -@@ -869,7 +1002,7 @@ - rts - add r2,r0 - -- -+ FUNC(GLOBAL(mulsi3)) - #endif - #endif /* ! __SH5__ */ - #ifdef L_sdivsi3_i4 -@@ -879,6 +1012,7 @@ - !! args in r4 and r5, result in fpul, clobber dr0, dr2 - - .global GLOBAL(sdivsi3_i4) -+ FUNC(GLOBAL(sdivsi3_i4)) - GLOBAL(sdivsi3_i4): - lds r4,fpul - float fpul,dr0 -@@ -888,6 +1022,8 @@ - rts - ftrc dr0,fpul - -+ ENDFUNC(GLOBAL(sdivsi3_i4)) -+ - #elif defined(__SH4_SINGLE__) || defined(__SH4_SINGLE_ONLY__) || (defined (__SH5__) && ! defined __SH4_NOFPU__) - !! args in r4 and r5, result in fpul, clobber r2, dr0, dr2 - -@@ -896,6 +1032,7 @@ - .mode SHcompact - #endif - .global GLOBAL(sdivsi3_i4) -+ FUNC(GLOBAL(sdivsi3_i4)) - GLOBAL(sdivsi3_i4): - sts.l fpscr,@-r15 - mov #8,r2 -@@ -910,6 +1047,8 @@ - rts - lds.l @r15+,fpscr - -+ ENDFUNC(GLOBAL(sdivsi3_i4)) -+ - #endif /* ! __SH5__ || __SH5__ == 32 */ - #endif /* ! __SH4__ */ - #endif -@@ -924,9 +1063,10 @@ - !! - !! - --!! args in r4 and r5, result in r0 clobber r1,r2,r3 -+!! args in r4 and r5, result in r0 clobber r1, r2, r3, and t bit - - .global GLOBAL(sdivsi3) -+ FUNC(GLOBAL(sdivsi3)) - #if __SHMEDIA__ - #if __SH5__ == 32 - .section .text..SHmedia32,"ax" -@@ -1076,6 +1216,7 @@ - div0: rts - mov #0,r0 - -+ ENDFUNC(GLOBAL(sdivsi3)) - #endif /* ! __SHMEDIA__ */ - #endif /* ! __SH4__ */ - #endif -@@ -1084,9 +1225,11 @@ - .title "SH DIVIDE" - !! 4 byte integer Divide code for the Hitachi SH - #ifdef __SH4__ --!! args in r4 and r5, result in fpul, clobber r0, r1, r4, r5, dr0, dr2, dr4 -+!! args in r4 and r5, result in fpul, clobber r0, r1, r4, r5, dr0, dr2, dr4, -+!! and t bit - - .global GLOBAL(udivsi3_i4) -+ FUNC(GLOBAL(udivsi3_i4)) - GLOBAL(udivsi3_i4): - mov #1,r1 - cmp/hi r1,r5 -@@ -1127,6 +1270,8 @@ - L1: - .double 2147483648 - -+ ENDFUNC(GLOBAL(udivsi3_i4)) -+ - #elif defined(__SH4_SINGLE__) || defined(__SH4_SINGLE_ONLY__) || (defined (__SH5__) && ! defined __SH4_NOFPU__) - !! args in r4 and r5, result in fpul, clobber r0, r1, r4, r5, dr0, dr2, dr4 - -@@ -1135,6 +1280,7 @@ - .mode SHcompact - #endif - .global GLOBAL(udivsi3_i4) -+ FUNC(GLOBAL(udivsi3_i4)) - GLOBAL(udivsi3_i4): - mov #1,r1 - cmp/hi r1,r5 -@@ -1183,6 +1329,8 @@ - #endif - .double 2147483648 - -+ ENDFUNC(GLOBAL(udivsi3_i4)) -+ - #endif /* ! __SH5__ || __SH5__ == 32 */ - #endif /* ! __SH4__ */ - #endif -@@ -1199,6 +1347,7 @@ - - !! args in r4 and r5, result in r0, clobbers r4, pr, and t bit - .global GLOBAL(udivsi3) -+ FUNC(GLOBAL(udivsi3)) - - #if __SHMEDIA__ - #if __SH5__ == 32 -@@ -1299,6 +1448,8 @@ - ret: rts - mov r4,r0 - -+ ENDFUNC(GLOBAL(udivsi3)) -+ - #endif /* ! __SHMEDIA__ */ - #endif /* __SH4__ */ - #endif -@@ -1308,6 +1459,7 @@ - .mode SHcompact - #endif - .global GLOBAL(set_fpscr) -+ FUNC(GLOBAL(set_fpscr)) - GLOBAL(set_fpscr): - lds r4,fpscr - mov.l LOCAL(set_fpscr_L1),r1 -@@ -1340,11 +1492,16 @@ - .align 2 - LOCAL(set_fpscr_L1): - .long GLOBAL(fpscr_values) -+ -+ ENDFUNC(GLOBAL(set_fpscr)) -+ -+#ifndef NO_FPSCR_VALUES - #ifdef __ELF__ - .comm GLOBAL(fpscr_values),8,4 - #else - .comm GLOBAL(fpscr_values),8 - #endif /* ELF */ -+#endif /* NO_FPSCR_VALUES */ - #endif /* SH3E / SH4 */ - #endif /* L_set_fpscr */ - #ifdef L_ic_invalidate -@@ -1360,6 +1517,7 @@ - blink tr0, r63 - #elif defined(__SH4_SINGLE__) || defined(__SH4__) || defined(__SH4_SINGLE_ONLY__) - .global GLOBAL(ic_invalidate) -+ FUNC(GLOBAL(ic_invalidate)) - GLOBAL(ic_invalidate): - ocbwb @r4 - mova 0f,r0 -@@ -1382,6 +1540,9 @@ - nop - .endr - .endr -+ -+ ENDFUNC(GLOBAL(ic_invalidate)) -+ - #endif /* SH4 */ - #endif /* L_ic_invalidate */ - -diff -ruN gcc-20030210.orig/gcc/config/sh/libgcc-glibc.ver gcc-20030210/gcc/config/sh/libgcc-glibc.ver ---- gcc-20030210.orig/gcc/config/sh/libgcc-glibc.ver Thu Jan 1 09:00:00 1970 -+++ gcc-20030210/gcc/config/sh/libgcc-glibc.ver Sat Feb 22 01:40:14 2003 -@@ -0,0 +1,21 @@ -+# In order to work around the very problems that force us to now generally -+# create a libgcc.so, glibc reexported a number of routines from libgcc.a. -+# By now choosing the same version tags for these specific routines, we -+# maintain enough binary compatibility to allow future versions of glibc -+# to defer implementation of these routines to libgcc.so via DT_AUXILIARY. -+ -+# Note that we cannot use the default libgcc-glibc.ver file on sh, -+# because GLIBC_2.0 does not exist on this architecture, as the first -+# ever glibc release on the platform was GLIBC_2.2. -+ -+%inherit GCC_3.0 GLIBC_2.2 -+GLIBC_2.2 { -+ __register_frame -+ __register_frame_table -+ __deregister_frame -+ __register_frame_info -+ __deregister_frame_info -+ __frame_state_for -+ __register_frame_info_table -+} -+ -diff -ruN gcc-20030210.orig/gcc/config/sh/linux.h gcc-20030210/gcc/config/sh/linux.h ---- gcc-20030210.orig/gcc/config/sh/linux.h Tue Apr 16 05:27:42 2002 -+++ gcc-20030210/gcc/config/sh/linux.h Sat Feb 22 01:40:14 2003 -@@ -19,6 +19,10 @@ - the Free Software Foundation, 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. */ - -+/* We're not SYSVR4, not having /usr/ccs */ -+#undef MD_EXEC_PREFIX -+#undef MD_STARTFILE_PREFIX -+ - /* Run-time Target Specification. */ - #undef TARGET_VERSION - #define TARGET_VERSION fputs (" (SH GNU/Linux with ELF)", stderr); -@@ -39,6 +43,28 @@ - #undef WCHAR_TYPE_SIZE - #define WCHAR_TYPE_SIZE BITS_PER_WORD - -+/* This was defined in linux.h. Define it here also. */ -+#undef DEFAULT_VTABLE_THUNKS -+#define DEFAULT_VTABLE_THUNKS 1 -+ -+/* Likewise. */ -+#define HANDLE_PRAGMA_PACK_PUSH_POP -+ -+/* Pick up the return address upon entry to a procedure. Used for -+ dwarf2 unwind information. This also enables the table driven -+ mechanism. */ -+ -+#define INCOMING_RETURN_ADDR_RTX gen_rtx_REG (Pmode, PR_REG) -+#define DWARF_FRAME_RETURN_COLUMN DWARF_FRAME_REGNUM (PR_REG) -+ -+#undef CPP_SPEC -+#define CPP_SPEC "\ -+ %{m4:-D__SH4__} \ -+ %{!m4:%(cpp_default_cpu_spec)} \ -+ %(subtarget_cpp_spec) \ -+ %(subtarget_cpp_ptr_spec) \ -+ %(subtarget_cpp_endian_spec) " -+ - #undef SUBTARGET_CPP_SPEC - #define SUBTARGET_CPP_SPEC "\ - %{fPIC:-D__PIC__ -D__pic__} \ -@@ -55,36 +81,45 @@ - #undef CPP_DEFAULT_CPU_SPEC - #define CPP_DEFAULT_CPU_SPEC "-D__SH3__ -D__sh3__" - -- - #undef CPP_PREDEFINES - #define CPP_PREDEFINES "-D__ELF__ -Dunix -D__sh__ -D__gnu_linux__ -Dlinux -Asystem=posix" - -+/* The GNU C++ standard library requires that these macros be defined. */ -+#undef CPLUSPLUS_CPP_SPEC -+#define CPLUSPLUS_CPP_SPEC "-D_GNU_SOURCE %(cpp)" -+ - #undef ASM_SPEC --#define ASM_SPEC "%{!mb:-little} %{mrelax:-relax}" -+#define ASM_SPEC "%{mb:-big} %{!mb:-little} %{mrelax:-relax}" - - #undef CC1_SPEC - #define CC1_SPEC \ -- "-musermode %{!mb:-ml} %{!m3e:%{!m4:-m3}}" -- --#undef CC1PLUS_SPEC --#define CC1PLUS_SPEC \ -- "-musermode %{!mb:-ml} %{!m3e:%{!m4:-m3}}" -+ "-musermode %{!mb:-ml} %{!m4:-m3} %{profile:-p}" - -+/* XXX: It's wrong if prefix != /usr */ - #undef LINK_SPEC - #define LINK_SPEC \ -- "%{!mb:-m shlelf_linux} %{mrelax:-relax} \ -+ "%{!mb:-m shlelf_linux -EL} %{mb:-m shelf_linux -EB} %{mrelax:-relax} \ - %{shared:-shared} \ - %{!static: \ - %{rdynamic:-export-dynamic} \ - %{!dynamic-linker:-dynamic-linker /lib/ld-linux.so.2} \ -- %{!rpath:-rpath /lib}} \ -+ %{!mb:%{!m4:-rpath-link /usr/sh-linux/lib }} \ -+ %{!mb:%{m4:-rpath-link /usr/sh-linux/lib/m4 }} \ -+ %{mb:%{!m4:-rpath-link /usr/sh-linux/lib/mb }} \ -+ %{mb:%{m4:-rpath-link /usr/sh-linux/lib/mb/m4 }}} \ - %{static:-static}" - - #undef LIB_SPEC -+#undef LIB_SPEC - #define LIB_SPEC \ - "%{shared: -lc} \ -- %{!shared: %{pthread:-lthread} \ -- %{profile:-lc_p} %{!profile: -lc}}" -+ %{!shared: %{mieee:-lieee} %{pthread:-lpthread} \ -+ %{profile:-lc_p} %{!profile: -lc}}" -+ -+#if defined(HAVE_LD_EH_FRAME_HDR) -+#undef LINK_EH_SPEC -+#define LINK_EH_SPEC "%{!static:--eh-frame-hdr} " -+#endif - - #undef STARTFILE_SPEC - #define STARTFILE_SPEC \ -@@ -92,4 +127,40 @@ - %{pg:gcrt1.o%s} %{!pg:%{p:gcrt1.o%s} \ - %{!p:%{profile:gcrt1.o%s} \ - %{!profile:crt1.o%s}}}} \ -- crti.o%s %{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s}" -+ crti.o%s %{static:crtbeginT.o%s}\ -+ %{!static:%{!shared:crtbegin.o%s} %{shared:crtbeginS.o%s}}" -+ -+#undef FUNCTION_PROFILER -+#define FUNCTION_PROFILER(STREAM,LABELNO) \ -+do \ -+{ \ -+ if (flag_pic) \ -+ { \ -+ fprintf (STREAM, " mov.l 3f,r1\n"); \ -+ fprintf (STREAM, " mova 3f,r0\n"); \ -+ fprintf (STREAM, " add r1,r0\n"); \ -+ fprintf (STREAM, " mov.l 1f,r1\n"); \ -+ fprintf (STREAM, " mov.l @(r0,r1),r1\n"); \ -+ } \ -+ else \ -+ { \ -+ fprintf (STREAM, " mov.l 1f,r1\n"); \ -+ } \ -+ fprintf (STREAM, " sts.l pr,@-r15\n"); \ -+ fprintf (STREAM, " mova 2f,r0\n"); \ -+ fprintf (STREAM, " jmp @r1\n"); \ -+ fprintf (STREAM, " lds r0,pr\n"); \ -+ fprintf (STREAM, " .align 2\n"); \ -+ if (flag_pic) \ -+ { \ -+ fprintf (STREAM, "1: .long mcount@GOT\n"); \ -+ fprintf (STREAM, "3: .long _GLOBAL_OFFSET_TABLE_\n"); \ -+ } \ -+ else \ -+ { \ -+ fprintf (STREAM, "1: .long mcount\n"); \ -+ } \ -+ fprintf (STREAM, "2: lds.l @r15+,pr\n"); \ -+} while (0) -+ -+#define NO_SHARED_LIBGCC_MULTILIB -diff -ruN gcc-20030210.orig/gcc/config/sh/sh-protos.h gcc-20030210/gcc/config/sh/sh-protos.h ---- gcc-20030210.orig/gcc/config/sh/sh-protos.h Fri Feb 22 01:42:28 2002 -+++ gcc-20030210/gcc/config/sh/sh-protos.h Sat Feb 22 01:40:14 2003 -@@ -74,6 +74,7 @@ - extern int shl_sext_length PARAMS ((rtx)); - extern int gen_shl_sext PARAMS ((rtx, rtx, rtx, rtx)); - extern rtx gen_datalabel_ref PARAMS ((rtx)); -+extern int shl_casesi_worker_length PARAMS ((rtx)); - extern int regs_used PARAMS ((rtx, int)); - extern void fixup_addr_diff_vecs PARAMS ((rtx)); - extern int get_dest_uid PARAMS ((rtx, int)); -diff -ruN gcc-20030210.orig/gcc/config/sh/sh.c gcc-20030210/gcc/config/sh/sh.c ---- gcc-20030210.orig/gcc/config/sh/sh.c Fri Feb 22 01:42:28 2002 -+++ gcc-20030210/gcc/config/sh/sh.c Sat Feb 22 01:40:14 2003 -@@ -2143,6 +2143,48 @@ - return sym; - } - -+ -+/* Function to be used in the length attribute of the casesi_worker -+ instruction. Returns number of instructions, which is half of the -+ length of bytes. */ -+ -+int -+shl_casesi_worker_length (insn) -+ rtx insn; -+{ -+ rtx set_src, label; -+ rtx diff_vec; -+ -+ set_src = SET_SRC (XVECEXP (PATTERN (insn), 0, 0)); -+ if (!(GET_CODE (set_src) == UNSPEC -+ && XINT (set_src, 1) == UNSPEC_CASESI)) -+ abort (); -+ -+ label = XVECEXP (set_src, 0, 2); -+ if (GET_CODE (label) != LABEL_REF) -+ abort (); -+ -+ diff_vec = PATTERN (next_real_insn (XEXP (label, 0))); -+ -+ if (GET_CODE (diff_vec) != ADDR_DIFF_VEC) -+ abort (); -+ -+ switch (GET_MODE (diff_vec)) -+ { -+ case SImode: -+ return 2; -+ case HImode: -+ if (ADDR_DIFF_VEC_FLAGS (diff_vec).offset_unsigned) -+ return 3; -+ return 2; -+ case QImode: -+ if (ADDR_DIFF_VEC_FLAGS (diff_vec).offset_unsigned) -+ return 2; -+ return 1; -+ default: -+ abort (); -+ } -+} - - /* The SH cannot load a large constant into a register, constants have to - come from a pc relative load. The reference of a pc relative load -@@ -3190,7 +3232,7 @@ - vec_lab = XEXP (XEXP (pat, 0), 0); - - /* Search the matching casesi_jump_2. */ -- for (prev = vec_lab; ; prev = PREV_INSN (prev)) -+ for (prev = vec_lab; prev; prev = PREV_INSN (prev)) - { - if (GET_CODE (prev) != JUMP_INSN) - continue; -@@ -3205,6 +3247,13 @@ - break; - } - -+ if (prev == NULL) -+ { /* Switch statement has been optimized out. */ -+ delete_insn (PREV_INSN (insn)); -+ delete_insn (insn); -+ continue; -+ } -+ - /* Emit the reference label of the braf where it belongs, right after - the casesi_jump_2 (i.e. braf). */ - braf_label = XEXP (XEXP (SET_SRC (XVECEXP (prevpat, 0, 0)), 1), 0); -@@ -3223,7 +3272,7 @@ - rtx barrier_or_label; - { - rtx next = next_real_insn (barrier_or_label), pat, prev; -- int slot, credit, jump_to_next; -+ int slot, credit, jump_to_next = 0; - - if (! next) - return 0; -@@ -4507,7 +4556,8 @@ - if (current_function_varargs || current_function_stdarg) - { - /* This is not used by the SH3E calling convention */ -- if (TARGET_SH1 && ! TARGET_SH3E && ! TARGET_SH5 && ! TARGET_HITACHI) -+ if (TARGET_SH1 && ! TARGET_SH3E && ! TARGET_SH5 && ! TARGET_HITACHI -+ || TARGET_NO_IMPLICIT_FP) - { - /* Push arg regs as if they'd been provided by caller in stack. */ - for (i = 0; i < NPARM_REGS(SImode); i++) -@@ -5149,7 +5199,8 @@ - tree f_next_o, f_next_o_limit, f_next_fp, f_next_fp_limit, f_next_stack; - tree record; - -- if (TARGET_SH5 || (! TARGET_SH3E && ! TARGET_SH4) || TARGET_HITACHI) -+ if (TARGET_SH5 || (! TARGET_SH3E && ! TARGET_SH4) || TARGET_HITACHI -+ || TARGET_NO_IMPLICIT_FP) - return ptr_type_node; - - record = make_node (RECORD_TYPE); -@@ -5211,7 +5262,8 @@ - return; - } - -- if ((! TARGET_SH3E && ! TARGET_SH4) || TARGET_HITACHI) -+ if ((! TARGET_SH3E && ! TARGET_SH4) -+ || TARGET_HITACHI || TARGET_NO_IMPLICIT_FP) - { - std_expand_builtin_va_start (stdarg_p, valist, nextarg); - return; -@@ -5289,7 +5341,8 @@ - rsize = (size + UNITS_PER_WORD - 1) & -UNITS_PER_WORD; - pptr_type_node = build_pointer_type (ptr_type_node); - -- if (! TARGET_SH5 && (TARGET_SH3E || TARGET_SH4) && ! TARGET_HITACHI) -+ if (! TARGET_SH5 && (TARGET_SH3E || TARGET_SH4) -+ && ! TARGET_HITACHI && ! TARGET_NO_IMPLICIT_FP) - { - tree f_next_o, f_next_o_limit, f_next_fp, f_next_fp_limit, f_next_stack; - tree next_o, next_o_limit, next_fp, next_fp_limit, next_stack; -diff -ruN gcc-20030210.orig/gcc/config/sh/sh.h gcc-20030210/gcc/config/sh/sh.h ---- gcc-20030210.orig/gcc/config/sh/sh.h Fri Feb 22 01:42:28 2002 -+++ gcc-20030210/gcc/config/sh/sh.h Sat Feb 22 01:40:14 2003 -@@ -147,10 +147,10 @@ - #define HARD_SH4_BIT (1<<5) - #define FPU_SINGLE_BIT (1<<7) - #define SH4_BIT (1<<12) -+#define NO_IMPLICIT_FP_BIT (1<<3) - #define FMOVD_BIT (1<<4) - #define SH5_BIT (1<<0) - #define SPACE_BIT (1<<13) --#define BIGTABLE_BIT (1<<14) - #define RELAX_BIT (1<<15) - #define USERMODE_BIT (1<<16) - #define HITACHI_BIT (1<<22) -@@ -205,6 +205,9 @@ - /* Nonzero if we should generate code for a SH5 CPU (either ISA). */ - #define TARGET_SH5 (target_flags & SH5_BIT) - -+/* Nonzero if we should not use FPU implicitly. */ -+#define TARGET_NO_IMPLICIT_FP (target_flags & NO_IMPLICIT_FP_BIT) -+ - /* Nonzero if we should generate code using the SHcompact instruction - set and 32-bit ABI. */ - #define TARGET_SHCOMPACT (TARGET_SH5 && TARGET_SH1) -@@ -225,6 +228,7 @@ - - /* Nonzero if we should generate code using SHmedia FPU instructions. */ - #define TARGET_SHMEDIA_FPU (TARGET_SHMEDIA && TARGET_FPU_DOUBLE) -+ - /* Nonzero if we should generate fmovd. */ - #define TARGET_FMOVD (target_flags & FMOVD_BIT) - -@@ -234,9 +238,6 @@ - /* Nonzero if we should generate smaller code rather than faster code. */ - #define TARGET_SMALLCODE (target_flags & SPACE_BIT) - --/* Nonzero to use long jump tables. */ --#define TARGET_BIGTABLE (target_flags & BIGTABLE_BIT) -- - /* Nonzero to generate pseudo-ops needed by the assembler and linker - to do function call relaxing. */ - #define TARGET_RELAX (target_flags & RELAX_BIT) -@@ -297,7 +298,6 @@ - {"5-compact-nofpu", TARGET_NONE, "" }, \ - {"5-compact-nofpu", SH5_BIT|SH3_BIT|SH2_BIT|SH1_BIT, "Generate FPU-less SHcompact code" }, \ - {"b", -LITTLE_ENDIAN_BIT, "" }, \ -- {"bigtable", BIGTABLE_BIT, "" }, \ - {"dalign", DALIGN_BIT, "" }, \ - {"fmovd", FMOVD_BIT, "" }, \ - {"hitachi", HITACHI_BIT, "" }, \ -@@ -306,6 +306,7 @@ - {"isize", ISIZE_BIT, "" }, \ - {"l", LITTLE_ENDIAN_BIT, "" }, \ - {"no-ieee", -IEEE_BIT, "" }, \ -+ {"no-implicit-fp", NO_IMPLICIT_FP_BIT, "" }, \ - {"padstruct", PADSTRUCT_BIT, "" }, \ - {"prefergot", PREFERGOT_BIT, "" }, \ - {"relax", RELAX_BIT, "" }, \ -@@ -2493,16 +2494,22 @@ - goto LABEL; \ - } - -+extern int optimize; /* needed for gen_casesi. */ -+extern int optimize_size; -+ - /* Specify the machine mode that this machine uses - for the index in the tablejump instruction. */ --#define CASE_VECTOR_MODE (TARGET_BIGTABLE ? SImode : HImode) -+#define CASE_VECTOR_MODE SImode - - #define CASE_VECTOR_SHORTEN_MODE(MIN_OFFSET, MAX_OFFSET, BODY) \ - ((MIN_OFFSET) >= 0 && (MAX_OFFSET) <= 127 \ - ? (ADDR_DIFF_VEC_FLAGS (BODY).offset_unsigned = 0, QImode) \ - : (MIN_OFFSET) >= 0 && (MAX_OFFSET) <= 255 \ - ? (ADDR_DIFF_VEC_FLAGS (BODY).offset_unsigned = 1, QImode) \ -- : (MIN_OFFSET) >= -32768 && (MAX_OFFSET) <= 32767 ? HImode \ -+ : (MIN_OFFSET) >= -32768 && (MAX_OFFSET) <= 32767 \ -+ ? (ADDR_DIFF_VEC_FLAGS (BODY).offset_unsigned = 0, HImode) \ -+ : optimize_size && (MIN_OFFSET) >= 0 && (MAX_OFFSET) <= 65535 \ -+ ? (ADDR_DIFF_VEC_FLAGS (BODY).offset_unsigned = 1, HImode) \ - : SImode) - - /* Define as C expression which evaluates to nonzero if the tablejump -@@ -3038,10 +3045,7 @@ - /* Output an absolute table element. */ - - #define ASM_OUTPUT_ADDR_VEC_ELT(STREAM,VALUE) \ -- if (TARGET_BIGTABLE) \ -- asm_fprintf ((STREAM), "\t.long\t%LL%d\n", (VALUE)); \ -- else \ -- asm_fprintf ((STREAM), "\t.word\t%LL%d\n", (VALUE)); \ -+ asm_fprintf ((STREAM), "\t.long\t%LL%d\n", (VALUE)) - - /* Output various types of constants. */ - -@@ -3167,8 +3171,6 @@ - #define sh_cpu_attr ((enum attr_cpu)sh_cpu) - extern enum processor_type sh_cpu; - --extern int optimize; /* needed for gen_casesi. */ -- - enum mdep_reorg_phase_e - { - SH_BEFORE_MDEP_REORG, -diff -ruN gcc-20030210.orig/gcc/config/sh/sh.md gcc-20030210/gcc/config/sh/sh.md ---- gcc-20030210.orig/gcc/config/sh/sh.md Sat Nov 23 04:58:06 2002 -+++ gcc-20030210/gcc/config/sh/sh.md Sat Feb 22 01:40:14 2003 -@@ -1242,7 +1242,7 @@ - (clobber (reg:SI PR_REG)) - (clobber (reg:SI R4_REG)) - (use (match_operand:SI 1 "arith_reg_operand" "r"))] -- "TARGET_SH1 && ! TARGET_SH4" -+ "TARGET_SH1 && ! TARGET_SH4 || TARGET_NO_IMPLICIT_FP" - "jsr @%1%#" - [(set_attr "type" "sfunc") - (set_attr "needs_delay_slot" "yes")]) -@@ -1336,7 +1336,7 @@ - - operands[3] = gen_reg_rtx (Pmode); - /* Emit the move of the address to a pseudo outside of the libcall. */ -- if (TARGET_HARD_SH4 && TARGET_SH3E) -+ if (TARGET_HARD_SH4 && TARGET_SH3E && !TARGET_NO_IMPLICIT_FP) - { - emit_move_insn (operands[3], - gen_rtx_SYMBOL_REF (SImode, \"__udivsi3_i4\")); -@@ -1391,7 +1391,7 @@ - (clobber (reg:SI R2_REG)) - (clobber (reg:SI R3_REG)) - (use (match_operand:SI 1 "arith_reg_operand" "r"))] -- "TARGET_SH1 && ! TARGET_SH4" -+ "TARGET_SH1 && ! TARGET_SH4 || TARGET_NO_IMPLICIT_FP" - "jsr @%1%#" - [(set_attr "type" "sfunc") - (set_attr "needs_delay_slot" "yes")]) -@@ -1476,7 +1476,7 @@ - - operands[3] = gen_reg_rtx (Pmode); - /* Emit the move of the address to a pseudo outside of the libcall. */ -- if (TARGET_HARD_SH4 && TARGET_SH3E) -+ if (TARGET_HARD_SH4 && TARGET_SH3E && !TARGET_NO_IMPLICIT_FP) - { - emit_move_insn (operands[3], - gen_rtx_SYMBOL_REF (SImode, \"__sdivsi3_i4\")); -@@ -6446,6 +6446,8 @@ - case SImode: - return \"shll2 %1\;mov.l @(r0,%1),%0\"; - case HImode: -+ if (ADDR_DIFF_VEC_FLAGS (diff_vec).offset_unsigned) -+ return \"add %1,%1\;mov.w @(r0,%1),%0\;extu.w %0,%0\"; - return \"add %1,%1\;mov.w @(r0,%1),%0\"; - case QImode: - if (ADDR_DIFF_VEC_FLAGS (diff_vec).offset_unsigned) -@@ -6455,7 +6457,15 @@ - abort (); - } - }" -- [(set_attr "length" "4")]) -+ [(set (attr "length") -+ (cond [(eq (symbol_ref "shl_casesi_worker_length (insn)") (const_int 1)) -+ (const_string "2") -+ (eq (symbol_ref "shl_casesi_worker_length (insn)") (const_int 2)) -+ (const_string "4") -+ ;; Put "match_dup" here so that insn_variable_length_p return 1. -+ (ne (match_dup 2) (match_dup 2)) -+ (const_string "4")] -+ (const_string "6")))]) - - (define_insn "casesi_shift_media" - [(set (match_operand 0 "arith_reg_operand" "=r") -diff -ruN gcc-20030210.orig/gcc/config/sh/sh3-linux.h gcc-20030210/gcc/config/sh/sh3-linux.h ---- gcc-20030210.orig/gcc/config/sh/sh3-linux.h Thu Jan 1 09:00:00 1970 -+++ gcc-20030210/gcc/config/sh/sh3-linux.h Sat Feb 22 01:40:14 2003 -@@ -0,0 +1,29 @@ -+#undef TARGET_VERSION -+#define TARGET_VERSION fputs (" (SH3 GNU/Linux with ELF)", stderr); -+ -+#undef CPP_SPEC -+#define CPP_SPEC \ -+ "-D__LITTLE_ENDIAN__ \ -+ -D__SH3__ -D__sh3__ \ -+ -D__SIZE_TYPE__=unsigned\\ int \ -+ -D__PTRDIFF_TYPE__=int \ -+ %{fPIC:-D__PIC__ -D__pic__} \ -+ %{fpic:-D__PIC__ -D__pic__} \ -+ %{posix:-D_POSIX_SOURCE} \ -+ %{pthread:-D_REENTRANT -D_PTHREADS}" -+ -+#undef ASM_SPEC -+#define ASM_SPEC "%{mrelax:-relax}" -+ -+#undef CC1_SPEC -+#define CC1_SPEC \ -+ "-musermode -ml -m3 %{profile:-p}" -+ -+#undef LINK_SPEC -+#define LINK_SPEC \ -+ "%{mrelax:-relax} \ -+ %{shared:-shared} \ -+ %{!static: \ -+ %{rdynamic:-export-dynamic} \ -+ %{!dynamic-linker:-dynamic-linker /lib/ld-linux.so.2}} \ -+ %{static:-static}" -diff -ruN gcc-20030210.orig/gcc/config/sh/sh3eb-linux.h gcc-20030210/gcc/config/sh/sh3eb-linux.h ---- gcc-20030210.orig/gcc/config/sh/sh3eb-linux.h Thu Jan 1 09:00:00 1970 -+++ gcc-20030210/gcc/config/sh/sh3eb-linux.h Sat Feb 22 01:40:14 2003 -@@ -0,0 +1,29 @@ -+#undef TARGET_VERSION -+#define TARGET_VERSION fputs (" (SH3EB GNU/Linux with ELF)", stderr); -+ -+#undef CPP_SPEC -+#define CPP_SPEC \ -+ "-D__BIG_ENDIAN__ \ -+ -D__SH3__ -D__sh3__ \ -+ -D__SIZE_TYPE__=unsigned\\ int \ -+ -D__PTRDIFF_TYPE__=int \ -+ %{fPIC:-D__PIC__ -D__pic__} \ -+ %{fpic:-D__PIC__ -D__pic__} \ -+ %{posix:-D_POSIX_SOURCE} \ -+ %{pthread:-D_REENTRANT -D_PTHREADS}" -+ -+#undef ASM_SPEC -+#define ASM_SPEC "%{mrelax:-relax}" -+ -+#undef CC1_SPEC -+#define CC1_SPEC \ -+ "-musermode -mb -m3 %{profile:-p}" -+ -+#undef LINK_SPEC -+#define LINK_SPEC \ -+ "%{mrelax:-relax} \ -+ %{shared:-shared} \ -+ %{!static: \ -+ %{rdynamic:-export-dynamic} \ -+ %{!dynamic-linker:-dynamic-linker /lib/ld-linux.so.2}} \ -+ %{static:-static}" -diff -ruN gcc-20030210.orig/gcc/config/sh/sh4-linux.h gcc-20030210/gcc/config/sh/sh4-linux.h ---- gcc-20030210.orig/gcc/config/sh/sh4-linux.h Thu Jan 1 09:00:00 1970 -+++ gcc-20030210/gcc/config/sh/sh4-linux.h Sat Feb 22 01:40:14 2003 -@@ -0,0 +1,29 @@ -+#undef TARGET_VERSION -+#define TARGET_VERSION fputs (" (SH4 GNU/Linux with ELF)", stderr); -+ -+#undef CPP_SPEC -+#define CPP_SPEC \ -+ "-D__LITTLE_ENDIAN__ \ -+ -D__SH4__ \ -+ -D__SIZE_TYPE__=unsigned\\ int \ -+ -D__PTRDIFF_TYPE__=int \ -+ %{fPIC:-D__PIC__ -D__pic__} \ -+ %{fpic:-D__PIC__ -D__pic__} \ -+ %{posix:-D_POSIX_SOURCE} \ -+ %{pthread:-D_REENTRANT -D_PTHREADS}" -+ -+#undef ASM_SPEC -+#define ASM_SPEC "%{mrelax:-relax}" -+ -+#undef CC1_SPEC -+#define CC1_SPEC \ -+ "-musermode -ml -m4 %{profile:-p}" -+ -+#undef LINK_SPEC -+#define LINK_SPEC \ -+ "%{mrelax:-relax} \ -+ %{shared:-shared} \ -+ %{!static: \ -+ %{rdynamic:-export-dynamic} \ -+ %{!dynamic-linker:-dynamic-linker /lib/ld-linux.so.2}} \ -+ %{static:-static}" -diff -ruN gcc-20030210.orig/gcc/config/sh/sh4eb-linux.h gcc-20030210/gcc/config/sh/sh4eb-linux.h ---- gcc-20030210.orig/gcc/config/sh/sh4eb-linux.h Thu Jan 1 09:00:00 1970 -+++ gcc-20030210/gcc/config/sh/sh4eb-linux.h Sat Feb 22 01:40:14 2003 -@@ -0,0 +1,29 @@ -+#undef TARGET_VERSION -+#define TARGET_VERSION fputs (" (SH4EB GNU/Linux with ELF)", stderr); -+ -+#undef CPP_SPEC -+#define CPP_SPEC \ -+ "-D__BIG_ENDIAN__ \ -+ -D__SH4__ \ -+ -D__SIZE_TYPE__=unsigned\\ int \ -+ -D__PTRDIFF_TYPE__=int \ -+ %{fPIC:-D__PIC__ -D__pic__} \ -+ %{fpic:-D__PIC__ -D__pic__} \ -+ %{posix:-D_POSIX_SOURCE} \ -+ %{pthread:-D_REENTRANT -D_PTHREADS}" -+ -+#undef ASM_SPEC -+#define ASM_SPEC "%{mrelax:-relax}" -+ -+#undef CC1_SPEC -+#define CC1_SPEC \ -+ "-musermode -mb -m4 %{profile:-p}" -+ -+#undef LINK_SPEC -+#define LINK_SPEC \ -+ "%{mrelax:-relax} \ -+ %{shared:-shared} \ -+ %{!static: \ -+ %{rdynamic:-export-dynamic} \ -+ %{!dynamic-linker:-dynamic-linker /lib/ld-linux.so.2}} \ -+ %{static:-static}" -diff -ruN gcc-20030210.orig/gcc/config/sh/t-linux gcc-20030210/gcc/config/sh/t-linux ---- gcc-20030210.orig/gcc/config/sh/t-linux Thu May 17 12:16:12 2001 -+++ gcc-20030210/gcc/config/sh/t-linux Sat Feb 22 01:40:14 2003 -@@ -1,10 +1,20 @@ --TARGET_LIBGCC2_CFLAGS = -fpic -+TARGET_LIBGCC2_CFLAGS = -fpic -DNO_FPSCR_VALUES -+LIBGCC1 = libgcc1-asm.a -+CROSS_LIBGCC1 = libgcc1-asm.a -+LIBGCC1_TEST = libgcc1-test - LIB1ASMFUNCS = _ashiftrt _ashiftrt_n _ashiftlt _lshiftrt _movstr \ - _movstr_i4 _mulsi3 _sdivsi3 _sdivsi3_i4 _udivsi3 _udivsi3_i4 _set_fpscr \ - _ic_invalidate -+LIB2ADDEH = $(srcdir)/unwind-sjlj.c -+LIB2ADDEHDEP = unwind.inc unwind-sjlj.c - --MULTILIB_OPTIONS= mb m3e/m4 -+MULTILIB_OPTIONS= mb m4 - MULTILIB_DIRNAMES= - MULTILIB_MATCHES = - --EXTRA_MULTILIB_PARTS= crtbegin.o crtend.o crtbeginS.o crtendS.o -+EXTRA_MULTILIB_PARTS= crtbegin.o crtend.o crtbeginS.o crtendS.o crtbeginT.o -+ -+# Override t-slibgcc-elf-ver to export some libgcc symbols with -+# the symbol versions that glibc used and SH specific. -+SHLIB_MAPFILES = $(srcdir)/libgcc-std.ver \ -+ $(srcdir)/config/sh/libgcc-glibc.ver -diff -ruN gcc-20030210.orig/gcc/config/sh/t-linux-nomulti gcc-20030210/gcc/config/sh/t-linux-nomulti ---- gcc-20030210.orig/gcc/config/sh/t-linux-nomulti Thu Jan 1 09:00:00 1970 -+++ gcc-20030210/gcc/config/sh/t-linux-nomulti Sat Feb 22 01:40:14 2003 -@@ -0,0 +1,9 @@ -+LIBGCC = libgcc.a -+EXTRA_PARTS = crtbegin.o crtbeginS.o crtend.o crtendS.o crtbeginT.o -+ -+INSTALL_LIBGCC = install-libgcc -+ -+MULTILIB_OPTIONS= -+MULTILIB_DIRNAMES= -+MULTILIB_MATCHES = -+EXTRA_MULTILIB_PARTS= -diff -ruN gcc-20030210.orig/gcc/config.gcc gcc-20030210/gcc/config.gcc ---- gcc-20030210.orig/gcc/config.gcc Fri Jan 31 19:17:13 2003 -+++ gcc-20030210/gcc/config.gcc Sat Feb 22 01:40:14 2003 -@@ -337,9 +337,9 @@ - sparc*-*-*) - cpu_type=sparc - ;; --sh64-*-*) -- cpu_type=sh -- ;; -+sh*-*-*) -+ cpu_type=sh -+ ;; - esac - - tm_file=${cpu_type}/${cpu_type}.h -@@ -3018,9 +3018,31 @@ - thread_file='rtems' - fi - ;; --sh-*-linux*) -+sh*-*-linux*) - tm_file="${tm_file} sh/elf.h sh/linux.h" -- tmake_file="sh/t-sh sh/t-elf sh/t-linux" -+ tmake_file="sh/t-sh sh/t-elf t-slibgcc-elf-ver t-linux sh/t-linux" -+ extra_parts="crtbegin.o crtend.o crtbeginS.o crtendS.o crtbeginT.o" -+ case $machine in -+ sh3eb-*) -+ tm_file="${tm_file} sh/sh3eb-linux.h" -+ tmake_file="${tmake_file} sh/t-linux-nomulti" -+ ;; -+ sh4eb-*) -+ tm_file="${tm_file} sh/sh4eb-linux.h" -+ tmake_file="${tmake_file} sh/t-linux-nomulti" -+ ;; -+ sh3-*) -+ tm_file="${tm_file} sh/sh3-linux.h" -+ tmake_file="${tmake_file} sh/t-linux-nomulti" -+ ;; -+ sh4-*) -+ tm_file="${tm_file} sh/sh4-linux.h" -+ tmake_file="${tmake_file} sh/t-linux-nomulti" -+ ;; -+ *) -+ ;; -+ esac -+ xmake_file=x-linux - gas=yes gnu_ld=yes - float_format=sh - ;; -diff -ruN gcc-20030210.orig/gcc/dwarf2out.c gcc-20030210/gcc/dwarf2out.c ---- gcc-20030210.orig/gcc/dwarf2out.c Mon Feb 10 19:36:25 2003 -+++ gcc-20030210/gcc/dwarf2out.c Sat Feb 22 01:40:14 2003 -@@ -10224,7 +10224,9 @@ - /* We can have a normal definition following an inline one in the - case of redefinition of GNU C extern inlines. - It seems reasonable to use AT_specification in this case. */ -- && !get_AT_unsigned (old_die, DW_AT_inline)) -+ && !get_AT_unsigned (old_die, DW_AT_inline) -+ /* Skip the nested function. */ -+ && !decl_function_context (decl)) - { - /* ??? This can happen if there is a bug in the program, for - instance, if it has duplicate function definitions. Ideally, -diff -ruN gcc-20030210.orig/gcc/final.c gcc-20030210/gcc/final.c ---- gcc-20030210.orig/gcc/final.c Fri Jan 31 19:17:20 2003 -+++ gcc-20030210/gcc/final.c Sat Feb 22 01:40:14 2003 -@@ -1128,7 +1128,7 @@ - } - } - -- INSN_ADDRESSES (uid) = insn_current_address; -+ INSN_ADDRESSES (uid) = insn_current_address + insn_lengths[uid]; - - if (GET_CODE (insn) == NOTE || GET_CODE (insn) == BARRIER - || GET_CODE (insn) == CODE_LABEL) -diff -ruN gcc-20030210.orig/gcc/mkmap-symver.awk gcc-20030210/gcc/mkmap-symver.awk ---- gcc-20030210.orig/gcc/mkmap-symver.awk Fri Jan 31 19:17:26 2003 -+++ gcc-20030210/gcc/mkmap-symver.awk Sat Feb 22 01:40:14 2003 -@@ -89,7 +89,11 @@ - output(inherit[lib]); - - printf("%s {\n", lib); -- printf(" global:\n"); -+ for (sym in ver) -+ if ((ver[sym] == lib) && (sym in def)) -+ count++; -+ if (count > 0) -+ printf(" global:\n"); - for (sym in ver) - if ((ver[sym] == lib) && (sym in def)) - { -diff -ruN gcc-20030210.orig/gcc/reload1.c gcc-20030210/gcc/reload1.c ---- gcc-20030210.orig/gcc/reload1.c Fri Jan 31 19:17:29 2003 -+++ gcc-20030210/gcc/reload1.c Sat Feb 22 01:40:14 2003 -@@ -6103,6 +6103,7 @@ - for (j = 0; j < n_reloads; j++) - if (rld[j].in != 0 - && rld[j].when_needed != RELOAD_OTHER -+ && rld[j].when_needed != RELOAD_FOR_OUTPUT_ADDRESS - && reg_overlap_mentioned_for_reload_p (rld[j].in, - rld[i].in)) - rld[j].when_needed -diff -ruN gcc-20030210.orig/gcc/reorg.c gcc-20030210/gcc/reorg.c ---- gcc-20030210.orig/gcc/reorg.c Fri Jan 31 19:17:30 2003 -+++ gcc-20030210/gcc/reorg.c Sat Feb 22 01:40:14 2003 -@@ -3265,6 +3265,14 @@ - || condjump_in_parallel_p (XVECEXP (PATTERN (insn), 0, 0)))) - continue; - -+#ifdef MD_CAN_REDIRECT_BRANCH -+ /* On some targets, branches with delay slots can have a limited -+ displacement. Give the back end a chance to tell us we can't do -+ this. */ -+ if (! MD_CAN_REDIRECT_BRANCH (insn, delay_insn)) -+ continue; -+#endif -+ - target_label = JUMP_LABEL (delay_insn); - - if (target_label) -diff -ruN gcc-20030210.orig/gcc/tree-inline.c gcc-20030210/gcc/tree-inline.c ---- gcc-20030210.orig/gcc/tree-inline.c Fri Jan 31 19:17:33 2003 -+++ gcc-20030210/gcc/tree-inline.c Sat Feb 22 01:40:14 2003 -@@ -836,11 +836,17 @@ - - /* Don't try to inline functions that are not well-suited to - inlining. */ -- if (!inlinable_function_p (fn, id)) -- return NULL_TREE; -+ if (! inlinable_function_p (fn, id) -+ || ! (*lang_hooks.tree_inlining.start_inlining) (fn)) -+ { -+ if (DECL_INLINE (fn) && warn_inline && ! flag_really_no_inline) -+ { -+ warning_with_decl (fn, "inlining failed in call to `%s'"); -+ warning ("called from here"); -+ } - -- if (! (*lang_hooks.tree_inlining.start_inlining) (fn)) -- return NULL_TREE; -+ return NULL_TREE; -+ } - - /* Set the current filename and line number to the function we are - inlining so that when we create new _STMT nodes here they get -diff -ruN gcc-20030210.orig/libjava/Makefile.in gcc-20030210/libjava/Makefile.in ---- gcc-20030210.orig/libjava/Makefile.in Tue Jan 28 10:44:37 2003 -+++ gcc-20030210/libjava/Makefile.in Sat Feb 22 01:40:14 2003 -@@ -1637,6 +1637,7 @@ - "AS=$(AS)" \ - "CC=$(CC)" \ - "CXX=$(CXX)" \ -+ "GCJ=$(GCJ)" \ - "LD=$(LD)" \ - "LIBCFLAGS=$(LIBCFLAGS)" \ - "NM=$(NM)" \ -diff -ruN gcc-20030210.orig/libjava/configure gcc-20030210/libjava/configure ---- gcc-20030210.orig/libjava/configure Tue Jan 28 10:44:37 2003 -+++ gcc-20030210/libjava/configure Sat Feb 22 01:42:11 2003 -@@ -2031,7 +2031,7 @@ - # This must be Linux ELF. - linux-gnu*) - case $host_cpu in -- alpha* | hppa* | i*86 | powerpc* | sparc* | ia64* ) -+ alpha* | hppa* | i*86 | powerpc* | sparc* | ia64* | sh* ) - lt_cv_deplibs_check_method=pass_all ;; - *) - # glibc up to 2.1.1 does not perform some relocations on ARM -diff -ruN gcc-20030210.orig/libjava/java/net/natInetAddress.cc gcc-20030210/libjava/java/net/natInetAddress.cc ---- gcc-20030210.orig/libjava/java/net/natInetAddress.cc Tue Mar 5 05:02:19 2002 -+++ gcc-20030210/libjava/java/net/natInetAddress.cc Sat Feb 22 01:40:14 2003 -@@ -56,7 +56,7 @@ - #endif - - #ifndef HAVE_GETHOSTNAME_DECL --extern "C" int gethostname (char *name, int namelen); -+extern "C" int gethostname (char *name, unsigned int namelen); - #endif - - #ifdef DISABLE_JAVA_NET -diff -ruN gcc-20030210.orig/libjava/libltdl/aclocal.m4 gcc-20030210/libjava/libltdl/aclocal.m4 ---- gcc-20030210.orig/libjava/libltdl/aclocal.m4 Sun Sep 10 17:04:40 2000 -+++ gcc-20030210/libjava/libltdl/aclocal.m4 Sat Feb 22 01:40:14 2003 -@@ -573,7 +573,7 @@ - # This must be Linux ELF. - linux-gnu*) - case "$host_cpu" in -- alpha* | i*86 | powerpc* | sparc* | ia64* ) -+ alpha* | i*86 | powerpc* | sparc* | ia64* | sh*) - lt_cv_deplibs_check_method=pass_all ;; - *) - # glibc up to 2.1.1 does not perform some relocations on ARM -diff -ruN gcc-20030210.orig/libjava/sysdep/sh/locks.h gcc-20030210/libjava/sysdep/sh/locks.h ---- gcc-20030210.orig/libjava/sysdep/sh/locks.h Thu Jan 1 09:00:00 1970 -+++ gcc-20030210/libjava/sysdep/sh/locks.h Sat Feb 22 01:40:14 2003 -@@ -0,0 +1,72 @@ -+// locks.h - Thread synchronization primitives. SuperH implementation. -+ -+/* Copyright (C) 2002 Free Software Foundation -+ -+ This file is part of libgcj. -+ -+This software is copyrighted work licensed under the terms of the -+Libgcj License. Please consult the file "LIBGCJ_LICENSE" for -+details. */ -+ -+#ifndef __SYSDEP_LOCKS_H__ -+#define __SYSDEP_LOCKS_H__ -+ -+typedef size_t obj_addr_t; /* Integer type big enough for object */ -+ /* address. */ -+ -+static unsigned char __cas_lock = 0; -+ -+inline static void -+__cas_start_atomic (void) -+{ -+ unsigned int val; -+ -+ do -+ __asm__ __volatile__ ("tas.b @%1; movt %0" -+ : "=r" (val) -+ : "r" (&__cas_lock) -+ : "memory"); -+ while (val == 0); -+} -+ -+inline static void -+__cas_end_atomic (void) -+{ -+ __asm__ __volatile__ (" " : : : "memory"); -+ __cas_lock = 0; -+} -+ -+inline static bool -+compare_and_swap (volatile obj_addr_t *addr, obj_addr_t old, -+ obj_addr_t new_val) -+{ -+ bool ret; -+ -+ __cas_start_atomic (); -+ if (*addr != old) -+ ret = false; -+ else -+ { -+ *addr = new_val; -+ ret = true; -+ } -+ __cas_end_atomic (); -+ -+ return ret; -+} -+ -+inline static void -+release_set (volatile obj_addr_t *addr, obj_addr_t new_val) -+{ -+ __asm__ __volatile__ (" " : : : "memory"); -+ *(addr) = new_val; -+} -+ -+inline static bool -+compare_and_swap_release (volatile obj_addr_t *addr, obj_addr_t old, -+ obj_addr_t new_val) -+{ -+ return compare_and_swap (addr, old, new_val); -+} -+ -+#endif /* ! __SYSDEP_LOCKS_H__ */ -diff -ruN gcc-20030210.orig/libstdc++-v3/acinclude.m4 gcc-20030210/libstdc++-v3/acinclude.m4 ---- gcc-20030210.orig/libstdc++-v3/acinclude.m4 Tue Jan 28 02:30:41 2003 -+++ gcc-20030210/libstdc++-v3/acinclude.m4 Sat Feb 22 01:40:14 2003 -@@ -1828,9 +1828,10 @@ - GLIBCPP_INCLUDES="-I${glibcpp_builddir}/include/${target_alias} -I${glibcpp_builddir}/include" - - # Passed down for canadian crosses. -- if test x"$CANADIAN" = xyes; then -- TOPLEVEL_INCLUDES='-I$(includedir)' -- fi -+ #if test x"$CANADIAN" = xyes; then -+ # TOPLEVEL_INCLUDES='-I$(includedir)' -+ #fi -+ TOPLEVEL_INCLUDES='' - - LIBMATH_INCLUDES='-I$(top_srcdir)/libmath' - -diff -ruN gcc-20030210.orig/libstdc++-v3/aclocal.m4 gcc-20030210/libstdc++-v3/aclocal.m4 ---- gcc-20030210.orig/libstdc++-v3/aclocal.m4 Mon Feb 10 19:36:47 2003 -+++ gcc-20030210/libstdc++-v3/aclocal.m4 Sat Feb 22 01:40:14 2003 -@@ -1840,9 +1840,10 @@ - GLIBCPP_INCLUDES="-I${glibcpp_builddir}/include/${target_alias} -I${glibcpp_builddir}/include" - - # Passed down for canadian crosses. -- if test x"$CANADIAN" = xyes; then -- TOPLEVEL_INCLUDES='-I$(includedir)' -- fi -+ #if test x"$CANADIAN" = xyes; then -+ # TOPLEVEL_INCLUDES='-I$(includedir)' -+ #fi -+ TOPLEVEL_INCLUDES='' - - LIBMATH_INCLUDES='-I$(top_srcdir)/libmath' - -diff -ruN gcc-20030210.orig/libstdc++-v3/configure gcc-20030210/libstdc++-v3/configure ---- gcc-20030210.orig/libstdc++-v3/configure Mon Feb 10 19:37:17 2003 -+++ gcc-20030210/libstdc++-v3/configure Sat Feb 22 01:40:14 2003 -@@ -1982,7 +1982,7 @@ - # This must be Linux ELF. - linux-gnu*) - case $host_cpu in -- alpha* | hppa* | i*86 | powerpc* | sparc* | ia64* ) -+ alpha* | hppa* | i*86 | powerpc* | sparc* | ia64* | sh*) - lt_cv_deplibs_check_method=pass_all ;; - *) - # glibc up to 2.1.1 does not perform some relocations on ARM -@@ -22340,9 +22340,10 @@ - GLIBCPP_INCLUDES="-I${glibcpp_builddir}/include/${target_alias} -I${glibcpp_builddir}/include" - - # Passed down for canadian crosses. -- if test x"$CANADIAN" = xyes; then -- TOPLEVEL_INCLUDES='-I$(includedir)' -- fi -+ #if test x"$CANADIAN" = xyes; then -+ # TOPLEVEL_INCLUDES='-I$(includedir)' -+ #fi -+ TOPLEVEL_INCLUDES='' - - LIBMATH_INCLUDES='-I$(top_srcdir)/libmath' - -diff -ruN gcc-20030210.orig/libtool.m4 gcc-20030210/libtool.m4 ---- gcc-20030210.orig/libtool.m4 Fri Jan 31 19:16:59 2003 -+++ gcc-20030210/libtool.m4 Sat Feb 22 01:40:14 2003 -@@ -597,7 +597,7 @@ - # This must be Linux ELF. - linux-gnu*) - case $host_cpu in -- alpha* | hppa* | i*86 | powerpc* | sparc* | ia64* ) -+ alpha* | hppa* | i*86 | powerpc* | sparc* | ia64* | sh* ) - lt_cv_deplibs_check_method=pass_all ;; - *) - # glibc up to 2.1.1 does not perform some relocations on ARM -diff -ruN gcc-20030210.orig/zlib/configure gcc-20030210/zlib/configure ---- gcc-20030210.orig/zlib/configure Tue Jan 28 10:44:15 2003 -+++ gcc-20030210/zlib/configure Sat Feb 22 01:40:14 2003 -@@ -1571,7 +1571,7 @@ - # This must be Linux ELF. - linux-gnu*) - case $host_cpu in -- alpha* | hppa* | i*86 | powerpc* | sparc* | ia64* ) -+ alpha* | hppa* | i*86 | powerpc* | sparc* | ia64* | sh* ) - lt_cv_deplibs_check_method=pass_all ;; - *) - # glibc up to 2.1.1 does not perform some relocations on ARM diff --git a/patches/gcc/3.2.3/gcc-3.2.3-g++.exp.patch b/patches/gcc/3.2.3/gcc-3.2.3-g++.exp.patch deleted file mode 100644 index 0de46fc..0000000 --- a/patches/gcc/3.2.3/gcc-3.2.3-g++.exp.patch +++ /dev/null @@ -1,98 +0,0 @@ -g++ testsuite fixes for cross-compilers, Dan Kegel, Ixia Communications, 12 July 2003 - -The first hunk fixes the error - -/testsuite_flags: /testsuite_flags: No such file or directory - while executing -"exec sh ${odir_v3}/testsuite_flags --build-includes" - (procedure "g++_include_flags" line 21) - invoked from within -"g++_include_flags [get_multilibs] " - (procedure "g++_init" line 63) - invoked from within -"${tool}_init $test_file_name" - (procedure "runtest" line 19) - invoked from within -"runtest $test_name" - ("foreach" body line 42) - invoked from within -... -make[1]: [check-g++] Error 1 (ignored) - -The fix isn't especially pretty, but it worked for me, and can't hurt the -more common native compiler case. Maybe someone who knows the code better -can come up with a better fix. - -The second hunk fixes the error - -sh: error while loading shared libraries: /opt/cegl-2.0/powerpc-405-linux-gnu/gcc-3.2.3-glibc-2.2.5/powerpc-405-linux-gnu/./lib/libdl.so.2: ELF file data encoding not little-endian - -when trying to compile g++ testcases (!); setting up -the shared library environment when running crosstests of g++ -should either be done by a special board file, or by -setting up a remote chroot environment (see http://kegel.com/crosstool), -not by blithely setting LD_LIBRARY_PATH on the local system. - ---- gcc-3.2.3/gcc/testsuite/lib/g++.exp.old Fri Jul 11 15:42:47 2003 -+++ gcc-3.2.3/gcc/testsuite/lib/g++.exp Sat Jul 12 12:57:07 2003 -@@ -72,6 +72,8 @@ - # - proc g++_include_flags { paths } { - global srcdir -+ global objdir -+ global target_triplet - global HAVE_LIBSTDCXX_V3 - global TESTING_IN_BUILD_TREE - -@@ -90,6 +92,20 @@ - - if { ${HAVE_LIBSTDCXX_V3} } { - set odir_v3 [lookfor_file ${gccpath} libstdc++-v3] -+ if { $odir_v3 == "" } { -+ verbose "g++_include_flags: couldn't find libstdc++-v3 on first try, now looking in build directory $objdir" -+ # first assume no multilibs -+ set odir_v3 [lookfor_file ${objdir} "$target_triplet/libstdc++-v3"] -+ } -+ if { $odir_v3 == "" } { -+ verbose "g++_include_flags: couldn't find libstdc++-v3 on second try, trying multilib" -+ # assume multilib only one level deep -+ set multisub [file tail $gccpath] -+ set odir_v3 [lookfor_file ${objdir} "$target_triplet/$multisub/libstdc++-v3"] -+ } -+ if { $odir_v3 == "" } { -+ error "Can't find libstdc++-v3" -+ } - append flags [exec sh ${odir_v3}/testsuite_flags --build-includes] - } else { - set odir_v2 [lookfor_file ${gccpath} libstdc++] -@@ -192,16 +192,20 @@ - } - } - -- # On IRIX 6, we have to set variables akin to LD_LIBRARY_PATH, but -- # called LD_LIBRARYN32_PATH (for the N32 ABI) and LD_LIBRARY64_PATH -- # (for the 64-bit ABI). The right way to do this would be to modify -- # unix.exp -- but that's not an option since it's part of DejaGNU -- # proper, so we do it here. We really only need to do -- # this on IRIX, but it shouldn't hurt to do it anywhere else. -- setenv LD_LIBRARY_PATH $ld_library_path -- setenv SHLIB_PATH $ld_library_path -- setenv LD_LIBRARYN32_PATH $ld_library_path -- setenv LD_LIBRARY64_PATH $ld_library_path -+ if {![is_remote target]} { -+ # On IRIX 6, we have to set variables akin to LD_LIBRARY_PATH, but -+ # called LD_LIBRARYN32_PATH (for the N32 ABI) and LD_LIBRARY64_PATH -+ # (for the 64-bit ABI). The right way to do this would be to modify -+ # unix.exp -- but that's not an option since it's part of DejaGNU -+ # proper, so we do it here. We really only need to do -+ # this on IRIX, but it shouldn't hurt to do it anywhere else. -+ -+ # Doing this causes us to be unable to run cross-compilers. -+ setenv LD_LIBRARY_PATH $ld_library_path -+ setenv SHLIB_PATH $ld_library_path -+ setenv LD_LIBRARYN32_PATH $ld_library_path -+ setenv LD_LIBRARY64_PATH $ld_library_path -+ } - - return "$flags" - } diff --git a/patches/gcc/3.2.3/gcc-3.2.3-libffi-1.patch b/patches/gcc/3.2.3/gcc-3.2.3-libffi-1.patch deleted file mode 100644 index db78ba1..0000000 --- a/patches/gcc/3.2.3/gcc-3.2.3-libffi-1.patch +++ /dev/null @@ -1,6864 +0,0 @@ -diff -ruN --exclude=CVS gcc-3.2.2.orig/libffi/Makefile.am gcc/libffi/Makefile.am ---- gcc-3.2.2.orig/libffi/Makefile.am Tue Jan 28 10:43:56 2003 -+++ gcc/libffi/Makefile.am Tue Jan 28 10:48:33 2003 -@@ -8,14 +8,17 @@ - src/mips/n32.s src/mips/o32.S src/mips/o32.s \ - src/sparc/ffi.c src/sparc/v8.S src/sparc/v9.S \ - src/x86/ffi.c src/x86/sysv.S src/x86/win32.S \ -+ src/x86/ffi64.c src/x86/unix64.S \ - src/alpha/ffi.c src/alpha/osf.S \ - src/m68k/ffi.c src/m68k/sysv.S \ - src/powerpc/ffi.c src/powerpc/sysv.S \ - src/powerpc/ppc_closure.S src/powerpc/asm.h \ - src/powerpc/ffi_darwin.c \ - src/powerpc/darwin.S src/powerpc/aix.S \ -- src/powerpc/darwin_closure.S src/powerpc/aix_closures.S \ -- src/arm/ffi.c src/arm/sysv.S -+ src/powerpc/darwin_closure.S src/powerpc/aix_closure.S \ -+ src/arm/ffi.c src/arm/sysv.S \ -+ src/s390/ffi.c src/s390/sysv.S \ -+ src/sh/ffi.c src/sh/sysv.S - - VPATH = @srcdir@:@srcdir@/src:@srcdir@/src/@TARGETDIR@ - -@@ -83,6 +86,7 @@ - ffitest_LDFLAGS = -shared-libgcc - - TARGET_SRC_MIPS_GCC = src/mips/ffi.c src/mips/o32.S src/mips/n32.S -+TARGET_SRC_MIPS_LINUX = src/mips/ffi.c src/mips/o32.S - TARGET_SRC_MIPS_SGI = src/mips/ffi.c src/mips/o32.s src/mips/n32.s - TARGET_SRC_X86 = src/x86/ffi.c src/x86/sysv.S - TARGET_SRC_X86_WIN32 = src/x86/ffi.c src/x86/win32.S -@@ -91,9 +95,12 @@ - TARGET_SRC_IA64 = src/ia64/ffi.c src/ia64/unix.S - TARGET_SRC_M68K = src/m68k/ffi.c src/m68k/sysv.S - TARGET_SRC_POWERPC = src/powerpc/ffi.c src/powerpc/sysv.S src/powerpc/ppc_closure.S --TARGET_SRC_POWERPC_AIX = src/powerpc/ffi_darwin.c src/powerpc/aix.S src/powerpc/aix_closures.S -+TARGET_SRC_POWERPC_AIX = src/powerpc/ffi_darwin.c src/powerpc/aix.S src/powerpc/aix_closure.S - TARGET_SRC_POWERPC_DARWIN = src/powerpc/ffi_darwin.c src/powerpc/darwin.S src/powerpc/darwin_closure.S - TARGET_SRC_ARM = src/arm/sysv.S src/arm/ffi.c -+TARGET_SRC_S390 = src/s390/sysv.S src/s390/ffi.c -+TARGET_SRC_X86_64 = src/x86/ffi64.c src/x86/unix64.S src/x86/ffi.c src/x86/sysv.S -+TARGET_SRC_SH = src/sh/sysv.S src/sh/ffi.c - - ##libffi_la_SOURCES = src/debug.c src/prep_cif.c src/types.c $(TARGET_SRC_@TARGET@) - ## Work around automake deficiency -@@ -103,6 +110,10 @@ - libffi_la_SOURCES = $(libffi_la_common_SOURCES) $(TARGET_SRC_MIPS_GCC) - libffi_convenience_la_SOURCES = $(libffi_la_common_SOURCES) $(TARGET_SRC_MIPS_GCC) - endif -+if MIPS_LINUX -+libffi_la_SOURCES = $(libffi_la_common_SOURCES) $(TARGET_SRC_MIPS_LINUX) -+libffi_convenience_la_SOURCES = $(libffi_la_common_SOURCES) $(TARGET_SRC_MIPS_LINUX) -+endif - if MIPS_SGI - libffi_la_SOURCES = $(libffi_la_common_SOURCES) $(TARGET_SRC_MIPS_SGI) - libffi_convenience_la_SOURCES = $(libffi_la_common_SOURCES) $(TARGET_SRC_MIPS_SGI) -@@ -147,6 +158,18 @@ - libffi_la_SOURCES = $(libffi_la_common_SOURCES) $(TARGET_SRC_ARM) - libffi_convenience_la_SOURCES = $(libffi_la_common_SOURCES) $(TARGET_SRC_ARM) - endif -+if S390 -+libffi_la_SOURCES = $(libffi_la_common_SOURCES) $(TARGET_SRC_S390) -+libffi_convenience_la_SOURCES = $(libffi_la_common_SOURCES) $(TARGET_SRC_S390) -+endif -+if X86_64 -+libffi_la_SOURCES = $(libffi_la_common_SOURCES) $(TARGET_SRC_X86_64) -+libffi_convenience_la_SOURCES = $(libffi_la_common_SOURCES) $(TARGET_SRC_X86_64) -+endif -+if SH -+libffi_la_SOURCES = $(libffi_la_common_SOURCES) $(TARGET_SRC_SH) -+libfficonvenience_la_SOURCES = $(libffi_la_common_SOURCES) $(TARGET_SRC_SH) -+endif - - AM_CFLAGS = -fexceptions - -diff -ruN --exclude=CVS gcc-3.2.2.orig/libffi/Makefile.in gcc/libffi/Makefile.in ---- gcc-3.2.2.orig/libffi/Makefile.in Wed Jan 29 07:59:05 2003 -+++ gcc/libffi/Makefile.in Wed Jan 29 07:58:58 2003 -@@ -91,14 +91,17 @@ - src/mips/n32.s src/mips/o32.S src/mips/o32.s \ - src/sparc/ffi.c src/sparc/v8.S src/sparc/v9.S \ - src/x86/ffi.c src/x86/sysv.S src/x86/win32.S \ -+ src/x86/ffi64.c src/x86/unix64.S \ - src/alpha/ffi.c src/alpha/osf.S \ - src/m68k/ffi.c src/m68k/sysv.S \ - src/powerpc/ffi.c src/powerpc/sysv.S \ - src/powerpc/ppc_closure.S src/powerpc/asm.h \ - src/powerpc/ffi_darwin.c \ - src/powerpc/darwin.S src/powerpc/aix.S \ -- src/powerpc/darwin_closure.S src/powerpc/aix_closures.S \ -- src/arm/ffi.c src/arm/sysv.S -+ src/powerpc/darwin_closure.S src/powerpc/aix_closure.S \ -+ src/arm/ffi.c src/arm/sysv.S \ -+ src/s390/ffi.c src/s390/sysv.S \ -+ src/sh/ffi.c src/sh/sysv.S - - - VPATH = @srcdir@:@srcdir@/src:@srcdir@/src/@TARGETDIR@ -@@ -162,6 +165,7 @@ - ffitest_LDFLAGS = -shared-libgcc - - TARGET_SRC_MIPS_GCC = src/mips/ffi.c src/mips/o32.S src/mips/n32.S -+TARGET_SRC_MIPS_LINUX = src/mips/ffi.c src/mips/o32.S - TARGET_SRC_MIPS_SGI = src/mips/ffi.c src/mips/o32.s src/mips/n32.s - TARGET_SRC_X86 = src/x86/ffi.c src/x86/sysv.S - TARGET_SRC_X86_WIN32 = src/x86/ffi.c src/x86/win32.S -@@ -170,14 +174,18 @@ - TARGET_SRC_IA64 = src/ia64/ffi.c src/ia64/unix.S - TARGET_SRC_M68K = src/m68k/ffi.c src/m68k/sysv.S - TARGET_SRC_POWERPC = src/powerpc/ffi.c src/powerpc/sysv.S src/powerpc/ppc_closure.S --TARGET_SRC_POWERPC_AIX = src/powerpc/ffi_darwin.c src/powerpc/aix.S src/powerpc/aix_closures.S -+TARGET_SRC_POWERPC_AIX = src/powerpc/ffi_darwin.c src/powerpc/aix.S src/powerpc/aix_closure.S - TARGET_SRC_POWERPC_DARWIN = src/powerpc/ffi_darwin.c src/powerpc/darwin.S src/powerpc/darwin_closure.S - TARGET_SRC_ARM = src/arm/sysv.S src/arm/ffi.c -+TARGET_SRC_S390 = src/s390/sysv.S src/s390/ffi.c -+TARGET_SRC_X86_64 = src/x86/ffi64.c src/x86/unix64.S src/x86/ffi.c src/x86/sysv.S -+TARGET_SRC_SH = src/sh/sysv.S src/sh/ffi.c - - libffi_la_common_SOURCES = src/debug.c src/prep_cif.c src/types.c \ - src/raw_api.c src/java_raw_api.c - - @MIPS_GCC_TRUE@libffi_la_SOURCES = @MIPS_GCC_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_MIPS_GCC) -+@MIPS_LINUX_TRUE@libffi_la_SOURCES = @MIPS_LINUX_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_MIPS_LINUX) - @MIPS_SGI_TRUE@libffi_la_SOURCES = @MIPS_SGI_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_MIPS_SGI) - @X86_TRUE@libffi_la_SOURCES = @X86_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_X86) - @X86_WIN32_TRUE@libffi_la_SOURCES = @X86_WIN32_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_X86_WIN32) -@@ -189,7 +197,11 @@ - @POWERPC_AIX_TRUE@libffi_la_SOURCES = @POWERPC_AIX_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_POWERPC_AIX) - @POWERPC_DARWIN_TRUE@libffi_la_SOURCES = @POWERPC_DARWIN_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_POWERPC_DARWIN) - @ARM_TRUE@libffi_la_SOURCES = @ARM_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_ARM) -+@S390_TRUE@libffi_la_SOURCES = @S390_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_S390) -+@X86_64_TRUE@libffi_la_SOURCES = @X86_64_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_X86_64) -+@SH_TRUE@libffi_la_SOURCES = @SH_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_SH) - @MIPS_GCC_TRUE@libffi_convenience_la_SOURCES = @MIPS_GCC_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_MIPS_GCC) -+@MIPS_LINUX_TRUE@libffi_convenience_la_SOURCES = @MIPS_LINUX_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_MIPS_LINUX) - @MIPS_SGI_TRUE@libffi_convenience_la_SOURCES = @MIPS_SGI_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_MIPS_SGI) - @X86_TRUE@libffi_convenience_la_SOURCES = @X86_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_X86) - @X86_WIN32_TRUE@libffi_convenience_la_SOURCES = @X86_WIN32_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_X86_WIN32) -@@ -201,6 +213,9 @@ - @POWERPC_AIX_TRUE@libffi_convenience_la_SOURCES = @POWERPC_AIX_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_POWERPC_AIX) - @POWERPC_DARWIN_TRUE@libffi_convenience_la_SOURCES = @POWERPC_DARWIN_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_POWERPC_DARWIN) - @ARM_TRUE@libffi_convenience_la_SOURCES = @ARM_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_ARM) -+@S390_TRUE@libffi_convenience_la_SOURCES = @S390_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_S390) -+@X86_64_TRUE@libffi_convenience_la_SOURCES = @X86_64_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_X86_64) -+@SH_TRUE@libfficonvenience_la_SOURCES = @SH_TRUE@$(libffi_la_common_SOURCES) $(TARGET_SRC_SH) - - AM_CFLAGS = -fexceptions - -@@ -208,7 +223,7 @@ - - INCLUDES = -I$(top_srcdir)/include -Iinclude -I$(top_srcdir)/src - ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 --mkinstalldirs = $(SHELL) $(top_srcdir)/../mkinstalldirs -+mkinstalldirs = $(SHELL) $(top_srcdir)/${libffi_basedir}/../mkinstalldirs - CONFIG_HEADER = fficonfig.h - CONFIG_CLEAN_FILES = - LTLIBRARIES = $(noinst_LTLIBRARIES) $(toolexeclib_LTLIBRARIES) -@@ -220,10 +235,6 @@ - LIBS = @LIBS@ - libffi_convenience_la_LDFLAGS = - libffi_convenience_la_LIBADD = --@POWERPC_TRUE@libffi_convenience_la_OBJECTS = src/debug.lo \ --@POWERPC_TRUE@src/prep_cif.lo src/types.lo src/raw_api.lo \ --@POWERPC_TRUE@src/java_raw_api.lo src/powerpc/ffi.lo \ --@POWERPC_TRUE@src/powerpc/sysv.lo src/powerpc/ppc_closure.lo - @ALPHA_TRUE@libffi_convenience_la_OBJECTS = src/debug.lo \ - @ALPHA_TRUE@src/prep_cif.lo src/types.lo src/raw_api.lo \ - @ALPHA_TRUE@src/java_raw_api.lo src/alpha/ffi.lo src/alpha/osf.lo -@@ -234,12 +245,29 @@ - @MIPS_GCC_TRUE@src/prep_cif.lo src/types.lo src/raw_api.lo \ - @MIPS_GCC_TRUE@src/java_raw_api.lo src/mips/ffi.lo src/mips/o32.lo \ - @MIPS_GCC_TRUE@src/mips/n32.lo --@X86_WIN32_TRUE@libffi_convenience_la_OBJECTS = src/debug.lo \ --@X86_WIN32_TRUE@src/prep_cif.lo src/types.lo src/raw_api.lo \ --@X86_WIN32_TRUE@src/java_raw_api.lo src/x86/ffi.lo src/x86/win32.lo -+@S390_TRUE@libffi_convenience_la_OBJECTS = src/debug.lo src/prep_cif.lo \ -+@S390_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \ -+@S390_TRUE@src/s390/sysv.lo src/s390/ffi.lo - @M68K_TRUE@libffi_convenience_la_OBJECTS = src/debug.lo src/prep_cif.lo \ - @M68K_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \ - @M68K_TRUE@src/m68k/ffi.lo src/m68k/sysv.lo -+@X86_TRUE@libffi_convenience_la_OBJECTS = src/debug.lo src/prep_cif.lo \ -+@X86_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \ -+@X86_TRUE@src/x86/ffi.lo src/x86/sysv.lo -+@POWERPC_TRUE@libffi_convenience_la_OBJECTS = src/debug.lo \ -+@POWERPC_TRUE@src/prep_cif.lo src/types.lo src/raw_api.lo \ -+@POWERPC_TRUE@src/java_raw_api.lo src/powerpc/ffi.lo \ -+@POWERPC_TRUE@src/powerpc/sysv.lo src/powerpc/ppc_closure.lo -+@MIPS_LINUX_TRUE@libffi_convenience_la_OBJECTS = src/debug.lo \ -+@MIPS_LINUX_TRUE@src/prep_cif.lo src/types.lo src/raw_api.lo \ -+@MIPS_LINUX_TRUE@src/java_raw_api.lo src/mips/ffi.lo src/mips/o32.lo -+@X86_WIN32_TRUE@libffi_convenience_la_OBJECTS = src/debug.lo \ -+@X86_WIN32_TRUE@src/prep_cif.lo src/types.lo src/raw_api.lo \ -+@X86_WIN32_TRUE@src/java_raw_api.lo src/x86/ffi.lo src/x86/win32.lo -+@X86_64_TRUE@libffi_convenience_la_OBJECTS = src/debug.lo \ -+@X86_64_TRUE@src/prep_cif.lo src/types.lo src/raw_api.lo \ -+@X86_64_TRUE@src/java_raw_api.lo src/x86/ffi64.lo src/x86/unix64.lo \ -+@X86_64_TRUE@src/x86/ffi.lo src/x86/sysv.lo - @SPARC_TRUE@libffi_convenience_la_OBJECTS = src/debug.lo \ - @SPARC_TRUE@src/prep_cif.lo src/types.lo src/raw_api.lo \ - @SPARC_TRUE@src/java_raw_api.lo src/sparc/ffi.lo src/sparc/v8.lo \ -@@ -247,62 +275,75 @@ - @POWERPC_AIX_TRUE@libffi_convenience_la_OBJECTS = src/debug.lo \ - @POWERPC_AIX_TRUE@src/prep_cif.lo src/types.lo src/raw_api.lo \ - @POWERPC_AIX_TRUE@src/java_raw_api.lo src/powerpc/ffi_darwin.lo \ --@POWERPC_AIX_TRUE@src/powerpc/aix.lo src/powerpc/aix_closures.lo --@X86_TRUE@libffi_convenience_la_OBJECTS = src/debug.lo src/prep_cif.lo \ --@X86_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \ --@X86_TRUE@src/x86/ffi.lo src/x86/sysv.lo --@ARM_TRUE@libffi_convenience_la_OBJECTS = src/debug.lo src/prep_cif.lo \ --@ARM_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \ --@ARM_TRUE@src/arm/sysv.lo src/arm/ffi.lo -+@POWERPC_AIX_TRUE@src/powerpc/aix.lo src/powerpc/aix_closure.lo -+@MIPS_SGI_TRUE@libffi_convenience_la_OBJECTS = src/debug.lo \ -+@MIPS_SGI_TRUE@src/prep_cif.lo src/types.lo src/raw_api.lo \ -+@MIPS_SGI_TRUE@src/java_raw_api.lo src/mips/ffi.lo src/mips/o32.lo \ -+@MIPS_SGI_TRUE@src/mips/n32.lo - @POWERPC_DARWIN_TRUE@libffi_convenience_la_OBJECTS = src/debug.lo \ - @POWERPC_DARWIN_TRUE@src/prep_cif.lo src/types.lo src/raw_api.lo \ - @POWERPC_DARWIN_TRUE@src/java_raw_api.lo src/powerpc/ffi_darwin.lo \ - @POWERPC_DARWIN_TRUE@src/powerpc/darwin.lo \ - @POWERPC_DARWIN_TRUE@src/powerpc/darwin_closure.lo --@MIPS_SGI_TRUE@libffi_convenience_la_OBJECTS = src/debug.lo \ --@MIPS_SGI_TRUE@src/prep_cif.lo src/types.lo src/raw_api.lo \ --@MIPS_SGI_TRUE@src/java_raw_api.lo src/mips/ffi.lo src/mips/o32.lo \ --@MIPS_SGI_TRUE@src/mips/n32.lo -+@ARM_TRUE@libffi_convenience_la_OBJECTS = src/debug.lo src/prep_cif.lo \ -+@ARM_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \ -+@ARM_TRUE@src/arm/sysv.lo src/arm/ffi.lo -+@SH_TRUE@libffi_convenience_la_OBJECTS = src/debug.lo src/prep_cif.lo \ -+@SH_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \ -+@SH_TRUE@src/sh/sysv.lo src/sh/ffi.lo - libffi_la_LIBADD = -+@SH_TRUE@libffi_la_OBJECTS = src/debug.lo src/prep_cif.lo src/types.lo \ -+@SH_TRUE@src/raw_api.lo src/java_raw_api.lo src/sh/sysv.lo \ -+@SH_TRUE@src/sh/ffi.lo -+@IA64_TRUE@libffi_la_OBJECTS = src/debug.lo src/prep_cif.lo \ -+@IA64_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \ -+@IA64_TRUE@src/ia64/ffi.lo src/ia64/unix.lo -+@X86_TRUE@libffi_la_OBJECTS = src/debug.lo src/prep_cif.lo src/types.lo \ -+@X86_TRUE@src/raw_api.lo src/java_raw_api.lo src/x86/ffi.lo \ -+@X86_TRUE@src/x86/sysv.lo - @POWERPC_TRUE@libffi_la_OBJECTS = src/debug.lo src/prep_cif.lo \ - @POWERPC_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \ - @POWERPC_TRUE@src/powerpc/ffi.lo src/powerpc/sysv.lo \ - @POWERPC_TRUE@src/powerpc/ppc_closure.lo --@ALPHA_TRUE@libffi_la_OBJECTS = src/debug.lo src/prep_cif.lo \ --@ALPHA_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \ --@ALPHA_TRUE@src/alpha/ffi.lo src/alpha/osf.lo --@IA64_TRUE@libffi_la_OBJECTS = src/debug.lo src/prep_cif.lo \ --@IA64_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \ --@IA64_TRUE@src/ia64/ffi.lo src/ia64/unix.lo --@MIPS_GCC_TRUE@libffi_la_OBJECTS = src/debug.lo src/prep_cif.lo \ --@MIPS_GCC_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \ --@MIPS_GCC_TRUE@src/mips/ffi.lo src/mips/o32.lo src/mips/n32.lo --@X86_WIN32_TRUE@libffi_la_OBJECTS = src/debug.lo src/prep_cif.lo \ --@X86_WIN32_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \ --@X86_WIN32_TRUE@src/x86/ffi.lo src/x86/win32.lo --@M68K_TRUE@libffi_la_OBJECTS = src/debug.lo src/prep_cif.lo \ --@M68K_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \ --@M68K_TRUE@src/m68k/ffi.lo src/m68k/sysv.lo -+@MIPS_LINUX_TRUE@libffi_la_OBJECTS = src/debug.lo src/prep_cif.lo \ -+@MIPS_LINUX_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \ -+@MIPS_LINUX_TRUE@src/mips/ffi.lo src/mips/o32.lo - @SPARC_TRUE@libffi_la_OBJECTS = src/debug.lo src/prep_cif.lo \ - @SPARC_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \ - @SPARC_TRUE@src/sparc/ffi.lo src/sparc/v8.lo src/sparc/v9.lo - @POWERPC_AIX_TRUE@libffi_la_OBJECTS = src/debug.lo src/prep_cif.lo \ - @POWERPC_AIX_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \ - @POWERPC_AIX_TRUE@src/powerpc/ffi_darwin.lo src/powerpc/aix.lo \ --@POWERPC_AIX_TRUE@src/powerpc/aix_closures.lo --@X86_TRUE@libffi_la_OBJECTS = src/debug.lo src/prep_cif.lo src/types.lo \ --@X86_TRUE@src/raw_api.lo src/java_raw_api.lo src/x86/ffi.lo \ --@X86_TRUE@src/x86/sysv.lo -+@POWERPC_AIX_TRUE@src/powerpc/aix_closure.lo -+@MIPS_SGI_TRUE@libffi_la_OBJECTS = src/debug.lo src/prep_cif.lo \ -+@MIPS_SGI_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \ -+@MIPS_SGI_TRUE@src/mips/ffi.lo src/mips/o32.lo src/mips/n32.lo - @ARM_TRUE@libffi_la_OBJECTS = src/debug.lo src/prep_cif.lo src/types.lo \ - @ARM_TRUE@src/raw_api.lo src/java_raw_api.lo src/arm/sysv.lo \ - @ARM_TRUE@src/arm/ffi.lo -+@ALPHA_TRUE@libffi_la_OBJECTS = src/debug.lo src/prep_cif.lo \ -+@ALPHA_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \ -+@ALPHA_TRUE@src/alpha/ffi.lo src/alpha/osf.lo -+@MIPS_GCC_TRUE@libffi_la_OBJECTS = src/debug.lo src/prep_cif.lo \ -+@MIPS_GCC_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \ -+@MIPS_GCC_TRUE@src/mips/ffi.lo src/mips/o32.lo src/mips/n32.lo -+@S390_TRUE@libffi_la_OBJECTS = src/debug.lo src/prep_cif.lo \ -+@S390_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \ -+@S390_TRUE@src/s390/sysv.lo src/s390/ffi.lo -+@M68K_TRUE@libffi_la_OBJECTS = src/debug.lo src/prep_cif.lo \ -+@M68K_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \ -+@M68K_TRUE@src/m68k/ffi.lo src/m68k/sysv.lo -+@X86_WIN32_TRUE@libffi_la_OBJECTS = src/debug.lo src/prep_cif.lo \ -+@X86_WIN32_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \ -+@X86_WIN32_TRUE@src/x86/ffi.lo src/x86/win32.lo -+@X86_64_TRUE@libffi_la_OBJECTS = src/debug.lo src/prep_cif.lo \ -+@X86_64_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \ -+@X86_64_TRUE@src/x86/ffi64.lo src/x86/unix64.lo src/x86/ffi.lo \ -+@X86_64_TRUE@src/x86/sysv.lo - @POWERPC_DARWIN_TRUE@libffi_la_OBJECTS = src/debug.lo src/prep_cif.lo \ - @POWERPC_DARWIN_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \ - @POWERPC_DARWIN_TRUE@src/powerpc/ffi_darwin.lo src/powerpc/darwin.lo \ - @POWERPC_DARWIN_TRUE@src/powerpc/darwin_closure.lo --@MIPS_SGI_TRUE@libffi_la_OBJECTS = src/debug.lo src/prep_cif.lo \ --@MIPS_SGI_TRUE@src/types.lo src/raw_api.lo src/java_raw_api.lo \ --@MIPS_SGI_TRUE@src/mips/ffi.lo src/mips/o32.lo src/mips/n32.lo - noinst_PROGRAMS = ffitest$(EXEEXT) - PROGRAMS = $(noinst_PROGRAMS) - -@@ -578,8 +616,8 @@ - -chmod 777 $(distdir) - $(mkinstalldirs) $(distdir)/src/alpha $(distdir)/src/arm \ - $(distdir)/src/m68k $(distdir)/src/mips \ -- $(distdir)/src/powerpc $(distdir)/src/sparc \ -- $(distdir)/src/x86 -+ $(distdir)/src/powerpc $(distdir)/src/s390 $(distdir)/src/sh \ -+ $(distdir)/src/sparc $(distdir)/src/x86 - @for file in $(DISTFILES); do \ - if test -f $$file; then d=.; else d=$(srcdir); fi; \ - if test -d $$d/$$file; then \ -diff -ruN --exclude=CVS gcc-3.2.2.orig/libffi/acinclude.m4 gcc/libffi/acinclude.m4 ---- gcc-3.2.2.orig/libffi/acinclude.m4 Sun Sep 10 16:43:14 2000 -+++ gcc/libffi/acinclude.m4 Tue Dec 17 03:22:47 2002 -@@ -4,5 +4,8 @@ - dnl to add a definition of LIBTOOL to Makefile.in. - ifelse(yes,no,[ - AC_DEFUN([AC_PROG_LIBTOOL],) -+AC_DEFUN([AM_PROG_LIBTOOL],) - AC_SUBST(LIBTOOL) - ]) -+ -+sinclude(../config/accross.m4) -diff -ruN --exclude=CVS gcc-3.2.2.orig/libffi/aclocal.m4 gcc/libffi/aclocal.m4 ---- gcc-3.2.2.orig/libffi/aclocal.m4 Fri Feb 1 07:25:31 2002 -+++ gcc/libffi/aclocal.m4 Tue Dec 17 03:22:47 2002 -@@ -1,6 +1,6 @@ --dnl aclocal.m4 generated automatically by aclocal 1.4 -+dnl aclocal.m4 generated automatically by aclocal 1.4-p5 - --dnl Copyright (C) 1994, 1995-8, 1999 Free Software Foundation, Inc. -+dnl Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc. - dnl This file is free software; the Free Software Foundation - dnl gives unlimited permission to copy and/or distribute it, - dnl with or without modifications, as long as this notice is preserved. -@@ -16,108 +16,15 @@ - dnl to add a definition of LIBTOOL to Makefile.in. - ifelse(yes,no,[ - AC_DEFUN([AC_PROG_LIBTOOL],) -+AC_DEFUN([AM_PROG_LIBTOOL],) - AC_SUBST(LIBTOOL) - ]) - --AC_DEFUN([AC_COMPILE_CHECK_SIZEOF], --[changequote(<<, >>)dnl --dnl The name to #define. --define(<>, translit(sizeof_$1, [a-z *], [A-Z_P]))dnl --dnl The cache variable name. --define(<>, translit(ac_cv_sizeof_$1, [ *], [_p]))dnl --changequote([, ])dnl --AC_MSG_CHECKING(size of $1) --AC_CACHE_VAL(AC_CV_NAME, --[for ac_size in 4 8 1 2 16 12 $2 ; do # List sizes in rough order of prevalence. -- AC_TRY_COMPILE([#include "confdefs.h" --#include --$2 --], [switch (0) case 0: case (sizeof ($1) == $ac_size):;], AC_CV_NAME=$ac_size) -- if test x$AC_CV_NAME != x ; then break; fi --done --]) --if test x$AC_CV_NAME = x ; then -- AC_MSG_ERROR([cannot determine a size for $1]) --fi --AC_MSG_RESULT($AC_CV_NAME) --AC_DEFINE_UNQUOTED(AC_TYPE_NAME, $AC_CV_NAME, [The number of bytes in type $1]) --undefine([AC_TYPE_NAME])dnl --undefine([AC_CV_NAME])dnl --]) -- --AC_DEFUN([AC_C_BIGENDIAN_CROSS], --[AC_CACHE_CHECK(whether byte ordering is bigendian, ac_cv_c_bigendian, --[ac_cv_c_bigendian=unknown --# See if sys/param.h defines the BYTE_ORDER macro. --AC_TRY_COMPILE([#include --#include ], [ --#if !BYTE_ORDER || !BIG_ENDIAN || !LITTLE_ENDIAN -- bogus endian macros --#endif], [# It does; now see whether it defined to BIG_ENDIAN or not. --AC_TRY_COMPILE([#include --#include ], [ --#if BYTE_ORDER != BIG_ENDIAN -- not big endian --#endif], ac_cv_c_bigendian=yes, ac_cv_c_bigendian=no)]) --if test $ac_cv_c_bigendian = unknown; then --AC_TRY_RUN([main () { -- /* Are we little or big endian? From Harbison&Steele. */ -- union -- { -- long l; -- char c[sizeof (long)]; -- } u; -- u.l = 1; -- exit (u.c[sizeof (long) - 1] == 1); --}], ac_cv_c_bigendian=no, ac_cv_c_bigendian=yes, --[ echo $ac_n "cross-compiling... " 2>&AC_FD_MSG ]) --fi]) --if test $ac_cv_c_bigendian = unknown; then --AC_MSG_CHECKING(to probe for byte ordering) --[ --cat >conftest.c <&AC_FD_MSG -- ac_cv_c_bigendian=yes -- fi -- if test `grep -l LiTTleEnDian conftest.o` ; then -- echo $ac_n ' little endian probe OK, ' 1>&AC_FD_MSG -- if test $ac_cv_c_bigendian = yes ; then -- ac_cv_c_bigendian=unknown; -- else -- ac_cv_c_bigendian=no -- fi -- fi -- echo $ac_n 'guessing bigendian ... ' >&AC_FD_MSG -- fi -- fi --AC_MSG_RESULT($ac_cv_c_bigendian) --fi --if test $ac_cv_c_bigendian = yes; then -- AC_DEFINE(WORDS_BIGENDIAN, 1, [whether byteorder is bigendian]) -- BYTEORDER=4321 --else -- BYTEORDER=1234 --fi --AC_DEFINE_UNQUOTED(BYTEORDER, $BYTEORDER, [1234 = LIL_ENDIAN, 4321 = BIGENDIAN]) --if test $ac_cv_c_bigendian = unknown; then -- AC_MSG_ERROR(unknown endianess - sorry, please pre-set ac_cv_c_bigendian) --fi --]) -+sinclude(../config/accross.m4) - - # Like AC_CONFIG_HEADER, but automatically create stamp file. - --AC_DEFUN(AM_CONFIG_HEADER, -+AC_DEFUN([AM_CONFIG_HEADER], - [AC_PREREQ([2.12]) - AC_CONFIG_HEADER([$1]) - dnl When config.status generates a header, we must update the stamp-h file. -@@ -147,7 +54,7 @@ - dnl Usage: - dnl AM_INIT_AUTOMAKE(package,version, [no-define]) - --AC_DEFUN(AM_INIT_AUTOMAKE, -+AC_DEFUN([AM_INIT_AUTOMAKE], - [AC_REQUIRE([AC_PROG_INSTALL]) - PACKAGE=[$1] - AC_SUBST(PACKAGE) -@@ -175,7 +82,7 @@ - # Check to make sure that the build environment is sane. - # - --AC_DEFUN(AM_SANITY_CHECK, -+AC_DEFUN([AM_SANITY_CHECK], - [AC_MSG_CHECKING([whether build environment is sane]) - # Just in case - sleep 1 -@@ -216,7 +123,7 @@ - - dnl AM_MISSING_PROG(NAME, PROGRAM, DIRECTORY) - dnl The program must properly implement --version. --AC_DEFUN(AM_MISSING_PROG, -+AC_DEFUN([AM_MISSING_PROG], - [AC_MSG_CHECKING(for working $2) - # Run test in a subshell; some versions of sh will print an error if - # an executable is not found, even if stderr is redirected. -@@ -235,7 +142,7 @@ - - # serial 1 - --AC_DEFUN(AM_MAINTAINER_MODE, -+AC_DEFUN([AM_MAINTAINER_MODE], - [AC_MSG_CHECKING([whether to enable maintainer-specific portions of Makefiles]) - dnl maintainer-mode is disabled by default - AC_ARG_ENABLE(maintainer-mode, -@@ -252,7 +159,7 @@ - - # Define a conditional. - --AC_DEFUN(AM_CONDITIONAL, -+AC_DEFUN([AM_CONDITIONAL], - [AC_SUBST($1_TRUE) - AC_SUBST($1_FALSE) - if $2; then -diff -ruN --exclude=CVS gcc-3.2.2.orig/libffi/configure gcc/libffi/configure ---- gcc-3.2.2.orig/libffi/configure Wed Jan 29 07:59:05 2003 -+++ gcc/libffi/configure Sat Feb 1 20:16:19 2003 -@@ -633,17 +633,16 @@ - - if test "${srcdir}" = "."; then - if test "${with_target_subdir}" != "."; then -- libffi_basedir="${srcdir}/${with_multisrctop}.." -+ libffi_basedir="${with_multisrctop}../" - else -- libffi_basedir="${srcdir}/${with_multisrctop}" -+ libffi_basedir="${with_multisrctop}" - fi - else -- libffi_basedir="${srcdir}" -+ libffi_basedir= - fi - -- - ac_aux_dir= --for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do -+for ac_dir in ${libffi_basedir}.. $srcdir/${libffi_basedir}..; do - if test -f $ac_dir/install-sh; then - ac_aux_dir=$ac_dir - ac_install_sh="$ac_aux_dir/install-sh -c" -@@ -655,13 +654,14 @@ - fi - done - if test -z "$ac_aux_dir"; then -- { echo "configure: error: can not find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." 1>&2; exit 1; } -+ { echo "configure: error: can not find install-sh or install.sh in ${libffi_basedir}.. $srcdir/${libffi_basedir}.." 1>&2; exit 1; } - fi - ac_config_guess=$ac_aux_dir/config.guess - ac_config_sub=$ac_aux_dir/config.sub - ac_configure=$ac_aux_dir/configure # This should be Cygnus configure. - - -+ - # Make sure we can run config.sub. - if ${CONFIG_SHELL-/bin/sh} $ac_config_sub sun4 >/dev/null 2>&1; then : - else { echo "configure: error: can not run $ac_config_sub" 1>&2; exit 1; } -@@ -1238,9 +1238,18 @@ - ;; - - hpux10.20*|hpux11*) -- lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9].[0-9]) shared library' -- lt_cv_file_magic_cmd=/usr/bin/file -- lt_cv_file_magic_test_file=/usr/lib/libc.sl -+ case $host_cpu in -+ hppa*) -+ lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|PA-RISC[0-9].[0-9]) shared library' -+ lt_cv_file_magic_cmd=/usr/bin/file -+ lt_cv_file_magic_test_file=/usr/lib/libc.sl -+ ;; -+ ia64*) -+ lt_cv_deplibs_check_method='file_magic (s[0-9][0-9][0-9]|ELF-[0-9][0-9]) shared object file - IA64' -+ lt_cv_file_magic_cmd=/usr/bin/file -+ lt_cv_file_magic_test_file=/usr/lib/hpux32/libc.so -+ ;; -+ esac - ;; - - irix5* | irix6*) -@@ -1267,7 +1276,7 @@ - # This must be Linux ELF. - linux-gnu*) - case $host_cpu in -- alpha* | hppa* | i*86 | powerpc* | sparc* | ia64* ) -+ alpha* | hppa* | i*86 | powerpc* | sparc* | ia64* | sh* ) - lt_cv_deplibs_check_method=pass_all ;; - *) - # glibc up to 2.1.1 does not perform some relocations on ARM -@@ -1330,13 +1339,13 @@ - deplibs_check_method=$lt_cv_deplibs_check_method - - echo $ac_n "checking for object suffix""... $ac_c" 1>&6 --echo "configure:1334: checking for object suffix" >&5 -+echo "configure:1343: checking for object suffix" >&5 - if eval "test \"`echo '$''{'ac_cv_objext'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 - else - rm -f conftest* - echo 'int i = 1;' > conftest.$ac_ext --if { (eval echo configure:1340: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then -+if { (eval echo configure:1349: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then - for ac_file in conftest.*; do - case $ac_file in - *.c) ;; -@@ -1356,7 +1365,7 @@ - - - echo $ac_n "checking for executable suffix""... $ac_c" 1>&6 --echo "configure:1360: checking for executable suffix" >&5 -+echo "configure:1369: checking for executable suffix" >&5 - if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 - else -@@ -1366,7 +1375,7 @@ - rm -f conftest* - echo 'int main () { return 0; }' > conftest.$ac_ext - ac_cv_exeext= -- if { (eval echo configure:1370: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then -+ if { (eval echo configure:1379: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then - for file in conftest.*; do - case $file in - *.c | *.o | *.obj) ;; -@@ -1399,7 +1408,7 @@ - file_magic*) - if test "$file_magic_cmd" = '$MAGIC_CMD'; then - echo $ac_n "checking for ${ac_tool_prefix}file""... $ac_c" 1>&6 --echo "configure:1403: checking for ${ac_tool_prefix}file" >&5 -+echo "configure:1412: checking for ${ac_tool_prefix}file" >&5 - if eval "test \"`echo '$''{'lt_cv_path_MAGIC_CMD'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 - else -@@ -1461,7 +1470,7 @@ - if test -z "$lt_cv_path_MAGIC_CMD"; then - if test -n "$ac_tool_prefix"; then - echo $ac_n "checking for file""... $ac_c" 1>&6 --echo "configure:1465: checking for file" >&5 -+echo "configure:1474: checking for file" >&5 - if eval "test \"`echo '$''{'lt_cv_path_MAGIC_CMD'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 - else -@@ -1532,7 +1541,7 @@ - # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. - set dummy ${ac_tool_prefix}ranlib; ac_word=$2 - echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 --echo "configure:1536: checking for $ac_word" >&5 -+echo "configure:1545: checking for $ac_word" >&5 - if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 - else -@@ -1564,7 +1573,7 @@ - # Extract the first word of "ranlib", so it can be a program name with args. - set dummy ranlib; ac_word=$2 - echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 --echo "configure:1568: checking for $ac_word" >&5 -+echo "configure:1577: checking for $ac_word" >&5 - if eval "test \"`echo '$''{'ac_cv_prog_RANLIB'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 - else -@@ -1599,7 +1608,7 @@ - # Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args. - set dummy ${ac_tool_prefix}strip; ac_word=$2 - echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 --echo "configure:1603: checking for $ac_word" >&5 -+echo "configure:1612: checking for $ac_word" >&5 - if eval "test \"`echo '$''{'ac_cv_prog_STRIP'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 - else -@@ -1631,7 +1640,7 @@ - # Extract the first word of "strip", so it can be a program name with args. - set dummy strip; ac_word=$2 - echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 --echo "configure:1635: checking for $ac_word" >&5 -+echo "configure:1644: checking for $ac_word" >&5 - if eval "test \"`echo '$''{'ac_cv_prog_STRIP'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 - else -@@ -1698,8 +1707,8 @@ - case $host in - *-*-irix6*) - # Find out which ABI we are using. -- echo '#line 1702 "configure"' > conftest.$ac_ext -- if { (eval echo configure:1703: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then -+ echo '#line 1711 "configure"' > conftest.$ac_ext -+ if { (eval echo configure:1712: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then - case `/usr/bin/file conftest.$ac_objext` in - *32-bit*) - LD="${LD-ld} -32" -@@ -1715,12 +1724,70 @@ - rm -rf conftest* - ;; - -+ia64-*-hpux*) -+ # Find out which ABI we are using. -+ echo 'int i;' > conftest.$ac_ext -+ if { (eval echo configure:1731: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then -+ case "`/usr/bin/file conftest.o`" in -+ *ELF-32*) -+ HPUX_IA64_MODE="32" -+ ;; -+ *ELF-64*) -+ HPUX_IA64_MODE="64" -+ ;; -+ esac -+ fi -+ rm -rf conftest* -+ ;; -+ -+x86_64-*linux*|ppc*-*linux*|powerpc*-*linux*|s390*-*linux*|sparc*-*linux*) -+ # Find out which ABI we are using. -+ echo 'int i;' > conftest.$ac_ext -+ if { (eval echo configure:1747: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then -+ case "`/usr/bin/file conftest.o`" in -+ *32-bit*) -+ case $host in -+ x86_64-*linux*) -+ LD="${LD-ld} -m elf_i386" -+ ;; -+ ppc64-*linux*) -+ LD="${LD-ld} -m elf32ppclinux" -+ ;; -+ s390x-*linux*) -+ LD="${LD-ld} -m elf_s390" -+ ;; -+ sparc64-*linux*) -+ LD="${LD-ld} -m elf32_sparc" -+ ;; -+ esac -+ ;; -+ *64-bit*) -+ case $host in -+ x86_64-*linux*) -+ LD="${LD-ld} -m elf_x86_64" -+ ;; -+ ppc*-*linux*|powerpc*-*linux*) -+ LD="${LD-ld} -m elf64ppc" -+ ;; -+ s390*-*linux*) -+ LD="${LD-ld} -m elf64_s390" -+ ;; -+ sparc*-*linux*) -+ LD="${LD-ld} -m elf64_sparc" -+ ;; -+ esac -+ ;; -+ esac -+ fi -+ rm -rf conftest* -+ ;; -+ - *-*-sco3.2v5*) - # On SCO OpenServer 5, we need -belf to get full-featured binaries. - SAVE_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS -belf" - echo $ac_n "checking whether the C compiler needs -belf""... $ac_c" 1>&6 --echo "configure:1724: checking whether the C compiler needs -belf" >&5 -+echo "configure:1791: checking whether the C compiler needs -belf" >&5 - if eval "test \"`echo '$''{'lt_cv_cc_needs_belf'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 - else -@@ -1733,14 +1800,14 @@ - cross_compiling=$ac_cv_prog_cc_cross - - cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:1811: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - lt_cv_cc_needs_belf=yes - else -@@ -1868,7 +1935,7 @@ - # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" - # ./install, which can be erroneously created by make from ./install.sh. - echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 --echo "configure:1872: checking for a BSD compatible install" >&5 -+echo "configure:1939: checking for a BSD compatible install" >&5 - if test -z "$INSTALL"; then - if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -@@ -1921,7 +1988,7 @@ - test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' - - echo $ac_n "checking whether build environment is sane""... $ac_c" 1>&6 --echo "configure:1925: checking whether build environment is sane" >&5 -+echo "configure:1992: checking whether build environment is sane" >&5 - # Just in case - sleep 1 - echo timestamp > conftestfile -@@ -1978,7 +2045,7 @@ - test "$program_transform_name" = "" && program_transform_name="s,x,x," - - echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6 --echo "configure:1982: checking whether ${MAKE-make} sets \${MAKE}" >&5 -+echo "configure:2049: checking whether ${MAKE-make} sets \${MAKE}" >&5 - set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'` - if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -@@ -2017,7 +2084,7 @@ - - missing_dir=`cd $ac_aux_dir && pwd` - echo $ac_n "checking for working aclocal""... $ac_c" 1>&6 --echo "configure:2021: checking for working aclocal" >&5 -+echo "configure:2088: checking for working aclocal" >&5 - # Run test in a subshell; some versions of sh will print an error if - # an executable is not found, even if stderr is redirected. - # Redirect stdin to placate older versions of autoconf. Sigh. -@@ -2030,7 +2097,7 @@ - fi - - echo $ac_n "checking for working autoconf""... $ac_c" 1>&6 --echo "configure:2034: checking for working autoconf" >&5 -+echo "configure:2101: checking for working autoconf" >&5 - # Run test in a subshell; some versions of sh will print an error if - # an executable is not found, even if stderr is redirected. - # Redirect stdin to placate older versions of autoconf. Sigh. -@@ -2043,7 +2110,7 @@ - fi - - echo $ac_n "checking for working automake""... $ac_c" 1>&6 --echo "configure:2047: checking for working automake" >&5 -+echo "configure:2114: checking for working automake" >&5 - # Run test in a subshell; some versions of sh will print an error if - # an executable is not found, even if stderr is redirected. - # Redirect stdin to placate older versions of autoconf. Sigh. -@@ -2056,7 +2123,7 @@ - fi - - echo $ac_n "checking for working autoheader""... $ac_c" 1>&6 --echo "configure:2060: checking for working autoheader" >&5 -+echo "configure:2127: checking for working autoheader" >&5 - # Run test in a subshell; some versions of sh will print an error if - # an executable is not found, even if stderr is redirected. - # Redirect stdin to placate older versions of autoconf. Sigh. -@@ -2069,7 +2136,7 @@ - fi - - echo $ac_n "checking for working makeinfo""... $ac_c" 1>&6 --echo "configure:2073: checking for working makeinfo" >&5 -+echo "configure:2140: checking for working makeinfo" >&5 - # Run test in a subshell; some versions of sh will print an error if - # an executable is not found, even if stderr is redirected. - # Redirect stdin to placate older versions of autoconf. Sigh. -@@ -2086,7 +2153,7 @@ - - - echo $ac_n "checking for executable suffix""... $ac_c" 1>&6 --echo "configure:2090: checking for executable suffix" >&5 -+echo "configure:2157: checking for executable suffix" >&5 - if eval "test \"`echo '$''{'ac_cv_exeext'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 - else -@@ -2096,7 +2163,7 @@ - rm -f conftest* - echo 'int main () { return 0; }' > conftest.$ac_ext - ac_cv_exeext= -- if { (eval echo configure:2100: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then -+ if { (eval echo configure:2167: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; }; then - for file in conftest.*; do - case $file in - *.c | *.o | *.obj) ;; -@@ -2117,7 +2184,7 @@ - ac_exeext=$EXEEXT - - echo $ac_n "checking whether to enable maintainer-specific portions of Makefiles""... $ac_c" 1>&6 --echo "configure:2121: checking whether to enable maintainer-specific portions of Makefiles" >&5 -+echo "configure:2188: checking whether to enable maintainer-specific portions of Makefiles" >&5 - # Check whether --enable-maintainer-mode or --disable-maintainer-mode was given. - if test "${enable_maintainer_mode+set}" = set; then - enableval="$enable_maintainer_mode" -@@ -2143,7 +2210,7 @@ - # Extract the first word of "gcc", so it can be a program name with args. - set dummy gcc; ac_word=$2 - echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 --echo "configure:2147: checking for $ac_word" >&5 -+echo "configure:2214: checking for $ac_word" >&5 - if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 - else -@@ -2173,7 +2240,7 @@ - # Extract the first word of "cc", so it can be a program name with args. - set dummy cc; ac_word=$2 - echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 --echo "configure:2177: checking for $ac_word" >&5 -+echo "configure:2244: checking for $ac_word" >&5 - if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 - else -@@ -2224,7 +2291,7 @@ - # Extract the first word of "cl", so it can be a program name with args. - set dummy cl; ac_word=$2 - echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 --echo "configure:2228: checking for $ac_word" >&5 -+echo "configure:2295: checking for $ac_word" >&5 - if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 - else -@@ -2256,7 +2323,7 @@ - fi - - echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 --echo "configure:2260: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 -+echo "configure:2327: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 - - ac_ext=c - # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. -@@ -2267,12 +2334,12 @@ - - cat > conftest.$ac_ext << EOF - --#line 2271 "configure" -+#line 2338 "configure" - #include "confdefs.h" - - main(){return(0);} - EOF --if { (eval echo configure:2276: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:2343: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - ac_cv_prog_cc_works=yes - # If we can't run a trivial program, we are probably using a cross compiler. - if (./conftest; exit) 2>/dev/null; then -@@ -2298,12 +2365,12 @@ - { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; } - fi - echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 --echo "configure:2302: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 -+echo "configure:2369: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 - echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6 - cross_compiling=$ac_cv_prog_cc_cross - - echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 --echo "configure:2307: checking whether we are using GNU C" >&5 -+echo "configure:2374: checking whether we are using GNU C" >&5 - if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 - else -@@ -2312,7 +2379,7 @@ - yes; - #endif - EOF --if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:2316: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then -+if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:2383: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then - ac_cv_prog_gcc=yes - else - ac_cv_prog_gcc=no -@@ -2331,7 +2398,7 @@ - ac_save_CFLAGS="$CFLAGS" - CFLAGS= - echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 --echo "configure:2335: checking whether ${CC-cc} accepts -g" >&5 -+echo "configure:2402: checking whether ${CC-cc} accepts -g" >&5 - if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 - else -@@ -2381,17 +2448,23 @@ - i*86-*-mingw*) TARGET=X86_WIN32; TARGETDIR=x86;; - sparc-sun-4*) TARGET=SPARC; TARGETDIR=sparc;; - sparc*-sun-*) TARGET=SPARC; TARGETDIR=sparc;; --sparc-*-linux*) TARGET=SPARC; TARGETDIR=sparc;; --sparc64-*-linux*) TARGET=SPARC; TARGETDIR=sparc;; --alpha*-*-linux* | alpha*-*-osf* | alpha*-*-freebsd*) TARGET=ALPHA; TARGETDIR=alpha;; -+sparc-*-linux* | sparc-*-netbsdelf*) TARGET=SPARC; TARGETDIR=sparc;; -+sparc64-*-linux* | sparc64-*-netbsd*) TARGET=SPARC; TARGETDIR=sparc;; -+alpha*-*-linux* | alpha*-*-osf* | alpha*-*-freebsd* | alpha*-*-netbsd*) TARGET=ALPHA; TARGETDIR=alpha;; - ia64*-*-*) TARGET=IA64; TARGETDIR=ia64;; - m68k-*-linux*) TARGET=M68K; TARGETDIR=m68k;; -+mips64*-*);; -+mips*-*-linux*) TARGET=MIPS_LINUX; TARGETDIR=mips;; - powerpc-*-linux* | powerpc-*-sysv*) TARGET=POWERPC; TARGETDIR=powerpc;; - powerpc-*-beos*) TARGET=POWERPC; TARGETDIR=powerpc;; - powerpc-*-darwin*) TARGET=POWERPC_DARWIN; TARGETDIR=powerpc;; - powerpc-*-aix*) TARGET=POWERPC_AIX; TARGETDIR=powerpc;; - rs6000-*-aix*) TARGET=POWERPC_AIX; TARGETDIR=powerpc;; - arm*-*-linux-*) TARGET=ARM; TARGETDIR=arm;; -+s390-*-linux-*) TARGET=S390; TARGETDIR=s390;; -+s390x-*-linux-*) TARGET=S390; TARGETDIR=s390;; -+x86_64-*-linux*) TARGET=X86_64; TARGETDIR=x86;; -+sh-*-linux* | sh[34]*-*-linux*) TARGET=SH; TARGETDIR=sh;; - esac - - if test $TARGETDIR = unknown; then -@@ -2418,6 +2491,15 @@ - fi - - -+if test x$TARGET = xMIPS_LINUX; then -+ MIPS_LINUX_TRUE= -+ MIPS_LINUX_FALSE='#' -+else -+ MIPS_LINUX_TRUE='#' -+ MIPS_LINUX_FALSE= -+fi -+ -+ - if test x$TARGET = xSPARC; then - SPARC_TRUE= - SPARC_FALSE='#' -@@ -2507,8 +2589,39 @@ - ARM_FALSE= - fi - -+ -+if test x$TARGET = xS390; then -+ S390_TRUE= -+ S390_FALSE='#' -+else -+ S390_TRUE='#' -+ S390_FALSE= -+fi -+ -+ -+if test x$TARGET = xX86_64; then -+ X86_64_TRUE= -+ X86_64_FALSE='#' -+else -+ X86_64_TRUE='#' -+ X86_64_FALSE= -+fi -+ -+ -+if test x$TARGET = xSH; then -+ SH_TRUE= -+ SH_FALSE='#' -+else -+ SH_TRUE='#' -+ SH_FALSE= -+fi -+ -+if test x$TARGET = xMIPS_LINUX; then -+ TARGET=MIPS -+fi -+ - echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 --echo "configure:2512: checking how to run the C preprocessor" >&5 -+echo "configure:2625: checking how to run the C preprocessor" >&5 - # On Suns, sometimes $CPP names a directory. - if test -n "$CPP" && test -d "$CPP"; then - CPP= -@@ -2523,13 +2636,13 @@ - # On the NeXT, cc -E runs the code through the compiler's parser, - # not just through cpp. - cat > conftest.$ac_ext < - Syntax Error - EOF - ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" --{ (eval echo configure:2533: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -+{ (eval echo configure:2646: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } - ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` - if test -z "$ac_err"; then - : -@@ -2540,13 +2653,13 @@ - rm -rf conftest* - CPP="${CC-cc} -E -traditional-cpp" - cat > conftest.$ac_ext < - Syntax Error - EOF - ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" --{ (eval echo configure:2550: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -+{ (eval echo configure:2663: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } - ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` - if test -z "$ac_err"; then - : -@@ -2557,13 +2670,13 @@ - rm -rf conftest* - CPP="${CC-cc} -nologo -E" - cat > conftest.$ac_ext < - Syntax Error - EOF - ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" --{ (eval echo configure:2567: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -+{ (eval echo configure:2680: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } - ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` - if test -z "$ac_err"; then - : -@@ -2588,12 +2701,12 @@ - echo "$ac_t""$CPP" 1>&6 - - echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 --echo "configure:2592: checking for ANSI C header files" >&5 -+echo "configure:2705: checking for ANSI C header files" >&5 - if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 - else - cat > conftest.$ac_ext < - #include -@@ -2601,7 +2714,7 @@ - #include - EOF - ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" --{ (eval echo configure:2605: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } -+{ (eval echo configure:2718: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } - ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` - if test -z "$ac_err"; then - rm -rf conftest* -@@ -2618,7 +2731,7 @@ - if test $ac_cv_header_stdc = yes; then - # SunOS 4.x string.h does not declare mem*, contrary to ANSI. - cat > conftest.$ac_ext < - EOF -@@ -2636,7 +2749,7 @@ - if test $ac_cv_header_stdc = yes; then - # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. - cat > conftest.$ac_ext < - EOF -@@ -2657,7 +2770,7 @@ - : - else - cat > conftest.$ac_ext < - #define ISLOWER(c) ('a' <= (c) && (c) <= 'z') -@@ -2668,7 +2781,7 @@ - exit (0); } - - EOF --if { (eval echo configure:2672: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null -+if { (eval echo configure:2785: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null - then - : - else -@@ -2694,12 +2807,12 @@ - for ac_func in memcpy - do - echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 --echo "configure:2698: checking for $ac_func" >&5 -+echo "configure:2811: checking for $ac_func" >&5 - if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 - else - cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:2839: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_func_$ac_func=yes" - else -@@ -2749,19 +2862,19 @@ - # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works - # for constant arguments. Useless! - echo $ac_n "checking for working alloca.h""... $ac_c" 1>&6 --echo "configure:2753: checking for working alloca.h" >&5 -+echo "configure:2866: checking for working alloca.h" >&5 - if eval "test \"`echo '$''{'ac_cv_header_alloca_h'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 - else - cat > conftest.$ac_ext < - int main() { - char *p = alloca(2 * sizeof(int)); - ; return 0; } - EOF --if { (eval echo configure:2765: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:2878: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - ac_cv_header_alloca_h=yes - else -@@ -2782,12 +2895,12 @@ - fi - - echo $ac_n "checking for alloca""... $ac_c" 1>&6 --echo "configure:2786: checking for alloca" >&5 -+echo "configure:2899: checking for alloca" >&5 - if eval "test \"`echo '$''{'ac_cv_func_alloca_works'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 - else - cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:2932: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - ac_cv_func_alloca_works=yes - else -@@ -2847,12 +2960,12 @@ - - - echo $ac_n "checking whether alloca needs Cray hooks""... $ac_c" 1>&6 --echo "configure:2851: checking whether alloca needs Cray hooks" >&5 -+echo "configure:2964: checking whether alloca needs Cray hooks" >&5 - if eval "test \"`echo '$''{'ac_cv_os_cray'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 - else - cat > conftest.$ac_ext <&6 --echo "configure:2881: checking for $ac_func" >&5 -+echo "configure:2994: checking for $ac_func" >&5 - if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 - else - cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:3022: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_func_$ac_func=yes" - else -@@ -2932,7 +3045,7 @@ - fi - - echo $ac_n "checking stack direction for C alloca""... $ac_c" 1>&6 --echo "configure:2936: checking stack direction for C alloca" >&5 -+echo "configure:3049: checking stack direction for C alloca" >&5 - if eval "test \"`echo '$''{'ac_cv_c_stack_direction'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 - else -@@ -2940,7 +3053,7 @@ - ac_cv_c_stack_direction=0 - else - cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null -+if { (eval echo configure:3076: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null - then - ac_cv_c_stack_direction=1 - else -@@ -2982,13 +3095,13 @@ - - - echo $ac_n "checking size of short""... $ac_c" 1>&6 --echo "configure:2986: checking size of short" >&5 -+echo "configure:3099: checking size of short" >&5 - if eval "test \"`echo '$''{'ac_cv_sizeof_short'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 - else - for ac_size in 4 8 1 2 16 12 ; do # List sizes in rough order of prevalence. - cat > conftest.$ac_ext < -@@ -2998,7 +3111,7 @@ - switch (0) case 0: case (sizeof (short) == $ac_size):; - ; return 0; } - EOF --if { (eval echo configure:3002: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then -+if { (eval echo configure:3115: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then - rm -rf conftest* - ac_cv_sizeof_short=$ac_size - else -@@ -3021,13 +3134,13 @@ - - - echo $ac_n "checking size of int""... $ac_c" 1>&6 --echo "configure:3025: checking size of int" >&5 -+echo "configure:3138: checking size of int" >&5 - if eval "test \"`echo '$''{'ac_cv_sizeof_int'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 - else - for ac_size in 4 8 1 2 16 12 ; do # List sizes in rough order of prevalence. - cat > conftest.$ac_ext < -@@ -3037,7 +3150,7 @@ - switch (0) case 0: case (sizeof (int) == $ac_size):; - ; return 0; } - EOF --if { (eval echo configure:3041: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then -+if { (eval echo configure:3154: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then - rm -rf conftest* - ac_cv_sizeof_int=$ac_size - else -@@ -3060,13 +3173,13 @@ - - - echo $ac_n "checking size of long""... $ac_c" 1>&6 --echo "configure:3064: checking size of long" >&5 -+echo "configure:3177: checking size of long" >&5 - if eval "test \"`echo '$''{'ac_cv_sizeof_long'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 - else - for ac_size in 4 8 1 2 16 12 ; do # List sizes in rough order of prevalence. - cat > conftest.$ac_ext < -@@ -3076,7 +3189,7 @@ - switch (0) case 0: case (sizeof (long) == $ac_size):; - ; return 0; } - EOF --if { (eval echo configure:3080: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then -+if { (eval echo configure:3193: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then - rm -rf conftest* - ac_cv_sizeof_long=$ac_size - else -@@ -3099,13 +3212,13 @@ - - - echo $ac_n "checking size of long long""... $ac_c" 1>&6 --echo "configure:3103: checking size of long long" >&5 -+echo "configure:3216: checking size of long long" >&5 - if eval "test \"`echo '$''{'ac_cv_sizeof_long_long'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 - else - for ac_size in 4 8 1 2 16 12 ; do # List sizes in rough order of prevalence. - cat > conftest.$ac_ext < -@@ -3115,7 +3228,7 @@ - switch (0) case 0: case (sizeof (long long) == $ac_size):; - ; return 0; } - EOF --if { (eval echo configure:3119: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then -+if { (eval echo configure:3232: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then - rm -rf conftest* - ac_cv_sizeof_long_long=$ac_size - else -@@ -3138,13 +3251,13 @@ - - - echo $ac_n "checking size of float""... $ac_c" 1>&6 --echo "configure:3142: checking size of float" >&5 -+echo "configure:3255: checking size of float" >&5 - if eval "test \"`echo '$''{'ac_cv_sizeof_float'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 - else - for ac_size in 4 8 1 2 16 12 ; do # List sizes in rough order of prevalence. - cat > conftest.$ac_ext < -@@ -3154,7 +3267,7 @@ - switch (0) case 0: case (sizeof (float) == $ac_size):; - ; return 0; } - EOF --if { (eval echo configure:3158: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then -+if { (eval echo configure:3271: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then - rm -rf conftest* - ac_cv_sizeof_float=$ac_size - else -@@ -3177,13 +3290,13 @@ - - - echo $ac_n "checking size of double""... $ac_c" 1>&6 --echo "configure:3181: checking size of double" >&5 -+echo "configure:3294: checking size of double" >&5 - if eval "test \"`echo '$''{'ac_cv_sizeof_double'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 - else - for ac_size in 4 8 1 2 16 12 ; do # List sizes in rough order of prevalence. - cat > conftest.$ac_ext < -@@ -3193,7 +3306,7 @@ - switch (0) case 0: case (sizeof (double) == $ac_size):; - ; return 0; } - EOF --if { (eval echo configure:3197: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then -+if { (eval echo configure:3310: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then - rm -rf conftest* - ac_cv_sizeof_double=$ac_size - else -@@ -3216,13 +3329,13 @@ - - - echo $ac_n "checking size of long double""... $ac_c" 1>&6 --echo "configure:3220: checking size of long double" >&5 -+echo "configure:3333: checking size of long double" >&5 - if eval "test \"`echo '$''{'ac_cv_sizeof_long_double'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 - else - for ac_size in 4 8 1 2 16 12 ; do # List sizes in rough order of prevalence. - cat > conftest.$ac_ext < -@@ -3232,7 +3345,7 @@ - switch (0) case 0: case (sizeof (long double) == $ac_size):; - ; return 0; } - EOF --if { (eval echo configure:3236: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then -+if { (eval echo configure:3349: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then - rm -rf conftest* - ac_cv_sizeof_long_double=$ac_size - else -@@ -3256,13 +3369,13 @@ - - - echo $ac_n "checking size of void *""... $ac_c" 1>&6 --echo "configure:3260: checking size of void *" >&5 -+echo "configure:3373: checking size of void *" >&5 - if eval "test \"`echo '$''{'ac_cv_sizeof_void_p'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 - else - for ac_size in 4 8 1 2 16 12 ; do # List sizes in rough order of prevalence. - cat > conftest.$ac_ext < -@@ -3272,7 +3385,7 @@ - switch (0) case 0: case (sizeof (void *) == $ac_size):; - ; return 0; } - EOF --if { (eval echo configure:3276: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then -+if { (eval echo configure:3389: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then - rm -rf conftest* - ac_cv_sizeof_void_p=$ac_size - else -@@ -3295,14 +3408,14 @@ - - - echo $ac_n "checking whether byte ordering is bigendian""... $ac_c" 1>&6 --echo "configure:3299: checking whether byte ordering is bigendian" >&5 -+echo "configure:3412: checking whether byte ordering is bigendian" >&5 - if eval "test \"`echo '$''{'ac_cv_c_bigendian'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 - else - ac_cv_c_bigendian=unknown - # See if sys/param.h defines the BYTE_ORDER macro. - cat > conftest.$ac_ext < - #include -@@ -3313,11 +3426,11 @@ - #endif - ; return 0; } - EOF --if { (eval echo configure:3317: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then -+if { (eval echo configure:3430: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then - rm -rf conftest* - # It does; now see whether it defined to BIG_ENDIAN or not. - cat > conftest.$ac_ext < - #include -@@ -3328,7 +3441,7 @@ - #endif - ; return 0; } - EOF --if { (eval echo configure:3332: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then -+if { (eval echo configure:3445: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then - rm -rf conftest* - ac_cv_c_bigendian=yes - else -@@ -3348,7 +3461,7 @@ - echo $ac_n "cross-compiling... " 2>&6 - else - cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null -+if { (eval echo configure:3478: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null - then - ac_cv_c_bigendian=no - else -@@ -3379,7 +3492,7 @@ - echo "$ac_t""$ac_cv_c_bigendian" 1>&6 - if test $ac_cv_c_bigendian = unknown; then - echo $ac_n "checking to probe for byte ordering""... $ac_c" 1>&6 --echo "configure:3383: checking to probe for byte ordering" >&5 -+echo "configure:3496: checking to probe for byte ordering" >&5 - - cat >conftest.c <> confdefs.h <<\EOF -+#define HOST_WORDS_BIG_ENDIAN 1 -+EOF -+ - BYTEORDER=4321 - else - BYTEORDER=1234 -@@ -3429,7 +3546,7 @@ - - if test x$TARGET = xSPARC; then - echo $ac_n "checking assembler and linker support unaligned pc related relocs""... $ac_c" 1>&6 --echo "configure:3433: checking assembler and linker support unaligned pc related relocs" >&5 -+echo "configure:3550: checking assembler and linker support unaligned pc related relocs" >&5 - if eval "test \"`echo '$''{'libffi_cv_as_sparc_ua_pcrel'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 - else -@@ -3439,14 +3556,14 @@ - CFLAGS="$CFLAGS -fpic" - LDFLAGS="$LDFLAGS -shared" - cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then -+if { (eval echo configure:3567: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - libffi_cv_as_sparc_ua_pcrel=yes - else -@@ -3709,6 +3826,8 @@ - s%@MIPS_GCC_FALSE@%$MIPS_GCC_FALSE%g - s%@MIPS_SGI_TRUE@%$MIPS_SGI_TRUE%g - s%@MIPS_SGI_FALSE@%$MIPS_SGI_FALSE%g -+s%@MIPS_LINUX_TRUE@%$MIPS_LINUX_TRUE%g -+s%@MIPS_LINUX_FALSE@%$MIPS_LINUX_FALSE%g - s%@SPARC_TRUE@%$SPARC_TRUE%g - s%@SPARC_FALSE@%$SPARC_FALSE%g - s%@X86_TRUE@%$X86_TRUE%g -@@ -3729,6 +3848,12 @@ - s%@POWERPC_DARWIN_FALSE@%$POWERPC_DARWIN_FALSE%g - s%@ARM_TRUE@%$ARM_TRUE%g - s%@ARM_FALSE@%$ARM_FALSE%g -+s%@S390_TRUE@%$S390_TRUE%g -+s%@S390_FALSE@%$S390_FALSE%g -+s%@X86_64_TRUE@%$X86_64_TRUE%g -+s%@X86_64_FALSE@%$X86_64_FALSE%g -+s%@SH_TRUE@%$SH_TRUE%g -+s%@SH_FALSE@%$SH_FALSE%g - s%@CPP@%$CPP%g - s%@ALLOCA@%$ALLOCA%g - s%@TARGET@%$TARGET%g -@@ -3969,7 +4094,7 @@ - - if test -n "$CONFIG_FILES"; then - LD="${ORIGINAL_LD_FOR_MULTILIBS}" -- ac_file=Makefile . ${libffi_basedir}/../config-ml.in -+ ac_file=Makefile . ${srcdir}/${libffi_basedir}../config-ml.in - fi - - exit 0 -diff -ruN --exclude=CVS gcc-3.2.2.orig/libffi/configure.in gcc/libffi/configure.in ---- gcc-3.2.2.orig/libffi/configure.in Tue Jan 28 10:43:56 2003 -+++ gcc/libffi/configure.in Sat Feb 1 20:16:19 2003 -@@ -22,14 +22,15 @@ - - if test "${srcdir}" = "."; then - if test "${with_target_subdir}" != "."; then -- libffi_basedir="${srcdir}/${with_multisrctop}.." -+ libffi_basedir="${with_multisrctop}../" - else -- libffi_basedir="${srcdir}/${with_multisrctop}" -+ libffi_basedir="${with_multisrctop}" - fi - else -- libffi_basedir="${srcdir}" -+ libffi_basedir= - fi - AC_SUBST(libffi_basedir) -+AC_CONFIG_AUX_DIR(${libffi_basedir}..) - - AC_CANONICAL_HOST - -@@ -56,17 +57,23 @@ - i*86-*-mingw*) TARGET=X86_WIN32; TARGETDIR=x86;; - sparc-sun-4*) TARGET=SPARC; TARGETDIR=sparc;; - sparc*-sun-*) TARGET=SPARC; TARGETDIR=sparc;; --sparc-*-linux*) TARGET=SPARC; TARGETDIR=sparc;; --sparc64-*-linux*) TARGET=SPARC; TARGETDIR=sparc;; --alpha*-*-linux* | alpha*-*-osf* | alpha*-*-freebsd*) TARGET=ALPHA; TARGETDIR=alpha;; -+sparc-*-linux* | sparc-*-netbsdelf*) TARGET=SPARC; TARGETDIR=sparc;; -+sparc64-*-linux* | sparc64-*-netbsd*) TARGET=SPARC; TARGETDIR=sparc;; -+alpha*-*-linux* | alpha*-*-osf* | alpha*-*-freebsd* | alpha*-*-netbsd*) TARGET=ALPHA; TARGETDIR=alpha;; - ia64*-*-*) TARGET=IA64; TARGETDIR=ia64;; - m68k-*-linux*) TARGET=M68K; TARGETDIR=m68k;; -+mips64*-*);; -+mips*-*-linux*) TARGET=MIPS_LINUX; TARGETDIR=mips;; - powerpc-*-linux* | powerpc-*-sysv*) TARGET=POWERPC; TARGETDIR=powerpc;; - powerpc-*-beos*) TARGET=POWERPC; TARGETDIR=powerpc;; - powerpc-*-darwin*) TARGET=POWERPC_DARWIN; TARGETDIR=powerpc;; - powerpc-*-aix*) TARGET=POWERPC_AIX; TARGETDIR=powerpc;; - rs6000-*-aix*) TARGET=POWERPC_AIX; TARGETDIR=powerpc;; - arm*-*-linux-*) TARGET=ARM; TARGETDIR=arm;; -+s390-*-linux-*) TARGET=S390; TARGETDIR=s390;; -+s390x-*-linux-*) TARGET=S390; TARGETDIR=s390;; -+x86_64-*-linux*) TARGET=X86_64; TARGETDIR=x86;; -+sh-*-linux* | sh[[34]]*-*-linux*) TARGET=SH; TARGETDIR=sh;; - esac - - if test $TARGETDIR = unknown; then -@@ -75,6 +82,7 @@ - - AM_CONDITIONAL(MIPS_GCC, test ${TARGET}${ac_cv_prog_gcc} = MIPSyes) - AM_CONDITIONAL(MIPS_SGI, test ${TARGET}${ac_cv_prog_gcc} = MIPSno) -+AM_CONDITIONAL(MIPS_LINUX, test x$TARGET = xMIPS_LINUX) - AM_CONDITIONAL(SPARC, test x$TARGET = xSPARC) - AM_CONDITIONAL(X86, test x$TARGET = xX86) - AM_CONDITIONAL(X86_WIN32, test x$TARGET = xX86_WIN32) -@@ -85,6 +93,13 @@ - AM_CONDITIONAL(POWERPC_AIX, test x$TARGET = xPOWERPC_AIX) - AM_CONDITIONAL(POWERPC_DARWIN, test x$TARGET = xPOWERPC_DARWIN) - AM_CONDITIONAL(ARM, test x$TARGET = xARM) -+AM_CONDITIONAL(S390, test x$TARGET = xS390) -+AM_CONDITIONAL(X86_64, test x$TARGET = xX86_64) -+AM_CONDITIONAL(SH, test x$TARGET = xSH) -+ -+if test x$TARGET = xMIPS_LINUX; then -+ TARGET=MIPS -+fi - - AC_HEADER_STDC - AC_CHECK_FUNCS(memcpy) -@@ -171,7 +186,7 @@ - [ - if test -n "$CONFIG_FILES"; then - LD="${ORIGINAL_LD_FOR_MULTILIBS}" -- ac_file=Makefile . ${libffi_basedir}/../config-ml.in -+ ac_file=Makefile . ${srcdir}/${libffi_basedir}../config-ml.in - fi - ], - srcdir=${srcdir} -diff -ruN --exclude=CVS gcc-3.2.2.orig/libffi/include/Makefile.in gcc/libffi/include/Makefile.in ---- gcc-3.2.2.orig/libffi/include/Makefile.in Tue Oct 9 14:32:16 2001 -+++ gcc/libffi/include/Makefile.in Mon Apr 29 13:14:44 2002 -@@ -99,7 +99,7 @@ - - DISTFILES = $(DIST_COMMON) $(SOURCES) $(HEADERS) $(TEXINFOS) $(EXTRA_DIST) - --TAR = gnutar -+TAR = gtar - GZIP_ENV = --best - all: all-redirect - .SUFFIXES: -diff -ruN --exclude=CVS gcc-3.2.2.orig/libffi/include/ffi.h.in gcc/libffi/include/ffi.h.in ---- gcc-3.2.2.orig/libffi/include/ffi.h.in Wed Mar 13 07:35:56 2002 -+++ gcc/libffi/include/ffi.h.in Wed Jan 29 00:54:28 2003 -@@ -1,5 +1,5 @@ - /* -----------------------------------------------------------------*-C-*- -- libffi @VERSION@ - Copyright (c) 1996-2002 Cygnus Solutions -+ libffi @VERSION@ - Copyright (c) 1996-2003 Cygnus Solutions - - Permission is hereby granted, free of charge, to any person obtaining - a copy of this software and associated documentation files (the -@@ -164,6 +164,12 @@ - #endif - #endif - -+#ifdef S390 -+#if defined (__s390x__) -+#define S390X -+#endif -+#endif -+ - #ifndef LIBFFI_ASM - - /* ---- Generic type definitions ----------------------------------------- */ -@@ -189,16 +195,23 @@ - #endif - #endif - -- /* ---- Intel x86 ---------------- */ --#ifdef X86 -+ /* ---- Intel x86 Win32 ---------- */ -+#ifdef X86_WIN32 - FFI_SYSV, -+ FFI_STDCALL, -+ /* TODO: Add fastcall support for the sake of completeness */ - FFI_DEFAULT_ABI = FFI_SYSV, - #endif - -- /* ---- Intel x86 Win32 ---------- */ --#ifdef X86_WIN32 -+ /* ---- Intel x86 and AMD x86-64 - */ -+#if !defined(X86_WIN32) && (defined(__i386__) || defined(__x86_64__)) - FFI_SYSV, -+ FFI_UNIX64, /* Unix variants all use the same ABI for x86-64 */ -+#ifdef __i386__ - FFI_DEFAULT_ABI = FFI_SYSV, -+#else -+ FFI_DEFAULT_ABI = FFI_UNIX64, -+#endif - #endif - - /* ---- Intel ia64 ---------------- */ -@@ -251,6 +264,18 @@ - FFI_DEFAULT_ABI = FFI_SYSV, - #endif - -+ /* ---- S390 --------------------- */ -+#ifdef S390 -+ FFI_SYSV, -+ FFI_DEFAULT_ABI = FFI_SYSV, -+#endif -+ -+ /* ---- SuperH ------------------- */ -+#ifdef SH -+ FFI_SYSV, -+ FFI_DEFAULT_ABI = FFI_SYSV, -+#endif -+ - /* Leave this for debugging purposes */ - FFI_LAST_ABI - -@@ -264,7 +289,7 @@ - /*@null@*/ struct _ffi_type **elements; - } ffi_type; - --/* These are defined in ffi.c */ -+/* These are defined in types.c */ - extern ffi_type ffi_type_void; - extern ffi_type ffi_type_uint8; - extern ffi_type ffi_type_sint8; -@@ -373,13 +398,7 @@ - - /* ---- Definitions for closures ----------------------------------------- */ - --#ifdef X86 -- --#define FFI_CLOSURES 1 /* x86 supports closures */ --#define FFI_TRAMPOLINE_SIZE 10 --#define FFI_NATIVE_RAW_API 1 /* and has native raw api support */ -- --#elif defined(X86_WIN32) -+#ifdef __i386__ - - #define FFI_CLOSURES 1 /* x86 supports closures */ - #define FFI_TRAMPOLINE_SIZE 10 -@@ -424,6 +443,40 @@ - #define FFI_TRAMPOLINE_SIZE 24 /* see struct below */ - #define FFI_NATIVE_RAW_API 0 - -+#elif defined(SPARC64) -+ -+#define FFI_CLOSURES 1 -+#define FFI_TRAMPOLINE_SIZE 24 -+#define FFI_NATIVE_RAW_API 0 -+ -+#elif defined(SPARC) -+ -+#define FFI_CLOSURES 1 -+#define FFI_TRAMPOLINE_SIZE 16 -+#define FFI_NATIVE_RAW_API 0 -+ -+#elif defined(S390) -+ -+#define FFI_CLOSURES 1 -+#ifdef S390X -+#define FFI_TRAMPOLINE_SIZE 32 -+#else -+#define FFI_TRAMPOLINE_SIZE 16 -+#endif -+#define FFI_NATIVE_RAW_API 0 -+ -+#elif defined(SH) -+ -+#define FFI_CLOSURES 1 -+#define FFI_TRAMPOLINE_SIZE 16 -+#define FFI_NATIVE_RAW_API 0 -+ -+#elif defined(__x86_64__) -+ -+#define FFI_CLOSURES 1 -+#define FFI_TRAMPOLINE_SIZE 24 -+#define FFI_NATIVE_RAW_API 0 -+ - #else - - #define FFI_CLOSURES 0 -diff -ruN --exclude=CVS gcc-3.2.2.orig/libffi/src/arm/ffi.c gcc/libffi/src/arm/ffi.c ---- gcc-3.2.2.orig/libffi/src/arm/ffi.c Sat Mar 3 07:21:23 2001 -+++ gcc/libffi/src/arm/ffi.c Fri Jul 19 08:08:30 2002 -@@ -36,13 +36,10 @@ - /*@=exportheader@*/ - { - register unsigned int i; -- register int tmp; -- register unsigned int avn; - register void **p_argv; - register char *argp; - register ffi_type **p_arg; - -- tmp = 0; - argp = stack; - - if ( ecif->cif->rtype->type == FFI_TYPE_STRUCT ) { -@@ -50,11 +47,10 @@ - argp += 4; - } - -- avn = ecif->cif->nargs; - p_argv = ecif->avalue; - - for (i = ecif->cif->nargs, p_arg = ecif->cif->arg_types; -- (i != 0) && (avn != 0); -+ (i != 0); - i--, p_arg++) - { - size_t z; -@@ -64,9 +60,6 @@ - argp = (char *) ALIGN(argp, (*p_arg)->alignment); - } - -- if (avn != 0) -- { -- avn--; - z = (*p_arg)->size; - if (z < sizeof(int)) - { -@@ -107,7 +100,6 @@ - } - p_argv++; - argp += z; -- } - } - - return; -diff -ruN --exclude=CVS gcc-3.2.2.orig/libffi/src/arm/sysv.S gcc/libffi/src/arm/sysv.S ---- gcc-3.2.2.orig/libffi/src/arm/sysv.S Sat Mar 3 07:21:23 2001 -+++ gcc/libffi/src/arm/sysv.S Mon Sep 30 03:08:58 2002 -@@ -28,8 +28,15 @@ - #ifdef HAVE_MACHINE_ASM_H - #include - #else --/* XXX these lose for some platforms, I'm sure. */ -+#ifdef __USER_LABEL_PREFIX__ -+#define CONCAT1(a, b) CONCAT2(a, b) -+#define CONCAT2(a, b) a ## b -+ -+/* Use the right prefix for global labels. */ -+#define CNAME(x) CONCAT1 (__USER_LABEL_PREFIX__, x) -+#else - #define CNAME(x) x -+#endif - #define ENTRY(x) .globl CNAME(x); .type CNAME(x),%function; CNAME(x): - #endif - -@@ -96,12 +103,20 @@ - - # return FLOAT - cmp a4, #FFI_TYPE_FLOAT -+#ifdef __SOFTFP__ -+ streq a1, [a3] -+#else - stfeqs f0, [a3] -+#endif - beq epilogue - - # return DOUBLE or LONGDOUBLE - cmp a4, #FFI_TYPE_DOUBLE -+#ifdef __SOFTFP__ -+ stmeqia a3, {a1, a2} -+#else - stfeqd f0, [a3] -+#endif - - epilogue: - ldmfd sp!, {a1-a4, fp, pc} -diff -ruN --exclude=CVS gcc-3.2.2.orig/libffi/src/java_raw_api.c gcc/libffi/src/java_raw_api.c ---- gcc-3.2.2.orig/libffi/src/java_raw_api.c Tue Apr 9 07:31:14 2002 -+++ gcc/libffi/src/java_raw_api.c Tue Oct 8 23:55:02 2002 -@@ -81,21 +81,14 @@ - { - case FFI_TYPE_UINT8: - case FFI_TYPE_SINT8: -- *args = (void*) ((char*)(raw++) + SIZEOF_ARG - 1); -+ *args = (void*) ((char*)(raw++) + 3); - break; - - case FFI_TYPE_UINT16: - case FFI_TYPE_SINT16: -- *args = (void*) ((char*)(raw++) + SIZEOF_ARG - 2); -+ *args = (void*) ((char*)(raw++) + 2); - break; - --#if SIZEOF_ARG >= 4 -- case FFI_TYPE_UINT32: -- case FFI_TYPE_SINT32: -- *args = (void*) ((char*)(raw++) + SIZEOF_ARG - 4); -- break; --#endif -- - #if SIZEOF_ARG == 8 - case FFI_TYPE_UINT64: - case FFI_TYPE_SINT64: -@@ -157,31 +150,54 @@ - switch ((*tp)->type) - { - case FFI_TYPE_UINT8: -+#if WORDS_BIGENDIAN -+ *(UINT32*)(raw++) = *(UINT8*) (*args); -+#else - (raw++)->uint = *(UINT8*) (*args); -+#endif - break; - - case FFI_TYPE_SINT8: -+#if WORDS_BIGENDIAN -+ *(SINT32*)(raw++) = *(SINT8*) (*args); -+#else - (raw++)->sint = *(SINT8*) (*args); -+#endif - break; - - case FFI_TYPE_UINT16: -+#if WORDS_BIGENDIAN -+ *(UINT32*)(raw++) = *(UINT16*) (*args); -+#else - (raw++)->uint = *(UINT16*) (*args); -+#endif - break; - - case FFI_TYPE_SINT16: -+#if WORDS_BIGENDIAN -+ *(SINT32*)(raw++) = *(SINT16*) (*args); -+#else - (raw++)->sint = *(SINT16*) (*args); -+#endif - break; - --#if SIZEOF_ARG >= 4 - case FFI_TYPE_UINT32: -+#if WORDS_BIGENDIAN -+ *(UINT32*)(raw++) = *(UINT32*) (*args); -+#else - (raw++)->uint = *(UINT32*) (*args); -+#endif - break; - - case FFI_TYPE_SINT32: -+#if WORDS_BIGENDIAN -+ *(SINT32*)(raw++) = *(SINT32*) (*args); -+#else - (raw++)->sint = *(SINT32*) (*args); -- break; - #endif -- case FFI_TYPE_FLOAT: -+ break; -+ -+ case FFI_TYPE_FLOAT: - (raw++)->flt = *(FLOAT32*) (*args); - break; - -@@ -211,6 +227,55 @@ - - #if !FFI_NATIVE_RAW_API - -+static void -+ffi_java_rvalue_to_raw (ffi_cif *cif, void *rvalue) -+{ -+#if WORDS_BIGENDIAN && SIZEOF_ARG == 8 -+ switch (cif->rtype->type) -+ { -+ case FFI_TYPE_UINT8: -+ case FFI_TYPE_UINT16: -+ case FFI_TYPE_UINT32: -+ *(UINT64 *)rvalue <<= 32; -+ break; -+ -+ case FFI_TYPE_SINT8: -+ case FFI_TYPE_SINT16: -+ case FFI_TYPE_SINT32: -+ case FFI_TYPE_INT: -+ *(SINT64 *)rvalue <<= 32; -+ break; -+ -+ default: -+ break; -+ } -+#endif -+} -+ -+static void -+ffi_java_raw_to_rvalue (ffi_cif *cif, void *rvalue) -+{ -+#if WORDS_BIGENDIAN && SIZEOF_ARG == 8 -+ switch (cif->rtype->type) -+ { -+ case FFI_TYPE_UINT8: -+ case FFI_TYPE_UINT16: -+ case FFI_TYPE_UINT32: -+ *(UINT64 *)rvalue >>= 32; -+ break; -+ -+ case FFI_TYPE_SINT8: -+ case FFI_TYPE_SINT16: -+ case FFI_TYPE_SINT32: -+ case FFI_TYPE_INT: -+ *(SINT64 *)rvalue >>= 32; -+ break; -+ -+ default: -+ break; -+ } -+#endif -+} - - /* This is a generic definition of ffi_raw_call, to be used if the - * native system does not provide a machine-specific implementation. -@@ -227,6 +292,7 @@ - void **avalue = (void**) alloca (cif->nargs * sizeof (void*)); - ffi_java_raw_to_ptrarray (cif, raw, avalue); - ffi_call (cif, fn, rvalue, avalue); -+ ffi_java_rvalue_to_raw (cif, rvalue); - } - - #if FFI_CLOSURES /* base system provides closures */ -@@ -240,6 +306,7 @@ - - ffi_java_ptrarray_to_raw (cif, avalue, raw); - (*cl->fun) (cif, rvalue, raw, cl->user_data); -+ ffi_java_raw_to_rvalue (cif, rvalue); - } - - /* Again, here is the generic version of ffi_prep_raw_closure, which -diff -ruN --exclude=CVS gcc-3.2.2.orig/libffi/src/m68k/ffi.c gcc/libffi/src/m68k/ffi.c ---- gcc-3.2.2.orig/libffi/src/m68k/ffi.c Sun Aug 8 22:27:19 1999 -+++ gcc/libffi/src/m68k/ffi.c Fri Jul 19 08:08:30 2002 -@@ -16,14 +16,11 @@ - ffi_prep_args (void *stack, extended_cif *ecif) - { - unsigned int i; -- int tmp; -- unsigned int avn; - void **p_argv; - char *argp; - ffi_type **p_arg; - void *struct_value_ptr; - -- tmp = 0; - argp = stack; - - if (ecif->cif->rtype->type == FFI_TYPE_STRUCT -@@ -32,11 +29,10 @@ - else - struct_value_ptr = NULL; - -- avn = ecif->cif->nargs; - p_argv = ecif->avalue; - - for (i = ecif->cif->nargs, p_arg = ecif->cif->arg_types; -- i != 0 && avn != 0; -+ i != 0; - i--, p_arg++) - { - size_t z; -@@ -45,9 +41,6 @@ - if (((*p_arg)->alignment - 1) & (unsigned) argp) - argp = (char *) ALIGN (argp, (*p_arg)->alignment); - -- if (avn != 0) -- { -- avn--; - z = (*p_arg)->size; - if (z < sizeof (int)) - { -@@ -82,7 +75,6 @@ - memcpy (argp, *p_argv, z); - p_argv++; - argp += z; -- } - } - - return struct_value_ptr; -diff -ruN --exclude=CVS gcc-3.2.2.orig/libffi/src/mips/ffi.c gcc/libffi/src/mips/ffi.c ---- gcc-3.2.2.orig/libffi/src/mips/ffi.c Sat Mar 3 07:21:23 2001 -+++ gcc/libffi/src/mips/ffi.c Fri Jul 19 08:08:31 2002 -@@ -23,6 +23,7 @@ - OTHER DEALINGS IN THE SOFTWARE. - ----------------------------------------------------------------------- */ - -+#include - #include - #include - -@@ -50,7 +51,6 @@ - int flags) - { - register int i; -- register int avn; - register void **p_argv; - register char *argp; - register ffi_type **p_arg; -@@ -80,12 +80,9 @@ - FIX_ARGP; - } - -- avn = ecif->cif->nargs; - p_argv = ecif->avalue; - -- for (i = ecif->cif->nargs, p_arg = ecif->cif->arg_types; -- i && avn; -- i--, p_arg++) -+ for (i = ecif->cif->nargs, p_arg = ecif->cif->arg_types; i; i--, p_arg++) - { - size_t z; - -@@ -101,9 +98,6 @@ - #define OFFSET sizeof(int) - #endif - -- if (avn) -- { -- avn--; - z = (*p_arg)->size; - if (z < sizeof(SLOT_TYPE_UNSIGNED)) - { -@@ -179,7 +173,6 @@ - p_argv++; - argp += z; - FIX_ARGP; -- } - } - - return; -diff -ruN --exclude=CVS gcc-3.2.2.orig/libffi/src/powerpc/darwin.S gcc/libffi/src/powerpc/darwin.S ---- gcc-3.2.2.orig/libffi/src/powerpc/darwin.S Sat Jan 19 01:22:34 2002 -+++ gcc/libffi/src/powerpc/darwin.S Thu Jan 23 03:21:55 2003 -@@ -3,8 +3,6 @@ - - PowerPC Assembly glue. - -- $Id: darwin.S,v 1.2 2002/01/18 16:22:34 dje Exp $ -- - Permission is hereby granted, free of charge, to any person obtaining - a copy of this software and associated documentation files (the - ``Software''), to deal in the Software without restriction, including -@@ -39,30 +37,34 @@ - .text - .align 2 - _ffi_call_DARWIN: -- mr r12,r8 // We only need r12 until the call, so it doesn't have to be saved... -+LFB0: -+ mr r12,r8 /* We only need r12 until the call, -+ so it doesn't have to be saved... */ -+LFB1: - /* Save the old stack pointer as AP. */ - mr r8,r1 -- -+LCFI0: - /* Allocate the stack space we need. */ - stwux r1,r1,r4 - - /* Save registers we use. */ - mflr r9 - -- stw r28,-16(r8) -+ stw r28,-16(r8) - stw r29,-12(r8) - stw r30, -8(r8) - stw r31, -4(r8) -- -- stw r9, 8(r8) -+ -+ stw r9, 8(r8) - stw r2, 20(r1) -+LCFI1: - - /* Save arguments over call... */ -- mr r31,r5 /* flags, */ -- mr r30,r6 /* rvalue, */ -- mr r29,r7 /* function address, */ -- mr r28,r8 /* our AP. */ -- -+ mr r31,r5 /* flags, */ -+ mr r30,r6 /* rvalue, */ -+ mr r29,r7 /* function address, */ -+ mr r28,r8 /* our AP. */ -+LCFI2: - /* Call ffi_prep_args. */ - mr r4,r1 - li r9,0 -@@ -145,7 +147,8 @@ - L(float_return_value): - stfs f1,0(r30) - b L(done_return_value) --//END(_ffi_call_DARWIN) -+LFE1: -+/* END(_ffi_call_DARWIN) */ - - /* Provide a null definition of _ffi_call_AIX. */ - .text -@@ -155,5 +158,61 @@ - .align 2 - _ffi_call_AIX: - blr --//END(_ffi_call_AIX) -+/* END(_ffi_call_AIX) */ - -+.data -+.section __TEXT,__eh_frame -+Lframe1: -+ .set L$set$0,LECIE1-LSCIE1 -+ .long L$set$0 ; Length of Common Information Entry -+LSCIE1: -+ .long 0x0 ; CIE Identifier Tag -+ .byte 0x1 ; CIE Version -+ .ascii "zR\0" ; CIE Augmentation -+ .byte 0x1 ; uleb128 0x1; CIE Code Alignment Factor -+ .byte 0x7c ; sleb128 -4; CIE Data Alignment Factor -+ .byte 0x41 ; CIE RA Column -+ .byte 0x1 ; uleb128 0x1; Augmentation size -+ .byte 0x10 ; FDE Encoding (pcrel) -+ .byte 0xc ; DW_CFA_def_cfa -+ .byte 0x1 ; uleb128 0x1 -+ .byte 0x0 ; uleb128 0x0 -+ .align 2 -+LECIE1: -+LSFDE1: -+ .set L$set$1,LEFDE1-LASFDE1 -+ .long L$set$1 ; FDE Length -+LASFDE1: -+ .set L$set$2,LASFDE1-Lframe1 -+ .long L$set$2 ; FDE CIE offset -+ .long LFB0-. ; FDE initial location -+ .set L$set$3,LFE1-LFB0 -+ .long L$set$3 ; FDE address range -+ .byte 0x0 ; uleb128 0x0; Augmentation size -+ .byte 0x4 ; DW_CFA_advance_loc4 -+ .set L$set$4,LCFI0-LFB1 -+ .long L$set$4 -+ .byte 0xd ; DW_CFA_def_cfa_register -+ .byte 0x08 ; uleb128 0x08 -+ .byte 0x4 ; DW_CFA_advance_loc4 -+ .set L$set$5,LCFI1-LCFI0 -+ .long L$set$5 -+ .byte 0x11 ; DW_CFA_offset_extended_sf -+ .byte 0x41 ; uleb128 0x41 -+ .byte 0x7e ; sleb128 -2 -+ .byte 0x9f ; DW_CFA_offset, column 0x1f -+ .byte 0x1 ; uleb128 0x1 -+ .byte 0x9e ; DW_CFA_offset, column 0x1e -+ .byte 0x2 ; uleb128 0x2 -+ .byte 0x9d ; DW_CFA_offset, column 0x1d -+ .byte 0x3 ; uleb128 0x3 -+ .byte 0x9c ; DW_CFA_offset, column 0x1c -+ .byte 0x4 ; uleb128 0x4 -+ .byte 0x4 ; DW_CFA_advance_loc4 -+ .set L$set$6,LCFI2-LCFI1 -+ .long L$set$6 -+ .byte 0xd ; DW_CFA_def_cfa_register -+ .byte 0x1c ; uleb128 0x1c -+ .align 2 -+LEFDE1: -+ -diff -ruN --exclude=CVS gcc-3.2.2.orig/libffi/src/prep_cif.c gcc/libffi/src/prep_cif.c ---- gcc-3.2.2.orig/libffi/src/prep_cif.c Sat Mar 3 07:21:22 2001 -+++ gcc/libffi/src/prep_cif.c Mon Sep 30 20:59:42 2002 -@@ -103,7 +103,8 @@ - /* Perform a sanity check on the return type */ - FFI_ASSERT(ffi_type_test(cif->rtype)); - --#ifndef M68K -+ /* x86-64 and s390 stack space allocation is handled in prep_machdep. */ -+#if !defined M68K && !defined __x86_64__ && !defined S390 - /* Make space for the return structure pointer */ - if (cif->rtype->type == FFI_TYPE_STRUCT - #ifdef SPARC -@@ -122,6 +123,7 @@ - if (((*ptr)->size == 0) && (initialize_aggregate((*ptr)) != FFI_OK)) - return FFI_BAD_TYPEDEF; - -+#if !defined __x86_64__ && !defined S390 - #ifdef SPARC - if (((*ptr)->type == FFI_TYPE_STRUCT - && ((*ptr)->size > 16 || cif->abi != FFI_V9)) -@@ -137,6 +139,7 @@ - - bytes += STACK_ARG_SIZE((*ptr)->size); - } -+#endif - } - - cif->bytes = bytes; -diff -ruN --exclude=CVS gcc-3.2.2.orig/libffi/src/s390/ffi.c gcc/libffi/src/s390/ffi.c ---- gcc-3.2.2.orig/libffi/src/s390/ffi.c Thu Jan 1 09:00:00 1970 -+++ gcc/libffi/src/s390/ffi.c Thu Feb 6 08:58:57 2003 -@@ -0,0 +1,753 @@ -+/* ----------------------------------------------------------------------- -+ ffi.c - Copyright (c) 2000 Software AG -+ -+ S390 Foreign Function Interface -+ -+ Permission is hereby granted, free of charge, to any person obtaining -+ a copy of this software and associated documentation files (the -+ ``Software''), to deal in the Software without restriction, including -+ without limitation the rights to use, copy, modify, merge, publish, -+ distribute, sublicense, and/or sell copies of the Software, and to -+ permit persons to whom the Software is furnished to do so, subject to -+ the following conditions: -+ -+ The above copyright notice and this permission notice shall be included -+ in all copies or substantial portions of the Software. -+ -+ THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS -+ OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -+ IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY CLAIM, DAMAGES OR -+ OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -+ ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -+ OTHER DEALINGS IN THE SOFTWARE. -+ ----------------------------------------------------------------------- */ -+/*====================================================================*/ -+/* Includes */ -+/* -------- */ -+/*====================================================================*/ -+ -+#include -+#include -+ -+#include -+#include -+ -+/*====================== End of Includes =============================*/ -+ -+/*====================================================================*/ -+/* Defines */ -+/* ------- */ -+/*====================================================================*/ -+ -+/* Maximum number of GPRs available for argument passing. */ -+#define MAX_GPRARGS 5 -+ -+/* Maximum number of FPRs available for argument passing. */ -+#ifdef __s390x__ -+#define MAX_FPRARGS 4 -+#else -+#define MAX_FPRARGS 2 -+#endif -+ -+/* Round to multiple of 16. */ -+#define ROUND_SIZE(size) (((size) + 15) & ~15) -+ -+/* If these values change, sysv.S must be adapted! */ -+#define FFI390_RET_VOID 0 -+#define FFI390_RET_STRUCT 1 -+#define FFI390_RET_FLOAT 2 -+#define FFI390_RET_DOUBLE 3 -+#define FFI390_RET_INT32 4 -+#define FFI390_RET_INT64 5 -+ -+/*===================== End of Defines ===============================*/ -+ -+/*====================================================================*/ -+/* Prototypes */ -+/* ---------- */ -+/*====================================================================*/ -+ -+static void ffi_prep_args (unsigned char *, extended_cif *); -+static int ffi_check_float_struct (ffi_type *); -+void -+#if __GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ > 2) -+__attribute__ ((visibility ("hidden"))) -+#endif -+ffi_closure_helper_SYSV (ffi_closure *, unsigned long *, -+ unsigned long long *, unsigned long *); -+ -+/*====================== End of Prototypes ===========================*/ -+ -+/*====================================================================*/ -+/* Externals */ -+/* --------- */ -+/*====================================================================*/ -+ -+extern void ffi_call_SYSV(unsigned, -+ extended_cif *, -+ void (*)(unsigned char *, extended_cif *), -+ unsigned, -+ void *, -+ void (*fn)()); -+ -+extern void ffi_closure_SYSV(void); -+ -+/*====================== End of Externals ============================*/ -+ -+/*====================================================================*/ -+/* */ -+/* Name - ffi_check_struct_type. */ -+/* */ -+/* Function - Determine if a structure can be passed within a */ -+/* general purpose or floating point register. */ -+/* */ -+/*====================================================================*/ -+ -+static int -+ffi_check_struct_type (ffi_type *arg) -+{ -+ size_t size = arg->size; -+ -+ /* If the struct has just one element, look at that element -+ to find out whether to consider the struct as floating point. */ -+ while (arg->type == FFI_TYPE_STRUCT -+ && arg->elements[0] && !arg->elements[1]) -+ arg = arg->elements[0]; -+ -+ /* Structs of size 1, 2, 4, and 8 are passed in registers, -+ just like the corresponding int/float types. */ -+ switch (size) -+ { -+ case 1: -+ return FFI_TYPE_UINT8; -+ -+ case 2: -+ return FFI_TYPE_UINT16; -+ -+ case 4: -+ if (arg->type == FFI_TYPE_FLOAT) -+ return FFI_TYPE_FLOAT; -+ else -+ return FFI_TYPE_UINT32; -+ -+ case 8: -+ if (arg->type == FFI_TYPE_DOUBLE) -+ return FFI_TYPE_DOUBLE; -+ else -+ return FFI_TYPE_UINT64; -+ -+ default: -+ break; -+ } -+ -+ /* Other structs are passed via a pointer to the data. */ -+ return FFI_TYPE_POINTER; -+} -+ -+/*======================== End of Routine ============================*/ -+ -+/*====================================================================*/ -+/* */ -+/* Name - ffi_prep_args. */ -+/* */ -+/* Function - Prepare parameters for call to function. */ -+/* */ -+/* ffi_prep_args is called by the assembly routine once stack space */ -+/* has been allocated for the function's arguments. */ -+/* */ -+/*====================================================================*/ -+ -+static void -+ffi_prep_args (unsigned char *stack, extended_cif *ecif) -+{ -+ /* The stack space will be filled with those areas: -+ -+ FPR argument register save area (highest addresses) -+ GPR argument register save area -+ temporary struct copies -+ overflow argument area (lowest addresses) -+ -+ We set up the following pointers: -+ -+ p_fpr: bottom of the FPR area (growing upwards) -+ p_gpr: bottom of the GPR area (growing upwards) -+ p_ov: bottom of the overflow area (growing upwards) -+ p_struct: top of the struct copy area (growing downwards) -+ -+ All areas are kept aligned to twice the word size. */ -+ -+ int gpr_off = ecif->cif->bytes; -+ int fpr_off = gpr_off + ROUND_SIZE (MAX_GPRARGS * sizeof (long)); -+ -+ unsigned long long *p_fpr = (unsigned long long *)(stack + fpr_off); -+ unsigned long *p_gpr = (unsigned long *)(stack + gpr_off); -+ unsigned char *p_struct = (unsigned char *)p_gpr; -+ unsigned long *p_ov = (unsigned long *)stack; -+ -+ int n_fpr = 0; -+ int n_gpr = 0; -+ int n_ov = 0; -+ -+ ffi_type **ptr; -+ void **p_argv = ecif->avalue; -+ int i; -+ -+ /* If we returning a structure then we set the first parameter register -+ to the address of where we are returning this structure. */ -+ -+ if (ecif->cif->flags == FFI390_RET_STRUCT) -+ p_gpr[n_gpr++] = (unsigned long) ecif->rvalue; -+ -+ /* Now for the arguments. */ -+ -+ for (ptr = ecif->cif->arg_types, i = ecif->cif->nargs; -+ i > 0; -+ i--, ptr++, p_argv++) -+ { -+ void *arg = *p_argv; -+ int type = (*ptr)->type; -+ -+ /* Check how a structure type is passed. */ -+ if (type == FFI_TYPE_STRUCT) -+ { -+ type = ffi_check_struct_type (*ptr); -+ -+ /* If we pass the struct via pointer, copy the data. */ -+ if (type == FFI_TYPE_POINTER) -+ { -+ p_struct -= ROUND_SIZE ((*ptr)->size); -+ memcpy (p_struct, (char *)arg, (*ptr)->size); -+ arg = &p_struct; -+ } -+ } -+ -+ /* Pointers are passed like UINTs of the same size. */ -+ if (type == FFI_TYPE_POINTER) -+#ifdef __s390x__ -+ type = FFI_TYPE_UINT64; -+#else -+ type = FFI_TYPE_UINT32; -+#endif -+ -+ /* Now handle all primitive int/float data types. */ -+ switch (type) -+ { -+ case FFI_TYPE_DOUBLE: -+ if (n_fpr < MAX_FPRARGS) -+ p_fpr[n_fpr++] = *(unsigned long long *) arg; -+ else -+#ifdef __s390x__ -+ p_ov[n_ov++] = *(unsigned long *) arg; -+#else -+ p_ov[n_ov++] = ((unsigned long *) arg)[0], -+ p_ov[n_ov++] = ((unsigned long *) arg)[1]; -+#endif -+ break; -+ -+ case FFI_TYPE_FLOAT: -+ if (n_fpr < MAX_FPRARGS) -+ p_fpr[n_fpr++] = (long long) *(unsigned int *) arg << 32; -+ else -+ p_ov[n_ov++] = *(unsigned int *) arg; -+ break; -+ -+ case FFI_TYPE_UINT64: -+ case FFI_TYPE_SINT64: -+#ifdef __s390x__ -+ if (n_gpr < MAX_GPRARGS) -+ p_gpr[n_gpr++] = *(unsigned long *) arg; -+ else -+ p_ov[n_ov++] = *(unsigned long *) arg; -+#else -+ if (n_gpr == MAX_GPRARGS-1) -+ n_gpr = MAX_GPRARGS; -+ if (n_gpr < MAX_GPRARGS) -+ p_gpr[n_gpr++] = ((unsigned long *) arg)[0], -+ p_gpr[n_gpr++] = ((unsigned long *) arg)[1]; -+ else -+ p_ov[n_ov++] = ((unsigned long *) arg)[0], -+ p_ov[n_ov++] = ((unsigned long *) arg)[1]; -+#endif -+ break; -+ -+ case FFI_TYPE_UINT32: -+ if (n_gpr < MAX_GPRARGS) -+ p_gpr[n_gpr++] = *(unsigned int *) arg; -+ else -+ p_ov[n_ov++] = *(unsigned int *) arg; -+ break; -+ -+ case FFI_TYPE_INT: -+ case FFI_TYPE_SINT32: -+ if (n_gpr < MAX_GPRARGS) -+ p_gpr[n_gpr++] = *(signed int *) arg; -+ else -+ p_ov[n_ov++] = *(signed int *) arg; -+ break; -+ -+ case FFI_TYPE_UINT16: -+ if (n_gpr < MAX_GPRARGS) -+ p_gpr[n_gpr++] = *(unsigned short *) arg; -+ else -+ p_ov[n_ov++] = *(unsigned short *) arg; -+ break; -+ -+ case FFI_TYPE_SINT16: -+ if (n_gpr < MAX_GPRARGS) -+ p_gpr[n_gpr++] = *(signed short *) arg; -+ else -+ p_ov[n_ov++] = *(signed short *) arg; -+ break; -+ -+ case FFI_TYPE_UINT8: -+ if (n_gpr < MAX_GPRARGS) -+ p_gpr[n_gpr++] = *(unsigned char *) arg; -+ else -+ p_ov[n_ov++] = *(unsigned char *) arg; -+ break; -+ -+ case FFI_TYPE_SINT8: -+ if (n_gpr < MAX_GPRARGS) -+ p_gpr[n_gpr++] = *(signed char *) arg; -+ else -+ p_ov[n_ov++] = *(signed char *) arg; -+ break; -+ -+ default: -+ FFI_ASSERT (0); -+ break; -+ } -+ } -+} -+ -+/*======================== End of Routine ============================*/ -+ -+/*====================================================================*/ -+/* */ -+/* Name - ffi_prep_cif_machdep. */ -+/* */ -+/* Function - Perform machine dependent CIF processing. */ -+/* */ -+/*====================================================================*/ -+ -+ffi_status -+ffi_prep_cif_machdep(ffi_cif *cif) -+{ -+ size_t struct_size = 0; -+ int n_gpr = 0; -+ int n_fpr = 0; -+ int n_ov = 0; -+ -+ ffi_type **ptr; -+ int i; -+ -+ /* Determine return value handling. */ -+ -+ switch (cif->rtype->type) -+ { -+ /* Void is easy. */ -+ case FFI_TYPE_VOID: -+ cif->flags = FFI390_RET_VOID; -+ break; -+ -+ /* Structures are returned via a hidden pointer. */ -+ case FFI_TYPE_STRUCT: -+ cif->flags = FFI390_RET_STRUCT; -+ n_gpr++; /* We need one GPR to pass the pointer. */ -+ break; -+ -+ /* Floating point values are returned in fpr 0. */ -+ case FFI_TYPE_FLOAT: -+ cif->flags = FFI390_RET_FLOAT; -+ break; -+ -+ case FFI_TYPE_DOUBLE: -+ cif->flags = FFI390_RET_DOUBLE; -+ break; -+ -+ /* Integer values are returned in gpr 2 (and gpr 3 -+ for 64-bit values on 31-bit machines). */ -+ case FFI_TYPE_UINT64: -+ case FFI_TYPE_SINT64: -+ cif->flags = FFI390_RET_INT64; -+ break; -+ -+ case FFI_TYPE_POINTER: -+ case FFI_TYPE_INT: -+ case FFI_TYPE_UINT32: -+ case FFI_TYPE_SINT32: -+ case FFI_TYPE_UINT16: -+ case FFI_TYPE_SINT16: -+ case FFI_TYPE_UINT8: -+ case FFI_TYPE_SINT8: -+ /* These are to be extended to word size. */ -+#ifdef __s390x__ -+ cif->flags = FFI390_RET_INT64; -+#else -+ cif->flags = FFI390_RET_INT32; -+#endif -+ break; -+ -+ default: -+ FFI_ASSERT (0); -+ break; -+ } -+ -+ /* Now for the arguments. */ -+ -+ for (ptr = cif->arg_types, i = cif->nargs; -+ i > 0; -+ i--, ptr++) -+ { -+ int type = (*ptr)->type; -+ -+ /* Check how a structure type is passed. */ -+ if (type == FFI_TYPE_STRUCT) -+ { -+ type = ffi_check_struct_type (*ptr); -+ -+ /* If we pass the struct via pointer, we must reserve space -+ to copy its data for proper call-by-value semantics. */ -+ if (type == FFI_TYPE_POINTER) -+ struct_size += ROUND_SIZE ((*ptr)->size); -+ } -+ -+ /* Now handle all primitive int/float data types. */ -+ switch (type) -+ { -+ /* The first MAX_FPRARGS floating point arguments -+ go in FPRs, the rest overflow to the stack. */ -+ -+ case FFI_TYPE_DOUBLE: -+ if (n_fpr < MAX_FPRARGS) -+ n_fpr++; -+ else -+ n_ov += sizeof (double) / sizeof (long); -+ break; -+ -+ case FFI_TYPE_FLOAT: -+ if (n_fpr < MAX_FPRARGS) -+ n_fpr++; -+ else -+ n_ov++; -+ break; -+ -+ /* On 31-bit machines, 64-bit integers are passed in GPR pairs, -+ if one is still available, or else on the stack. If only one -+ register is free, skip the register (it won't be used for any -+ subsequent argument either). */ -+ -+#ifndef __s390x__ -+ case FFI_TYPE_UINT64: -+ case FFI_TYPE_SINT64: -+ if (n_gpr == MAX_GPRARGS-1) -+ n_gpr = MAX_GPRARGS; -+ if (n_gpr < MAX_GPRARGS) -+ n_gpr += 2; -+ else -+ n_ov += 2; -+ break; -+#endif -+ -+ /* Everything else is passed in GPRs (until MAX_GPRARGS -+ have been used) or overflows to the stack. */ -+ -+ default: -+ if (n_gpr < MAX_GPRARGS) -+ n_gpr++; -+ else -+ n_ov++; -+ break; -+ } -+ } -+ -+ /* Total stack space as required for overflow arguments -+ and temporary structure copies. */ -+ -+ cif->bytes = ROUND_SIZE (n_ov * sizeof (long)) + struct_size; -+ -+ return FFI_OK; -+} -+ -+/*======================== End of Routine ============================*/ -+ -+/*====================================================================*/ -+/* */ -+/* Name - ffi_call. */ -+/* */ -+/* Function - Call the FFI routine. */ -+/* */ -+/*====================================================================*/ -+ -+void -+ffi_call(ffi_cif *cif, -+ void (*fn)(), -+ void *rvalue, -+ void **avalue) -+{ -+ int ret_type = cif->flags; -+ extended_cif ecif; -+ -+ ecif.cif = cif; -+ ecif.avalue = avalue; -+ ecif.rvalue = rvalue; -+ -+ /* If we don't have a return value, we need to fake one. */ -+ if (rvalue == NULL) -+ { -+ if (ret_type == FFI390_RET_STRUCT) -+ ecif.rvalue = alloca (cif->rtype->size); -+ else -+ ret_type = FFI390_RET_VOID; -+ } -+ -+ switch (cif->abi) -+ { -+ case FFI_SYSV: -+ ffi_call_SYSV (cif->bytes, &ecif, ffi_prep_args, -+ ret_type, ecif.rvalue, fn); -+ break; -+ -+ default: -+ FFI_ASSERT (0); -+ break; -+ } -+} -+ -+/*======================== End of Routine ============================*/ -+ -+/*====================================================================*/ -+/* */ -+/* Name - ffi_closure_helper_SYSV. */ -+/* */ -+/* Function - Call a FFI closure target function. */ -+/* */ -+/*====================================================================*/ -+ -+void -+ffi_closure_helper_SYSV (ffi_closure *closure, -+ unsigned long *p_gpr, -+ unsigned long long *p_fpr, -+ unsigned long *p_ov) -+{ -+ unsigned long long ret_buffer; -+ -+ void *rvalue = &ret_buffer; -+ void **avalue; -+ void **p_arg; -+ -+ int n_gpr = 0; -+ int n_fpr = 0; -+ int n_ov = 0; -+ -+ ffi_type **ptr; -+ int i; -+ -+ /* Allocate buffer for argument list pointers. */ -+ -+ p_arg = avalue = alloca (closure->cif->nargs * sizeof (void *)); -+ -+ /* If we returning a structure, pass the structure address -+ directly to the target function. Otherwise, have the target -+ function store the return value to the GPR save area. */ -+ -+ if (closure->cif->flags == FFI390_RET_STRUCT) -+ rvalue = (void *) p_gpr[n_gpr++]; -+ -+ /* Now for the arguments. */ -+ -+ for (ptr = closure->cif->arg_types, i = closure->cif->nargs; -+ i > 0; -+ i--, p_arg++, ptr++) -+ { -+ int deref_struct_pointer = 0; -+ int type = (*ptr)->type; -+ -+ /* Check how a structure type is passed. */ -+ if (type == FFI_TYPE_STRUCT) -+ { -+ type = ffi_check_struct_type (*ptr); -+ -+ /* If we pass the struct via pointer, remember to -+ retrieve the pointer later. */ -+ if (type == FFI_TYPE_POINTER) -+ deref_struct_pointer = 1; -+ } -+ -+ /* Pointers are passed like UINTs of the same size. */ -+ if (type == FFI_TYPE_POINTER) -+#ifdef __s390x__ -+ type = FFI_TYPE_UINT64; -+#else -+ type = FFI_TYPE_UINT32; -+#endif -+ -+ /* Now handle all primitive int/float data types. */ -+ switch (type) -+ { -+ case FFI_TYPE_DOUBLE: -+ if (n_fpr < MAX_FPRARGS) -+ *p_arg = &p_fpr[n_fpr++]; -+ else -+ *p_arg = &p_ov[n_ov], -+ n_ov += sizeof (double) / sizeof (long); -+ break; -+ -+ case FFI_TYPE_FLOAT: -+ if (n_fpr < MAX_FPRARGS) -+ *p_arg = &p_fpr[n_fpr++]; -+ else -+ *p_arg = (char *)&p_ov[n_ov++] + sizeof (long) - 4; -+ break; -+ -+ case FFI_TYPE_UINT64: -+ case FFI_TYPE_SINT64: -+#ifdef __s390x__ -+ if (n_gpr < MAX_GPRARGS) -+ *p_arg = &p_gpr[n_gpr++]; -+ else -+ *p_arg = &p_ov[n_ov++]; -+#else -+ if (n_gpr == MAX_GPRARGS-1) -+ n_gpr = MAX_GPRARGS; -+ if (n_gpr < MAX_GPRARGS) -+ *p_arg = &p_gpr[n_gpr], n_gpr += 2; -+ else -+ *p_arg = &p_ov[n_ov], n_ov += 2; -+#endif -+ break; -+ -+ case FFI_TYPE_INT: -+ case FFI_TYPE_UINT32: -+ case FFI_TYPE_SINT32: -+ if (n_gpr < MAX_GPRARGS) -+ *p_arg = (char *)&p_gpr[n_gpr++] + sizeof (long) - 4; -+ else -+ *p_arg = (char *)&p_ov[n_ov++] + sizeof (long) - 4; -+ break; -+ -+ case FFI_TYPE_UINT16: -+ case FFI_TYPE_SINT16: -+ if (n_gpr < MAX_GPRARGS) -+ *p_arg = (char *)&p_gpr[n_gpr++] + sizeof (long) - 2; -+ else -+ *p_arg = (char *)&p_ov[n_ov++] + sizeof (long) - 2; -+ break; -+ -+ case FFI_TYPE_UINT8: -+ case FFI_TYPE_SINT8: -+ if (n_gpr < MAX_GPRARGS) -+ *p_arg = (char *)&p_gpr[n_gpr++] + sizeof (long) - 1; -+ else -+ *p_arg = (char *)&p_ov[n_ov++] + sizeof (long) - 1; -+ break; -+ -+ default: -+ FFI_ASSERT (0); -+ break; -+ } -+ -+ /* If this is a struct passed via pointer, we need to -+ actually retrieve that pointer. */ -+ if (deref_struct_pointer) -+ *p_arg = *(void **)*p_arg; -+ } -+ -+ -+ /* Call the target function. */ -+ (closure->fun) (closure->cif, rvalue, avalue, closure->user_data); -+ -+ /* Convert the return value. */ -+ switch (closure->cif->rtype->type) -+ { -+ /* Void is easy, and so is struct. */ -+ case FFI_TYPE_VOID: -+ case FFI_TYPE_STRUCT: -+ break; -+ -+ /* Floating point values are returned in fpr 0. */ -+ case FFI_TYPE_FLOAT: -+ p_fpr[0] = (long long) *(unsigned int *) rvalue << 32; -+ break; -+ -+ case FFI_TYPE_DOUBLE: -+ p_fpr[0] = *(unsigned long long *) rvalue; -+ break; -+ -+ /* Integer values are returned in gpr 2 (and gpr 3 -+ for 64-bit values on 31-bit machines). */ -+ case FFI_TYPE_UINT64: -+ case FFI_TYPE_SINT64: -+#ifdef __s390x__ -+ p_gpr[0] = *(unsigned long *) rvalue; -+#else -+ p_gpr[0] = ((unsigned long *) rvalue)[0], -+ p_gpr[1] = ((unsigned long *) rvalue)[1]; -+#endif -+ break; -+ -+ case FFI_TYPE_POINTER: -+ case FFI_TYPE_UINT32: -+ case FFI_TYPE_UINT16: -+ case FFI_TYPE_UINT8: -+ p_gpr[0] = *(unsigned long *) rvalue; -+ break; -+ -+ case FFI_TYPE_INT: -+ case FFI_TYPE_SINT32: -+ case FFI_TYPE_SINT16: -+ case FFI_TYPE_SINT8: -+ p_gpr[0] = *(signed long *) rvalue; -+ break; -+ -+ default: -+ FFI_ASSERT (0); -+ break; -+ } -+} -+ -+/*======================== End of Routine ============================*/ -+ -+/*====================================================================*/ -+/* */ -+/* Name - ffi_prep_closure. */ -+/* */ -+/* Function - Prepare a FFI closure. */ -+/* */ -+/*====================================================================*/ -+ -+ffi_status -+ffi_prep_closure (ffi_closure *closure, -+ ffi_cif *cif, -+ void (*fun) (ffi_cif *, void *, void **, void *), -+ void *user_data) -+{ -+ FFI_ASSERT (cif->abi == FFI_SYSV); -+ -+#ifndef __s390x__ -+ *(short *)&closure->tramp [0] = 0x0d10; /* basr %r1,0 */ -+ *(short *)&closure->tramp [2] = 0x9801; /* lm %r0,%r1,6(%r1) */ -+ *(short *)&closure->tramp [4] = 0x1006; -+ *(short *)&closure->tramp [6] = 0x07f1; /* br %r1 */ -+ *(long *)&closure->tramp [8] = (long)closure; -+ *(long *)&closure->tramp[12] = (long)&ffi_closure_SYSV; -+#else -+ *(short *)&closure->tramp [0] = 0x0d10; /* basr %r1,0 */ -+ *(short *)&closure->tramp [2] = 0xeb01; /* lmg %r0,%r1,14(%r1) */ -+ *(short *)&closure->tramp [4] = 0x100e; -+ *(short *)&closure->tramp [6] = 0x0004; -+ *(short *)&closure->tramp [8] = 0x07f1; /* br %r1 */ -+ *(long *)&closure->tramp[16] = (long)closure; -+ *(long *)&closure->tramp[24] = (long)&ffi_closure_SYSV; -+#endif -+ -+ closure->cif = cif; -+ closure->user_data = user_data; -+ closure->fun = fun; -+ -+ return FFI_OK; -+} -+ -+/*======================== End of Routine ============================*/ -+ -diff -ruN --exclude=CVS gcc-3.2.2.orig/libffi/src/s390/sysv.S gcc/libffi/src/s390/sysv.S ---- gcc-3.2.2.orig/libffi/src/s390/sysv.S Thu Jan 1 09:00:00 1970 -+++ gcc/libffi/src/s390/sysv.S Thu Nov 28 01:44:35 2002 -@@ -0,0 +1,425 @@ -+/* ----------------------------------------------------------------------- -+ sysv.S - Copyright (c) 2000 Software AG -+ -+ S390 Foreign Function Interface -+ -+ Permission is hereby granted, free of charge, to any person obtaining -+ a copy of this software and associated documentation files (the -+ ``Software''), to deal in the Software without restriction, including -+ without limitation the rights to use, copy, modify, merge, publish, -+ distribute, sublicense, and/or sell copies of the Software, and to -+ permit persons to whom the Software is furnished to do so, subject to -+ the following conditions: -+ -+ The above copyright notice and this permission notice shall be included -+ in all copies or substantial portions of the Software. -+ -+ THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS -+ OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -+ IN NO EVENT SHALL CYGNUS SOLUTIONS BE LIABLE FOR ANY CLAIM, DAMAGES OR -+ OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -+ ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -+ OTHER DEALINGS IN THE SOFTWARE. -+ ----------------------------------------------------------------------- */ -+ -+#ifndef __s390x__ -+ -+.text -+ -+ # r2: cif->bytes -+ # r3: &ecif -+ # r4: ffi_prep_args -+ # r5: ret_type -+ # r6: ecif.rvalue -+ # ov: fn -+ -+ # This assumes we are using gas. -+ .globl ffi_call_SYSV -+ .type ffi_call_SYSV,%function -+ffi_call_SYSV: -+.LFB1: -+ stm %r6,%r15,24(%r15) # Save registers -+.LCFI0: -+ basr %r13,0 # Set up base register -+.Lbase: -+ lr %r11,%r15 # Set up frame pointer -+.LCFI1: -+ sr %r15,%r2 -+ ahi %r15,-96-48 # Allocate stack -+ lr %r8,%r6 # Save ecif.rvalue -+ sr %r9,%r9 -+ ic %r9,.Ltable-.Lbase(%r13,%r5) # Load epilog address -+ l %r7,96(%r11) # Load function address -+ st %r11,0(%r15) # Set up back chain -+ ahi %r11,-48 # Register save area -+.LCFI2: -+ -+ la %r2,96(%r15) # Save area -+ # r3 already holds &ecif -+ basr %r14,%r4 # Call ffi_prep_args -+ -+ lm %r2,%r6,0(%r11) # Load arguments -+ ld %f0,32(%r11) -+ ld %f2,40(%r11) -+ la %r14,0(%r13,%r9) # Set return address -+ br %r7 # ... and call function -+ -+.LretNone: # Return void -+ l %r4,48+56(%r11) -+ lm %r6,%r15,48+24(%r11) -+ br %r4 -+ -+.LretFloat: -+ l %r4,48+56(%r11) -+ ste %f0,0(%r8) # Return float -+ lm %r6,%r15,48+24(%r11) -+ br %r4 -+ -+.LretDouble: -+ l %r4,48+56(%r11) -+ std %f0,0(%r8) # Return double -+ lm %r6,%r15,48+24(%r11) -+ br %r4 -+ -+.LretInt32: -+ l %r4,48+56(%r11) -+ st %r2,0(%r8) # Return int -+ lm %r6,%r15,48+24(%r11) -+ br %r4 -+ -+.LretInt64: -+ l %r4,48+56(%r11) -+ stm %r2,%r3,0(%r8) # Return long long -+ lm %r6,%r15,48+24(%r11) -+ br %r4 -+ -+.Ltable: -+ .byte .LretNone-.Lbase # FFI390_RET_VOID -+ .byte .LretNone-.Lbase # FFI390_RET_STRUCT -+ .byte .LretFloat-.Lbase # FFI390_RET_FLOAT -+ .byte .LretDouble-.Lbase # FFI390_RET_DOUBLE -+ .byte .LretInt32-.Lbase # FFI390_RET_INT32 -+ .byte .LretInt64-.Lbase # FFI390_RET_INT64 -+ -+.LFE1: -+.ffi_call_SYSV_end: -+ .size ffi_call_SYSV,.ffi_call_SYSV_end-ffi_call_SYSV -+ -+ -+ .globl ffi_closure_SYSV -+ .type ffi_closure_SYSV,%function -+ffi_closure_SYSV: -+.LFB2: -+ stm %r12,%r15,48(%r15) # Save registers -+.LCFI10: -+ basr %r13,0 # Set up base register -+.Lcbase: -+ stm %r2,%r6,8(%r15) # Save arguments -+ std %f0,64(%r15) -+ std %f2,72(%r15) -+ lr %r1,%r15 # Set up stack frame -+ ahi %r15,-96 -+.LCFI11: -+ l %r12,.Lchelper-.Lcbase(%r13) # Get helper function -+ lr %r2,%r0 # Closure -+ la %r3,8(%r1) # GPRs -+ la %r4,64(%r1) # FPRs -+ la %r5,96(%r1) # Overflow -+ st %r1,0(%r15) # Set up back chain -+ -+ bas %r14,0(%r12,%r13) # Call helper -+ -+ l %r4,96+56(%r15) -+ ld %f0,96+64(%r15) # Load return registers -+ lm %r2,%r3,96+8(%r15) -+ lm %r12,%r15,96+48(%r15) -+ br %r4 -+ -+ .align 4 -+.Lchelper: -+ .long ffi_closure_helper_SYSV-.Lcbase -+ -+.LFE2: -+ -+.ffi_closure_SYSV_end: -+ .size ffi_closure_SYSV,.ffi_closure_SYSV_end-ffi_closure_SYSV -+ -+ -+ .section .eh_frame,"a",@progbits -+.Lframe1: -+ .4byte .LECIE1-.LSCIE1 # Length of Common Information Entry -+.LSCIE1: -+ .4byte 0x0 # CIE Identifier Tag -+ .byte 0x1 # CIE Version -+ .ascii "zR\0" # CIE Augmentation -+ .uleb128 0x1 # CIE Code Alignment Factor -+ .sleb128 -4 # CIE Data Alignment Factor -+ .byte 0xe # CIE RA Column -+ .uleb128 0x1 # Augmentation size -+ .byte 0x1b # FDE Encoding (pcrel sdata4) -+ .byte 0xc # DW_CFA_def_cfa -+ .uleb128 0xf -+ .uleb128 0x60 -+ .align 4 -+.LECIE1: -+.LSFDE1: -+ .4byte .LEFDE1-.LASFDE1 # FDE Length -+.LASFDE1: -+ .4byte .LASFDE1-.Lframe1 # FDE CIE offset -+ .4byte .LFB1-. # FDE initial location -+ .4byte .LFE1-.LFB1 # FDE address range -+ .uleb128 0x0 # Augmentation size -+ .byte 0x4 # DW_CFA_advance_loc4 -+ .4byte .LCFI0-.LFB1 -+ .byte 0x8f # DW_CFA_offset, column 0xf -+ .uleb128 0x9 -+ .byte 0x8e # DW_CFA_offset, column 0xe -+ .uleb128 0xa -+ .byte 0x8d # DW_CFA_offset, column 0xd -+ .uleb128 0xb -+ .byte 0x8c # DW_CFA_offset, column 0xc -+ .uleb128 0xc -+ .byte 0x8b # DW_CFA_offset, column 0xb -+ .uleb128 0xd -+ .byte 0x8a # DW_CFA_offset, column 0xa -+ .uleb128 0xe -+ .byte 0x89 # DW_CFA_offset, column 0x9 -+ .uleb128 0xf -+ .byte 0x88 # DW_CFA_offset, column 0x8 -+ .uleb128 0x10 -+ .byte 0x87 # DW_CFA_offset, column 0x7 -+ .uleb128 0x11 -+ .byte 0x86 # DW_CFA_offset, column 0x6 -+ .uleb128 0x12 -+ .byte 0x4 # DW_CFA_advance_loc4 -+ .4byte .LCFI1-.LCFI0 -+ .byte 0xd # DW_CFA_def_cfa_register -+ .uleb128 0xb -+ .byte 0x4 # DW_CFA_advance_loc4 -+ .4byte .LCFI2-.LCFI1 -+ .byte 0xe # DW_CFA_def_cfa_offset -+ .uleb128 0x90 -+ .align 4 -+.LEFDE1: -+.LSFDE2: -+ .4byte .LEFDE2-.LASFDE2 # FDE Length -+.LASFDE2: -+ .4byte .LASFDE2-.Lframe1 # FDE CIE offset -+ .4byte .LFB2-. # FDE initial location -+ .4byte .LFE2-.LFB2 # FDE address range -+ .uleb128 0x0 # Augmentation size -+ .byte 0x4 # DW_CFA_advance_loc4 -+ .4byte .LCFI10-.LFB2 -+ .byte 0x8f # DW_CFA_offset, column 0xf -+ .uleb128 0x9 -+ .byte 0x8e # DW_CFA_offset, column 0xe -+ .uleb128 0xa -+ .byte 0x8d # DW_CFA_offset, column 0xd -+ .uleb128 0xb -+ .byte 0x8c # DW_CFA_offset, column 0xc -+ .uleb128 0xc -+ .byte 0x4 # DW_CFA_advance_loc4 -+ .4byte .LCFI11-.LCFI10 -+ .byte 0xe # DW_CFA_def_cfa_offset -+ .uleb128 0xc0 -+ .align 4 -+.LEFDE2: -+ -+#else -+ -+.text -+ -+ # r2: cif->bytes -+ # r3: &ecif -+ # r4: ffi_prep_args -+ # r5: ret_type -+ # r6: ecif.rvalue -+ # ov: fn -+ -+ # This assumes we are using gas. -+ .globl ffi_call_SYSV -+ .type ffi_call_SYSV,%function -+ffi_call_SYSV: -+.LFB1: -+ stmg %r6,%r15,48(%r15) # Save registers -+.LCFI0: -+ larl %r13,.Lbase # Set up base register -+ lgr %r11,%r15 # Set up frame pointer -+.LCFI1: -+ sgr %r15,%r2 -+ aghi %r15,-160-80 # Allocate stack -+ lgr %r8,%r6 # Save ecif.rvalue -+ llgc %r9,.Ltable-.Lbase(%r13,%r5) # Load epilog address -+ lg %r7,160(%r11) # Load function address -+ stg %r11,0(%r15) # Set up back chain -+ aghi %r11,-80 # Register save area -+.LCFI2: -+ -+ la %r2,160(%r15) # Save area -+ # r3 already holds &ecif -+ basr %r14,%r4 # Call ffi_prep_args -+ -+ lmg %r2,%r6,0(%r11) # Load arguments -+ ld %f0,48(%r11) -+ ld %f2,56(%r11) -+ ld %f4,64(%r11) -+ ld %f6,72(%r11) -+ la %r14,0(%r13,%r9) # Set return address -+ br %r7 # ... and call function -+ -+.Lbase: -+.LretNone: # Return void -+ lg %r4,80+112(%r11) -+ lmg %r6,%r15,80+48(%r11) -+ br %r4 -+ -+.LretFloat: -+ lg %r4,80+112(%r11) -+ ste %f0,0(%r8) # Return float -+ lmg %r6,%r15,80+48(%r11) -+ br %r4 -+ -+.LretDouble: -+ lg %r4,80+112(%r11) -+ std %f0,0(%r8) # Return double -+ lmg %r6,%r15,80+48(%r11) -+ br %r4 -+ -+.LretInt32: -+ lg %r4,80+112(%r11) -+ st %r2,0(%r8) # Return int -+ lmg %r6,%r15,80+48(%r11) -+ br %r4 -+ -+.LretInt64: -+ lg %r4,80+112(%r11) -+ stg %r2,0(%r8) # Return long -+ lmg %r6,%r15,80+48(%r11) -+ br %r4 -+ -+.Ltable: -+ .byte .LretNone-.Lbase # FFI390_RET_VOID -+ .byte .LretNone-.Lbase # FFI390_RET_STRUCT -+ .byte .LretFloat-.Lbase # FFI390_RET_FLOAT -+ .byte .LretDouble-.Lbase # FFI390_RET_DOUBLE -+ .byte .LretInt32-.Lbase # FFI390_RET_INT32 -+ .byte .LretInt64-.Lbase # FFI390_RET_INT64 -+ -+.LFE1: -+.ffi_call_SYSV_end: -+ .size ffi_call_SYSV,.ffi_call_SYSV_end-ffi_call_SYSV -+ -+ -+ .globl ffi_closure_SYSV -+ .type ffi_closure_SYSV,%function -+ffi_closure_SYSV: -+.LFB2: -+ stmg %r14,%r15,112(%r15) # Save registers -+.LCFI10: -+ stmg %r2,%r6,16(%r15) # Save arguments -+ std %f0,128(%r15) -+ std %f2,136(%r15) -+ std %f4,144(%r15) -+ std %f6,152(%r15) -+ lgr %r1,%r15 # Set up stack frame -+ aghi %r15,-160 -+.LCFI11: -+ lgr %r2,%r0 # Closure -+ la %r3,16(%r1) # GPRs -+ la %r4,128(%r1) # FPRs -+ la %r5,160(%r1) # Overflow -+ stg %r1,0(%r15) # Set up back chain -+ -+ brasl %r14,ffi_closure_helper_SYSV # Call helper -+ -+ lg %r14,160+112(%r15) -+ ld %f0,160+128(%r15) # Load return registers -+ lg %r2,160+16(%r15) -+ la %r15,160(%r15) -+ br %r14 -+.LFE2: -+ -+.ffi_closure_SYSV_end: -+ .size ffi_closure_SYSV,.ffi_closure_SYSV_end-ffi_closure_SYSV -+ -+ -+ -+ .section .eh_frame,"a",@progbits -+.Lframe1: -+ .4byte .LECIE1-.LSCIE1 # Length of Common Information Entry -+.LSCIE1: -+ .4byte 0x0 # CIE Identifier Tag -+ .byte 0x1 # CIE Version -+ .ascii "zR\0" # CIE Augmentation -+ .uleb128 0x1 # CIE Code Alignment Factor -+ .sleb128 -8 # CIE Data Alignment Factor -+ .byte 0xe # CIE RA Column -+ .uleb128 0x1 # Augmentation size -+ .byte 0x1b # FDE Encoding (pcrel sdata4) -+ .byte 0xc # DW_CFA_def_cfa -+ .uleb128 0xf -+ .uleb128 0xa0 -+ .align 8 -+.LECIE1: -+.LSFDE1: -+ .4byte .LEFDE1-.LASFDE1 # FDE Length -+.LASFDE1: -+ .4byte .LASFDE1-.Lframe1 # FDE CIE offset -+ .4byte .LFB1-. # FDE initial location -+ .4byte .LFE1-.LFB1 # FDE address range -+ .uleb128 0x0 # Augmentation size -+ .byte 0x4 # DW_CFA_advance_loc4 -+ .4byte .LCFI0-.LFB1 -+ .byte 0x8f # DW_CFA_offset, column 0xf -+ .uleb128 0x5 -+ .byte 0x8e # DW_CFA_offset, column 0xe -+ .uleb128 0x6 -+ .byte 0x8d # DW_CFA_offset, column 0xd -+ .uleb128 0x7 -+ .byte 0x8c # DW_CFA_offset, column 0xc -+ .uleb128 0x8 -+ .byte 0x8b # DW_CFA_offset, column 0xb -+ .uleb128 0x9 -+ .byte 0x8a # DW_CFA_offset, column 0xa -+ .uleb128 0xa -+ .byte 0x89 # DW_CFA_offset, column 0x9 -+ .uleb128 0xb -+ .byte 0x88 # DW_CFA_offset, column 0x8 -+ .uleb128 0xc -+ .byte 0x87 # DW_CFA_offset, column 0x7 -+ .uleb128 0xd -+ .byte 0x86 # DW_CFA_offset, column 0x6 -+ .uleb128 0xe -+ .byte 0x4 # DW_CFA_advance_loc4 -+ .4byte .LCFI1-.LCFI0 -+ .byte 0xd # DW_CFA_def_cfa_register -+ .uleb128 0xb -+ .byte 0x4 # DW_CFA_advance_loc4 -+ .4byte .LCFI2-.LCFI1 -+ .byte 0xe # DW_CFA_def_cfa_offset -+ .uleb128 0xf0 -+ .align 8 -+.LEFDE1: -+.LSFDE2: -+ .4byte .LEFDE2-.LASFDE2 # FDE Length -+.LASFDE2: -+ .4byte .LASFDE2-.Lframe1 # FDE CIE offset -+ .4byte .LFB2-. # FDE initial location -+ .4byte .LFE2-.LFB2 # FDE address range -+ .uleb128 0x0 # Augmentation size -+ .byte 0x4 # DW_CFA_advance_loc4 -+ .4byte .LCFI10-.LFB2 -+ .byte 0x8f # DW_CFA_offset, column 0xf -+ .uleb128 0x5 -+ .byte 0x8e # DW_CFA_offset, column 0xe -+ .uleb128 0x6 -+ .byte 0x4 # DW_CFA_advance_loc4 -+ .4byte .LCFI11-.LCFI10 -+ .byte 0xe # DW_CFA_def_cfa_offset -+ .uleb128 0x140 -+ .align 8 -+.LEFDE2: -+ -+#endif -+ -diff -ruN --exclude=CVS gcc-3.2.2.orig/libffi/src/sh/ffi.c gcc/libffi/src/sh/ffi.c ---- gcc-3.2.2.orig/libffi/src/sh/ffi.c Thu Jan 1 09:00:00 1970 -+++ gcc/libffi/src/sh/ffi.c Fri Jul 19 10:08:43 2002 -@@ -0,0 +1,722 @@ -+/* ----------------------------------------------------------------------- -+ ffi.c - Copyright (c) 2002 Kaz Kojima -+ -+ SuperH Foreign Function Interface -+ -+ Permission is hereby granted, free of charge, to any person obtaining -+ a copy of this software and associated documentation files (the -+ ``Software''), to deal in the Software without restriction, including -+ without limitation the rights to use, copy, modify, merge, publish, -+ distribute, sublicense, and/or sell copies of the Software, and to -+ permit persons to whom the Software is furnished to do so, subject to -+ the following conditions: -+ -+ The above copyright notice and this permission notice shall be included -+ in all copies or substantial portions of the Software. -+ -+ THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS -+ OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -+ IN NO EVENT SHALL CYGNUS SOLUTIONS BE LIABLE FOR ANY CLAIM, DAMAGES OR -+ OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -+ ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -+ OTHER DEALINGS IN THE SOFTWARE. -+ ----------------------------------------------------------------------- */ -+ -+#include -+#include -+ -+#include -+ -+#define NGREGARG 4 -+#if defined(__SH4__) -+#define NFREGARG 8 -+#endif -+ -+#if defined(__HITACHI__) -+#define STRUCT_VALUE_ADDRESS_WITH_ARG 1 -+#else -+#define STRUCT_VALUE_ADDRESS_WITH_ARG 0 -+#endif -+ -+/* If the structure has essentialy an unique element, return its type. */ -+static int -+simple_type (ffi_type *arg) -+{ -+ if (arg->type != FFI_TYPE_STRUCT) -+ return arg->type; -+ else if (arg->elements[1]) -+ return FFI_TYPE_STRUCT; -+ -+ return simple_type (arg->elements[0]); -+} -+ -+static int -+return_type (ffi_type *arg) -+{ -+ unsigned short type; -+ -+ if (arg->type != FFI_TYPE_STRUCT) -+ return arg->type; -+ -+ type = simple_type (arg->elements[0]); -+ if (! arg->elements[1]) -+ { -+ switch (type) -+ { -+ case FFI_TYPE_SINT8: -+ case FFI_TYPE_UINT8: -+ case FFI_TYPE_SINT16: -+ case FFI_TYPE_UINT16: -+ case FFI_TYPE_SINT32: -+ case FFI_TYPE_UINT32: -+ return FFI_TYPE_INT; -+ -+ default: -+ return type; -+ } -+ } -+ -+ /* gcc uses r0/r1 pair for some kind of structures. */ -+ if (arg->size <= 2 * sizeof (int)) -+ { -+ int i = 0; -+ ffi_type *e; -+ -+ while ((e = arg->elements[i++])) -+ { -+ type = simple_type (e); -+ switch (type) -+ { -+ case FFI_TYPE_SINT32: -+ case FFI_TYPE_UINT32: -+ case FFI_TYPE_INT: -+ case FFI_TYPE_FLOAT: -+ return FFI_TYPE_UINT64; -+ -+ default: -+ break; -+ } -+ } -+ } -+ -+ return FFI_TYPE_STRUCT; -+} -+ -+/* ffi_prep_args is called by the assembly routine once stack space -+ has been allocated for the function's arguments */ -+ -+/*@-exportheader@*/ -+void ffi_prep_args(char *stack, extended_cif *ecif) -+/*@=exportheader@*/ -+{ -+ register unsigned int i; -+ register int tmp; -+ register unsigned int avn; -+ register void **p_argv; -+ register char *argp; -+ register ffi_type **p_arg; -+ int greg, ireg; -+#if defined(__SH4__) -+ int freg = 0; -+#endif -+ -+ tmp = 0; -+ argp = stack; -+ -+ if (return_type (ecif->cif->rtype) == FFI_TYPE_STRUCT) -+ { -+ *(void **) argp = ecif->rvalue; -+ argp += 4; -+ ireg = STRUCT_VALUE_ADDRESS_WITH_ARG ? 1 : 0; -+ } -+ else -+ ireg = 0; -+ -+ /* Set arguments for registers. */ -+ greg = ireg; -+ avn = ecif->cif->nargs; -+ p_argv = ecif->avalue; -+ -+ for (i = 0, p_arg = ecif->cif->arg_types; i < avn; i++, p_arg++, p_argv++) -+ { -+ size_t z; -+ -+ z = (*p_arg)->size; -+ if (z < sizeof(int)) -+ { -+ if (greg++ >= NGREGARG) -+ continue; -+ -+ z = sizeof(int); -+ switch ((*p_arg)->type) -+ { -+ case FFI_TYPE_SINT8: -+ *(signed int *) argp = (signed int)*(SINT8 *)(* p_argv); -+ break; -+ -+ case FFI_TYPE_UINT8: -+ *(unsigned int *) argp = (unsigned int)*(UINT8 *)(* p_argv); -+ break; -+ -+ case FFI_TYPE_SINT16: -+ *(signed int *) argp = (signed int)*(SINT16 *)(* p_argv); -+ break; -+ -+ case FFI_TYPE_UINT16: -+ *(unsigned int *) argp = (unsigned int)*(UINT16 *)(* p_argv); -+ break; -+ -+ case FFI_TYPE_STRUCT: -+ *(unsigned int *) argp = (unsigned int)*(UINT32 *)(* p_argv); -+ break; -+ -+ default: -+ FFI_ASSERT(0); -+ } -+ argp += z; -+ } -+ else if (z == sizeof(int)) -+ { -+#if defined(__SH4__) -+ if ((*p_arg)->type == FFI_TYPE_FLOAT) -+ { -+ if (freg++ >= NFREGARG) -+ continue; -+ } -+ else -+#endif -+ { -+ if (greg++ >= NGREGARG) -+ continue; -+ } -+ *(unsigned int *) argp = (unsigned int)*(UINT32 *)(* p_argv); -+ argp += z; -+ } -+#if defined(__SH4__) -+ else if ((*p_arg)->type == FFI_TYPE_DOUBLE) -+ { -+ if (freg + 1 >= NFREGARG) -+ continue; -+ freg = (freg + 1) & ~1; -+ freg += 2; -+ memcpy (argp, *p_argv, z); -+ argp += z; -+ } -+#endif -+ else -+ { -+ int n = (z + sizeof (int) - 1) / sizeof (int); -+#if defined(__SH4__) -+ if (greg + n - 1 >= NGREGARG) -+ continue; -+ greg += n; -+#else -+ if (greg >= NGREGARG) -+ continue; -+ else if (greg + n - 1 >= NGREGARG) -+ greg = NGREGARG; -+ else -+ greg += n; -+#endif -+ memcpy (argp, *p_argv, z); -+ argp += z; -+ } -+ } -+ -+ /* Set arguments on stack. */ -+ greg = ireg; -+#if defined(__SH4__) -+ freg = 0; -+#endif -+ p_argv = ecif->avalue; -+ -+ for (i = 0, p_arg = ecif->cif->arg_types; i < avn; i++, p_arg++, p_argv++) -+ { -+ size_t z; -+ -+ z = (*p_arg)->size; -+ if (z < sizeof(int)) -+ { -+ if (greg++ < NGREGARG) -+ continue; -+ -+ z = sizeof(int); -+ switch ((*p_arg)->type) -+ { -+ case FFI_TYPE_SINT8: -+ *(signed int *) argp = (signed int)*(SINT8 *)(* p_argv); -+ break; -+ -+ case FFI_TYPE_UINT8: -+ *(unsigned int *) argp = (unsigned int)*(UINT8 *)(* p_argv); -+ break; -+ -+ case FFI_TYPE_SINT16: -+ *(signed int *) argp = (signed int)*(SINT16 *)(* p_argv); -+ break; -+ -+ case FFI_TYPE_UINT16: -+ *(unsigned int *) argp = (unsigned int)*(UINT16 *)(* p_argv); -+ break; -+ -+ case FFI_TYPE_STRUCT: -+ *(unsigned int *) argp = (unsigned int)*(UINT32 *)(* p_argv); -+ break; -+ -+ default: -+ FFI_ASSERT(0); -+ } -+ argp += z; -+ } -+ else if (z == sizeof(int)) -+ { -+#if defined(__SH4__) -+ if ((*p_arg)->type == FFI_TYPE_FLOAT) -+ { -+ if (freg++ < NFREGARG) -+ continue; -+ } -+ else -+#endif -+ { -+ if (greg++ < NGREGARG) -+ continue; -+ } -+ *(unsigned int *) argp = (unsigned int)*(UINT32 *)(* p_argv); -+ argp += z; -+ } -+#if defined(__SH4__) -+ else if ((*p_arg)->type == FFI_TYPE_DOUBLE) -+ { -+ if (freg + 1 < NFREGARG) -+ { -+ freg = (freg + 1) & ~1; -+ freg += 2; -+ continue; -+ } -+ memcpy (argp, *p_argv, z); -+ argp += z; -+ } -+#endif -+ else -+ { -+ int n = (z + sizeof (int) - 1) / sizeof (int); -+ if (greg + n - 1 < NGREGARG) -+ { -+ greg += n; -+ continue; -+ } -+#if (! defined(__SH4__)) -+ else if (greg < NGREGARG) -+ { -+ greg = NGREGARG; -+ continue; -+ } -+#endif -+ memcpy (argp, *p_argv, z); -+ argp += z; -+ } -+ } -+ -+ return; -+} -+ -+/* Perform machine dependent cif processing */ -+ffi_status ffi_prep_cif_machdep(ffi_cif *cif) -+{ -+ int i, j; -+ int size, type; -+ int n, m; -+ int greg; -+#if defined(__SH4__) -+ int freg = 0; -+#endif -+ -+ cif->flags = 0; -+ -+ greg = ((return_type (cif->rtype) == FFI_TYPE_STRUCT) && -+ STRUCT_VALUE_ADDRESS_WITH_ARG) ? 1 : 0; -+ -+#if defined(__SH4__) -+ for (i = j = 0; i < cif->nargs && j < 12; i++) -+ { -+ type = (cif->arg_types)[i]->type; -+ switch (type) -+ { -+ case FFI_TYPE_FLOAT: -+ if (freg >= NFREGARG) -+ continue; -+ freg++; -+ cif->flags += ((cif->arg_types)[i]->type) << (2 * j); -+ j++; -+ break; -+ -+ case FFI_TYPE_DOUBLE: -+ if ((freg + 1) >= NFREGARG) -+ continue; -+ freg = (freg + 1) & ~1; -+ freg += 2; -+ cif->flags += ((cif->arg_types)[i]->type) << (2 * j); -+ j++; -+ break; -+ -+ default: -+ size = (cif->arg_types)[i]->size; -+ n = (size + sizeof (int) - 1) / sizeof (int); -+ if (greg + n - 1 >= NGREGARG) -+ continue; -+ greg += n; -+ for (m = 0; m < n; m++) -+ cif->flags += FFI_TYPE_INT << (2 * j++); -+ break; -+ } -+ } -+#else -+ for (i = j = 0; i < cif->nargs && j < 4; i++) -+ { -+ size = (cif->arg_types)[i]->size; -+ n = (size + sizeof (int) - 1) / sizeof (int); -+ if (greg >= NGREGARG) -+ continue; -+ else if (greg + n - 1 >= NGREGARG) -+ greg = NGREGARG; -+ else -+ greg += n; -+ for (m = 0; m < n; m++) -+ cif->flags += FFI_TYPE_INT << (2 * j++); -+ } -+#endif -+ -+ /* Set the return type flag */ -+ switch (cif->rtype->type) -+ { -+ case FFI_TYPE_STRUCT: -+ cif->flags += (unsigned) (return_type (cif->rtype)) << 24; -+ break; -+ -+ case FFI_TYPE_VOID: -+ case FFI_TYPE_FLOAT: -+ case FFI_TYPE_DOUBLE: -+ case FFI_TYPE_SINT64: -+ case FFI_TYPE_UINT64: -+ cif->flags += (unsigned) cif->rtype->type << 24; -+ break; -+ -+ default: -+ cif->flags += FFI_TYPE_INT << 24; -+ break; -+ } -+ -+ return FFI_OK; -+} -+ -+/*@-declundef@*/ -+/*@-exportheader@*/ -+extern void ffi_call_SYSV(void (*)(char *, extended_cif *), -+ /*@out@*/ extended_cif *, -+ unsigned, unsigned, -+ /*@out@*/ unsigned *, -+ void (*fn)()); -+/*@=declundef@*/ -+/*@=exportheader@*/ -+ -+void ffi_call(/*@dependent@*/ ffi_cif *cif, -+ void (*fn)(), -+ /*@out@*/ void *rvalue, -+ /*@dependent@*/ void **avalue) -+{ -+ extended_cif ecif; -+ -+ ecif.cif = cif; -+ ecif.avalue = avalue; -+ -+ /* If the return value is a struct and we don't have a return */ -+ /* value address then we need to make one */ -+ -+ if ((rvalue == NULL) && -+ (cif->rtype->type == FFI_TYPE_STRUCT)) -+ { -+ /*@-sysunrecog@*/ -+ ecif.rvalue = alloca(cif->rtype->size); -+ /*@=sysunrecog@*/ -+ } -+ else -+ ecif.rvalue = rvalue; -+ -+ -+ switch (cif->abi) -+ { -+ case FFI_SYSV: -+ /*@-usedef@*/ -+ ffi_call_SYSV(ffi_prep_args, &ecif, cif->bytes, -+ cif->flags, ecif.rvalue, fn); -+ /*@=usedef@*/ -+ break; -+ default: -+ FFI_ASSERT(0); -+ break; -+ } -+} -+ -+extern void ffi_closure_SYSV (void); -+#if defined(__SH4__) -+extern void __ic_invalidate (void *line); -+#endif -+ -+ffi_status -+ffi_prep_closure (ffi_closure* closure, -+ ffi_cif* cif, -+ void (*fun)(ffi_cif*, void*, void**, void*), -+ void *user_data) -+{ -+ unsigned int *tramp; -+ -+ FFI_ASSERT (cif->abi == FFI_GCC_SYSV); -+ -+ tramp = (unsigned int *) &closure->tramp[0]; -+#ifdef __LITTLE_ENDIAN__ -+ tramp[0] = 0xd301d202; -+ tramp[1] = 0x0009422b; -+#else -+ tramp[0] = 0xd202d301; -+ tramp[1] = 0x422b0009; -+#endif -+ *(void **) &tramp[2] = (void *)closure; /* ctx */ -+ *(void **) &tramp[3] = (void *)ffi_closure_SYSV; /* funaddr */ -+ -+ closure->cif = cif; -+ closure->fun = fun; -+ closure->user_data = user_data; -+ -+#if defined(__SH4__) -+ /* Flush the icache. */ -+ __ic_invalidate(&closure->tramp[0]); -+#endif -+ -+ return FFI_OK; -+} -+ -+/* Basically the trampoline invokes ffi_closure_SYSV, and on -+ * entry, r3 holds the address of the closure. -+ * After storing the registers that could possibly contain -+ * parameters to be passed into the stack frame and setting -+ * up space for a return value, ffi_closure_SYSV invokes the -+ * following helper function to do most of the work. -+ */ -+ -+#ifdef __LITTLE_ENDIAN__ -+#define OFS_INT8 0 -+#define OFS_INT16 2 -+#else -+#define OFS_INT8 3 -+#define OFS_INT16 2 -+#endif -+ -+int -+ffi_closure_helper_SYSV (ffi_closure *closure, void *rvalue, -+ unsigned long *pgr, unsigned long *pfr, -+ unsigned long *pst) -+{ -+ void **avalue; -+ ffi_type **p_arg; -+ int i, avn; -+ int ireg, greg = 0; -+#if defined(__SH4__) -+ int freg = 0; -+#endif -+ ffi_cif *cif; -+ double temp; -+ -+ cif = closure->cif; -+ avalue = alloca(cif->nargs * sizeof(void *)); -+ -+ /* Copy the caller's structure return value address so that the closure -+ returns the data directly to the caller. */ -+ if (cif->rtype->type == FFI_TYPE_STRUCT) -+ { -+ rvalue = *pgr++; -+ ireg = STRUCT_VALUE_ADDRESS_WITH_ARG ? 1 : 0; -+ } -+ else -+ ireg = 0; -+ -+ cif = closure->cif; -+ greg = ireg; -+ avn = cif->nargs; -+ -+ /* Grab the addresses of the arguments from the stack frame. */ -+ for (i = 0, p_arg = cif->arg_types; i < avn; i++, p_arg++) -+ { -+ size_t z; -+ -+ z = (*p_arg)->size; -+ if (z < sizeof(int)) -+ { -+ if (greg++ >= NGREGARG) -+ continue; -+ -+ z = sizeof(int); -+ switch ((*p_arg)->type) -+ { -+ case FFI_TYPE_SINT8: -+ case FFI_TYPE_UINT8: -+ avalue[i] = (((char *)pgr) + OFS_INT8); -+ break; -+ -+ case FFI_TYPE_SINT16: -+ case FFI_TYPE_UINT16: -+ avalue[i] = (((char *)pgr) + OFS_INT16); -+ break; -+ -+ case FFI_TYPE_STRUCT: -+ avalue[i] = pgr; -+ break; -+ -+ default: -+ FFI_ASSERT(0); -+ } -+ pgr++; -+ } -+ else if (z == sizeof(int)) -+ { -+#if defined(__SH4__) -+ if ((*p_arg)->type == FFI_TYPE_FLOAT) -+ { -+ if (freg++ >= NFREGARG) -+ continue; -+ avalue[i] = pfr; -+ pfr++; -+ } -+ else -+#endif -+ { -+ if (greg++ >= NGREGARG) -+ continue; -+ avalue[i] = pgr; -+ pgr++; -+ } -+ } -+#if defined(__SH4__) -+ else if ((*p_arg)->type == FFI_TYPE_DOUBLE) -+ { -+ if (freg + 1 >= NFREGARG) -+ continue; -+ freg = (freg + 1) & ~1; -+ freg += 2; -+ avalue[i] = pfr; -+ pfr += 2; -+ } -+#endif -+ else -+ { -+ int n = (z + sizeof (int) - 1) / sizeof (int); -+#if defined(__SH4__) -+ if (greg + n - 1 >= NGREGARG) -+ continue; -+ greg += n; -+#else -+ if (greg >= NGREGARG) -+ continue; -+ else if (greg + n - 1 >= NGREGARG) -+ greg = NGREGARG; -+ else -+ greg += n; -+#endif -+ avalue[i] = pgr; -+ pgr += n; -+ } -+ } -+ -+ greg = ireg; -+#if defined(__SH4__) -+ freg = 0; -+#endif -+ -+ for (i = 0, p_arg = cif->arg_types; i < avn; i++, p_arg++) -+ { -+ size_t z; -+ -+ z = (*p_arg)->size; -+ if (z < sizeof(int)) -+ { -+ if (greg++ < NGREGARG) -+ continue; -+ -+ z = sizeof(int); -+ switch ((*p_arg)->type) -+ { -+ case FFI_TYPE_SINT8: -+ case FFI_TYPE_UINT8: -+ avalue[i] = (((char *)pst) + OFS_INT8); -+ break; -+ -+ case FFI_TYPE_SINT16: -+ case FFI_TYPE_UINT16: -+ avalue[i] = (((char *)pst) + OFS_INT16); -+ break; -+ -+ case FFI_TYPE_STRUCT: -+ avalue[i] = pst; -+ break; -+ -+ default: -+ FFI_ASSERT(0); -+ } -+ pst++; -+ } -+ else if (z == sizeof(int)) -+ { -+#if defined(__SH4__) -+ if ((*p_arg)->type == FFI_TYPE_FLOAT) -+ { -+ if (freg++ < NFREGARG) -+ continue; -+ } -+ else -+#endif -+ { -+ if (greg++ < NGREGARG) -+ continue; -+ } -+ avalue[i] = pst; -+ pst++; -+ } -+#if defined(__SH4__) -+ else if ((*p_arg)->type == FFI_TYPE_DOUBLE) -+ { -+ if (freg + 1 < NFREGARG) -+ { -+ freg = (freg + 1) & ~1; -+ freg += 2; -+ continue; -+ } -+ avalue[i] = pst; -+ pst += 2; -+ } -+#endif -+ else -+ { -+ int n = (z + sizeof (int) - 1) / sizeof (int); -+ if (greg + n - 1 < NGREGARG) -+ { -+ greg += n; -+ continue; -+ } -+#if (! defined(__SH4__)) -+ else if (greg < NGREGARG) -+ { -+ greg = NGREGARG; -+ continue; -+ } -+#endif -+ avalue[i] = pst; -+ pst += n; -+ } -+ } -+ -+ (closure->fun) (cif, rvalue, avalue, closure->user_data); -+ -+ /* Tell ffi_closure_osf how to perform return type promotions. */ -+ return cif->rtype->type; -+} -diff -ruN --exclude=CVS gcc-3.2.2.orig/libffi/src/sh/sysv.S gcc/libffi/src/sh/sysv.S ---- gcc-3.2.2.orig/libffi/src/sh/sysv.S Thu Jan 1 09:00:00 1970 -+++ gcc/libffi/src/sh/sysv.S Tue Dec 17 03:22:48 2002 -@@ -0,0 +1,773 @@ -+/* ----------------------------------------------------------------------- -+ sysv.S - Copyright (c) 2002 Kaz Kojima -+ -+ SuperH Foreign Function Interface -+ -+ Permission is hereby granted, free of charge, to any person obtaining -+ a copy of this software and associated documentation files (the -+ ``Software''), to deal in the Software without restriction, including -+ without limitation the rights to use, copy, modify, merge, publish, -+ distribute, sublicense, and/or sell copies of the Software, and to -+ permit persons to whom the Software is furnished to do so, subject to -+ the following conditions: -+ -+ The above copyright notice and this permission notice shall be included -+ in all copies or substantial portions of the Software. -+ -+ THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS -+ OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -+ IN NO EVENT SHALL CYGNUS SOLUTIONS BE LIABLE FOR ANY CLAIM, DAMAGES OR -+ OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -+ ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -+ OTHER DEALINGS IN THE SOFTWARE. -+ ----------------------------------------------------------------------- */ -+ -+#define LIBFFI_ASM -+#include -+#ifdef HAVE_MACHINE_ASM_H -+#include -+#else -+/* XXX these lose for some platforms, I'm sure. */ -+#define CNAME(x) x -+#define ENTRY(x) .globl CNAME(x); .type CNAME(x),%function; CNAME(x): -+#endif -+ -+#if defined(__HITACHI__) -+#define STRUCT_VALUE_ADDRESS_WITH_ARG 1 -+#else -+#define STRUCT_VALUE_ADDRESS_WITH_ARG 0 -+#endif -+ -+.text -+ -+ # r4: ffi_prep_args -+ # r5: &ecif -+ # r6: bytes -+ # r7: flags -+ # sp+0: rvalue -+ # sp+4: fn -+ -+ # This assumes we are using gas. -+ENTRY(ffi_call_SYSV) -+ # Save registers -+.LFB1: -+ mov.l r8,@-r15 -+.LCFI0: -+ mov.l r9,@-r15 -+.LCFI1: -+ mov.l r10,@-r15 -+.LCFI2: -+ mov.l r12,@-r15 -+.LCFI3: -+ mov.l r14,@-r15 -+.LCFI4: -+ sts.l pr,@-r15 -+.LCFI5: -+ mov r15,r14 -+.LCFI6: -+#if defined(__SH4__) -+ mov r6,r8 -+ mov r7,r9 -+ -+ sub r6,r15 -+ add #-16,r15 -+ mov #~7,r0 -+ and r0,r15 -+ -+ mov r4,r0 -+ jsr @r0 -+ mov r15,r4 -+ -+ mov r9,r1 -+ shlr8 r9 -+ shlr8 r9 -+ shlr8 r9 -+ -+ mov #FFI_TYPE_STRUCT,r2 -+ cmp/eq r2,r9 -+ bf 1f -+#if STRUCT_VALUE_ADDRESS_WITH_ARG -+ mov.l @r15+,r4 -+ bra 2f -+ mov #5,r2 -+#else -+ mov.l @r15+,r10 -+#endif -+1: -+ mov #4,r2 -+2: -+ mov #4,r3 -+ -+L_pass: -+ cmp/pl r8 -+ bf L_call_it -+ -+ mov r1,r0 -+ and #3,r0 -+ -+L_pass_d: -+ cmp/eq #FFI_TYPE_DOUBLE,r0 -+ bf L_pass_f -+ -+ mov r3,r0 -+ and #1,r0 -+ tst r0,r0 -+ bt 1f -+ add #1,r3 -+1: -+ mov r15,r0 -+ and #7,r0 -+ tst r0,r0 -+ bt 2f -+ add #4,r15 -+2: -+ mov #12,r0 -+ cmp/hs r0,r3 -+ bt/s 3f -+ shlr2 r1 -+ bsr L_pop_d -+ nop -+3: -+ add #2,r3 -+ bra L_pass -+ add #-8,r8 -+ -+L_pop_d: -+ mov r3,r0 -+ add r0,r0 -+ add r3,r0 -+ add #-12,r0 -+ braf r0 -+ nop -+#ifdef __LITTLE_ENDIAN__ -+ fmov.s @r15+,fr5 -+ rts -+ fmov.s @r15+,fr4 -+ fmov.s @r15+,fr7 -+ rts -+ fmov.s @r15+,fr6 -+ fmov.s @r15+,fr9 -+ rts -+ fmov.s @r15+,fr8 -+ fmov.s @r15+,fr11 -+ rts -+ fmov.s @r15+,fr10 -+#else -+ fmov.s @r15+,fr4 -+ rts -+ fmov.s @r15+,fr5 -+ fmov.s @r15+,fr6 -+ rts -+ fmov.s @r15+,fr7 -+ fmov.s @r15+,fr8 -+ rts -+ fmov.s @r15+,fr9 -+ fmov.s @r15+,fr10 -+ rts -+ fmov.s @r15+,fr11 -+#endif -+ -+L_pass_f: -+ cmp/eq #FFI_TYPE_FLOAT,r0 -+ bf L_pass_i -+ -+ mov #12,r0 -+ cmp/hs r0,r3 -+ bt/s 2f -+ shlr2 r1 -+ bsr L_pop_f -+ nop -+2: -+ add #1,r3 -+ bra L_pass -+ add #-4,r8 -+ -+L_pop_f: -+ mov r3,r0 -+ shll2 r0 -+ add #-16,r0 -+ braf r0 -+ nop -+#ifdef __LITTLE_ENDIAN__ -+ rts -+ fmov.s @r15+,fr5 -+ rts -+ fmov.s @r15+,fr4 -+ rts -+ fmov.s @r15+,fr7 -+ rts -+ fmov.s @r15+,fr6 -+ rts -+ fmov.s @r15+,fr9 -+ rts -+ fmov.s @r15+,fr8 -+ rts -+ fmov.s @r15+,fr11 -+ rts -+ fmov.s @r15+,fr10 -+#else -+ rts -+ fmov.s @r15+,fr4 -+ rts -+ fmov.s @r15+,fr5 -+ rts -+ fmov.s @r15+,fr6 -+ rts -+ fmov.s @r15+,fr7 -+ rts -+ fmov.s @r15+,fr8 -+ rts -+ fmov.s @r15+,fr9 -+ rts -+ fmov.s @r15+,fr10 -+ rts -+ fmov.s @r15+,fr11 -+#endif -+ -+L_pass_i: -+ cmp/eq #FFI_TYPE_INT,r0 -+ bf L_call_it -+ -+ mov #8,r0 -+ cmp/hs r0,r2 -+ bt/s 2f -+ shlr2 r1 -+ bsr L_pop_i -+ nop -+2: -+ add #1,r2 -+ bra L_pass -+ add #-4,r8 -+ -+L_pop_i: -+ mov r2,r0 -+ shll2 r0 -+ add #-16,r0 -+ braf r0 -+ nop -+ rts -+ mov.l @r15+,r4 -+ rts -+ mov.l @r15+,r5 -+ rts -+ mov.l @r15+,r6 -+ rts -+ mov.l @r15+,r7 -+ -+L_call_it: -+ # call function -+#if (! STRUCT_VALUE_ADDRESS_WITH_ARG) -+ mov r10, r2 -+#endif -+ mov.l @(28,r14),r1 -+ jsr @r1 -+ nop -+ -+L_ret_d: -+ mov #FFI_TYPE_DOUBLE,r2 -+ cmp/eq r2,r9 -+ bf L_ret_ll -+ -+ mov.l @(24,r14),r1 -+#ifdef __LITTLE_ENDIAN__ -+ fmov.s fr1,@r1 -+ add #4,r1 -+ bra L_epilogue -+ fmov.s fr0,@r1 -+#else -+ fmov.s fr0,@r1 -+ add #4,r1 -+ bra L_epilogue -+ fmov.s fr1,@r1 -+#endif -+ -+L_ret_ll: -+ mov #FFI_TYPE_SINT64,r2 -+ cmp/eq r2,r9 -+ bt/s 1f -+ mov #FFI_TYPE_UINT64,r2 -+ cmp/eq r2,r9 -+ bf L_ret_f -+ -+1: -+ mov.l @(24,r14),r2 -+ mov.l r0,@r2 -+ bra L_epilogue -+ mov.l r1,@(4,r2) -+ -+L_ret_f: -+ mov #FFI_TYPE_FLOAT,r2 -+ cmp/eq r2,r9 -+ bf L_ret_i -+ -+ mov.l @(24,r14),r1 -+ bra L_epilogue -+ fmov.s fr0,@r1 -+ -+L_ret_i: -+ mov #FFI_TYPE_INT,r2 -+ cmp/eq r2,r9 -+ bf L_epilogue -+ -+ mov.l @(24,r14),r1 -+ bra L_epilogue -+ mov.l r0,@r1 -+ -+L_epilogue: -+ # Remove the space we pushed for the args -+ mov r14,r15 -+ -+ lds.l @r15+,pr -+ mov.l @r15+,r14 -+ mov.l @r15+,r12 -+ mov.l @r15+,r10 -+ mov.l @r15+,r9 -+ rts -+ mov.l @r15+,r8 -+#else -+ mov r6,r8 -+ mov r7,r9 -+ -+ sub r6,r15 -+ add #-16,r15 -+ mov #~7,r0 -+ and r0,r15 -+ -+ mov r4,r0 -+ jsr @r0 -+ mov r15,r4 -+ -+ mov r9,r3 -+ shlr8 r9 -+ shlr8 r9 -+ shlr8 r9 -+ -+ mov #FFI_TYPE_STRUCT,r2 -+ cmp/eq r2,r9 -+ bf 1f -+#if STRUCT_VALUE_ADDRESS_WITH_ARG -+ mov.l @r15+,r4 -+ bra 2f -+ mov #5,r2 -+#else -+ mov.l @r15+,r10 -+#endif -+1: -+ mov #4,r2 -+2: -+ -+L_pass: -+ cmp/pl r8 -+ bf L_call_it -+ -+ mov r3,r0 -+ and #3,r0 -+ -+L_pass_d: -+ cmp/eq #FFI_TYPE_DOUBLE,r0 -+ bf L_pass_i -+ -+ mov r15,r0 -+ and #7,r0 -+ tst r0,r0 -+ bt 1f -+ add #4,r15 -+1: -+ mov #8,r0 -+ cmp/hs r0,r2 -+ bt/s 2f -+ shlr2 r3 -+ bsr L_pop_d -+ nop -+2: -+ add #2,r2 -+ bra L_pass -+ add #-8,r8 -+ -+L_pop_d: -+ mov r2,r0 -+ add r0,r0 -+ add r2,r0 -+ add #-12,r0 -+ add r0,r0 -+ braf r0 -+ nop -+ mov.l @r15+,r4 -+ rts -+ mov.l @r15+,r5 -+ mov.l @r15+,r5 -+ rts -+ mov.l @r15+,r6 -+ mov.l @r15+,r6 -+ rts -+ mov.l @r15+,r7 -+ rts -+ mov.l @r15+,r7 -+ -+L_pass_i: -+ mov #8,r0 -+ cmp/hs r0,r2 -+ bt/s 2f -+ shlr2 r3 -+ bsr L_pop_i -+ nop -+2: -+ add #1,r2 -+ bra L_pass -+ add #-4,r8 -+ -+L_pop_i: -+ mov r2,r0 -+ shll2 r0 -+ add #-16,r0 -+ braf r0 -+ nop -+ rts -+ mov.l @r15+,r4 -+ rts -+ mov.l @r15+,r5 -+ rts -+ mov.l @r15+,r6 -+ rts -+ mov.l @r15+,r7 -+ -+L_call_it: -+ # call function -+#if (! STRUCT_VALUE_ADDRESS_WITH_ARG) -+ mov r10, r2 -+#endif -+ mov.l @(28,r14),r1 -+ jsr @r1 -+ nop -+ -+L_ret_d: -+ mov #FFI_TYPE_DOUBLE,r2 -+ cmp/eq r2,r9 -+ bf L_ret_ll -+ -+ mov.l @(24,r14),r2 -+ mov.l r0,@r2 -+ bra L_epilogue -+ mov.l r1,@(4,r2) -+ -+L_ret_ll: -+ mov #FFI_TYPE_SINT64,r2 -+ cmp/eq r2,r9 -+ bt/s 1f -+ mov #FFI_TYPE_UINT64,r2 -+ cmp/eq r2,r9 -+ bf L_ret_i -+ -+1: -+ mov.l @(24,r14),r2 -+ mov.l r0,@r2 -+ bra L_epilogue -+ mov.l r1,@(4,r2) -+ -+L_ret_i: -+ mov #FFI_TYPE_FLOAT,r2 -+ cmp/eq r2,r9 -+ bt 1f -+ mov #FFI_TYPE_INT,r2 -+ cmp/eq r2,r9 -+ bf L_epilogue -+1: -+ mov.l @(24,r14),r1 -+ bra L_epilogue -+ mov.l r0,@r1 -+ -+L_epilogue: -+ # Remove the space we pushed for the args -+ mov r14,r15 -+ -+ lds.l @r15+,pr -+ mov.l @r15+,r14 -+ mov.l @r15+,r12 -+ mov.l @r15+,r10 -+ mov.l @r15+,r9 -+ rts -+ mov.l @r15+,r8 -+#endif -+.LFE1: -+.ffi_call_SYSV_end: -+ .size CNAME(ffi_call_SYSV),.ffi_call_SYSV_end-CNAME(ffi_call_SYSV) -+ -+.globl ffi_closure_helper_SYSV -+ -+ENTRY(ffi_closure_SYSV) -+.LFB2: -+ mov.l r14,@-r15 -+.LCFI7: -+ sts.l pr,@-r15 -+ -+ /* Stack layout: -+ ... -+ 32 bytes (floating register parameters, SH-4 only) -+ 16 bytes (register parameters) -+ 4 bytes (result) -+ 4 bytes (5th arg) -+ <- new stack pointer -+ */ -+.LCFI8: -+#if defined(__SH4__) -+ add #-56,r15 -+#else -+ add #-24,r15 -+#endif -+.LCFI9: -+ mov r15,r14 -+.LCFIA: -+ mov r14,r1 -+ add #24,r1 -+ mov.l r7,@-r1 -+ mov.l r6,@-r1 -+ mov.l r5,@-r1 -+ mov.l r4,@-r1 -+ mov r1,r6 -+ -+#if defined(__SH4__) -+ mov r14,r1 -+ add #56,r1 -+#ifdef __LITTLE_ENDIAN__ -+ fmov.s fr10,@-r1 -+ fmov.s fr11,@-r1 -+ fmov.s fr8,@-r1 -+ fmov.s fr9,@-r1 -+ fmov.s fr6,@-r1 -+ fmov.s fr7,@-r1 -+ fmov.s fr4,@-r1 -+ fmov.s fr5,@-r1 -+#else -+ fmov.s fr11,@-r1 -+ fmov.s fr10,@-r1 -+ fmov.s fr9,@-r1 -+ fmov.s fr8,@-r1 -+ fmov.s fr7,@-r1 -+ fmov.s fr6,@-r1 -+ fmov.s fr5,@-r1 -+ fmov.s fr4,@-r1 -+#endif -+ mov r1,r7 -+#endif -+ -+ mov r14,r1 -+ add #4,r1 -+ mov r1,r5 -+ -+ mov r14,r1 -+#if defined(__SH4__) -+ add #64,r1 -+#else -+ add #32,r1 -+#endif -+ mov.l r1,@r14 -+ -+ mov.l L_helper,r0 -+ jsr @r0 -+ mov r3,r4 -+ -+ shll r0 -+ mov r0,r1 -+ mova L_table,r0 -+ add r1,r0 -+ mov.w @r0,r0 -+ mov r14,r2 -+ braf r0 -+ add #4,r2 -+0: -+ .align 2 -+L_helper: -+ .long ffi_closure_helper_SYSV -+L_table: -+ .short L_case_v - 0b /* FFI_TYPE_VOID */ -+ .short L_case_i - 0b /* FFI_TYPE_INT */ -+#if defined(__SH4__) -+ .short L_case_f - 0b /* FFI_TYPE_FLOAT */ -+ .short L_case_d - 0b /* FFI_TYPE_DOUBLE */ -+ .short L_case_d - 0b /* FFI_TYPE_LONGDOUBLE */ -+#else -+ .short L_case_i - 0b /* FFI_TYPE_FLOAT */ -+ .short L_case_ll - 0b /* FFI_TYPE_DOUBLE */ -+ .short L_case_ll - 0b /* FFI_TYPE_LONGDOUBLE */ -+#endif -+ .short L_case_uq - 0b /* FFI_TYPE_UINT8 */ -+ .short L_case_q - 0b /* FFI_TYPE_SINT8 */ -+ .short L_case_uh - 0b /* FFI_TYPE_UINT16 */ -+ .short L_case_h - 0b /* FFI_TYPE_SINT16 */ -+ .short L_case_i - 0b /* FFI_TYPE_UINT32 */ -+ .short L_case_i - 0b /* FFI_TYPE_SINT32 */ -+ .short L_case_ll - 0b /* FFI_TYPE_UINT64 */ -+ .short L_case_ll - 0b /* FFI_TYPE_SINT64 */ -+ .short L_case_v - 0b /* FFI_TYPE_STRUCT */ -+ .short L_case_i - 0b /* FFI_TYPE_POINTER */ -+ -+#if defined(__SH4__) -+L_case_d: -+#ifdef __LITTLE_ENDIAN__ -+ fmov.s @r2+,fr1 -+ bra L_case_v -+ fmov.s @r2,fr0 -+#else -+ fmov.s @r2+,fr0 -+ bra L_case_v -+ fmov.s @r2,fr1 -+#endif -+ -+L_case_f: -+ bra L_case_v -+ fmov.s @r2,fr0 -+#endif -+ -+L_case_ll: -+ mov.l @r2+,r0 -+ bra L_case_v -+ mov.l @r2,r1 -+ -+L_case_i: -+ bra L_case_v -+ mov.l @r2,r0 -+ -+L_case_q: -+#ifdef __LITTLE_ENDIAN__ -+#else -+ add #3,r2 -+#endif -+ bra L_case_v -+ mov.b @r2,r0 -+ -+L_case_uq: -+#ifdef __LITTLE_ENDIAN__ -+#else -+ add #3,r2 -+#endif -+ mov.b @r2,r0 -+ bra L_case_v -+ extu.b r0,r0 -+ -+L_case_h: -+#ifdef __LITTLE_ENDIAN__ -+#else -+ add #2,r2 -+#endif -+ bra L_case_v -+ mov.w @r2,r0 -+ -+L_case_uh: -+#ifdef __LITTLE_ENDIAN__ -+#else -+ add #2,r2 -+#endif -+ mov.w @r2,r0 -+ extu.w r0,r0 -+ /* fall through */ -+ -+L_case_v: -+#if defined(__SH4__) -+ add #56,r15 -+#else -+ add #24,r15 -+#endif -+ lds.l @r15+,pr -+ rts -+ mov.l @r15+,r14 -+.LFE2: -+.ffi_closure_SYSV_end: -+ .size CNAME(ffi_closure_SYSV),.ffi_closure_SYSV_end-CNAME(ffi_closure_SYSV) -+ -+ .section ".eh_frame","aw",@progbits -+__FRAME_BEGIN__: -+ .4byte .LECIE1-.LSCIE1 /* Length of Common Information Entry */ -+.LSCIE1: -+ .4byte 0x0 /* CIE Identifier Tag */ -+ .byte 0x1 /* CIE Version */ -+ .byte 0x0 /* CIE Augmentation */ -+ .byte 0x1 /* uleb128 0x1; CIE Code Alignment Factor */ -+ .byte 0x7c /* sleb128 -4; CIE Data Alignment Factor */ -+ .byte 0x11 /* CIE RA Column */ -+ .byte 0xc /* DW_CFA_def_cfa */ -+ .byte 0xf /* uleb128 0xf */ -+ .byte 0x0 /* uleb128 0x0 */ -+ .align 2 -+.LECIE1: -+.LSFDE1: -+ .4byte .LEFDE1-.LASFDE1 /* FDE Length */ -+.LASFDE1: -+ .4byte .LASFDE1-__FRAME_BEGIN__ /* FDE CIE offset */ -+ .4byte .LFB1 /* FDE initial location */ -+ .4byte .LFE1-.LFB1 /* FDE address range */ -+ .byte 0x4 /* DW_CFA_advance_loc4 */ -+ .4byte .LCFI0-.LFB1 -+ .byte 0xe /* DW_CFA_def_cfa_offset */ -+ .byte 0x4 /* uleb128 0x4 */ -+ .byte 0x4 /* DW_CFA_advance_loc4 */ -+ .4byte .LCFI1-.LCFI0 -+ .byte 0xe /* DW_CFA_def_cfa_offset */ -+ .byte 0x8 /* uleb128 0x4 */ -+ .byte 0x4 /* DW_CFA_advance_loc4 */ -+ .4byte .LCFI2-.LCFI1 -+ .byte 0xe /* DW_CFA_def_cfa_offset */ -+ .byte 0xc /* uleb128 0x4 */ -+ .byte 0x4 /* DW_CFA_advance_loc4 */ -+ .4byte .LCFI3-.LCFI2 -+ .byte 0xe /* DW_CFA_def_cfa_offset */ -+ .byte 0x10 /* uleb128 0x4 */ -+ .byte 0x4 /* DW_CFA_advance_loc4 */ -+ .4byte .LCFI4-.LCFI3 -+ .byte 0xe /* DW_CFA_def_cfa_offset */ -+ .byte 0x14 /* uleb128 0x4 */ -+ .byte 0x4 /* DW_CFA_advance_loc4 */ -+ .4byte .LCFI5-.LCFI4 -+ .byte 0xe /* DW_CFA_def_cfa_offset */ -+ .byte 0x18 /* uleb128 0x4 */ -+ .byte 0x91 /* DW_CFA_offset, column 0x11 */ -+ .byte 0x6 /* uleb128 0x6 */ -+ .byte 0x8e /* DW_CFA_offset, column 0xe */ -+ .byte 0x5 /* uleb128 0x5 */ -+ .byte 0x8c /* DW_CFA_offset, column 0xc */ -+ .byte 0x4 /* uleb128 0x4 */ -+ .byte 0x8a /* DW_CFA_offset, column 0xa */ -+ .byte 0x3 /* uleb128 0x3 */ -+ .byte 0x89 /* DW_CFA_offset, column 0x9 */ -+ .byte 0x2 /* uleb128 0x2 */ -+ .byte 0x88 /* DW_CFA_offset, column 0x8 */ -+ .byte 0x1 /* uleb128 0x1 */ -+ .byte 0x4 /* DW_CFA_advance_loc4 */ -+ .4byte .LCFI6-.LCFI5 -+ .byte 0xd /* DW_CFA_def_cfa_register */ -+ .byte 0xe /* uleb128 0xe */ -+ .align 2 -+.LEFDE1: -+ -+.LSFDE3: -+ .4byte .LEFDE3-.LASFDE3 /* FDE Length */ -+.LASFDE3: -+ .4byte .LASFDE3-__FRAME_BEGIN__ /* FDE CIE offset */ -+ .4byte .LFB2 /* FDE initial location */ -+ .4byte .LFE2-.LFB2 /* FDE address range */ -+ .byte 0x4 /* DW_CFA_advance_loc4 */ -+ .4byte .LCFI7-.LFB2 -+ .byte 0xe /* DW_CFA_def_cfa_offset */ -+ .byte 0x4 /* uleb128 0x4 */ -+ .byte 0x4 /* DW_CFA_advance_loc4 */ -+ .4byte .LCFI8-.LCFI7 -+ .byte 0xe /* DW_CFA_def_cfa_offset */ -+ .byte 0x8 /* uleb128 0x8 */ -+ .byte 0x4 /* DW_CFA_advance_loc4 */ -+ .4byte .LCFI9-.LCFI8 -+ .byte 0xe /* DW_CFA_def_cfa_offset */ -+#if defined(__SH4__) -+ .byte 8+56 /* uleb128 8+56 */ -+#else -+ .byte 8+24 /* uleb128 8+24 */ -+#endif -+ .byte 0x91 /* DW_CFA_offset, column 0x11 */ -+ .byte 0x2 -+ .byte 0x8e /* DW_CFA_offset, column 0xe */ -+ .byte 0x1 -+ .byte 0x4 /* DW_CFA_advance_loc4 */ -+ .4byte .LCFIA-.LCFI9 -+ .byte 0xd /* DW_CFA_def_cfa_register */ -+ .byte 0xe /* uleb128 0xe */ -+ .align 2 -+.LEFDE3: -diff -ruN --exclude=CVS gcc-3.2.2.orig/libffi/src/sparc/ffi.c gcc/libffi/src/sparc/ffi.c ---- gcc-3.2.2.orig/libffi/src/sparc/ffi.c Sat Mar 3 07:21:23 2001 -+++ gcc/libffi/src/sparc/ffi.c Sat Jan 4 08:08:56 2003 -@@ -1,5 +1,5 @@ - /* ----------------------------------------------------------------------- -- ffi.c - Copyright (c) 1996 Cygnus Solutions -+ ffi.c - Copyright (c) 1996, 2003 Cygnus Solutions - - Sparc Foreign Function Interface - -@@ -28,20 +28,22 @@ - - #include - -+#ifdef SPARC64 -+extern void ffi_closure_v9(void); -+#else -+extern void ffi_closure_v8(void); -+#endif -+ - /* ffi_prep_args is called by the assembly routine once stack space - has been allocated for the function's arguments */ - - void ffi_prep_args_v8(char *stack, extended_cif *ecif) - { - int i; -- int tmp; -- int avn; - void **p_argv; - char *argp; - ffi_type **p_arg; - -- tmp = 0; -- - /* Skip 16 words for the window save area */ - argp = stack + 16*sizeof(int); - -@@ -66,18 +68,12 @@ - ((int*)argp)[5] = 0; - #endif - -- avn = ecif->cif->nargs; - p_argv = ecif->avalue; - -- for (i = ecif->cif->nargs, p_arg = ecif->cif->arg_types; -- i && avn; -- i--, p_arg++) -+ for (i = ecif->cif->nargs, p_arg = ecif->cif->arg_types; i; i--, p_arg++) - { - size_t z; - -- if (avn) -- { -- avn--; - if ((*p_arg)->type == FFI_TYPE_STRUCT - #if FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE - || (*p_arg)->type == FFI_TYPE_LONGDOUBLE -@@ -122,7 +118,6 @@ - } - p_argv++; - argp += z; -- } - } - - return; -@@ -420,3 +415,101 @@ - } - - } -+ -+ffi_status -+ffi_prep_closure (ffi_closure* closure, -+ ffi_cif* cif, -+ void (*fun)(ffi_cif*, void*, void**, void*), -+ void *user_data) -+{ -+ unsigned int *tramp = (unsigned int *) &closure->tramp[0]; -+ unsigned long fn; -+ unsigned long ctx = (unsigned long) closure; -+ -+#ifdef SPARC64 -+ /* Trampoline address is equal to the closure address. We take advantage -+ of that to reduce the trampoline size by 8 bytes. */ -+ FFI_ASSERT (cif->abi == FFI_V9); -+ fn = (unsigned long) ffi_closure_v9; -+ tramp[0] = 0x83414000; /* rd %pc, %g1 */ -+ tramp[1] = 0xca586010; /* ldx [%g1+16], %g5 */ -+ tramp[2] = 0x81c14000; /* jmp %g5 */ -+ tramp[3] = 0x01000000; /* nop */ -+ *((unsigned long *) &tramp[4]) = fn; -+#else -+ FFI_ASSERT (cif->abi == FFI_V8); -+ fn = (unsigned long) ffi_closure_v8; -+ tramp[0] = 0x03000000 | fn >> 10; /* sethi %hi(fn), %g1 */ -+ tramp[1] = 0x05000000 | ctx >> 10; /* sethi %hi(ctx), %g2 */ -+ tramp[2] = 0x81c06000 | (fn & 0x3ff); /* jmp %g1+%lo(fn) */ -+ tramp[3] = 0x8410a000 | (ctx & 0x3ff);/* or %g2, %lo(ctx) */ -+#endif -+ -+ closure->cif = cif; -+ closure->fun = fun; -+ closure->user_data = user_data; -+ -+ /* Flush the Icache. FIXME: alignment isn't certain, assume 8 bytes */ -+#ifdef SPARC64 -+ asm volatile ("flush %0" : : "r" (closure) : "memory"); -+ asm volatile ("flush %0" : : "r" (((char *) closure) + 8) : "memory"); -+#else -+ asm volatile ("iflush %0" : : "r" (closure) : "memory"); -+ asm volatile ("iflush %0" : : "r" (((char *) closure) + 8) : "memory"); -+#endif -+ -+ return FFI_OK; -+} -+ -+int -+ffi_closure_sparc_inner(ffi_closure *closure, -+ void *rvalue, unsigned long *gpr, double *fpr) -+{ -+ ffi_cif *cif; -+ void **avalue; -+ ffi_type **arg_types; -+ int i, avn, argn; -+ -+ cif = closure->cif; -+ avalue = alloca(cif->nargs * sizeof(void *)); -+ -+ argn = 0; -+ -+ /* Copy the caller's structure return address to that the closure -+ returns the data directly to the caller. */ -+ if (cif->flags == FFI_TYPE_STRUCT) -+ { -+ rvalue = (void *) gpr[0]; -+ argn = 1; -+ } -+ -+ i = 0; -+ avn = cif->nargs; -+ arg_types = cif->arg_types; -+ -+ /* Grab the addresses of the arguments from the stack frame. */ -+ while (i < avn) -+ { -+ /* Assume big-endian. FIXME */ -+ argn += ALIGN(arg_types[i]->size, SIZEOF_ARG) / SIZEOF_ARG; -+ -+#ifdef SPARC64 -+ if (i < 6 && (arg_types[i]->type == FFI_TYPE_FLOAT -+ || arg_types[i]->type == FFI_TYPE_DOUBLE -+#if FFI_TYPE_LONGDOUBLE != FFI_TYPE_DOUBLE -+ || arg_types[i]->type == FFI_TYPE_LONGDOUBLE -+#endif -+ )) -+ avalue[i] = ((char *) &fpr[argn]) - arg_types[i]->size; -+ else -+#endif -+ avalue[i] = ((char *) &gpr[argn]) - arg_types[i]->size; -+ i++; -+ } -+ -+ /* Invoke the closure. */ -+ (closure->fun) (cif, rvalue, avalue, closure->user_data); -+ -+ /* Tell ffi_closure_sparc how to perform return type promotions. */ -+ return cif->rtype->type; -+} -diff -ruN --exclude=CVS gcc-3.2.2.orig/libffi/src/sparc/v8.S gcc/libffi/src/sparc/v8.S ---- gcc-3.2.2.orig/libffi/src/sparc/v8.S Mon Apr 29 05:12:04 2002 -+++ gcc/libffi/src/sparc/v8.S Sat Jan 4 08:08:56 2003 -@@ -1,5 +1,5 @@ - /* ----------------------------------------------------------------------- -- v8.S - Copyright (c) 1996, 1997 Cygnus Solutions -+ v8.S - Copyright (c) 1996, 1997, 2003 Cygnus Solutions - - Sparc Foreign Function Interface - -@@ -94,6 +94,72 @@ - .ffi_call_V8_end: - .size ffi_call_V8,.ffi_call_V8_end-ffi_call_V8 - -+ -+#define STACKFRAME 104 /* 16*4 register window + -+ 1*4 struct return + -+ 6*4 args backing store + -+ 3*4 locals */ -+ -+/* ffi_closure_v8(...) -+ -+ Receives the closure argument in %g2. */ -+ -+ .text -+ .align 8 -+ .globl ffi_closure_v8 -+ -+ffi_closure_v8: -+ .register %g2, #scratch -+.LLFB2: -+ save %sp, -STACKFRAME, %sp -+.LLCFI1: -+ -+ ! Store all of the potential argument registers in va_list format. -+ st %i0, [%fp+68+0] -+ st %i1, [%fp+68+4] -+ st %i2, [%fp+68+8] -+ st %i3, [%fp+68+12] -+ st %i4, [%fp+68+16] -+ st %i5, [%fp+68+20] -+ -+ ! Call ffi_closure_sparc_inner to do the bulk of the work. -+ mov %g2, %o0 -+ add %fp, -8, %o1 -+ add %fp, 68, %o2 -+ call ffi_closure_sparc_inner -+ mov 0, %o3 -+ -+ ! Load up the return value in the proper type. -+ cmp %o0, FFI_TYPE_VOID -+ be done1 -+ -+ cmp %o0, FFI_TYPE_FLOAT -+ be,a done1 -+ ld [%fp-8], %f0 -+ -+ cmp %o0, FFI_TYPE_DOUBLE -+ be,a done1 -+ ldd [%fp-8], %f0 -+ -+ cmp %o0, FFI_TYPE_SINT64 -+ be,a integer -+ ld [%fp-4], %i1 -+ -+ cmp %o0, FFI_TYPE_UINT64 -+ be,a integer -+ ld [%fp-4], %i1 -+ -+integer: -+ ld [%fp-8], %i0 -+ -+done1: -+ ret -+ restore -+.LLFE2: -+ -+.ffi_closure_v8_end: -+ .size ffi_closure_v8,.ffi_closure_v8_end-ffi_closure_v8 -+ - #ifdef SPARC64 - #define WS 8 - #define nword xword -@@ -148,3 +214,26 @@ - .byte 0x1f ! uleb128 0x1f - .align WS - .LLEFDE1: -+.LLSFDE2: -+ .uaword .LLEFDE2-.LLASFDE2 ! FDE Length -+.LLASFDE2: -+ .uaword .LLASFDE2-.LLframe1 ! FDE CIE offset -+#ifdef HAVE_AS_SPARC_UA_PCREL -+ .uaword %r_disp32(.LLFB2) -+ .uaword .LLFE2-.LLFB2 ! FDE address range -+#else -+ .align WS -+ .nword .LLFB2 -+ .uanword .LLFE2-.LLFB2 ! FDE address range -+#endif -+ .byte 0x0 ! uleb128 0x0; Augmentation size -+ .byte 0x4 ! DW_CFA_advance_loc4 -+ .uaword .LLCFI1-.LLFB2 -+ .byte 0xd ! DW_CFA_def_cfa_register -+ .byte 0x1e ! uleb128 0x1e -+ .byte 0x2d ! DW_CFA_GNU_window_save -+ .byte 0x9 ! DW_CFA_register -+ .byte 0xf ! uleb128 0xf -+ .byte 0x1f ! uleb128 0x1f -+ .align WS -+.LLEFDE2: -diff -ruN --exclude=CVS gcc-3.2.2.orig/libffi/src/sparc/v9.S gcc/libffi/src/sparc/v9.S ---- gcc-3.2.2.orig/libffi/src/sparc/v9.S Mon Apr 29 05:12:04 2002 -+++ gcc/libffi/src/sparc/v9.S Sat Jan 4 08:08:56 2003 -@@ -1,5 +1,5 @@ - /* ----------------------------------------------------------------------- -- v9.S - Copyright (c) 2000 Cygnus Solutions -+ v9.S - Copyright (c) 2000, 2003 Cygnus Solutions - - Sparc 64bit Foreign Function Interface - -@@ -99,7 +99,7 @@ - cmp %i3, FFI_TYPE_STRUCT - be,pn %icc, dostruct - -- cmp %i3, FFI_TYPE_LONGDOUBLE -+ cmp %i3, FFI_TYPE_LONGDOUBLE - bne,pt %icc, done - nop - std %f0, [%i4+0] -@@ -125,6 +125,88 @@ - .ffi_call_V9_end: - .size ffi_call_V9,.ffi_call_V9_end-ffi_call_V9 - -+ -+#define STACKFRAME 240 /* 16*8 register window + -+ 6*8 args backing store + -+ 8*8 locals */ -+#define FP %fp+STACK_BIAS -+ -+/* ffi_closure_v9(...) -+ -+ Receives the closure argument in %g1. */ -+ -+ .text -+ .align 8 -+ .globl ffi_closure_v9 -+ -+ffi_closure_v9: -+.LLFB2: -+ save %sp, -STACKFRAME, %sp -+.LLCFI1: -+ -+ ! Store all of the potential argument registers in va_list format. -+ stx %i0, [FP+128+0] -+ stx %i1, [FP+128+8] -+ stx %i2, [FP+128+16] -+ stx %i3, [FP+128+24] -+ stx %i4, [FP+128+32] -+ stx %i5, [FP+128+40] -+ -+ ! Store possible floating point argument registers too. -+ std %f0, [FP-48] -+ std %f2, [FP-40] -+ std %f4, [FP-32] -+ std %f6, [FP-24] -+ std %f8, [FP-16] -+ std %f10, [FP-8] -+ -+ ! Call ffi_closure_sparc_inner to do the bulk of the work. -+ mov %g1, %o0 -+ add %fp, STACK_BIAS-64, %o1 -+ add %fp, STACK_BIAS+128, %o2 -+ call ffi_closure_sparc_inner -+ add %fp, STACK_BIAS-48, %o3 -+ -+ ! Load up the return value in the proper type. -+ cmp %o0, FFI_TYPE_VOID -+ be,pn %icc, done1 -+ -+ cmp %o0, FFI_TYPE_FLOAT -+ be,a,pn %icc, done1 -+ ld [FP-64], %f0 -+ -+ cmp %o0, FFI_TYPE_DOUBLE -+ be,a,pn %icc, done1 -+ ldd [FP-64], %f0 -+ -+ cmp %o0, FFI_TYPE_LONGDOUBLE -+ be,a,pn %icc, longdouble1 -+ ldd [FP-64], %f0 -+ -+ cmp %o0, FFI_TYPE_STRUCT -+ be,pn %icc, struct1 -+ -+ ! FFI_TYPE_UINT64 | FFI_TYPE_SINT64 | FFI_TYPE_POINTER -+ ldx [FP-64], %i0 -+ -+done1: -+ ret -+ restore -+ -+struct1: -+ ldx [FP-56], %i2 -+ ret -+ restore -+ -+longdouble1: -+ ldd [FP-56], %f2 -+ ret -+ restore -+.LLFE2: -+ -+.ffi_closure_v9_end: -+ .size ffi_closure_v9,.ffi_closure_v9_end-ffi_closure_v9 -+ - .section ".eh_frame",#alloc,#write - .LLframe1: - .uaword .LLECIE1-.LLSCIE1 ! Length of Common Information Entry -@@ -169,5 +251,27 @@ - .byte 0x1f ! uleb128 0x1f - .align 8 - .LLEFDE1: -- -+.LLSFDE2: -+ .uaword .LLEFDE2-.LLASFDE2 ! FDE Length -+.LLASFDE2: -+ .uaword .LLASFDE2-.LLframe1 ! FDE CIE offset -+#ifdef HAVE_AS_SPARC_UA_PCREL -+ .uaword %r_disp32(.LLFB2) -+ .uaword .LLFE2-.LLFB2 ! FDE address range -+#else -+ .align 8 -+ .xword .LLFB2 -+ .uaxword .LLFE2-.LLFB2 ! FDE address range -+#endif -+ .byte 0x0 ! uleb128 0x0; Augmentation size -+ .byte 0x4 ! DW_CFA_advance_loc4 -+ .uaword .LLCFI1-.LLFB2 -+ .byte 0xd ! DW_CFA_def_cfa_register -+ .byte 0x1e ! uleb128 0x1e -+ .byte 0x2d ! DW_CFA_GNU_window_save -+ .byte 0x9 ! DW_CFA_register -+ .byte 0xf ! uleb128 0xf -+ .byte 0x1f ! uleb128 0x1f -+ .align 8 -+.LLEFDE2: - #endif -diff -ruN --exclude=CVS gcc-3.2.2.orig/libffi/src/types.c gcc/libffi/src/types.c ---- gcc-3.2.2.orig/libffi/src/types.c Tue Mar 27 11:39:16 2001 -+++ gcc/libffi/src/types.c Wed Nov 27 07:24:05 2002 -@@ -42,7 +42,8 @@ - FFI_INTEGRAL_TYPEDEF(sint32, 4, 4, FFI_TYPE_SINT32); - FFI_INTEGRAL_TYPEDEF(float, 4, 4, FFI_TYPE_FLOAT); - --#if defined ALPHA || defined SPARC64 -+#if defined ALPHA || defined SPARC64 || defined X86_64 || defined S390X \ -+ || defined IA64 - - FFI_INTEGRAL_TYPEDEF(pointer, 8, 8, FFI_TYPE_POINTER); - -@@ -52,22 +53,12 @@ - - #endif - --#ifdef X86 -+#if defined X86 || defined X86_WIN32 || defined ARM || defined M68K - - FFI_INTEGRAL_TYPEDEF(uint64, 8, 4, FFI_TYPE_UINT64); - FFI_INTEGRAL_TYPEDEF(sint64, 8, 4, FFI_TYPE_SINT64); - --#elif defined X86_WIN32 -- --FFI_INTEGRAL_TYPEDEF(uint64, 8, 4, FFI_TYPE_UINT64); --FFI_INTEGRAL_TYPEDEF(sint64, 8, 4, FFI_TYPE_SINT64); -- --#elif defined ARM -- --FFI_INTEGRAL_TYPEDEF(uint64, 8, 4, FFI_TYPE_UINT64); --FFI_INTEGRAL_TYPEDEF(sint64, 8, 4, FFI_TYPE_SINT64); -- --#elif defined M68K -+#elif defined SH - - FFI_INTEGRAL_TYPEDEF(uint64, 8, 4, FFI_TYPE_UINT64); - FFI_INTEGRAL_TYPEDEF(sint64, 8, 4, FFI_TYPE_SINT64); -@@ -80,12 +71,7 @@ - #endif - - --#ifdef X86 -- --FFI_INTEGRAL_TYPEDEF(double, 8, 4, FFI_TYPE_DOUBLE); --FFI_INTEGRAL_TYPEDEF(longdouble, 12, 4, FFI_TYPE_LONGDOUBLE); -- --#elif defined X86_WIN32 -+#if defined X86 || defined X86_WIN32 || defined M68K - - FFI_INTEGRAL_TYPEDEF(double, 8, 4, FFI_TYPE_DOUBLE); - FFI_INTEGRAL_TYPEDEF(longdouble, 12, 4, FFI_TYPE_LONGDOUBLE); -@@ -95,25 +81,25 @@ - FFI_INTEGRAL_TYPEDEF(double, 8, 4, FFI_TYPE_DOUBLE); - FFI_INTEGRAL_TYPEDEF(longdouble, 8, 4, FFI_TYPE_LONGDOUBLE); - --#elif defined M68K -+#elif defined SH - - FFI_INTEGRAL_TYPEDEF(double, 8, 4, FFI_TYPE_DOUBLE); --FFI_INTEGRAL_TYPEDEF(longdouble, 12, 4, FFI_TYPE_LONGDOUBLE); -+FFI_INTEGRAL_TYPEDEF(longdouble, 8, 4, FFI_TYPE_LONGDOUBLE); - - #elif defined SPARC - - FFI_INTEGRAL_TYPEDEF(double, 8, 8, FFI_TYPE_DOUBLE); -- - #ifdef SPARC64 -- - FFI_INTEGRAL_TYPEDEF(longdouble, 16, 16, FFI_TYPE_LONGDOUBLE); -- - #else -- - FFI_INTEGRAL_TYPEDEF(longdouble, 16, 8, FFI_TYPE_LONGDOUBLE); -- - #endif - -+#elif defined X86_64 -+ -+FFI_INTEGRAL_TYPEDEF(double, 8, 8, FFI_TYPE_DOUBLE); -+FFI_INTEGRAL_TYPEDEF(longdouble, 16, 16, FFI_TYPE_LONGDOUBLE); -+ - #else - - FFI_INTEGRAL_TYPEDEF(double, 8, 8, FFI_TYPE_DOUBLE); -diff -ruN --exclude=CVS gcc-3.2.2.orig/libffi/src/x86/ffi.c gcc/libffi/src/x86/ffi.c ---- gcc-3.2.2.orig/libffi/src/x86/ffi.c Tue May 28 18:22:08 2002 -+++ gcc/libffi/src/x86/ffi.c Fri Dec 6 10:16:45 2002 -@@ -1,5 +1,8 @@ - /* ----------------------------------------------------------------------- -- ffi.c - Copyright (c) 1996, 1998, 1999 Cygnus Solutions -+ ffi.c - Copyright (c) 1996, 1998, 1999, 2001 Red Hat, Inc. -+ Copyright (c) 2002 Ranjit Mathew -+ Copyright (c) 2002 Bo Thorsen -+ Copyright (c) 2002 Roger Sayle - - x86 Foreign Function Interface - -@@ -23,6 +26,8 @@ - OTHER DEALINGS IN THE SOFTWARE. - ----------------------------------------------------------------------- */ - -+#ifndef __x86_64__ -+ - #include - #include - -@@ -36,12 +41,10 @@ - /*@=exportheader@*/ - { - register unsigned int i; -- register int tmp; - register void **p_argv; - register char *argp; - register ffi_type **p_arg; - -- tmp = 0; - argp = stack; - - if (ecif->cif->rtype->type == FFI_TYPE_STRUCT) -@@ -148,6 +151,18 @@ - /*@=declundef@*/ - /*@=exportheader@*/ - -+#ifdef X86_WIN32 -+/*@-declundef@*/ -+/*@-exportheader@*/ -+extern void ffi_call_STDCALL(void (*)(char *, extended_cif *), -+ /*@out@*/ extended_cif *, -+ unsigned, unsigned, -+ /*@out@*/ unsigned *, -+ void (*fn)()); -+/*@=declundef@*/ -+/*@=exportheader@*/ -+#endif /* X86_WIN32 */ -+ - void ffi_call(/*@dependent@*/ ffi_cif *cif, - void (*fn)(), - /*@out@*/ void *rvalue, -@@ -180,6 +195,14 @@ - cif->flags, ecif.rvalue, fn); - /*@=usedef@*/ - break; -+#ifdef X86_WIN32 -+ case FFI_STDCALL: -+ /*@-usedef@*/ -+ ffi_call_STDCALL(ffi_prep_args, &ecif, cif->bytes, -+ cif->flags, ecif.rvalue, fn); -+ /*@=usedef@*/ -+ break; -+#endif /* X86_WIN32 */ - default: - FFI_ASSERT(0); - break; -@@ -266,12 +289,10 @@ - /*@=exportheader@*/ - { - register unsigned int i; -- register int tmp; - register void **p_argv; - register char *argp; - register ffi_type **p_arg; - -- tmp = 0; - argp = stack; - - if ( cif->rtype->type == FFI_TYPE_STRUCT ) { -@@ -281,13 +302,14 @@ - - p_argv = avalue; - -- for (i = cif->nargs, p_arg = cif->arg_types; i != 0; i--, p_arg++) -+ for (i = cif->nargs, p_arg = cif->arg_types; (i != 0); i--, p_arg++) - { - size_t z; - - /* Align if necessary */ -- if (((*p_arg)->alignment - 1) & (unsigned) argp) -+ if (((*p_arg)->alignment - 1) & (unsigned) argp) { - argp = (char *) ALIGN(argp, (*p_arg)->alignment); -+ } - - z = (*p_arg)->size; - -@@ -298,7 +320,7 @@ - p_argv++; - argp += z; - } -- -+ - return; - } - -@@ -449,6 +471,15 @@ - /*@out@*/ unsigned *, - void (*fn)()); - -+#ifdef X86_WIN32 -+extern void -+ffi_call_STDCALL(void (*)(char *, extended_cif *), -+ /*@out@*/ extended_cif *, -+ unsigned, unsigned, -+ /*@out@*/ unsigned *, -+ void (*fn)()); -+#endif /* X86_WIN32 */ -+ - void - ffi_raw_call(/*@dependent@*/ ffi_cif *cif, - void (*fn)(), -@@ -483,6 +514,14 @@ - cif->flags, ecif.rvalue, fn); - /*@=usedef@*/ - break; -+#ifdef X86_WIN32 -+ case FFI_STDCALL: -+ /*@-usedef@*/ -+ ffi_call_STDCALL(ffi_prep_args_raw, &ecif, cif->bytes, -+ cif->flags, ecif.rvalue, fn); -+ /*@=usedef@*/ -+ break; -+#endif /* X86_WIN32 */ - default: - FFI_ASSERT(0); - break; -@@ -490,3 +529,5 @@ - } - - #endif -+ -+#endif /* __x86_64__ */ -diff -ruN --exclude=CVS gcc-3.2.2.orig/libffi/src/x86/ffi64.c gcc/libffi/src/x86/ffi64.c ---- gcc-3.2.2.orig/libffi/src/x86/ffi64.c Thu Jan 1 09:00:00 1970 -+++ gcc/libffi/src/x86/ffi64.c Wed Jan 29 00:54:28 2003 -@@ -0,0 +1,706 @@ -+/* ----------------------------------------------------------------------- -+ ffi.c - Copyright (c) 2002 Bo Thorsen -+ -+ x86-64 Foreign Function Interface -+ -+ Permission is hereby granted, free of charge, to any person obtaining -+ a copy of this software and associated documentation files (the -+ ``Software''), to deal in the Software without restriction, including -+ without limitation the rights to use, copy, modify, merge, publish, -+ distribute, sublicense, and/or sell copies of the Software, and to -+ permit persons to whom the Software is furnished to do so, subject to -+ the following conditions: -+ -+ The above copyright notice and this permission notice shall be included -+ in all copies or substantial portions of the Software. -+ -+ THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS -+ OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -+ IN NO EVENT SHALL CYGNUS SOLUTIONS BE LIABLE FOR ANY CLAIM, DAMAGES OR -+ OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -+ ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -+ OTHER DEALINGS IN THE SOFTWARE. -+ ----------------------------------------------------------------------- */ -+ -+#include -+#include -+ -+#include -+#include -+ -+/* ffi_prep_args is called by the assembly routine once stack space -+ has been allocated for the function's arguments */ -+ -+#ifdef __x86_64__ -+ -+#define MAX_GPR_REGS 6 -+#define MAX_SSE_REGS 8 -+typedef struct -+{ -+ /* Registers for argument passing. */ -+ long gpr[MAX_GPR_REGS]; -+ __int128_t sse[MAX_SSE_REGS]; -+ -+ /* Stack space for arguments. */ -+ char argspace[0]; -+} stackLayout; -+ -+/* All reference to register classes here is identical to the code in -+ gcc/config/i386/i386.c. Do *not* change one without the other. */ -+ -+/* Register class used for passing given 64bit part of the argument. -+ These represent classes as documented by the PS ABI, with the exception -+ of SSESF, SSEDF classes, that are basically SSE class, just gcc will -+ use SF or DFmode move instead of DImode to avoid reformating penalties. -+ -+ Similary we play games with INTEGERSI_CLASS to use cheaper SImode moves -+ whenever possible (upper half does contain padding). -+ */ -+enum x86_64_reg_class -+ { -+ X86_64_NO_CLASS, -+ X86_64_INTEGER_CLASS, -+ X86_64_INTEGERSI_CLASS, -+ X86_64_SSE_CLASS, -+ X86_64_SSESF_CLASS, -+ X86_64_SSEDF_CLASS, -+ X86_64_SSEUP_CLASS, -+ X86_64_X87_CLASS, -+ X86_64_X87UP_CLASS, -+ X86_64_MEMORY_CLASS -+ }; -+ -+#define MAX_CLASSES 4 -+ -+/* x86-64 register passing implementation. See x86-64 ABI for details. Goal -+ of this code is to classify each 8bytes of incoming argument by the register -+ class and assign registers accordingly. */ -+ -+/* Return the union class of CLASS1 and CLASS2. -+ See the x86-64 PS ABI for details. */ -+ -+static enum x86_64_reg_class -+merge_classes (enum x86_64_reg_class class1, enum x86_64_reg_class class2) -+{ -+ /* Rule #1: If both classes are equal, this is the resulting class. */ -+ if (class1 == class2) -+ return class1; -+ -+ /* Rule #2: If one of the classes is NO_CLASS, the resulting class is -+ the other class. */ -+ if (class1 == X86_64_NO_CLASS) -+ return class2; -+ if (class2 == X86_64_NO_CLASS) -+ return class1; -+ -+ /* Rule #3: If one of the classes is MEMORY, the result is MEMORY. */ -+ if (class1 == X86_64_MEMORY_CLASS || class2 == X86_64_MEMORY_CLASS) -+ return X86_64_MEMORY_CLASS; -+ -+ /* Rule #4: If one of the classes is INTEGER, the result is INTEGER. */ -+ if ((class1 == X86_64_INTEGERSI_CLASS && class2 == X86_64_SSESF_CLASS) -+ || (class2 == X86_64_INTEGERSI_CLASS && class1 == X86_64_SSESF_CLASS)) -+ return X86_64_INTEGERSI_CLASS; -+ if (class1 == X86_64_INTEGER_CLASS || class1 == X86_64_INTEGERSI_CLASS -+ || class2 == X86_64_INTEGER_CLASS || class2 == X86_64_INTEGERSI_CLASS) -+ return X86_64_INTEGER_CLASS; -+ -+ /* Rule #5: If one of the classes is X87 or X87UP class, MEMORY is used. */ -+ if (class1 == X86_64_X87_CLASS || class1 == X86_64_X87UP_CLASS -+ || class2 == X86_64_X87_CLASS || class2 == X86_64_X87UP_CLASS) -+ return X86_64_MEMORY_CLASS; -+ -+ /* Rule #6: Otherwise class SSE is used. */ -+ return X86_64_SSE_CLASS; -+} -+ -+/* Classify the argument of type TYPE and mode MODE. -+ CLASSES will be filled by the register class used to pass each word -+ of the operand. The number of words is returned. In case the parameter -+ should be passed in memory, 0 is returned. As a special case for zero -+ sized containers, classes[0] will be NO_CLASS and 1 is returned. -+ -+ See the x86-64 PS ABI for details. -+*/ -+static int -+classify_argument (ffi_type *type, enum x86_64_reg_class classes[], -+ int *byte_offset) -+{ -+ /* First, align to the right place. */ -+ *byte_offset = ALIGN(*byte_offset, type->alignment); -+ -+ switch (type->type) -+ { -+ case FFI_TYPE_UINT8: -+ case FFI_TYPE_SINT8: -+ case FFI_TYPE_UINT16: -+ case FFI_TYPE_SINT16: -+ case FFI_TYPE_UINT32: -+ case FFI_TYPE_SINT32: -+ case FFI_TYPE_UINT64: -+ case FFI_TYPE_SINT64: -+ case FFI_TYPE_POINTER: -+ if (((*byte_offset) % 8 + type->size) <= 4) -+ classes[0] = X86_64_INTEGERSI_CLASS; -+ else -+ classes[0] = X86_64_INTEGER_CLASS; -+ return 1; -+ case FFI_TYPE_FLOAT: -+ if (((*byte_offset) % 8) == 0) -+ classes[0] = X86_64_SSESF_CLASS; -+ else -+ classes[0] = X86_64_SSE_CLASS; -+ return 1; -+ case FFI_TYPE_DOUBLE: -+ classes[0] = X86_64_SSEDF_CLASS; -+ return 1; -+ case FFI_TYPE_LONGDOUBLE: -+ classes[0] = X86_64_X87_CLASS; -+ classes[1] = X86_64_X87UP_CLASS; -+ return 2; -+ case FFI_TYPE_STRUCT: -+ { -+ const int UNITS_PER_WORD = 8; -+ int words = (type->size + UNITS_PER_WORD - 1) / UNITS_PER_WORD; -+ ffi_type **ptr; -+ int i; -+ enum x86_64_reg_class subclasses[MAX_CLASSES]; -+ -+ /* If the struct is larger than 16 bytes, pass it on the stack. */ -+ if (type->size > 16) -+ return 0; -+ -+ for (i = 0; i < words; i++) -+ classes[i] = X86_64_NO_CLASS; -+ -+ /* Merge the fields of structure. */ -+ for (ptr=type->elements; (*ptr)!=NULL; ptr++) -+ { -+ int num; -+ -+ num = classify_argument (*ptr, subclasses, byte_offset); -+ if (num == 0) -+ return 0; -+ for (i = 0; i < num; i++) -+ { -+ int pos = *byte_offset / 8; -+ classes[i + pos] = -+ merge_classes (subclasses[i], classes[i + pos]); -+ } -+ -+ if ((*ptr)->type != FFI_TYPE_STRUCT) -+ *byte_offset += (*ptr)->size; -+ } -+ -+ /* Final merger cleanup. */ -+ for (i = 0; i < words; i++) -+ { -+ /* If one class is MEMORY, everything should be passed in -+ memory. */ -+ if (classes[i] == X86_64_MEMORY_CLASS) -+ return 0; -+ -+ /* The X86_64_SSEUP_CLASS should be always preceded by -+ X86_64_SSE_CLASS. */ -+ if (classes[i] == X86_64_SSEUP_CLASS -+ && (i == 0 || classes[i - 1] != X86_64_SSE_CLASS)) -+ classes[i] = X86_64_SSE_CLASS; -+ -+ /* X86_64_X87UP_CLASS should be preceded by X86_64_X87_CLASS. */ -+ if (classes[i] == X86_64_X87UP_CLASS -+ && (i == 0 || classes[i - 1] != X86_64_X87_CLASS)) -+ classes[i] = X86_64_SSE_CLASS; -+ } -+ return words; -+ } -+ -+ default: -+ FFI_ASSERT(0); -+ } -+ return 0; /* Never reached. */ -+} -+ -+/* Examine the argument and return set number of register required in each -+ class. Return 0 iff parameter should be passed in memory. */ -+static int -+examine_argument (ffi_type *type, int in_return, int *int_nregs,int *sse_nregs) -+{ -+ enum x86_64_reg_class class[MAX_CLASSES]; -+ int offset = 0; -+ int n; -+ -+ n = classify_argument (type, class, &offset); -+ -+ if (n == 0) -+ return 0; -+ -+ *int_nregs = 0; -+ *sse_nregs = 0; -+ for (n--; n>=0; n--) -+ switch (class[n]) -+ { -+ case X86_64_INTEGER_CLASS: -+ case X86_64_INTEGERSI_CLASS: -+ (*int_nregs)++; -+ break; -+ case X86_64_SSE_CLASS: -+ case X86_64_SSESF_CLASS: -+ case X86_64_SSEDF_CLASS: -+ (*sse_nregs)++; -+ break; -+ case X86_64_NO_CLASS: -+ case X86_64_SSEUP_CLASS: -+ break; -+ case X86_64_X87_CLASS: -+ case X86_64_X87UP_CLASS: -+ if (!in_return) -+ return 0; -+ break; -+ default: -+ abort (); -+ } -+ return 1; -+} -+ -+/* Functions to load floats and double to an SSE register placeholder. */ -+extern void float2sse (float, __int128_t *); -+extern void double2sse (double, __int128_t *); -+extern void floatfloat2sse (void *, __int128_t *); -+ -+/* Functions to put the floats and doubles back. */ -+extern float sse2float (__int128_t *); -+extern double sse2double (__int128_t *); -+extern void sse2floatfloat(__int128_t *, void *); -+ -+/*@-exportheader@*/ -+void -+ffi_prep_args (stackLayout *stack, extended_cif *ecif) -+/*@=exportheader@*/ -+{ -+ int gprcount, ssecount, i, g, s; -+ void **p_argv; -+ void *argp = &stack->argspace; -+ ffi_type **p_arg; -+ -+ /* First check if the return value should be passed in memory. If so, -+ pass the pointer as the first argument. */ -+ gprcount = ssecount = 0; -+ if (ecif->cif->rtype->type != FFI_TYPE_VOID -+ && examine_argument (ecif->cif->rtype, 1, &g, &s) == 0) -+ (void *)stack->gpr[gprcount++] = ecif->rvalue; -+ -+ for (i=ecif->cif->nargs, p_arg=ecif->cif->arg_types, p_argv = ecif->avalue; -+ i!=0; i--, p_arg++, p_argv++) -+ { -+ int in_register = 0; -+ -+ switch ((*p_arg)->type) -+ { -+ case FFI_TYPE_SINT8: -+ case FFI_TYPE_SINT16: -+ case FFI_TYPE_SINT32: -+ case FFI_TYPE_SINT64: -+ case FFI_TYPE_UINT8: -+ case FFI_TYPE_UINT16: -+ case FFI_TYPE_UINT32: -+ case FFI_TYPE_UINT64: -+ case FFI_TYPE_POINTER: -+ if (gprcount < MAX_GPR_REGS) -+ { -+ stack->gpr[gprcount] = 0; -+ stack->gpr[gprcount++] = *(long long *)(*p_argv); -+ in_register = 1; -+ } -+ break; -+ -+ case FFI_TYPE_FLOAT: -+ if (ssecount < MAX_SSE_REGS) -+ { -+ float2sse (*(float *)(*p_argv), &stack->sse[ssecount++]); -+ in_register = 1; -+ } -+ break; -+ -+ case FFI_TYPE_DOUBLE: -+ if (ssecount < MAX_SSE_REGS) -+ { -+ double2sse (*(double *)(*p_argv), &stack->sse[ssecount++]); -+ in_register = 1; -+ } -+ break; -+ } -+ -+ if (in_register) -+ continue; -+ -+ /* Either all places in registers where filled, or this is a -+ type that potentially goes into a memory slot. */ -+ if (examine_argument (*p_arg, 0, &g, &s) == 0 -+ || gprcount + g > MAX_GPR_REGS || ssecount + s > MAX_SSE_REGS) -+ { -+ /* Pass this argument in memory. */ -+ argp = (void *)ALIGN(argp, (*p_arg)->alignment); -+ memcpy (argp, *p_argv, (*p_arg)->size); -+ argp += (*p_arg)->size; -+ } -+ else -+ { -+ /* All easy cases are eliminated. Now fire the big guns. */ -+ -+ enum x86_64_reg_class classes[MAX_CLASSES]; -+ int offset = 0, j, num; -+ void *a; -+ -+ num = classify_argument (*p_arg, classes, &offset); -+ for (j=0, a=*p_argv; jgpr[gprcount++] = *(long long *)a; -+ break; -+ case X86_64_SSE_CLASS: -+ floatfloat2sse (a, &stack->sse[ssecount++]); -+ break; -+ case X86_64_SSESF_CLASS: -+ float2sse (*(float *)a, &stack->sse[ssecount++]); -+ break; -+ case X86_64_SSEDF_CLASS: -+ double2sse (*(double *)a, &stack->sse[ssecount++]); -+ break; -+ default: -+ abort(); -+ } -+ } -+ } -+ } -+} -+ -+/* Perform machine dependent cif processing. */ -+ffi_status -+ffi_prep_cif_machdep (ffi_cif *cif) -+{ -+ int gprcount, ssecount, i, g, s; -+ -+ gprcount = ssecount = 0; -+ -+ /* Reset the byte count. We handle this size estimation here. */ -+ cif->bytes = 0; -+ -+ /* If the return value should be passed in memory, pass the pointer -+ as the first argument. The actual memory isn't allocated here. */ -+ if (cif->rtype->type != FFI_TYPE_VOID -+ && examine_argument (cif->rtype, 1, &g, &s) == 0) -+ gprcount = 1; -+ -+ /* Go over all arguments and determine the way they should be passed. -+ If it's in a register and there is space for it, let that be so. If -+ not, add it's size to the stack byte count. */ -+ for (i=0; inargs; i++) -+ { -+ if (examine_argument (cif->arg_types[i], 0, &g, &s) == 0 -+ || gprcount + g > MAX_GPR_REGS || ssecount + s > MAX_SSE_REGS) -+ { -+ /* This is passed in memory. First align to the basic type. */ -+ cif->bytes = ALIGN(cif->bytes, cif->arg_types[i]->alignment); -+ -+ /* Stack arguments are *always* at least 8 byte aligned. */ -+ cif->bytes = ALIGN(cif->bytes, 8); -+ -+ /* Now add the size of this argument. */ -+ cif->bytes += cif->arg_types[i]->size; -+ } -+ else -+ { -+ gprcount += g; -+ ssecount += s; -+ } -+ } -+ -+ /* Set the flag for the closures return. */ -+ switch (cif->rtype->type) -+ { -+ case FFI_TYPE_VOID: -+ case FFI_TYPE_STRUCT: -+ case FFI_TYPE_SINT64: -+ case FFI_TYPE_FLOAT: -+ case FFI_TYPE_DOUBLE: -+ case FFI_TYPE_LONGDOUBLE: -+ cif->flags = (unsigned) cif->rtype->type; -+ break; -+ -+ case FFI_TYPE_UINT64: -+ cif->flags = FFI_TYPE_SINT64; -+ break; -+ -+ default: -+ cif->flags = FFI_TYPE_INT; -+ break; -+ } -+ -+ return FFI_OK; -+} -+ -+typedef struct -+{ -+ long gpr[2]; -+ __int128_t sse[2]; -+ long double st0; -+} return_value; -+ -+void -+ffi_fill_return_value (return_value *rv, extended_cif *ecif) -+{ -+ enum x86_64_reg_class classes[MAX_CLASSES]; -+ int i = 0, num; -+ long *gpr = rv->gpr; -+ __int128_t *sse = rv->sse; -+ signed char sc; -+ signed short ss; -+ -+ /* This is needed because of the way x86-64 handles signed short -+ integers. */ -+ switch (ecif->cif->rtype->type) -+ { -+ case FFI_TYPE_SINT8: -+ sc = *(signed char *)gpr; -+ *(long long *)ecif->rvalue = (long long)sc; -+ return; -+ case FFI_TYPE_SINT16: -+ ss = *(signed short *)gpr; -+ *(long long *)ecif->rvalue = (long long)ss; -+ return; -+ default: -+ /* Just continue. */ -+ ; -+ } -+ -+ num = classify_argument (ecif->cif->rtype, classes, &i); -+ -+ if (num == 0) -+ /* Return in memory. */ -+ ecif->rvalue = (void *) rv->gpr[0]; -+ else if (num == 2 && classes[0] == X86_64_X87_CLASS && -+ classes[1] == X86_64_X87UP_CLASS) -+ /* This is a long double (this is easiest to handle this way instead -+ of an eightbyte at a time as in the loop below. */ -+ *((long double *)ecif->rvalue) = rv->st0; -+ else -+ { -+ void *a; -+ -+ for (i=0, a=ecif->rvalue; irtype, 1, &dummy, &dummy) == 0)) -+ { -+ /*@-sysunrecog@*/ -+ ecif.rvalue = alloca(cif->rtype->size); -+ /*@=sysunrecog@*/ -+ } -+ else -+ ecif.rvalue = rvalue; -+ -+ /* Stack must always be 16byte aligned. Make it so. */ -+ cif->bytes = ALIGN(cif->bytes, 16); -+ -+ switch (cif->abi) -+ { -+ case FFI_SYSV: -+ /* Calling 32bit code from 64bit is not possible */ -+ FFI_ASSERT(0); -+ break; -+ -+ case FFI_UNIX64: -+ /*@-usedef@*/ -+ ffi_call_UNIX64 (ffi_prep_args, ffi_fill_return_value, &ecif, -+ cif->bytes, ecif.rvalue, fn); -+ /*@=usedef@*/ -+ break; -+ -+ default: -+ FFI_ASSERT(0); -+ break; -+ } -+} -+ -+extern void ffi_closure_UNIX64(void); -+ -+ffi_status -+ffi_prep_closure (ffi_closure* closure, -+ ffi_cif* cif, -+ void (*fun)(ffi_cif*, void*, void**, void*), -+ void *user_data) -+{ -+ volatile unsigned short *tramp; -+ -+ /* FFI_ASSERT (cif->abi == FFI_OSF); */ -+ -+ tramp = (volatile unsigned short *) &closure->tramp[0]; -+ tramp[0] = 0xbb49; /* mov , %r11 */ -+ tramp[5] = 0xba49; /* mov , %r10 */ -+ tramp[10] = 0xff49; /* jmp *%r11 */ -+ tramp[11] = 0x00e3; -+ *(void * volatile *) &tramp[1] = ffi_closure_UNIX64; -+ *(void * volatile *) &tramp[6] = closure; -+ -+ closure->cif = cif; -+ closure->fun = fun; -+ closure->user_data = user_data; -+ -+ return FFI_OK; -+} -+ -+int -+ffi_closure_UNIX64_inner(ffi_closure *closure, va_list l, void *rp) -+{ -+ ffi_cif *cif; -+ void **avalue; -+ ffi_type **arg_types; -+ long i, avn, argn; -+ -+ cif = closure->cif; -+ avalue = alloca(cif->nargs * sizeof(void *)); -+ -+ argn = 0; -+ -+ i = 0; -+ avn = cif->nargs; -+ arg_types = cif->arg_types; -+ -+ /* Grab the addresses of the arguments from the stack frame. */ -+ while (i < avn) -+ { -+ switch (arg_types[i]->type) -+ { -+ case FFI_TYPE_SINT8: -+ case FFI_TYPE_UINT8: -+ case FFI_TYPE_SINT16: -+ case FFI_TYPE_UINT16: -+ case FFI_TYPE_SINT32: -+ case FFI_TYPE_UINT32: -+ case FFI_TYPE_SINT64: -+ case FFI_TYPE_UINT64: -+ case FFI_TYPE_POINTER: -+ { -+ if (l->gp_offset > 48-8) -+ { -+ avalue[i] = l->overflow_arg_area; -+ l->overflow_arg_area = (char *)l->overflow_arg_area + 8; -+ } -+ else -+ { -+ avalue[i] = (char *)l->reg_save_area + l->gp_offset; -+ l->gp_offset += 8; -+ } -+ } -+ break; -+ -+ case FFI_TYPE_STRUCT: -+ /* FIXME */ -+ FFI_ASSERT(0); -+ break; -+ -+ case FFI_TYPE_DOUBLE: -+ { -+ if (l->fp_offset > 176-16) -+ { -+ avalue[i] = l->overflow_arg_area; -+ l->overflow_arg_area = (char *)l->overflow_arg_area + 8; -+ } -+ else -+ { -+ avalue[i] = (char *)l->reg_save_area + l->fp_offset; -+ l->fp_offset += 16; -+ } -+ } -+#if DEBUG_FFI -+ fprintf (stderr, "double arg %d = %g\n", i, *(double *)avalue[i]); -+#endif -+ break; -+ -+ case FFI_TYPE_FLOAT: -+ { -+ if (l->fp_offset > 176-16) -+ { -+ avalue[i] = l->overflow_arg_area; -+ l->overflow_arg_area = (char *)l->overflow_arg_area + 8; -+ } -+ else -+ { -+ avalue[i] = (char *)l->reg_save_area + l->fp_offset; -+ l->fp_offset += 16; -+ } -+ } -+#if DEBUG_FFI -+ fprintf (stderr, "float arg %d = %g\n", i, *(float *)avalue[i]); -+#endif -+ break; -+ -+ default: -+ FFI_ASSERT(0); -+ } -+ -+ argn += ALIGN(arg_types[i]->size, SIZEOF_ARG) / SIZEOF_ARG; -+ i++; -+ } -+ -+ /* Invoke the closure. */ -+ (closure->fun) (cif, rp, avalue, closure->user_data); -+ -+ /* FIXME: Structs not supported. */ -+ FFI_ASSERT(cif->rtype->type != FFI_TYPE_STRUCT); -+ -+ /* Tell ffi_closure_UNIX64 how to perform return type promotions. */ -+ -+ return cif->rtype->type; -+} -+#endif /* ifndef __x86_64__ */ -diff -ruN --exclude=CVS gcc-3.2.2.orig/libffi/src/x86/sysv.S gcc/libffi/src/x86/sysv.S ---- gcc-3.2.2.orig/libffi/src/x86/sysv.S Tue Jul 17 02:10:53 2001 -+++ gcc/libffi/src/x86/sysv.S Fri Jul 19 08:08:31 2002 -@@ -1,5 +1,5 @@ - /* ----------------------------------------------------------------------- -- sysv.S - Copyright (c) 1996, 1998, 2001 Cygnus Solutions -+ sysv.S - Copyright (c) 1996, 1998, 2001, 2002 Cygnus Solutions - - X86 Foreign Function Interface - -@@ -23,6 +23,8 @@ - OTHER DEALINGS IN THE SOFTWARE. - ----------------------------------------------------------------------- */ - -+#ifndef __x86_64__ -+ - #define LIBFFI_ASM - #include - -@@ -163,3 +165,5 @@ - .align 4 - .LEFDE1: - .set .LLFDE1,.LEFDE1-.LSFDE1 -+ -+#endif /* ifndef __x86_64__ */ -diff -ruN --exclude=CVS gcc-3.2.2.orig/libffi/src/x86/unix64.S gcc/libffi/src/x86/unix64.S ---- gcc-3.2.2.orig/libffi/src/x86/unix64.S Thu Jan 1 09:00:00 1970 -+++ gcc/libffi/src/x86/unix64.S Wed Jan 29 00:54:28 2003 -@@ -0,0 +1,302 @@ -+/* ----------------------------------------------------------------------- -+ unix64.S - Copyright (c) 2002 Bo Thorsen -+ -+ x86-64 Foreign Function Interface -+ -+ Permission is hereby granted, free of charge, to any person obtaining -+ a copy of this software and associated documentation files (the -+ ``Software''), to deal in the Software without restriction, including -+ without limitation the rights to use, copy, modify, merge, publish, -+ distribute, sublicense, and/or sell copies of the Software, and to -+ permit persons to whom the Software is furnished to do so, subject to -+ the following conditions: -+ -+ The above copyright notice and this permission notice shall be included -+ in all copies or substantial portions of the Software. -+ -+ THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND, EXPRESS -+ OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -+ IN NO EVENT SHALL CYGNUS SOLUTIONS BE LIABLE FOR ANY CLAIM, DAMAGES OR -+ OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, -+ ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -+ OTHER DEALINGS IN THE SOFTWARE. -+ ----------------------------------------------------------------------- */ -+ -+#ifdef __x86_64__ -+#define LIBFFI_ASM -+#include -+ -+ .section .rodata -+.LC0: -+ .string "asm in progress %lld\n" -+.LC1: -+ .string "asm in progress\n" -+.text -+ .align 2 -+.globl ffi_call_UNIX64 -+ .type ffi_call_UNIX64,@function -+ -+ffi_call_UNIX64: -+.LFB1: -+ pushq %rbp -+.LCFI0: -+ movq %rsp, %rbp -+.LCFI1: -+ /* Save all arguments */ -+ subq $48, %rsp -+.LCFI2: -+ movq %rdi, -8(%rbp) /* ffi_prep_args */ -+ movq %rsi, -16(%rbp) /* ffi_fill_return_value */ -+ movq %rdx, -24(%rbp) /* ecif */ -+ movq %rcx, -32(%rbp) /* cif->bytes */ -+ movq %r8, -40(%rbp) /* ecif.rvalue */ -+ movq %r9, -48(%rbp) /* fn */ -+ -+ /* Make room for all of the new args and the register args */ -+ addl $176, %ecx -+.LCFI3: -+ subq %rcx, %rsp -+.LCFI4: -+ /* Setup the call to ffi_prep_args. */ -+ movq %rdi, %rax /* &ffi_prep_args */ -+ movq %rsp, %rdi /* stackLayout */ -+ movq %rdx, %rsi /* ecif */ -+ call *%rax /* ffi_prep_args(stackLayout, ecif);*/ -+ -+ /* ffi_prep_args have put all the register contents into the */ -+ /* stackLayout struct. Now put the register values in place. */ -+ movq (%rsp), %rdi -+ movq 8(%rsp), %rsi -+ movq 16(%rsp), %rdx -+ movq 24(%rsp), %rcx -+ movq 32(%rsp), %r8 -+ movq 40(%rsp), %r9 -+ movaps 48(%rsp), %xmm0 -+ movaps 64(%rsp), %xmm1 -+ movaps 80(%rsp), %xmm2 -+ movaps 96(%rsp), %xmm3 -+ movaps 112(%rsp), %xmm4 -+ movaps 128(%rsp), %xmm5 -+ movaps 144(%rsp), %xmm6 -+ movaps 160(%rsp), %xmm7 -+ -+ /* Remove space for stackLayout so stack arguments are placed -+ correctly for the call. */ -+.LCFI5: -+ addq $176, %rsp -+.LCFI6: -+ /* Call the user function. */ -+ call *-48(%rbp) -+ -+ /* Make stack space for the return_value struct. */ -+ subq $64, %rsp -+ -+ /* Fill in all potential return values to this struct. */ -+ movq %rax, (%rsp) -+ movq %rdx, 8(%rsp) -+ movaps %xmm0, 16(%rsp) -+ movaps %xmm1, 32(%rsp) -+ fstpt 48(%rsp) -+ -+ /* Now call ffi_fill_return_value. */ -+ movq %rsp, %rdi /* struct return_value */ -+ movq -24(%rbp), %rsi /* ecif */ -+ movq -16(%rbp), %rax /* &ffi_fill_return_value */ -+ call *%rax /* call it */ -+ -+ /* And the work is done. */ -+ leave -+ ret -+.LFE1: -+.ffi_call_UNIX64_end: -+ .size ffi_call_UNIX64,.ffi_call_UNIX64_end-ffi_call_UNIX64 -+ -+.text -+ .align 2 -+.globl float2sse -+ .type float2sse,@function -+float2sse: -+ /* Save the contents of this sse-float in a pointer. */ -+ movaps %xmm0, (%rdi) -+ ret -+ -+ .align 2 -+.globl floatfloat2sse -+ .type floatfloat2sse,@function -+floatfloat2sse: -+ /* Save the contents of these two sse-floats in a pointer. */ -+ movq (%rdi), %xmm0 -+ movaps %xmm0, (%rsi) -+ ret -+ -+ .align 2 -+.globl double2sse -+ .type double2sse,@function -+double2sse: -+ /* Save the contents of this sse-double in a pointer. */ -+ movaps %xmm0, (%rdi) -+ ret -+ -+ .align 2 -+.globl sse2float -+ .type sse2float,@function -+sse2float: -+ /* Save the contents of this sse-float in a pointer. */ -+ movaps (%rdi), %xmm0 -+ ret -+ -+ .align 2 -+.globl sse2double -+ .type sse2double,@function -+sse2double: -+ /* Save the contents of this pointer in a sse-double. */ -+ movaps (%rdi), %xmm0 -+ ret -+ -+ .align 2 -+.globl sse2floatfloat -+ .type sse2floatfloat,@function -+sse2floatfloat: -+ /* Save the contents of this pointer in two sse-floats. */ -+ movaps (%rdi), %xmm0 -+ movq %xmm0, (%rsi) -+ ret -+ -+ .align 2 -+.globl ffi_closure_UNIX64 -+ .type ffi_closure_UNIX64,@function -+ -+ffi_closure_UNIX64: -+.LFB2: -+ pushq %rbp -+.LCFI10: -+ movq %rsp, %rbp -+.LCFI11: -+ subq $240, %rsp -+.LCFI12: -+ movq %rdi, -176(%rbp) -+ movq %rsi, -168(%rbp) -+ movq %rdx, -160(%rbp) -+ movq %rcx, -152(%rbp) -+ movq %r8, -144(%rbp) -+ movq %r9, -136(%rbp) -+ /* FIXME: We can avoid all this stashing of XMM registers by -+ (in ffi_prep_closure) computing the number of -+ floating-point args and moving it into %rax before calling -+ this function. Once this is done, uncomment the next few -+ lines and only the essential XMM registers will be written -+ to memory. This is a significant saving. */ -+/* movzbl %al, %eax */ -+/* movq %rax, %rdx */ -+/* leaq 0(,%rdx,4), %rax */ -+/* leaq 2f(%rip), %rdx */ -+/* subq %rax, %rdx */ -+ leaq -1(%rbp), %rax -+/* jmp *%rdx */ -+ movaps %xmm7, -15(%rax) -+ movaps %xmm6, -31(%rax) -+ movaps %xmm5, -47(%rax) -+ movaps %xmm4, -63(%rax) -+ movaps %xmm3, -79(%rax) -+ movaps %xmm2, -95(%rax) -+ movaps %xmm1, -111(%rax) -+ movaps %xmm0, -127(%rax) -+2: -+ movl %edi, -180(%rbp) -+ movl $0, -224(%rbp) -+ movl $48, -220(%rbp) -+ leaq 16(%rbp), %rax -+ movq %rax, -216(%rbp) -+ leaq -176(%rbp), %rdx -+ movq %rdx, -208(%rbp) -+ leaq -224(%rbp), %rsi -+ movq %r10, %rdi -+ movq %rsp, %rdx -+ call ffi_closure_UNIX64_inner@PLT -+ -+ cmpl $FFI_TYPE_FLOAT, %eax -+ je 1f -+ cmpl $FFI_TYPE_DOUBLE, %eax -+ je 2f -+ cmpl $FFI_TYPE_LONGDOUBLE, %eax -+ je 3f -+ cmpl $FFI_TYPE_STRUCT, %eax -+ je 4f -+ popq %rax -+ leave -+ ret -+1: -+2: -+3: -+ movaps -240(%rbp), %xmm0 -+ leave -+ ret -+4: -+ leave -+ ret -+.LFE2: -+ -+ .section .eh_frame,"a",@progbits -+.Lframe0: -+ .long .LECIE1-.LSCIE1 -+.LSCIE1: -+ .long 0x0 -+ .byte 0x1 -+ .string "zR" -+ .uleb128 0x1 -+ .sleb128 -8 -+ .byte 0x10 -+ .uleb128 0x1 -+ .byte 0x1b -+ .byte 0xc -+ .uleb128 0x7 -+ .uleb128 0x8 -+ .byte 0x90 -+ .uleb128 0x1 -+ .align 8 -+.LECIE1: -+.LSFDE1: -+ .long .LEFDE1-.LASFDE1 -+.LASFDE1: -+ .long .LASFDE1-.Lframe0 -+ -+ .long .LFB1-. -+ .long .LFE1-.LFB1 -+ .uleb128 0x0 -+ .byte 0x4 # DW_CFA_advance_loc4 -+ .long .LCFI0-.LFB1 -+ .byte 0xe # DW_CFA_def_cfa_offset -+ .uleb128 0x10 -+ .byte 0x86 # DW_CFA_offset: r6 at cfa-16 -+ .uleb128 0x2 -+ .byte 0x4 # DW_CFA_advance_loc4 -+ .long .LCFI1-.LCFI0 -+ .byte 0x86 # DW_CFA_offset: r6 at cfa-16 -+ .uleb128 0x2 -+ .byte 0xd # DW_CFA_def_cfa_reg: r6 -+ .uleb128 0x6 -+ .align 8 -+.LEFDE1: -+.LSFDE3: -+ .long .LEFDE3-.LASFDE3 # FDE Length -+.LASFDE3: -+ .long .LASFDE3-.Lframe0 # FDE CIE offset -+ -+ .long .LFB2-. # FDE initial location -+ .long .LFE2-.LFB2 # FDE address range -+ .uleb128 0x0 # Augmentation size -+ .byte 0x4 # DW_CFA_advance_loc4 -+ .long .LCFI10-.LFB2 -+ .byte 0xe # DW_CFA_def_cfa_offset -+ .uleb128 0x10 -+ .byte 0x86 # DW_CFA_offset, column 0x6 -+ .uleb128 0x2 -+ .byte 0x4 # DW_CFA_advance_loc4 -+ .long .LCFI11-.LCFI10 -+ .byte 0xd # DW_CFA_def_cfa_register -+ .uleb128 0x6 -+ .align 8 -+.LEFDE3: -+ -+#endif /* __x86_64__ */ -diff -ruN --exclude=CVS gcc-3.2.2.orig/libffi/src/x86/win32.S gcc/libffi/src/x86/win32.S ---- gcc-3.2.2.orig/libffi/src/x86/win32.S Tue Mar 27 11:39:16 2001 -+++ gcc/libffi/src/x86/win32.S Fri Dec 6 10:16:45 2002 -@@ -1,5 +1,8 @@ - /* ----------------------------------------------------------------------- -- win32.S - Copyright (c) 1996, 1998, 2001 Cygnus Solutions -+ win32.S - Copyright (c) 1996, 1998, 2001, 2002 Red Hat, Inc. -+ Copyright (c) 2001 John Beniton -+ Copyright (c) 2002 Ranjit Mathew -+ - - X86 Foreign Function Interface - -@@ -52,7 +55,10 @@ - # Return stack to previous state and call the function - addl $8,%esp - -- call *28(%ebp) -+ # FIXME: Align the stack to a 128-bit boundary to avoid -+ # potential performance hits. -+ -+ call *28(%ebp) - - # Remove the space we pushed for the args - movl 16(%ebp),%ecx -@@ -123,3 +129,98 @@ - ret - - .ffi_call_SYSV_end: -+ -+ # This assumes we are using gas. -+ .balign 16 -+.globl _ffi_call_STDCALL -+ -+_ffi_call_STDCALL: -+ pushl %ebp -+ movl %esp,%ebp -+ -+ # Make room for all of the new args. -+ movl 16(%ebp),%ecx -+ subl %ecx,%esp -+ -+ movl %esp,%eax -+ -+ # Place all of the ffi_prep_args in position -+ pushl 12(%ebp) -+ pushl %eax -+ call *8(%ebp) -+ -+ # Return stack to previous state and call the function -+ addl $8,%esp -+ -+ # FIXME: Align the stack to a 128-bit boundary to avoid -+ # potential performance hits. -+ -+ call *28(%ebp) -+ -+ # stdcall functions pop arguments off the stack themselves -+ -+ # Load %ecx with the return type code -+ movl 20(%ebp),%ecx -+ -+ # If the return value pointer is NULL, assume no return value. -+ cmpl $0,24(%ebp) -+ jne sc_retint -+ -+ # Even if there is no space for the return value, we are -+ # obliged to handle floating-point values. -+ cmpl $FFI_TYPE_FLOAT,%ecx -+ jne sc_noretval -+ fstp %st(0) -+ -+ jmp sc_epilogue -+ -+sc_retint: -+ cmpl $FFI_TYPE_INT,%ecx -+ jne sc_retfloat -+ # Load %ecx with the pointer to storage for the return value -+ movl 24(%ebp),%ecx -+ movl %eax,0(%ecx) -+ jmp sc_epilogue -+ -+sc_retfloat: -+ cmpl $FFI_TYPE_FLOAT,%ecx -+ jne sc_retdouble -+ # Load %ecx with the pointer to storage for the return value -+ movl 24(%ebp),%ecx -+ fstps (%ecx) -+ jmp sc_epilogue -+ -+sc_retdouble: -+ cmpl $FFI_TYPE_DOUBLE,%ecx -+ jne sc_retlongdouble -+ # Load %ecx with the pointer to storage for the return value -+ movl 24(%ebp),%ecx -+ fstpl (%ecx) -+ jmp sc_epilogue -+ -+sc_retlongdouble: -+ cmpl $FFI_TYPE_LONGDOUBLE,%ecx -+ jne sc_retint64 -+ # Load %ecx with the pointer to storage for the return value -+ movl 24(%ebp),%ecx -+ fstpt (%ecx) -+ jmp sc_epilogue -+ -+sc_retint64: -+ cmpl $FFI_TYPE_SINT64,%ecx -+ jne sc_retstruct -+ # Load %ecx with the pointer to storage for the return value -+ movl 24(%ebp),%ecx -+ movl %eax,0(%ecx) -+ movl %edx,4(%ecx) -+ -+sc_retstruct: -+ # Nothing to do! -+ -+sc_noretval: -+sc_epilogue: -+ movl %ebp,%esp -+ popl %ebp -+ ret -+ -+.ffi_call_STDCALL_end: ---- gcc-3.2.2.orig/libjava/configure.host Mon Jun 10 13:15:26 2002 -+++ gcc-3.2.2/libjava/configure.host Sat Feb 15 19:57:25 2003 -@@ -115,6 +115,12 @@ - enable_getenv_properties_default=no - enable_main_args_default=no - ;; -+ sh-* | sh[34]*-*) -+ sysdeps_dir=sh -+ libgcj_flags="${libgcj_flags} -mieee" -+ libgcj_interpreter=yes -+ enable_hash_synchronization_default=yes -+ ;; - esac - - # This case statement supports generic port properties and may refine -@@ -126,7 +132,8 @@ - powerpc*-linux* | \ - alpha*-linux* | \ - sparc*-linux* | \ -- ia64-*) -+ ia64-* | \ -+ sh-linux* | sh[34]*-linux*) - can_unwind_signal=yes - ;; - *-*-darwin*) diff --git a/patches/gcc/3.2.3/gcc-3.2.3-ppc-asm-spec.patch b/patches/gcc/3.2.3/gcc-3.2.3-ppc-asm-spec.patch deleted file mode 100644 index e0ccd9f..0000000 --- a/patches/gcc/3.2.3/gcc-3.2.3-ppc-asm-spec.patch +++ /dev/null @@ -1,54 +0,0 @@ -Based on gcc-3.4.0/gcc-3.3.3h-ppc-asm-spec.patch - -Fixes the following errors when building gcc for ppc7450: - -/tmp/ccYph3gd.s: Assembler messages: -/tmp/ccYph3gd.s:3823: Error: Unrecognized opcode: `mfvrsave' -/tmp/ccYph3gd.s:3857: Error: Unrecognized opcode: `stvx' -/tmp/ccYph3gd.s:4026: Error: Unrecognized opcode: `lvx' -/tmp/ccYph3gd.s:4027: Error: Unrecognized opcode: `mtvrsave' -make[2]: *** [libgcc/./unwind-dw2.o] Error 1 -make[2]: Leaving directory `/opt/crosstool-0.28-rc35/build/powerpc-7450-linux-gnu/gcc-3.2.3-glibc-2.3.2/build-gcc-core/gcc' -make[1]: *** [stmp-multilib] Error 2 -make[1]: Leaving directory `/opt/crosstool-0.28-rc35/build/powerpc-7450-linux-gnu/gcc-3.2.3-glibc-2.3.2/build-gcc-core/gcc' -make: *** [all-gcc] Error 2 - -Note that the "-mcpu=7450" option must appear on the "gcc" command line in -order for "-maltivec" to be passed to the assembler. Or, "-maltivec" itself -may be passed to the "gcc" command. - -Contributed by Tom Warzeka - -=================================================================== ---- gcc-3.2.3/gcc/config/rs6000/rs6000.h~ 2003-03-29 07:39:20.000000000 -0500 -+++ gcc-3.2.3/gcc/config/rs6000/rs6000.h 2004-08-23 16:33:21.000000000 -0400 -@@ -77,8 +77,8 @@ - %{mcpu=604e: -D_ARCH_PPC} \ - %{mcpu=620: -D_ARCH_PPC} \ - %{mcpu=740: -D_ARCH_PPC} \ --%{mcpu=7400: -D_ARCH_PPC} \ --%{mcpu=7450: -D_ARCH_PPC} \ -+%{mcpu=7400: -D_ARCH_PPC -D__ALTIVEC__} \ -+%{mcpu=7450: -D_ARCH_PPC -D__ALTIVEC__} \ - %{mcpu=750: -D_ARCH_PPC} \ - %{mcpu=801: -D_ARCH_PPC} \ - %{mcpu=821: -D_ARCH_PPC} \ -@@ -117,14 +117,15 @@ - %{mcpu=604e: -mppc} \ - %{mcpu=620: -mppc} \ - %{mcpu=740: -mppc} \ --%{mcpu=7400: -mppc} \ --%{mcpu=7450: -mppc} \ -+%{mcpu=7400: -mppc -maltivec} \ -+%{mcpu=7450: -mppc -maltivec} \ - %{mcpu=750: -mppc} \ - %{mcpu=801: -mppc} \ - %{mcpu=821: -mppc} \ - %{mcpu=823: -mppc} \ - %{mcpu=860: -mppc} \ --%{maltivec: -maltivec}" -+%{maltivec: -maltivec} \ -+-many" - - #define CPP_DEFAULT_SPEC "" - diff --git a/patches/gcc/3.2.3/gcc-3.2.3-trap-posix.patch b/patches/gcc/3.2.3/gcc-3.2.3-trap-posix.patch deleted file mode 100644 index 4751e9d..0000000 --- a/patches/gcc/3.2.3/gcc-3.2.3-trap-posix.patch +++ /dev/null @@ -1,45 +0,0 @@ -# -# Submitted-By: Marc Kleine-Budde , 2005-04-20 -# -# Error: -# -# creating libintl.h -# Configuring etc... -# loading cache ../config.cache -# checking for a BSD compatible install... (cached) /usr/bin/install -c -# creating ./config.status -# creating Makefile -# trap: usage: trap [-lp] [[arg] signal_spec ...] -# -# Description: -# -# non-posix conform usage of trap causes bash >= 3.0 to fail -# -# e.g.: http://sourceware.org/ml/crossgcc/2004-12/msg00132.html -# -# Status: -# -# fixed in gcc >= 3.3.5 -# backport of gcc-3.3.5 fix -# -diff -ruN gcc-3.2.3-orig/configure gcc-3.2.3/configure ---- gcc-3.2.3-orig/configure 2002-06-24 18:14:28.000000000 +0200 -+++ gcc-3.2.3/configure 2005-04-20 18:42:49.000000000 +0200 -@@ -697,7 +697,7 @@ - if test -f skip-this-dir; then - # Perform the same cleanup as the trap handler, minus the "exit 1" of course, - # and reset the trap handler. -- trap 0 -+ trap '' 0 - rm -rf Makefile* ${tmpdir} - # Execute the final clean-up actions - ${config_shell} skip-this-dir -@@ -1615,7 +1615,7 @@ - # Perform the same cleanup as the trap handler, minus the "exit 1" of course, - # and reset the trap handler. - rm -rf ${tmpdir} --trap 0 -+trap '' 0 - - exit 0 - diff --git a/patches/gcc/3.2.3/gcc-3.3-libstdc++-v3-dg.exp.patch b/patches/gcc/3.2.3/gcc-3.3-libstdc++-v3-dg.exp.patch deleted file mode 100644 index aafc130..0000000 --- a/patches/gcc/3.2.3/gcc-3.3-libstdc++-v3-dg.exp.patch +++ /dev/null @@ -1,54 +0,0 @@ -Without this patch, the command - -RUNTESTFLAGS=--target=powerpc-750-linux-gnu -v -v -v -v make check-target-libstdc++-v3 - -fails in two ways: -1. the -L option meant to locate the testsuite directory is incorrect, and -2. the wrong compiler is invoked, causing all sorts of havoc, not least of which -is the native compiler is invoked when we really wanted to invoke the cross-compiler -we just built. - -Here's an example log of the problem in action. Every testcase fails, this shows just one: -------------- -Invoking the compiler as g++ -ggdb3 -DDEBUG_ASSERT -I/home3/dank/wk/ixos/dap_interim/linux/3rdParty/crosstool/crosstool-0.12/build/powerpc-750-linux-gnu/gcc-3.3-glibc-2.2.5/gcc-3.3/libstdc++-v3/testsuite /home3/dank/wk/ixos/dap_interim/linux/3rdParty/crosstool/crosstool-0.12/build/powerpc-750-linux-gnu/gcc-3.3-glibc-2.2.5/gcc-3.3/libstdc++-v3/testsuite/20_util/binders.cc -g -O2 -DDEBUG_ASSERT -L/testsuite -lv3test -lm -o ./binders.exe -compiler exited with status 1 -output is: -/usr/lib/gcc-lib/i386-linux/2.95.4/../../../../include/g++-3/stl_function.h: In method `void binder2nd >::operator ()(const Elem &) const':^M -/usr/lib/gcc-lib/i386-linux/2.95.4/../../../../include/g++-3/stl_algo.h:83: instantiated from `for_each > >(Elem *, Elem *, binder2nd >)'^M -/home3/dank/wk/ixos/dap_interim/linux/3rdParty/crosstool/crosstool-0.12/build/powerpc-750-linux-gnu/gcc-3.3-glibc-2.2.5/gcc-3.3/libstdc++-v3/testsuite/20_util/binders.cc:43: instantiated from here^M -/usr/lib/gcc-lib/i386-linux/2.95.4/../../../../include/g++-3/stl_function.h:224: conversion from `const Elem' to `Elem &' discards qualifiers^M -/usr/lib/gcc-lib/i386-linux/2.95.4/../../../../include/g++-3/stl_function.h:622: in passing argument 1 of `mem_fun1_ref_t::operator ()(Elem &, int) const'^M -... -FAIL: 20_util/binders.cc (test for excess errors) -WARNING: 20_util/binders.cc compilation failed to produce executable -------------- - -And here's the patch. I'm not happy with it, and it probably gets some cases wrong, -but it seems to work for the common native case and for my cross-compiler case. - ---- gcc-3.3/libstdc++-v3/testsuite/lib/libstdc++-v3-dg.exp.old Sun Jul 13 10:42:01 2003 -+++ gcc-3.3/libstdc++-v3/testsuite/lib/libstdc++-v3-dg.exp Sun Jul 13 11:39:54 2003 -@@ -46,8 +46,23 @@ - global gluefile wrap_flags - global ld_library_path - global tool_root_dir -+ global target_triplet - - set blddir [lookfor_file [get_multilibs] libstdc++-v3] -+ if { $blddir == "" } { -+ set multilibs [get_multilibs] -+ # FIXME: assume multilib only one level deep -+ set multisub [file tail $multilibs] -+ verbose "libstdc++-v3-init: couldn't find libstdc++-v3 in $multilibs, trying $objdir" -+ set blddir [lookfor_file ${objdir} "$target_triplet/$multisub/libstdc++-v3"] -+ } -+ if { $blddir == "" } { -+ verbose "libstdc++-v3-init: couldn't find libstdc++-v3, trying $objdir without multilibs" -+ set blddir [lookfor_file ${objdir} "$target_triplet/libstdc++-v3"] -+ } -+ if { $blddir == "" } { -+ error "Can't find libstdc++-v3" -+ } - - # By default, we assume we want to run program images. - global dg-do-what-default diff --git a/patches/gcc/3.3.6/100-fix-fixincl.patch b/patches/gcc/3.3.6/100-fix-fixincl.patch new file mode 100644 index 0000000..7936b19 --- /dev/null +++ b/patches/gcc/3.3.6/100-fix-fixincl.patch @@ -0,0 +1,70 @@ +See http://gcc.gnu.org/PR22541 + +From: Dan Kegel + +When building gcc-3.4.3 or gcc-4.0.0 as a cross into a clean $PREFIX +(the only two I've tried like this), the configure script happily copies +the glibc include files from include to sys-include; here's the line +from the log file (with $PREFIX instead of the real prefix): + +Copying $PREFIX/i686-unknown-linux-gnu/include to $PREFIX/i686-unknown-linux-gnu/sys-include + +But later, when running fixincludes, it gives the error message + The directory that should contain system headers does not exist: + $PREFIX/lib/gcc/i686-unknown-linux-gnu/3.4.3/../../../../i686-unknown-linux-gnu/sys-include + +Nevertheless, it continues building; the header files it installs in + $PREFIX/lib/gcc/i686-unknown-linux-gnu/3.4.3/include +do not include the boilerplate that would cause it to #include_next the +glibc headers in the system header directory. +Thus the resulting toolchain can't compile the following program: +#include +int x = PATH_MAX; +because its limits.h doesn't include the glibc header. + +That's not nice. I suspect the problem is that gcc/Makefile.in assumes that +it can refer to $PREFIX/i686-unknown-linux-gnu with the path + $PREFIX/lib/../i686-unknown-linux-gnu, but +that fails because the directory $PREFIX/lib doesn't exist during 'make all'; +it is only created later, during 'make install'. (Which makes this problem +confusing, since one only notices the breakage well after 'make install', +at which point the path configure complained about does exist, and has the +right stuff in it.) + +A possible fix is to replace the line in gcc/Makefile.in that says + SYSTEM_HEADER_DIR = @SYSTEM_HEADER_DIR@ +with a version that gets rid of extra ..'s, e.g. + SYSTEM_HEADER_DIR = `echo @SYSTEM_HEADER_DIR@ | sed -e :a -e "s,[^/]*/\.\.\/,,;ta"` +(hey, that's the first time I've ever used a label in a sed script; thanks to the sed faq +for explaining the :a ... ta method of looping to repeat a search-and-replace until it doesn't match.) + + +--- gcc-3.4.3/gcc/Makefile.in.foo 2005-05-20 11:41:39.000000000 -0700 ++++ gcc-3.4.3/gcc/Makefile.in 2005-05-20 12:08:46.000000000 -0700 +@@ -350,7 +350,10 @@ + CROSS_SYSTEM_HEADER_DIR = @CROSS_SYSTEM_HEADER_DIR@ + + # autoconf sets SYSTEM_HEADER_DIR to one of the above. +-SYSTEM_HEADER_DIR = @SYSTEM_HEADER_DIR@ ++# Purge it of unneccessary internal relative paths ++# to directories that might not exist yet. ++# The sed idiom for this is to repeat the search-and-replace until it doesn't match, using :a ... ta. ++SYSTEM_HEADER_DIR = `echo @SYSTEM_HEADER_DIR@ | sed -e :a -e "s,[^/]*/\.\.\/,," -e ta` + + # Control whether to run fixproto and fixincludes. + STMP_FIXPROTO = @STMP_FIXPROTO@ +@@ -2532,11 +2535,13 @@ + $(SHELL) ${srcdir}/mkinstalldirs $(DESTDIR)$(gcc_tooldir) + + # Build fixed copies of system files. ++# Abort if no system headers available, unless building a crosscompiler. ++# FIXME: abort unless building --without-headers would be more accurate and less ugly + stmp-fixinc: fixinc.sh gsyslimits.h + @if test ! -d ${SYSTEM_HEADER_DIR}; then \ + echo The directory that should contain system headers does not exist: >&2 ; \ + echo " ${SYSTEM_HEADER_DIR}" >&2 ; \ +- if test "x${SYSTEM_HEADER_DIR}" = "x${gcc_tooldir}/sys-include"; \ ++ if test "x${SYSTEM_HEADER_DIR}" = "x`echo "${gcc_tooldir}/sys-include" | sed -e :a -e "s,[^/]*/\.\.\/,," -e ta`"; \ + then sleep 1; else exit 1; fi; \ + fi + rm -rf include; mkdir include diff --git a/patches/gcc/3.3.6/110-gcc-3.3.4-arm-bigendian.patch b/patches/gcc/3.3.6/110-gcc-3.3.4-arm-bigendian.patch new file mode 100644 index 0000000..0816b83 --- /dev/null +++ b/patches/gcc/3.3.6/110-gcc-3.3.4-arm-bigendian.patch @@ -0,0 +1,62 @@ +diff -urN gcc-3.3.4.orig/gcc/config/arm/linux-elf.h gcc-3.3.4/gcc/config/arm/linux-elf.h +--- gcc-3.3.4.orig/gcc/config/arm/linux-elf.h 2004-03-30 22:43:45.000000000 +0200 ++++ gcc-3.3.4/gcc/config/arm/linux-elf.h 2004-08-20 02:13:02.969084177 +0200 +@@ -30,17 +30,31 @@ + /* Do not assume anything about header files. */ + #define NO_IMPLICIT_EXTERN_C + ++/* ++ * 'config.gcc' defines TARGET_BIG_ENDIAN_DEFAULT as 1 for arm*b-* ++ * (big endian) configurations. ++ */ ++#if TARGET_BIG_ENDIAN_DEFAULT ++#define TARGET_ENDIAN_DEFAULT ARM_FLAG_BIG_END ++#define TARGET_ENDIAN_OPTION "mbig-endian" ++#define TARGET_LINKER_EMULATION "armelfb_linux" ++#else ++#define TARGET_ENDIAN_DEFAULT 0 ++#define TARGET_ENDIAN_OPTION "mlittle-endian" ++#define TARGET_LINKER_EMULATION "armelf_linux" ++#endif ++ + /* Default is to use APCS-32 mode. */ + #undef TARGET_DEFAULT +-#define TARGET_DEFAULT (ARM_FLAG_APCS_32 | ARM_FLAG_MMU_TRAPS) ++#define TARGET_DEFAULT (ARM_FLAG_APCS_32 | ARM_FLAG_MMU_TRAPS | TARGET_ENDIAN_DEFAULT) + + #define SUBTARGET_CPU_DEFAULT TARGET_CPU_arm6 + +-#define SUBTARGET_EXTRA_LINK_SPEC " -m armelf_linux -p" ++#define SUBTARGET_EXTRA_LINK_SPEC " -m " TARGET_LINKER_EMULATION " -p" + + #undef MULTILIB_DEFAULTS + #define MULTILIB_DEFAULTS \ +- { "marm", "mlittle-endian", "mhard-float", "mapcs-32", "mno-thumb-interwork" } ++ { "marm", TARGET_ENDIAN_OPTION, "mhard-float", "mapcs-32", "mno-thumb-interwork" } + + #define CPP_APCS_PC_DEFAULT_SPEC "-D__APCS_32__" + +@@ -88,7 +102,7 @@ + %{rdynamic:-export-dynamic} \ + %{!dynamic-linker:-dynamic-linker /lib/ld-linux.so.2} \ + -X \ +- %{mbig-endian:-EB}" \ ++ %{mbig-endian:-EB} %{mlittle-endian:-EL}" \ + SUBTARGET_EXTRA_LINK_SPEC + + #define TARGET_OS_CPP_BUILTINS() \ +diff -urN gcc-3.3.4.orig/gcc/config.gcc gcc-3.3.4/gcc/config.gcc +--- gcc-3.3.4.orig/gcc/config.gcc 2004-04-29 06:42:47.000000000 +0200 ++++ gcc-3.3.4/gcc/config.gcc 2004-08-20 02:11:04.326143343 +0200 +@@ -699,6 +699,11 @@ + ;; + arm*-*-linux*) # ARM GNU/Linux with ELF + tm_file="dbxelf.h elfos.h arm/elf.h arm/linux-gas.h arm/linux-elf.h arm/aout.h arm/arm.h" ++ case $machine in ++ arm*b-*) ++ tm_defines="TARGET_BIG_ENDIAN_DEFAULT=1 $tm_defines" ++ ;; ++ esac + tmake_file="t-slibgcc-elf-ver t-linux arm/t-linux" + extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o" + gnu_ld=yes diff --git a/patches/gcc/3.3.6/120-gcc-3.3.4-arm-pr22528.patch b/patches/gcc/3.3.6/120-gcc-3.3.4-arm-pr22528.patch new file mode 100644 index 0000000..0611e2c --- /dev/null +++ b/patches/gcc/3.3.6/120-gcc-3.3.4-arm-pr22528.patch @@ -0,0 +1,71 @@ +From http://gcc.gnu.org/ml/gcc-patches/2003-11/msg00832.html, by +Richard Earnshaw. Fixes http://gcc.gnu.org/PR22528 + +--- gcc-3.3.4/gcc/config/arm/arm.md.orig 2004-03-30 22:43:44.000000000 +0200 ++++ gcc-3.3.4/gcc/config/arm/arm.md 2005-08-15 12:21:55.000000000 +0200 +@@ -4275,7 +4275,7 @@ + (set (match_dup 2) + (ashiftrt:SI (match_operand 0 "" "") (const_int 8))) + ;; store the high byte +- (set (match_dup 4) (subreg:QI (match_dup 2) 0))] ;explicit subreg safe ++ (set (match_dup 4) (match_dup 5))] + "TARGET_ARM" + " + { +@@ -4291,7 +4291,8 @@ + operands[1] = adjust_address (operands[1], QImode, 0); + operands[3] = gen_lowpart (QImode, operands[0]); + operands[0] = gen_lowpart (SImode, operands[0]); +- operands[2] = gen_reg_rtx (SImode); ++ operands[2] = gen_reg_rtx (SImode); ++ operands[5] = gen_lowpart (QImode, operands[2]); + }" + ) + +@@ -4299,7 +4300,7 @@ + [(set (match_dup 4) (match_dup 3)) + (set (match_dup 2) + (ashiftrt:SI (match_operand 0 "" "") (const_int 8))) +- (set (match_operand 1 "" "") (subreg:QI (match_dup 2) 3))] ++ (set (match_operand 1 "" "") (match_dup 5))] + "TARGET_ARM" + " + { +@@ -4316,13 +4317,14 @@ + operands[3] = gen_lowpart (QImode, operands[0]); + operands[0] = gen_lowpart (SImode, operands[0]); + operands[2] = gen_reg_rtx (SImode); ++ operands[5] = gen_lowpart (QImode, operands[2]); + }" + ) + + ;; Subroutine to store a half word integer constant into memory. + (define_expand "storeinthi" + [(set (match_operand 0 "" "") +- (subreg:QI (match_operand 1 "" "") 0)) ++ (match_operand 1 "" "")) + (set (match_dup 3) (match_dup 2))] + "TARGET_ARM" + " +@@ -4363,6 +4365,7 @@ + operands[3] = adjust_address (op0, QImode, 1); + operands[0] = adjust_address (operands[0], QImode, 0); + operands[2] = gen_lowpart (QImode, operands[2]); ++ operands[1] = gen_lowpart (QImode, operands[1]); + }" + ) + +@@ -4682,11 +4685,12 @@ + (set (match_dup 3) + (ashiftrt:SI (match_dup 2) (const_int 16))) + (set (match_operand:HI 0 "s_register_operand" "") +- (subreg:HI (match_dup 3) 0))] ++ (match_dup 4))] + "TARGET_ARM" + " + operands[2] = gen_reg_rtx (SImode); + operands[3] = gen_reg_rtx (SImode); ++ operands[4] = gen_lowpart (HImode, operands[3]); + " + ) + diff --git a/patches/gcc/3.3.6/fix-fixincl.patch b/patches/gcc/3.3.6/fix-fixincl.patch deleted file mode 100644 index 7936b19..0000000 --- a/patches/gcc/3.3.6/fix-fixincl.patch +++ /dev/null @@ -1,70 +0,0 @@ -See http://gcc.gnu.org/PR22541 - -From: Dan Kegel - -When building gcc-3.4.3 or gcc-4.0.0 as a cross into a clean $PREFIX -(the only two I've tried like this), the configure script happily copies -the glibc include files from include to sys-include; here's the line -from the log file (with $PREFIX instead of the real prefix): - -Copying $PREFIX/i686-unknown-linux-gnu/include to $PREFIX/i686-unknown-linux-gnu/sys-include - -But later, when running fixincludes, it gives the error message - The directory that should contain system headers does not exist: - $PREFIX/lib/gcc/i686-unknown-linux-gnu/3.4.3/../../../../i686-unknown-linux-gnu/sys-include - -Nevertheless, it continues building; the header files it installs in - $PREFIX/lib/gcc/i686-unknown-linux-gnu/3.4.3/include -do not include the boilerplate that would cause it to #include_next the -glibc headers in the system header directory. -Thus the resulting toolchain can't compile the following program: -#include -int x = PATH_MAX; -because its limits.h doesn't include the glibc header. - -That's not nice. I suspect the problem is that gcc/Makefile.in assumes that -it can refer to $PREFIX/i686-unknown-linux-gnu with the path - $PREFIX/lib/../i686-unknown-linux-gnu, but -that fails because the directory $PREFIX/lib doesn't exist during 'make all'; -it is only created later, during 'make install'. (Which makes this problem -confusing, since one only notices the breakage well after 'make install', -at which point the path configure complained about does exist, and has the -right stuff in it.) - -A possible fix is to replace the line in gcc/Makefile.in that says - SYSTEM_HEADER_DIR = @SYSTEM_HEADER_DIR@ -with a version that gets rid of extra ..'s, e.g. - SYSTEM_HEADER_DIR = `echo @SYSTEM_HEADER_DIR@ | sed -e :a -e "s,[^/]*/\.\.\/,,;ta"` -(hey, that's the first time I've ever used a label in a sed script; thanks to the sed faq -for explaining the :a ... ta method of looping to repeat a search-and-replace until it doesn't match.) - - ---- gcc-3.4.3/gcc/Makefile.in.foo 2005-05-20 11:41:39.000000000 -0700 -+++ gcc-3.4.3/gcc/Makefile.in 2005-05-20 12:08:46.000000000 -0700 -@@ -350,7 +350,10 @@ - CROSS_SYSTEM_HEADER_DIR = @CROSS_SYSTEM_HEADER_DIR@ - - # autoconf sets SYSTEM_HEADER_DIR to one of the above. --SYSTEM_HEADER_DIR = @SYSTEM_HEADER_DIR@ -+# Purge it of unneccessary internal relative paths -+# to directories that might not exist yet. -+# The sed idiom for this is to repeat the search-and-replace until it doesn't match, using :a ... ta. -+SYSTEM_HEADER_DIR = `echo @SYSTEM_HEADER_DIR@ | sed -e :a -e "s,[^/]*/\.\.\/,," -e ta` - - # Control whether to run fixproto and fixincludes. - STMP_FIXPROTO = @STMP_FIXPROTO@ -@@ -2532,11 +2535,13 @@ - $(SHELL) ${srcdir}/mkinstalldirs $(DESTDIR)$(gcc_tooldir) - - # Build fixed copies of system files. -+# Abort if no system headers available, unless building a crosscompiler. -+# FIXME: abort unless building --without-headers would be more accurate and less ugly - stmp-fixinc: fixinc.sh gsyslimits.h - @if test ! -d ${SYSTEM_HEADER_DIR}; then \ - echo The directory that should contain system headers does not exist: >&2 ; \ - echo " ${SYSTEM_HEADER_DIR}" >&2 ; \ -- if test "x${SYSTEM_HEADER_DIR}" = "x${gcc_tooldir}/sys-include"; \ -+ if test "x${SYSTEM_HEADER_DIR}" = "x`echo "${gcc_tooldir}/sys-include" | sed -e :a -e "s,[^/]*/\.\.\/,," -e ta`"; \ - then sleep 1; else exit 1; fi; \ - fi - rm -rf include; mkdir include diff --git a/patches/gcc/3.3.6/gcc-3.3.4-arm-bigendian.patch b/patches/gcc/3.3.6/gcc-3.3.4-arm-bigendian.patch deleted file mode 100644 index 0816b83..0000000 --- a/patches/gcc/3.3.6/gcc-3.3.4-arm-bigendian.patch +++ /dev/null @@ -1,62 +0,0 @@ -diff -urN gcc-3.3.4.orig/gcc/config/arm/linux-elf.h gcc-3.3.4/gcc/config/arm/linux-elf.h ---- gcc-3.3.4.orig/gcc/config/arm/linux-elf.h 2004-03-30 22:43:45.000000000 +0200 -+++ gcc-3.3.4/gcc/config/arm/linux-elf.h 2004-08-20 02:13:02.969084177 +0200 -@@ -30,17 +30,31 @@ - /* Do not assume anything about header files. */ - #define NO_IMPLICIT_EXTERN_C - -+/* -+ * 'config.gcc' defines TARGET_BIG_ENDIAN_DEFAULT as 1 for arm*b-* -+ * (big endian) configurations. -+ */ -+#if TARGET_BIG_ENDIAN_DEFAULT -+#define TARGET_ENDIAN_DEFAULT ARM_FLAG_BIG_END -+#define TARGET_ENDIAN_OPTION "mbig-endian" -+#define TARGET_LINKER_EMULATION "armelfb_linux" -+#else -+#define TARGET_ENDIAN_DEFAULT 0 -+#define TARGET_ENDIAN_OPTION "mlittle-endian" -+#define TARGET_LINKER_EMULATION "armelf_linux" -+#endif -+ - /* Default is to use APCS-32 mode. */ - #undef TARGET_DEFAULT --#define TARGET_DEFAULT (ARM_FLAG_APCS_32 | ARM_FLAG_MMU_TRAPS) -+#define TARGET_DEFAULT (ARM_FLAG_APCS_32 | ARM_FLAG_MMU_TRAPS | TARGET_ENDIAN_DEFAULT) - - #define SUBTARGET_CPU_DEFAULT TARGET_CPU_arm6 - --#define SUBTARGET_EXTRA_LINK_SPEC " -m armelf_linux -p" -+#define SUBTARGET_EXTRA_LINK_SPEC " -m " TARGET_LINKER_EMULATION " -p" - - #undef MULTILIB_DEFAULTS - #define MULTILIB_DEFAULTS \ -- { "marm", "mlittle-endian", "mhard-float", "mapcs-32", "mno-thumb-interwork" } -+ { "marm", TARGET_ENDIAN_OPTION, "mhard-float", "mapcs-32", "mno-thumb-interwork" } - - #define CPP_APCS_PC_DEFAULT_SPEC "-D__APCS_32__" - -@@ -88,7 +102,7 @@ - %{rdynamic:-export-dynamic} \ - %{!dynamic-linker:-dynamic-linker /lib/ld-linux.so.2} \ - -X \ -- %{mbig-endian:-EB}" \ -+ %{mbig-endian:-EB} %{mlittle-endian:-EL}" \ - SUBTARGET_EXTRA_LINK_SPEC - - #define TARGET_OS_CPP_BUILTINS() \ -diff -urN gcc-3.3.4.orig/gcc/config.gcc gcc-3.3.4/gcc/config.gcc ---- gcc-3.3.4.orig/gcc/config.gcc 2004-04-29 06:42:47.000000000 +0200 -+++ gcc-3.3.4/gcc/config.gcc 2004-08-20 02:11:04.326143343 +0200 -@@ -699,6 +699,11 @@ - ;; - arm*-*-linux*) # ARM GNU/Linux with ELF - tm_file="dbxelf.h elfos.h arm/elf.h arm/linux-gas.h arm/linux-elf.h arm/aout.h arm/arm.h" -+ case $machine in -+ arm*b-*) -+ tm_defines="TARGET_BIG_ENDIAN_DEFAULT=1 $tm_defines" -+ ;; -+ esac - tmake_file="t-slibgcc-elf-ver t-linux arm/t-linux" - extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o" - gnu_ld=yes diff --git a/patches/gcc/3.3.6/gcc-3.3.4-arm-pr22528.patch b/patches/gcc/3.3.6/gcc-3.3.4-arm-pr22528.patch deleted file mode 100644 index 0611e2c..0000000 --- a/patches/gcc/3.3.6/gcc-3.3.4-arm-pr22528.patch +++ /dev/null @@ -1,71 +0,0 @@ -From http://gcc.gnu.org/ml/gcc-patches/2003-11/msg00832.html, by -Richard Earnshaw. Fixes http://gcc.gnu.org/PR22528 - ---- gcc-3.3.4/gcc/config/arm/arm.md.orig 2004-03-30 22:43:44.000000000 +0200 -+++ gcc-3.3.4/gcc/config/arm/arm.md 2005-08-15 12:21:55.000000000 +0200 -@@ -4275,7 +4275,7 @@ - (set (match_dup 2) - (ashiftrt:SI (match_operand 0 "" "") (const_int 8))) - ;; store the high byte -- (set (match_dup 4) (subreg:QI (match_dup 2) 0))] ;explicit subreg safe -+ (set (match_dup 4) (match_dup 5))] - "TARGET_ARM" - " - { -@@ -4291,7 +4291,8 @@ - operands[1] = adjust_address (operands[1], QImode, 0); - operands[3] = gen_lowpart (QImode, operands[0]); - operands[0] = gen_lowpart (SImode, operands[0]); -- operands[2] = gen_reg_rtx (SImode); -+ operands[2] = gen_reg_rtx (SImode); -+ operands[5] = gen_lowpart (QImode, operands[2]); - }" - ) - -@@ -4299,7 +4300,7 @@ - [(set (match_dup 4) (match_dup 3)) - (set (match_dup 2) - (ashiftrt:SI (match_operand 0 "" "") (const_int 8))) -- (set (match_operand 1 "" "") (subreg:QI (match_dup 2) 3))] -+ (set (match_operand 1 "" "") (match_dup 5))] - "TARGET_ARM" - " - { -@@ -4316,13 +4317,14 @@ - operands[3] = gen_lowpart (QImode, operands[0]); - operands[0] = gen_lowpart (SImode, operands[0]); - operands[2] = gen_reg_rtx (SImode); -+ operands[5] = gen_lowpart (QImode, operands[2]); - }" - ) - - ;; Subroutine to store a half word integer constant into memory. - (define_expand "storeinthi" - [(set (match_operand 0 "" "") -- (subreg:QI (match_operand 1 "" "") 0)) -+ (match_operand 1 "" "")) - (set (match_dup 3) (match_dup 2))] - "TARGET_ARM" - " -@@ -4363,6 +4365,7 @@ - operands[3] = adjust_address (op0, QImode, 1); - operands[0] = adjust_address (operands[0], QImode, 0); - operands[2] = gen_lowpart (QImode, operands[2]); -+ operands[1] = gen_lowpart (QImode, operands[1]); - }" - ) - -@@ -4682,11 +4685,12 @@ - (set (match_dup 3) - (ashiftrt:SI (match_dup 2) (const_int 16))) - (set (match_operand:HI 0 "s_register_operand" "") -- (subreg:HI (match_dup 3) 0))] -+ (match_dup 4))] - "TARGET_ARM" - " - operands[2] = gen_reg_rtx (SImode); - operands[3] = gen_reg_rtx (SImode); -+ operands[4] = gen_lowpart (HImode, operands[3]); - " - ) - diff --git a/patches/gcc/3.4.6/710-all_sh-pr16665-fix.patch b/patches/gcc/3.4.6/710-all_sh-pr16665-fix.patch new file mode 100644 index 0000000..7297fca --- /dev/null +++ b/patches/gcc/3.4.6/710-all_sh-pr16665-fix.patch @@ -0,0 +1,44 @@ +diff -durN gcc-3.4.6.orig/gcc/config/sh/sh.c gcc-3.4.6/gcc/config/sh/sh.c +--- gcc-3.4.6.orig/gcc/config/sh/sh.c 2004-09-03 08:51:30.000000000 +0200 ++++ gcc-3.4.6/gcc/config/sh/sh.c 2007-08-15 23:01:48.000000000 +0200 +@@ -9107,6 +9107,15 @@ + } + this = FUNCTION_ARG (cum, Pmode, ptr_type_node, 1); + ++ /* In PIC case, we set PIC register to compute the target address. We ++ can use a scratch register to save and restore the original value ++ except for SHcompact. For SHcompact, use stack. */ ++ if (flag_pic && TARGET_SHCOMPACT) ++ { ++ push (PIC_OFFSET_TABLE_REGNUM); ++ emit_insn (gen_GOTaddr2picreg ()); ++ } ++ + /* For SHcompact, we only have r0 for a scratch register: r1 is the + static chain pointer (even if you can't have nested virtual functions + right now, someone might implement them sometime), and the rest of the +@@ -9189,8 +9198,24 @@ + assemble_external (function); + TREE_USED (function) = 1; + } ++ /* We can use scratch1 to save and restore the original value of ++ PIC register except for SHcompact. */ ++ if (flag_pic && ! TARGET_SHCOMPACT) ++ { ++ emit_move_insn (scratch1, ++ gen_rtx_REG (Pmode, PIC_OFFSET_TABLE_REGNUM)); ++ emit_insn (gen_GOTaddr2picreg ()); ++ } + funexp = XEXP (DECL_RTL (function), 0); + emit_move_insn (scratch2, funexp); ++ if (flag_pic) ++ { ++ if (! TARGET_SHCOMPACT) ++ emit_move_insn (gen_rtx_REG (Pmode, PIC_OFFSET_TABLE_REGNUM), ++ scratch1); ++ else ++ pop (PIC_OFFSET_TABLE_REGNUM); ++ } + funexp = gen_rtx_MEM (FUNCTION_MODE, scratch2); + sibcall = emit_call_insn (gen_sibcall (funexp, const0_rtx, NULL_RTX)); + SIBLING_CALL_P (sibcall) = 1; diff --git a/patches/gcc/3.4.6/71_all_sh-pr16665-fix.patch b/patches/gcc/3.4.6/71_all_sh-pr16665-fix.patch deleted file mode 100644 index 7297fca..0000000 --- a/patches/gcc/3.4.6/71_all_sh-pr16665-fix.patch +++ /dev/null @@ -1,44 +0,0 @@ -diff -durN gcc-3.4.6.orig/gcc/config/sh/sh.c gcc-3.4.6/gcc/config/sh/sh.c ---- gcc-3.4.6.orig/gcc/config/sh/sh.c 2004-09-03 08:51:30.000000000 +0200 -+++ gcc-3.4.6/gcc/config/sh/sh.c 2007-08-15 23:01:48.000000000 +0200 -@@ -9107,6 +9107,15 @@ - } - this = FUNCTION_ARG (cum, Pmode, ptr_type_node, 1); - -+ /* In PIC case, we set PIC register to compute the target address. We -+ can use a scratch register to save and restore the original value -+ except for SHcompact. For SHcompact, use stack. */ -+ if (flag_pic && TARGET_SHCOMPACT) -+ { -+ push (PIC_OFFSET_TABLE_REGNUM); -+ emit_insn (gen_GOTaddr2picreg ()); -+ } -+ - /* For SHcompact, we only have r0 for a scratch register: r1 is the - static chain pointer (even if you can't have nested virtual functions - right now, someone might implement them sometime), and the rest of the -@@ -9189,8 +9198,24 @@ - assemble_external (function); - TREE_USED (function) = 1; - } -+ /* We can use scratch1 to save and restore the original value of -+ PIC register except for SHcompact. */ -+ if (flag_pic && ! TARGET_SHCOMPACT) -+ { -+ emit_move_insn (scratch1, -+ gen_rtx_REG (Pmode, PIC_OFFSET_TABLE_REGNUM)); -+ emit_insn (gen_GOTaddr2picreg ()); -+ } - funexp = XEXP (DECL_RTL (function), 0); - emit_move_insn (scratch2, funexp); -+ if (flag_pic) -+ { -+ if (! TARGET_SHCOMPACT) -+ emit_move_insn (gen_rtx_REG (Pmode, PIC_OFFSET_TABLE_REGNUM), -+ scratch1); -+ else -+ pop (PIC_OFFSET_TABLE_REGNUM); -+ } - funexp = gen_rtx_MEM (FUNCTION_MODE, scratch2); - sibcall = emit_call_insn (gen_sibcall (funexp, const0_rtx, NULL_RTX)); - SIBLING_CALL_P (sibcall) = 1; diff --git a/patches/gcc/3.4.6/720-all_sh-no-reorder-blocks.patch b/patches/gcc/3.4.6/720-all_sh-no-reorder-blocks.patch new file mode 100644 index 0000000..fed1424 --- /dev/null +++ b/patches/gcc/3.4.6/720-all_sh-no-reorder-blocks.patch @@ -0,0 +1,14 @@ +diff -durN gcc-3.4.6.orig/gcc/config/sh/sh.h gcc-3.4.6/gcc/config/sh/sh.h +--- gcc-3.4.6.orig/gcc/config/sh/sh.h 2006-01-12 02:20:32.000000000 +0100 ++++ gcc-3.4.6/gcc/config/sh/sh.h 2007-08-15 23:03:09.000000000 +0200 +@@ -422,6 +422,10 @@ + do { \ + if (LEVEL) \ + flag_omit_frame_pointer = -1; \ ++ if (LEVEL <= 2) \ ++ { \ ++ flag_reorder_blocks = 0; \ ++ } \ + if (SIZE) \ + target_flags |= SPACE_BIT; \ + if (TARGET_SHMEDIA && LEVEL > 1) \ diff --git a/patches/gcc/3.4.6/72_all_sh-no-reorder-blocks.patch b/patches/gcc/3.4.6/72_all_sh-no-reorder-blocks.patch deleted file mode 100644 index fed1424..0000000 --- a/patches/gcc/3.4.6/72_all_sh-no-reorder-blocks.patch +++ /dev/null @@ -1,14 +0,0 @@ -diff -durN gcc-3.4.6.orig/gcc/config/sh/sh.h gcc-3.4.6/gcc/config/sh/sh.h ---- gcc-3.4.6.orig/gcc/config/sh/sh.h 2006-01-12 02:20:32.000000000 +0100 -+++ gcc-3.4.6/gcc/config/sh/sh.h 2007-08-15 23:03:09.000000000 +0200 -@@ -422,6 +422,10 @@ - do { \ - if (LEVEL) \ - flag_omit_frame_pointer = -1; \ -+ if (LEVEL <= 2) \ -+ { \ -+ flag_reorder_blocks = 0; \ -+ } \ - if (SIZE) \ - target_flags |= SPACE_BIT; \ - if (TARGET_SHMEDIA && LEVEL > 1) \ diff --git a/patches/gcc/3.4.6/730-all_sh-pr20617.patch b/patches/gcc/3.4.6/730-all_sh-pr20617.patch new file mode 100644 index 0000000..80d0d90 --- /dev/null +++ b/patches/gcc/3.4.6/730-all_sh-pr20617.patch @@ -0,0 +1,24 @@ +diff -durN gcc-3.4.6.orig/gcc/config/sh/lib1funcs.asm gcc-3.4.6/gcc/config/sh/lib1funcs.asm +--- gcc-3.4.6.orig/gcc/config/sh/lib1funcs.asm 2003-08-12 03:25:07.000000000 +0200 ++++ gcc-3.4.6/gcc/config/sh/lib1funcs.asm 2007-08-15 23:04:26.000000000 +0200 +@@ -37,9 +37,19 @@ + ELF local label prefixes by J"orn Rennecke + amylaar@cygnus.com */ + ++#define ALIAS(X,Y) .global GLOBAL(X); .set GLOBAL(X),GLOBAL(Y) ++ + #ifdef __ELF__ + #define LOCAL(X) .L_##X +-#define FUNC(X) .type X,@function ++ ++#if 1 /* ??? The export list mechanism is broken, everything that is not ++ hidden is exported. */ ++#undef FUNC ++#define FUNC(X) .type X,@function; .hidden X ++#undef ALIAS ++#define ALIAS(X,Y) .global GLOBAL(X); .set GLOBAL(X),GLOBAL(Y); .hidden GLOBAL(X) ++#endif ++ + #define ENDFUNC0(X) .Lfe_##X: .size X,.Lfe_##X-X + #define ENDFUNC(X) ENDFUNC0(X) + #else diff --git a/patches/gcc/3.4.6/73_all_sh-pr20617.patch b/patches/gcc/3.4.6/73_all_sh-pr20617.patch deleted file mode 100644 index 80d0d90..0000000 --- a/patches/gcc/3.4.6/73_all_sh-pr20617.patch +++ /dev/null @@ -1,24 +0,0 @@ -diff -durN gcc-3.4.6.orig/gcc/config/sh/lib1funcs.asm gcc-3.4.6/gcc/config/sh/lib1funcs.asm ---- gcc-3.4.6.orig/gcc/config/sh/lib1funcs.asm 2003-08-12 03:25:07.000000000 +0200 -+++ gcc-3.4.6/gcc/config/sh/lib1funcs.asm 2007-08-15 23:04:26.000000000 +0200 -@@ -37,9 +37,19 @@ - ELF local label prefixes by J"orn Rennecke - amylaar@cygnus.com */ - -+#define ALIAS(X,Y) .global GLOBAL(X); .set GLOBAL(X),GLOBAL(Y) -+ - #ifdef __ELF__ - #define LOCAL(X) .L_##X --#define FUNC(X) .type X,@function -+ -+#if 1 /* ??? The export list mechanism is broken, everything that is not -+ hidden is exported. */ -+#undef FUNC -+#define FUNC(X) .type X,@function; .hidden X -+#undef ALIAS -+#define ALIAS(X,Y) .global GLOBAL(X); .set GLOBAL(X),GLOBAL(Y); .hidden GLOBAL(X) -+#endif -+ - #define ENDFUNC0(X) .Lfe_##X: .size X,.Lfe_##X-X - #define ENDFUNC(X) ENDFUNC0(X) - #else diff --git a/patches/gcc/3.4.6/910-arm-softfloat.patch b/patches/gcc/3.4.6/910-arm-softfloat.patch new file mode 100644 index 0000000..b0ef614 --- /dev/null +++ b/patches/gcc/3.4.6/910-arm-softfloat.patch @@ -0,0 +1,161 @@ +diff -durN gcc-3.4.6.orig/gcc/config/arm/coff.h gcc-3.4.6/gcc/config/arm/coff.h +--- gcc-3.4.6.orig/gcc/config/arm/coff.h 2004-02-24 15:25:22.000000000 +0100 ++++ gcc-3.4.6/gcc/config/arm/coff.h 2007-08-15 23:10:54.000000000 +0200 +@@ -31,11 +31,16 @@ + #define TARGET_VERSION fputs (" (ARM/coff)", stderr) + + #undef TARGET_DEFAULT +-#define TARGET_DEFAULT (ARM_FLAG_SOFT_FLOAT | ARM_FLAG_APCS_32 | ARM_FLAG_APCS_FRAME | ARM_FLAG_MMU_TRAPS) ++#define TARGET_DEFAULT \ ++ ( ARM_FLAG_SOFT_FLOAT \ ++ | ARM_FLAG_VFP \ ++ | ARM_FLAG_APCS_32 \ ++ | ARM_FLAG_APCS_FRAME \ ++ | ARM_FLAG_MMU_TRAPS ) + + #ifndef MULTILIB_DEFAULTS + #define MULTILIB_DEFAULTS \ +- { "marm", "mlittle-endian", "msoft-float", "mapcs-32", "mno-thumb-interwork" } ++ { "marm", "mlittle-endian", "mapcs-32", "mno-thumb-interwork" } + #endif + + /* This is COFF, but prefer stabs. */ +diff -durN gcc-3.4.6.orig/gcc/config/arm/elf.h gcc-3.4.6/gcc/config/arm/elf.h +--- gcc-3.4.6.orig/gcc/config/arm/elf.h 2004-02-24 15:25:22.000000000 +0100 ++++ gcc-3.4.6/gcc/config/arm/elf.h 2007-08-15 23:10:54.000000000 +0200 +@@ -46,7 +46,9 @@ + + #ifndef SUBTARGET_ASM_FLOAT_SPEC + #define SUBTARGET_ASM_FLOAT_SPEC "\ +-%{mapcs-float:-mfloat} %{msoft-float:-mfpu=softfpa}" ++%{mapcs-float:-mfloat} \ ++%{mhard-float:-mfpu=fpa} \ ++%{!mhard-float: %{msoft-float:-mfpu=softfpa} %{!msoft-float:-mfpu=softvfp}}" + #endif + + #ifndef ASM_SPEC +@@ -106,12 +108,17 @@ + #endif + + #ifndef TARGET_DEFAULT +-#define TARGET_DEFAULT (ARM_FLAG_SOFT_FLOAT | ARM_FLAG_APCS_32 | ARM_FLAG_APCS_FRAME | ARM_FLAG_MMU_TRAPS) ++#define TARGET_DEFAULT \ ++ ( ARM_FLAG_SOFT_FLOAT \ ++ | ARM_FLAG_VFP \ ++ | ARM_FLAG_APCS_32 \ ++ | ARM_FLAG_APCS_FRAME \ ++ | ARM_FLAG_MMU_TRAPS ) + #endif + + #ifndef MULTILIB_DEFAULTS + #define MULTILIB_DEFAULTS \ +- { "marm", "mlittle-endian", "msoft-float", "mapcs-32", "mno-thumb-interwork", "fno-leading-underscore" } ++ { "marm", "mlittle-endian", "mapcs-32", "mno-thumb-interwork", "fno-leading-underscore" } + #endif + + #define TARGET_ASM_FILE_START_APP_OFF true +diff -durN gcc-3.4.6.orig/gcc/config/arm/linux-elf.h gcc-3.4.6/gcc/config/arm/linux-elf.h +--- gcc-3.4.6.orig/gcc/config/arm/linux-elf.h 2007-08-15 23:07:00.000000000 +0200 ++++ gcc-3.4.6/gcc/config/arm/linux-elf.h 2007-08-15 23:10:54.000000000 +0200 +@@ -44,12 +44,26 @@ + #define TARGET_LINKER_EMULATION "armelf_linux" + #endif + +-/* Default is to use APCS-32 mode. */ ++/* ++ * Default is to use APCS-32 mode with soft-vfp. ++ * The old Linux default for floats can be achieved with -mhard-float ++ * or with the configure --with-float=hard option. ++ * If -msoft-float or --with-float=soft is used then software float ++ * support will be used just like the default but with the legacy ++ * big endian word ordering for double float representation instead. ++ */ + #undef TARGET_DEFAULT +-#define TARGET_DEFAULT \ +- ( ARM_FLAG_APCS_32 | \ +- ARM_FLAG_MMU_TRAPS | \ +- TARGET_ENDIAN_DEFAULT ) ++#define TARGET_DEFAULT \ ++ ( ARM_FLAG_APCS_32 \ ++ | ARM_FLAG_SOFT_FLOAT \ ++ | TARGET_ENDIAN_DEFAULT \ ++ | ARM_FLAG_VFP \ ++ | ARM_FLAG_MMU_TRAPS ) ++ ++#undef SUBTARGET_EXTRA_ASM_SPEC ++#define SUBTARGET_EXTRA_ASM_SPEC "\ ++%{mhard-float:-mfpu=fpa} \ ++%{!mhard-float: %{msoft-float:-mfpu=softfpa} %{!msoft-float:-mfpu=softvfp}}" + + #define SUBTARGET_CPU_DEFAULT TARGET_CPU_arm6 + +@@ -57,7 +71,7 @@ + + #undef MULTILIB_DEFAULTS + #define MULTILIB_DEFAULTS \ +- { "marm", TARGET_ENDIAN_OPTION, "mhard-float", "mapcs-32", "mno-thumb-interwork" } ++ { "marm", TARGET_ENDIAN_OPTION, "mapcs-32", "mno-thumb-interwork" } + + #define CPP_APCS_PC_DEFAULT_SPEC "-D__APCS_32__" + +@@ -72,7 +86,7 @@ + %{shared:-lc} \ + %{!shared:%{profile:-lc_p}%{!profile:-lc}}" + +-#define LIBGCC_SPEC "%{msoft-float:-lfloat} -lgcc" ++#define LIBGCC_SPEC "-lgcc" + + /* Provide a STARTFILE_SPEC appropriate for GNU/Linux. Here we add + the GNU/Linux magical crtbegin.o file (see crtstuff.c) which +diff -durN gcc-3.4.6.orig/gcc/config/arm/t-linux gcc-3.4.6/gcc/config/arm/t-linux +--- gcc-3.4.6.orig/gcc/config/arm/t-linux 2003-09-20 23:09:07.000000000 +0200 ++++ gcc-3.4.6/gcc/config/arm/t-linux 2007-08-15 23:10:54.000000000 +0200 +@@ -4,7 +4,10 @@ + LIBGCC2_DEBUG_CFLAGS = -g0 + + LIB1ASMSRC = arm/lib1funcs.asm +-LIB1ASMFUNCS = _udivsi3 _divsi3 _umodsi3 _modsi3 _dvmd_lnx ++LIB1ASMFUNCS = _udivsi3 _divsi3 _umodsi3 _modsi3 _dvmd_lnx \ ++ _negdf2 _addsubdf3 _muldivdf3 _cmpdf2 _unorddf2 _fixdfsi _fixunsdfsi \ ++ _truncdfsf2 _negsf2 _addsubsf3 _muldivsf3 _cmpsf2 _unordsf2 \ ++ _fixsfsi _fixunssfsi + + # MULTILIB_OPTIONS = mhard-float/msoft-float + # MULTILIB_DIRNAMES = hard-float soft-float +diff -durN gcc-3.4.6.orig/gcc/config/arm/unknown-elf.h gcc-3.4.6/gcc/config/arm/unknown-elf.h +--- gcc-3.4.6.orig/gcc/config/arm/unknown-elf.h 2004-02-24 15:25:22.000000000 +0100 ++++ gcc-3.4.6/gcc/config/arm/unknown-elf.h 2007-08-15 23:10:54.000000000 +0200 +@@ -30,7 +30,12 @@ + + /* Default to using APCS-32 and software floating point. */ + #ifndef TARGET_DEFAULT +-#define TARGET_DEFAULT (ARM_FLAG_SOFT_FLOAT | ARM_FLAG_APCS_32 | ARM_FLAG_APCS_FRAME | ARM_FLAG_MMU_TRAPS) ++#define TARGET_DEFAULT \ ++ ( ARM_FLAG_SOFT_FLOAT \ ++ | ARM_FLAG_VFP \ ++ | ARM_FLAG_APCS_32 \ ++ | ARM_FLAG_APCS_FRAME \ ++ | ARM_FLAG_MMU_TRAPS ) + #endif + + /* Now we define the strings used to build the spec file. */ +diff -durN gcc-3.4.6.orig/gcc/config/arm/xscale-elf.h gcc-3.4.6/gcc/config/arm/xscale-elf.h +--- gcc-3.4.6.orig/gcc/config/arm/xscale-elf.h 2003-07-02 01:26:43.000000000 +0200 ++++ gcc-3.4.6/gcc/config/arm/xscale-elf.h 2007-08-15 23:10:54.000000000 +0200 +@@ -49,11 +49,12 @@ + endian, regardless of the endian-ness of the memory + system. */ + +-#define SUBTARGET_EXTRA_ASM_SPEC "%{!mcpu=*:-mcpu=xscale} \ +- %{mhard-float:-mfpu=fpa} \ +- %{!mhard-float: %{msoft-float:-mfpu=softfpa;:-mfpu=softvfp}}" ++#define SUBTARGET_EXTRA_ASM_SPEC "\ ++%{!mcpu=*:-mcpu=xscale} \ ++%{mhard-float:-mfpu=fpa} \ ++%{!mhard-float: %{msoft-float:-mfpu=softfpa} %{!msoft-float:-mfpu=softvfp}}" + + #ifndef MULTILIB_DEFAULTS + #define MULTILIB_DEFAULTS \ +- { "mlittle-endian", "mno-thumb-interwork", "marm", "msoft-float" } ++ { "mlittle-endian", "mno-thumb-interwork", "marm" } + #endif diff --git a/patches/gcc/3.4.6/arm-softfloat.patch b/patches/gcc/3.4.6/arm-softfloat.patch deleted file mode 100644 index b0ef614..0000000 --- a/patches/gcc/3.4.6/arm-softfloat.patch +++ /dev/null @@ -1,161 +0,0 @@ -diff -durN gcc-3.4.6.orig/gcc/config/arm/coff.h gcc-3.4.6/gcc/config/arm/coff.h ---- gcc-3.4.6.orig/gcc/config/arm/coff.h 2004-02-24 15:25:22.000000000 +0100 -+++ gcc-3.4.6/gcc/config/arm/coff.h 2007-08-15 23:10:54.000000000 +0200 -@@ -31,11 +31,16 @@ - #define TARGET_VERSION fputs (" (ARM/coff)", stderr) - - #undef TARGET_DEFAULT --#define TARGET_DEFAULT (ARM_FLAG_SOFT_FLOAT | ARM_FLAG_APCS_32 | ARM_FLAG_APCS_FRAME | ARM_FLAG_MMU_TRAPS) -+#define TARGET_DEFAULT \ -+ ( ARM_FLAG_SOFT_FLOAT \ -+ | ARM_FLAG_VFP \ -+ | ARM_FLAG_APCS_32 \ -+ | ARM_FLAG_APCS_FRAME \ -+ | ARM_FLAG_MMU_TRAPS ) - - #ifndef MULTILIB_DEFAULTS - #define MULTILIB_DEFAULTS \ -- { "marm", "mlittle-endian", "msoft-float", "mapcs-32", "mno-thumb-interwork" } -+ { "marm", "mlittle-endian", "mapcs-32", "mno-thumb-interwork" } - #endif - - /* This is COFF, but prefer stabs. */ -diff -durN gcc-3.4.6.orig/gcc/config/arm/elf.h gcc-3.4.6/gcc/config/arm/elf.h ---- gcc-3.4.6.orig/gcc/config/arm/elf.h 2004-02-24 15:25:22.000000000 +0100 -+++ gcc-3.4.6/gcc/config/arm/elf.h 2007-08-15 23:10:54.000000000 +0200 -@@ -46,7 +46,9 @@ - - #ifndef SUBTARGET_ASM_FLOAT_SPEC - #define SUBTARGET_ASM_FLOAT_SPEC "\ --%{mapcs-float:-mfloat} %{msoft-float:-mfpu=softfpa}" -+%{mapcs-float:-mfloat} \ -+%{mhard-float:-mfpu=fpa} \ -+%{!mhard-float: %{msoft-float:-mfpu=softfpa} %{!msoft-float:-mfpu=softvfp}}" - #endif - - #ifndef ASM_SPEC -@@ -106,12 +108,17 @@ - #endif - - #ifndef TARGET_DEFAULT --#define TARGET_DEFAULT (ARM_FLAG_SOFT_FLOAT | ARM_FLAG_APCS_32 | ARM_FLAG_APCS_FRAME | ARM_FLAG_MMU_TRAPS) -+#define TARGET_DEFAULT \ -+ ( ARM_FLAG_SOFT_FLOAT \ -+ | ARM_FLAG_VFP \ -+ | ARM_FLAG_APCS_32 \ -+ | ARM_FLAG_APCS_FRAME \ -+ | ARM_FLAG_MMU_TRAPS ) - #endif - - #ifndef MULTILIB_DEFAULTS - #define MULTILIB_DEFAULTS \ -- { "marm", "mlittle-endian", "msoft-float", "mapcs-32", "mno-thumb-interwork", "fno-leading-underscore" } -+ { "marm", "mlittle-endian", "mapcs-32", "mno-thumb-interwork", "fno-leading-underscore" } - #endif - - #define TARGET_ASM_FILE_START_APP_OFF true -diff -durN gcc-3.4.6.orig/gcc/config/arm/linux-elf.h gcc-3.4.6/gcc/config/arm/linux-elf.h ---- gcc-3.4.6.orig/gcc/config/arm/linux-elf.h 2007-08-15 23:07:00.000000000 +0200 -+++ gcc-3.4.6/gcc/config/arm/linux-elf.h 2007-08-15 23:10:54.000000000 +0200 -@@ -44,12 +44,26 @@ - #define TARGET_LINKER_EMULATION "armelf_linux" - #endif - --/* Default is to use APCS-32 mode. */ -+/* -+ * Default is to use APCS-32 mode with soft-vfp. -+ * The old Linux default for floats can be achieved with -mhard-float -+ * or with the configure --with-float=hard option. -+ * If -msoft-float or --with-float=soft is used then software float -+ * support will be used just like the default but with the legacy -+ * big endian word ordering for double float representation instead. -+ */ - #undef TARGET_DEFAULT --#define TARGET_DEFAULT \ -- ( ARM_FLAG_APCS_32 | \ -- ARM_FLAG_MMU_TRAPS | \ -- TARGET_ENDIAN_DEFAULT ) -+#define TARGET_DEFAULT \ -+ ( ARM_FLAG_APCS_32 \ -+ | ARM_FLAG_SOFT_FLOAT \ -+ | TARGET_ENDIAN_DEFAULT \ -+ | ARM_FLAG_VFP \ -+ | ARM_FLAG_MMU_TRAPS ) -+ -+#undef SUBTARGET_EXTRA_ASM_SPEC -+#define SUBTARGET_EXTRA_ASM_SPEC "\ -+%{mhard-float:-mfpu=fpa} \ -+%{!mhard-float: %{msoft-float:-mfpu=softfpa} %{!msoft-float:-mfpu=softvfp}}" - - #define SUBTARGET_CPU_DEFAULT TARGET_CPU_arm6 - -@@ -57,7 +71,7 @@ - - #undef MULTILIB_DEFAULTS - #define MULTILIB_DEFAULTS \ -- { "marm", TARGET_ENDIAN_OPTION, "mhard-float", "mapcs-32", "mno-thumb-interwork" } -+ { "marm", TARGET_ENDIAN_OPTION, "mapcs-32", "mno-thumb-interwork" } - - #define CPP_APCS_PC_DEFAULT_SPEC "-D__APCS_32__" - -@@ -72,7 +86,7 @@ - %{shared:-lc} \ - %{!shared:%{profile:-lc_p}%{!profile:-lc}}" - --#define LIBGCC_SPEC "%{msoft-float:-lfloat} -lgcc" -+#define LIBGCC_SPEC "-lgcc" - - /* Provide a STARTFILE_SPEC appropriate for GNU/Linux. Here we add - the GNU/Linux magical crtbegin.o file (see crtstuff.c) which -diff -durN gcc-3.4.6.orig/gcc/config/arm/t-linux gcc-3.4.6/gcc/config/arm/t-linux ---- gcc-3.4.6.orig/gcc/config/arm/t-linux 2003-09-20 23:09:07.000000000 +0200 -+++ gcc-3.4.6/gcc/config/arm/t-linux 2007-08-15 23:10:54.000000000 +0200 -@@ -4,7 +4,10 @@ - LIBGCC2_DEBUG_CFLAGS = -g0 - - LIB1ASMSRC = arm/lib1funcs.asm --LIB1ASMFUNCS = _udivsi3 _divsi3 _umodsi3 _modsi3 _dvmd_lnx -+LIB1ASMFUNCS = _udivsi3 _divsi3 _umodsi3 _modsi3 _dvmd_lnx \ -+ _negdf2 _addsubdf3 _muldivdf3 _cmpdf2 _unorddf2 _fixdfsi _fixunsdfsi \ -+ _truncdfsf2 _negsf2 _addsubsf3 _muldivsf3 _cmpsf2 _unordsf2 \ -+ _fixsfsi _fixunssfsi - - # MULTILIB_OPTIONS = mhard-float/msoft-float - # MULTILIB_DIRNAMES = hard-float soft-float -diff -durN gcc-3.4.6.orig/gcc/config/arm/unknown-elf.h gcc-3.4.6/gcc/config/arm/unknown-elf.h ---- gcc-3.4.6.orig/gcc/config/arm/unknown-elf.h 2004-02-24 15:25:22.000000000 +0100 -+++ gcc-3.4.6/gcc/config/arm/unknown-elf.h 2007-08-15 23:10:54.000000000 +0200 -@@ -30,7 +30,12 @@ - - /* Default to using APCS-32 and software floating point. */ - #ifndef TARGET_DEFAULT --#define TARGET_DEFAULT (ARM_FLAG_SOFT_FLOAT | ARM_FLAG_APCS_32 | ARM_FLAG_APCS_FRAME | ARM_FLAG_MMU_TRAPS) -+#define TARGET_DEFAULT \ -+ ( ARM_FLAG_SOFT_FLOAT \ -+ | ARM_FLAG_VFP \ -+ | ARM_FLAG_APCS_32 \ -+ | ARM_FLAG_APCS_FRAME \ -+ | ARM_FLAG_MMU_TRAPS ) - #endif - - /* Now we define the strings used to build the spec file. */ -diff -durN gcc-3.4.6.orig/gcc/config/arm/xscale-elf.h gcc-3.4.6/gcc/config/arm/xscale-elf.h ---- gcc-3.4.6.orig/gcc/config/arm/xscale-elf.h 2003-07-02 01:26:43.000000000 +0200 -+++ gcc-3.4.6/gcc/config/arm/xscale-elf.h 2007-08-15 23:10:54.000000000 +0200 -@@ -49,11 +49,12 @@ - endian, regardless of the endian-ness of the memory - system. */ - --#define SUBTARGET_EXTRA_ASM_SPEC "%{!mcpu=*:-mcpu=xscale} \ -- %{mhard-float:-mfpu=fpa} \ -- %{!mhard-float: %{msoft-float:-mfpu=softfpa;:-mfpu=softvfp}}" -+#define SUBTARGET_EXTRA_ASM_SPEC "\ -+%{!mcpu=*:-mcpu=xscale} \ -+%{mhard-float:-mfpu=fpa} \ -+%{!mhard-float: %{msoft-float:-mfpu=softfpa} %{!msoft-float:-mfpu=softvfp}}" - - #ifndef MULTILIB_DEFAULTS - #define MULTILIB_DEFAULTS \ -- { "mlittle-endian", "mno-thumb-interwork", "marm", "msoft-float" } -+ { "mlittle-endian", "mno-thumb-interwork", "marm" } - #endif diff --git a/patches/gcc/4.0.0/100-fix-fixincl.patch b/patches/gcc/4.0.0/100-fix-fixincl.patch new file mode 100644 index 0000000..8051f31 --- /dev/null +++ b/patches/gcc/4.0.0/100-fix-fixincl.patch @@ -0,0 +1,72 @@ +See http://gcc.gnu.org/PR22541 + +From: Dan Kegel + +When building gcc-3.4.3 or gcc-4.0.[01] into a clean $PREFIX (the only two I've tried like this), +the configure script happily copies the glibc include files from include to sys-include; +here's the line from the log file (with $PREFIX instead of the real prefix): + +Copying $PREFIX/i686-unknown-linux-gnu/include to $PREFIX/i686-unknown-linux-gnu/sys-include + +But later, when running fixincludes, it gives the error message + The directory that should contain system headers does not exist: + $PREFIX/lib/gcc/i686-unknown-linux-gnu/3.4.3/../../../../i686-unknown-linux-gnu/sys-include + +Nevertheless, it continues building; the header files it installs in + $PREFIX/lib/gcc/i686-unknown-linux-gnu/3.4.3/include +do not include the boilerplate that would cause it to #include_next the +glibc headers in the system header directory. +Thus the resulting toolchain can't compile the following program: +#include +int x = PATH_MAX; +because its limits.h doesn't include the glibc header. + +That's not nice. I suspect the problem is that gcc/Makefile.in assumes that +it can refer to $PREFIX/i686-unknown-linux-gnu with the path + $PREFIX/lib/../i686-unknown-linux-gnu, but +that fails because the directory $PREFIX/lib doesn't exist during 'make all'; +it is only created later, during 'make install'. (Which makes this problem +confusing, since one only notices the breakage well after 'make install', +at which point the path configure complained about does exist, and has the +right stuff in it.) + +A possible fix is to replace the line in gcc/Makefile.in that says + SYSTEM_HEADER_DIR = @SYSTEM_HEADER_DIR@ +with a version that gets rid of extra ..'s, e.g. + SYSTEM_HEADER_DIR = `echo @SYSTEM_HEADER_DIR@ | sed -e :a -e "s,[^/]*/\.\.\/,,;ta"` +(hey, that's the first time I've ever used a label in a sed script; thanks to the sed faq +for explaining the :a ... ta method of looping to repeat a search-and-replace until it doesn't match.) + +[rediffed against gcc-4.0.0] + +--- gcc-4.0.0/gcc/Makefile.in.orig 2005-04-04 12:45:13.000000000 -0700 ++++ gcc-4.0.0/gcc/Makefile.in 2005-05-20 12:33:43.000000000 -0700 +@@ -378,7 +378,10 @@ + CROSS_SYSTEM_HEADER_DIR = @CROSS_SYSTEM_HEADER_DIR@ + + # autoconf sets SYSTEM_HEADER_DIR to one of the above. +-SYSTEM_HEADER_DIR = @SYSTEM_HEADER_DIR@ ++# Purge it of unneccessary internal relative paths ++# to directories that might not exist yet. ++# The sed idiom for this is to repeat the search-and-replace until it doesn't match, using :a ... ta. ++SYSTEM_HEADER_DIR = `echo @SYSTEM_HEADER_DIR@ | sed -e :a -e "s,[^/]*/\.\.\/,," -e ta` + + # Control whether to run fixproto and fixincludes. + STMP_FIXPROTO = @STMP_FIXPROTO@ +@@ -2838,13 +2841,15 @@ + ../$(build_subdir)/fixincludes/fixincl: ; @ : + + # Build fixed copies of system files. ++# Abort if no system headers available, unless building a crosscompiler. ++# FIXME: abort unless building --without-headers would be more accurate and less ugly + stmp-fixinc: gsyslimits.h macro_list \ + ../$(build_subdir)/fixincludes/fixincl \ + ../$(build_subdir)/fixincludes/fixinc.sh + @if test ! -d ${SYSTEM_HEADER_DIR}; then \ + echo The directory that should contain system headers does not exist: >&2 ; \ + echo " ${SYSTEM_HEADER_DIR}" >&2 ; \ +- if test "x${SYSTEM_HEADER_DIR}" = "x${gcc_tooldir}/sys-include"; \ ++ if test "x${SYSTEM_HEADER_DIR}" = "x`echo "${gcc_tooldir}/sys-include" | sed -e :a -e "s,[^/]*/\.\.\/,," -e ta`"; \ + then sleep 1; else exit 1; fi; \ + fi + rm -rf include; mkdir include diff --git a/patches/gcc/4.0.0/110-gcc-4.0-arm-bigendian.patch b/patches/gcc/4.0.0/110-gcc-4.0-arm-bigendian.patch new file mode 100644 index 0000000..d9bcffe --- /dev/null +++ b/patches/gcc/4.0.0/110-gcc-4.0-arm-bigendian.patch @@ -0,0 +1,79 @@ +By Lennert Buytenhek +Adds support for arm*b-linux* big-endian ARM targets + +Fixes following build error for big-endian ARM targets: + +armeb-unknown-linux-gnu/gcc-4.0.0-20050410-glibc-2.3.4/bin/../lib/gcc/armeb-unknown-linux-gnu/4.0.0/../../../../armeb-unknown-linux-gnu/bin/ld: unrecognised emulation mode: armelf_linux +Supported emulations: armelfb_linux armelfb +collect2: ld returned 1 exit status +make[2]: *** [crosstool-0.32/build/armeb-unknown-linux-gnu/gcc-4.0.0-20050410-glibc-2.3.4/build-glibc/csu/crt1.o] Error 1 +make[2]: Leaving directory `crosstool-0.32/build/armeb-unknown-linux-gnu/gcc-4.0.0-20050410-glibc-2.3.4/glibc-2.3.4/csu' +make[1]: *** [csu/subdir_lib] Error 2 +make[1]: Leaving directory `crosstool-0.32/build/armeb-unknown-linux-gnu/gcc-4.0.0-20050410-glibc-2.3.4/glibc-2.3.4' +make: *** [lib] Error 2 + + +See http://gcc.gnu.org/PR16350 + +--- gcc-4.0-20050305/gcc/config/arm/linux-elf.h.orig 2005-03-23 18:44:54.822707377 +0100 ++++ gcc-4.0-20050305/gcc/config/arm/linux-elf.h 2005-03-23 18:46:18.228560206 +0100 +@@ -31,19 +31,33 @@ + /* Do not assume anything about header files. */ + #define NO_IMPLICIT_EXTERN_C + ++/* ++ * 'config.gcc' defines TARGET_BIG_ENDIAN_DEFAULT as 1 for ++ * arm*b-*-linux* (big endian) configurations. ++ */ ++#if TARGET_BIG_ENDIAN_DEFAULT ++#define TARGET_ENDIAN_DEFAULT ARM_FLAG_BIG_END ++#define TARGET_ENDIAN_OPTION "mbig-endian" ++#define TARGET_LINKER_EMULATION "armelfb_linux" ++#else ++#define TARGET_ENDIAN_DEFAULT 0 ++#define TARGET_ENDIAN_OPTION "mlittle-endian" ++#define TARGET_LINKER_EMULATION "armelf_linux" ++#endif ++ + #undef TARGET_DEFAULT_FLOAT_ABI + #define TARGET_DEFAULT_FLOAT_ABI ARM_FLOAT_ABI_HARD + + #undef TARGET_DEFAULT +-#define TARGET_DEFAULT (0) ++#define TARGET_DEFAULT (TARGET_ENDIAN_DEFAULT) + + #define SUBTARGET_CPU_DEFAULT TARGET_CPU_arm6 + +-#define SUBTARGET_EXTRA_LINK_SPEC " -m armelf_linux -p" ++#define SUBTARGET_EXTRA_LINK_SPEC " -m " TARGET_LINKER_EMULATION " -p" + + #undef MULTILIB_DEFAULTS + #define MULTILIB_DEFAULTS \ +- { "marm", "mlittle-endian", "mhard-float", "mno-thumb-interwork" } ++ { "marm", TARGET_ENDIAN_OPTION, "mhard-float", "mno-thumb-interwork" } + + /* The GNU C++ standard library requires that these macros be defined. */ + #undef CPLUSPLUS_CPP_SPEC +@@ -90,7 +104,7 @@ + %{rdynamic:-export-dynamic} \ + %{!dynamic-linker:-dynamic-linker /lib/ld-linux.so.2} \ + -X \ +- %{mbig-endian:-EB}" \ ++ %{mbig-endian:-EB} %{mlittle-endian:-EL}" \ + SUBTARGET_EXTRA_LINK_SPEC + + #define TARGET_OS_CPP_BUILTINS() \ +--- gcc-4.0-20050305/gcc/config.gcc.orig 2005-03-23 18:46:23.318105335 +0100 ++++ gcc-4.0-20050305/gcc/config.gcc 2005-03-23 18:47:41.592546386 +0100 +@@ -650,6 +650,11 @@ + ;; + arm*-*-linux*) # ARM GNU/Linux with ELF + tm_file="dbxelf.h elfos.h linux.h arm/elf.h arm/linux-gas.h arm/linux-elf.h arm/aout.h arm/arm.h" ++ case $target in ++ arm*b-*-linux*) ++ tm_defines="${tm_defines} TARGET_BIG_ENDIAN_DEFAULT=1" ++ ;; ++ esac + tmake_file="${tmake_file} arm/t-arm arm/t-linux" + extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o" + gnu_ld=yes diff --git a/patches/gcc/4.0.0/120-pr20815-fix.patch b/patches/gcc/4.0.0/120-pr20815-fix.patch new file mode 100644 index 0000000..7ac8ab5 --- /dev/null +++ b/patches/gcc/4.0.0/120-pr20815-fix.patch @@ -0,0 +1,121 @@ +Date: 18 May 2005 22:47:59 -0000 +Message-ID: <20050518224759.7352.qmail@sourceware.org> +From: "hubicka at ucw dot cz" +To: dank@kegel.com +References: <20050407215701.20815.dank@kegel.com> +Reply-To: gcc-bugzilla@gcc.gnu.org +Subject: [Bug gcov/profile/20815] -fprofile-use barfs with "coverage mismatch for function '...' while reading counter 'arcs'." + + +------- Additional Comments From hubicka at ucw dot cz 2005-05-18 22:47 ------- +Subject: Re: [Bug gcov/profile/20815] -fprofile-use barfs with "coverage mismatch for function '...' while reading counter 'arcs'." + +> +> ------- Additional Comments From hubicka at ucw dot cz 2005-05-18 22:22 ------- +> Subject: Re: [Bug gcov/profile/20815] -fprofile-use barfs with "coverage mismatch for function '...' while reading counter 'arcs'." +> +> coverage_checksum_string already knows a bit about ignoring random seed +> produced mess. It looks like this needs to be extended somehow to +> handle namespaces too... + +This seems to solve the missmatch. Would it be possible to test it on +bigger testcase and if it works distile a testcase that don't use +file IO so it is more suitable for gcc regtesting? + +Index: coverage.c +=================================================================== +RCS file: /cvs/gcc/gcc/gcc/coverage.c,v +retrieving revision 1.6.2.12.2.12 +diff -c -3 -p -r1.6.2.12.2.12 coverage.c +*** gcc-old/gcc/coverage.c 18 May 2005 07:37:31 -0000 1.6.2.12.2.12 +--- gcc/gcc/coverage.c 18 May 2005 22:45:36 -0000 +*************** coverage_checksum_string (unsigned chksu +*** 471,505 **** + as the checksums are used only for sanity checking. */ + for (i = 0; string[i]; i++) + { + if (!strncmp (string + i, "_GLOBAL__", 9)) +! for (i = i + 9; string[i]; i++) +! if (string[i]=='_') +! { +! int y; +! unsigned seed; +! int scan; +! +! for (y = 1; y < 9; y++) +! if (!(string[i + y] >= '0' && string[i + y] <= '9') +! && !(string[i + y] >= 'A' && string[i + y] <= 'F')) +! break; +! if (y != 9 || string[i + 9] != '_') +! continue; +! for (y = 10; y < 18; y++) +! if (!(string[i + y] >= '0' && string[i + y] <= '9') +! && !(string[i + y] >= 'A' && string[i + y] <= 'F')) +! break; +! if (y != 18) +! continue; +! scan = sscanf (string + i + 10, "%X", &seed); +! gcc_assert (scan); +! if (seed != crc32_string (0, flag_random_seed)) +! continue; +! string = dup = xstrdup (string); +! for (y = 10; y < 18; y++) +! dup[i + y] = '0'; +! break; +! } + break; + } + +--- 471,511 ---- + as the checksums are used only for sanity checking. */ + for (i = 0; string[i]; i++) + { ++ int offset = 0; ++ if (!strncmp (string + i, "_GLOBAL__N_", 11)) ++ offset = 11; + if (!strncmp (string + i, "_GLOBAL__", 9)) +! offset = 9; +! +! /* C++ namespaces do have scheme: +! _GLOBAL__N___functionname +! since filename might contain extra underscores there seems +! to be no better chance then walk all possible offsets looking +! for magicnuber. */ +! if (offset) +! for (;string[offset]; offset++) +! for (i = i + offset; string[i]; i++) +! if (string[i]=='_') +! { +! int y; +! +! for (y = 1; y < 9; y++) +! if (!(string[i + y] >= '0' && string[i + y] <= '9') +! && !(string[i + y] >= 'A' && string[i + y] <= 'F')) +! break; +! if (y != 9 || string[i + 9] != '_') +! continue; +! for (y = 10; y < 18; y++) +! if (!(string[i + y] >= '0' && string[i + y] <= '9') +! && !(string[i + y] >= 'A' && string[i + y] <= 'F')) +! break; +! if (y != 18) +! continue; +! if (!dup) +! string = dup = xstrdup (string); +! for (y = 10; y < 18; y++) +! dup[i + y] = '0'; +! } + break; + } + + + +-- + + +http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20815 + +------- You are receiving this mail because: ------- +You reported the bug, or are watching the reporter. + + diff --git a/patches/gcc/4.0.0/130-pr20973-fix.patch b/patches/gcc/4.0.0/130-pr20973-fix.patch new file mode 100644 index 0000000..7451219 --- /dev/null +++ b/patches/gcc/4.0.0/130-pr20973-fix.patch @@ -0,0 +1,80 @@ +http://gcc.gnu.org/PR20973 + +"gcc 4 (about RC1) miscompiles khtml, in fact something in CSS, which basically +leads to all websites being misrendered. I can't easily reduce the testcase, +but have applied the whole preprocessed source of css/cssstyleselector.ii. + +It is to be compiled with g++ -O2 -fPIC -march=i586 -mtune=i686 +-fno-exceptions. A more detailed analysis will follow, as we've found out +some things already." + +--- + +Subject: Bug 20973 + +CVSROOT: /cvs/gcc +Module name: gcc +Branch: gcc-4_0-branch +Changes by: matz@gcc.gnu.org 2005-04-22 17:30:21 + +Modified files: + gcc : ChangeLog reload.c + +Log message: + PR middle-end/20973 + * reload.c (push_reload, find_dummy_reload): Check for uninitialized + pseudos. + +Patches: +http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=2.7592.2.177&r2=2.7592.2.178 +http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/reload.c.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.268&r2=1.268.2.1 + +--- + +=================================================================== +RCS file: /cvs/gcc/gcc/gcc/reload.c,v +retrieving revision 1.268 +retrieving revision 1.268.2.1 +diff -u -r1.268 -r1.268.2.1 +--- gcc/gcc/reload.c 2005/02/24 22:06:06 1.268 ++++ gcc/gcc/reload.c 2005/04/22 17:30:15 1.268.2.1 +@@ -1520,7 +1520,7 @@ + But if there is no spilling in this block, that is OK. + An explicitly used hard reg cannot be a spill reg. */ + +- if (rld[i].reg_rtx == 0 && in != 0) ++ if (rld[i].reg_rtx == 0 && in != 0 && hard_regs_live_known) + { + rtx note; + int regno; +@@ -1534,6 +1534,11 @@ + && REG_P (XEXP (note, 0)) + && (regno = REGNO (XEXP (note, 0))) < FIRST_PSEUDO_REGISTER + && reg_mentioned_p (XEXP (note, 0), in) ++ /* Check that we don't use a hardreg for an uninitialized ++ pseudo. See also find_dummy_reload(). */ ++ && (ORIGINAL_REGNO (XEXP (note, 0)) < FIRST_PSEUDO_REGISTER ++ || ! bitmap_bit_p (ENTRY_BLOCK_PTR->global_live_at_end, ++ ORIGINAL_REGNO (XEXP (note, 0)))) + && ! refers_to_regno_for_reload_p (regno, + (regno + + hard_regno_nregs[regno] +@@ -1997,7 +2002,17 @@ + is a subreg, and in that case, out + has a real mode. */ + (GET_MODE (out) != VOIDmode +- ? GET_MODE (out) : outmode))) ++ ? GET_MODE (out) : outmode)) ++ /* But only do all this if we can be sure, that this input ++ operand doesn't correspond with an uninitialized pseudoreg. ++ global can assign some hardreg to it, which is the same as ++ a different pseudo also currently live (as it can ignore the ++ conflict). So we never must introduce writes to such hardregs, ++ as they would clobber the other live pseudo using the same. ++ See also PR20973. */ ++ && (ORIGINAL_REGNO (in) < FIRST_PSEUDO_REGISTER ++ || ! bitmap_bit_p (ENTRY_BLOCK_PTR->global_live_at_end, ++ ORIGINAL_REGNO (in)))) + { + unsigned int regno = REGNO (in) + in_offset; + unsigned int nwords = hard_regno_nregs[regno][inmode]; diff --git a/patches/gcc/4.0.0/140-pr21173-fix.patch b/patches/gcc/4.0.0/140-pr21173-fix.patch new file mode 100644 index 0000000..0582d75 --- /dev/null +++ b/patches/gcc/4.0.0/140-pr21173-fix.patch @@ -0,0 +1,66 @@ +See http://gcc.gnu.org/PR21173 +This is a fix for a last minute brown-bag bug with gcc-4.0.0 + + ------- Additional Comment #24 From CVS Commits 2005-04-25 14:03 [reply] ------- +Subject: Bug 21173 + +CVSROOT: /cvs/gcc +Module name: gcc +Branch: gcc-4_0-branch +Changes by: dberlin@gcc.gnu.org 2005-04-25 14:02:38 + +Modified files: + gcc : ChangeLog tree-ssa-pre.c + +Log message: + 2005-04-25 Daniel Berlin + + Fix PR tree-optimization/21173 + + * tree-ssa-pre.c (create_expression_by_pieces): Call unshare_expr + on things we pass to force_gimple_operand. Don't try to special + case min_invariants. + +Patches: +http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=2.7592.2.192&r2=2.7592.2.193 +http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/tree-ssa-pre.c.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=2.65.4.2&r2=2.65.4.3 + +=================================================================== +RCS file: /cvs/gcc/gcc/gcc/tree-ssa-pre.c,v +retrieving revision 2.65.4.2 +retrieving revision 2.65.4.3 +diff -u -r2.65.4.2 -r2.65.4.3 +--- gcc/gcc/tree-ssa-pre.c 2005/04/17 23:40:31 2.65.4.2 ++++ gcc/gcc/tree-ssa-pre.c 2005/04/25 14:02:31 2.65.4.3 +@@ -1330,7 +1330,8 @@ + + folded = fold (build (TREE_CODE (expr), TREE_TYPE (expr), + genop1, genop2)); +- newexpr = force_gimple_operand (folded, &forced_stmts, false, NULL); ++ newexpr = force_gimple_operand (unshare_expr (folded), ++ &forced_stmts, false, NULL); + if (forced_stmts) + { + tsi = tsi_start (forced_stmts); +@@ -1372,14 +1373,8 @@ + add_referenced_tmp_var (temp); + folded = fold (build (TREE_CODE (expr), TREE_TYPE (expr), + genop1)); +- /* If the generated operand is already GIMPLE min_invariant +- just use it instead of calling force_gimple_operand on it, +- since that may make it not invariant by copying it into an +- assignment. */ +- if (!is_gimple_min_invariant (genop1)) +- newexpr = force_gimple_operand (folded, &forced_stmts, false, NULL); +- else +- newexpr = genop1; ++ newexpr = force_gimple_operand (unshare_expr (folded), ++ &forced_stmts, false, NULL); + if (forced_stmts) + { + tsi = tsi_start (forced_stmts); + + 0K . 1.24 MB/s + +13:16:54 (1.24 MB/s) - `-' saved [1303] + diff --git a/patches/gcc/4.0.0/150-pr21951.patch b/patches/gcc/4.0.0/150-pr21951.patch new file mode 100644 index 0000000..8c5ffb9 --- /dev/null +++ b/patches/gcc/4.0.0/150-pr21951.patch @@ -0,0 +1,153 @@ +Workaround for buglet in std::vector etc. when compiling +with gcc-4.0.0 -Wall -O -fno-exceptions +Fixes: + +.../include/c++/4.0.0/bits/vector.tcc: In member function 'void std::vector<_Tp, +_Alloc>::reserve(size_t) [with _Tp = int, _Alloc = std::allocator]': +.../include/c++/4.0.0/bits/vector.tcc:78: warning: control may reach end of +non-void function 'typename _Alloc::pointer std::vector<_Tp, +_Alloc>::_M_allocate_and_copy(size_t, _ForwardIterator, _ForwardIterator) [with +_ForwardIterator = int*, _Tp = int, _Alloc = std::allocator]' being inlined + +See http://gcc.gnu.org/PR21951 + +--- gcc-4.0.1-20050607/libstdc++-v3/include/bits/stl_vector.h.old 2005-06-11 03:58:20.000000000 -0700 ++++ gcc-4.0.1-20050607/libstdc++-v3/include/bits/stl_vector.h 2005-06-11 04:01:21.000000000 -0700 +@@ -765,13 +765,13 @@ + { + std::__uninitialized_copy_a(__first, __last, __result, + this->get_allocator()); +- return __result; + } + catch(...) + { + _M_deallocate(__result, __n); + __throw_exception_again; + } ++ return __result; + } + + +--- gcc-4.0.1-20050607/libstdc++-v3/include/bits/stl_uninitialized.h.old 2005-06-11 03:58:20.000000000 -0700 ++++ gcc-4.0.1-20050607/libstdc++-v3/include/bits/stl_uninitialized.h 2005-06-11 04:05:18.990003248 -0700 +@@ -84,13 +84,13 @@ + { + for (; __first != __last; ++__first, ++__cur) + std::_Construct(&*__cur, *__first); +- return __cur; + } + catch(...) + { + std::_Destroy(__result, __cur); + __throw_exception_again; + } ++ return __cur; + } + + /** +@@ -236,13 +236,13 @@ + { + for (; __first != __last; ++__first, ++__cur) + __alloc.construct(&*__cur, *__first); +- return __cur; + } + catch(...) + { + std::_Destroy(__result, __cur, __alloc); + __throw_exception_again; + } ++ return __cur; + } + + template +@@ -337,11 +337,13 @@ + { + return std::__uninitialized_copy_a(__first2, __last2, __mid, __alloc); + } ++#ifdef __EXCEPTIONS // work around http://gcc.gnu.org/PR21951 in gcc-4.0 only + catch(...) + { + std::_Destroy(__result, __mid, __alloc); + __throw_exception_again; + } ++#endif + } + + // __uninitialized_fill_copy +@@ -360,11 +362,13 @@ + { + return std::__uninitialized_copy_a(__first, __last, __mid, __alloc); + } ++#ifdef __EXCEPTIONS // work around http://gcc.gnu.org/PR21951 in gcc-4.0 only + catch(...) + { + std::_Destroy(__result, __mid, __alloc); + __throw_exception_again; + } ++#endif + } + + // __uninitialized_copy_fill +--- gcc-4.0.1-20050607/libstdc++-v3/include/ext/rope.old 2005-06-11 03:58:20.000000000 -0700 ++++ gcc-4.0.1-20050607/libstdc++-v3/include/ext/rope 2005-06-11 04:13:26.628870872 -0700 +@@ -1645,11 +1645,13 @@ + _S_cond_store_eos(__buf[__size]); + try + { return _S_new_RopeLeaf(__buf, __size, __a); } ++#ifdef __EXCEPTIONS // work around http://gcc.gnu.org/PR21951 in gcc-4.0 only + catch(...) + { + _RopeRep::__STL_FREE_STRING(__buf, __size, __a); + __throw_exception_again; + } ++#endif + } + + // Concatenation of nonempty strings. +--- gcc-4.0.1-20050607/libstdc++-v3/include/ext/memory.old 2005-06-11 03:58:20.000000000 -0700 ++++ gcc-4.0.1-20050607/libstdc++-v3/include/ext/memory 2005-06-11 04:13:52.897877376 -0700 +@@ -85,11 +85,13 @@ + std::_Construct(&*__cur, *__first); + return pair<_InputIter, _ForwardIter>(__first, __cur); + } ++#ifdef __EXCEPTIONS // work around http://gcc.gnu.org/PR21951 in gcc-4.0 only + catch(...) + { + std::_Destroy(__result, __cur); + __throw_exception_again; + } ++#endif + } + + template +@@ -144,11 +146,13 @@ + __alloc.construct(&*__cur, *__first); + return pair<_InputIter, _ForwardIter>(__first, __cur); + } ++#ifdef __EXCEPTIONS // work around http://gcc.gnu.org/PR21951 in gcc-4.0 only + catch(...) + { + std::_Destroy(__result, __cur, __alloc); + __throw_exception_again; + } ++#endif + } + + templateget_allocator().construct(&__n->_M_val, __obj); +- return __n; + } + catch(...) + { + _M_put_node(__n); + __throw_exception_again; + } ++ return __n; + } + + void diff --git a/patches/gcc/4.0.0/fix-fixincl.patch b/patches/gcc/4.0.0/fix-fixincl.patch deleted file mode 100644 index 8051f31..0000000 --- a/patches/gcc/4.0.0/fix-fixincl.patch +++ /dev/null @@ -1,72 +0,0 @@ -See http://gcc.gnu.org/PR22541 - -From: Dan Kegel - -When building gcc-3.4.3 or gcc-4.0.[01] into a clean $PREFIX (the only two I've tried like this), -the configure script happily copies the glibc include files from include to sys-include; -here's the line from the log file (with $PREFIX instead of the real prefix): - -Copying $PREFIX/i686-unknown-linux-gnu/include to $PREFIX/i686-unknown-linux-gnu/sys-include - -But later, when running fixincludes, it gives the error message - The directory that should contain system headers does not exist: - $PREFIX/lib/gcc/i686-unknown-linux-gnu/3.4.3/../../../../i686-unknown-linux-gnu/sys-include - -Nevertheless, it continues building; the header files it installs in - $PREFIX/lib/gcc/i686-unknown-linux-gnu/3.4.3/include -do not include the boilerplate that would cause it to #include_next the -glibc headers in the system header directory. -Thus the resulting toolchain can't compile the following program: -#include -int x = PATH_MAX; -because its limits.h doesn't include the glibc header. - -That's not nice. I suspect the problem is that gcc/Makefile.in assumes that -it can refer to $PREFIX/i686-unknown-linux-gnu with the path - $PREFIX/lib/../i686-unknown-linux-gnu, but -that fails because the directory $PREFIX/lib doesn't exist during 'make all'; -it is only created later, during 'make install'. (Which makes this problem -confusing, since one only notices the breakage well after 'make install', -at which point the path configure complained about does exist, and has the -right stuff in it.) - -A possible fix is to replace the line in gcc/Makefile.in that says - SYSTEM_HEADER_DIR = @SYSTEM_HEADER_DIR@ -with a version that gets rid of extra ..'s, e.g. - SYSTEM_HEADER_DIR = `echo @SYSTEM_HEADER_DIR@ | sed -e :a -e "s,[^/]*/\.\.\/,,;ta"` -(hey, that's the first time I've ever used a label in a sed script; thanks to the sed faq -for explaining the :a ... ta method of looping to repeat a search-and-replace until it doesn't match.) - -[rediffed against gcc-4.0.0] - ---- gcc-4.0.0/gcc/Makefile.in.orig 2005-04-04 12:45:13.000000000 -0700 -+++ gcc-4.0.0/gcc/Makefile.in 2005-05-20 12:33:43.000000000 -0700 -@@ -378,7 +378,10 @@ - CROSS_SYSTEM_HEADER_DIR = @CROSS_SYSTEM_HEADER_DIR@ - - # autoconf sets SYSTEM_HEADER_DIR to one of the above. --SYSTEM_HEADER_DIR = @SYSTEM_HEADER_DIR@ -+# Purge it of unneccessary internal relative paths -+# to directories that might not exist yet. -+# The sed idiom for this is to repeat the search-and-replace until it doesn't match, using :a ... ta. -+SYSTEM_HEADER_DIR = `echo @SYSTEM_HEADER_DIR@ | sed -e :a -e "s,[^/]*/\.\.\/,," -e ta` - - # Control whether to run fixproto and fixincludes. - STMP_FIXPROTO = @STMP_FIXPROTO@ -@@ -2838,13 +2841,15 @@ - ../$(build_subdir)/fixincludes/fixincl: ; @ : - - # Build fixed copies of system files. -+# Abort if no system headers available, unless building a crosscompiler. -+# FIXME: abort unless building --without-headers would be more accurate and less ugly - stmp-fixinc: gsyslimits.h macro_list \ - ../$(build_subdir)/fixincludes/fixincl \ - ../$(build_subdir)/fixincludes/fixinc.sh - @if test ! -d ${SYSTEM_HEADER_DIR}; then \ - echo The directory that should contain system headers does not exist: >&2 ; \ - echo " ${SYSTEM_HEADER_DIR}" >&2 ; \ -- if test "x${SYSTEM_HEADER_DIR}" = "x${gcc_tooldir}/sys-include"; \ -+ if test "x${SYSTEM_HEADER_DIR}" = "x`echo "${gcc_tooldir}/sys-include" | sed -e :a -e "s,[^/]*/\.\.\/,," -e ta`"; \ - then sleep 1; else exit 1; fi; \ - fi - rm -rf include; mkdir include diff --git a/patches/gcc/4.0.0/gcc-4.0-arm-bigendian.patch b/patches/gcc/4.0.0/gcc-4.0-arm-bigendian.patch deleted file mode 100644 index d9bcffe..0000000 --- a/patches/gcc/4.0.0/gcc-4.0-arm-bigendian.patch +++ /dev/null @@ -1,79 +0,0 @@ -By Lennert Buytenhek -Adds support for arm*b-linux* big-endian ARM targets - -Fixes following build error for big-endian ARM targets: - -armeb-unknown-linux-gnu/gcc-4.0.0-20050410-glibc-2.3.4/bin/../lib/gcc/armeb-unknown-linux-gnu/4.0.0/../../../../armeb-unknown-linux-gnu/bin/ld: unrecognised emulation mode: armelf_linux -Supported emulations: armelfb_linux armelfb -collect2: ld returned 1 exit status -make[2]: *** [crosstool-0.32/build/armeb-unknown-linux-gnu/gcc-4.0.0-20050410-glibc-2.3.4/build-glibc/csu/crt1.o] Error 1 -make[2]: Leaving directory `crosstool-0.32/build/armeb-unknown-linux-gnu/gcc-4.0.0-20050410-glibc-2.3.4/glibc-2.3.4/csu' -make[1]: *** [csu/subdir_lib] Error 2 -make[1]: Leaving directory `crosstool-0.32/build/armeb-unknown-linux-gnu/gcc-4.0.0-20050410-glibc-2.3.4/glibc-2.3.4' -make: *** [lib] Error 2 - - -See http://gcc.gnu.org/PR16350 - ---- gcc-4.0-20050305/gcc/config/arm/linux-elf.h.orig 2005-03-23 18:44:54.822707377 +0100 -+++ gcc-4.0-20050305/gcc/config/arm/linux-elf.h 2005-03-23 18:46:18.228560206 +0100 -@@ -31,19 +31,33 @@ - /* Do not assume anything about header files. */ - #define NO_IMPLICIT_EXTERN_C - -+/* -+ * 'config.gcc' defines TARGET_BIG_ENDIAN_DEFAULT as 1 for -+ * arm*b-*-linux* (big endian) configurations. -+ */ -+#if TARGET_BIG_ENDIAN_DEFAULT -+#define TARGET_ENDIAN_DEFAULT ARM_FLAG_BIG_END -+#define TARGET_ENDIAN_OPTION "mbig-endian" -+#define TARGET_LINKER_EMULATION "armelfb_linux" -+#else -+#define TARGET_ENDIAN_DEFAULT 0 -+#define TARGET_ENDIAN_OPTION "mlittle-endian" -+#define TARGET_LINKER_EMULATION "armelf_linux" -+#endif -+ - #undef TARGET_DEFAULT_FLOAT_ABI - #define TARGET_DEFAULT_FLOAT_ABI ARM_FLOAT_ABI_HARD - - #undef TARGET_DEFAULT --#define TARGET_DEFAULT (0) -+#define TARGET_DEFAULT (TARGET_ENDIAN_DEFAULT) - - #define SUBTARGET_CPU_DEFAULT TARGET_CPU_arm6 - --#define SUBTARGET_EXTRA_LINK_SPEC " -m armelf_linux -p" -+#define SUBTARGET_EXTRA_LINK_SPEC " -m " TARGET_LINKER_EMULATION " -p" - - #undef MULTILIB_DEFAULTS - #define MULTILIB_DEFAULTS \ -- { "marm", "mlittle-endian", "mhard-float", "mno-thumb-interwork" } -+ { "marm", TARGET_ENDIAN_OPTION, "mhard-float", "mno-thumb-interwork" } - - /* The GNU C++ standard library requires that these macros be defined. */ - #undef CPLUSPLUS_CPP_SPEC -@@ -90,7 +104,7 @@ - %{rdynamic:-export-dynamic} \ - %{!dynamic-linker:-dynamic-linker /lib/ld-linux.so.2} \ - -X \ -- %{mbig-endian:-EB}" \ -+ %{mbig-endian:-EB} %{mlittle-endian:-EL}" \ - SUBTARGET_EXTRA_LINK_SPEC - - #define TARGET_OS_CPP_BUILTINS() \ ---- gcc-4.0-20050305/gcc/config.gcc.orig 2005-03-23 18:46:23.318105335 +0100 -+++ gcc-4.0-20050305/gcc/config.gcc 2005-03-23 18:47:41.592546386 +0100 -@@ -650,6 +650,11 @@ - ;; - arm*-*-linux*) # ARM GNU/Linux with ELF - tm_file="dbxelf.h elfos.h linux.h arm/elf.h arm/linux-gas.h arm/linux-elf.h arm/aout.h arm/arm.h" -+ case $target in -+ arm*b-*-linux*) -+ tm_defines="${tm_defines} TARGET_BIG_ENDIAN_DEFAULT=1" -+ ;; -+ esac - tmake_file="${tmake_file} arm/t-arm arm/t-linux" - extra_parts="crtbegin.o crtbeginS.o crtend.o crtendS.o" - gnu_ld=yes diff --git a/patches/gcc/4.0.0/pr20815-fix.patch b/patches/gcc/4.0.0/pr20815-fix.patch deleted file mode 100644 index 7ac8ab5..0000000 --- a/patches/gcc/4.0.0/pr20815-fix.patch +++ /dev/null @@ -1,121 +0,0 @@ -Date: 18 May 2005 22:47:59 -0000 -Message-ID: <20050518224759.7352.qmail@sourceware.org> -From: "hubicka at ucw dot cz" -To: dank@kegel.com -References: <20050407215701.20815.dank@kegel.com> -Reply-To: gcc-bugzilla@gcc.gnu.org -Subject: [Bug gcov/profile/20815] -fprofile-use barfs with "coverage mismatch for function '...' while reading counter 'arcs'." - - -------- Additional Comments From hubicka at ucw dot cz 2005-05-18 22:47 ------- -Subject: Re: [Bug gcov/profile/20815] -fprofile-use barfs with "coverage mismatch for function '...' while reading counter 'arcs'." - -> -> ------- Additional Comments From hubicka at ucw dot cz 2005-05-18 22:22 ------- -> Subject: Re: [Bug gcov/profile/20815] -fprofile-use barfs with "coverage mismatch for function '...' while reading counter 'arcs'." -> -> coverage_checksum_string already knows a bit about ignoring random seed -> produced mess. It looks like this needs to be extended somehow to -> handle namespaces too... - -This seems to solve the missmatch. Would it be possible to test it on -bigger testcase and if it works distile a testcase that don't use -file IO so it is more suitable for gcc regtesting? - -Index: coverage.c -=================================================================== -RCS file: /cvs/gcc/gcc/gcc/coverage.c,v -retrieving revision 1.6.2.12.2.12 -diff -c -3 -p -r1.6.2.12.2.12 coverage.c -*** gcc-old/gcc/coverage.c 18 May 2005 07:37:31 -0000 1.6.2.12.2.12 ---- gcc/gcc/coverage.c 18 May 2005 22:45:36 -0000 -*************** coverage_checksum_string (unsigned chksu -*** 471,505 **** - as the checksums are used only for sanity checking. */ - for (i = 0; string[i]; i++) - { - if (!strncmp (string + i, "_GLOBAL__", 9)) -! for (i = i + 9; string[i]; i++) -! if (string[i]=='_') -! { -! int y; -! unsigned seed; -! int scan; -! -! for (y = 1; y < 9; y++) -! if (!(string[i + y] >= '0' && string[i + y] <= '9') -! && !(string[i + y] >= 'A' && string[i + y] <= 'F')) -! break; -! if (y != 9 || string[i + 9] != '_') -! continue; -! for (y = 10; y < 18; y++) -! if (!(string[i + y] >= '0' && string[i + y] <= '9') -! && !(string[i + y] >= 'A' && string[i + y] <= 'F')) -! break; -! if (y != 18) -! continue; -! scan = sscanf (string + i + 10, "%X", &seed); -! gcc_assert (scan); -! if (seed != crc32_string (0, flag_random_seed)) -! continue; -! string = dup = xstrdup (string); -! for (y = 10; y < 18; y++) -! dup[i + y] = '0'; -! break; -! } - break; - } - ---- 471,511 ---- - as the checksums are used only for sanity checking. */ - for (i = 0; string[i]; i++) - { -+ int offset = 0; -+ if (!strncmp (string + i, "_GLOBAL__N_", 11)) -+ offset = 11; - if (!strncmp (string + i, "_GLOBAL__", 9)) -! offset = 9; -! -! /* C++ namespaces do have scheme: -! _GLOBAL__N___functionname -! since filename might contain extra underscores there seems -! to be no better chance then walk all possible offsets looking -! for magicnuber. */ -! if (offset) -! for (;string[offset]; offset++) -! for (i = i + offset; string[i]; i++) -! if (string[i]=='_') -! { -! int y; -! -! for (y = 1; y < 9; y++) -! if (!(string[i + y] >= '0' && string[i + y] <= '9') -! && !(string[i + y] >= 'A' && string[i + y] <= 'F')) -! break; -! if (y != 9 || string[i + 9] != '_') -! continue; -! for (y = 10; y < 18; y++) -! if (!(string[i + y] >= '0' && string[i + y] <= '9') -! && !(string[i + y] >= 'A' && string[i + y] <= 'F')) -! break; -! if (y != 18) -! continue; -! if (!dup) -! string = dup = xstrdup (string); -! for (y = 10; y < 18; y++) -! dup[i + y] = '0'; -! } - break; - } - - - --- - - -http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20815 - -------- You are receiving this mail because: ------- -You reported the bug, or are watching the reporter. - - diff --git a/patches/gcc/4.0.0/pr20973-fix.patch b/patches/gcc/4.0.0/pr20973-fix.patch deleted file mode 100644 index 7451219..0000000 --- a/patches/gcc/4.0.0/pr20973-fix.patch +++ /dev/null @@ -1,80 +0,0 @@ -http://gcc.gnu.org/PR20973 - -"gcc 4 (about RC1) miscompiles khtml, in fact something in CSS, which basically -leads to all websites being misrendered. I can't easily reduce the testcase, -but have applied the whole preprocessed source of css/cssstyleselector.ii. - -It is to be compiled with g++ -O2 -fPIC -march=i586 -mtune=i686 --fno-exceptions. A more detailed analysis will follow, as we've found out -some things already." - ---- - -Subject: Bug 20973 - -CVSROOT: /cvs/gcc -Module name: gcc -Branch: gcc-4_0-branch -Changes by: matz@gcc.gnu.org 2005-04-22 17:30:21 - -Modified files: - gcc : ChangeLog reload.c - -Log message: - PR middle-end/20973 - * reload.c (push_reload, find_dummy_reload): Check for uninitialized - pseudos. - -Patches: -http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=2.7592.2.177&r2=2.7592.2.178 -http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/reload.c.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.268&r2=1.268.2.1 - ---- - -=================================================================== -RCS file: /cvs/gcc/gcc/gcc/reload.c,v -retrieving revision 1.268 -retrieving revision 1.268.2.1 -diff -u -r1.268 -r1.268.2.1 ---- gcc/gcc/reload.c 2005/02/24 22:06:06 1.268 -+++ gcc/gcc/reload.c 2005/04/22 17:30:15 1.268.2.1 -@@ -1520,7 +1520,7 @@ - But if there is no spilling in this block, that is OK. - An explicitly used hard reg cannot be a spill reg. */ - -- if (rld[i].reg_rtx == 0 && in != 0) -+ if (rld[i].reg_rtx == 0 && in != 0 && hard_regs_live_known) - { - rtx note; - int regno; -@@ -1534,6 +1534,11 @@ - && REG_P (XEXP (note, 0)) - && (regno = REGNO (XEXP (note, 0))) < FIRST_PSEUDO_REGISTER - && reg_mentioned_p (XEXP (note, 0), in) -+ /* Check that we don't use a hardreg for an uninitialized -+ pseudo. See also find_dummy_reload(). */ -+ && (ORIGINAL_REGNO (XEXP (note, 0)) < FIRST_PSEUDO_REGISTER -+ || ! bitmap_bit_p (ENTRY_BLOCK_PTR->global_live_at_end, -+ ORIGINAL_REGNO (XEXP (note, 0)))) - && ! refers_to_regno_for_reload_p (regno, - (regno - + hard_regno_nregs[regno] -@@ -1997,7 +2002,17 @@ - is a subreg, and in that case, out - has a real mode. */ - (GET_MODE (out) != VOIDmode -- ? GET_MODE (out) : outmode))) -+ ? GET_MODE (out) : outmode)) -+ /* But only do all this if we can be sure, that this input -+ operand doesn't correspond with an uninitialized pseudoreg. -+ global can assign some hardreg to it, which is the same as -+ a different pseudo also currently live (as it can ignore the -+ conflict). So we never must introduce writes to such hardregs, -+ as they would clobber the other live pseudo using the same. -+ See also PR20973. */ -+ && (ORIGINAL_REGNO (in) < FIRST_PSEUDO_REGISTER -+ || ! bitmap_bit_p (ENTRY_BLOCK_PTR->global_live_at_end, -+ ORIGINAL_REGNO (in)))) - { - unsigned int regno = REGNO (in) + in_offset; - unsigned int nwords = hard_regno_nregs[regno][inmode]; diff --git a/patches/gcc/4.0.0/pr21173-fix.patch b/patches/gcc/4.0.0/pr21173-fix.patch deleted file mode 100644 index 0582d75..0000000 --- a/patches/gcc/4.0.0/pr21173-fix.patch +++ /dev/null @@ -1,66 +0,0 @@ -See http://gcc.gnu.org/PR21173 -This is a fix for a last minute brown-bag bug with gcc-4.0.0 - - ------- Additional Comment #24 From CVS Commits 2005-04-25 14:03 [reply] ------- -Subject: Bug 21173 - -CVSROOT: /cvs/gcc -Module name: gcc -Branch: gcc-4_0-branch -Changes by: dberlin@gcc.gnu.org 2005-04-25 14:02:38 - -Modified files: - gcc : ChangeLog tree-ssa-pre.c - -Log message: - 2005-04-25 Daniel Berlin - - Fix PR tree-optimization/21173 - - * tree-ssa-pre.c (create_expression_by_pieces): Call unshare_expr - on things we pass to force_gimple_operand. Don't try to special - case min_invariants. - -Patches: -http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=2.7592.2.192&r2=2.7592.2.193 -http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/tree-ssa-pre.c.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=2.65.4.2&r2=2.65.4.3 - -=================================================================== -RCS file: /cvs/gcc/gcc/gcc/tree-ssa-pre.c,v -retrieving revision 2.65.4.2 -retrieving revision 2.65.4.3 -diff -u -r2.65.4.2 -r2.65.4.3 ---- gcc/gcc/tree-ssa-pre.c 2005/04/17 23:40:31 2.65.4.2 -+++ gcc/gcc/tree-ssa-pre.c 2005/04/25 14:02:31 2.65.4.3 -@@ -1330,7 +1330,8 @@ - - folded = fold (build (TREE_CODE (expr), TREE_TYPE (expr), - genop1, genop2)); -- newexpr = force_gimple_operand (folded, &forced_stmts, false, NULL); -+ newexpr = force_gimple_operand (unshare_expr (folded), -+ &forced_stmts, false, NULL); - if (forced_stmts) - { - tsi = tsi_start (forced_stmts); -@@ -1372,14 +1373,8 @@ - add_referenced_tmp_var (temp); - folded = fold (build (TREE_CODE (expr), TREE_TYPE (expr), - genop1)); -- /* If the generated operand is already GIMPLE min_invariant -- just use it instead of calling force_gimple_operand on it, -- since that may make it not invariant by copying it into an -- assignment. */ -- if (!is_gimple_min_invariant (genop1)) -- newexpr = force_gimple_operand (folded, &forced_stmts, false, NULL); -- else -- newexpr = genop1; -+ newexpr = force_gimple_operand (unshare_expr (folded), -+ &forced_stmts, false, NULL); - if (forced_stmts) - { - tsi = tsi_start (forced_stmts); - - 0K . 1.24 MB/s - -13:16:54 (1.24 MB/s) - `-' saved [1303] - diff --git a/patches/gcc/4.0.0/pr21951.patch b/patches/gcc/4.0.0/pr21951.patch deleted file mode 100644 index 8c5ffb9..0000000 --- a/patches/gcc/4.0.0/pr21951.patch +++ /dev/null @@ -1,153 +0,0 @@ -Workaround for buglet in std::vector etc. when compiling -with gcc-4.0.0 -Wall -O -fno-exceptions -Fixes: - -.../include/c++/4.0.0/bits/vector.tcc: In member function 'void std::vector<_Tp, -_Alloc>::reserve(size_t) [with _Tp = int, _Alloc = std::allocator]': -.../include/c++/4.0.0/bits/vector.tcc:78: warning: control may reach end of -non-void function 'typename _Alloc::pointer std::vector<_Tp, -_Alloc>::_M_allocate_and_copy(size_t, _ForwardIterator, _ForwardIterator) [with -_ForwardIterator = int*, _Tp = int, _Alloc = std::allocator]' being inlined - -See http://gcc.gnu.org/PR21951 - ---- gcc-4.0.1-20050607/libstdc++-v3/include/bits/stl_vector.h.old 2005-06-11 03:58:20.000000000 -0700 -+++ gcc-4.0.1-20050607/libstdc++-v3/include/bits/stl_vector.h 2005-06-11 04:01:21.000000000 -0700 -@@ -765,13 +765,13 @@ - { - std::__uninitialized_copy_a(__first, __last, __result, - this->get_allocator()); -- return __result; - } - catch(...) - { - _M_deallocate(__result, __n); - __throw_exception_again; - } -+ return __result; - } - - ---- gcc-4.0.1-20050607/libstdc++-v3/include/bits/stl_uninitialized.h.old 2005-06-11 03:58:20.000000000 -0700 -+++ gcc-4.0.1-20050607/libstdc++-v3/include/bits/stl_uninitialized.h 2005-06-11 04:05:18.990003248 -0700 -@@ -84,13 +84,13 @@ - { - for (; __first != __last; ++__first, ++__cur) - std::_Construct(&*__cur, *__first); -- return __cur; - } - catch(...) - { - std::_Destroy(__result, __cur); - __throw_exception_again; - } -+ return __cur; - } - - /** -@@ -236,13 +236,13 @@ - { - for (; __first != __last; ++__first, ++__cur) - __alloc.construct(&*__cur, *__first); -- return __cur; - } - catch(...) - { - std::_Destroy(__result, __cur, __alloc); - __throw_exception_again; - } -+ return __cur; - } - - template -@@ -337,11 +337,13 @@ - { - return std::__uninitialized_copy_a(__first2, __last2, __mid, __alloc); - } -+#ifdef __EXCEPTIONS // work around http://gcc.gnu.org/PR21951 in gcc-4.0 only - catch(...) - { - std::_Destroy(__result, __mid, __alloc); - __throw_exception_again; - } -+#endif - } - - // __uninitialized_fill_copy -@@ -360,11 +362,13 @@ - { - return std::__uninitialized_copy_a(__first, __last, __mid, __alloc); - } -+#ifdef __EXCEPTIONS // work around http://gcc.gnu.org/PR21951 in gcc-4.0 only - catch(...) - { - std::_Destroy(__result, __mid, __alloc); - __throw_exception_again; - } -+#endif - } - - // __uninitialized_copy_fill ---- gcc-4.0.1-20050607/libstdc++-v3/include/ext/rope.old 2005-06-11 03:58:20.000000000 -0700 -+++ gcc-4.0.1-20050607/libstdc++-v3/include/ext/rope 2005-06-11 04:13:26.628870872 -0700 -@@ -1645,11 +1645,13 @@ - _S_cond_store_eos(__buf[__size]); - try - { return _S_new_RopeLeaf(__buf, __size, __a); } -+#ifdef __EXCEPTIONS // work around http://gcc.gnu.org/PR21951 in gcc-4.0 only - catch(...) - { - _RopeRep::__STL_FREE_STRING(__buf, __size, __a); - __throw_exception_again; - } -+#endif - } - - // Concatenation of nonempty strings. ---- gcc-4.0.1-20050607/libstdc++-v3/include/ext/memory.old 2005-06-11 03:58:20.000000000 -0700 -+++ gcc-4.0.1-20050607/libstdc++-v3/include/ext/memory 2005-06-11 04:13:52.897877376 -0700 -@@ -85,11 +85,13 @@ - std::_Construct(&*__cur, *__first); - return pair<_InputIter, _ForwardIter>(__first, __cur); - } -+#ifdef __EXCEPTIONS // work around http://gcc.gnu.org/PR21951 in gcc-4.0 only - catch(...) - { - std::_Destroy(__result, __cur); - __throw_exception_again; - } -+#endif - } - - template -@@ -144,11 +146,13 @@ - __alloc.construct(&*__cur, *__first); - return pair<_InputIter, _ForwardIter>(__first, __cur); - } -+#ifdef __EXCEPTIONS // work around http://gcc.gnu.org/PR21951 in gcc-4.0 only - catch(...) - { - std::_Destroy(__result, __cur, __alloc); - __throw_exception_again; - } -+#endif - } - - templateget_allocator().construct(&__n->_M_val, __obj); -- return __n; - } - catch(...) - { - _M_put_node(__n); - __throw_exception_again; - } -+ return __n; - } - - void diff --git a/patches/gcc/4.0.1/100-fix-fixincl.patch b/patches/gcc/4.0.1/100-fix-fixincl.patch new file mode 100644 index 0000000..8051f31 --- /dev/null +++ b/patches/gcc/4.0.1/100-fix-fixincl.patch @@ -0,0 +1,72 @@ +See http://gcc.gnu.org/PR22541 + +From: Dan Kegel + +When building gcc-3.4.3 or gcc-4.0.[01] into a clean $PREFIX (the only two I've tried like this), +the configure script happily copies the glibc include files from include to sys-include; +here's the line from the log file (with $PREFIX instead of the real prefix): + +Copying $PREFIX/i686-unknown-linux-gnu/include to $PREFIX/i686-unknown-linux-gnu/sys-include + +But later, when running fixincludes, it gives the error message + The directory that should contain system headers does not exist: + $PREFIX/lib/gcc/i686-unknown-linux-gnu/3.4.3/../../../../i686-unknown-linux-gnu/sys-include + +Nevertheless, it continues building; the header files it installs in + $PREFIX/lib/gcc/i686-unknown-linux-gnu/3.4.3/include +do not include the boilerplate that would cause it to #include_next the +glibc headers in the system header directory. +Thus the resulting toolchain can't compile the following program: +#include +int x = PATH_MAX; +because its limits.h doesn't include the glibc header. + +That's not nice. I suspect the problem is that gcc/Makefile.in assumes that +it can refer to $PREFIX/i686-unknown-linux-gnu with the path + $PREFIX/lib/../i686-unknown-linux-gnu, but +that fails because the directory $PREFIX/lib doesn't exist during 'make all'; +it is only created later, during 'make install'. (Which makes this problem +confusing, since one only notices the breakage well after 'make install', +at which point the path configure complained about does exist, and has the +right stuff in it.) + +A possible fix is to replace the line in gcc/Makefile.in that says + SYSTEM_HEADER_DIR = @SYSTEM_HEADER_DIR@ +with a version that gets rid of extra ..'s, e.g. + SYSTEM_HEADER_DIR = `echo @SYSTEM_HEADER_DIR@ | sed -e :a -e "s,[^/]*/\.\.\/,,;ta"` +(hey, that's the first time I've ever used a label in a sed script; thanks to the sed faq +for explaining the :a ... ta method of looping to repeat a search-and-replace until it doesn't match.) + +[rediffed against gcc-4.0.0] + +--- gcc-4.0.0/gcc/Makefile.in.orig 2005-04-04 12:45:13.000000000 -0700 ++++ gcc-4.0.0/gcc/Makefile.in 2005-05-20 12:33:43.000000000 -0700 +@@ -378,7 +378,10 @@ + CROSS_SYSTEM_HEADER_DIR = @CROSS_SYSTEM_HEADER_DIR@ + + # autoconf sets SYSTEM_HEADER_DIR to one of the above. +-SYSTEM_HEADER_DIR = @SYSTEM_HEADER_DIR@ ++# Purge it of unneccessary internal relative paths ++# to directories that might not exist yet. ++# The sed idiom for this is to repeat the search-and-replace until it doesn't match, using :a ... ta. ++SYSTEM_HEADER_DIR = `echo @SYSTEM_HEADER_DIR@ | sed -e :a -e "s,[^/]*/\.\.\/,," -e ta` + + # Control whether to run fixproto and fixincludes. + STMP_FIXPROTO = @STMP_FIXPROTO@ +@@ -2838,13 +2841,15 @@ + ../$(build_subdir)/fixincludes/fixincl: ; @ : + + # Build fixed copies of system files. ++# Abort if no system headers available, unless building a crosscompiler. ++# FIXME: abort unless building --without-headers would be more accurate and less ugly + stmp-fixinc: gsyslimits.h macro_list \ + ../$(build_subdir)/fixincludes/fixincl \ + ../$(build_subdir)/fixincludes/fixinc.sh + @if test ! -d ${SYSTEM_HEADER_DIR}; then \ + echo The directory that should contain system headers does not exist: >&2 ; \ + echo " ${SYSTEM_HEADER_DIR}" >&2 ; \ +- if test "x${SYSTEM_HEADER_DIR}" = "x${gcc_tooldir}/sys-include"; \ ++ if test "x${SYSTEM_HEADER_DIR}" = "x`echo "${gcc_tooldir}/sys-include" | sed -e :a -e "s,[^/]*/\.\.\/,," -e ta`"; \ + then sleep 1; else exit 1; fi; \ + fi + rm -rf include; mkdir include diff --git a/patches/gcc/4.0.1/110-pr20815-fix.patch b/patches/gcc/4.0.1/110-pr20815-fix.patch new file mode 100644 index 0000000..7ac8ab5 --- /dev/null +++ b/patches/gcc/4.0.1/110-pr20815-fix.patch @@ -0,0 +1,121 @@ +Date: 18 May 2005 22:47:59 -0000 +Message-ID: <20050518224759.7352.qmail@sourceware.org> +From: "hubicka at ucw dot cz" +To: dank@kegel.com +References: <20050407215701.20815.dank@kegel.com> +Reply-To: gcc-bugzilla@gcc.gnu.org +Subject: [Bug gcov/profile/20815] -fprofile-use barfs with "coverage mismatch for function '...' while reading counter 'arcs'." + + +------- Additional Comments From hubicka at ucw dot cz 2005-05-18 22:47 ------- +Subject: Re: [Bug gcov/profile/20815] -fprofile-use barfs with "coverage mismatch for function '...' while reading counter 'arcs'." + +> +> ------- Additional Comments From hubicka at ucw dot cz 2005-05-18 22:22 ------- +> Subject: Re: [Bug gcov/profile/20815] -fprofile-use barfs with "coverage mismatch for function '...' while reading counter 'arcs'." +> +> coverage_checksum_string already knows a bit about ignoring random seed +> produced mess. It looks like this needs to be extended somehow to +> handle namespaces too... + +This seems to solve the missmatch. Would it be possible to test it on +bigger testcase and if it works distile a testcase that don't use +file IO so it is more suitable for gcc regtesting? + +Index: coverage.c +=================================================================== +RCS file: /cvs/gcc/gcc/gcc/coverage.c,v +retrieving revision 1.6.2.12.2.12 +diff -c -3 -p -r1.6.2.12.2.12 coverage.c +*** gcc-old/gcc/coverage.c 18 May 2005 07:37:31 -0000 1.6.2.12.2.12 +--- gcc/gcc/coverage.c 18 May 2005 22:45:36 -0000 +*************** coverage_checksum_string (unsigned chksu +*** 471,505 **** + as the checksums are used only for sanity checking. */ + for (i = 0; string[i]; i++) + { + if (!strncmp (string + i, "_GLOBAL__", 9)) +! for (i = i + 9; string[i]; i++) +! if (string[i]=='_') +! { +! int y; +! unsigned seed; +! int scan; +! +! for (y = 1; y < 9; y++) +! if (!(string[i + y] >= '0' && string[i + y] <= '9') +! && !(string[i + y] >= 'A' && string[i + y] <= 'F')) +! break; +! if (y != 9 || string[i + 9] != '_') +! continue; +! for (y = 10; y < 18; y++) +! if (!(string[i + y] >= '0' && string[i + y] <= '9') +! && !(string[i + y] >= 'A' && string[i + y] <= 'F')) +! break; +! if (y != 18) +! continue; +! scan = sscanf (string + i + 10, "%X", &seed); +! gcc_assert (scan); +! if (seed != crc32_string (0, flag_random_seed)) +! continue; +! string = dup = xstrdup (string); +! for (y = 10; y < 18; y++) +! dup[i + y] = '0'; +! break; +! } + break; + } + +--- 471,511 ---- + as the checksums are used only for sanity checking. */ + for (i = 0; string[i]; i++) + { ++ int offset = 0; ++ if (!strncmp (string + i, "_GLOBAL__N_", 11)) ++ offset = 11; + if (!strncmp (string + i, "_GLOBAL__", 9)) +! offset = 9; +! +! /* C++ namespaces do have scheme: +! _GLOBAL__N___functionname +! since filename might contain extra underscores there seems +! to be no better chance then walk all possible offsets looking +! for magicnuber. */ +! if (offset) +! for (;string[offset]; offset++) +! for (i = i + offset; string[i]; i++) +! if (string[i]=='_') +! { +! int y; +! +! for (y = 1; y < 9; y++) +! if (!(string[i + y] >= '0' && string[i + y] <= '9') +! && !(string[i + y] >= 'A' && string[i + y] <= 'F')) +! break; +! if (y != 9 || string[i + 9] != '_') +! continue; +! for (y = 10; y < 18; y++) +! if (!(string[i + y] >= '0' && string[i + y] <= '9') +! && !(string[i + y] >= 'A' && string[i + y] <= 'F')) +! break; +! if (y != 18) +! continue; +! if (!dup) +! string = dup = xstrdup (string); +! for (y = 10; y < 18; y++) +! dup[i + y] = '0'; +! } + break; + } + + + +-- + + +http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20815 + +------- You are receiving this mail because: ------- +You reported the bug, or are watching the reporter. + + diff --git a/patches/gcc/4.0.1/120-pr21951-fix2.patch b/patches/gcc/4.0.1/120-pr21951-fix2.patch new file mode 100644 index 0000000..5e35a1e --- /dev/null +++ b/patches/gcc/4.0.1/120-pr21951-fix2.patch @@ -0,0 +1,71 @@ +Workaround for buglet in std::vector etc. when compiling +with gcc-4.0.1 -Wall -O -fno-exceptions +Fixes: + +.../include/c++/4.0.0/bits/vector.tcc: In member function 'void std::vector<_Tp, +_Alloc>::reserve(size_t) [with _Tp = int, _Alloc = std::allocator]': +.../include/c++/4.0.0/bits/vector.tcc:78: warning: control may reach end of +non-void function 'typename _Alloc::pointer std::vector<_Tp, +_Alloc>::_M_allocate_and_copy(size_t, _ForwardIterator, _ForwardIterator) [with +_ForwardIterator = int*, _Tp = int, _Alloc = std::allocator]' being inlined + +See http://gcc.gnu.org/PR21951 + +To: gcc-patches at gcc dot gnu dot org +Subject: [4.0.x] may reach end warning in system headers +Message-Id: <20050701183024.E138714C16A9@geoffk5.apple.com> +Date: Fri, 1 Jul 2005 11:30:24 -0700 (PDT) +From: gkeating at apple dot com (Geoffrey Keating) + + +One of our users was getting + +/usr/include/gcc/darwin/4.0/c++/bits/stl_uninitialized.h:113: warning: +control may reach end of non-void function '_ForwardIterator +std::__uninitialized_copy_aux(_InputIterator, _InputIterator, +_ForwardIterator, __false_type) [with _InputIterator = +__gnu_cxx::__normal_iterator > >, _ForwardIterator = +__gnu_cxx::__normal_iterator > >]' being inlined + +which shouldn't be happening, he has no way to change a standard C++ +header. The warning is bogus anyway, but it's fixed in 4.1 through +the CFG changes, which I don't really want to backport to the 4.0 +branch, so instead I'll add this patch. Other warnings generated from +tree-inline.c check for DECL_SYSTEM_HEADER like this. + +Bootstrapped & tested on powerpc-darwin8, I'll commit when the branch +is unfrozen. + +-- +- Geoffrey Keating + +===File ~/patches/gcc-40-4121982.patch====================== +Index: ChangeLog +2005-06-28 Geoffrey Keating + + * tree-inline.c (expand_call_inline): Prevent 'may reach end' + warning in system headers. + +Index: tree-inline.c +=================================================================== +RCS file: /cvs/gcc/gcc/gcc/tree-inline.c,v +retrieving revision 1.170.8.4 +diff -u -p -u -p -r1.170.8.4 tree-inline.c +--- gcc-4.0.1/gcc/tree-inline.c.old 6 Jun 2005 19:20:32 -0000 1.170.8.4 ++++ gcc-4.0.1/gcc/tree-inline.c 1 Jul 2005 18:27:26 -0000 +@@ -1693,7 +1693,8 @@ expand_call_inline (tree *tp, int *walk_ + && !TREE_NO_WARNING (fn) + && !VOID_TYPE_P (TREE_TYPE (TREE_TYPE (fn))) + && return_slot_addr == NULL_TREE +- && block_may_fallthru (copy)) ++ && block_may_fallthru (copy) ++ && !DECL_IN_SYSTEM_HEADER (fn)) + { + warning ("control may reach end of non-void function %qD being inlined", + fn); +============================================================ + diff --git a/patches/gcc/4.0.1/fix-fixincl.patch b/patches/gcc/4.0.1/fix-fixincl.patch deleted file mode 100644 index 8051f31..0000000 --- a/patches/gcc/4.0.1/fix-fixincl.patch +++ /dev/null @@ -1,72 +0,0 @@ -See http://gcc.gnu.org/PR22541 - -From: Dan Kegel - -When building gcc-3.4.3 or gcc-4.0.[01] into a clean $PREFIX (the only two I've tried like this), -the configure script happily copies the glibc include files from include to sys-include; -here's the line from the log file (with $PREFIX instead of the real prefix): - -Copying $PREFIX/i686-unknown-linux-gnu/include to $PREFIX/i686-unknown-linux-gnu/sys-include - -But later, when running fixincludes, it gives the error message - The directory that should contain system headers does not exist: - $PREFIX/lib/gcc/i686-unknown-linux-gnu/3.4.3/../../../../i686-unknown-linux-gnu/sys-include - -Nevertheless, it continues building; the header files it installs in - $PREFIX/lib/gcc/i686-unknown-linux-gnu/3.4.3/include -do not include the boilerplate that would cause it to #include_next the -glibc headers in the system header directory. -Thus the resulting toolchain can't compile the following program: -#include -int x = PATH_MAX; -because its limits.h doesn't include the glibc header. - -That's not nice. I suspect the problem is that gcc/Makefile.in assumes that -it can refer to $PREFIX/i686-unknown-linux-gnu with the path - $PREFIX/lib/../i686-unknown-linux-gnu, but -that fails because the directory $PREFIX/lib doesn't exist during 'make all'; -it is only created later, during 'make install'. (Which makes this problem -confusing, since one only notices the breakage well after 'make install', -at which point the path configure complained about does exist, and has the -right stuff in it.) - -A possible fix is to replace the line in gcc/Makefile.in that says - SYSTEM_HEADER_DIR = @SYSTEM_HEADER_DIR@ -with a version that gets rid of extra ..'s, e.g. - SYSTEM_HEADER_DIR = `echo @SYSTEM_HEADER_DIR@ | sed -e :a -e "s,[^/]*/\.\.\/,,;ta"` -(hey, that's the first time I've ever used a label in a sed script; thanks to the sed faq -for explaining the :a ... ta method of looping to repeat a search-and-replace until it doesn't match.) - -[rediffed against gcc-4.0.0] - ---- gcc-4.0.0/gcc/Makefile.in.orig 2005-04-04 12:45:13.000000000 -0700 -+++ gcc-4.0.0/gcc/Makefile.in 2005-05-20 12:33:43.000000000 -0700 -@@ -378,7 +378,10 @@ - CROSS_SYSTEM_HEADER_DIR = @CROSS_SYSTEM_HEADER_DIR@ - - # autoconf sets SYSTEM_HEADER_DIR to one of the above. --SYSTEM_HEADER_DIR = @SYSTEM_HEADER_DIR@ -+# Purge it of unneccessary internal relative paths -+# to directories that might not exist yet. -+# The sed idiom for this is to repeat the search-and-replace until it doesn't match, using :a ... ta. -+SYSTEM_HEADER_DIR = `echo @SYSTEM_HEADER_DIR@ | sed -e :a -e "s,[^/]*/\.\.\/,," -e ta` - - # Control whether to run fixproto and fixincludes. - STMP_FIXPROTO = @STMP_FIXPROTO@ -@@ -2838,13 +2841,15 @@ - ../$(build_subdir)/fixincludes/fixincl: ; @ : - - # Build fixed copies of system files. -+# Abort if no system headers available, unless building a crosscompiler. -+# FIXME: abort unless building --without-headers would be more accurate and less ugly - stmp-fixinc: gsyslimits.h macro_list \ - ../$(build_subdir)/fixincludes/fixincl \ - ../$(build_subdir)/fixincludes/fixinc.sh - @if test ! -d ${SYSTEM_HEADER_DIR}; then \ - echo The directory that should contain system headers does not exist: >&2 ; \ - echo " ${SYSTEM_HEADER_DIR}" >&2 ; \ -- if test "x${SYSTEM_HEADER_DIR}" = "x${gcc_tooldir}/sys-include"; \ -+ if test "x${SYSTEM_HEADER_DIR}" = "x`echo "${gcc_tooldir}/sys-include" | sed -e :a -e "s,[^/]*/\.\.\/,," -e ta`"; \ - then sleep 1; else exit 1; fi; \ - fi - rm -rf include; mkdir include diff --git a/patches/gcc/4.0.1/pr20815-fix.patch b/patches/gcc/4.0.1/pr20815-fix.patch deleted file mode 100644 index 7ac8ab5..0000000 --- a/patches/gcc/4.0.1/pr20815-fix.patch +++ /dev/null @@ -1,121 +0,0 @@ -Date: 18 May 2005 22:47:59 -0000 -Message-ID: <20050518224759.7352.qmail@sourceware.org> -From: "hubicka at ucw dot cz" -To: dank@kegel.com -References: <20050407215701.20815.dank@kegel.com> -Reply-To: gcc-bugzilla@gcc.gnu.org -Subject: [Bug gcov/profile/20815] -fprofile-use barfs with "coverage mismatch for function '...' while reading counter 'arcs'." - - -------- Additional Comments From hubicka at ucw dot cz 2005-05-18 22:47 ------- -Subject: Re: [Bug gcov/profile/20815] -fprofile-use barfs with "coverage mismatch for function '...' while reading counter 'arcs'." - -> -> ------- Additional Comments From hubicka at ucw dot cz 2005-05-18 22:22 ------- -> Subject: Re: [Bug gcov/profile/20815] -fprofile-use barfs with "coverage mismatch for function '...' while reading counter 'arcs'." -> -> coverage_checksum_string already knows a bit about ignoring random seed -> produced mess. It looks like this needs to be extended somehow to -> handle namespaces too... - -This seems to solve the missmatch. Would it be possible to test it on -bigger testcase and if it works distile a testcase that don't use -file IO so it is more suitable for gcc regtesting? - -Index: coverage.c -=================================================================== -RCS file: /cvs/gcc/gcc/gcc/coverage.c,v -retrieving revision 1.6.2.12.2.12 -diff -c -3 -p -r1.6.2.12.2.12 coverage.c -*** gcc-old/gcc/coverage.c 18 May 2005 07:37:31 -0000 1.6.2.12.2.12 ---- gcc/gcc/coverage.c 18 May 2005 22:45:36 -0000 -*************** coverage_checksum_string (unsigned chksu -*** 471,505 **** - as the checksums are used only for sanity checking. */ - for (i = 0; string[i]; i++) - { - if (!strncmp (string + i, "_GLOBAL__", 9)) -! for (i = i + 9; string[i]; i++) -! if (string[i]=='_') -! { -! int y; -! unsigned seed; -! int scan; -! -! for (y = 1; y < 9; y++) -! if (!(string[i + y] >= '0' && string[i + y] <= '9') -! && !(string[i + y] >= 'A' && string[i + y] <= 'F')) -! break; -! if (y != 9 || string[i + 9] != '_') -! continue; -! for (y = 10; y < 18; y++) -! if (!(string[i + y] >= '0' && string[i + y] <= '9') -! && !(string[i + y] >= 'A' && string[i + y] <= 'F')) -! break; -! if (y != 18) -! continue; -! scan = sscanf (string + i + 10, "%X", &seed); -! gcc_assert (scan); -! if (seed != crc32_string (0, flag_random_seed)) -! continue; -! string = dup = xstrdup (string); -! for (y = 10; y < 18; y++) -! dup[i + y] = '0'; -! break; -! } - break; - } - ---- 471,511 ---- - as the checksums are used only for sanity checking. */ - for (i = 0; string[i]; i++) - { -+ int offset = 0; -+ if (!strncmp (string + i, "_GLOBAL__N_", 11)) -+ offset = 11; - if (!strncmp (string + i, "_GLOBAL__", 9)) -! offset = 9; -! -! /* C++ namespaces do have scheme: -! _GLOBAL__N___functionname -! since filename might contain extra underscores there seems -! to be no better chance then walk all possible offsets looking -! for magicnuber. */ -! if (offset) -! for (;string[offset]; offset++) -! for (i = i + offset; string[i]; i++) -! if (string[i]=='_') -! { -! int y; -! -! for (y = 1; y < 9; y++) -! if (!(string[i + y] >= '0' && string[i + y] <= '9') -! && !(string[i + y] >= 'A' && string[i + y] <= 'F')) -! break; -! if (y != 9 || string[i + 9] != '_') -! continue; -! for (y = 10; y < 18; y++) -! if (!(string[i + y] >= '0' && string[i + y] <= '9') -! && !(string[i + y] >= 'A' && string[i + y] <= 'F')) -! break; -! if (y != 18) -! continue; -! if (!dup) -! string = dup = xstrdup (string); -! for (y = 10; y < 18; y++) -! dup[i + y] = '0'; -! } - break; - } - - - --- - - -http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20815 - -------- You are receiving this mail because: ------- -You reported the bug, or are watching the reporter. - - diff --git a/patches/gcc/4.0.1/pr21951-fix2.patch b/patches/gcc/4.0.1/pr21951-fix2.patch deleted file mode 100644 index 5e35a1e..0000000 --- a/patches/gcc/4.0.1/pr21951-fix2.patch +++ /dev/null @@ -1,71 +0,0 @@ -Workaround for buglet in std::vector etc. when compiling -with gcc-4.0.1 -Wall -O -fno-exceptions -Fixes: - -.../include/c++/4.0.0/bits/vector.tcc: In member function 'void std::vector<_Tp, -_Alloc>::reserve(size_t) [with _Tp = int, _Alloc = std::allocator]': -.../include/c++/4.0.0/bits/vector.tcc:78: warning: control may reach end of -non-void function 'typename _Alloc::pointer std::vector<_Tp, -_Alloc>::_M_allocate_and_copy(size_t, _ForwardIterator, _ForwardIterator) [with -_ForwardIterator = int*, _Tp = int, _Alloc = std::allocator]' being inlined - -See http://gcc.gnu.org/PR21951 - -To: gcc-patches at gcc dot gnu dot org -Subject: [4.0.x] may reach end warning in system headers -Message-Id: <20050701183024.E138714C16A9@geoffk5.apple.com> -Date: Fri, 1 Jul 2005 11:30:24 -0700 (PDT) -From: gkeating at apple dot com (Geoffrey Keating) - - -One of our users was getting - -/usr/include/gcc/darwin/4.0/c++/bits/stl_uninitialized.h:113: warning: -control may reach end of non-void function '_ForwardIterator -std::__uninitialized_copy_aux(_InputIterator, _InputIterator, -_ForwardIterator, __false_type) [with _InputIterator = -__gnu_cxx::__normal_iterator > >, _ForwardIterator = -__gnu_cxx::__normal_iterator > >]' being inlined - -which shouldn't be happening, he has no way to change a standard C++ -header. The warning is bogus anyway, but it's fixed in 4.1 through -the CFG changes, which I don't really want to backport to the 4.0 -branch, so instead I'll add this patch. Other warnings generated from -tree-inline.c check for DECL_SYSTEM_HEADER like this. - -Bootstrapped & tested on powerpc-darwin8, I'll commit when the branch -is unfrozen. - --- -- Geoffrey Keating - -===File ~/patches/gcc-40-4121982.patch====================== -Index: ChangeLog -2005-06-28 Geoffrey Keating - - * tree-inline.c (expand_call_inline): Prevent 'may reach end' - warning in system headers. - -Index: tree-inline.c -=================================================================== -RCS file: /cvs/gcc/gcc/gcc/tree-inline.c,v -retrieving revision 1.170.8.4 -diff -u -p -u -p -r1.170.8.4 tree-inline.c ---- gcc-4.0.1/gcc/tree-inline.c.old 6 Jun 2005 19:20:32 -0000 1.170.8.4 -+++ gcc-4.0.1/gcc/tree-inline.c 1 Jul 2005 18:27:26 -0000 -@@ -1693,7 +1693,8 @@ expand_call_inline (tree *tp, int *walk_ - && !TREE_NO_WARNING (fn) - && !VOID_TYPE_P (TREE_TYPE (TREE_TYPE (fn))) - && return_slot_addr == NULL_TREE -- && block_may_fallthru (copy)) -+ && block_may_fallthru (copy) -+ && !DECL_IN_SYSTEM_HEADER (fn)) - { - warning ("control may reach end of non-void function %qD being inlined", - fn); -============================================================ - diff --git a/patches/gcc/4.0.2/100-fix-fixincl.patch b/patches/gcc/4.0.2/100-fix-fixincl.patch new file mode 100644 index 0000000..8051f31 --- /dev/null +++ b/patches/gcc/4.0.2/100-fix-fixincl.patch @@ -0,0 +1,72 @@ +See http://gcc.gnu.org/PR22541 + +From: Dan Kegel + +When building gcc-3.4.3 or gcc-4.0.[01] into a clean $PREFIX (the only two I've tried like this), +the configure script happily copies the glibc include files from include to sys-include; +here's the line from the log file (with $PREFIX instead of the real prefix): + +Copying $PREFIX/i686-unknown-linux-gnu/include to $PREFIX/i686-unknown-linux-gnu/sys-include + +But later, when running fixincludes, it gives the error message + The directory that should contain system headers does not exist: + $PREFIX/lib/gcc/i686-unknown-linux-gnu/3.4.3/../../../../i686-unknown-linux-gnu/sys-include + +Nevertheless, it continues building; the header files it installs in + $PREFIX/lib/gcc/i686-unknown-linux-gnu/3.4.3/include +do not include the boilerplate that would cause it to #include_next the +glibc headers in the system header directory. +Thus the resulting toolchain can't compile the following program: +#include +int x = PATH_MAX; +because its limits.h doesn't include the glibc header. + +That's not nice. I suspect the problem is that gcc/Makefile.in assumes that +it can refer to $PREFIX/i686-unknown-linux-gnu with the path + $PREFIX/lib/../i686-unknown-linux-gnu, but +that fails because the directory $PREFIX/lib doesn't exist during 'make all'; +it is only created later, during 'make install'. (Which makes this problem +confusing, since one only notices the breakage well after 'make install', +at which point the path configure complained about does exist, and has the +right stuff in it.) + +A possible fix is to replace the line in gcc/Makefile.in that says + SYSTEM_HEADER_DIR = @SYSTEM_HEADER_DIR@ +with a version that gets rid of extra ..'s, e.g. + SYSTEM_HEADER_DIR = `echo @SYSTEM_HEADER_DIR@ | sed -e :a -e "s,[^/]*/\.\.\/,,;ta"` +(hey, that's the first time I've ever used a label in a sed script; thanks to the sed faq +for explaining the :a ... ta method of looping to repeat a search-and-replace until it doesn't match.) + +[rediffed against gcc-4.0.0] + +--- gcc-4.0.0/gcc/Makefile.in.orig 2005-04-04 12:45:13.000000000 -0700 ++++ gcc-4.0.0/gcc/Makefile.in 2005-05-20 12:33:43.000000000 -0700 +@@ -378,7 +378,10 @@ + CROSS_SYSTEM_HEADER_DIR = @CROSS_SYSTEM_HEADER_DIR@ + + # autoconf sets SYSTEM_HEADER_DIR to one of the above. +-SYSTEM_HEADER_DIR = @SYSTEM_HEADER_DIR@ ++# Purge it of unneccessary internal relative paths ++# to directories that might not exist yet. ++# The sed idiom for this is to repeat the search-and-replace until it doesn't match, using :a ... ta. ++SYSTEM_HEADER_DIR = `echo @SYSTEM_HEADER_DIR@ | sed -e :a -e "s,[^/]*/\.\.\/,," -e ta` + + # Control whether to run fixproto and fixincludes. + STMP_FIXPROTO = @STMP_FIXPROTO@ +@@ -2838,13 +2841,15 @@ + ../$(build_subdir)/fixincludes/fixincl: ; @ : + + # Build fixed copies of system files. ++# Abort if no system headers available, unless building a crosscompiler. ++# FIXME: abort unless building --without-headers would be more accurate and less ugly + stmp-fixinc: gsyslimits.h macro_list \ + ../$(build_subdir)/fixincludes/fixincl \ + ../$(build_subdir)/fixincludes/fixinc.sh + @if test ! -d ${SYSTEM_HEADER_DIR}; then \ + echo The directory that should contain system headers does not exist: >&2 ; \ + echo " ${SYSTEM_HEADER_DIR}" >&2 ; \ +- if test "x${SYSTEM_HEADER_DIR}" = "x${gcc_tooldir}/sys-include"; \ ++ if test "x${SYSTEM_HEADER_DIR}" = "x`echo "${gcc_tooldir}/sys-include" | sed -e :a -e "s,[^/]*/\.\.\/,," -e ta`"; \ + then sleep 1; else exit 1; fi; \ + fi + rm -rf include; mkdir include diff --git a/patches/gcc/4.0.2/110-pr20815-fix.patch b/patches/gcc/4.0.2/110-pr20815-fix.patch new file mode 100644 index 0000000..7ac8ab5 --- /dev/null +++ b/patches/gcc/4.0.2/110-pr20815-fix.patch @@ -0,0 +1,121 @@ +Date: 18 May 2005 22:47:59 -0000 +Message-ID: <20050518224759.7352.qmail@sourceware.org> +From: "hubicka at ucw dot cz" +To: dank@kegel.com +References: <20050407215701.20815.dank@kegel.com> +Reply-To: gcc-bugzilla@gcc.gnu.org +Subject: [Bug gcov/profile/20815] -fprofile-use barfs with "coverage mismatch for function '...' while reading counter 'arcs'." + + +------- Additional Comments From hubicka at ucw dot cz 2005-05-18 22:47 ------- +Subject: Re: [Bug gcov/profile/20815] -fprofile-use barfs with "coverage mismatch for function '...' while reading counter 'arcs'." + +> +> ------- Additional Comments From hubicka at ucw dot cz 2005-05-18 22:22 ------- +> Subject: Re: [Bug gcov/profile/20815] -fprofile-use barfs with "coverage mismatch for function '...' while reading counter 'arcs'." +> +> coverage_checksum_string already knows a bit about ignoring random seed +> produced mess. It looks like this needs to be extended somehow to +> handle namespaces too... + +This seems to solve the missmatch. Would it be possible to test it on +bigger testcase and if it works distile a testcase that don't use +file IO so it is more suitable for gcc regtesting? + +Index: coverage.c +=================================================================== +RCS file: /cvs/gcc/gcc/gcc/coverage.c,v +retrieving revision 1.6.2.12.2.12 +diff -c -3 -p -r1.6.2.12.2.12 coverage.c +*** gcc-old/gcc/coverage.c 18 May 2005 07:37:31 -0000 1.6.2.12.2.12 +--- gcc/gcc/coverage.c 18 May 2005 22:45:36 -0000 +*************** coverage_checksum_string (unsigned chksu +*** 471,505 **** + as the checksums are used only for sanity checking. */ + for (i = 0; string[i]; i++) + { + if (!strncmp (string + i, "_GLOBAL__", 9)) +! for (i = i + 9; string[i]; i++) +! if (string[i]=='_') +! { +! int y; +! unsigned seed; +! int scan; +! +! for (y = 1; y < 9; y++) +! if (!(string[i + y] >= '0' && string[i + y] <= '9') +! && !(string[i + y] >= 'A' && string[i + y] <= 'F')) +! break; +! if (y != 9 || string[i + 9] != '_') +! continue; +! for (y = 10; y < 18; y++) +! if (!(string[i + y] >= '0' && string[i + y] <= '9') +! && !(string[i + y] >= 'A' && string[i + y] <= 'F')) +! break; +! if (y != 18) +! continue; +! scan = sscanf (string + i + 10, "%X", &seed); +! gcc_assert (scan); +! if (seed != crc32_string (0, flag_random_seed)) +! continue; +! string = dup = xstrdup (string); +! for (y = 10; y < 18; y++) +! dup[i + y] = '0'; +! break; +! } + break; + } + +--- 471,511 ---- + as the checksums are used only for sanity checking. */ + for (i = 0; string[i]; i++) + { ++ int offset = 0; ++ if (!strncmp (string + i, "_GLOBAL__N_", 11)) ++ offset = 11; + if (!strncmp (string + i, "_GLOBAL__", 9)) +! offset = 9; +! +! /* C++ namespaces do have scheme: +! _GLOBAL__N___functionname +! since filename might contain extra underscores there seems +! to be no better chance then walk all possible offsets looking +! for magicnuber. */ +! if (offset) +! for (;string[offset]; offset++) +! for (i = i + offset; string[i]; i++) +! if (string[i]=='_') +! { +! int y; +! +! for (y = 1; y < 9; y++) +! if (!(string[i + y] >= '0' && string[i + y] <= '9') +! && !(string[i + y] >= 'A' && string[i + y] <= 'F')) +! break; +! if (y != 9 || string[i + 9] != '_') +! continue; +! for (y = 10; y < 18; y++) +! if (!(string[i + y] >= '0' && string[i + y] <= '9') +! && !(string[i + y] >= 'A' && string[i + y] <= 'F')) +! break; +! if (y != 18) +! continue; +! if (!dup) +! string = dup = xstrdup (string); +! for (y = 10; y < 18; y++) +! dup[i + y] = '0'; +! } + break; + } + + + +-- + + +http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20815 + +------- You are receiving this mail because: ------- +You reported the bug, or are watching the reporter. + + diff --git a/patches/gcc/4.0.2/120-pr21623-workaround.patch b/patches/gcc/4.0.2/120-pr21623-workaround.patch new file mode 100644 index 0000000..90453fb --- /dev/null +++ b/patches/gcc/4.0.2/120-pr21623-workaround.patch @@ -0,0 +1,53 @@ +Message-ID: <434576E1.6020305@sscd.de> +Date: Thu, 06 Oct 2005 21:11:29 +0200 +From: Alexander Sieb +To: crossgcc@sourceware.org +Subject: Crosstool sh4-linux-gcc-4.0.2-glibc-2.3.5 patches + +Hi, + +attached you find the files I needed to add to crosstool-0.38 +in order to build a sh4-linux gcc-4.0.2-glibc-2.3.5 tool chain. + +Files attached: + +sh4-gcc4.dat: + * gcc4 needs --with-multilib-list=m4,m4-nofpu otherwise a linux + kernel won't build as it uses the -m4-nofpu option. + +gcc-pr21623.patch: + * Kaz Kojima provided a patch [really, a workaround -dank] for http://gcc.gnu.org/PR21623 + +glibc-2.3.5-sh-memset.patch: + * A patch for glibc-2.3.5 which corrects memset. From SUGIOKA Toshinobu. + See content for rationale. + +-- snip -- + +-- Here's patch 1 of 2, plus URLs showing where it is in CVS -- + +[http://gcc.gnu.org/ml/gcc-cvs/2005-10/msg00081.html] + +2005-09-30 Kaz Kojima + + * config/sh/sh.c (sh_register_move_cost): Add case for moving + from T_REGS to FP register class. + +[http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/config/sh/sh.c.diff?cvsroot=gcc&r1=1.347&r2=1.348] + +RCS file: /cvs/gcc/gcc/gcc/config/sh/sh.c,v +retrieving revision 1.347 +retrieving revision 1.348 +diff -u -r1.347 -r1.348 +--- gcc/gcc/config/sh/sh.c 2005/09/05 12:45:22 1.347 ++++ gcc/gcc/config/sh/sh.c 2005/10/03 22:07:08 1.348 +@@ -9491,6 +9491,9 @@ sh_register_move_cost (enum machine_mode + && REGCLASS_HAS_FP_REG (dstclass)) + return 4; + ++ if (REGCLASS_HAS_FP_REG (dstclass) && srcclass == T_REGS) ++ return ((TARGET_HARD_SH4 && !optimize_size) ? 10 : 7); ++ + if ((REGCLASS_HAS_FP_REG (dstclass) && srcclass == MAC_REGS) + || (dstclass == MAC_REGS && REGCLASS_HAS_FP_REG (srcclass))) + return 9; diff --git a/patches/gcc/4.0.2/fix-fixincl.patch b/patches/gcc/4.0.2/fix-fixincl.patch deleted file mode 100644 index 8051f31..0000000 --- a/patches/gcc/4.0.2/fix-fixincl.patch +++ /dev/null @@ -1,72 +0,0 @@ -See http://gcc.gnu.org/PR22541 - -From: Dan Kegel - -When building gcc-3.4.3 or gcc-4.0.[01] into a clean $PREFIX (the only two I've tried like this), -the configure script happily copies the glibc include files from include to sys-include; -here's the line from the log file (with $PREFIX instead of the real prefix): - -Copying $PREFIX/i686-unknown-linux-gnu/include to $PREFIX/i686-unknown-linux-gnu/sys-include - -But later, when running fixincludes, it gives the error message - The directory that should contain system headers does not exist: - $PREFIX/lib/gcc/i686-unknown-linux-gnu/3.4.3/../../../../i686-unknown-linux-gnu/sys-include - -Nevertheless, it continues building; the header files it installs in - $PREFIX/lib/gcc/i686-unknown-linux-gnu/3.4.3/include -do not include the boilerplate that would cause it to #include_next the -glibc headers in the system header directory. -Thus the resulting toolchain can't compile the following program: -#include -int x = PATH_MAX; -because its limits.h doesn't include the glibc header. - -That's not nice. I suspect the problem is that gcc/Makefile.in assumes that -it can refer to $PREFIX/i686-unknown-linux-gnu with the path - $PREFIX/lib/../i686-unknown-linux-gnu, but -that fails because the directory $PREFIX/lib doesn't exist during 'make all'; -it is only created later, during 'make install'. (Which makes this problem -confusing, since one only notices the breakage well after 'make install', -at which point the path configure complained about does exist, and has the -right stuff in it.) - -A possible fix is to replace the line in gcc/Makefile.in that says - SYSTEM_HEADER_DIR = @SYSTEM_HEADER_DIR@ -with a version that gets rid of extra ..'s, e.g. - SYSTEM_HEADER_DIR = `echo @SYSTEM_HEADER_DIR@ | sed -e :a -e "s,[^/]*/\.\.\/,,;ta"` -(hey, that's the first time I've ever used a label in a sed script; thanks to the sed faq -for explaining the :a ... ta method of looping to repeat a search-and-replace until it doesn't match.) - -[rediffed against gcc-4.0.0] - ---- gcc-4.0.0/gcc/Makefile.in.orig 2005-04-04 12:45:13.000000000 -0700 -+++ gcc-4.0.0/gcc/Makefile.in 2005-05-20 12:33:43.000000000 -0700 -@@ -378,7 +378,10 @@ - CROSS_SYSTEM_HEADER_DIR = @CROSS_SYSTEM_HEADER_DIR@ - - # autoconf sets SYSTEM_HEADER_DIR to one of the above. --SYSTEM_HEADER_DIR = @SYSTEM_HEADER_DIR@ -+# Purge it of unneccessary internal relative paths -+# to directories that might not exist yet. -+# The sed idiom for this is to repeat the search-and-replace until it doesn't match, using :a ... ta. -+SYSTEM_HEADER_DIR = `echo @SYSTEM_HEADER_DIR@ | sed -e :a -e "s,[^/]*/\.\.\/,," -e ta` - - # Control whether to run fixproto and fixincludes. - STMP_FIXPROTO = @STMP_FIXPROTO@ -@@ -2838,13 +2841,15 @@ - ../$(build_subdir)/fixincludes/fixincl: ; @ : - - # Build fixed copies of system files. -+# Abort if no system headers available, unless building a crosscompiler. -+# FIXME: abort unless building --without-headers would be more accurate and less ugly - stmp-fixinc: gsyslimits.h macro_list \ - ../$(build_subdir)/fixincludes/fixincl \ - ../$(build_subdir)/fixincludes/fixinc.sh - @if test ! -d ${SYSTEM_HEADER_DIR}; then \ - echo The directory that should contain system headers does not exist: >&2 ; \ - echo " ${SYSTEM_HEADER_DIR}" >&2 ; \ -- if test "x${SYSTEM_HEADER_DIR}" = "x${gcc_tooldir}/sys-include"; \ -+ if test "x${SYSTEM_HEADER_DIR}" = "x`echo "${gcc_tooldir}/sys-include" | sed -e :a -e "s,[^/]*/\.\.\/,," -e ta`"; \ - then sleep 1; else exit 1; fi; \ - fi - rm -rf include; mkdir include diff --git a/patches/gcc/4.0.2/pr20815-fix.patch b/patches/gcc/4.0.2/pr20815-fix.patch deleted file mode 100644 index 7ac8ab5..0000000 --- a/patches/gcc/4.0.2/pr20815-fix.patch +++ /dev/null @@ -1,121 +0,0 @@ -Date: 18 May 2005 22:47:59 -0000 -Message-ID: <20050518224759.7352.qmail@sourceware.org> -From: "hubicka at ucw dot cz" -To: dank@kegel.com -References: <20050407215701.20815.dank@kegel.com> -Reply-To: gcc-bugzilla@gcc.gnu.org -Subject: [Bug gcov/profile/20815] -fprofile-use barfs with "coverage mismatch for function '...' while reading counter 'arcs'." - - -------- Additional Comments From hubicka at ucw dot cz 2005-05-18 22:47 ------- -Subject: Re: [Bug gcov/profile/20815] -fprofile-use barfs with "coverage mismatch for function '...' while reading counter 'arcs'." - -> -> ------- Additional Comments From hubicka at ucw dot cz 2005-05-18 22:22 ------- -> Subject: Re: [Bug gcov/profile/20815] -fprofile-use barfs with "coverage mismatch for function '...' while reading counter 'arcs'." -> -> coverage_checksum_string already knows a bit about ignoring random seed -> produced mess. It looks like this needs to be extended somehow to -> handle namespaces too... - -This seems to solve the missmatch. Would it be possible to test it on -bigger testcase and if it works distile a testcase that don't use -file IO so it is more suitable for gcc regtesting? - -Index: coverage.c -=================================================================== -RCS file: /cvs/gcc/gcc/gcc/coverage.c,v -retrieving revision 1.6.2.12.2.12 -diff -c -3 -p -r1.6.2.12.2.12 coverage.c -*** gcc-old/gcc/coverage.c 18 May 2005 07:37:31 -0000 1.6.2.12.2.12 ---- gcc/gcc/coverage.c 18 May 2005 22:45:36 -0000 -*************** coverage_checksum_string (unsigned chksu -*** 471,505 **** - as the checksums are used only for sanity checking. */ - for (i = 0; string[i]; i++) - { - if (!strncmp (string + i, "_GLOBAL__", 9)) -! for (i = i + 9; string[i]; i++) -! if (string[i]=='_') -! { -! int y; -! unsigned seed; -! int scan; -! -! for (y = 1; y < 9; y++) -! if (!(string[i + y] >= '0' && string[i + y] <= '9') -! && !(string[i + y] >= 'A' && string[i + y] <= 'F')) -! break; -! if (y != 9 || string[i + 9] != '_') -! continue; -! for (y = 10; y < 18; y++) -! if (!(string[i + y] >= '0' && string[i + y] <= '9') -! && !(string[i + y] >= 'A' && string[i + y] <= 'F')) -! break; -! if (y != 18) -! continue; -! scan = sscanf (string + i + 10, "%X", &seed); -! gcc_assert (scan); -! if (seed != crc32_string (0, flag_random_seed)) -! continue; -! string = dup = xstrdup (string); -! for (y = 10; y < 18; y++) -! dup[i + y] = '0'; -! break; -! } - break; - } - ---- 471,511 ---- - as the checksums are used only for sanity checking. */ - for (i = 0; string[i]; i++) - { -+ int offset = 0; -+ if (!strncmp (string + i, "_GLOBAL__N_", 11)) -+ offset = 11; - if (!strncmp (string + i, "_GLOBAL__", 9)) -! offset = 9; -! -! /* C++ namespaces do have scheme: -! _GLOBAL__N___functionname -! since filename might contain extra underscores there seems -! to be no better chance then walk all possible offsets looking -! for magicnuber. */ -! if (offset) -! for (;string[offset]; offset++) -! for (i = i + offset; string[i]; i++) -! if (string[i]=='_') -! { -! int y; -! -! for (y = 1; y < 9; y++) -! if (!(string[i + y] >= '0' && string[i + y] <= '9') -! && !(string[i + y] >= 'A' && string[i + y] <= 'F')) -! break; -! if (y != 9 || string[i + 9] != '_') -! continue; -! for (y = 10; y < 18; y++) -! if (!(string[i + y] >= '0' && string[i + y] <= '9') -! && !(string[i + y] >= 'A' && string[i + y] <= 'F')) -! break; -! if (y != 18) -! continue; -! if (!dup) -! string = dup = xstrdup (string); -! for (y = 10; y < 18; y++) -! dup[i + y] = '0'; -! } - break; - } - - - --- - - -http://gcc.gnu.org/bugzilla/show_bug.cgi?id=20815 - -------- You are receiving this mail because: ------- -You reported the bug, or are watching the reporter. - - diff --git a/patches/gcc/4.0.2/pr21623-workaround.patch b/patches/gcc/4.0.2/pr21623-workaround.patch deleted file mode 100644 index 90453fb..0000000 --- a/patches/gcc/4.0.2/pr21623-workaround.patch +++ /dev/null @@ -1,53 +0,0 @@ -Message-ID: <434576E1.6020305@sscd.de> -Date: Thu, 06 Oct 2005 21:11:29 +0200 -From: Alexander Sieb -To: crossgcc@sourceware.org -Subject: Crosstool sh4-linux-gcc-4.0.2-glibc-2.3.5 patches - -Hi, - -attached you find the files I needed to add to crosstool-0.38 -in order to build a sh4-linux gcc-4.0.2-glibc-2.3.5 tool chain. - -Files attached: - -sh4-gcc4.dat: - * gcc4 needs --with-multilib-list=m4,m4-nofpu otherwise a linux - kernel won't build as it uses the -m4-nofpu option. - -gcc-pr21623.patch: - * Kaz Kojima provided a patch [really, a workaround -dank] for http://gcc.gnu.org/PR21623 - -glibc-2.3.5-sh-memset.patch: - * A patch for glibc-2.3.5 which corrects memset. From SUGIOKA Toshinobu. - See content for rationale. - --- snip -- - --- Here's patch 1 of 2, plus URLs showing where it is in CVS -- - -[http://gcc.gnu.org/ml/gcc-cvs/2005-10/msg00081.html] - -2005-09-30 Kaz Kojima - - * config/sh/sh.c (sh_register_move_cost): Add case for moving - from T_REGS to FP register class. - -[http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/config/sh/sh.c.diff?cvsroot=gcc&r1=1.347&r2=1.348] - -RCS file: /cvs/gcc/gcc/gcc/config/sh/sh.c,v -retrieving revision 1.347 -retrieving revision 1.348 -diff -u -r1.347 -r1.348 ---- gcc/gcc/config/sh/sh.c 2005/09/05 12:45:22 1.347 -+++ gcc/gcc/config/sh/sh.c 2005/10/03 22:07:08 1.348 -@@ -9491,6 +9491,9 @@ sh_register_move_cost (enum machine_mode - && REGCLASS_HAS_FP_REG (dstclass)) - return 4; - -+ if (REGCLASS_HAS_FP_REG (dstclass) && srcclass == T_REGS) -+ return ((TARGET_HARD_SH4 && !optimize_size) ? 10 : 7); -+ - if ((REGCLASS_HAS_FP_REG (dstclass) && srcclass == MAC_REGS) - || (dstclass == MAC_REGS && REGCLASS_HAS_FP_REG (srcclass))) - return 9; diff --git a/patches/gcc/4.1.0/100-gcc-4.1-fix-fixincl.patch b/patches/gcc/4.1.0/100-gcc-4.1-fix-fixincl.patch new file mode 100644 index 0000000..3928705 --- /dev/null +++ b/patches/gcc/4.1.0/100-gcc-4.1-fix-fixincl.patch @@ -0,0 +1,71 @@ +See http://gcc.gnu.org/PR22541 + +From: Dan Kegel + +When building gcc-3.4.3 or gcc-4.x into a clean $PREFIX, +the configure script happily copies the glibc include files from include to sys-include; +here's the line from the log file (with $PREFIX instead of the real prefix): + +Copying $PREFIX/i686-unknown-linux-gnu/include to $PREFIX/i686-unknown-linux-gnu/sys-include + +But later, when running fixincludes, it gives the error message + The directory that should contain system headers does not exist: + $PREFIX/lib/gcc/i686-unknown-linux-gnu/3.4.3/../../../../i686-unknown-linux-gnu/sys-include + +Nevertheless, it continues building; the header files it installs in + $PREFIX/lib/gcc/i686-unknown-linux-gnu/3.4.3/include +do not include the boilerplate that would cause it to #include_next the +glibc headers in the system header directory. +Thus the resulting toolchain can't compile the following program: +#include +int x = PATH_MAX; +because its limits.h doesn't include the glibc header. + +The problem is that gcc/Makefile.in assumes that +it can refer to $PREFIX/i686-unknown-linux-gnu with the path + $PREFIX/lib/../i686-unknown-linux-gnu, but +that fails because the directory $PREFIX/lib doesn't exist during 'make all'; +it is only created later, during 'make install'. (Which makes this problem +confusing, since one only notices the breakage well after 'make install', +at which point the path configure complained about does exist, and has the +right stuff in it.) + +A fix that I've been using for a while is to use sed to canonicalize +the path. The sed syntax is a bit obtuse, but it works. + +(hey, that's the first time I've ever used a label in a sed script; thanks to the sed faq +for explaining the :a ... ta method of looping to repeat a search-and-replace until it doesn't match.) + +[rediffed against gcc-4.1-20060210] + +--- gcc-4.1-20060210/gcc/Makefile.in.old 2006-01-11 06:29:29.000000000 -0800 ++++ gcc-4.1-20060210/gcc/Makefile.in 2006-02-14 16:08:54.000000000 -0800 +@@ -388,7 +388,10 @@ + CROSS_SYSTEM_HEADER_DIR = @CROSS_SYSTEM_HEADER_DIR@ + + # autoconf sets SYSTEM_HEADER_DIR to one of the above. +-SYSTEM_HEADER_DIR = @SYSTEM_HEADER_DIR@ ++# Purge it of unneccessary internal relative paths ++# to directories that might not exist yet. ++# The sed idiom for this is to repeat the search-and-replace until it doesn't match, using :a ... ta. ++SYSTEM_HEADER_DIR = `echo @SYSTEM_HEADER_DIR@ | sed -e :a -e "s,[^/]*/\.\.\/,," -e ta` + + # Control whether to run fixproto and fixincludes. + STMP_FIXPROTO = @STMP_FIXPROTO@ +@@ -3167,13 +3170,15 @@ + ../$(build_subdir)/fixincludes/fixincl: ; @ : + + # Build fixed copies of system files. ++# Abort if no system headers available, unless building a crosscompiler. ++# Canonicalize $gcc_tooldir/sys-include in same way as $SYSTEM_HEADER_DIR was canonicalized so test still works + stmp-fixinc: gsyslimits.h macro_list \ + $(build_objdir)/fixincludes/fixincl \ + $(build_objdir)/fixincludes/fixinc.sh + @if ! $(inhibit_libc) && test ! -d ${SYSTEM_HEADER_DIR}; then \ + echo The directory that should contain system headers does not exist: >&2 ; \ + echo " ${SYSTEM_HEADER_DIR}" >&2 ; \ +- if test "x${SYSTEM_HEADER_DIR}" = "x${gcc_tooldir}/sys-include"; \ ++ if test "x${SYSTEM_HEADER_DIR}" = "x`echo "${gcc_tooldir}/sys-include" | sed -e :a -e "s,[^/]*/\.\.\/,," -e ta`"; \ + then sleep 1; else exit 1; fi; \ + fi + rm -rf include; mkdir include diff --git a/patches/gcc/4.1.0/gcc-4.1-fix-fixincl.patch b/patches/gcc/4.1.0/gcc-4.1-fix-fixincl.patch deleted file mode 100644 index 3928705..0000000 --- a/patches/gcc/4.1.0/gcc-4.1-fix-fixincl.patch +++ /dev/null @@ -1,71 +0,0 @@ -See http://gcc.gnu.org/PR22541 - -From: Dan Kegel - -When building gcc-3.4.3 or gcc-4.x into a clean $PREFIX, -the configure script happily copies the glibc include files from include to sys-include; -here's the line from the log file (with $PREFIX instead of the real prefix): - -Copying $PREFIX/i686-unknown-linux-gnu/include to $PREFIX/i686-unknown-linux-gnu/sys-include - -But later, when running fixincludes, it gives the error message - The directory that should contain system headers does not exist: - $PREFIX/lib/gcc/i686-unknown-linux-gnu/3.4.3/../../../../i686-unknown-linux-gnu/sys-include - -Nevertheless, it continues building; the header files it installs in - $PREFIX/lib/gcc/i686-unknown-linux-gnu/3.4.3/include -do not include the boilerplate that would cause it to #include_next the -glibc headers in the system header directory. -Thus the resulting toolchain can't compile the following program: -#include -int x = PATH_MAX; -because its limits.h doesn't include the glibc header. - -The problem is that gcc/Makefile.in assumes that -it can refer to $PREFIX/i686-unknown-linux-gnu with the path - $PREFIX/lib/../i686-unknown-linux-gnu, but -that fails because the directory $PREFIX/lib doesn't exist during 'make all'; -it is only created later, during 'make install'. (Which makes this problem -confusing, since one only notices the breakage well after 'make install', -at which point the path configure complained about does exist, and has the -right stuff in it.) - -A fix that I've been using for a while is to use sed to canonicalize -the path. The sed syntax is a bit obtuse, but it works. - -(hey, that's the first time I've ever used a label in a sed script; thanks to the sed faq -for explaining the :a ... ta method of looping to repeat a search-and-replace until it doesn't match.) - -[rediffed against gcc-4.1-20060210] - ---- gcc-4.1-20060210/gcc/Makefile.in.old 2006-01-11 06:29:29.000000000 -0800 -+++ gcc-4.1-20060210/gcc/Makefile.in 2006-02-14 16:08:54.000000000 -0800 -@@ -388,7 +388,10 @@ - CROSS_SYSTEM_HEADER_DIR = @CROSS_SYSTEM_HEADER_DIR@ - - # autoconf sets SYSTEM_HEADER_DIR to one of the above. --SYSTEM_HEADER_DIR = @SYSTEM_HEADER_DIR@ -+# Purge it of unneccessary internal relative paths -+# to directories that might not exist yet. -+# The sed idiom for this is to repeat the search-and-replace until it doesn't match, using :a ... ta. -+SYSTEM_HEADER_DIR = `echo @SYSTEM_HEADER_DIR@ | sed -e :a -e "s,[^/]*/\.\.\/,," -e ta` - - # Control whether to run fixproto and fixincludes. - STMP_FIXPROTO = @STMP_FIXPROTO@ -@@ -3167,13 +3170,15 @@ - ../$(build_subdir)/fixincludes/fixincl: ; @ : - - # Build fixed copies of system files. -+# Abort if no system headers available, unless building a crosscompiler. -+# Canonicalize $gcc_tooldir/sys-include in same way as $SYSTEM_HEADER_DIR was canonicalized so test still works - stmp-fixinc: gsyslimits.h macro_list \ - $(build_objdir)/fixincludes/fixincl \ - $(build_objdir)/fixincludes/fixinc.sh - @if ! $(inhibit_libc) && test ! -d ${SYSTEM_HEADER_DIR}; then \ - echo The directory that should contain system headers does not exist: >&2 ; \ - echo " ${SYSTEM_HEADER_DIR}" >&2 ; \ -- if test "x${SYSTEM_HEADER_DIR}" = "x${gcc_tooldir}/sys-include"; \ -+ if test "x${SYSTEM_HEADER_DIR}" = "x`echo "${gcc_tooldir}/sys-include" | sed -e :a -e "s,[^/]*/\.\.\/,," -e ta`"; \ - then sleep 1; else exit 1; fi; \ - fi - rm -rf include; mkdir include diff --git a/patches/glibc/2.3.6/100-arm-ctl_bus_isa.patch b/patches/glibc/2.3.6/100-arm-ctl_bus_isa.patch new file mode 100644 index 0000000..413c685 --- /dev/null +++ b/patches/glibc/2.3.6/100-arm-ctl_bus_isa.patch @@ -0,0 +1,53 @@ +Applies to both glibc-2.2.5 and glibc-2.3.2, and probably glibc cvs as of Aug 2004. +Needed to build glibc with linux kernels 2.4.23 or higher on ARM, +Fixes following error: + +../sysdeps/unix/sysv/linux/arm/ioperm.c: In function `init_iosys': +../sysdeps/unix/sysv/linux/arm/ioperm.c:103: error: `BUS_ISA' undeclared (first use in this function) +../sysdeps/unix/sysv/linux/arm/ioperm.c:103: error: (Each undeclared identifier is reported only once +../sysdeps/unix/sysv/linux/arm/ioperm.c:103: error: for each function it appears in.) +../sysdeps/unix/sysv/linux/arm/ioperm.c:103: error: initializer element is not constant +../sysdeps/unix/sysv/linux/arm/ioperm.c:103: error: (near initialization for `iobase_name[1]') +../sysdeps/unix/sysv/linux/arm/ioperm.c:104: error: initializer element is not constant +../sysdeps/unix/sysv/linux/arm/ioperm.c:104: error: (near initialization for `ioshift_name[1]') +make[2]: *** [/home/dank/crosstool-0.28/build/arm-softfloat-linux-gnu/gcc-3.3.4-glibc-2.2.5/build-glibc/misc/ioperm.o] Error 1 + +cf. "[SYSCTL] BUS_ISA -> CTL_BUS_ISA", http://www.ussg.iu.edu/hypermail/linux/kernel/0311.0/0529.html + +--- glibc-2.3.2/sysdeps/unix/sysv/linux/arm/ioperm.c.old 2003-02-20 14:22:24.000000000 -0800 ++++ glibc-2.3.2/sysdeps/unix/sysv/linux/arm/ioperm.c 2004-01-31 16:01:50.000000000 -0800 +@@ -47,6 +47,12 @@ + #include + #include + ++/* see http://www.ussg.iu.edu/hypermail/linux/kernel/0311.0/0529.html */ ++#include ++#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,4,23)) ++#define CTL_BUS_ISA BUS_ISA /* and hope it's not the one from linux/input.h */ ++#endif ++ + #define PATH_ARM_SYSTYPE "/etc/arm_systype" + #define PATH_CPUINFO "/proc/cpuinfo" + +@@ -80,7 +86,7 @@ + * Initialize I/O system. There are several ways to get the information + * we need. Each is tried in turn until one succeeds. + * +- * 1. Sysctl (CTL_BUS, BUS_ISA, ISA_*). This is the preferred method ++ * 1. Sysctl (CTL_BUS, CTL_BUS_ISA, ISA_*). This is the preferred method + * but not all kernels support it. + * + * 2. Read the value (not the contents) of symlink PATH_ARM_SYSTYPE. +@@ -100,8 +106,8 @@ + { + char systype[256]; + int i, n; +- static int iobase_name[] = { CTL_BUS, BUS_ISA, BUS_ISA_PORT_BASE }; +- static int ioshift_name[] = { CTL_BUS, BUS_ISA, BUS_ISA_PORT_SHIFT }; ++ static int iobase_name[] = { CTL_BUS, CTL_BUS_ISA, BUS_ISA_PORT_BASE }; ++ static int ioshift_name[] = { CTL_BUS, CTL_BUS_ISA, BUS_ISA_PORT_SHIFT }; + size_t len = sizeof(io.base); + + if (! sysctl (iobase_name, 3, &io.io_base, &len, NULL, 0) + +Signed-off-by: Robert P. J. Day diff --git a/patches/glibc/2.3.6/110-fix-pr398.patch b/patches/glibc/2.3.6/110-fix-pr398.patch new file mode 100644 index 0000000..d5d0309 --- /dev/null +++ b/patches/glibc/2.3.6/110-fix-pr398.patch @@ -0,0 +1,70 @@ +Fixes error + +dl-runtime.c:222: error: parse error before "CFI_STARTPROC" +make[2]: *** [crosstool-0.28-rc35/build/s390-unknown-linux-gnu/gcc-3.4.1-glibc-20040822/build-glibc/elf/dl-runtim +e.o] Error 1 +make[2]: Leaving directory `crosstool-0.28-rc35/build/s390-unknown-linux-gnu/gcc-3.4.1-glibc-20040822/glibc-20040 +822/elf' +make[1]: *** [elf/subdir_lib] Error 2 +make[1]: Leaving directory `crosstool-0.28-rc35/build/s390-unknown-linux-gnu/gcc-3.4.1-glibc-20040822/glibc-20040 +822' +make: *** [all] Error 2 + +----------------- + +See http://sources.redhat.com/bugzilla/show_bug.cgi?id=398 +http://sources.redhat.com/ml/libc-alpha/2004-07/msg00023.html + +----------------- + +CVSROOT: /cvs/glibc +Module name: libc +Branch: glibc-2_3-branch +Changes by: roland@sources.redhat.com 2006-02-23 22:36:51 + +Modified files: + sysdeps/s390/s390-64: dl-machine.h + sysdeps/s390/s390-32: dl-machine.h + +Log message: + 2004-07-10 GOTO Masanori + + [BZ #398] + * sysdeps/s390/s390-32/dl-machine.h: Include for CFI + directive. + * sysdeps/s390/s390-64/dl-machine.h: Likewise. + +Patches: +http://sources.redhat.com/cgi-bin/cvsweb.cgi/libc/sysdeps/s390/s390-64/dl-machine.h.diff?cvsroot=glibc&only_with_tag=glibc-2_3-branch&r1=1.19.4.1&r2=1.19.4.2 +http://sources.redhat.com/cgi-bin/cvsweb.cgi/libc/sysdeps/s390/s390-32/dl-machine.h.diff?cvsroot=glibc&only_with_tag=glibc-2_3-branch&r1=1.20.4.1&r2=1.20.4.2 + +=================================================================== +RCS file: /cvs/glibc/libc/sysdeps/s390/s390-64/dl-machine.h,v +retrieving revision 1.19.4.1 +retrieving revision 1.19.4.2 +diff -u -r1.19.4.1 -r1.19.4.2 +--- libc/sysdeps/s390/s390-64/dl-machine.h 2005/10/17 04:57:27 1.19.4.1 ++++ libc/sysdeps/s390/s390-64/dl-machine.h 2006/02/23 22:36:51 1.19.4.2 +@@ -27,6 +27,7 @@ + #include + #include + #include ++#include + + /* This is an older, now obsolete value. */ + #define EM_S390_OLD 0xA390 +=================================================================== +RCS file: /cvs/glibc/libc/sysdeps/s390/s390-32/dl-machine.h,v +retrieving revision 1.20.4.1 +retrieving revision 1.20.4.2 +diff -u -r1.20.4.1 -r1.20.4.2 +--- libc/sysdeps/s390/s390-32/dl-machine.h 2005/10/17 04:57:27 1.20.4.1 ++++ libc/sysdeps/s390/s390-32/dl-machine.h 2006/02/23 22:36:51 1.20.4.2 +@@ -27,6 +27,7 @@ + #include + #include + #include ++#include + + /* This is an older, now obsolete value. */ + #define EM_S390_OLD 0xA390 diff --git a/patches/glibc/2.3.6/120-glibc-2.3.5-allow-gcc-4.0-wordexp.patch b/patches/glibc/2.3.6/120-glibc-2.3.5-allow-gcc-4.0-wordexp.patch new file mode 100644 index 0000000..996359a --- /dev/null +++ b/patches/glibc/2.3.6/120-glibc-2.3.5-allow-gcc-4.0-wordexp.patch @@ -0,0 +1,21 @@ +../sysdeps/generic/wordexp.c: In function 'exec_comm': +../sysdeps/generic/wordexp.c:815: sorry, unimplemented: inlining failed in call to 'exec_comm_child': function body not available +../sysdeps/generic/wordexp.c:900: sorry, unimplemented: called from here +make[2]: *** [/home/dank/queue/jobdir.fast2/crosstool-dev/build/i686-unknown-linux-gnu/gcc-4.0-20050305-glibc-2.3-20050307/build-glibc/posix/wordexp.o] Error + +I had to add the keyword 'inline' to get it to compile: + +--- glibc-2.3-20050307/sysdeps/generic/wordexp.c.old 2005-03-12 08:54:15.709253928 -0800 ++++ glibc-2.3-20050307/sysdeps/generic/wordexp.c 2005-03-12 08:54:51.242852000 -0800 +@@ -809,7 +809,7 @@ + } + + /* Function called by child process in exec_comm() */ +-static void ++static inline void + internal_function __attribute__ ((always_inline)) + exec_comm_child (char *comm, int *fildes, int showerr, int noexec) + { + + +Signed-off-by: Robert P. J. Day diff --git a/patches/glibc/2.3.6/130-glibc-2.3.5-allow-gcc4-wcstol_l.patch b/patches/glibc/2.3.6/130-glibc-2.3.5-allow-gcc4-wcstol_l.patch new file mode 100644 index 0000000..0e6776f --- /dev/null +++ b/patches/glibc/2.3.6/130-glibc-2.3.5-allow-gcc4-wcstol_l.patch @@ -0,0 +1,59 @@ +Fixes +../sysdeps/wordsize-64/wcstol_l.c:11: error: '____wcstoll_l_internal' aliased to undefined symbol '____wcstol_l_internal' +../sysdeps/wordsize-64/wcstol_l.c:12: error: '__wcstoll_l' aliased to undefined symbol '__wcstol_l' +../sysdeps/wordsize-64/wcstol_l.c:13: error: 'wcstoll_l' aliased to undefined symbol '__wcstol_l' +make[2]: *** [/home/dkegel/queue/jobdir.produser_cpsm10/crosstool-0.32/build/x86_64-unknown-linux-gnu/gcc-4.0.0-20050410-glibc-2.3.4/build-glibc/wcsmbs/wcstoul_l.o] Error 1 + +https://www.redhat.com/archives/fedora-cvs-commits/2005-March/msg00408.html +%changelog ++* Fri Mar 25 2005 Jakub Jelinek 2.3.4-18 ++- fix build on 64-bit arches with new GCC + +Revision 1.4.2.1, Fri Mar 25 11:59:01 2005 UTC (3 weeks, 4 days ago) by jakub +Branch: fedora-branch +CVS Tags: fedora-glibc-2_3_4-18 +Changes since 1.4: +2 -0 lines +Diff to previous 1.4 (colored) + + * sysdeps/wordsize-64/strtol_l.c: Don't add aliases if UNSIGNED. + * sysdeps/wordsize-64/wcstol_l.c: Likewise. + + +http://sourceware.org/cgi-bin/cvsweb.cgi/libc/sysdeps/wordsize-64/strtol_l.c.diff?r1=1.4&r2=1.4.2.1&cvsroot=glibc +http://sourceware.org/cgi-bin/cvsweb.cgi/libc/sysdeps/wordsize-64/wcstol_l.c.diff?r1=1.4&r2=1.4.2.1&cvsroot=glibc + +=================================================================== +RCS file: /cvs/glibc/libc/sysdeps/wordsize-64/strtol_l.c,v +retrieving revision 1.4 +retrieving revision 1.4.2.1 +diff -u -r1.4 -r1.4.2.1 +--- libc/sysdeps/wordsize-64/strtol_l.c 2003/03/03 09:45:12 1.4 ++++ libc/sysdeps/wordsize-64/strtol_l.c 2005/03/25 11:59:01 1.4.2.1 +@@ -8,7 +8,9 @@ + #undef ____strtoll_l_internal + #undef __strtoll_l + #undef strtoll_l ++#if !UNSIGNED + strong_alias (____strtol_l_internal, ____strtoll_l_internal) + libc_hidden_ver (____strtol_l_internal, ____strtoll_l_internal) + weak_alias (__strtol_l, __strtoll_l) + weak_alias (__strtol_l, strtoll_l) ++#endif +=================================================================== +RCS file: /cvs/glibc/libc/sysdeps/wordsize-64/wcstol_l.c,v +retrieving revision 1.4 +retrieving revision 1.4.2.1 +diff -u -r1.4 -r1.4.2.1 +--- libc/sysdeps/wordsize-64/wcstol_l.c 2002/08/08 11:44:51 1.4 ++++ libc/sysdeps/wordsize-64/wcstol_l.c 2005/03/25 11:59:01 1.4.2.1 +@@ -8,6 +8,8 @@ + #undef ____wcstoll_l_internal + #undef __wcstoll_l + #undef wcstoll_l ++#if !UNSIGNED + strong_alias (____wcstol_l_internal, ____wcstoll_l_internal) + weak_alias (__wcstol_l, __wcstoll_l) + weak_alias (__wcstol_l, wcstoll_l) ++#endif + +Signed-off-by: Robert P. J. Day diff --git a/patches/glibc/2.3.6/140-glibc-2.3.5-cygwin.patch b/patches/glibc/2.3.6/140-glibc-2.3.5-cygwin.patch new file mode 100644 index 0000000..423a1c5 --- /dev/null +++ b/patches/glibc/2.3.6/140-glibc-2.3.5-cygwin.patch @@ -0,0 +1,187 @@ +Fixes +elf/librtld.os: In function `process_envvars': : undefined reference to `__access' +... +when building glibc-2.3.x on cygwin + +Idea from +http://sources.redhat.com/ml/bug-glibc/2002-01/msg00071/glibc-2.2-cygin-shared.patch +Basically, make glibc use .oST as suffix for 'object static' +instead of .oS, since cygwin has trouble distinguishing .os from .oS +(Original patch had .on, but .oST is more mnemonic for 'object static') + +glibc-linuxthreads-2.3.5 also requires a patch, see +../glibc-linuxthreads-2.3.5/glibc-linuxthreads-2.3.5-cygwin.patch + +[ forward ported to glibc-2.3.5 by Petr Cvachoucek: + +Message-ID: <4282FCBA.3040000@unicontrols.cz> +Date: Thu, 12 May 2005 08:50:34 +0200 +From: Petr Cvachoucek +To: Dan Kegel +CC: crossgcc@sources.redhat.com +Subject: Patches to build gcc 3.4.3 / glibc 2.3.5 on cygwin + +Hi Dan, +following patches are needed to build gcc-3.4.3/glibc-2.3.5 toolchain +on cygwin. Tested to build toolchains for powerpc 604 and 750 targets. + +-- + Petr Cvachoucek + Unicontrols a.s. + http://www.unicontrols.cz +] + +diff -aur glibc-2.3.5/Makeconfig glibc-2.3.5-cygwin/Makeconfig +--- glibc-2.3.5/Makeconfig 2005-02-16 11:50:19.000000000 +0100 ++++ glibc-2.3.5-cygwin/Makeconfig 2005-05-11 08:24:51.046875000 +0200 +@@ -449,7 +449,7 @@ + # run the linked programs. + link-libc = -Wl,-rpath-link=$(rpath-link) \ + $(common-objpfx)libc.so$(libc.so-version) \ +- $(common-objpfx)$(patsubst %,$(libtype.oS),c) $(gnulib) ++ $(common-objpfx)$(patsubst %,$(libtype.oST),c) $(gnulib) + # This is how to find at build-time things that will be installed there. + rpath-dirs = math elf dlfcn nss nis rt resolv crypt + endif +@@ -656,7 +656,7 @@ + # The compilation rules use $(CPPFLAGS-${SUFFIX}) and $(CFLAGS-${SUFFIX}) + # to pass different flags for each flavor. + libtypes = $(foreach o,$(object-suffixes-for-libc),$(libtype$o)) +-all-object-suffixes := .o .os .op .og .ob .oS ++all-object-suffixes := .o .os .op .og .ob .oST + object-suffixes := + CPPFLAGS-.o = $(pic-default) + CFLAGS-.o = $(filter %frame-pointer,$(+cflags)) +@@ -712,14 +712,14 @@ + + ifeq (yes,$(build-shared)) + # Build special library that contains the static-only routines for libc. +-object-suffixes-for-libc += .oS ++object-suffixes-for-libc += .oST + + # Must build the routines as PIC, though, because they can end up in (users') + # shared objects. We don't want to use CFLAGS-os because users may, for + # example, make that processor-specific. +-CFLAGS-.oS = $(CFLAGS-.o) $(PIC-ccflag) +-CPPFLAGS-.oS = $(CPPFLAGS-.o) -DPIC -DLIBC_NONSHARED=1 +-libtype.oS = lib%_nonshared.a ++CFLAGS-.oST = $(CFLAGS-.o) $(PIC-ccflag) ++CPPFLAGS-.oST = $(CPPFLAGS-.o) -DPIC -DLIBC_NONSHARED=1 ++libtype.oST = lib%_nonshared.a + endif + + # The assembler can generate debug information too. +diff -aur glibc-2.3.5/Makerules glibc-2.3.5-cygwin/Makerules +--- glibc-2.3.5/Makerules 2004-12-15 19:52:39.000000000 +0100 ++++ glibc-2.3.5-cygwin/Makerules 2005-05-11 08:25:33.578125000 +0200 +@@ -416,7 +416,7 @@ + # Bounded pointer thunks are only built for *.ob + elide-bp-thunks = $(addprefix $(bppfx),$(bp-thunks)) + +-elide-routines.oS += $(filter-out $(static-only-routines),\ ++elide-routines.oST += $(filter-out $(static-only-routines),\ + $(routines) $(aux) $(sysdep_routines)) \ + $(elide-bp-thunks) + elide-routines.os += $(static-only-routines) $(elide-bp-thunks) +@@ -961,7 +961,7 @@ + install: $(inst_libdir)/libc.so + $(inst_libdir)/libc.so: $(common-objpfx)format.lds \ + $(common-objpfx)libc.so$(libc.so-version) \ +- $(inst_libdir)/$(patsubst %,$(libtype.oS),\ ++ $(inst_libdir)/$(patsubst %,$(libtype.oST),\ + $(libprefix)$(libc-name)) \ + $(+force) + (echo '/* GNU ld script';\ +@@ -969,7 +969,7 @@ + echo ' the static library, so try that secondarily. */';\ + cat $<; \ + echo 'GROUP ( $(slibdir)/libc.so$(libc.so-version)' \ +- '$(libdir)/$(patsubst %,$(libtype.oS),$(libprefix)$(libc-name))'\ ++ '$(libdir)/$(patsubst %,$(libtype.oST),$(libprefix)$(libc-name))'\ + ')' \ + ) > $@.new + mv -f $@.new $@ +diff -aur glibc-2.3.5/extra-lib.mk glibc-2.3.5-cygwin/extra-lib.mk +--- glibc-2.3.5/extra-lib.mk 2004-12-02 23:54:47.000000000 +0100 ++++ glibc-2.3.5-cygwin/extra-lib.mk 2005-05-11 08:27:28.156250000 +0200 +@@ -13,7 +13,7 @@ + + ifneq (,$($(lib)-static-only-routines)) + ifneq (,$(filter yesyes%,$(build-shared)$(elf)$($(lib).so-version))) +-object-suffixes-$(lib) += $(filter-out $($(lib)-inhibit-o),.oS) ++object-suffixes-$(lib) += $(filter-out $($(lib)-inhibit-o),.oST) + endif + endif + +@@ -29,7 +29,7 @@ + + # Add each flavor of library to the lists of things to build and install. + install-lib += $(foreach o,$(object-suffixes-$(lib)),$(lib:lib%=$(libtype$o))) +-extra-objs += $(foreach o,$(filter-out .os .oS,$(object-suffixes-$(lib))),\ ++extra-objs += $(foreach o,$(filter-out .os .oST,$(object-suffixes-$(lib))),\ + $(patsubst %,%$o,$(filter-out \ + $($(lib)-shared-only-routines),\ + $(all-$(lib)-routines)))) +@@ -57,7 +57,7 @@ + + + # Use o-iterator.mk to generate a rule for each flavor of library. +-ifneq (,$(filter-out .os .oS,$(object-suffixes-$(lib)))) ++ifneq (,$(filter-out .os .oST,$(object-suffixes-$(lib)))) + define o-iterator-doit + $(objpfx)$(patsubst %,$(libtype$o),$(lib:lib%=%)): \ + $(patsubst %,$(objpfx)%$o,\ +@@ -65,7 +65,7 @@ + $(all-$(lib)-routines))); \ + $$(build-extra-lib) + endef +-object-suffixes-left = $(filter-out .os .oS,$(object-suffixes-$(lib))) ++object-suffixes-left = $(filter-out .os .oST,$(object-suffixes-$(lib))) + include $(patsubst %,$(..)o-iterator.mk,$(object-suffixes-left)) + endif + +@@ -77,9 +77,9 @@ + $(build-extra-lib) + endif + +-ifneq (,$(filter .oS,$(object-suffixes-$(lib)))) +-$(objpfx)$(patsubst %,$(libtype.oS),$(lib:lib%=%)): \ +- $(patsubst %,$(objpfx)%.oS,\ ++ifneq (,$(filter .oST,$(object-suffixes-$(lib)))) ++$(objpfx)$(patsubst %,$(libtype.oST),$(lib:lib%=%)): \ ++ $(patsubst %,$(objpfx)%.oST,\ + $(filter $($(lib)-static-only-routines),\ + $(all-$(lib)-routines))) + $(build-extra-lib) +diff -aur glibc-2.3.5/nptl/Makefile glibc-2.3.5-cygwin/nptl/Makefile +--- glibc-2.3.5/nptl/Makefile 2005-02-16 09:45:56.000000000 +0100 ++++ glibc-2.3.5-cygwin/nptl/Makefile 2005-05-11 08:26:01.812500000 +0200 +@@ -360,7 +360,7 @@ + + $(inst_libdir)/libpthread.so: $(common-objpfx)format.lds \ + $(objpfx)libpthread.so$(libpthread.so-version) \ +- $(inst_libdir)/$(patsubst %,$(libtype.oS),\ ++ $(inst_libdir)/$(patsubst %,$(libtype.oST),\ + $(libprefix)pthread) \ + $(+force) + (echo '/* GNU ld script';\ +@@ -368,7 +368,7 @@ + echo ' the static library, so try that secondarily. */';\ + cat $<; \ + echo 'GROUP ( $(slibdir)/libpthread.so$(libpthread.so-version)' \ +- '$(libdir)/$(patsubst %,$(libtype.oS),$(libprefix)pthread)'\ ++ '$(libdir)/$(patsubst %,$(libtype.oST),$(libprefix)pthread)'\ + ')' \ + ) > $@.new + mv -f $@.new $@ +diff -aur glibc-2.3.5/sysdeps/sparc/sparc32/sparcv9/Makefile glibc-2.3.5-cygwin/sysdeps/sparc/sparc32/sparcv9/Makefile +--- glibc-2.3.5/sysdeps/sparc/sparc32/sparcv9/Makefile 2004-08-16 08:46:14.000000000 +0200 ++++ glibc-2.3.5-cygwin/sysdeps/sparc/sparc32/sparcv9/Makefile 2005-05-11 08:26:25.937500000 +0200 +@@ -10,4 +10,4 @@ + ASFLAGS-.op += -Wa,-Av9a + ASFLAGS-.og += -Wa,-Av9a + ASFLAGS-.ob += -Wa,-Av9a +-ASFLAGS-.oS += -Wa,-Av9a ++ASFLAGS-.oST += -Wa,-Av9a + +Signed-off-by: Robert P. J. Day diff --git a/patches/glibc/2.3.6/150-glibc-2.3.5-sh-lowlevellock.patch b/patches/glibc/2.3.6/150-glibc-2.3.5-sh-lowlevellock.patch new file mode 100644 index 0000000..9af78d1 --- /dev/null +++ b/patches/glibc/2.3.6/150-glibc-2.3.5-sh-lowlevellock.patch @@ -0,0 +1,43 @@ +ML: http://sources.redhat.com/ml/libc-hacker/2005-09/msg00002.html + +Date: Mon, 05 Sep 2005 21:07:15 +0900 (JST) +Message-Id: <20050905.210715.15267870.kkojima@rr.iij4u.or.jp> +To: libc-hacker at sources dot redhat dot com +Subject: SH: A typo in lowlevellock.S +From: Kaz Kojima + +Hi, + +The appended patch fixes a typo in a low-level lock function. It +set the correct 3rd argument for the futex syscall in loop. Sorry +for missing such an embarrassing bug. + +Regards, + kaz + +nptl/ChangeLog: +2005-09-05 Kaz Kojima + + * sysdeps/unix/sysv/linux/sh/lowlevellock.S (__lll_mutex_lock_wait): + Fix typo in register name. + +--- glibc.old/nptl/sysdeps/unix/sysv/linux/sh/lowlevellock.S 2004-10-26 04:06:44.000000000 +0900 ++++ glibc/nptl/sysdeps/unix/sysv/linux/sh/lowlevellock.S 2005-09-05 19:18:25.000000000 +0900 +@@ -1,4 +1,4 @@ +-/* Copyright (C) 2003, 2004 Free Software Foundation, Inc. ++/* Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc. + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or +@@ -51,8 +51,8 @@ __lll_mutex_lock_wait: + SYSCALL_INST_PAD + + 2: +- mov #2, r4 +- XCHG (r4, @r8, r2) ++ mov #2, r6 ++ XCHG (r6, @r8, r2) + tst r2, r2 + bf 1b + +Signed-off-by: Robert P. J. Day diff --git a/patches/glibc/2.3.6/160-glibc-2.3.5-sh-memset.patch b/patches/glibc/2.3.6/160-glibc-2.3.5-sh-memset.patch new file mode 100644 index 0000000..1ccc1e1 --- /dev/null +++ b/patches/glibc/2.3.6/160-glibc-2.3.5-sh-memset.patch @@ -0,0 +1,30 @@ +From: + http://sources.redhat.com/ml/libc-alpha/2005-07/msg00051.html + http://sources.redhat.com/ml/crossgcc/2005-10/msg00035.html + +Message-ID: <434576E1.6020305@sscd.de> +Date: Thu, 06 Oct 2005 21:11:29 +0200 +From: Alexander Sieb +To: crossgcc at sourceware dot org +Subject: Crosstool sh4-linux-gcc-4.0.2-glibc-2.3.5 patches + +On sh[34]-linux, memset function does not work if 2nd argument is negative +and 3rd argument is greater than 12. +for example, memset(ptr, "\xda", 20) sets 0xff instead of 0xda. + +Attached patch fixes this problem. + + * sysdeps/sh/memset.S (memset): Correct 2nd argument handling. + +--- glibc-2.3.5.old/sysdeps/sh/memset.S 29 Apr 2003 22:47:18 -0000 1.4 ++++ glibc-2.3.5/sysdeps/sh/memset.S 23 Jul 2005 08:37:21 -0000 +@@ -28,6 +28,7 @@ ENTRY(memset) + bt.s L_byte_loop_init + mov r4,r7 + ++ extu.b r5,r5 + swap.b r5,r1 + or r1,r5 + swap.w r5,r1 + +Signed-off-by: Robert P. J. Day diff --git a/patches/glibc/2.3.6/170-glibc-2.3.6-allow-gcc-4.0-arm.patch b/patches/glibc/2.3.6/170-glibc-2.3.6-allow-gcc-4.0-arm.patch new file mode 100644 index 0000000..ea885ea --- /dev/null +++ b/patches/glibc/2.3.6/170-glibc-2.3.6-allow-gcc-4.0-arm.patch @@ -0,0 +1,35 @@ +Fixes +In file included from dynamic-link.h:22, + from dl-reloc.c:265: +../sysdeps/arm/dl-machine.h: In function '_dl_relocate_object': +../sysdeps/arm/dl-machine.h:371: error: invalid storage class for function 'fix_bad_pc24' +make[2]: Leaving directory `/home/dank/queue/jobdir.k8/crosstool-dev/build/arm-unknown-linux-gnu/gcc-4.0-20050305-glibc-2.3.6/glibc-2.3.6/elf' + +when building glibc-2.3.6 with gcc-4.0 + +Like +http://sources.redhat.com/cgi-bin/cvsweb.cgi/libc/sysdeps/arm/dl-machine.h.diff?r1=1.51&r2=1.52&cvsroot=glibc +but fixes fix_bad_pc24. + + +--- glibc-2.3.6-orig/sysdeps/arm/dl-machine.h Sun Mar 20 17:54:37 2005 ++++ glibc-2.3.6/sysdeps/arm/dl-machine.h Sun Mar 20 17:57:32 2005 +@@ -357,7 +357,14 @@ + #ifdef RESOLVE + + /* Deal with an out-of-range PC24 reloc. */ +-static Elf32_Addr ++#if __GNUC__ >= 4 ++ auto inline Elf32_Addr ++#else ++ static inline Elf32_Addr ++#endif ++#if __GNUC__ >= 4 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 2) ++ __attribute ((always_inline)) ++#endif + fix_bad_pc24 (Elf32_Addr *const reloc_addr, Elf32_Addr value) + { + static void *fix_page; + +Signed-off-by: Robert P. J. Day +with a little editing by dank@kegel.com diff --git a/patches/glibc/2.3.6/180-glibc-2.3.6-allow-gcc-4.0-elf.patch b/patches/glibc/2.3.6/180-glibc-2.3.6-allow-gcc-4.0-elf.patch new file mode 100644 index 0000000..ec48544 --- /dev/null +++ b/patches/glibc/2.3.6/180-glibc-2.3.6-allow-gcc-4.0-elf.patch @@ -0,0 +1,67 @@ +From http://www.mail-archive.com/pld-cvs-commit@pld-linux.org/msg00229.html +Fixes + rtld.c: In function '_dl_start': + dynamic-link.h:47: error: nested function 'elf_machine_rela_relative' declared but never defined + dynamic-link.h:41: error: nested function 'elf_machine_rela' declared but never defined +when compiling glibc-2.3.4 with gcc-4.0 + +But see also +http://sources.redhat.com/ml/libc-hacker/2005-02/msg00000.html +and +http://sources.redhat.com/ml/libc-hacker/2005-03/msg00008.html +which seem to propose less radical fixes? + +Aha. See also http://sources.redhat.com/bugzilla/show_bug.cgi?id=721 + +--- glibc-2.3.6.orig/elf/dynamic-link.h 2005-03-12 18:12:37.000000000 -0800 ++++ glibc-2.3.6/elf/dynamic-link.h 2005-03-12 18:12:59.777820848 -0800 +@@ -19,47 +19,6 @@ + + #include + #include +- +-#ifdef RESOLVE +-/* We pass reloc_addr as a pointer to void, as opposed to a pointer to +- ElfW(Addr), because not all architectures can assume that the +- relocated address is properly aligned, whereas the compiler is +- entitled to assume that a pointer to a type is properly aligned for +- the type. Even if we cast the pointer back to some other type with +- less strict alignment requirements, the compiler might still +- remember that the pointer was originally more aligned, thereby +- optimizing away alignment tests or using word instructions for +- copying memory, breaking the very code written to handle the +- unaligned cases. */ +-# if ! ELF_MACHINE_NO_REL +-auto inline void __attribute__((always_inline)) +-elf_machine_rel (struct link_map *map, const ElfW(Rel) *reloc, +- const ElfW(Sym) *sym, const struct r_found_version *version, +- void *const reloc_addr); +-auto inline void __attribute__((always_inline)) +-elf_machine_rel_relative (ElfW(Addr) l_addr, const ElfW(Rel) *reloc, +- void *const reloc_addr); +-# endif +-# if ! ELF_MACHINE_NO_RELA +-auto inline void __attribute__((always_inline)) +-elf_machine_rela (struct link_map *map, const ElfW(Rela) *reloc, +- const ElfW(Sym) *sym, const struct r_found_version *version, +- void *const reloc_addr); +-auto inline void __attribute__((always_inline)) +-elf_machine_rela_relative (ElfW(Addr) l_addr, const ElfW(Rela) *reloc, +- void *const reloc_addr); +-# endif +-# if ELF_MACHINE_NO_RELA || defined ELF_MACHINE_PLT_REL +-auto inline void __attribute__((always_inline)) +-elf_machine_lazy_rel (struct link_map *map, +- ElfW(Addr) l_addr, const ElfW(Rel) *reloc); +-# else +-auto inline void __attribute__((always_inline)) +-elf_machine_lazy_rel (struct link_map *map, +- ElfW(Addr) l_addr, const ElfW(Rela) *reloc); +-# endif +-#endif +- + #include + + #ifndef VERSYMIDX + +Signed-off-by: Robert P. J. Day diff --git a/patches/glibc/2.3.6/190-glibc-2.3.6-configure-apple-as.patch b/patches/glibc/2.3.6/190-glibc-2.3.6-configure-apple-as.patch new file mode 100644 index 0000000..5d9943a --- /dev/null +++ b/patches/glibc/2.3.6/190-glibc-2.3.6-configure-apple-as.patch @@ -0,0 +1,25 @@ +http://in3www.epfl.ch/~schaffne/glibc-configure-apple-as.patch +http://sources.redhat.com/ml/crossgcc/2004-02/msg00151.html + +The following makes it possible to configure glibc-2.3.2 on Mac OS X, +where the assembler but doesn't understand the --version flag. + +Fixes the symptom +checking whether ld is GNU ld... no +checking for /usr/libexec/gcc/darwin/ppc/as... /usr/libexec/gcc/darwin/ppc/as +checking version of /usr/libexec/gcc/darwin/ppc/as... + + +--- glibc-2.3.2/configure~ Wed Feb 26 09:20:48 2003 ++++ glibc-2.3.2/configure Fri Feb 27 13:12:53 2004 +@@ -3914,7 +3914,7 @@ + # Found it, now check the version. + echo "$as_me:$LINENO: checking version of $AS" >&5 + echo $ECHO_N "checking version of $AS... $ECHO_C" >&6 +- ac_prog_version=`$AS --version 2>&1 | sed -n 's/^.*GNU assembler.* \([0-9]*\.[0-9.]*\).*$/\1/p'` ++ ac_prog_version=`$AS -v &1 | sed -n 's/^.*GNU assembler.* \([0-9]*\.[0-9.]*\).*$/\1/p'` + case $ac_prog_version in + '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;; + 2.1[3-9]*) + +Signed-off-by: Robert P. J. Day diff --git a/patches/glibc/2.3.6/200-glibc-2.3.6-fix-pr631.patch b/patches/glibc/2.3.6/200-glibc-2.3.6-fix-pr631.patch new file mode 100644 index 0000000..899fa2a --- /dev/null +++ b/patches/glibc/2.3.6/200-glibc-2.3.6-fix-pr631.patch @@ -0,0 +1,45 @@ +From dank@kegel.com +Wed Jun 15 09:12:43 PDT 2005 + +Fixes + +build-glibc/libc.a(nsswitch.o)(.data+0x64): undefined reference to `_nss_files_getaliasent_r' +build-glibc/libc.a(nsswitch.o)(.data+0x6c): undefined reference to `_nss_files_endaliasent' +... 53 lines deleted ... +build-glibc/libc.a(nsswitch.o)(.data+0x21c): undefined reference to `_nss_files_getspnam_r' +collect2: ld returned 1 exit status +make[2]: *** [/build/gcc-3.4.3-glibc-2.3.5-hdrs-2.6.11.2/i686-unknown-linux-gnu/build-glibc/elf/ldconfig] Error 1 + +when building glibc with --enable-static-nss. + +See http://sources.redhat.com/bugzilla/show_bug.cgi?id=631 + +--- glibc-2.3.5/Makeconfig.old Wed Jun 15 08:13:12 2005 ++++ glibc-2.3.5/Makeconfig Wed Jun 15 08:13:14 2005 +@@ -487,7 +487,7 @@ + + # The static libraries. + ifeq (yes,$(build-static)) +-link-libc-static = $(common-objpfx)libc.a $(static-gnulib) $(common-objpfx)libc.a ++link-libc-static = $(common-objpfx)libc.a $(static-gnulib) $(otherlibs) $(common-objpfx)libc.a + else + ifeq (yes,$(build-shared)) + # We can try to link the programs with lib*_pic.a... +--- glibc-2.3.5/elf/Makefile.old Wed Jun 15 07:46:49 2005 ++++ glibc-2.3.5/elf/Makefile Wed Jun 15 08:14:00 2005 +@@ -115,6 +115,13 @@ + install-bin-script = ldd + endif + ++ifeq (yes,$(build-static-nss)) ++nssobjdir := $(patsubst ../$(subdir),.,$(common-objpfx)nss) ++resolvobjdir := $(patsubst ../$(subdir),.,$(common-objpfx)resolv) ++otherlibs += $(nssobjdir)/libnss_files.a $(resolvobjdir)/libnss_dns.a \ ++ $(resolvobjdir)/libresolv.a ++endif ++ + others = sprof sln + install-bin = sprof + others-static = sln + +Signed-off-by: Robert P. J. Day diff --git a/patches/glibc/2.3.6/210-glibc-fp-byteorder.patch b/patches/glibc/2.3.6/210-glibc-fp-byteorder.patch new file mode 100644 index 0000000..d45cdbc --- /dev/null +++ b/patches/glibc/2.3.6/210-glibc-fp-byteorder.patch @@ -0,0 +1,205 @@ +Taken from http://sources.redhat.com/ml/crossgcc/2004-02/msg00104.html +Author: addsub@eyou.com +Target: ARM + +Fixes http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gcc.c-torture/execute/920501-8.c +and makes printf("%f", 1.0) work. + +Lennert Buytenhek wrote in http://sources.redhat.com/ml/crossgcc/2004-09/msg00115.html : + It ... fixes the 'printf("%f\n", 0.5); prints 0.000000' and general 'floating point + is broken' on my big-endian hardfloat FPA ARM platform. ... + It's definitely needed for hardfloat. So I'd think it's needed for + big-endian systems in any case, and for VFP on little-endian systems + too. Someone would have to verify that though. + +Lennert Buytenhek wrote in http://sources.redhat.com/ml/crossgcc/2004-09/msg00123.html + I just had a look at glibc-20040830, and [this patch] is still needed and useful + for this version. glibc-20040830 out-of-the-box still contains the + following wrong assumptions: + - sysdeps/arm/bits/endian.h: float word order is big endian (which it is + not on vfp systems) + - sysdeps/arm/gmp-mparam.h: IEEE doubles are mixed endian (which they + are not on big endian systems, neither on vfp systems) + - sysdeps/arm/ieee754.h: IEEE doubles are in little endian byte order + (which they are not on big endian systems) + [This patch] seems the right solution for all of these issues. + +Dimitry Andric wrote in http://sources.redhat.com/ml/crossgcc/2004-09/msg00132.html : + It's even needed for glibc CVS, AFAICS. + The patch hunk which modifies glibc.new/sysdeps/arm/bits/endian.h + (currently at version 1.4) is only needed for proper VFP operation. + But the hunk which modifies sysdeps/arm/gmp-mparam.h, and the hunk + that deletes sysdeps/arm/ieee754.h (yes, this IS correct), are needed + for proper operation of *any* FP model on big endian ARM. + +See also discussion in followups to +http://sources.redhat.com/ml/crossgcc/2004-05/msg00245.html) + +Message-ID: <276985760.37584@eyou.com> +Received: from unknown (HELO eyou.com) (172.16.2.2) + by 0.0.0.0 with SMTP; Tue, 17 Feb 2004 10:42:40 +0800 +Received: (qmail 8238 invoked by uid 65534); 17 Feb 2004 10:42:38 +0800 +Date: 17 Feb 2004 10:42:38 +0800 +Message-ID: <20040217104238.8237.qmail@eyou.com> +From: "add" +To: dank@kegel.com +Reply-To: "add" +Subject: Re:   problem while building arm vfp softfloat gcc ` + +Hi, Dan, This is a patch I applied to my glibc-2.3.2, then my softfloat +toolchain can printf("%f\n",1.0). So you may have a try of this + + +diff -uNrp glibc.old/sysdeps/arm/bits/endian.h glibc.new/sysdeps/arm/bits/endian.h +--- glibc.old/sysdeps/arm/bits/endian.h 1999-04-12 11:59:13.000000000 -0400 ++++ glibc.new/sysdeps/arm/bits/endian.h 2004-02-12 09:15:13.000000000 -0500 +@@ -9,4 +9,9 @@ + #else + #define __BYTE_ORDER __LITTLE_ENDIAN + #endif ++ ++#ifdef __VFP_FP__ ++#define __FLOAT_WORD_ORDER __BYTE_ORDER ++#else + #define __FLOAT_WORD_ORDER __BIG_ENDIAN ++#endif +diff -uNrp glibc.old/sysdeps/arm/gmp-mparam.h glibc.new/sysdeps/arm/gmp-mparam.h +--- glibc.old/sysdeps/arm/gmp-mparam.h 2001-07-07 15:21:19.000000000 -0400 ++++ glibc.new/sysdeps/arm/gmp-mparam.h 2004-02-12 09:15:13.000000000 -0500 +@@ -26,5 +26,13 @@ MA 02111-1307, USA. */ + #define BITS_PER_SHORTINT 16 + #define BITS_PER_CHAR 8 + +-#define IEEE_DOUBLE_BIG_ENDIAN 0 +-#define IEEE_DOUBLE_MIXED_ENDIAN 1 ++#if defined(__ARMEB__) ++# define IEEE_DOUBLE_MIXED_ENDIAN 0 ++# define IEEE_DOUBLE_BIG_ENDIAN 1 ++#elif defined(__VFP_FP__) ++# define IEEE_DOUBLE_MIXED_ENDIAN 0 ++# define IEEE_DOUBLE_BIG_ENDIAN 0 ++#else ++# define IEEE_DOUBLE_BIG_ENDIAN 0 ++# define IEEE_DOUBLE_MIXED_ENDIAN 1 ++#endif +diff -uNrp glibc.old/sysdeps/arm/ieee754.h glibc.new/sysdeps/arm/ieee754.h +--- glibc.old/sysdeps/arm/ieee754.h 2001-07-07 15:21:19.000000000 -0400 ++++ glibc.new/sysdeps/arm/ieee754.h 1969-12-31 19:00:00.000000000 -0500 +@@ -1,115 +0,0 @@ +-/* Copyright (C) 1992, 1995, 1996, 1998 Free Software Foundation, Inc. +- This file is part of the GNU C Library. +- +- The GNU C Library is free software; you can redistribute it and/or +- modify it under the terms of the GNU Lesser General Public +- License as published by the Free Software Foundation; either +- version 2.1 of the License, or (at your option) any later version. +- +- The GNU C Library 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 +- Lesser General Public License for more details. +- +- You should have received a copy of the GNU Lesser General Public +- License along with the GNU C Library; if not, write to the Free +- Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA +- 02111-1307 USA. */ +- +-#ifndef _IEEE754_H +- +-#define _IEEE754_H 1 +-#include +- +-#include +- +-__BEGIN_DECLS +- +-union ieee754_float +- { +- float f; +- +- /* This is the IEEE 754 single-precision format. */ +- struct +- { +- unsigned int mantissa:23; +- unsigned int exponent:8; +- unsigned int negative:1; +- } ieee; +- +- /* This format makes it easier to see if a NaN is a signalling NaN. */ +- struct +- { +- unsigned int mantissa:22; +- unsigned int quiet_nan:1; +- unsigned int exponent:8; +- unsigned int negative:1; +- } ieee_nan; +- }; +- +-#define IEEE754_FLOAT_BIAS 0x7f /* Added to exponent. */ +- +- +-union ieee754_double +- { +- double d; +- +- /* This is the IEEE 754 double-precision format. */ +- struct +- { +- unsigned int mantissa0:20; +- unsigned int exponent:11; +- unsigned int negative:1; +- unsigned int mantissa1:32; +- } ieee; +- +- /* This format makes it easier to see if a NaN is a signalling NaN. */ +- struct +- { +- unsigned int mantissa0:19; +- unsigned int quiet_nan:1; +- unsigned int exponent:11; +- unsigned int negative:1; +- unsigned int mantissa1:32; +- } ieee_nan; +- }; +- +-#define IEEE754_DOUBLE_BIAS 0x3ff /* Added to exponent. */ +- +- +-/* The following two structures are correct for `new' floating point systems but +- wrong for the old FPPC. The only solution seems to be to avoid their use on +- old hardware. */ +- +-union ieee854_long_double +- { +- long double d; +- +- /* This is the IEEE 854 double-extended-precision format. */ +- struct +- { +- unsigned int exponent:15; +- unsigned int empty:16; +- unsigned int negative:1; +- unsigned int mantissa1:32; +- unsigned int mantissa0:32; +- } ieee; +- +- /* This is for NaNs in the IEEE 854 double-extended-precision format. */ +- struct +- { +- unsigned int exponent:15; +- unsigned int empty:16; +- unsigned int negative:1; +- unsigned int mantissa1:32; +- unsigned int mantissa0:30; +- unsigned int quiet_nan:1; +- unsigned int one:1; +- } ieee_nan; +- }; +- +-#define IEEE854_LONG_DOUBLE_BIAS 0x3fff +- +-__END_DECLS +- +-#endif /* ieee754.h */ + +Signed-off-by: Robert P. J. Day diff --git a/patches/glibc/2.3.6/220-glibc-mips-bootstrap-gcc-header-install.patch b/patches/glibc/2.3.6/220-glibc-mips-bootstrap-gcc-header-install.patch new file mode 100644 index 0000000..2fd72f8 --- /dev/null +++ b/patches/glibc/2.3.6/220-glibc-mips-bootstrap-gcc-header-install.patch @@ -0,0 +1,37 @@ +http://sourceware.org/ml/crossgcc/2005-05/msg00165.html +Fixes a MIPS build problem (unrelated to NPTL) + +Message-ID: <428E8B24.1000201@realitydiluted.com> +Date: Fri, 20 May 2005 20:13:08 -0500 +From: "Steven J dot Hill" +To: crossgcc at sources dot redhat dot com, toolchain at gentoo dot org, + Shay_Gal-On at pmc-sierra dot com, TheNop at gmx dot net +Subject: New NPTL patches for crosstools and MIPS NPTL patches.... + +Greetings. + +I have uploaded the latest NPTL patch for crosstool-0.34. I have also +uploaded a tarball of the patches necessary to build a MIPS NPTL +cross toolchain. To build a MIPS NPTL toolchain you will need the +released version of binutils-2.16 and the absolute latest GCC and +glibc code from the HEAD of cvs. Use the 'demo-mips-nptl.sh' script +to build the toolchain. Please report bugs or issues to the crossgcc +mailing list. Here is the link off of my FTP site: + + ftp://ftp.realitydiluted.com/crosstools/crosstool-0.34/ + +[Note: BOOTSTRAP_GCC is set by crosstool.sh when invoking make install-headers] + +diff -ur glibc-2.4.0-20050406/sysdeps/mips/mips32/Makefile glibc-2.4.0-20050406-patched/sysdeps/mips/mips32/Makefile +--- glibc-2.4.0-20050406/sysdeps/mips/mips32/Makefile 2003-03-29 02:15:28.000000000 -0600 ++++ glibc-2.4.0-20050406-patched/sysdeps/mips/mips32/Makefile 2005-04-12 21:36:51.318837655 -0500 +@@ -1,3 +1,7 @@ ++ifeq ($(filter -DBOOTSTRAP_GCC,$(CFLAGS)),) + ifeq ($(filter -mabi=32,$(CC)),) + CC += -mabi=32 + endif ++else ++CC += -D"_MIPS_SZPTR=32" ++endif + +Signed-off-by: Robert P. J. Day diff --git a/patches/glibc/2.3.6/230-make-install-lib-all.patch b/patches/glibc/2.3.6/230-make-install-lib-all.patch new file mode 100644 index 0000000..1e69bb2 --- /dev/null +++ b/patches/glibc/2.3.6/230-make-install-lib-all.patch @@ -0,0 +1,26 @@ +From http://svn.exactcode.de/t2/trunk/package/base/glibc32/make-install-lib-all.patch +Rule to install all needed libraries, not just the ones installed by install-lib, +yet not install programs. +Needed because we can't use the main install target, as we can't build programs before +we have the final gcc installed; linking fails because libeh.a is not present, +and glibc insists on linking programs with that library. + +diff -Naur glibc-2.3.4.orig/Makerules glibc-2.3.4/Makerules +--- glibc-2.3.4.orig/Makerules 2004-12-15 20:52:39.000000000 +0200 ++++ glibc-2.3.4/Makerules 2005-02-19 15:16:31.415125176 +0200 +@@ -844,6 +844,13 @@ + installed-libcs := $(foreach o,$(filter-out .os,$(object-suffixes-for-libc)),\ + $(inst_libdir)/$(patsubst %,$(libtype$o),\ + $(libprefix)$(libc-name))) ++ ++install-lib-all: $(inst_slibdir)/libc.so$(libc.so-version) \ ++ $(inst_slibdir)/libc-$(version).so \ ++ $(inst_libdir)/libc.so \ ++ $(inst_libdir)/libc.a \ ++ install-lib ++ + install: $(installed-libcs) + $(installed-libcs): $(inst_libdir)/lib$(libprefix)%: lib $(+force) + $(make-target-directory) + +Signed-off-by: Robert P. J. Day diff --git a/patches/glibc/2.3.6/240-weakalias.patch b/patches/glibc/2.3.6/240-weakalias.patch new file mode 100644 index 0000000..722365f --- /dev/null +++ b/patches/glibc/2.3.6/240-weakalias.patch @@ -0,0 +1,45 @@ +This one was taken from debian. + +# DP: Description: Fix __bind redefinition problem +# DP: Related bugs: +# DP: Dpatch author: Phil Blundell +# DP: Patch author: Daniel Jacobowitz +# DP: Upstream status: In CVS +# DP: Status Details: +# DP: Date: 2005-12-25 + +Index: sysdeps/unix/sysv/linux/arm/socket.S +=================================================================== +RCS file: /cvs/glibc/ports/sysdeps/unix/sysv/linux/arm/socket.S,v +retrieving revision 1.12 +retrieving revision 1.13 +diff -u -r1.12 -r1.13 +--- glibc-2.3.6.ds1.orig/sysdeps/unix/sysv/linux/arm/socket.S 4 Dec 2004 21:20:16 -0000 1.12 ++++ glibc-2.3.6.ds1/sysdeps/unix/sysv/linux/arm/socket.S 27 Oct 2005 18:50:12 -0000 1.13 +@@ -1,4 +1,6 @@ +-/* Copyright (C) 1995, 1996, 1997, 1998, 2003 Free Software Foundation, Inc. ++/* Copyright (C) 1995, 1996, 1997, 1998, 2003, 2004, 2005 ++ Free Software Foundation, Inc. ++ + This file is part of the GNU C Library. + + The GNU C Library is free software; you can redistribute it and/or +@@ -32,7 +34,11 @@ + The .S files for the other calls just #define socket and #include this. */ + + #ifndef __socket ++#ifndef NO_WEAK_ALIAS + #define __socket P(__,socket) ++#else ++#define __socket socket ++#endif + #endif + + #define PUSHARGS_1 str a1, [sp, $-4]! +@@ -120,4 +126,6 @@ + + PSEUDO_END (__socket) + ++#ifndef NO_WEAK_ALIAS + weak_alias (__socket, socket) ++#endif diff --git a/patches/glibc/2.3.6/arm-ctl_bus_isa.patch b/patches/glibc/2.3.6/arm-ctl_bus_isa.patch deleted file mode 100644 index 413c685..0000000 --- a/patches/glibc/2.3.6/arm-ctl_bus_isa.patch +++ /dev/null @@ -1,53 +0,0 @@ -Applies to both glibc-2.2.5 and glibc-2.3.2, and probably glibc cvs as of Aug 2004. -Needed to build glibc with linux kernels 2.4.23 or higher on ARM, -Fixes following error: - -../sysdeps/unix/sysv/linux/arm/ioperm.c: In function `init_iosys': -../sysdeps/unix/sysv/linux/arm/ioperm.c:103: error: `BUS_ISA' undeclared (first use in this function) -../sysdeps/unix/sysv/linux/arm/ioperm.c:103: error: (Each undeclared identifier is reported only once -../sysdeps/unix/sysv/linux/arm/ioperm.c:103: error: for each function it appears in.) -../sysdeps/unix/sysv/linux/arm/ioperm.c:103: error: initializer element is not constant -../sysdeps/unix/sysv/linux/arm/ioperm.c:103: error: (near initialization for `iobase_name[1]') -../sysdeps/unix/sysv/linux/arm/ioperm.c:104: error: initializer element is not constant -../sysdeps/unix/sysv/linux/arm/ioperm.c:104: error: (near initialization for `ioshift_name[1]') -make[2]: *** [/home/dank/crosstool-0.28/build/arm-softfloat-linux-gnu/gcc-3.3.4-glibc-2.2.5/build-glibc/misc/ioperm.o] Error 1 - -cf. "[SYSCTL] BUS_ISA -> CTL_BUS_ISA", http://www.ussg.iu.edu/hypermail/linux/kernel/0311.0/0529.html - ---- glibc-2.3.2/sysdeps/unix/sysv/linux/arm/ioperm.c.old 2003-02-20 14:22:24.000000000 -0800 -+++ glibc-2.3.2/sysdeps/unix/sysv/linux/arm/ioperm.c 2004-01-31 16:01:50.000000000 -0800 -@@ -47,6 +47,12 @@ - #include - #include - -+/* see http://www.ussg.iu.edu/hypermail/linux/kernel/0311.0/0529.html */ -+#include -+#if (LINUX_VERSION_CODE < KERNEL_VERSION(2,4,23)) -+#define CTL_BUS_ISA BUS_ISA /* and hope it's not the one from linux/input.h */ -+#endif -+ - #define PATH_ARM_SYSTYPE "/etc/arm_systype" - #define PATH_CPUINFO "/proc/cpuinfo" - -@@ -80,7 +86,7 @@ - * Initialize I/O system. There are several ways to get the information - * we need. Each is tried in turn until one succeeds. - * -- * 1. Sysctl (CTL_BUS, BUS_ISA, ISA_*). This is the preferred method -+ * 1. Sysctl (CTL_BUS, CTL_BUS_ISA, ISA_*). This is the preferred method - * but not all kernels support it. - * - * 2. Read the value (not the contents) of symlink PATH_ARM_SYSTYPE. -@@ -100,8 +106,8 @@ - { - char systype[256]; - int i, n; -- static int iobase_name[] = { CTL_BUS, BUS_ISA, BUS_ISA_PORT_BASE }; -- static int ioshift_name[] = { CTL_BUS, BUS_ISA, BUS_ISA_PORT_SHIFT }; -+ static int iobase_name[] = { CTL_BUS, CTL_BUS_ISA, BUS_ISA_PORT_BASE }; -+ static int ioshift_name[] = { CTL_BUS, CTL_BUS_ISA, BUS_ISA_PORT_SHIFT }; - size_t len = sizeof(io.base); - - if (! sysctl (iobase_name, 3, &io.io_base, &len, NULL, 0) - -Signed-off-by: Robert P. J. Day diff --git a/patches/glibc/2.3.6/fix-pr398.patch b/patches/glibc/2.3.6/fix-pr398.patch deleted file mode 100644 index d5d0309..0000000 --- a/patches/glibc/2.3.6/fix-pr398.patch +++ /dev/null @@ -1,70 +0,0 @@ -Fixes error - -dl-runtime.c:222: error: parse error before "CFI_STARTPROC" -make[2]: *** [crosstool-0.28-rc35/build/s390-unknown-linux-gnu/gcc-3.4.1-glibc-20040822/build-glibc/elf/dl-runtim -e.o] Error 1 -make[2]: Leaving directory `crosstool-0.28-rc35/build/s390-unknown-linux-gnu/gcc-3.4.1-glibc-20040822/glibc-20040 -822/elf' -make[1]: *** [elf/subdir_lib] Error 2 -make[1]: Leaving directory `crosstool-0.28-rc35/build/s390-unknown-linux-gnu/gcc-3.4.1-glibc-20040822/glibc-20040 -822' -make: *** [all] Error 2 - ------------------ - -See http://sources.redhat.com/bugzilla/show_bug.cgi?id=398 -http://sources.redhat.com/ml/libc-alpha/2004-07/msg00023.html - ------------------ - -CVSROOT: /cvs/glibc -Module name: libc -Branch: glibc-2_3-branch -Changes by: roland@sources.redhat.com 2006-02-23 22:36:51 - -Modified files: - sysdeps/s390/s390-64: dl-machine.h - sysdeps/s390/s390-32: dl-machine.h - -Log message: - 2004-07-10 GOTO Masanori - - [BZ #398] - * sysdeps/s390/s390-32/dl-machine.h: Include for CFI - directive. - * sysdeps/s390/s390-64/dl-machine.h: Likewise. - -Patches: -http://sources.redhat.com/cgi-bin/cvsweb.cgi/libc/sysdeps/s390/s390-64/dl-machine.h.diff?cvsroot=glibc&only_with_tag=glibc-2_3-branch&r1=1.19.4.1&r2=1.19.4.2 -http://sources.redhat.com/cgi-bin/cvsweb.cgi/libc/sysdeps/s390/s390-32/dl-machine.h.diff?cvsroot=glibc&only_with_tag=glibc-2_3-branch&r1=1.20.4.1&r2=1.20.4.2 - -=================================================================== -RCS file: /cvs/glibc/libc/sysdeps/s390/s390-64/dl-machine.h,v -retrieving revision 1.19.4.1 -retrieving revision 1.19.4.2 -diff -u -r1.19.4.1 -r1.19.4.2 ---- libc/sysdeps/s390/s390-64/dl-machine.h 2005/10/17 04:57:27 1.19.4.1 -+++ libc/sysdeps/s390/s390-64/dl-machine.h 2006/02/23 22:36:51 1.19.4.2 -@@ -27,6 +27,7 @@ - #include - #include - #include -+#include - - /* This is an older, now obsolete value. */ - #define EM_S390_OLD 0xA390 -=================================================================== -RCS file: /cvs/glibc/libc/sysdeps/s390/s390-32/dl-machine.h,v -retrieving revision 1.20.4.1 -retrieving revision 1.20.4.2 -diff -u -r1.20.4.1 -r1.20.4.2 ---- libc/sysdeps/s390/s390-32/dl-machine.h 2005/10/17 04:57:27 1.20.4.1 -+++ libc/sysdeps/s390/s390-32/dl-machine.h 2006/02/23 22:36:51 1.20.4.2 -@@ -27,6 +27,7 @@ - #include - #include - #include -+#include - - /* This is an older, now obsolete value. */ - #define EM_S390_OLD 0xA390 diff --git a/patches/glibc/2.3.6/glibc-2.3.5-allow-gcc-4.0-wordexp.patch b/patches/glibc/2.3.6/glibc-2.3.5-allow-gcc-4.0-wordexp.patch deleted file mode 100644 index 996359a..0000000 --- a/patches/glibc/2.3.6/glibc-2.3.5-allow-gcc-4.0-wordexp.patch +++ /dev/null @@ -1,21 +0,0 @@ -../sysdeps/generic/wordexp.c: In function 'exec_comm': -../sysdeps/generic/wordexp.c:815: sorry, unimplemented: inlining failed in call to 'exec_comm_child': function body not available -../sysdeps/generic/wordexp.c:900: sorry, unimplemented: called from here -make[2]: *** [/home/dank/queue/jobdir.fast2/crosstool-dev/build/i686-unknown-linux-gnu/gcc-4.0-20050305-glibc-2.3-20050307/build-glibc/posix/wordexp.o] Error - -I had to add the keyword 'inline' to get it to compile: - ---- glibc-2.3-20050307/sysdeps/generic/wordexp.c.old 2005-03-12 08:54:15.709253928 -0800 -+++ glibc-2.3-20050307/sysdeps/generic/wordexp.c 2005-03-12 08:54:51.242852000 -0800 -@@ -809,7 +809,7 @@ - } - - /* Function called by child process in exec_comm() */ --static void -+static inline void - internal_function __attribute__ ((always_inline)) - exec_comm_child (char *comm, int *fildes, int showerr, int noexec) - { - - -Signed-off-by: Robert P. J. Day diff --git a/patches/glibc/2.3.6/glibc-2.3.5-allow-gcc4-wcstol_l.patch b/patches/glibc/2.3.6/glibc-2.3.5-allow-gcc4-wcstol_l.patch deleted file mode 100644 index 0e6776f..0000000 --- a/patches/glibc/2.3.6/glibc-2.3.5-allow-gcc4-wcstol_l.patch +++ /dev/null @@ -1,59 +0,0 @@ -Fixes -../sysdeps/wordsize-64/wcstol_l.c:11: error: '____wcstoll_l_internal' aliased to undefined symbol '____wcstol_l_internal' -../sysdeps/wordsize-64/wcstol_l.c:12: error: '__wcstoll_l' aliased to undefined symbol '__wcstol_l' -../sysdeps/wordsize-64/wcstol_l.c:13: error: 'wcstoll_l' aliased to undefined symbol '__wcstol_l' -make[2]: *** [/home/dkegel/queue/jobdir.produser_cpsm10/crosstool-0.32/build/x86_64-unknown-linux-gnu/gcc-4.0.0-20050410-glibc-2.3.4/build-glibc/wcsmbs/wcstoul_l.o] Error 1 - -https://www.redhat.com/archives/fedora-cvs-commits/2005-March/msg00408.html -%changelog -+* Fri Mar 25 2005 Jakub Jelinek 2.3.4-18 -+- fix build on 64-bit arches with new GCC - -Revision 1.4.2.1, Fri Mar 25 11:59:01 2005 UTC (3 weeks, 4 days ago) by jakub -Branch: fedora-branch -CVS Tags: fedora-glibc-2_3_4-18 -Changes since 1.4: +2 -0 lines -Diff to previous 1.4 (colored) - - * sysdeps/wordsize-64/strtol_l.c: Don't add aliases if UNSIGNED. - * sysdeps/wordsize-64/wcstol_l.c: Likewise. - - -http://sourceware.org/cgi-bin/cvsweb.cgi/libc/sysdeps/wordsize-64/strtol_l.c.diff?r1=1.4&r2=1.4.2.1&cvsroot=glibc -http://sourceware.org/cgi-bin/cvsweb.cgi/libc/sysdeps/wordsize-64/wcstol_l.c.diff?r1=1.4&r2=1.4.2.1&cvsroot=glibc - -=================================================================== -RCS file: /cvs/glibc/libc/sysdeps/wordsize-64/strtol_l.c,v -retrieving revision 1.4 -retrieving revision 1.4.2.1 -diff -u -r1.4 -r1.4.2.1 ---- libc/sysdeps/wordsize-64/strtol_l.c 2003/03/03 09:45:12 1.4 -+++ libc/sysdeps/wordsize-64/strtol_l.c 2005/03/25 11:59:01 1.4.2.1 -@@ -8,7 +8,9 @@ - #undef ____strtoll_l_internal - #undef __strtoll_l - #undef strtoll_l -+#if !UNSIGNED - strong_alias (____strtol_l_internal, ____strtoll_l_internal) - libc_hidden_ver (____strtol_l_internal, ____strtoll_l_internal) - weak_alias (__strtol_l, __strtoll_l) - weak_alias (__strtol_l, strtoll_l) -+#endif -=================================================================== -RCS file: /cvs/glibc/libc/sysdeps/wordsize-64/wcstol_l.c,v -retrieving revision 1.4 -retrieving revision 1.4.2.1 -diff -u -r1.4 -r1.4.2.1 ---- libc/sysdeps/wordsize-64/wcstol_l.c 2002/08/08 11:44:51 1.4 -+++ libc/sysdeps/wordsize-64/wcstol_l.c 2005/03/25 11:59:01 1.4.2.1 -@@ -8,6 +8,8 @@ - #undef ____wcstoll_l_internal - #undef __wcstoll_l - #undef wcstoll_l -+#if !UNSIGNED - strong_alias (____wcstol_l_internal, ____wcstoll_l_internal) - weak_alias (__wcstol_l, __wcstoll_l) - weak_alias (__wcstol_l, wcstoll_l) -+#endif - -Signed-off-by: Robert P. J. Day diff --git a/patches/glibc/2.3.6/glibc-2.3.5-cygwin.patch b/patches/glibc/2.3.6/glibc-2.3.5-cygwin.patch deleted file mode 100644 index 423a1c5..0000000 --- a/patches/glibc/2.3.6/glibc-2.3.5-cygwin.patch +++ /dev/null @@ -1,187 +0,0 @@ -Fixes -elf/librtld.os: In function `process_envvars': : undefined reference to `__access' -... -when building glibc-2.3.x on cygwin - -Idea from -http://sources.redhat.com/ml/bug-glibc/2002-01/msg00071/glibc-2.2-cygin-shared.patch -Basically, make glibc use .oST as suffix for 'object static' -instead of .oS, since cygwin has trouble distinguishing .os from .oS -(Original patch had .on, but .oST is more mnemonic for 'object static') - -glibc-linuxthreads-2.3.5 also requires a patch, see -../glibc-linuxthreads-2.3.5/glibc-linuxthreads-2.3.5-cygwin.patch - -[ forward ported to glibc-2.3.5 by Petr Cvachoucek: - -Message-ID: <4282FCBA.3040000@unicontrols.cz> -Date: Thu, 12 May 2005 08:50:34 +0200 -From: Petr Cvachoucek -To: Dan Kegel -CC: crossgcc@sources.redhat.com -Subject: Patches to build gcc 3.4.3 / glibc 2.3.5 on cygwin - -Hi Dan, -following patches are needed to build gcc-3.4.3/glibc-2.3.5 toolchain -on cygwin. Tested to build toolchains for powerpc 604 and 750 targets. - --- - Petr Cvachoucek - Unicontrols a.s. - http://www.unicontrols.cz -] - -diff -aur glibc-2.3.5/Makeconfig glibc-2.3.5-cygwin/Makeconfig ---- glibc-2.3.5/Makeconfig 2005-02-16 11:50:19.000000000 +0100 -+++ glibc-2.3.5-cygwin/Makeconfig 2005-05-11 08:24:51.046875000 +0200 -@@ -449,7 +449,7 @@ - # run the linked programs. - link-libc = -Wl,-rpath-link=$(rpath-link) \ - $(common-objpfx)libc.so$(libc.so-version) \ -- $(common-objpfx)$(patsubst %,$(libtype.oS),c) $(gnulib) -+ $(common-objpfx)$(patsubst %,$(libtype.oST),c) $(gnulib) - # This is how to find at build-time things that will be installed there. - rpath-dirs = math elf dlfcn nss nis rt resolv crypt - endif -@@ -656,7 +656,7 @@ - # The compilation rules use $(CPPFLAGS-${SUFFIX}) and $(CFLAGS-${SUFFIX}) - # to pass different flags for each flavor. - libtypes = $(foreach o,$(object-suffixes-for-libc),$(libtype$o)) --all-object-suffixes := .o .os .op .og .ob .oS -+all-object-suffixes := .o .os .op .og .ob .oST - object-suffixes := - CPPFLAGS-.o = $(pic-default) - CFLAGS-.o = $(filter %frame-pointer,$(+cflags)) -@@ -712,14 +712,14 @@ - - ifeq (yes,$(build-shared)) - # Build special library that contains the static-only routines for libc. --object-suffixes-for-libc += .oS -+object-suffixes-for-libc += .oST - - # Must build the routines as PIC, though, because they can end up in (users') - # shared objects. We don't want to use CFLAGS-os because users may, for - # example, make that processor-specific. --CFLAGS-.oS = $(CFLAGS-.o) $(PIC-ccflag) --CPPFLAGS-.oS = $(CPPFLAGS-.o) -DPIC -DLIBC_NONSHARED=1 --libtype.oS = lib%_nonshared.a -+CFLAGS-.oST = $(CFLAGS-.o) $(PIC-ccflag) -+CPPFLAGS-.oST = $(CPPFLAGS-.o) -DPIC -DLIBC_NONSHARED=1 -+libtype.oST = lib%_nonshared.a - endif - - # The assembler can generate debug information too. -diff -aur glibc-2.3.5/Makerules glibc-2.3.5-cygwin/Makerules ---- glibc-2.3.5/Makerules 2004-12-15 19:52:39.000000000 +0100 -+++ glibc-2.3.5-cygwin/Makerules 2005-05-11 08:25:33.578125000 +0200 -@@ -416,7 +416,7 @@ - # Bounded pointer thunks are only built for *.ob - elide-bp-thunks = $(addprefix $(bppfx),$(bp-thunks)) - --elide-routines.oS += $(filter-out $(static-only-routines),\ -+elide-routines.oST += $(filter-out $(static-only-routines),\ - $(routines) $(aux) $(sysdep_routines)) \ - $(elide-bp-thunks) - elide-routines.os += $(static-only-routines) $(elide-bp-thunks) -@@ -961,7 +961,7 @@ - install: $(inst_libdir)/libc.so - $(inst_libdir)/libc.so: $(common-objpfx)format.lds \ - $(common-objpfx)libc.so$(libc.so-version) \ -- $(inst_libdir)/$(patsubst %,$(libtype.oS),\ -+ $(inst_libdir)/$(patsubst %,$(libtype.oST),\ - $(libprefix)$(libc-name)) \ - $(+force) - (echo '/* GNU ld script';\ -@@ -969,7 +969,7 @@ - echo ' the static library, so try that secondarily. */';\ - cat $<; \ - echo 'GROUP ( $(slibdir)/libc.so$(libc.so-version)' \ -- '$(libdir)/$(patsubst %,$(libtype.oS),$(libprefix)$(libc-name))'\ -+ '$(libdir)/$(patsubst %,$(libtype.oST),$(libprefix)$(libc-name))'\ - ')' \ - ) > $@.new - mv -f $@.new $@ -diff -aur glibc-2.3.5/extra-lib.mk glibc-2.3.5-cygwin/extra-lib.mk ---- glibc-2.3.5/extra-lib.mk 2004-12-02 23:54:47.000000000 +0100 -+++ glibc-2.3.5-cygwin/extra-lib.mk 2005-05-11 08:27:28.156250000 +0200 -@@ -13,7 +13,7 @@ - - ifneq (,$($(lib)-static-only-routines)) - ifneq (,$(filter yesyes%,$(build-shared)$(elf)$($(lib).so-version))) --object-suffixes-$(lib) += $(filter-out $($(lib)-inhibit-o),.oS) -+object-suffixes-$(lib) += $(filter-out $($(lib)-inhibit-o),.oST) - endif - endif - -@@ -29,7 +29,7 @@ - - # Add each flavor of library to the lists of things to build and install. - install-lib += $(foreach o,$(object-suffixes-$(lib)),$(lib:lib%=$(libtype$o))) --extra-objs += $(foreach o,$(filter-out .os .oS,$(object-suffixes-$(lib))),\ -+extra-objs += $(foreach o,$(filter-out .os .oST,$(object-suffixes-$(lib))),\ - $(patsubst %,%$o,$(filter-out \ - $($(lib)-shared-only-routines),\ - $(all-$(lib)-routines)))) -@@ -57,7 +57,7 @@ - - - # Use o-iterator.mk to generate a rule for each flavor of library. --ifneq (,$(filter-out .os .oS,$(object-suffixes-$(lib)))) -+ifneq (,$(filter-out .os .oST,$(object-suffixes-$(lib)))) - define o-iterator-doit - $(objpfx)$(patsubst %,$(libtype$o),$(lib:lib%=%)): \ - $(patsubst %,$(objpfx)%$o,\ -@@ -65,7 +65,7 @@ - $(all-$(lib)-routines))); \ - $$(build-extra-lib) - endef --object-suffixes-left = $(filter-out .os .oS,$(object-suffixes-$(lib))) -+object-suffixes-left = $(filter-out .os .oST,$(object-suffixes-$(lib))) - include $(patsubst %,$(..)o-iterator.mk,$(object-suffixes-left)) - endif - -@@ -77,9 +77,9 @@ - $(build-extra-lib) - endif - --ifneq (,$(filter .oS,$(object-suffixes-$(lib)))) --$(objpfx)$(patsubst %,$(libtype.oS),$(lib:lib%=%)): \ -- $(patsubst %,$(objpfx)%.oS,\ -+ifneq (,$(filter .oST,$(object-suffixes-$(lib)))) -+$(objpfx)$(patsubst %,$(libtype.oST),$(lib:lib%=%)): \ -+ $(patsubst %,$(objpfx)%.oST,\ - $(filter $($(lib)-static-only-routines),\ - $(all-$(lib)-routines))) - $(build-extra-lib) -diff -aur glibc-2.3.5/nptl/Makefile glibc-2.3.5-cygwin/nptl/Makefile ---- glibc-2.3.5/nptl/Makefile 2005-02-16 09:45:56.000000000 +0100 -+++ glibc-2.3.5-cygwin/nptl/Makefile 2005-05-11 08:26:01.812500000 +0200 -@@ -360,7 +360,7 @@ - - $(inst_libdir)/libpthread.so: $(common-objpfx)format.lds \ - $(objpfx)libpthread.so$(libpthread.so-version) \ -- $(inst_libdir)/$(patsubst %,$(libtype.oS),\ -+ $(inst_libdir)/$(patsubst %,$(libtype.oST),\ - $(libprefix)pthread) \ - $(+force) - (echo '/* GNU ld script';\ -@@ -368,7 +368,7 @@ - echo ' the static library, so try that secondarily. */';\ - cat $<; \ - echo 'GROUP ( $(slibdir)/libpthread.so$(libpthread.so-version)' \ -- '$(libdir)/$(patsubst %,$(libtype.oS),$(libprefix)pthread)'\ -+ '$(libdir)/$(patsubst %,$(libtype.oST),$(libprefix)pthread)'\ - ')' \ - ) > $@.new - mv -f $@.new $@ -diff -aur glibc-2.3.5/sysdeps/sparc/sparc32/sparcv9/Makefile glibc-2.3.5-cygwin/sysdeps/sparc/sparc32/sparcv9/Makefile ---- glibc-2.3.5/sysdeps/sparc/sparc32/sparcv9/Makefile 2004-08-16 08:46:14.000000000 +0200 -+++ glibc-2.3.5-cygwin/sysdeps/sparc/sparc32/sparcv9/Makefile 2005-05-11 08:26:25.937500000 +0200 -@@ -10,4 +10,4 @@ - ASFLAGS-.op += -Wa,-Av9a - ASFLAGS-.og += -Wa,-Av9a - ASFLAGS-.ob += -Wa,-Av9a --ASFLAGS-.oS += -Wa,-Av9a -+ASFLAGS-.oST += -Wa,-Av9a - -Signed-off-by: Robert P. J. Day diff --git a/patches/glibc/2.3.6/glibc-2.3.5-sh-lowlevellock.patch b/patches/glibc/2.3.6/glibc-2.3.5-sh-lowlevellock.patch deleted file mode 100644 index 9af78d1..0000000 --- a/patches/glibc/2.3.6/glibc-2.3.5-sh-lowlevellock.patch +++ /dev/null @@ -1,43 +0,0 @@ -ML: http://sources.redhat.com/ml/libc-hacker/2005-09/msg00002.html - -Date: Mon, 05 Sep 2005 21:07:15 +0900 (JST) -Message-Id: <20050905.210715.15267870.kkojima@rr.iij4u.or.jp> -To: libc-hacker at sources dot redhat dot com -Subject: SH: A typo in lowlevellock.S -From: Kaz Kojima - -Hi, - -The appended patch fixes a typo in a low-level lock function. It -set the correct 3rd argument for the futex syscall in loop. Sorry -for missing such an embarrassing bug. - -Regards, - kaz - -nptl/ChangeLog: -2005-09-05 Kaz Kojima - - * sysdeps/unix/sysv/linux/sh/lowlevellock.S (__lll_mutex_lock_wait): - Fix typo in register name. - ---- glibc.old/nptl/sysdeps/unix/sysv/linux/sh/lowlevellock.S 2004-10-26 04:06:44.000000000 +0900 -+++ glibc/nptl/sysdeps/unix/sysv/linux/sh/lowlevellock.S 2005-09-05 19:18:25.000000000 +0900 -@@ -1,4 +1,4 @@ --/* Copyright (C) 2003, 2004 Free Software Foundation, Inc. -+/* Copyright (C) 2003, 2004, 2005 Free Software Foundation, Inc. - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or -@@ -51,8 +51,8 @@ __lll_mutex_lock_wait: - SYSCALL_INST_PAD - - 2: -- mov #2, r4 -- XCHG (r4, @r8, r2) -+ mov #2, r6 -+ XCHG (r6, @r8, r2) - tst r2, r2 - bf 1b - -Signed-off-by: Robert P. J. Day diff --git a/patches/glibc/2.3.6/glibc-2.3.5-sh-memset.patch b/patches/glibc/2.3.6/glibc-2.3.5-sh-memset.patch deleted file mode 100644 index 1ccc1e1..0000000 --- a/patches/glibc/2.3.6/glibc-2.3.5-sh-memset.patch +++ /dev/null @@ -1,30 +0,0 @@ -From: - http://sources.redhat.com/ml/libc-alpha/2005-07/msg00051.html - http://sources.redhat.com/ml/crossgcc/2005-10/msg00035.html - -Message-ID: <434576E1.6020305@sscd.de> -Date: Thu, 06 Oct 2005 21:11:29 +0200 -From: Alexander Sieb -To: crossgcc at sourceware dot org -Subject: Crosstool sh4-linux-gcc-4.0.2-glibc-2.3.5 patches - -On sh[34]-linux, memset function does not work if 2nd argument is negative -and 3rd argument is greater than 12. -for example, memset(ptr, "\xda", 20) sets 0xff instead of 0xda. - -Attached patch fixes this problem. - - * sysdeps/sh/memset.S (memset): Correct 2nd argument handling. - ---- glibc-2.3.5.old/sysdeps/sh/memset.S 29 Apr 2003 22:47:18 -0000 1.4 -+++ glibc-2.3.5/sysdeps/sh/memset.S 23 Jul 2005 08:37:21 -0000 -@@ -28,6 +28,7 @@ ENTRY(memset) - bt.s L_byte_loop_init - mov r4,r7 - -+ extu.b r5,r5 - swap.b r5,r1 - or r1,r5 - swap.w r5,r1 - -Signed-off-by: Robert P. J. Day diff --git a/patches/glibc/2.3.6/glibc-2.3.6-allow-gcc-4.0-arm.patch b/patches/glibc/2.3.6/glibc-2.3.6-allow-gcc-4.0-arm.patch deleted file mode 100644 index ea885ea..0000000 --- a/patches/glibc/2.3.6/glibc-2.3.6-allow-gcc-4.0-arm.patch +++ /dev/null @@ -1,35 +0,0 @@ -Fixes -In file included from dynamic-link.h:22, - from dl-reloc.c:265: -../sysdeps/arm/dl-machine.h: In function '_dl_relocate_object': -../sysdeps/arm/dl-machine.h:371: error: invalid storage class for function 'fix_bad_pc24' -make[2]: Leaving directory `/home/dank/queue/jobdir.k8/crosstool-dev/build/arm-unknown-linux-gnu/gcc-4.0-20050305-glibc-2.3.6/glibc-2.3.6/elf' - -when building glibc-2.3.6 with gcc-4.0 - -Like -http://sources.redhat.com/cgi-bin/cvsweb.cgi/libc/sysdeps/arm/dl-machine.h.diff?r1=1.51&r2=1.52&cvsroot=glibc -but fixes fix_bad_pc24. - - ---- glibc-2.3.6-orig/sysdeps/arm/dl-machine.h Sun Mar 20 17:54:37 2005 -+++ glibc-2.3.6/sysdeps/arm/dl-machine.h Sun Mar 20 17:57:32 2005 -@@ -357,7 +357,14 @@ - #ifdef RESOLVE - - /* Deal with an out-of-range PC24 reloc. */ --static Elf32_Addr -+#if __GNUC__ >= 4 -+ auto inline Elf32_Addr -+#else -+ static inline Elf32_Addr -+#endif -+#if __GNUC__ >= 4 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 2) -+ __attribute ((always_inline)) -+#endif - fix_bad_pc24 (Elf32_Addr *const reloc_addr, Elf32_Addr value) - { - static void *fix_page; - -Signed-off-by: Robert P. J. Day -with a little editing by dank@kegel.com diff --git a/patches/glibc/2.3.6/glibc-2.3.6-allow-gcc-4.0-elf.patch b/patches/glibc/2.3.6/glibc-2.3.6-allow-gcc-4.0-elf.patch deleted file mode 100644 index ec48544..0000000 --- a/patches/glibc/2.3.6/glibc-2.3.6-allow-gcc-4.0-elf.patch +++ /dev/null @@ -1,67 +0,0 @@ -From http://www.mail-archive.com/pld-cvs-commit@pld-linux.org/msg00229.html -Fixes - rtld.c: In function '_dl_start': - dynamic-link.h:47: error: nested function 'elf_machine_rela_relative' declared but never defined - dynamic-link.h:41: error: nested function 'elf_machine_rela' declared but never defined -when compiling glibc-2.3.4 with gcc-4.0 - -But see also -http://sources.redhat.com/ml/libc-hacker/2005-02/msg00000.html -and -http://sources.redhat.com/ml/libc-hacker/2005-03/msg00008.html -which seem to propose less radical fixes? - -Aha. See also http://sources.redhat.com/bugzilla/show_bug.cgi?id=721 - ---- glibc-2.3.6.orig/elf/dynamic-link.h 2005-03-12 18:12:37.000000000 -0800 -+++ glibc-2.3.6/elf/dynamic-link.h 2005-03-12 18:12:59.777820848 -0800 -@@ -19,47 +19,6 @@ - - #include - #include -- --#ifdef RESOLVE --/* We pass reloc_addr as a pointer to void, as opposed to a pointer to -- ElfW(Addr), because not all architectures can assume that the -- relocated address is properly aligned, whereas the compiler is -- entitled to assume that a pointer to a type is properly aligned for -- the type. Even if we cast the pointer back to some other type with -- less strict alignment requirements, the compiler might still -- remember that the pointer was originally more aligned, thereby -- optimizing away alignment tests or using word instructions for -- copying memory, breaking the very code written to handle the -- unaligned cases. */ --# if ! ELF_MACHINE_NO_REL --auto inline void __attribute__((always_inline)) --elf_machine_rel (struct link_map *map, const ElfW(Rel) *reloc, -- const ElfW(Sym) *sym, const struct r_found_version *version, -- void *const reloc_addr); --auto inline void __attribute__((always_inline)) --elf_machine_rel_relative (ElfW(Addr) l_addr, const ElfW(Rel) *reloc, -- void *const reloc_addr); --# endif --# if ! ELF_MACHINE_NO_RELA --auto inline void __attribute__((always_inline)) --elf_machine_rela (struct link_map *map, const ElfW(Rela) *reloc, -- const ElfW(Sym) *sym, const struct r_found_version *version, -- void *const reloc_addr); --auto inline void __attribute__((always_inline)) --elf_machine_rela_relative (ElfW(Addr) l_addr, const ElfW(Rela) *reloc, -- void *const reloc_addr); --# endif --# if ELF_MACHINE_NO_RELA || defined ELF_MACHINE_PLT_REL --auto inline void __attribute__((always_inline)) --elf_machine_lazy_rel (struct link_map *map, -- ElfW(Addr) l_addr, const ElfW(Rel) *reloc); --# else --auto inline void __attribute__((always_inline)) --elf_machine_lazy_rel (struct link_map *map, -- ElfW(Addr) l_addr, const ElfW(Rela) *reloc); --# endif --#endif -- - #include - - #ifndef VERSYMIDX - -Signed-off-by: Robert P. J. Day diff --git a/patches/glibc/2.3.6/glibc-2.3.6-configure-apple-as.patch b/patches/glibc/2.3.6/glibc-2.3.6-configure-apple-as.patch deleted file mode 100644 index 5d9943a..0000000 --- a/patches/glibc/2.3.6/glibc-2.3.6-configure-apple-as.patch +++ /dev/null @@ -1,25 +0,0 @@ -http://in3www.epfl.ch/~schaffne/glibc-configure-apple-as.patch -http://sources.redhat.com/ml/crossgcc/2004-02/msg00151.html - -The following makes it possible to configure glibc-2.3.2 on Mac OS X, -where the assembler but doesn't understand the --version flag. - -Fixes the symptom -checking whether ld is GNU ld... no -checking for /usr/libexec/gcc/darwin/ppc/as... /usr/libexec/gcc/darwin/ppc/as -checking version of /usr/libexec/gcc/darwin/ppc/as... - - ---- glibc-2.3.2/configure~ Wed Feb 26 09:20:48 2003 -+++ glibc-2.3.2/configure Fri Feb 27 13:12:53 2004 -@@ -3914,7 +3914,7 @@ - # Found it, now check the version. - echo "$as_me:$LINENO: checking version of $AS" >&5 - echo $ECHO_N "checking version of $AS... $ECHO_C" >&6 -- ac_prog_version=`$AS --version 2>&1 | sed -n 's/^.*GNU assembler.* \([0-9]*\.[0-9.]*\).*$/\1/p'` -+ ac_prog_version=`$AS -v &1 | sed -n 's/^.*GNU assembler.* \([0-9]*\.[0-9.]*\).*$/\1/p'` - case $ac_prog_version in - '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;; - 2.1[3-9]*) - -Signed-off-by: Robert P. J. Day diff --git a/patches/glibc/2.3.6/glibc-2.3.6-fix-pr631.patch b/patches/glibc/2.3.6/glibc-2.3.6-fix-pr631.patch deleted file mode 100644 index 899fa2a..0000000 --- a/patches/glibc/2.3.6/glibc-2.3.6-fix-pr631.patch +++ /dev/null @@ -1,45 +0,0 @@ -From dank@kegel.com -Wed Jun 15 09:12:43 PDT 2005 - -Fixes - -build-glibc/libc.a(nsswitch.o)(.data+0x64): undefined reference to `_nss_files_getaliasent_r' -build-glibc/libc.a(nsswitch.o)(.data+0x6c): undefined reference to `_nss_files_endaliasent' -... 53 lines deleted ... -build-glibc/libc.a(nsswitch.o)(.data+0x21c): undefined reference to `_nss_files_getspnam_r' -collect2: ld returned 1 exit status -make[2]: *** [/build/gcc-3.4.3-glibc-2.3.5-hdrs-2.6.11.2/i686-unknown-linux-gnu/build-glibc/elf/ldconfig] Error 1 - -when building glibc with --enable-static-nss. - -See http://sources.redhat.com/bugzilla/show_bug.cgi?id=631 - ---- glibc-2.3.5/Makeconfig.old Wed Jun 15 08:13:12 2005 -+++ glibc-2.3.5/Makeconfig Wed Jun 15 08:13:14 2005 -@@ -487,7 +487,7 @@ - - # The static libraries. - ifeq (yes,$(build-static)) --link-libc-static = $(common-objpfx)libc.a $(static-gnulib) $(common-objpfx)libc.a -+link-libc-static = $(common-objpfx)libc.a $(static-gnulib) $(otherlibs) $(common-objpfx)libc.a - else - ifeq (yes,$(build-shared)) - # We can try to link the programs with lib*_pic.a... ---- glibc-2.3.5/elf/Makefile.old Wed Jun 15 07:46:49 2005 -+++ glibc-2.3.5/elf/Makefile Wed Jun 15 08:14:00 2005 -@@ -115,6 +115,13 @@ - install-bin-script = ldd - endif - -+ifeq (yes,$(build-static-nss)) -+nssobjdir := $(patsubst ../$(subdir),.,$(common-objpfx)nss) -+resolvobjdir := $(patsubst ../$(subdir),.,$(common-objpfx)resolv) -+otherlibs += $(nssobjdir)/libnss_files.a $(resolvobjdir)/libnss_dns.a \ -+ $(resolvobjdir)/libresolv.a -+endif -+ - others = sprof sln - install-bin = sprof - others-static = sln - -Signed-off-by: Robert P. J. Day diff --git a/patches/glibc/2.3.6/glibc-fp-byteorder.patch b/patches/glibc/2.3.6/glibc-fp-byteorder.patch deleted file mode 100644 index d45cdbc..0000000 --- a/patches/glibc/2.3.6/glibc-fp-byteorder.patch +++ /dev/null @@ -1,205 +0,0 @@ -Taken from http://sources.redhat.com/ml/crossgcc/2004-02/msg00104.html -Author: addsub@eyou.com -Target: ARM - -Fixes http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/gcc.c-torture/execute/920501-8.c -and makes printf("%f", 1.0) work. - -Lennert Buytenhek wrote in http://sources.redhat.com/ml/crossgcc/2004-09/msg00115.html : - It ... fixes the 'printf("%f\n", 0.5); prints 0.000000' and general 'floating point - is broken' on my big-endian hardfloat FPA ARM platform. ... - It's definitely needed for hardfloat. So I'd think it's needed for - big-endian systems in any case, and for VFP on little-endian systems - too. Someone would have to verify that though. - -Lennert Buytenhek wrote in http://sources.redhat.com/ml/crossgcc/2004-09/msg00123.html - I just had a look at glibc-20040830, and [this patch] is still needed and useful - for this version. glibc-20040830 out-of-the-box still contains the - following wrong assumptions: - - sysdeps/arm/bits/endian.h: float word order is big endian (which it is - not on vfp systems) - - sysdeps/arm/gmp-mparam.h: IEEE doubles are mixed endian (which they - are not on big endian systems, neither on vfp systems) - - sysdeps/arm/ieee754.h: IEEE doubles are in little endian byte order - (which they are not on big endian systems) - [This patch] seems the right solution for all of these issues. - -Dimitry Andric wrote in http://sources.redhat.com/ml/crossgcc/2004-09/msg00132.html : - It's even needed for glibc CVS, AFAICS. - The patch hunk which modifies glibc.new/sysdeps/arm/bits/endian.h - (currently at version 1.4) is only needed for proper VFP operation. - But the hunk which modifies sysdeps/arm/gmp-mparam.h, and the hunk - that deletes sysdeps/arm/ieee754.h (yes, this IS correct), are needed - for proper operation of *any* FP model on big endian ARM. - -See also discussion in followups to -http://sources.redhat.com/ml/crossgcc/2004-05/msg00245.html) - -Message-ID: <276985760.37584@eyou.com> -Received: from unknown (HELO eyou.com) (172.16.2.2) - by 0.0.0.0 with SMTP; Tue, 17 Feb 2004 10:42:40 +0800 -Received: (qmail 8238 invoked by uid 65534); 17 Feb 2004 10:42:38 +0800 -Date: 17 Feb 2004 10:42:38 +0800 -Message-ID: <20040217104238.8237.qmail@eyou.com> -From: "add" -To: dank@kegel.com -Reply-To: "add" -Subject: Re:   problem while building arm vfp softfloat gcc ` - -Hi, Dan, This is a patch I applied to my glibc-2.3.2, then my softfloat -toolchain can printf("%f\n",1.0). So you may have a try of this - - -diff -uNrp glibc.old/sysdeps/arm/bits/endian.h glibc.new/sysdeps/arm/bits/endian.h ---- glibc.old/sysdeps/arm/bits/endian.h 1999-04-12 11:59:13.000000000 -0400 -+++ glibc.new/sysdeps/arm/bits/endian.h 2004-02-12 09:15:13.000000000 -0500 -@@ -9,4 +9,9 @@ - #else - #define __BYTE_ORDER __LITTLE_ENDIAN - #endif -+ -+#ifdef __VFP_FP__ -+#define __FLOAT_WORD_ORDER __BYTE_ORDER -+#else - #define __FLOAT_WORD_ORDER __BIG_ENDIAN -+#endif -diff -uNrp glibc.old/sysdeps/arm/gmp-mparam.h glibc.new/sysdeps/arm/gmp-mparam.h ---- glibc.old/sysdeps/arm/gmp-mparam.h 2001-07-07 15:21:19.000000000 -0400 -+++ glibc.new/sysdeps/arm/gmp-mparam.h 2004-02-12 09:15:13.000000000 -0500 -@@ -26,5 +26,13 @@ MA 02111-1307, USA. */ - #define BITS_PER_SHORTINT 16 - #define BITS_PER_CHAR 8 - --#define IEEE_DOUBLE_BIG_ENDIAN 0 --#define IEEE_DOUBLE_MIXED_ENDIAN 1 -+#if defined(__ARMEB__) -+# define IEEE_DOUBLE_MIXED_ENDIAN 0 -+# define IEEE_DOUBLE_BIG_ENDIAN 1 -+#elif defined(__VFP_FP__) -+# define IEEE_DOUBLE_MIXED_ENDIAN 0 -+# define IEEE_DOUBLE_BIG_ENDIAN 0 -+#else -+# define IEEE_DOUBLE_BIG_ENDIAN 0 -+# define IEEE_DOUBLE_MIXED_ENDIAN 1 -+#endif -diff -uNrp glibc.old/sysdeps/arm/ieee754.h glibc.new/sysdeps/arm/ieee754.h ---- glibc.old/sysdeps/arm/ieee754.h 2001-07-07 15:21:19.000000000 -0400 -+++ glibc.new/sysdeps/arm/ieee754.h 1969-12-31 19:00:00.000000000 -0500 -@@ -1,115 +0,0 @@ --/* Copyright (C) 1992, 1995, 1996, 1998 Free Software Foundation, Inc. -- This file is part of the GNU C Library. -- -- The GNU C Library is free software; you can redistribute it and/or -- modify it under the terms of the GNU Lesser General Public -- License as published by the Free Software Foundation; either -- version 2.1 of the License, or (at your option) any later version. -- -- The GNU C Library 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 -- Lesser General Public License for more details. -- -- You should have received a copy of the GNU Lesser General Public -- License along with the GNU C Library; if not, write to the Free -- Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA -- 02111-1307 USA. */ -- --#ifndef _IEEE754_H -- --#define _IEEE754_H 1 --#include -- --#include -- --__BEGIN_DECLS -- --union ieee754_float -- { -- float f; -- -- /* This is the IEEE 754 single-precision format. */ -- struct -- { -- unsigned int mantissa:23; -- unsigned int exponent:8; -- unsigned int negative:1; -- } ieee; -- -- /* This format makes it easier to see if a NaN is a signalling NaN. */ -- struct -- { -- unsigned int mantissa:22; -- unsigned int quiet_nan:1; -- unsigned int exponent:8; -- unsigned int negative:1; -- } ieee_nan; -- }; -- --#define IEEE754_FLOAT_BIAS 0x7f /* Added to exponent. */ -- -- --union ieee754_double -- { -- double d; -- -- /* This is the IEEE 754 double-precision format. */ -- struct -- { -- unsigned int mantissa0:20; -- unsigned int exponent:11; -- unsigned int negative:1; -- unsigned int mantissa1:32; -- } ieee; -- -- /* This format makes it easier to see if a NaN is a signalling NaN. */ -- struct -- { -- unsigned int mantissa0:19; -- unsigned int quiet_nan:1; -- unsigned int exponent:11; -- unsigned int negative:1; -- unsigned int mantissa1:32; -- } ieee_nan; -- }; -- --#define IEEE754_DOUBLE_BIAS 0x3ff /* Added to exponent. */ -- -- --/* The following two structures are correct for `new' floating point systems but -- wrong for the old FPPC. The only solution seems to be to avoid their use on -- old hardware. */ -- --union ieee854_long_double -- { -- long double d; -- -- /* This is the IEEE 854 double-extended-precision format. */ -- struct -- { -- unsigned int exponent:15; -- unsigned int empty:16; -- unsigned int negative:1; -- unsigned int mantissa1:32; -- unsigned int mantissa0:32; -- } ieee; -- -- /* This is for NaNs in the IEEE 854 double-extended-precision format. */ -- struct -- { -- unsigned int exponent:15; -- unsigned int empty:16; -- unsigned int negative:1; -- unsigned int mantissa1:32; -- unsigned int mantissa0:30; -- unsigned int quiet_nan:1; -- unsigned int one:1; -- } ieee_nan; -- }; -- --#define IEEE854_LONG_DOUBLE_BIAS 0x3fff -- --__END_DECLS -- --#endif /* ieee754.h */ - -Signed-off-by: Robert P. J. Day diff --git a/patches/glibc/2.3.6/glibc-mips-bootstrap-gcc-header-install.patch b/patches/glibc/2.3.6/glibc-mips-bootstrap-gcc-header-install.patch deleted file mode 100644 index 2fd72f8..0000000 --- a/patches/glibc/2.3.6/glibc-mips-bootstrap-gcc-header-install.patch +++ /dev/null @@ -1,37 +0,0 @@ -http://sourceware.org/ml/crossgcc/2005-05/msg00165.html -Fixes a MIPS build problem (unrelated to NPTL) - -Message-ID: <428E8B24.1000201@realitydiluted.com> -Date: Fri, 20 May 2005 20:13:08 -0500 -From: "Steven J dot Hill" -To: crossgcc at sources dot redhat dot com, toolchain at gentoo dot org, - Shay_Gal-On at pmc-sierra dot com, TheNop at gmx dot net -Subject: New NPTL patches for crosstools and MIPS NPTL patches.... - -Greetings. - -I have uploaded the latest NPTL patch for crosstool-0.34. I have also -uploaded a tarball of the patches necessary to build a MIPS NPTL -cross toolchain. To build a MIPS NPTL toolchain you will need the -released version of binutils-2.16 and the absolute latest GCC and -glibc code from the HEAD of cvs. Use the 'demo-mips-nptl.sh' script -to build the toolchain. Please report bugs or issues to the crossgcc -mailing list. Here is the link off of my FTP site: - - ftp://ftp.realitydiluted.com/crosstools/crosstool-0.34/ - -[Note: BOOTSTRAP_GCC is set by crosstool.sh when invoking make install-headers] - -diff -ur glibc-2.4.0-20050406/sysdeps/mips/mips32/Makefile glibc-2.4.0-20050406-patched/sysdeps/mips/mips32/Makefile ---- glibc-2.4.0-20050406/sysdeps/mips/mips32/Makefile 2003-03-29 02:15:28.000000000 -0600 -+++ glibc-2.4.0-20050406-patched/sysdeps/mips/mips32/Makefile 2005-04-12 21:36:51.318837655 -0500 -@@ -1,3 +1,7 @@ -+ifeq ($(filter -DBOOTSTRAP_GCC,$(CFLAGS)),) - ifeq ($(filter -mabi=32,$(CC)),) - CC += -mabi=32 - endif -+else -+CC += -D"_MIPS_SZPTR=32" -+endif - -Signed-off-by: Robert P. J. Day diff --git a/patches/glibc/2.3.6/make-install-lib-all.patch b/patches/glibc/2.3.6/make-install-lib-all.patch deleted file mode 100644 index 1e69bb2..0000000 --- a/patches/glibc/2.3.6/make-install-lib-all.patch +++ /dev/null @@ -1,26 +0,0 @@ -From http://svn.exactcode.de/t2/trunk/package/base/glibc32/make-install-lib-all.patch -Rule to install all needed libraries, not just the ones installed by install-lib, -yet not install programs. -Needed because we can't use the main install target, as we can't build programs before -we have the final gcc installed; linking fails because libeh.a is not present, -and glibc insists on linking programs with that library. - -diff -Naur glibc-2.3.4.orig/Makerules glibc-2.3.4/Makerules ---- glibc-2.3.4.orig/Makerules 2004-12-15 20:52:39.000000000 +0200 -+++ glibc-2.3.4/Makerules 2005-02-19 15:16:31.415125176 +0200 -@@ -844,6 +844,13 @@ - installed-libcs := $(foreach o,$(filter-out .os,$(object-suffixes-for-libc)),\ - $(inst_libdir)/$(patsubst %,$(libtype$o),\ - $(libprefix)$(libc-name))) -+ -+install-lib-all: $(inst_slibdir)/libc.so$(libc.so-version) \ -+ $(inst_slibdir)/libc-$(version).so \ -+ $(inst_libdir)/libc.so \ -+ $(inst_libdir)/libc.a \ -+ install-lib -+ - install: $(installed-libcs) - $(installed-libcs): $(inst_libdir)/lib$(libprefix)%: lib $(+force) - $(make-target-directory) - -Signed-off-by: Robert P. J. Day diff --git a/patches/glibc/2.3.6/weakalias.patch b/patches/glibc/2.3.6/weakalias.patch deleted file mode 100644 index 722365f..0000000 --- a/patches/glibc/2.3.6/weakalias.patch +++ /dev/null @@ -1,45 +0,0 @@ -This one was taken from debian. - -# DP: Description: Fix __bind redefinition problem -# DP: Related bugs: -# DP: Dpatch author: Phil Blundell -# DP: Patch author: Daniel Jacobowitz -# DP: Upstream status: In CVS -# DP: Status Details: -# DP: Date: 2005-12-25 - -Index: sysdeps/unix/sysv/linux/arm/socket.S -=================================================================== -RCS file: /cvs/glibc/ports/sysdeps/unix/sysv/linux/arm/socket.S,v -retrieving revision 1.12 -retrieving revision 1.13 -diff -u -r1.12 -r1.13 ---- glibc-2.3.6.ds1.orig/sysdeps/unix/sysv/linux/arm/socket.S 4 Dec 2004 21:20:16 -0000 1.12 -+++ glibc-2.3.6.ds1/sysdeps/unix/sysv/linux/arm/socket.S 27 Oct 2005 18:50:12 -0000 1.13 -@@ -1,4 +1,6 @@ --/* Copyright (C) 1995, 1996, 1997, 1998, 2003 Free Software Foundation, Inc. -+/* Copyright (C) 1995, 1996, 1997, 1998, 2003, 2004, 2005 -+ Free Software Foundation, Inc. -+ - This file is part of the GNU C Library. - - The GNU C Library is free software; you can redistribute it and/or -@@ -32,7 +34,11 @@ - The .S files for the other calls just #define socket and #include this. */ - - #ifndef __socket -+#ifndef NO_WEAK_ALIAS - #define __socket P(__,socket) -+#else -+#define __socket socket -+#endif - #endif - - #define PUSHARGS_1 str a1, [sp, $-4]! -@@ -120,4 +126,6 @@ - - PSEUDO_END (__socket) - -+#ifndef NO_WEAK_ALIAS - weak_alias (__socket, socket) -+#endif diff --git a/patches/glibc/2.5.1/100-fix-pr398.patch b/patches/glibc/2.5.1/100-fix-pr398.patch new file mode 100644 index 0000000..d5d0309 --- /dev/null +++ b/patches/glibc/2.5.1/100-fix-pr398.patch @@ -0,0 +1,70 @@ +Fixes error + +dl-runtime.c:222: error: parse error before "CFI_STARTPROC" +make[2]: *** [crosstool-0.28-rc35/build/s390-unknown-linux-gnu/gcc-3.4.1-glibc-20040822/build-glibc/elf/dl-runtim +e.o] Error 1 +make[2]: Leaving directory `crosstool-0.28-rc35/build/s390-unknown-linux-gnu/gcc-3.4.1-glibc-20040822/glibc-20040 +822/elf' +make[1]: *** [elf/subdir_lib] Error 2 +make[1]: Leaving directory `crosstool-0.28-rc35/build/s390-unknown-linux-gnu/gcc-3.4.1-glibc-20040822/glibc-20040 +822' +make: *** [all] Error 2 + +----------------- + +See http://sources.redhat.com/bugzilla/show_bug.cgi?id=398 +http://sources.redhat.com/ml/libc-alpha/2004-07/msg00023.html + +----------------- + +CVSROOT: /cvs/glibc +Module name: libc +Branch: glibc-2_3-branch +Changes by: roland@sources.redhat.com 2006-02-23 22:36:51 + +Modified files: + sysdeps/s390/s390-64: dl-machine.h + sysdeps/s390/s390-32: dl-machine.h + +Log message: + 2004-07-10 GOTO Masanori + + [BZ #398] + * sysdeps/s390/s390-32/dl-machine.h: Include for CFI + directive. + * sysdeps/s390/s390-64/dl-machine.h: Likewise. + +Patches: +http://sources.redhat.com/cgi-bin/cvsweb.cgi/libc/sysdeps/s390/s390-64/dl-machine.h.diff?cvsroot=glibc&only_with_tag=glibc-2_3-branch&r1=1.19.4.1&r2=1.19.4.2 +http://sources.redhat.com/cgi-bin/cvsweb.cgi/libc/sysdeps/s390/s390-32/dl-machine.h.diff?cvsroot=glibc&only_with_tag=glibc-2_3-branch&r1=1.20.4.1&r2=1.20.4.2 + +=================================================================== +RCS file: /cvs/glibc/libc/sysdeps/s390/s390-64/dl-machine.h,v +retrieving revision 1.19.4.1 +retrieving revision 1.19.4.2 +diff -u -r1.19.4.1 -r1.19.4.2 +--- libc/sysdeps/s390/s390-64/dl-machine.h 2005/10/17 04:57:27 1.19.4.1 ++++ libc/sysdeps/s390/s390-64/dl-machine.h 2006/02/23 22:36:51 1.19.4.2 +@@ -27,6 +27,7 @@ + #include + #include + #include ++#include + + /* This is an older, now obsolete value. */ + #define EM_S390_OLD 0xA390 +=================================================================== +RCS file: /cvs/glibc/libc/sysdeps/s390/s390-32/dl-machine.h,v +retrieving revision 1.20.4.1 +retrieving revision 1.20.4.2 +diff -u -r1.20.4.1 -r1.20.4.2 +--- libc/sysdeps/s390/s390-32/dl-machine.h 2005/10/17 04:57:27 1.20.4.1 ++++ libc/sysdeps/s390/s390-32/dl-machine.h 2006/02/23 22:36:51 1.20.4.2 +@@ -27,6 +27,7 @@ + #include + #include + #include ++#include + + /* This is an older, now obsolete value. */ + #define EM_S390_OLD 0xA390 diff --git a/patches/glibc/2.5.1/110-glibc-2.3.5-allow-gcc4-wcstol_l.patch b/patches/glibc/2.5.1/110-glibc-2.3.5-allow-gcc4-wcstol_l.patch new file mode 100644 index 0000000..0e6776f --- /dev/null +++ b/patches/glibc/2.5.1/110-glibc-2.3.5-allow-gcc4-wcstol_l.patch @@ -0,0 +1,59 @@ +Fixes +../sysdeps/wordsize-64/wcstol_l.c:11: error: '____wcstoll_l_internal' aliased to undefined symbol '____wcstol_l_internal' +../sysdeps/wordsize-64/wcstol_l.c:12: error: '__wcstoll_l' aliased to undefined symbol '__wcstol_l' +../sysdeps/wordsize-64/wcstol_l.c:13: error: 'wcstoll_l' aliased to undefined symbol '__wcstol_l' +make[2]: *** [/home/dkegel/queue/jobdir.produser_cpsm10/crosstool-0.32/build/x86_64-unknown-linux-gnu/gcc-4.0.0-20050410-glibc-2.3.4/build-glibc/wcsmbs/wcstoul_l.o] Error 1 + +https://www.redhat.com/archives/fedora-cvs-commits/2005-March/msg00408.html +%changelog ++* Fri Mar 25 2005 Jakub Jelinek 2.3.4-18 ++- fix build on 64-bit arches with new GCC + +Revision 1.4.2.1, Fri Mar 25 11:59:01 2005 UTC (3 weeks, 4 days ago) by jakub +Branch: fedora-branch +CVS Tags: fedora-glibc-2_3_4-18 +Changes since 1.4: +2 -0 lines +Diff to previous 1.4 (colored) + + * sysdeps/wordsize-64/strtol_l.c: Don't add aliases if UNSIGNED. + * sysdeps/wordsize-64/wcstol_l.c: Likewise. + + +http://sourceware.org/cgi-bin/cvsweb.cgi/libc/sysdeps/wordsize-64/strtol_l.c.diff?r1=1.4&r2=1.4.2.1&cvsroot=glibc +http://sourceware.org/cgi-bin/cvsweb.cgi/libc/sysdeps/wordsize-64/wcstol_l.c.diff?r1=1.4&r2=1.4.2.1&cvsroot=glibc + +=================================================================== +RCS file: /cvs/glibc/libc/sysdeps/wordsize-64/strtol_l.c,v +retrieving revision 1.4 +retrieving revision 1.4.2.1 +diff -u -r1.4 -r1.4.2.1 +--- libc/sysdeps/wordsize-64/strtol_l.c 2003/03/03 09:45:12 1.4 ++++ libc/sysdeps/wordsize-64/strtol_l.c 2005/03/25 11:59:01 1.4.2.1 +@@ -8,7 +8,9 @@ + #undef ____strtoll_l_internal + #undef __strtoll_l + #undef strtoll_l ++#if !UNSIGNED + strong_alias (____strtol_l_internal, ____strtoll_l_internal) + libc_hidden_ver (____strtol_l_internal, ____strtoll_l_internal) + weak_alias (__strtol_l, __strtoll_l) + weak_alias (__strtol_l, strtoll_l) ++#endif +=================================================================== +RCS file: /cvs/glibc/libc/sysdeps/wordsize-64/wcstol_l.c,v +retrieving revision 1.4 +retrieving revision 1.4.2.1 +diff -u -r1.4 -r1.4.2.1 +--- libc/sysdeps/wordsize-64/wcstol_l.c 2002/08/08 11:44:51 1.4 ++++ libc/sysdeps/wordsize-64/wcstol_l.c 2005/03/25 11:59:01 1.4.2.1 +@@ -8,6 +8,8 @@ + #undef ____wcstoll_l_internal + #undef __wcstoll_l + #undef wcstoll_l ++#if !UNSIGNED + strong_alias (____wcstol_l_internal, ____wcstoll_l_internal) + weak_alias (__wcstol_l, __wcstoll_l) + weak_alias (__wcstol_l, wcstoll_l) ++#endif + +Signed-off-by: Robert P. J. Day diff --git a/patches/glibc/2.5.1/120-glibc-2.3.5-cygwin.patch b/patches/glibc/2.5.1/120-glibc-2.3.5-cygwin.patch new file mode 100644 index 0000000..3c0cd7d --- /dev/null +++ b/patches/glibc/2.5.1/120-glibc-2.3.5-cygwin.patch @@ -0,0 +1,187 @@ +Fixes +elf/librtld.os: In function `process_envvars': : undefined reference to `__access' +... +when building glibc-2.3.x on cygwin + +Idea from +http://sources.redhat.com/ml/bug-glibc/2002-01/msg00071/glibc-2.2-cygin-shared.patch +Basically, make glibc use .oST as suffix for 'object static' +instead of .oS, since cygwin has trouble distinguishing .os from .oS +(Original patch had .on, but .oST is more mnemonic for 'object static') + +glibc-linuxthreads-2.3.5 also requires a patch, see +../glibc-linuxthreads-2.3.5/glibc-linuxthreads-2.3.5-cygwin.patch + +[ forward ported to glibc-2.3.5 by Petr Cvachoucek: + +Message-ID: <4282FCBA.3040000@unicontrols.cz> +Date: Thu, 12 May 2005 08:50:34 +0200 +From: Petr Cvachoucek +To: Dan Kegel +CC: crossgcc@sources.redhat.com +Subject: Patches to build gcc 3.4.3 / glibc 2.3.5 on cygwin + +Hi Dan, +following patches are needed to build gcc-3.4.3/glibc-2.3.5 toolchain +on cygwin. Tested to build toolchains for powerpc 604 and 750 targets. + +-- + Petr Cvachoucek + Unicontrols a.s. + http://www.unicontrols.cz +] + +diff -aur glibc-2.3.5/Makeconfig glibc-2.3.5-cygwin/Makeconfig +--- glibc-2.3.5/Makeconfig 2005-02-16 11:50:19.000000000 +0100 ++++ glibc-2.3.5-cygwin/Makeconfig 2005-05-11 08:24:51.046875000 +0200 +@@ -472,7 +472,7 @@ + # run the linked programs. + link-libc = -Wl,-rpath-link=$(rpath-link) \ + $(common-objpfx)libc.so$(libc.so-version) \ +- $(common-objpfx)$(patsubst %,$(libtype.oS),c) $(gnulib) ++ $(common-objpfx)$(patsubst %,$(libtype.oST),c) $(gnulib) + # This is how to find at build-time things that will be installed there. + rpath-dirs = math elf dlfcn nss nis rt resolv crypt + endif +@@ -693,7 +693,7 @@ + # The compilation rules use $(CPPFLAGS-${SUFFIX}) and $(CFLAGS-${SUFFIX}) + # to pass different flags for each flavor. + libtypes = $(foreach o,$(object-suffixes-for-libc),$(libtype$o)) +-all-object-suffixes := .o .os .op .og .ob .oS ++all-object-suffixes := .o .os .op .og .ob .oST + object-suffixes := + CPPFLAGS-.o = $(pic-default) + CFLAGS-.o = $(filter %frame-pointer,$(+cflags)) +@@ -749,14 +749,14 @@ + + ifeq (yes,$(build-shared)) + # Build special library that contains the static-only routines for libc. +-object-suffixes-for-libc += .oS ++object-suffixes-for-libc += .oST + + # Must build the routines as PIC, though, because they can end up in (users') + # shared objects. We don't want to use CFLAGS-os because users may, for + # example, make that processor-specific. +-CFLAGS-.oS = $(CFLAGS-.o) $(PIC-ccflag) +-CPPFLAGS-.oS = $(CPPFLAGS-.o) -DPIC -DLIBC_NONSHARED=1 +-libtype.oS = lib%_nonshared.a ++CFLAGS-.oST = $(CFLAGS-.o) $(PIC-ccflag) ++CPPFLAGS-.oST = $(CPPFLAGS-.o) -DPIC -DLIBC_NONSHARED=1 ++libtype.oST = lib%_nonshared.a + endif + + # The assembler can generate debug information too. +diff -aur glibc-2.3.5/Makerules glibc-2.3.5-cygwin/Makerules +--- glibc-2.3.5/Makerules 2004-12-15 19:52:39.000000000 +0100 ++++ glibc-2.3.5-cygwin/Makerules 2005-05-11 08:25:33.578125000 +0200 +@@ -417,7 +417,7 @@ + # Bounded pointer thunks are only built for *.ob + elide-bp-thunks = $(addprefix $(bppfx),$(bp-thunks)) + +-elide-routines.oS += $(filter-out $(static-only-routines),\ ++elide-routines.oST += $(filter-out $(static-only-routines),\ + $(routines) $(aux) $(sysdep_routines)) \ + $(elide-bp-thunks) + elide-routines.os += $(static-only-routines) $(elide-bp-thunks) +@@ -981,7 +981,7 @@ + install: $(inst_libdir)/libc.so + $(inst_libdir)/libc.so: $(common-objpfx)format.lds \ + $(common-objpfx)libc.so$(libc.so-version) \ +- $(inst_libdir)/$(patsubst %,$(libtype.oS),\ ++ $(inst_libdir)/$(patsubst %,$(libtype.oST),\ + $(libprefix)$(libc-name)) \ + $(+force) + (echo '/* GNU ld script';\ +@@ -989,7 +989,7 @@ + echo ' the static library, so try that secondarily. */';\ + cat $<; \ + echo 'GROUP ( $(slibdir)/libc.so$(libc.so-version)' \ +- '$(libdir)/$(patsubst %,$(libtype.oS),$(libprefix)$(libc-name))'\ ++ '$(libdir)/$(patsubst %,$(libtype.oST),$(libprefix)$(libc-name))'\ + ' AS_NEEDED (' $(slibdir)/$(rtld-installed-name) ') )' \ + ) > $@.new + mv -f $@.new $@ +diff -aur glibc-2.3.5/extra-lib.mk glibc-2.3.5-cygwin/extra-lib.mk +--- glibc-2.3.5/extra-lib.mk 2004-12-02 23:54:47.000000000 +0100 ++++ glibc-2.3.5-cygwin/extra-lib.mk 2005-05-11 08:27:28.156250000 +0200 +@@ -13,7 +13,7 @@ + + ifneq (,$($(lib)-static-only-routines)) + ifneq (,$(filter yesyes%,$(build-shared)$(elf)$($(lib).so-version))) +-object-suffixes-$(lib) += $(filter-out $($(lib)-inhibit-o),.oS) ++object-suffixes-$(lib) += $(filter-out $($(lib)-inhibit-o),.oST) + endif + endif + +@@ -29,7 +29,7 @@ + + # Add each flavor of library to the lists of things to build and install. + install-lib += $(foreach o,$(object-suffixes-$(lib)),$(lib:lib%=$(libtype$o))) +-extra-objs += $(foreach o,$(filter-out .os .oS,$(object-suffixes-$(lib))),\ ++extra-objs += $(foreach o,$(filter-out .os .oST,$(object-suffixes-$(lib))),\ + $(patsubst %,%$o,$(filter-out \ + $($(lib)-shared-only-routines),\ + $(all-$(lib)-routines)))) +@@ -57,7 +57,7 @@ + + + # Use o-iterator.mk to generate a rule for each flavor of library. +-ifneq (,$(filter-out .os .oS,$(object-suffixes-$(lib)))) ++ifneq (,$(filter-out .os .oST,$(object-suffixes-$(lib)))) + define o-iterator-doit + $(objpfx)$(patsubst %,$(libtype$o),$(lib:lib%=%)): \ + $(patsubst %,$(objpfx)%$o,\ +@@ -65,7 +65,7 @@ + $(all-$(lib)-routines))); \ + $$(build-extra-lib) + endef +-object-suffixes-left = $(filter-out .os .oS,$(object-suffixes-$(lib))) ++object-suffixes-left = $(filter-out .os .oST,$(object-suffixes-$(lib))) + include $(patsubst %,$(..)o-iterator.mk,$(object-suffixes-left)) + endif + +@@ -77,9 +77,9 @@ + $(build-extra-lib) + endif + +-ifneq (,$(filter .oS,$(object-suffixes-$(lib)))) +-$(objpfx)$(patsubst %,$(libtype.oS),$(lib:lib%=%)): \ +- $(patsubst %,$(objpfx)%.oS,\ ++ifneq (,$(filter .oST,$(object-suffixes-$(lib)))) ++$(objpfx)$(patsubst %,$(libtype.oST),$(lib:lib%=%)): \ ++ $(patsubst %,$(objpfx)%.oST,\ + $(filter $($(lib)-static-only-routines),\ + $(all-$(lib)-routines))) + $(build-extra-lib) +diff -aur glibc-2.3.5/nptl/Makefile glibc-2.3.5-cygwin/nptl/Makefile +--- glibc-2.3.5/nptl/Makefile 2005-02-16 09:45:56.000000000 +0100 ++++ glibc-2.3.5-cygwin/nptl/Makefile 2005-05-11 08:26:01.812500000 +0200 +@@ -375,7 +375,7 @@ + + $(inst_libdir)/libpthread.so: $(common-objpfx)format.lds \ + $(objpfx)libpthread.so$(libpthread.so-version) \ +- $(inst_libdir)/$(patsubst %,$(libtype.oS),\ ++ $(inst_libdir)/$(patsubst %,$(libtype.oST),\ + $(libprefix)pthread) \ + $(+force) + (echo '/* GNU ld script';\ +@@ -383,7 +383,7 @@ + echo ' the static library, so try that secondarily. */';\ + cat $<; \ + echo 'GROUP ( $(slibdir)/libpthread.so$(libpthread.so-version)' \ +- '$(libdir)/$(patsubst %,$(libtype.oS),$(libprefix)pthread)'\ ++ '$(libdir)/$(patsubst %,$(libtype.oST),$(libprefix)pthread)'\ + ')' \ + ) > $@.new + mv -f $@.new $@ +diff -aur glibc-2.3.5/sysdeps/sparc/sparc32/sparcv9/Makefile glibc-2.3.5-cygwin/sysdeps/sparc/sparc32/sparcv9/Makefile +--- glibc-2.3.5/sysdeps/sparc/sparc32/sparcv9/Makefile 2004-08-16 08:46:14.000000000 +0200 ++++ glibc-2.3.5-cygwin/sysdeps/sparc/sparc32/sparcv9/Makefile 2005-05-11 08:26:25.937500000 +0200 +@@ -10,4 +10,4 @@ + ASFLAGS-.op += -Wa,-Av9a + ASFLAGS-.og += -Wa,-Av9a + ASFLAGS-.ob += -Wa,-Av9a +-ASFLAGS-.oS += -Wa,-Av9a ++ASFLAGS-.oST += -Wa,-Av9a + +Signed-off-by: Robert P. J. Day diff --git a/patches/glibc/2.5.1/130-glibc-2.3.6-allow-gcc-4.0-elf.patch b/patches/glibc/2.5.1/130-glibc-2.3.6-allow-gcc-4.0-elf.patch new file mode 100644 index 0000000..87860fa --- /dev/null +++ b/patches/glibc/2.5.1/130-glibc-2.3.6-allow-gcc-4.0-elf.patch @@ -0,0 +1,67 @@ +From http://www.mail-archive.com/pld-cvs-commit@pld-linux.org/msg00229.html +Fixes + rtld.c: In function '_dl_start': + dynamic-link.h:47: error: nested function 'elf_machine_rela_relative' declared but never defined + dynamic-link.h:41: error: nested function 'elf_machine_rela' declared but never defined +when compiling glibc-2.3.4 with gcc-4.0 + +But see also +http://sources.redhat.com/ml/libc-hacker/2005-02/msg00000.html +and +http://sources.redhat.com/ml/libc-hacker/2005-03/msg00008.html +which seem to propose less radical fixes? + +Aha. See also http://sources.redhat.com/bugzilla/show_bug.cgi?id=721 + +--- glibc-2.3.6.orig/elf/dynamic-link.h 2005-03-12 18:12:37.000000000 -0800 ++++ glibc-2.3.6/elf/dynamic-link.h 2005-03-12 18:12:59.777820848 -0800 +@@ -19,47 +19,6 @@ + + #include + #include +- +-#ifdef RESOLVE_MAP +-/* We pass reloc_addr as a pointer to void, as opposed to a pointer to +- ElfW(Addr), because not all architectures can assume that the +- relocated address is properly aligned, whereas the compiler is +- entitled to assume that a pointer to a type is properly aligned for +- the type. Even if we cast the pointer back to some other type with +- less strict alignment requirements, the compiler might still +- remember that the pointer was originally more aligned, thereby +- optimizing away alignment tests or using word instructions for +- copying memory, breaking the very code written to handle the +- unaligned cases. */ +-# if ! ELF_MACHINE_NO_REL +-auto inline void __attribute__((always_inline)) +-elf_machine_rel (struct link_map *map, const ElfW(Rel) *reloc, +- const ElfW(Sym) *sym, const struct r_found_version *version, +- void *const reloc_addr); +-auto inline void __attribute__((always_inline)) +-elf_machine_rel_relative (ElfW(Addr) l_addr, const ElfW(Rel) *reloc, +- void *const reloc_addr); +-# endif +-# if ! ELF_MACHINE_NO_RELA +-auto inline void __attribute__((always_inline)) +-elf_machine_rela (struct link_map *map, const ElfW(Rela) *reloc, +- const ElfW(Sym) *sym, const struct r_found_version *version, +- void *const reloc_addr); +-auto inline void __attribute__((always_inline)) +-elf_machine_rela_relative (ElfW(Addr) l_addr, const ElfW(Rela) *reloc, +- void *const reloc_addr); +-# endif +-# if ELF_MACHINE_NO_RELA || defined ELF_MACHINE_PLT_REL +-auto inline void __attribute__((always_inline)) +-elf_machine_lazy_rel (struct link_map *map, +- ElfW(Addr) l_addr, const ElfW(Rel) *reloc); +-# else +-auto inline void __attribute__((always_inline)) +-elf_machine_lazy_rel (struct link_map *map, +- ElfW(Addr) l_addr, const ElfW(Rela) *reloc); +-# endif +-#endif +- + #include + + #ifndef VERSYMIDX + +Signed-off-by: Robert P. J. Day diff --git a/patches/glibc/2.5.1/140-glibc-2.3.6-configure-apple-as.patch b/patches/glibc/2.5.1/140-glibc-2.3.6-configure-apple-as.patch new file mode 100644 index 0000000..78a1324 --- /dev/null +++ b/patches/glibc/2.5.1/140-glibc-2.3.6-configure-apple-as.patch @@ -0,0 +1,25 @@ +http://in3www.epfl.ch/~schaffne/glibc-configure-apple-as.patch +http://sources.redhat.com/ml/crossgcc/2004-02/msg00151.html + +The following makes it possible to configure glibc-2.3.2 on Mac OS X, +where the assembler but doesn't understand the --version flag. + +Fixes the symptom +checking whether ld is GNU ld... no +checking for /usr/libexec/gcc/darwin/ppc/as... /usr/libexec/gcc/darwin/ppc/as +checking version of /usr/libexec/gcc/darwin/ppc/as... + + +--- glibc-2.3.2/configure~ Wed Feb 26 09:20:48 2003 ++++ glibc-2.3.2/configure Fri Feb 27 13:12:53 2004 +@@ -4039,7 +4039,7 @@ + # Found it, now check the version. + echo "$as_me:$LINENO: checking version of $AS" >&5 + echo $ECHO_N "checking version of $AS... $ECHO_C" >&6 +- ac_prog_version=`$AS --version 2>&1 | sed -n 's/^.*GNU assembler.* \([0-9]*\.[0-9.]*\).*$/\1/p'` ++ ac_prog_version=`$AS -v &1 | sed -n 's/^.*GNU assembler.* \([0-9]*\.[0-9.]*\).*$/\1/p'` + case $ac_prog_version in + '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;; + 2.1[3-9]*) + +Signed-off-by: Robert P. J. Day diff --git a/patches/glibc/2.5.1/150-glibc-2.3.6-fix-pr631.patch b/patches/glibc/2.5.1/150-glibc-2.3.6-fix-pr631.patch new file mode 100644 index 0000000..13688df --- /dev/null +++ b/patches/glibc/2.5.1/150-glibc-2.3.6-fix-pr631.patch @@ -0,0 +1,45 @@ +From dank@kegel.com +Wed Jun 15 09:12:43 PDT 2005 + +Fixes + +build-glibc/libc.a(nsswitch.o)(.data+0x64): undefined reference to `_nss_files_getaliasent_r' +build-glibc/libc.a(nsswitch.o)(.data+0x6c): undefined reference to `_nss_files_endaliasent' +... 53 lines deleted ... +build-glibc/libc.a(nsswitch.o)(.data+0x21c): undefined reference to `_nss_files_getspnam_r' +collect2: ld returned 1 exit status +make[2]: *** [/build/gcc-3.4.3-glibc-2.3.5-hdrs-2.6.11.2/i686-unknown-linux-gnu/build-glibc/elf/ldconfig] Error 1 + +when building glibc with --enable-static-nss. + +See http://sources.redhat.com/bugzilla/show_bug.cgi?id=631 + +--- glibc-2.3.5/Makeconfig.old Wed Jun 15 08:13:12 2005 ++++ glibc-2.3.5/Makeconfig Wed Jun 15 08:13:14 2005 +@@ -510,7 +510,7 @@ + + # The static libraries. + ifeq (yes,$(build-static)) +-link-libc-static = $(common-objpfx)libc.a $(static-gnulib) $(common-objpfx)libc.a ++link-libc-static = $(common-objpfx)libc.a $(static-gnulib) $(otherlibs) $(common-objpfx)libc.a + else + ifeq (yes,$(build-shared)) + # We can try to link the programs with lib*_pic.a... +--- glibc-2.3.5/elf/Makefile.old Wed Jun 15 07:46:49 2005 ++++ glibc-2.3.5/elf/Makefile Wed Jun 15 08:14:00 2005 +@@ -120,6 +120,13 @@ + install-bin-script = ldd + endif + ++ifeq (yes,$(build-static-nss)) ++nssobjdir := $(patsubst ../$(subdir),.,$(common-objpfx)nss) ++resolvobjdir := $(patsubst ../$(subdir),.,$(common-objpfx)resolv) ++otherlibs += $(nssobjdir)/libnss_files.a $(resolvobjdir)/libnss_dns.a \ ++ $(resolvobjdir)/libresolv.a ++endif ++ + others = sprof sln + install-bin = sprof + others-static = sln + +Signed-off-by: Robert P. J. Day diff --git a/patches/glibc/2.5.1/160-glibc-2.4-i686-assembler.patch b/patches/glibc/2.5.1/160-glibc-2.4-i686-assembler.patch new file mode 100644 index 0000000..9904efb --- /dev/null +++ b/patches/glibc/2.5.1/160-glibc-2.4-i686-assembler.patch @@ -0,0 +1,38 @@ +2007-02-15 Khem Raj + + * sysdeps/unix/sysv/linux/i386/sysdep.h: Re-define __i686. + * nptl/sysdeps/pthread/pt-initfini.c: Ditto. + + + +Index: glibc-2.4/sysdeps/unix/sysv/linux/i386/sysdep.h +=================================================================== +--- glibc-2.4/sysdeps/unix/sysv/linux/i386/sysdep.h (revision 1469) ++++ glibc-2.4/sysdeps/unix/sysv/linux/i386/sysdep.h (working copy) +@@ -29,6 +29,10 @@ + #include + #include + ++#if defined __i686 && defined __ASSEMBLER__ ++#undef __i686 ++#define __i686 __i686 ++#endif + + /* For Linux we can use the system call table in the header file + /usr/include/asm/unistd.h +Index: glibc-2.4/nptl/sysdeps/pthread/pt-initfini.c +=================================================================== +--- glibc-2.4/nptl/sysdeps/pthread/pt-initfini.c (revision 1469) ++++ glibc-2.4/nptl/sysdeps/pthread/pt-initfini.c (working copy) +@@ -45,6 +45,11 @@ + /* Embed an #include to pull in the alignment and .end directives. */ + asm ("\n#include \"defs.h\""); + ++asm ("\n#if defined __i686 && defined __ASSEMBLER__"); ++asm ("\n#undef __i686"); ++asm ("\n#define __i686 __i686"); ++asm ("\n#endif"); ++ + /* The initial common code ends here. */ + asm ("\n/*@HEADER_ENDS*/"); + diff --git a/patches/glibc/2.5.1/170-glibc-i386-preferred-stack-boundary.patch b/patches/glibc/2.5.1/170-glibc-i386-preferred-stack-boundary.patch new file mode 100644 index 0000000..449821d --- /dev/null +++ b/patches/glibc/2.5.1/170-glibc-i386-preferred-stack-boundary.patch @@ -0,0 +1,18 @@ +(C) 2007 Yann E. MORIN +License: LGPL v2.1 + +Shut off a stupid warning: preffered-stack-boundary must be between 4 ad 12, +and 2 is not. + +diff -dur glibc-2.5.orig/sysdeps/i386/Makefile glibc-2.5/sysdeps/i386/Makefile +--- glibc-2.5.orig/sysdeps/i386/Makefile 2005-03-06 01:18:16.000000000 +0100 ++++ glibc-2.5/sysdeps/i386/Makefile 2007-05-27 17:49:37.000000000 +0200 +@@ -36,7 +36,7 @@ + ifeq ($(subdir),csu) + sysdep-CFLAGS += -mpreferred-stack-boundary=4 + else +-sysdep-CFLAGS += -mpreferred-stack-boundary=2 ++sysdep-CFLAGS += -mpreferred-stack-boundary=4 + # Likewise, any function which calls user callbacks + uses-callbacks += -mpreferred-stack-boundary=4 + # Likewise, any stack alignment tests diff --git a/patches/glibc/2.5.1/fix-pr398.patch b/patches/glibc/2.5.1/fix-pr398.patch deleted file mode 100644 index d5d0309..0000000 --- a/patches/glibc/2.5.1/fix-pr398.patch +++ /dev/null @@ -1,70 +0,0 @@ -Fixes error - -dl-runtime.c:222: error: parse error before "CFI_STARTPROC" -make[2]: *** [crosstool-0.28-rc35/build/s390-unknown-linux-gnu/gcc-3.4.1-glibc-20040822/build-glibc/elf/dl-runtim -e.o] Error 1 -make[2]: Leaving directory `crosstool-0.28-rc35/build/s390-unknown-linux-gnu/gcc-3.4.1-glibc-20040822/glibc-20040 -822/elf' -make[1]: *** [elf/subdir_lib] Error 2 -make[1]: Leaving directory `crosstool-0.28-rc35/build/s390-unknown-linux-gnu/gcc-3.4.1-glibc-20040822/glibc-20040 -822' -make: *** [all] Error 2 - ------------------ - -See http://sources.redhat.com/bugzilla/show_bug.cgi?id=398 -http://sources.redhat.com/ml/libc-alpha/2004-07/msg00023.html - ------------------ - -CVSROOT: /cvs/glibc -Module name: libc -Branch: glibc-2_3-branch -Changes by: roland@sources.redhat.com 2006-02-23 22:36:51 - -Modified files: - sysdeps/s390/s390-64: dl-machine.h - sysdeps/s390/s390-32: dl-machine.h - -Log message: - 2004-07-10 GOTO Masanori - - [BZ #398] - * sysdeps/s390/s390-32/dl-machine.h: Include for CFI - directive. - * sysdeps/s390/s390-64/dl-machine.h: Likewise. - -Patches: -http://sources.redhat.com/cgi-bin/cvsweb.cgi/libc/sysdeps/s390/s390-64/dl-machine.h.diff?cvsroot=glibc&only_with_tag=glibc-2_3-branch&r1=1.19.4.1&r2=1.19.4.2 -http://sources.redhat.com/cgi-bin/cvsweb.cgi/libc/sysdeps/s390/s390-32/dl-machine.h.diff?cvsroot=glibc&only_with_tag=glibc-2_3-branch&r1=1.20.4.1&r2=1.20.4.2 - -=================================================================== -RCS file: /cvs/glibc/libc/sysdeps/s390/s390-64/dl-machine.h,v -retrieving revision 1.19.4.1 -retrieving revision 1.19.4.2 -diff -u -r1.19.4.1 -r1.19.4.2 ---- libc/sysdeps/s390/s390-64/dl-machine.h 2005/10/17 04:57:27 1.19.4.1 -+++ libc/sysdeps/s390/s390-64/dl-machine.h 2006/02/23 22:36:51 1.19.4.2 -@@ -27,6 +27,7 @@ - #include - #include - #include -+#include - - /* This is an older, now obsolete value. */ - #define EM_S390_OLD 0xA390 -=================================================================== -RCS file: /cvs/glibc/libc/sysdeps/s390/s390-32/dl-machine.h,v -retrieving revision 1.20.4.1 -retrieving revision 1.20.4.2 -diff -u -r1.20.4.1 -r1.20.4.2 ---- libc/sysdeps/s390/s390-32/dl-machine.h 2005/10/17 04:57:27 1.20.4.1 -+++ libc/sysdeps/s390/s390-32/dl-machine.h 2006/02/23 22:36:51 1.20.4.2 -@@ -27,6 +27,7 @@ - #include - #include - #include -+#include - - /* This is an older, now obsolete value. */ - #define EM_S390_OLD 0xA390 diff --git a/patches/glibc/2.5.1/glibc-2.3.5-allow-gcc4-wcstol_l.patch b/patches/glibc/2.5.1/glibc-2.3.5-allow-gcc4-wcstol_l.patch deleted file mode 100644 index 0e6776f..0000000 --- a/patches/glibc/2.5.1/glibc-2.3.5-allow-gcc4-wcstol_l.patch +++ /dev/null @@ -1,59 +0,0 @@ -Fixes -../sysdeps/wordsize-64/wcstol_l.c:11: error: '____wcstoll_l_internal' aliased to undefined symbol '____wcstol_l_internal' -../sysdeps/wordsize-64/wcstol_l.c:12: error: '__wcstoll_l' aliased to undefined symbol '__wcstol_l' -../sysdeps/wordsize-64/wcstol_l.c:13: error: 'wcstoll_l' aliased to undefined symbol '__wcstol_l' -make[2]: *** [/home/dkegel/queue/jobdir.produser_cpsm10/crosstool-0.32/build/x86_64-unknown-linux-gnu/gcc-4.0.0-20050410-glibc-2.3.4/build-glibc/wcsmbs/wcstoul_l.o] Error 1 - -https://www.redhat.com/archives/fedora-cvs-commits/2005-March/msg00408.html -%changelog -+* Fri Mar 25 2005 Jakub Jelinek 2.3.4-18 -+- fix build on 64-bit arches with new GCC - -Revision 1.4.2.1, Fri Mar 25 11:59:01 2005 UTC (3 weeks, 4 days ago) by jakub -Branch: fedora-branch -CVS Tags: fedora-glibc-2_3_4-18 -Changes since 1.4: +2 -0 lines -Diff to previous 1.4 (colored) - - * sysdeps/wordsize-64/strtol_l.c: Don't add aliases if UNSIGNED. - * sysdeps/wordsize-64/wcstol_l.c: Likewise. - - -http://sourceware.org/cgi-bin/cvsweb.cgi/libc/sysdeps/wordsize-64/strtol_l.c.diff?r1=1.4&r2=1.4.2.1&cvsroot=glibc -http://sourceware.org/cgi-bin/cvsweb.cgi/libc/sysdeps/wordsize-64/wcstol_l.c.diff?r1=1.4&r2=1.4.2.1&cvsroot=glibc - -=================================================================== -RCS file: /cvs/glibc/libc/sysdeps/wordsize-64/strtol_l.c,v -retrieving revision 1.4 -retrieving revision 1.4.2.1 -diff -u -r1.4 -r1.4.2.1 ---- libc/sysdeps/wordsize-64/strtol_l.c 2003/03/03 09:45:12 1.4 -+++ libc/sysdeps/wordsize-64/strtol_l.c 2005/03/25 11:59:01 1.4.2.1 -@@ -8,7 +8,9 @@ - #undef ____strtoll_l_internal - #undef __strtoll_l - #undef strtoll_l -+#if !UNSIGNED - strong_alias (____strtol_l_internal, ____strtoll_l_internal) - libc_hidden_ver (____strtol_l_internal, ____strtoll_l_internal) - weak_alias (__strtol_l, __strtoll_l) - weak_alias (__strtol_l, strtoll_l) -+#endif -=================================================================== -RCS file: /cvs/glibc/libc/sysdeps/wordsize-64/wcstol_l.c,v -retrieving revision 1.4 -retrieving revision 1.4.2.1 -diff -u -r1.4 -r1.4.2.1 ---- libc/sysdeps/wordsize-64/wcstol_l.c 2002/08/08 11:44:51 1.4 -+++ libc/sysdeps/wordsize-64/wcstol_l.c 2005/03/25 11:59:01 1.4.2.1 -@@ -8,6 +8,8 @@ - #undef ____wcstoll_l_internal - #undef __wcstoll_l - #undef wcstoll_l -+#if !UNSIGNED - strong_alias (____wcstol_l_internal, ____wcstoll_l_internal) - weak_alias (__wcstol_l, __wcstoll_l) - weak_alias (__wcstol_l, wcstoll_l) -+#endif - -Signed-off-by: Robert P. J. Day diff --git a/patches/glibc/2.5.1/glibc-2.3.5-cygwin.patch b/patches/glibc/2.5.1/glibc-2.3.5-cygwin.patch deleted file mode 100644 index 3c0cd7d..0000000 --- a/patches/glibc/2.5.1/glibc-2.3.5-cygwin.patch +++ /dev/null @@ -1,187 +0,0 @@ -Fixes -elf/librtld.os: In function `process_envvars': : undefined reference to `__access' -... -when building glibc-2.3.x on cygwin - -Idea from -http://sources.redhat.com/ml/bug-glibc/2002-01/msg00071/glibc-2.2-cygin-shared.patch -Basically, make glibc use .oST as suffix for 'object static' -instead of .oS, since cygwin has trouble distinguishing .os from .oS -(Original patch had .on, but .oST is more mnemonic for 'object static') - -glibc-linuxthreads-2.3.5 also requires a patch, see -../glibc-linuxthreads-2.3.5/glibc-linuxthreads-2.3.5-cygwin.patch - -[ forward ported to glibc-2.3.5 by Petr Cvachoucek: - -Message-ID: <4282FCBA.3040000@unicontrols.cz> -Date: Thu, 12 May 2005 08:50:34 +0200 -From: Petr Cvachoucek -To: Dan Kegel -CC: crossgcc@sources.redhat.com -Subject: Patches to build gcc 3.4.3 / glibc 2.3.5 on cygwin - -Hi Dan, -following patches are needed to build gcc-3.4.3/glibc-2.3.5 toolchain -on cygwin. Tested to build toolchains for powerpc 604 and 750 targets. - --- - Petr Cvachoucek - Unicontrols a.s. - http://www.unicontrols.cz -] - -diff -aur glibc-2.3.5/Makeconfig glibc-2.3.5-cygwin/Makeconfig ---- glibc-2.3.5/Makeconfig 2005-02-16 11:50:19.000000000 +0100 -+++ glibc-2.3.5-cygwin/Makeconfig 2005-05-11 08:24:51.046875000 +0200 -@@ -472,7 +472,7 @@ - # run the linked programs. - link-libc = -Wl,-rpath-link=$(rpath-link) \ - $(common-objpfx)libc.so$(libc.so-version) \ -- $(common-objpfx)$(patsubst %,$(libtype.oS),c) $(gnulib) -+ $(common-objpfx)$(patsubst %,$(libtype.oST),c) $(gnulib) - # This is how to find at build-time things that will be installed there. - rpath-dirs = math elf dlfcn nss nis rt resolv crypt - endif -@@ -693,7 +693,7 @@ - # The compilation rules use $(CPPFLAGS-${SUFFIX}) and $(CFLAGS-${SUFFIX}) - # to pass different flags for each flavor. - libtypes = $(foreach o,$(object-suffixes-for-libc),$(libtype$o)) --all-object-suffixes := .o .os .op .og .ob .oS -+all-object-suffixes := .o .os .op .og .ob .oST - object-suffixes := - CPPFLAGS-.o = $(pic-default) - CFLAGS-.o = $(filter %frame-pointer,$(+cflags)) -@@ -749,14 +749,14 @@ - - ifeq (yes,$(build-shared)) - # Build special library that contains the static-only routines for libc. --object-suffixes-for-libc += .oS -+object-suffixes-for-libc += .oST - - # Must build the routines as PIC, though, because they can end up in (users') - # shared objects. We don't want to use CFLAGS-os because users may, for - # example, make that processor-specific. --CFLAGS-.oS = $(CFLAGS-.o) $(PIC-ccflag) --CPPFLAGS-.oS = $(CPPFLAGS-.o) -DPIC -DLIBC_NONSHARED=1 --libtype.oS = lib%_nonshared.a -+CFLAGS-.oST = $(CFLAGS-.o) $(PIC-ccflag) -+CPPFLAGS-.oST = $(CPPFLAGS-.o) -DPIC -DLIBC_NONSHARED=1 -+libtype.oST = lib%_nonshared.a - endif - - # The assembler can generate debug information too. -diff -aur glibc-2.3.5/Makerules glibc-2.3.5-cygwin/Makerules ---- glibc-2.3.5/Makerules 2004-12-15 19:52:39.000000000 +0100 -+++ glibc-2.3.5-cygwin/Makerules 2005-05-11 08:25:33.578125000 +0200 -@@ -417,7 +417,7 @@ - # Bounded pointer thunks are only built for *.ob - elide-bp-thunks = $(addprefix $(bppfx),$(bp-thunks)) - --elide-routines.oS += $(filter-out $(static-only-routines),\ -+elide-routines.oST += $(filter-out $(static-only-routines),\ - $(routines) $(aux) $(sysdep_routines)) \ - $(elide-bp-thunks) - elide-routines.os += $(static-only-routines) $(elide-bp-thunks) -@@ -981,7 +981,7 @@ - install: $(inst_libdir)/libc.so - $(inst_libdir)/libc.so: $(common-objpfx)format.lds \ - $(common-objpfx)libc.so$(libc.so-version) \ -- $(inst_libdir)/$(patsubst %,$(libtype.oS),\ -+ $(inst_libdir)/$(patsubst %,$(libtype.oST),\ - $(libprefix)$(libc-name)) \ - $(+force) - (echo '/* GNU ld script';\ -@@ -989,7 +989,7 @@ - echo ' the static library, so try that secondarily. */';\ - cat $<; \ - echo 'GROUP ( $(slibdir)/libc.so$(libc.so-version)' \ -- '$(libdir)/$(patsubst %,$(libtype.oS),$(libprefix)$(libc-name))'\ -+ '$(libdir)/$(patsubst %,$(libtype.oST),$(libprefix)$(libc-name))'\ - ' AS_NEEDED (' $(slibdir)/$(rtld-installed-name) ') )' \ - ) > $@.new - mv -f $@.new $@ -diff -aur glibc-2.3.5/extra-lib.mk glibc-2.3.5-cygwin/extra-lib.mk ---- glibc-2.3.5/extra-lib.mk 2004-12-02 23:54:47.000000000 +0100 -+++ glibc-2.3.5-cygwin/extra-lib.mk 2005-05-11 08:27:28.156250000 +0200 -@@ -13,7 +13,7 @@ - - ifneq (,$($(lib)-static-only-routines)) - ifneq (,$(filter yesyes%,$(build-shared)$(elf)$($(lib).so-version))) --object-suffixes-$(lib) += $(filter-out $($(lib)-inhibit-o),.oS) -+object-suffixes-$(lib) += $(filter-out $($(lib)-inhibit-o),.oST) - endif - endif - -@@ -29,7 +29,7 @@ - - # Add each flavor of library to the lists of things to build and install. - install-lib += $(foreach o,$(object-suffixes-$(lib)),$(lib:lib%=$(libtype$o))) --extra-objs += $(foreach o,$(filter-out .os .oS,$(object-suffixes-$(lib))),\ -+extra-objs += $(foreach o,$(filter-out .os .oST,$(object-suffixes-$(lib))),\ - $(patsubst %,%$o,$(filter-out \ - $($(lib)-shared-only-routines),\ - $(all-$(lib)-routines)))) -@@ -57,7 +57,7 @@ - - - # Use o-iterator.mk to generate a rule for each flavor of library. --ifneq (,$(filter-out .os .oS,$(object-suffixes-$(lib)))) -+ifneq (,$(filter-out .os .oST,$(object-suffixes-$(lib)))) - define o-iterator-doit - $(objpfx)$(patsubst %,$(libtype$o),$(lib:lib%=%)): \ - $(patsubst %,$(objpfx)%$o,\ -@@ -65,7 +65,7 @@ - $(all-$(lib)-routines))); \ - $$(build-extra-lib) - endef --object-suffixes-left = $(filter-out .os .oS,$(object-suffixes-$(lib))) -+object-suffixes-left = $(filter-out .os .oST,$(object-suffixes-$(lib))) - include $(patsubst %,$(..)o-iterator.mk,$(object-suffixes-left)) - endif - -@@ -77,9 +77,9 @@ - $(build-extra-lib) - endif - --ifneq (,$(filter .oS,$(object-suffixes-$(lib)))) --$(objpfx)$(patsubst %,$(libtype.oS),$(lib:lib%=%)): \ -- $(patsubst %,$(objpfx)%.oS,\ -+ifneq (,$(filter .oST,$(object-suffixes-$(lib)))) -+$(objpfx)$(patsubst %,$(libtype.oST),$(lib:lib%=%)): \ -+ $(patsubst %,$(objpfx)%.oST,\ - $(filter $($(lib)-static-only-routines),\ - $(all-$(lib)-routines))) - $(build-extra-lib) -diff -aur glibc-2.3.5/nptl/Makefile glibc-2.3.5-cygwin/nptl/Makefile ---- glibc-2.3.5/nptl/Makefile 2005-02-16 09:45:56.000000000 +0100 -+++ glibc-2.3.5-cygwin/nptl/Makefile 2005-05-11 08:26:01.812500000 +0200 -@@ -375,7 +375,7 @@ - - $(inst_libdir)/libpthread.so: $(common-objpfx)format.lds \ - $(objpfx)libpthread.so$(libpthread.so-version) \ -- $(inst_libdir)/$(patsubst %,$(libtype.oS),\ -+ $(inst_libdir)/$(patsubst %,$(libtype.oST),\ - $(libprefix)pthread) \ - $(+force) - (echo '/* GNU ld script';\ -@@ -383,7 +383,7 @@ - echo ' the static library, so try that secondarily. */';\ - cat $<; \ - echo 'GROUP ( $(slibdir)/libpthread.so$(libpthread.so-version)' \ -- '$(libdir)/$(patsubst %,$(libtype.oS),$(libprefix)pthread)'\ -+ '$(libdir)/$(patsubst %,$(libtype.oST),$(libprefix)pthread)'\ - ')' \ - ) > $@.new - mv -f $@.new $@ -diff -aur glibc-2.3.5/sysdeps/sparc/sparc32/sparcv9/Makefile glibc-2.3.5-cygwin/sysdeps/sparc/sparc32/sparcv9/Makefile ---- glibc-2.3.5/sysdeps/sparc/sparc32/sparcv9/Makefile 2004-08-16 08:46:14.000000000 +0200 -+++ glibc-2.3.5-cygwin/sysdeps/sparc/sparc32/sparcv9/Makefile 2005-05-11 08:26:25.937500000 +0200 -@@ -10,4 +10,4 @@ - ASFLAGS-.op += -Wa,-Av9a - ASFLAGS-.og += -Wa,-Av9a - ASFLAGS-.ob += -Wa,-Av9a --ASFLAGS-.oS += -Wa,-Av9a -+ASFLAGS-.oST += -Wa,-Av9a - -Signed-off-by: Robert P. J. Day diff --git a/patches/glibc/2.5.1/glibc-2.3.6-allow-gcc-4.0-elf.patch b/patches/glibc/2.5.1/glibc-2.3.6-allow-gcc-4.0-elf.patch deleted file mode 100644 index 87860fa..0000000 --- a/patches/glibc/2.5.1/glibc-2.3.6-allow-gcc-4.0-elf.patch +++ /dev/null @@ -1,67 +0,0 @@ -From http://www.mail-archive.com/pld-cvs-commit@pld-linux.org/msg00229.html -Fixes - rtld.c: In function '_dl_start': - dynamic-link.h:47: error: nested function 'elf_machine_rela_relative' declared but never defined - dynamic-link.h:41: error: nested function 'elf_machine_rela' declared but never defined -when compiling glibc-2.3.4 with gcc-4.0 - -But see also -http://sources.redhat.com/ml/libc-hacker/2005-02/msg00000.html -and -http://sources.redhat.com/ml/libc-hacker/2005-03/msg00008.html -which seem to propose less radical fixes? - -Aha. See also http://sources.redhat.com/bugzilla/show_bug.cgi?id=721 - ---- glibc-2.3.6.orig/elf/dynamic-link.h 2005-03-12 18:12:37.000000000 -0800 -+++ glibc-2.3.6/elf/dynamic-link.h 2005-03-12 18:12:59.777820848 -0800 -@@ -19,47 +19,6 @@ - - #include - #include -- --#ifdef RESOLVE_MAP --/* We pass reloc_addr as a pointer to void, as opposed to a pointer to -- ElfW(Addr), because not all architectures can assume that the -- relocated address is properly aligned, whereas the compiler is -- entitled to assume that a pointer to a type is properly aligned for -- the type. Even if we cast the pointer back to some other type with -- less strict alignment requirements, the compiler might still -- remember that the pointer was originally more aligned, thereby -- optimizing away alignment tests or using word instructions for -- copying memory, breaking the very code written to handle the -- unaligned cases. */ --# if ! ELF_MACHINE_NO_REL --auto inline void __attribute__((always_inline)) --elf_machine_rel (struct link_map *map, const ElfW(Rel) *reloc, -- const ElfW(Sym) *sym, const struct r_found_version *version, -- void *const reloc_addr); --auto inline void __attribute__((always_inline)) --elf_machine_rel_relative (ElfW(Addr) l_addr, const ElfW(Rel) *reloc, -- void *const reloc_addr); --# endif --# if ! ELF_MACHINE_NO_RELA --auto inline void __attribute__((always_inline)) --elf_machine_rela (struct link_map *map, const ElfW(Rela) *reloc, -- const ElfW(Sym) *sym, const struct r_found_version *version, -- void *const reloc_addr); --auto inline void __attribute__((always_inline)) --elf_machine_rela_relative (ElfW(Addr) l_addr, const ElfW(Rela) *reloc, -- void *const reloc_addr); --# endif --# if ELF_MACHINE_NO_RELA || defined ELF_MACHINE_PLT_REL --auto inline void __attribute__((always_inline)) --elf_machine_lazy_rel (struct link_map *map, -- ElfW(Addr) l_addr, const ElfW(Rel) *reloc); --# else --auto inline void __attribute__((always_inline)) --elf_machine_lazy_rel (struct link_map *map, -- ElfW(Addr) l_addr, const ElfW(Rela) *reloc); --# endif --#endif -- - #include - - #ifndef VERSYMIDX - -Signed-off-by: Robert P. J. Day diff --git a/patches/glibc/2.5.1/glibc-2.3.6-configure-apple-as.patch b/patches/glibc/2.5.1/glibc-2.3.6-configure-apple-as.patch deleted file mode 100644 index 78a1324..0000000 --- a/patches/glibc/2.5.1/glibc-2.3.6-configure-apple-as.patch +++ /dev/null @@ -1,25 +0,0 @@ -http://in3www.epfl.ch/~schaffne/glibc-configure-apple-as.patch -http://sources.redhat.com/ml/crossgcc/2004-02/msg00151.html - -The following makes it possible to configure glibc-2.3.2 on Mac OS X, -where the assembler but doesn't understand the --version flag. - -Fixes the symptom -checking whether ld is GNU ld... no -checking for /usr/libexec/gcc/darwin/ppc/as... /usr/libexec/gcc/darwin/ppc/as -checking version of /usr/libexec/gcc/darwin/ppc/as... - - ---- glibc-2.3.2/configure~ Wed Feb 26 09:20:48 2003 -+++ glibc-2.3.2/configure Fri Feb 27 13:12:53 2004 -@@ -4039,7 +4039,7 @@ - # Found it, now check the version. - echo "$as_me:$LINENO: checking version of $AS" >&5 - echo $ECHO_N "checking version of $AS... $ECHO_C" >&6 -- ac_prog_version=`$AS --version 2>&1 | sed -n 's/^.*GNU assembler.* \([0-9]*\.[0-9.]*\).*$/\1/p'` -+ ac_prog_version=`$AS -v &1 | sed -n 's/^.*GNU assembler.* \([0-9]*\.[0-9.]*\).*$/\1/p'` - case $ac_prog_version in - '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;; - 2.1[3-9]*) - -Signed-off-by: Robert P. J. Day diff --git a/patches/glibc/2.5.1/glibc-2.3.6-fix-pr631.patch b/patches/glibc/2.5.1/glibc-2.3.6-fix-pr631.patch deleted file mode 100644 index 13688df..0000000 --- a/patches/glibc/2.5.1/glibc-2.3.6-fix-pr631.patch +++ /dev/null @@ -1,45 +0,0 @@ -From dank@kegel.com -Wed Jun 15 09:12:43 PDT 2005 - -Fixes - -build-glibc/libc.a(nsswitch.o)(.data+0x64): undefined reference to `_nss_files_getaliasent_r' -build-glibc/libc.a(nsswitch.o)(.data+0x6c): undefined reference to `_nss_files_endaliasent' -... 53 lines deleted ... -build-glibc/libc.a(nsswitch.o)(.data+0x21c): undefined reference to `_nss_files_getspnam_r' -collect2: ld returned 1 exit status -make[2]: *** [/build/gcc-3.4.3-glibc-2.3.5-hdrs-2.6.11.2/i686-unknown-linux-gnu/build-glibc/elf/ldconfig] Error 1 - -when building glibc with --enable-static-nss. - -See http://sources.redhat.com/bugzilla/show_bug.cgi?id=631 - ---- glibc-2.3.5/Makeconfig.old Wed Jun 15 08:13:12 2005 -+++ glibc-2.3.5/Makeconfig Wed Jun 15 08:13:14 2005 -@@ -510,7 +510,7 @@ - - # The static libraries. - ifeq (yes,$(build-static)) --link-libc-static = $(common-objpfx)libc.a $(static-gnulib) $(common-objpfx)libc.a -+link-libc-static = $(common-objpfx)libc.a $(static-gnulib) $(otherlibs) $(common-objpfx)libc.a - else - ifeq (yes,$(build-shared)) - # We can try to link the programs with lib*_pic.a... ---- glibc-2.3.5/elf/Makefile.old Wed Jun 15 07:46:49 2005 -+++ glibc-2.3.5/elf/Makefile Wed Jun 15 08:14:00 2005 -@@ -120,6 +120,13 @@ - install-bin-script = ldd - endif - -+ifeq (yes,$(build-static-nss)) -+nssobjdir := $(patsubst ../$(subdir),.,$(common-objpfx)nss) -+resolvobjdir := $(patsubst ../$(subdir),.,$(common-objpfx)resolv) -+otherlibs += $(nssobjdir)/libnss_files.a $(resolvobjdir)/libnss_dns.a \ -+ $(resolvobjdir)/libresolv.a -+endif -+ - others = sprof sln - install-bin = sprof - others-static = sln - -Signed-off-by: Robert P. J. Day diff --git a/patches/glibc/2.5.1/glibc-2.4-i686-assembler.patch b/patches/glibc/2.5.1/glibc-2.4-i686-assembler.patch deleted file mode 100644 index 9904efb..0000000 --- a/patches/glibc/2.5.1/glibc-2.4-i686-assembler.patch +++ /dev/null @@ -1,38 +0,0 @@ -2007-02-15 Khem Raj - - * sysdeps/unix/sysv/linux/i386/sysdep.h: Re-define __i686. - * nptl/sysdeps/pthread/pt-initfini.c: Ditto. - - - -Index: glibc-2.4/sysdeps/unix/sysv/linux/i386/sysdep.h -=================================================================== ---- glibc-2.4/sysdeps/unix/sysv/linux/i386/sysdep.h (revision 1469) -+++ glibc-2.4/sysdeps/unix/sysv/linux/i386/sysdep.h (working copy) -@@ -29,6 +29,10 @@ - #include - #include - -+#if defined __i686 && defined __ASSEMBLER__ -+#undef __i686 -+#define __i686 __i686 -+#endif - - /* For Linux we can use the system call table in the header file - /usr/include/asm/unistd.h -Index: glibc-2.4/nptl/sysdeps/pthread/pt-initfini.c -=================================================================== ---- glibc-2.4/nptl/sysdeps/pthread/pt-initfini.c (revision 1469) -+++ glibc-2.4/nptl/sysdeps/pthread/pt-initfini.c (working copy) -@@ -45,6 +45,11 @@ - /* Embed an #include to pull in the alignment and .end directives. */ - asm ("\n#include \"defs.h\""); - -+asm ("\n#if defined __i686 && defined __ASSEMBLER__"); -+asm ("\n#undef __i686"); -+asm ("\n#define __i686 __i686"); -+asm ("\n#endif"); -+ - /* The initial common code ends here. */ - asm ("\n/*@HEADER_ENDS*/"); - diff --git a/patches/glibc/2.5.1/glibc-i386-preferred-stack-boundary.patch b/patches/glibc/2.5.1/glibc-i386-preferred-stack-boundary.patch deleted file mode 100644 index 449821d..0000000 --- a/patches/glibc/2.5.1/glibc-i386-preferred-stack-boundary.patch +++ /dev/null @@ -1,18 +0,0 @@ -(C) 2007 Yann E. MORIN -License: LGPL v2.1 - -Shut off a stupid warning: preffered-stack-boundary must be between 4 ad 12, -and 2 is not. - -diff -dur glibc-2.5.orig/sysdeps/i386/Makefile glibc-2.5/sysdeps/i386/Makefile ---- glibc-2.5.orig/sysdeps/i386/Makefile 2005-03-06 01:18:16.000000000 +0100 -+++ glibc-2.5/sysdeps/i386/Makefile 2007-05-27 17:49:37.000000000 +0200 -@@ -36,7 +36,7 @@ - ifeq ($(subdir),csu) - sysdep-CFLAGS += -mpreferred-stack-boundary=4 - else --sysdep-CFLAGS += -mpreferred-stack-boundary=2 -+sysdep-CFLAGS += -mpreferred-stack-boundary=4 - # Likewise, any function which calls user callbacks - uses-callbacks += -mpreferred-stack-boundary=4 - # Likewise, any stack alignment tests diff --git a/patches/glibc/2.5/100-fix-pr398.patch b/patches/glibc/2.5/100-fix-pr398.patch new file mode 100644 index 0000000..d5d0309 --- /dev/null +++ b/patches/glibc/2.5/100-fix-pr398.patch @@ -0,0 +1,70 @@ +Fixes error + +dl-runtime.c:222: error: parse error before "CFI_STARTPROC" +make[2]: *** [crosstool-0.28-rc35/build/s390-unknown-linux-gnu/gcc-3.4.1-glibc-20040822/build-glibc/elf/dl-runtim +e.o] Error 1 +make[2]: Leaving directory `crosstool-0.28-rc35/build/s390-unknown-linux-gnu/gcc-3.4.1-glibc-20040822/glibc-20040 +822/elf' +make[1]: *** [elf/subdir_lib] Error 2 +make[1]: Leaving directory `crosstool-0.28-rc35/build/s390-unknown-linux-gnu/gcc-3.4.1-glibc-20040822/glibc-20040 +822' +make: *** [all] Error 2 + +----------------- + +See http://sources.redhat.com/bugzilla/show_bug.cgi?id=398 +http://sources.redhat.com/ml/libc-alpha/2004-07/msg00023.html + +----------------- + +CVSROOT: /cvs/glibc +Module name: libc +Branch: glibc-2_3-branch +Changes by: roland@sources.redhat.com 2006-02-23 22:36:51 + +Modified files: + sysdeps/s390/s390-64: dl-machine.h + sysdeps/s390/s390-32: dl-machine.h + +Log message: + 2004-07-10 GOTO Masanori + + [BZ #398] + * sysdeps/s390/s390-32/dl-machine.h: Include for CFI + directive. + * sysdeps/s390/s390-64/dl-machine.h: Likewise. + +Patches: +http://sources.redhat.com/cgi-bin/cvsweb.cgi/libc/sysdeps/s390/s390-64/dl-machine.h.diff?cvsroot=glibc&only_with_tag=glibc-2_3-branch&r1=1.19.4.1&r2=1.19.4.2 +http://sources.redhat.com/cgi-bin/cvsweb.cgi/libc/sysdeps/s390/s390-32/dl-machine.h.diff?cvsroot=glibc&only_with_tag=glibc-2_3-branch&r1=1.20.4.1&r2=1.20.4.2 + +=================================================================== +RCS file: /cvs/glibc/libc/sysdeps/s390/s390-64/dl-machine.h,v +retrieving revision 1.19.4.1 +retrieving revision 1.19.4.2 +diff -u -r1.19.4.1 -r1.19.4.2 +--- libc/sysdeps/s390/s390-64/dl-machine.h 2005/10/17 04:57:27 1.19.4.1 ++++ libc/sysdeps/s390/s390-64/dl-machine.h 2006/02/23 22:36:51 1.19.4.2 +@@ -27,6 +27,7 @@ + #include + #include + #include ++#include + + /* This is an older, now obsolete value. */ + #define EM_S390_OLD 0xA390 +=================================================================== +RCS file: /cvs/glibc/libc/sysdeps/s390/s390-32/dl-machine.h,v +retrieving revision 1.20.4.1 +retrieving revision 1.20.4.2 +diff -u -r1.20.4.1 -r1.20.4.2 +--- libc/sysdeps/s390/s390-32/dl-machine.h 2005/10/17 04:57:27 1.20.4.1 ++++ libc/sysdeps/s390/s390-32/dl-machine.h 2006/02/23 22:36:51 1.20.4.2 +@@ -27,6 +27,7 @@ + #include + #include + #include ++#include + + /* This is an older, now obsolete value. */ + #define EM_S390_OLD 0xA390 diff --git a/patches/glibc/2.5/110-glibc-2.3.5-allow-gcc4-wcstol_l.patch b/patches/glibc/2.5/110-glibc-2.3.5-allow-gcc4-wcstol_l.patch new file mode 100644 index 0000000..0e6776f --- /dev/null +++ b/patches/glibc/2.5/110-glibc-2.3.5-allow-gcc4-wcstol_l.patch @@ -0,0 +1,59 @@ +Fixes +../sysdeps/wordsize-64/wcstol_l.c:11: error: '____wcstoll_l_internal' aliased to undefined symbol '____wcstol_l_internal' +../sysdeps/wordsize-64/wcstol_l.c:12: error: '__wcstoll_l' aliased to undefined symbol '__wcstol_l' +../sysdeps/wordsize-64/wcstol_l.c:13: error: 'wcstoll_l' aliased to undefined symbol '__wcstol_l' +make[2]: *** [/home/dkegel/queue/jobdir.produser_cpsm10/crosstool-0.32/build/x86_64-unknown-linux-gnu/gcc-4.0.0-20050410-glibc-2.3.4/build-glibc/wcsmbs/wcstoul_l.o] Error 1 + +https://www.redhat.com/archives/fedora-cvs-commits/2005-March/msg00408.html +%changelog ++* Fri Mar 25 2005 Jakub Jelinek 2.3.4-18 ++- fix build on 64-bit arches with new GCC + +Revision 1.4.2.1, Fri Mar 25 11:59:01 2005 UTC (3 weeks, 4 days ago) by jakub +Branch: fedora-branch +CVS Tags: fedora-glibc-2_3_4-18 +Changes since 1.4: +2 -0 lines +Diff to previous 1.4 (colored) + + * sysdeps/wordsize-64/strtol_l.c: Don't add aliases if UNSIGNED. + * sysdeps/wordsize-64/wcstol_l.c: Likewise. + + +http://sourceware.org/cgi-bin/cvsweb.cgi/libc/sysdeps/wordsize-64/strtol_l.c.diff?r1=1.4&r2=1.4.2.1&cvsroot=glibc +http://sourceware.org/cgi-bin/cvsweb.cgi/libc/sysdeps/wordsize-64/wcstol_l.c.diff?r1=1.4&r2=1.4.2.1&cvsroot=glibc + +=================================================================== +RCS file: /cvs/glibc/libc/sysdeps/wordsize-64/strtol_l.c,v +retrieving revision 1.4 +retrieving revision 1.4.2.1 +diff -u -r1.4 -r1.4.2.1 +--- libc/sysdeps/wordsize-64/strtol_l.c 2003/03/03 09:45:12 1.4 ++++ libc/sysdeps/wordsize-64/strtol_l.c 2005/03/25 11:59:01 1.4.2.1 +@@ -8,7 +8,9 @@ + #undef ____strtoll_l_internal + #undef __strtoll_l + #undef strtoll_l ++#if !UNSIGNED + strong_alias (____strtol_l_internal, ____strtoll_l_internal) + libc_hidden_ver (____strtol_l_internal, ____strtoll_l_internal) + weak_alias (__strtol_l, __strtoll_l) + weak_alias (__strtol_l, strtoll_l) ++#endif +=================================================================== +RCS file: /cvs/glibc/libc/sysdeps/wordsize-64/wcstol_l.c,v +retrieving revision 1.4 +retrieving revision 1.4.2.1 +diff -u -r1.4 -r1.4.2.1 +--- libc/sysdeps/wordsize-64/wcstol_l.c 2002/08/08 11:44:51 1.4 ++++ libc/sysdeps/wordsize-64/wcstol_l.c 2005/03/25 11:59:01 1.4.2.1 +@@ -8,6 +8,8 @@ + #undef ____wcstoll_l_internal + #undef __wcstoll_l + #undef wcstoll_l ++#if !UNSIGNED + strong_alias (____wcstol_l_internal, ____wcstoll_l_internal) + weak_alias (__wcstol_l, __wcstoll_l) + weak_alias (__wcstol_l, wcstoll_l) ++#endif + +Signed-off-by: Robert P. J. Day diff --git a/patches/glibc/2.5/120-glibc-2.3.5-cygwin.patch b/patches/glibc/2.5/120-glibc-2.3.5-cygwin.patch new file mode 100644 index 0000000..3c0cd7d --- /dev/null +++ b/patches/glibc/2.5/120-glibc-2.3.5-cygwin.patch @@ -0,0 +1,187 @@ +Fixes +elf/librtld.os: In function `process_envvars': : undefined reference to `__access' +... +when building glibc-2.3.x on cygwin + +Idea from +http://sources.redhat.com/ml/bug-glibc/2002-01/msg00071/glibc-2.2-cygin-shared.patch +Basically, make glibc use .oST as suffix for 'object static' +instead of .oS, since cygwin has trouble distinguishing .os from .oS +(Original patch had .on, but .oST is more mnemonic for 'object static') + +glibc-linuxthreads-2.3.5 also requires a patch, see +../glibc-linuxthreads-2.3.5/glibc-linuxthreads-2.3.5-cygwin.patch + +[ forward ported to glibc-2.3.5 by Petr Cvachoucek: + +Message-ID: <4282FCBA.3040000@unicontrols.cz> +Date: Thu, 12 May 2005 08:50:34 +0200 +From: Petr Cvachoucek +To: Dan Kegel +CC: crossgcc@sources.redhat.com +Subject: Patches to build gcc 3.4.3 / glibc 2.3.5 on cygwin + +Hi Dan, +following patches are needed to build gcc-3.4.3/glibc-2.3.5 toolchain +on cygwin. Tested to build toolchains for powerpc 604 and 750 targets. + +-- + Petr Cvachoucek + Unicontrols a.s. + http://www.unicontrols.cz +] + +diff -aur glibc-2.3.5/Makeconfig glibc-2.3.5-cygwin/Makeconfig +--- glibc-2.3.5/Makeconfig 2005-02-16 11:50:19.000000000 +0100 ++++ glibc-2.3.5-cygwin/Makeconfig 2005-05-11 08:24:51.046875000 +0200 +@@ -472,7 +472,7 @@ + # run the linked programs. + link-libc = -Wl,-rpath-link=$(rpath-link) \ + $(common-objpfx)libc.so$(libc.so-version) \ +- $(common-objpfx)$(patsubst %,$(libtype.oS),c) $(gnulib) ++ $(common-objpfx)$(patsubst %,$(libtype.oST),c) $(gnulib) + # This is how to find at build-time things that will be installed there. + rpath-dirs = math elf dlfcn nss nis rt resolv crypt + endif +@@ -693,7 +693,7 @@ + # The compilation rules use $(CPPFLAGS-${SUFFIX}) and $(CFLAGS-${SUFFIX}) + # to pass different flags for each flavor. + libtypes = $(foreach o,$(object-suffixes-for-libc),$(libtype$o)) +-all-object-suffixes := .o .os .op .og .ob .oS ++all-object-suffixes := .o .os .op .og .ob .oST + object-suffixes := + CPPFLAGS-.o = $(pic-default) + CFLAGS-.o = $(filter %frame-pointer,$(+cflags)) +@@ -749,14 +749,14 @@ + + ifeq (yes,$(build-shared)) + # Build special library that contains the static-only routines for libc. +-object-suffixes-for-libc += .oS ++object-suffixes-for-libc += .oST + + # Must build the routines as PIC, though, because they can end up in (users') + # shared objects. We don't want to use CFLAGS-os because users may, for + # example, make that processor-specific. +-CFLAGS-.oS = $(CFLAGS-.o) $(PIC-ccflag) +-CPPFLAGS-.oS = $(CPPFLAGS-.o) -DPIC -DLIBC_NONSHARED=1 +-libtype.oS = lib%_nonshared.a ++CFLAGS-.oST = $(CFLAGS-.o) $(PIC-ccflag) ++CPPFLAGS-.oST = $(CPPFLAGS-.o) -DPIC -DLIBC_NONSHARED=1 ++libtype.oST = lib%_nonshared.a + endif + + # The assembler can generate debug information too. +diff -aur glibc-2.3.5/Makerules glibc-2.3.5-cygwin/Makerules +--- glibc-2.3.5/Makerules 2004-12-15 19:52:39.000000000 +0100 ++++ glibc-2.3.5-cygwin/Makerules 2005-05-11 08:25:33.578125000 +0200 +@@ -417,7 +417,7 @@ + # Bounded pointer thunks are only built for *.ob + elide-bp-thunks = $(addprefix $(bppfx),$(bp-thunks)) + +-elide-routines.oS += $(filter-out $(static-only-routines),\ ++elide-routines.oST += $(filter-out $(static-only-routines),\ + $(routines) $(aux) $(sysdep_routines)) \ + $(elide-bp-thunks) + elide-routines.os += $(static-only-routines) $(elide-bp-thunks) +@@ -981,7 +981,7 @@ + install: $(inst_libdir)/libc.so + $(inst_libdir)/libc.so: $(common-objpfx)format.lds \ + $(common-objpfx)libc.so$(libc.so-version) \ +- $(inst_libdir)/$(patsubst %,$(libtype.oS),\ ++ $(inst_libdir)/$(patsubst %,$(libtype.oST),\ + $(libprefix)$(libc-name)) \ + $(+force) + (echo '/* GNU ld script';\ +@@ -989,7 +989,7 @@ + echo ' the static library, so try that secondarily. */';\ + cat $<; \ + echo 'GROUP ( $(slibdir)/libc.so$(libc.so-version)' \ +- '$(libdir)/$(patsubst %,$(libtype.oS),$(libprefix)$(libc-name))'\ ++ '$(libdir)/$(patsubst %,$(libtype.oST),$(libprefix)$(libc-name))'\ + ' AS_NEEDED (' $(slibdir)/$(rtld-installed-name) ') )' \ + ) > $@.new + mv -f $@.new $@ +diff -aur glibc-2.3.5/extra-lib.mk glibc-2.3.5-cygwin/extra-lib.mk +--- glibc-2.3.5/extra-lib.mk 2004-12-02 23:54:47.000000000 +0100 ++++ glibc-2.3.5-cygwin/extra-lib.mk 2005-05-11 08:27:28.156250000 +0200 +@@ -13,7 +13,7 @@ + + ifneq (,$($(lib)-static-only-routines)) + ifneq (,$(filter yesyes%,$(build-shared)$(elf)$($(lib).so-version))) +-object-suffixes-$(lib) += $(filter-out $($(lib)-inhibit-o),.oS) ++object-suffixes-$(lib) += $(filter-out $($(lib)-inhibit-o),.oST) + endif + endif + +@@ -29,7 +29,7 @@ + + # Add each flavor of library to the lists of things to build and install. + install-lib += $(foreach o,$(object-suffixes-$(lib)),$(lib:lib%=$(libtype$o))) +-extra-objs += $(foreach o,$(filter-out .os .oS,$(object-suffixes-$(lib))),\ ++extra-objs += $(foreach o,$(filter-out .os .oST,$(object-suffixes-$(lib))),\ + $(patsubst %,%$o,$(filter-out \ + $($(lib)-shared-only-routines),\ + $(all-$(lib)-routines)))) +@@ -57,7 +57,7 @@ + + + # Use o-iterator.mk to generate a rule for each flavor of library. +-ifneq (,$(filter-out .os .oS,$(object-suffixes-$(lib)))) ++ifneq (,$(filter-out .os .oST,$(object-suffixes-$(lib)))) + define o-iterator-doit + $(objpfx)$(patsubst %,$(libtype$o),$(lib:lib%=%)): \ + $(patsubst %,$(objpfx)%$o,\ +@@ -65,7 +65,7 @@ + $(all-$(lib)-routines))); \ + $$(build-extra-lib) + endef +-object-suffixes-left = $(filter-out .os .oS,$(object-suffixes-$(lib))) ++object-suffixes-left = $(filter-out .os .oST,$(object-suffixes-$(lib))) + include $(patsubst %,$(..)o-iterator.mk,$(object-suffixes-left)) + endif + +@@ -77,9 +77,9 @@ + $(build-extra-lib) + endif + +-ifneq (,$(filter .oS,$(object-suffixes-$(lib)))) +-$(objpfx)$(patsubst %,$(libtype.oS),$(lib:lib%=%)): \ +- $(patsubst %,$(objpfx)%.oS,\ ++ifneq (,$(filter .oST,$(object-suffixes-$(lib)))) ++$(objpfx)$(patsubst %,$(libtype.oST),$(lib:lib%=%)): \ ++ $(patsubst %,$(objpfx)%.oST,\ + $(filter $($(lib)-static-only-routines),\ + $(all-$(lib)-routines))) + $(build-extra-lib) +diff -aur glibc-2.3.5/nptl/Makefile glibc-2.3.5-cygwin/nptl/Makefile +--- glibc-2.3.5/nptl/Makefile 2005-02-16 09:45:56.000000000 +0100 ++++ glibc-2.3.5-cygwin/nptl/Makefile 2005-05-11 08:26:01.812500000 +0200 +@@ -375,7 +375,7 @@ + + $(inst_libdir)/libpthread.so: $(common-objpfx)format.lds \ + $(objpfx)libpthread.so$(libpthread.so-version) \ +- $(inst_libdir)/$(patsubst %,$(libtype.oS),\ ++ $(inst_libdir)/$(patsubst %,$(libtype.oST),\ + $(libprefix)pthread) \ + $(+force) + (echo '/* GNU ld script';\ +@@ -383,7 +383,7 @@ + echo ' the static library, so try that secondarily. */';\ + cat $<; \ + echo 'GROUP ( $(slibdir)/libpthread.so$(libpthread.so-version)' \ +- '$(libdir)/$(patsubst %,$(libtype.oS),$(libprefix)pthread)'\ ++ '$(libdir)/$(patsubst %,$(libtype.oST),$(libprefix)pthread)'\ + ')' \ + ) > $@.new + mv -f $@.new $@ +diff -aur glibc-2.3.5/sysdeps/sparc/sparc32/sparcv9/Makefile glibc-2.3.5-cygwin/sysdeps/sparc/sparc32/sparcv9/Makefile +--- glibc-2.3.5/sysdeps/sparc/sparc32/sparcv9/Makefile 2004-08-16 08:46:14.000000000 +0200 ++++ glibc-2.3.5-cygwin/sysdeps/sparc/sparc32/sparcv9/Makefile 2005-05-11 08:26:25.937500000 +0200 +@@ -10,4 +10,4 @@ + ASFLAGS-.op += -Wa,-Av9a + ASFLAGS-.og += -Wa,-Av9a + ASFLAGS-.ob += -Wa,-Av9a +-ASFLAGS-.oS += -Wa,-Av9a ++ASFLAGS-.oST += -Wa,-Av9a + +Signed-off-by: Robert P. J. Day diff --git a/patches/glibc/2.5/130-glibc-2.3.6-allow-gcc-4.0-elf.patch b/patches/glibc/2.5/130-glibc-2.3.6-allow-gcc-4.0-elf.patch new file mode 100644 index 0000000..87860fa --- /dev/null +++ b/patches/glibc/2.5/130-glibc-2.3.6-allow-gcc-4.0-elf.patch @@ -0,0 +1,67 @@ +From http://www.mail-archive.com/pld-cvs-commit@pld-linux.org/msg00229.html +Fixes + rtld.c: In function '_dl_start': + dynamic-link.h:47: error: nested function 'elf_machine_rela_relative' declared but never defined + dynamic-link.h:41: error: nested function 'elf_machine_rela' declared but never defined +when compiling glibc-2.3.4 with gcc-4.0 + +But see also +http://sources.redhat.com/ml/libc-hacker/2005-02/msg00000.html +and +http://sources.redhat.com/ml/libc-hacker/2005-03/msg00008.html +which seem to propose less radical fixes? + +Aha. See also http://sources.redhat.com/bugzilla/show_bug.cgi?id=721 + +--- glibc-2.3.6.orig/elf/dynamic-link.h 2005-03-12 18:12:37.000000000 -0800 ++++ glibc-2.3.6/elf/dynamic-link.h 2005-03-12 18:12:59.777820848 -0800 +@@ -19,47 +19,6 @@ + + #include + #include +- +-#ifdef RESOLVE_MAP +-/* We pass reloc_addr as a pointer to void, as opposed to a pointer to +- ElfW(Addr), because not all architectures can assume that the +- relocated address is properly aligned, whereas the compiler is +- entitled to assume that a pointer to a type is properly aligned for +- the type. Even if we cast the pointer back to some other type with +- less strict alignment requirements, the compiler might still +- remember that the pointer was originally more aligned, thereby +- optimizing away alignment tests or using word instructions for +- copying memory, breaking the very code written to handle the +- unaligned cases. */ +-# if ! ELF_MACHINE_NO_REL +-auto inline void __attribute__((always_inline)) +-elf_machine_rel (struct link_map *map, const ElfW(Rel) *reloc, +- const ElfW(Sym) *sym, const struct r_found_version *version, +- void *const reloc_addr); +-auto inline void __attribute__((always_inline)) +-elf_machine_rel_relative (ElfW(Addr) l_addr, const ElfW(Rel) *reloc, +- void *const reloc_addr); +-# endif +-# if ! ELF_MACHINE_NO_RELA +-auto inline void __attribute__((always_inline)) +-elf_machine_rela (struct link_map *map, const ElfW(Rela) *reloc, +- const ElfW(Sym) *sym, const struct r_found_version *version, +- void *const reloc_addr); +-auto inline void __attribute__((always_inline)) +-elf_machine_rela_relative (ElfW(Addr) l_addr, const ElfW(Rela) *reloc, +- void *const reloc_addr); +-# endif +-# if ELF_MACHINE_NO_RELA || defined ELF_MACHINE_PLT_REL +-auto inline void __attribute__((always_inline)) +-elf_machine_lazy_rel (struct link_map *map, +- ElfW(Addr) l_addr, const ElfW(Rel) *reloc); +-# else +-auto inline void __attribute__((always_inline)) +-elf_machine_lazy_rel (struct link_map *map, +- ElfW(Addr) l_addr, const ElfW(Rela) *reloc); +-# endif +-#endif +- + #include + + #ifndef VERSYMIDX + +Signed-off-by: Robert P. J. Day diff --git a/patches/glibc/2.5/140-glibc-2.3.6-configure-apple-as.patch b/patches/glibc/2.5/140-glibc-2.3.6-configure-apple-as.patch new file mode 100644 index 0000000..78a1324 --- /dev/null +++ b/patches/glibc/2.5/140-glibc-2.3.6-configure-apple-as.patch @@ -0,0 +1,25 @@ +http://in3www.epfl.ch/~schaffne/glibc-configure-apple-as.patch +http://sources.redhat.com/ml/crossgcc/2004-02/msg00151.html + +The following makes it possible to configure glibc-2.3.2 on Mac OS X, +where the assembler but doesn't understand the --version flag. + +Fixes the symptom +checking whether ld is GNU ld... no +checking for /usr/libexec/gcc/darwin/ppc/as... /usr/libexec/gcc/darwin/ppc/as +checking version of /usr/libexec/gcc/darwin/ppc/as... + + +--- glibc-2.3.2/configure~ Wed Feb 26 09:20:48 2003 ++++ glibc-2.3.2/configure Fri Feb 27 13:12:53 2004 +@@ -4039,7 +4039,7 @@ + # Found it, now check the version. + echo "$as_me:$LINENO: checking version of $AS" >&5 + echo $ECHO_N "checking version of $AS... $ECHO_C" >&6 +- ac_prog_version=`$AS --version 2>&1 | sed -n 's/^.*GNU assembler.* \([0-9]*\.[0-9.]*\).*$/\1/p'` ++ ac_prog_version=`$AS -v &1 | sed -n 's/^.*GNU assembler.* \([0-9]*\.[0-9.]*\).*$/\1/p'` + case $ac_prog_version in + '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;; + 2.1[3-9]*) + +Signed-off-by: Robert P. J. Day diff --git a/patches/glibc/2.5/150-glibc-2.3.6-fix-pr631.patch b/patches/glibc/2.5/150-glibc-2.3.6-fix-pr631.patch new file mode 100644 index 0000000..13688df --- /dev/null +++ b/patches/glibc/2.5/150-glibc-2.3.6-fix-pr631.patch @@ -0,0 +1,45 @@ +From dank@kegel.com +Wed Jun 15 09:12:43 PDT 2005 + +Fixes + +build-glibc/libc.a(nsswitch.o)(.data+0x64): undefined reference to `_nss_files_getaliasent_r' +build-glibc/libc.a(nsswitch.o)(.data+0x6c): undefined reference to `_nss_files_endaliasent' +... 53 lines deleted ... +build-glibc/libc.a(nsswitch.o)(.data+0x21c): undefined reference to `_nss_files_getspnam_r' +collect2: ld returned 1 exit status +make[2]: *** [/build/gcc-3.4.3-glibc-2.3.5-hdrs-2.6.11.2/i686-unknown-linux-gnu/build-glibc/elf/ldconfig] Error 1 + +when building glibc with --enable-static-nss. + +See http://sources.redhat.com/bugzilla/show_bug.cgi?id=631 + +--- glibc-2.3.5/Makeconfig.old Wed Jun 15 08:13:12 2005 ++++ glibc-2.3.5/Makeconfig Wed Jun 15 08:13:14 2005 +@@ -510,7 +510,7 @@ + + # The static libraries. + ifeq (yes,$(build-static)) +-link-libc-static = $(common-objpfx)libc.a $(static-gnulib) $(common-objpfx)libc.a ++link-libc-static = $(common-objpfx)libc.a $(static-gnulib) $(otherlibs) $(common-objpfx)libc.a + else + ifeq (yes,$(build-shared)) + # We can try to link the programs with lib*_pic.a... +--- glibc-2.3.5/elf/Makefile.old Wed Jun 15 07:46:49 2005 ++++ glibc-2.3.5/elf/Makefile Wed Jun 15 08:14:00 2005 +@@ -120,6 +120,13 @@ + install-bin-script = ldd + endif + ++ifeq (yes,$(build-static-nss)) ++nssobjdir := $(patsubst ../$(subdir),.,$(common-objpfx)nss) ++resolvobjdir := $(patsubst ../$(subdir),.,$(common-objpfx)resolv) ++otherlibs += $(nssobjdir)/libnss_files.a $(resolvobjdir)/libnss_dns.a \ ++ $(resolvobjdir)/libresolv.a ++endif ++ + others = sprof sln + install-bin = sprof + others-static = sln + +Signed-off-by: Robert P. J. Day diff --git a/patches/glibc/2.5/160-glibc-2.4-i686-assembler.patch b/patches/glibc/2.5/160-glibc-2.4-i686-assembler.patch new file mode 100644 index 0000000..9904efb --- /dev/null +++ b/patches/glibc/2.5/160-glibc-2.4-i686-assembler.patch @@ -0,0 +1,38 @@ +2007-02-15 Khem Raj + + * sysdeps/unix/sysv/linux/i386/sysdep.h: Re-define __i686. + * nptl/sysdeps/pthread/pt-initfini.c: Ditto. + + + +Index: glibc-2.4/sysdeps/unix/sysv/linux/i386/sysdep.h +=================================================================== +--- glibc-2.4/sysdeps/unix/sysv/linux/i386/sysdep.h (revision 1469) ++++ glibc-2.4/sysdeps/unix/sysv/linux/i386/sysdep.h (working copy) +@@ -29,6 +29,10 @@ + #include + #include + ++#if defined __i686 && defined __ASSEMBLER__ ++#undef __i686 ++#define __i686 __i686 ++#endif + + /* For Linux we can use the system call table in the header file + /usr/include/asm/unistd.h +Index: glibc-2.4/nptl/sysdeps/pthread/pt-initfini.c +=================================================================== +--- glibc-2.4/nptl/sysdeps/pthread/pt-initfini.c (revision 1469) ++++ glibc-2.4/nptl/sysdeps/pthread/pt-initfini.c (working copy) +@@ -45,6 +45,11 @@ + /* Embed an #include to pull in the alignment and .end directives. */ + asm ("\n#include \"defs.h\""); + ++asm ("\n#if defined __i686 && defined __ASSEMBLER__"); ++asm ("\n#undef __i686"); ++asm ("\n#define __i686 __i686"); ++asm ("\n#endif"); ++ + /* The initial common code ends here. */ + asm ("\n/*@HEADER_ENDS*/"); + diff --git a/patches/glibc/2.5/170-glibc-i386-preferred-stack-boundary.patch b/patches/glibc/2.5/170-glibc-i386-preferred-stack-boundary.patch new file mode 100644 index 0000000..449821d --- /dev/null +++ b/patches/glibc/2.5/170-glibc-i386-preferred-stack-boundary.patch @@ -0,0 +1,18 @@ +(C) 2007 Yann E. MORIN +License: LGPL v2.1 + +Shut off a stupid warning: preffered-stack-boundary must be between 4 ad 12, +and 2 is not. + +diff -dur glibc-2.5.orig/sysdeps/i386/Makefile glibc-2.5/sysdeps/i386/Makefile +--- glibc-2.5.orig/sysdeps/i386/Makefile 2005-03-06 01:18:16.000000000 +0100 ++++ glibc-2.5/sysdeps/i386/Makefile 2007-05-27 17:49:37.000000000 +0200 +@@ -36,7 +36,7 @@ + ifeq ($(subdir),csu) + sysdep-CFLAGS += -mpreferred-stack-boundary=4 + else +-sysdep-CFLAGS += -mpreferred-stack-boundary=2 ++sysdep-CFLAGS += -mpreferred-stack-boundary=4 + # Likewise, any function which calls user callbacks + uses-callbacks += -mpreferred-stack-boundary=4 + # Likewise, any stack alignment tests diff --git a/patches/glibc/2.5/fix-pr398.patch b/patches/glibc/2.5/fix-pr398.patch deleted file mode 100644 index d5d0309..0000000 --- a/patches/glibc/2.5/fix-pr398.patch +++ /dev/null @@ -1,70 +0,0 @@ -Fixes error - -dl-runtime.c:222: error: parse error before "CFI_STARTPROC" -make[2]: *** [crosstool-0.28-rc35/build/s390-unknown-linux-gnu/gcc-3.4.1-glibc-20040822/build-glibc/elf/dl-runtim -e.o] Error 1 -make[2]: Leaving directory `crosstool-0.28-rc35/build/s390-unknown-linux-gnu/gcc-3.4.1-glibc-20040822/glibc-20040 -822/elf' -make[1]: *** [elf/subdir_lib] Error 2 -make[1]: Leaving directory `crosstool-0.28-rc35/build/s390-unknown-linux-gnu/gcc-3.4.1-glibc-20040822/glibc-20040 -822' -make: *** [all] Error 2 - ------------------ - -See http://sources.redhat.com/bugzilla/show_bug.cgi?id=398 -http://sources.redhat.com/ml/libc-alpha/2004-07/msg00023.html - ------------------ - -CVSROOT: /cvs/glibc -Module name: libc -Branch: glibc-2_3-branch -Changes by: roland@sources.redhat.com 2006-02-23 22:36:51 - -Modified files: - sysdeps/s390/s390-64: dl-machine.h - sysdeps/s390/s390-32: dl-machine.h - -Log message: - 2004-07-10 GOTO Masanori - - [BZ #398] - * sysdeps/s390/s390-32/dl-machine.h: Include for CFI - directive. - * sysdeps/s390/s390-64/dl-machine.h: Likewise. - -Patches: -http://sources.redhat.com/cgi-bin/cvsweb.cgi/libc/sysdeps/s390/s390-64/dl-machine.h.diff?cvsroot=glibc&only_with_tag=glibc-2_3-branch&r1=1.19.4.1&r2=1.19.4.2 -http://sources.redhat.com/cgi-bin/cvsweb.cgi/libc/sysdeps/s390/s390-32/dl-machine.h.diff?cvsroot=glibc&only_with_tag=glibc-2_3-branch&r1=1.20.4.1&r2=1.20.4.2 - -=================================================================== -RCS file: /cvs/glibc/libc/sysdeps/s390/s390-64/dl-machine.h,v -retrieving revision 1.19.4.1 -retrieving revision 1.19.4.2 -diff -u -r1.19.4.1 -r1.19.4.2 ---- libc/sysdeps/s390/s390-64/dl-machine.h 2005/10/17 04:57:27 1.19.4.1 -+++ libc/sysdeps/s390/s390-64/dl-machine.h 2006/02/23 22:36:51 1.19.4.2 -@@ -27,6 +27,7 @@ - #include - #include - #include -+#include - - /* This is an older, now obsolete value. */ - #define EM_S390_OLD 0xA390 -=================================================================== -RCS file: /cvs/glibc/libc/sysdeps/s390/s390-32/dl-machine.h,v -retrieving revision 1.20.4.1 -retrieving revision 1.20.4.2 -diff -u -r1.20.4.1 -r1.20.4.2 ---- libc/sysdeps/s390/s390-32/dl-machine.h 2005/10/17 04:57:27 1.20.4.1 -+++ libc/sysdeps/s390/s390-32/dl-machine.h 2006/02/23 22:36:51 1.20.4.2 -@@ -27,6 +27,7 @@ - #include - #include - #include -+#include - - /* This is an older, now obsolete value. */ - #define EM_S390_OLD 0xA390 diff --git a/patches/glibc/2.5/glibc-2.3.5-allow-gcc4-wcstol_l.patch b/patches/glibc/2.5/glibc-2.3.5-allow-gcc4-wcstol_l.patch deleted file mode 100644 index 0e6776f..0000000 --- a/patches/glibc/2.5/glibc-2.3.5-allow-gcc4-wcstol_l.patch +++ /dev/null @@ -1,59 +0,0 @@ -Fixes -../sysdeps/wordsize-64/wcstol_l.c:11: error: '____wcstoll_l_internal' aliased to undefined symbol '____wcstol_l_internal' -../sysdeps/wordsize-64/wcstol_l.c:12: error: '__wcstoll_l' aliased to undefined symbol '__wcstol_l' -../sysdeps/wordsize-64/wcstol_l.c:13: error: 'wcstoll_l' aliased to undefined symbol '__wcstol_l' -make[2]: *** [/home/dkegel/queue/jobdir.produser_cpsm10/crosstool-0.32/build/x86_64-unknown-linux-gnu/gcc-4.0.0-20050410-glibc-2.3.4/build-glibc/wcsmbs/wcstoul_l.o] Error 1 - -https://www.redhat.com/archives/fedora-cvs-commits/2005-March/msg00408.html -%changelog -+* Fri Mar 25 2005 Jakub Jelinek 2.3.4-18 -+- fix build on 64-bit arches with new GCC - -Revision 1.4.2.1, Fri Mar 25 11:59:01 2005 UTC (3 weeks, 4 days ago) by jakub -Branch: fedora-branch -CVS Tags: fedora-glibc-2_3_4-18 -Changes since 1.4: +2 -0 lines -Diff to previous 1.4 (colored) - - * sysdeps/wordsize-64/strtol_l.c: Don't add aliases if UNSIGNED. - * sysdeps/wordsize-64/wcstol_l.c: Likewise. - - -http://sourceware.org/cgi-bin/cvsweb.cgi/libc/sysdeps/wordsize-64/strtol_l.c.diff?r1=1.4&r2=1.4.2.1&cvsroot=glibc -http://sourceware.org/cgi-bin/cvsweb.cgi/libc/sysdeps/wordsize-64/wcstol_l.c.diff?r1=1.4&r2=1.4.2.1&cvsroot=glibc - -=================================================================== -RCS file: /cvs/glibc/libc/sysdeps/wordsize-64/strtol_l.c,v -retrieving revision 1.4 -retrieving revision 1.4.2.1 -diff -u -r1.4 -r1.4.2.1 ---- libc/sysdeps/wordsize-64/strtol_l.c 2003/03/03 09:45:12 1.4 -+++ libc/sysdeps/wordsize-64/strtol_l.c 2005/03/25 11:59:01 1.4.2.1 -@@ -8,7 +8,9 @@ - #undef ____strtoll_l_internal - #undef __strtoll_l - #undef strtoll_l -+#if !UNSIGNED - strong_alias (____strtol_l_internal, ____strtoll_l_internal) - libc_hidden_ver (____strtol_l_internal, ____strtoll_l_internal) - weak_alias (__strtol_l, __strtoll_l) - weak_alias (__strtol_l, strtoll_l) -+#endif -=================================================================== -RCS file: /cvs/glibc/libc/sysdeps/wordsize-64/wcstol_l.c,v -retrieving revision 1.4 -retrieving revision 1.4.2.1 -diff -u -r1.4 -r1.4.2.1 ---- libc/sysdeps/wordsize-64/wcstol_l.c 2002/08/08 11:44:51 1.4 -+++ libc/sysdeps/wordsize-64/wcstol_l.c 2005/03/25 11:59:01 1.4.2.1 -@@ -8,6 +8,8 @@ - #undef ____wcstoll_l_internal - #undef __wcstoll_l - #undef wcstoll_l -+#if !UNSIGNED - strong_alias (____wcstol_l_internal, ____wcstoll_l_internal) - weak_alias (__wcstol_l, __wcstoll_l) - weak_alias (__wcstol_l, wcstoll_l) -+#endif - -Signed-off-by: Robert P. J. Day diff --git a/patches/glibc/2.5/glibc-2.3.5-cygwin.patch b/patches/glibc/2.5/glibc-2.3.5-cygwin.patch deleted file mode 100644 index 3c0cd7d..0000000 --- a/patches/glibc/2.5/glibc-2.3.5-cygwin.patch +++ /dev/null @@ -1,187 +0,0 @@ -Fixes -elf/librtld.os: In function `process_envvars': : undefined reference to `__access' -... -when building glibc-2.3.x on cygwin - -Idea from -http://sources.redhat.com/ml/bug-glibc/2002-01/msg00071/glibc-2.2-cygin-shared.patch -Basically, make glibc use .oST as suffix for 'object static' -instead of .oS, since cygwin has trouble distinguishing .os from .oS -(Original patch had .on, but .oST is more mnemonic for 'object static') - -glibc-linuxthreads-2.3.5 also requires a patch, see -../glibc-linuxthreads-2.3.5/glibc-linuxthreads-2.3.5-cygwin.patch - -[ forward ported to glibc-2.3.5 by Petr Cvachoucek: - -Message-ID: <4282FCBA.3040000@unicontrols.cz> -Date: Thu, 12 May 2005 08:50:34 +0200 -From: Petr Cvachoucek -To: Dan Kegel -CC: crossgcc@sources.redhat.com -Subject: Patches to build gcc 3.4.3 / glibc 2.3.5 on cygwin - -Hi Dan, -following patches are needed to build gcc-3.4.3/glibc-2.3.5 toolchain -on cygwin. Tested to build toolchains for powerpc 604 and 750 targets. - --- - Petr Cvachoucek - Unicontrols a.s. - http://www.unicontrols.cz -] - -diff -aur glibc-2.3.5/Makeconfig glibc-2.3.5-cygwin/Makeconfig ---- glibc-2.3.5/Makeconfig 2005-02-16 11:50:19.000000000 +0100 -+++ glibc-2.3.5-cygwin/Makeconfig 2005-05-11 08:24:51.046875000 +0200 -@@ -472,7 +472,7 @@ - # run the linked programs. - link-libc = -Wl,-rpath-link=$(rpath-link) \ - $(common-objpfx)libc.so$(libc.so-version) \ -- $(common-objpfx)$(patsubst %,$(libtype.oS),c) $(gnulib) -+ $(common-objpfx)$(patsubst %,$(libtype.oST),c) $(gnulib) - # This is how to find at build-time things that will be installed there. - rpath-dirs = math elf dlfcn nss nis rt resolv crypt - endif -@@ -693,7 +693,7 @@ - # The compilation rules use $(CPPFLAGS-${SUFFIX}) and $(CFLAGS-${SUFFIX}) - # to pass different flags for each flavor. - libtypes = $(foreach o,$(object-suffixes-for-libc),$(libtype$o)) --all-object-suffixes := .o .os .op .og .ob .oS -+all-object-suffixes := .o .os .op .og .ob .oST - object-suffixes := - CPPFLAGS-.o = $(pic-default) - CFLAGS-.o = $(filter %frame-pointer,$(+cflags)) -@@ -749,14 +749,14 @@ - - ifeq (yes,$(build-shared)) - # Build special library that contains the static-only routines for libc. --object-suffixes-for-libc += .oS -+object-suffixes-for-libc += .oST - - # Must build the routines as PIC, though, because they can end up in (users') - # shared objects. We don't want to use CFLAGS-os because users may, for - # example, make that processor-specific. --CFLAGS-.oS = $(CFLAGS-.o) $(PIC-ccflag) --CPPFLAGS-.oS = $(CPPFLAGS-.o) -DPIC -DLIBC_NONSHARED=1 --libtype.oS = lib%_nonshared.a -+CFLAGS-.oST = $(CFLAGS-.o) $(PIC-ccflag) -+CPPFLAGS-.oST = $(CPPFLAGS-.o) -DPIC -DLIBC_NONSHARED=1 -+libtype.oST = lib%_nonshared.a - endif - - # The assembler can generate debug information too. -diff -aur glibc-2.3.5/Makerules glibc-2.3.5-cygwin/Makerules ---- glibc-2.3.5/Makerules 2004-12-15 19:52:39.000000000 +0100 -+++ glibc-2.3.5-cygwin/Makerules 2005-05-11 08:25:33.578125000 +0200 -@@ -417,7 +417,7 @@ - # Bounded pointer thunks are only built for *.ob - elide-bp-thunks = $(addprefix $(bppfx),$(bp-thunks)) - --elide-routines.oS += $(filter-out $(static-only-routines),\ -+elide-routines.oST += $(filter-out $(static-only-routines),\ - $(routines) $(aux) $(sysdep_routines)) \ - $(elide-bp-thunks) - elide-routines.os += $(static-only-routines) $(elide-bp-thunks) -@@ -981,7 +981,7 @@ - install: $(inst_libdir)/libc.so - $(inst_libdir)/libc.so: $(common-objpfx)format.lds \ - $(common-objpfx)libc.so$(libc.so-version) \ -- $(inst_libdir)/$(patsubst %,$(libtype.oS),\ -+ $(inst_libdir)/$(patsubst %,$(libtype.oST),\ - $(libprefix)$(libc-name)) \ - $(+force) - (echo '/* GNU ld script';\ -@@ -989,7 +989,7 @@ - echo ' the static library, so try that secondarily. */';\ - cat $<; \ - echo 'GROUP ( $(slibdir)/libc.so$(libc.so-version)' \ -- '$(libdir)/$(patsubst %,$(libtype.oS),$(libprefix)$(libc-name))'\ -+ '$(libdir)/$(patsubst %,$(libtype.oST),$(libprefix)$(libc-name))'\ - ' AS_NEEDED (' $(slibdir)/$(rtld-installed-name) ') )' \ - ) > $@.new - mv -f $@.new $@ -diff -aur glibc-2.3.5/extra-lib.mk glibc-2.3.5-cygwin/extra-lib.mk ---- glibc-2.3.5/extra-lib.mk 2004-12-02 23:54:47.000000000 +0100 -+++ glibc-2.3.5-cygwin/extra-lib.mk 2005-05-11 08:27:28.156250000 +0200 -@@ -13,7 +13,7 @@ - - ifneq (,$($(lib)-static-only-routines)) - ifneq (,$(filter yesyes%,$(build-shared)$(elf)$($(lib).so-version))) --object-suffixes-$(lib) += $(filter-out $($(lib)-inhibit-o),.oS) -+object-suffixes-$(lib) += $(filter-out $($(lib)-inhibit-o),.oST) - endif - endif - -@@ -29,7 +29,7 @@ - - # Add each flavor of library to the lists of things to build and install. - install-lib += $(foreach o,$(object-suffixes-$(lib)),$(lib:lib%=$(libtype$o))) --extra-objs += $(foreach o,$(filter-out .os .oS,$(object-suffixes-$(lib))),\ -+extra-objs += $(foreach o,$(filter-out .os .oST,$(object-suffixes-$(lib))),\ - $(patsubst %,%$o,$(filter-out \ - $($(lib)-shared-only-routines),\ - $(all-$(lib)-routines)))) -@@ -57,7 +57,7 @@ - - - # Use o-iterator.mk to generate a rule for each flavor of library. --ifneq (,$(filter-out .os .oS,$(object-suffixes-$(lib)))) -+ifneq (,$(filter-out .os .oST,$(object-suffixes-$(lib)))) - define o-iterator-doit - $(objpfx)$(patsubst %,$(libtype$o),$(lib:lib%=%)): \ - $(patsubst %,$(objpfx)%$o,\ -@@ -65,7 +65,7 @@ - $(all-$(lib)-routines))); \ - $$(build-extra-lib) - endef --object-suffixes-left = $(filter-out .os .oS,$(object-suffixes-$(lib))) -+object-suffixes-left = $(filter-out .os .oST,$(object-suffixes-$(lib))) - include $(patsubst %,$(..)o-iterator.mk,$(object-suffixes-left)) - endif - -@@ -77,9 +77,9 @@ - $(build-extra-lib) - endif - --ifneq (,$(filter .oS,$(object-suffixes-$(lib)))) --$(objpfx)$(patsubst %,$(libtype.oS),$(lib:lib%=%)): \ -- $(patsubst %,$(objpfx)%.oS,\ -+ifneq (,$(filter .oST,$(object-suffixes-$(lib)))) -+$(objpfx)$(patsubst %,$(libtype.oST),$(lib:lib%=%)): \ -+ $(patsubst %,$(objpfx)%.oST,\ - $(filter $($(lib)-static-only-routines),\ - $(all-$(lib)-routines))) - $(build-extra-lib) -diff -aur glibc-2.3.5/nptl/Makefile glibc-2.3.5-cygwin/nptl/Makefile ---- glibc-2.3.5/nptl/Makefile 2005-02-16 09:45:56.000000000 +0100 -+++ glibc-2.3.5-cygwin/nptl/Makefile 2005-05-11 08:26:01.812500000 +0200 -@@ -375,7 +375,7 @@ - - $(inst_libdir)/libpthread.so: $(common-objpfx)format.lds \ - $(objpfx)libpthread.so$(libpthread.so-version) \ -- $(inst_libdir)/$(patsubst %,$(libtype.oS),\ -+ $(inst_libdir)/$(patsubst %,$(libtype.oST),\ - $(libprefix)pthread) \ - $(+force) - (echo '/* GNU ld script';\ -@@ -383,7 +383,7 @@ - echo ' the static library, so try that secondarily. */';\ - cat $<; \ - echo 'GROUP ( $(slibdir)/libpthread.so$(libpthread.so-version)' \ -- '$(libdir)/$(patsubst %,$(libtype.oS),$(libprefix)pthread)'\ -+ '$(libdir)/$(patsubst %,$(libtype.oST),$(libprefix)pthread)'\ - ')' \ - ) > $@.new - mv -f $@.new $@ -diff -aur glibc-2.3.5/sysdeps/sparc/sparc32/sparcv9/Makefile glibc-2.3.5-cygwin/sysdeps/sparc/sparc32/sparcv9/Makefile ---- glibc-2.3.5/sysdeps/sparc/sparc32/sparcv9/Makefile 2004-08-16 08:46:14.000000000 +0200 -+++ glibc-2.3.5-cygwin/sysdeps/sparc/sparc32/sparcv9/Makefile 2005-05-11 08:26:25.937500000 +0200 -@@ -10,4 +10,4 @@ - ASFLAGS-.op += -Wa,-Av9a - ASFLAGS-.og += -Wa,-Av9a - ASFLAGS-.ob += -Wa,-Av9a --ASFLAGS-.oS += -Wa,-Av9a -+ASFLAGS-.oST += -Wa,-Av9a - -Signed-off-by: Robert P. J. Day diff --git a/patches/glibc/2.5/glibc-2.3.6-allow-gcc-4.0-elf.patch b/patches/glibc/2.5/glibc-2.3.6-allow-gcc-4.0-elf.patch deleted file mode 100644 index 87860fa..0000000 --- a/patches/glibc/2.5/glibc-2.3.6-allow-gcc-4.0-elf.patch +++ /dev/null @@ -1,67 +0,0 @@ -From http://www.mail-archive.com/pld-cvs-commit@pld-linux.org/msg00229.html -Fixes - rtld.c: In function '_dl_start': - dynamic-link.h:47: error: nested function 'elf_machine_rela_relative' declared but never defined - dynamic-link.h:41: error: nested function 'elf_machine_rela' declared but never defined -when compiling glibc-2.3.4 with gcc-4.0 - -But see also -http://sources.redhat.com/ml/libc-hacker/2005-02/msg00000.html -and -http://sources.redhat.com/ml/libc-hacker/2005-03/msg00008.html -which seem to propose less radical fixes? - -Aha. See also http://sources.redhat.com/bugzilla/show_bug.cgi?id=721 - ---- glibc-2.3.6.orig/elf/dynamic-link.h 2005-03-12 18:12:37.000000000 -0800 -+++ glibc-2.3.6/elf/dynamic-link.h 2005-03-12 18:12:59.777820848 -0800 -@@ -19,47 +19,6 @@ - - #include - #include -- --#ifdef RESOLVE_MAP --/* We pass reloc_addr as a pointer to void, as opposed to a pointer to -- ElfW(Addr), because not all architectures can assume that the -- relocated address is properly aligned, whereas the compiler is -- entitled to assume that a pointer to a type is properly aligned for -- the type. Even if we cast the pointer back to some other type with -- less strict alignment requirements, the compiler might still -- remember that the pointer was originally more aligned, thereby -- optimizing away alignment tests or using word instructions for -- copying memory, breaking the very code written to handle the -- unaligned cases. */ --# if ! ELF_MACHINE_NO_REL --auto inline void __attribute__((always_inline)) --elf_machine_rel (struct link_map *map, const ElfW(Rel) *reloc, -- const ElfW(Sym) *sym, const struct r_found_version *version, -- void *const reloc_addr); --auto inline void __attribute__((always_inline)) --elf_machine_rel_relative (ElfW(Addr) l_addr, const ElfW(Rel) *reloc, -- void *const reloc_addr); --# endif --# if ! ELF_MACHINE_NO_RELA --auto inline void __attribute__((always_inline)) --elf_machine_rela (struct link_map *map, const ElfW(Rela) *reloc, -- const ElfW(Sym) *sym, const struct r_found_version *version, -- void *const reloc_addr); --auto inline void __attribute__((always_inline)) --elf_machine_rela_relative (ElfW(Addr) l_addr, const ElfW(Rela) *reloc, -- void *const reloc_addr); --# endif --# if ELF_MACHINE_NO_RELA || defined ELF_MACHINE_PLT_REL --auto inline void __attribute__((always_inline)) --elf_machine_lazy_rel (struct link_map *map, -- ElfW(Addr) l_addr, const ElfW(Rel) *reloc); --# else --auto inline void __attribute__((always_inline)) --elf_machine_lazy_rel (struct link_map *map, -- ElfW(Addr) l_addr, const ElfW(Rela) *reloc); --# endif --#endif -- - #include - - #ifndef VERSYMIDX - -Signed-off-by: Robert P. J. Day diff --git a/patches/glibc/2.5/glibc-2.3.6-configure-apple-as.patch b/patches/glibc/2.5/glibc-2.3.6-configure-apple-as.patch deleted file mode 100644 index 78a1324..0000000 --- a/patches/glibc/2.5/glibc-2.3.6-configure-apple-as.patch +++ /dev/null @@ -1,25 +0,0 @@ -http://in3www.epfl.ch/~schaffne/glibc-configure-apple-as.patch -http://sources.redhat.com/ml/crossgcc/2004-02/msg00151.html - -The following makes it possible to configure glibc-2.3.2 on Mac OS X, -where the assembler but doesn't understand the --version flag. - -Fixes the symptom -checking whether ld is GNU ld... no -checking for /usr/libexec/gcc/darwin/ppc/as... /usr/libexec/gcc/darwin/ppc/as -checking version of /usr/libexec/gcc/darwin/ppc/as... - - ---- glibc-2.3.2/configure~ Wed Feb 26 09:20:48 2003 -+++ glibc-2.3.2/configure Fri Feb 27 13:12:53 2004 -@@ -4039,7 +4039,7 @@ - # Found it, now check the version. - echo "$as_me:$LINENO: checking version of $AS" >&5 - echo $ECHO_N "checking version of $AS... $ECHO_C" >&6 -- ac_prog_version=`$AS --version 2>&1 | sed -n 's/^.*GNU assembler.* \([0-9]*\.[0-9.]*\).*$/\1/p'` -+ ac_prog_version=`$AS -v &1 | sed -n 's/^.*GNU assembler.* \([0-9]*\.[0-9.]*\).*$/\1/p'` - case $ac_prog_version in - '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;; - 2.1[3-9]*) - -Signed-off-by: Robert P. J. Day diff --git a/patches/glibc/2.5/glibc-2.3.6-fix-pr631.patch b/patches/glibc/2.5/glibc-2.3.6-fix-pr631.patch deleted file mode 100644 index 13688df..0000000 --- a/patches/glibc/2.5/glibc-2.3.6-fix-pr631.patch +++ /dev/null @@ -1,45 +0,0 @@ -From dank@kegel.com -Wed Jun 15 09:12:43 PDT 2005 - -Fixes - -build-glibc/libc.a(nsswitch.o)(.data+0x64): undefined reference to `_nss_files_getaliasent_r' -build-glibc/libc.a(nsswitch.o)(.data+0x6c): undefined reference to `_nss_files_endaliasent' -... 53 lines deleted ... -build-glibc/libc.a(nsswitch.o)(.data+0x21c): undefined reference to `_nss_files_getspnam_r' -collect2: ld returned 1 exit status -make[2]: *** [/build/gcc-3.4.3-glibc-2.3.5-hdrs-2.6.11.2/i686-unknown-linux-gnu/build-glibc/elf/ldconfig] Error 1 - -when building glibc with --enable-static-nss. - -See http://sources.redhat.com/bugzilla/show_bug.cgi?id=631 - ---- glibc-2.3.5/Makeconfig.old Wed Jun 15 08:13:12 2005 -+++ glibc-2.3.5/Makeconfig Wed Jun 15 08:13:14 2005 -@@ -510,7 +510,7 @@ - - # The static libraries. - ifeq (yes,$(build-static)) --link-libc-static = $(common-objpfx)libc.a $(static-gnulib) $(common-objpfx)libc.a -+link-libc-static = $(common-objpfx)libc.a $(static-gnulib) $(otherlibs) $(common-objpfx)libc.a - else - ifeq (yes,$(build-shared)) - # We can try to link the programs with lib*_pic.a... ---- glibc-2.3.5/elf/Makefile.old Wed Jun 15 07:46:49 2005 -+++ glibc-2.3.5/elf/Makefile Wed Jun 15 08:14:00 2005 -@@ -120,6 +120,13 @@ - install-bin-script = ldd - endif - -+ifeq (yes,$(build-static-nss)) -+nssobjdir := $(patsubst ../$(subdir),.,$(common-objpfx)nss) -+resolvobjdir := $(patsubst ../$(subdir),.,$(common-objpfx)resolv) -+otherlibs += $(nssobjdir)/libnss_files.a $(resolvobjdir)/libnss_dns.a \ -+ $(resolvobjdir)/libresolv.a -+endif -+ - others = sprof sln - install-bin = sprof - others-static = sln - -Signed-off-by: Robert P. J. Day diff --git a/patches/glibc/2.5/glibc-2.4-i686-assembler.patch b/patches/glibc/2.5/glibc-2.4-i686-assembler.patch deleted file mode 100644 index 9904efb..0000000 --- a/patches/glibc/2.5/glibc-2.4-i686-assembler.patch +++ /dev/null @@ -1,38 +0,0 @@ -2007-02-15 Khem Raj - - * sysdeps/unix/sysv/linux/i386/sysdep.h: Re-define __i686. - * nptl/sysdeps/pthread/pt-initfini.c: Ditto. - - - -Index: glibc-2.4/sysdeps/unix/sysv/linux/i386/sysdep.h -=================================================================== ---- glibc-2.4/sysdeps/unix/sysv/linux/i386/sysdep.h (revision 1469) -+++ glibc-2.4/sysdeps/unix/sysv/linux/i386/sysdep.h (working copy) -@@ -29,6 +29,10 @@ - #include - #include - -+#if defined __i686 && defined __ASSEMBLER__ -+#undef __i686 -+#define __i686 __i686 -+#endif - - /* For Linux we can use the system call table in the header file - /usr/include/asm/unistd.h -Index: glibc-2.4/nptl/sysdeps/pthread/pt-initfini.c -=================================================================== ---- glibc-2.4/nptl/sysdeps/pthread/pt-initfini.c (revision 1469) -+++ glibc-2.4/nptl/sysdeps/pthread/pt-initfini.c (working copy) -@@ -45,6 +45,11 @@ - /* Embed an #include to pull in the alignment and .end directives. */ - asm ("\n#include \"defs.h\""); - -+asm ("\n#if defined __i686 && defined __ASSEMBLER__"); -+asm ("\n#undef __i686"); -+asm ("\n#define __i686 __i686"); -+asm ("\n#endif"); -+ - /* The initial common code ends here. */ - asm ("\n/*@HEADER_ENDS*/"); - diff --git a/patches/glibc/2.5/glibc-i386-preferred-stack-boundary.patch b/patches/glibc/2.5/glibc-i386-preferred-stack-boundary.patch deleted file mode 100644 index 449821d..0000000 --- a/patches/glibc/2.5/glibc-i386-preferred-stack-boundary.patch +++ /dev/null @@ -1,18 +0,0 @@ -(C) 2007 Yann E. MORIN -License: LGPL v2.1 - -Shut off a stupid warning: preffered-stack-boundary must be between 4 ad 12, -and 2 is not. - -diff -dur glibc-2.5.orig/sysdeps/i386/Makefile glibc-2.5/sysdeps/i386/Makefile ---- glibc-2.5.orig/sysdeps/i386/Makefile 2005-03-06 01:18:16.000000000 +0100 -+++ glibc-2.5/sysdeps/i386/Makefile 2007-05-27 17:49:37.000000000 +0200 -@@ -36,7 +36,7 @@ - ifeq ($(subdir),csu) - sysdep-CFLAGS += -mpreferred-stack-boundary=4 - else --sysdep-CFLAGS += -mpreferred-stack-boundary=2 -+sysdep-CFLAGS += -mpreferred-stack-boundary=4 - # Likewise, any function which calls user callbacks - uses-callbacks += -mpreferred-stack-boundary=4 - # Likewise, any stack alignment tests diff --git a/patches/glibc/2.6.1/100-fix-pr398.patch b/patches/glibc/2.6.1/100-fix-pr398.patch new file mode 100644 index 0000000..d5d0309 --- /dev/null +++ b/patches/glibc/2.6.1/100-fix-pr398.patch @@ -0,0 +1,70 @@ +Fixes error + +dl-runtime.c:222: error: parse error before "CFI_STARTPROC" +make[2]: *** [crosstool-0.28-rc35/build/s390-unknown-linux-gnu/gcc-3.4.1-glibc-20040822/build-glibc/elf/dl-runtim +e.o] Error 1 +make[2]: Leaving directory `crosstool-0.28-rc35/build/s390-unknown-linux-gnu/gcc-3.4.1-glibc-20040822/glibc-20040 +822/elf' +make[1]: *** [elf/subdir_lib] Error 2 +make[1]: Leaving directory `crosstool-0.28-rc35/build/s390-unknown-linux-gnu/gcc-3.4.1-glibc-20040822/glibc-20040 +822' +make: *** [all] Error 2 + +----------------- + +See http://sources.redhat.com/bugzilla/show_bug.cgi?id=398 +http://sources.redhat.com/ml/libc-alpha/2004-07/msg00023.html + +----------------- + +CVSROOT: /cvs/glibc +Module name: libc +Branch: glibc-2_3-branch +Changes by: roland@sources.redhat.com 2006-02-23 22:36:51 + +Modified files: + sysdeps/s390/s390-64: dl-machine.h + sysdeps/s390/s390-32: dl-machine.h + +Log message: + 2004-07-10 GOTO Masanori + + [BZ #398] + * sysdeps/s390/s390-32/dl-machine.h: Include for CFI + directive. + * sysdeps/s390/s390-64/dl-machine.h: Likewise. + +Patches: +http://sources.redhat.com/cgi-bin/cvsweb.cgi/libc/sysdeps/s390/s390-64/dl-machine.h.diff?cvsroot=glibc&only_with_tag=glibc-2_3-branch&r1=1.19.4.1&r2=1.19.4.2 +http://sources.redhat.com/cgi-bin/cvsweb.cgi/libc/sysdeps/s390/s390-32/dl-machine.h.diff?cvsroot=glibc&only_with_tag=glibc-2_3-branch&r1=1.20.4.1&r2=1.20.4.2 + +=================================================================== +RCS file: /cvs/glibc/libc/sysdeps/s390/s390-64/dl-machine.h,v +retrieving revision 1.19.4.1 +retrieving revision 1.19.4.2 +diff -u -r1.19.4.1 -r1.19.4.2 +--- libc/sysdeps/s390/s390-64/dl-machine.h 2005/10/17 04:57:27 1.19.4.1 ++++ libc/sysdeps/s390/s390-64/dl-machine.h 2006/02/23 22:36:51 1.19.4.2 +@@ -27,6 +27,7 @@ + #include + #include + #include ++#include + + /* This is an older, now obsolete value. */ + #define EM_S390_OLD 0xA390 +=================================================================== +RCS file: /cvs/glibc/libc/sysdeps/s390/s390-32/dl-machine.h,v +retrieving revision 1.20.4.1 +retrieving revision 1.20.4.2 +diff -u -r1.20.4.1 -r1.20.4.2 +--- libc/sysdeps/s390/s390-32/dl-machine.h 2005/10/17 04:57:27 1.20.4.1 ++++ libc/sysdeps/s390/s390-32/dl-machine.h 2006/02/23 22:36:51 1.20.4.2 +@@ -27,6 +27,7 @@ + #include + #include + #include ++#include + + /* This is an older, now obsolete value. */ + #define EM_S390_OLD 0xA390 diff --git a/patches/glibc/2.6.1/110-glibc-2.3.5-allow-gcc4-wcstol_l.patch b/patches/glibc/2.6.1/110-glibc-2.3.5-allow-gcc4-wcstol_l.patch new file mode 100644 index 0000000..0e6776f --- /dev/null +++ b/patches/glibc/2.6.1/110-glibc-2.3.5-allow-gcc4-wcstol_l.patch @@ -0,0 +1,59 @@ +Fixes +../sysdeps/wordsize-64/wcstol_l.c:11: error: '____wcstoll_l_internal' aliased to undefined symbol '____wcstol_l_internal' +../sysdeps/wordsize-64/wcstol_l.c:12: error: '__wcstoll_l' aliased to undefined symbol '__wcstol_l' +../sysdeps/wordsize-64/wcstol_l.c:13: error: 'wcstoll_l' aliased to undefined symbol '__wcstol_l' +make[2]: *** [/home/dkegel/queue/jobdir.produser_cpsm10/crosstool-0.32/build/x86_64-unknown-linux-gnu/gcc-4.0.0-20050410-glibc-2.3.4/build-glibc/wcsmbs/wcstoul_l.o] Error 1 + +https://www.redhat.com/archives/fedora-cvs-commits/2005-March/msg00408.html +%changelog ++* Fri Mar 25 2005 Jakub Jelinek 2.3.4-18 ++- fix build on 64-bit arches with new GCC + +Revision 1.4.2.1, Fri Mar 25 11:59:01 2005 UTC (3 weeks, 4 days ago) by jakub +Branch: fedora-branch +CVS Tags: fedora-glibc-2_3_4-18 +Changes since 1.4: +2 -0 lines +Diff to previous 1.4 (colored) + + * sysdeps/wordsize-64/strtol_l.c: Don't add aliases if UNSIGNED. + * sysdeps/wordsize-64/wcstol_l.c: Likewise. + + +http://sourceware.org/cgi-bin/cvsweb.cgi/libc/sysdeps/wordsize-64/strtol_l.c.diff?r1=1.4&r2=1.4.2.1&cvsroot=glibc +http://sourceware.org/cgi-bin/cvsweb.cgi/libc/sysdeps/wordsize-64/wcstol_l.c.diff?r1=1.4&r2=1.4.2.1&cvsroot=glibc + +=================================================================== +RCS file: /cvs/glibc/libc/sysdeps/wordsize-64/strtol_l.c,v +retrieving revision 1.4 +retrieving revision 1.4.2.1 +diff -u -r1.4 -r1.4.2.1 +--- libc/sysdeps/wordsize-64/strtol_l.c 2003/03/03 09:45:12 1.4 ++++ libc/sysdeps/wordsize-64/strtol_l.c 2005/03/25 11:59:01 1.4.2.1 +@@ -8,7 +8,9 @@ + #undef ____strtoll_l_internal + #undef __strtoll_l + #undef strtoll_l ++#if !UNSIGNED + strong_alias (____strtol_l_internal, ____strtoll_l_internal) + libc_hidden_ver (____strtol_l_internal, ____strtoll_l_internal) + weak_alias (__strtol_l, __strtoll_l) + weak_alias (__strtol_l, strtoll_l) ++#endif +=================================================================== +RCS file: /cvs/glibc/libc/sysdeps/wordsize-64/wcstol_l.c,v +retrieving revision 1.4 +retrieving revision 1.4.2.1 +diff -u -r1.4 -r1.4.2.1 +--- libc/sysdeps/wordsize-64/wcstol_l.c 2002/08/08 11:44:51 1.4 ++++ libc/sysdeps/wordsize-64/wcstol_l.c 2005/03/25 11:59:01 1.4.2.1 +@@ -8,6 +8,8 @@ + #undef ____wcstoll_l_internal + #undef __wcstoll_l + #undef wcstoll_l ++#if !UNSIGNED + strong_alias (____wcstol_l_internal, ____wcstoll_l_internal) + weak_alias (__wcstol_l, __wcstoll_l) + weak_alias (__wcstol_l, wcstoll_l) ++#endif + +Signed-off-by: Robert P. J. Day diff --git a/patches/glibc/2.6.1/120-glibc-2.3.5-cygwin.patch b/patches/glibc/2.6.1/120-glibc-2.3.5-cygwin.patch new file mode 100644 index 0000000..3c0cd7d --- /dev/null +++ b/patches/glibc/2.6.1/120-glibc-2.3.5-cygwin.patch @@ -0,0 +1,187 @@ +Fixes +elf/librtld.os: In function `process_envvars': : undefined reference to `__access' +... +when building glibc-2.3.x on cygwin + +Idea from +http://sources.redhat.com/ml/bug-glibc/2002-01/msg00071/glibc-2.2-cygin-shared.patch +Basically, make glibc use .oST as suffix for 'object static' +instead of .oS, since cygwin has trouble distinguishing .os from .oS +(Original patch had .on, but .oST is more mnemonic for 'object static') + +glibc-linuxthreads-2.3.5 also requires a patch, see +../glibc-linuxthreads-2.3.5/glibc-linuxthreads-2.3.5-cygwin.patch + +[ forward ported to glibc-2.3.5 by Petr Cvachoucek: + +Message-ID: <4282FCBA.3040000@unicontrols.cz> +Date: Thu, 12 May 2005 08:50:34 +0200 +From: Petr Cvachoucek +To: Dan Kegel +CC: crossgcc@sources.redhat.com +Subject: Patches to build gcc 3.4.3 / glibc 2.3.5 on cygwin + +Hi Dan, +following patches are needed to build gcc-3.4.3/glibc-2.3.5 toolchain +on cygwin. Tested to build toolchains for powerpc 604 and 750 targets. + +-- + Petr Cvachoucek + Unicontrols a.s. + http://www.unicontrols.cz +] + +diff -aur glibc-2.3.5/Makeconfig glibc-2.3.5-cygwin/Makeconfig +--- glibc-2.3.5/Makeconfig 2005-02-16 11:50:19.000000000 +0100 ++++ glibc-2.3.5-cygwin/Makeconfig 2005-05-11 08:24:51.046875000 +0200 +@@ -472,7 +472,7 @@ + # run the linked programs. + link-libc = -Wl,-rpath-link=$(rpath-link) \ + $(common-objpfx)libc.so$(libc.so-version) \ +- $(common-objpfx)$(patsubst %,$(libtype.oS),c) $(gnulib) ++ $(common-objpfx)$(patsubst %,$(libtype.oST),c) $(gnulib) + # This is how to find at build-time things that will be installed there. + rpath-dirs = math elf dlfcn nss nis rt resolv crypt + endif +@@ -693,7 +693,7 @@ + # The compilation rules use $(CPPFLAGS-${SUFFIX}) and $(CFLAGS-${SUFFIX}) + # to pass different flags for each flavor. + libtypes = $(foreach o,$(object-suffixes-for-libc),$(libtype$o)) +-all-object-suffixes := .o .os .op .og .ob .oS ++all-object-suffixes := .o .os .op .og .ob .oST + object-suffixes := + CPPFLAGS-.o = $(pic-default) + CFLAGS-.o = $(filter %frame-pointer,$(+cflags)) +@@ -749,14 +749,14 @@ + + ifeq (yes,$(build-shared)) + # Build special library that contains the static-only routines for libc. +-object-suffixes-for-libc += .oS ++object-suffixes-for-libc += .oST + + # Must build the routines as PIC, though, because they can end up in (users') + # shared objects. We don't want to use CFLAGS-os because users may, for + # example, make that processor-specific. +-CFLAGS-.oS = $(CFLAGS-.o) $(PIC-ccflag) +-CPPFLAGS-.oS = $(CPPFLAGS-.o) -DPIC -DLIBC_NONSHARED=1 +-libtype.oS = lib%_nonshared.a ++CFLAGS-.oST = $(CFLAGS-.o) $(PIC-ccflag) ++CPPFLAGS-.oST = $(CPPFLAGS-.o) -DPIC -DLIBC_NONSHARED=1 ++libtype.oST = lib%_nonshared.a + endif + + # The assembler can generate debug information too. +diff -aur glibc-2.3.5/Makerules glibc-2.3.5-cygwin/Makerules +--- glibc-2.3.5/Makerules 2004-12-15 19:52:39.000000000 +0100 ++++ glibc-2.3.5-cygwin/Makerules 2005-05-11 08:25:33.578125000 +0200 +@@ -417,7 +417,7 @@ + # Bounded pointer thunks are only built for *.ob + elide-bp-thunks = $(addprefix $(bppfx),$(bp-thunks)) + +-elide-routines.oS += $(filter-out $(static-only-routines),\ ++elide-routines.oST += $(filter-out $(static-only-routines),\ + $(routines) $(aux) $(sysdep_routines)) \ + $(elide-bp-thunks) + elide-routines.os += $(static-only-routines) $(elide-bp-thunks) +@@ -981,7 +981,7 @@ + install: $(inst_libdir)/libc.so + $(inst_libdir)/libc.so: $(common-objpfx)format.lds \ + $(common-objpfx)libc.so$(libc.so-version) \ +- $(inst_libdir)/$(patsubst %,$(libtype.oS),\ ++ $(inst_libdir)/$(patsubst %,$(libtype.oST),\ + $(libprefix)$(libc-name)) \ + $(+force) + (echo '/* GNU ld script';\ +@@ -989,7 +989,7 @@ + echo ' the static library, so try that secondarily. */';\ + cat $<; \ + echo 'GROUP ( $(slibdir)/libc.so$(libc.so-version)' \ +- '$(libdir)/$(patsubst %,$(libtype.oS),$(libprefix)$(libc-name))'\ ++ '$(libdir)/$(patsubst %,$(libtype.oST),$(libprefix)$(libc-name))'\ + ' AS_NEEDED (' $(slibdir)/$(rtld-installed-name) ') )' \ + ) > $@.new + mv -f $@.new $@ +diff -aur glibc-2.3.5/extra-lib.mk glibc-2.3.5-cygwin/extra-lib.mk +--- glibc-2.3.5/extra-lib.mk 2004-12-02 23:54:47.000000000 +0100 ++++ glibc-2.3.5-cygwin/extra-lib.mk 2005-05-11 08:27:28.156250000 +0200 +@@ -13,7 +13,7 @@ + + ifneq (,$($(lib)-static-only-routines)) + ifneq (,$(filter yesyes%,$(build-shared)$(elf)$($(lib).so-version))) +-object-suffixes-$(lib) += $(filter-out $($(lib)-inhibit-o),.oS) ++object-suffixes-$(lib) += $(filter-out $($(lib)-inhibit-o),.oST) + endif + endif + +@@ -29,7 +29,7 @@ + + # Add each flavor of library to the lists of things to build and install. + install-lib += $(foreach o,$(object-suffixes-$(lib)),$(lib:lib%=$(libtype$o))) +-extra-objs += $(foreach o,$(filter-out .os .oS,$(object-suffixes-$(lib))),\ ++extra-objs += $(foreach o,$(filter-out .os .oST,$(object-suffixes-$(lib))),\ + $(patsubst %,%$o,$(filter-out \ + $($(lib)-shared-only-routines),\ + $(all-$(lib)-routines)))) +@@ -57,7 +57,7 @@ + + + # Use o-iterator.mk to generate a rule for each flavor of library. +-ifneq (,$(filter-out .os .oS,$(object-suffixes-$(lib)))) ++ifneq (,$(filter-out .os .oST,$(object-suffixes-$(lib)))) + define o-iterator-doit + $(objpfx)$(patsubst %,$(libtype$o),$(lib:lib%=%)): \ + $(patsubst %,$(objpfx)%$o,\ +@@ -65,7 +65,7 @@ + $(all-$(lib)-routines))); \ + $$(build-extra-lib) + endef +-object-suffixes-left = $(filter-out .os .oS,$(object-suffixes-$(lib))) ++object-suffixes-left = $(filter-out .os .oST,$(object-suffixes-$(lib))) + include $(patsubst %,$(..)o-iterator.mk,$(object-suffixes-left)) + endif + +@@ -77,9 +77,9 @@ + $(build-extra-lib) + endif + +-ifneq (,$(filter .oS,$(object-suffixes-$(lib)))) +-$(objpfx)$(patsubst %,$(libtype.oS),$(lib:lib%=%)): \ +- $(patsubst %,$(objpfx)%.oS,\ ++ifneq (,$(filter .oST,$(object-suffixes-$(lib)))) ++$(objpfx)$(patsubst %,$(libtype.oST),$(lib:lib%=%)): \ ++ $(patsubst %,$(objpfx)%.oST,\ + $(filter $($(lib)-static-only-routines),\ + $(all-$(lib)-routines))) + $(build-extra-lib) +diff -aur glibc-2.3.5/nptl/Makefile glibc-2.3.5-cygwin/nptl/Makefile +--- glibc-2.3.5/nptl/Makefile 2005-02-16 09:45:56.000000000 +0100 ++++ glibc-2.3.5-cygwin/nptl/Makefile 2005-05-11 08:26:01.812500000 +0200 +@@ -375,7 +375,7 @@ + + $(inst_libdir)/libpthread.so: $(common-objpfx)format.lds \ + $(objpfx)libpthread.so$(libpthread.so-version) \ +- $(inst_libdir)/$(patsubst %,$(libtype.oS),\ ++ $(inst_libdir)/$(patsubst %,$(libtype.oST),\ + $(libprefix)pthread) \ + $(+force) + (echo '/* GNU ld script';\ +@@ -383,7 +383,7 @@ + echo ' the static library, so try that secondarily. */';\ + cat $<; \ + echo 'GROUP ( $(slibdir)/libpthread.so$(libpthread.so-version)' \ +- '$(libdir)/$(patsubst %,$(libtype.oS),$(libprefix)pthread)'\ ++ '$(libdir)/$(patsubst %,$(libtype.oST),$(libprefix)pthread)'\ + ')' \ + ) > $@.new + mv -f $@.new $@ +diff -aur glibc-2.3.5/sysdeps/sparc/sparc32/sparcv9/Makefile glibc-2.3.5-cygwin/sysdeps/sparc/sparc32/sparcv9/Makefile +--- glibc-2.3.5/sysdeps/sparc/sparc32/sparcv9/Makefile 2004-08-16 08:46:14.000000000 +0200 ++++ glibc-2.3.5-cygwin/sysdeps/sparc/sparc32/sparcv9/Makefile 2005-05-11 08:26:25.937500000 +0200 +@@ -10,4 +10,4 @@ + ASFLAGS-.op += -Wa,-Av9a + ASFLAGS-.og += -Wa,-Av9a + ASFLAGS-.ob += -Wa,-Av9a +-ASFLAGS-.oS += -Wa,-Av9a ++ASFLAGS-.oST += -Wa,-Av9a + +Signed-off-by: Robert P. J. Day diff --git a/patches/glibc/2.6.1/130-glibc-2.3.6-allow-gcc-4.0-elf.patch b/patches/glibc/2.6.1/130-glibc-2.3.6-allow-gcc-4.0-elf.patch new file mode 100644 index 0000000..87860fa --- /dev/null +++ b/patches/glibc/2.6.1/130-glibc-2.3.6-allow-gcc-4.0-elf.patch @@ -0,0 +1,67 @@ +From http://www.mail-archive.com/pld-cvs-commit@pld-linux.org/msg00229.html +Fixes + rtld.c: In function '_dl_start': + dynamic-link.h:47: error: nested function 'elf_machine_rela_relative' declared but never defined + dynamic-link.h:41: error: nested function 'elf_machine_rela' declared but never defined +when compiling glibc-2.3.4 with gcc-4.0 + +But see also +http://sources.redhat.com/ml/libc-hacker/2005-02/msg00000.html +and +http://sources.redhat.com/ml/libc-hacker/2005-03/msg00008.html +which seem to propose less radical fixes? + +Aha. See also http://sources.redhat.com/bugzilla/show_bug.cgi?id=721 + +--- glibc-2.3.6.orig/elf/dynamic-link.h 2005-03-12 18:12:37.000000000 -0800 ++++ glibc-2.3.6/elf/dynamic-link.h 2005-03-12 18:12:59.777820848 -0800 +@@ -19,47 +19,6 @@ + + #include + #include +- +-#ifdef RESOLVE_MAP +-/* We pass reloc_addr as a pointer to void, as opposed to a pointer to +- ElfW(Addr), because not all architectures can assume that the +- relocated address is properly aligned, whereas the compiler is +- entitled to assume that a pointer to a type is properly aligned for +- the type. Even if we cast the pointer back to some other type with +- less strict alignment requirements, the compiler might still +- remember that the pointer was originally more aligned, thereby +- optimizing away alignment tests or using word instructions for +- copying memory, breaking the very code written to handle the +- unaligned cases. */ +-# if ! ELF_MACHINE_NO_REL +-auto inline void __attribute__((always_inline)) +-elf_machine_rel (struct link_map *map, const ElfW(Rel) *reloc, +- const ElfW(Sym) *sym, const struct r_found_version *version, +- void *const reloc_addr); +-auto inline void __attribute__((always_inline)) +-elf_machine_rel_relative (ElfW(Addr) l_addr, const ElfW(Rel) *reloc, +- void *const reloc_addr); +-# endif +-# if ! ELF_MACHINE_NO_RELA +-auto inline void __attribute__((always_inline)) +-elf_machine_rela (struct link_map *map, const ElfW(Rela) *reloc, +- const ElfW(Sym) *sym, const struct r_found_version *version, +- void *const reloc_addr); +-auto inline void __attribute__((always_inline)) +-elf_machine_rela_relative (ElfW(Addr) l_addr, const ElfW(Rela) *reloc, +- void *const reloc_addr); +-# endif +-# if ELF_MACHINE_NO_RELA || defined ELF_MACHINE_PLT_REL +-auto inline void __attribute__((always_inline)) +-elf_machine_lazy_rel (struct link_map *map, +- ElfW(Addr) l_addr, const ElfW(Rel) *reloc); +-# else +-auto inline void __attribute__((always_inline)) +-elf_machine_lazy_rel (struct link_map *map, +- ElfW(Addr) l_addr, const ElfW(Rela) *reloc); +-# endif +-#endif +- + #include + + #ifndef VERSYMIDX + +Signed-off-by: Robert P. J. Day diff --git a/patches/glibc/2.6.1/140-glibc-2.3.6-configure-apple-as.patch b/patches/glibc/2.6.1/140-glibc-2.3.6-configure-apple-as.patch new file mode 100644 index 0000000..78a1324 --- /dev/null +++ b/patches/glibc/2.6.1/140-glibc-2.3.6-configure-apple-as.patch @@ -0,0 +1,25 @@ +http://in3www.epfl.ch/~schaffne/glibc-configure-apple-as.patch +http://sources.redhat.com/ml/crossgcc/2004-02/msg00151.html + +The following makes it possible to configure glibc-2.3.2 on Mac OS X, +where the assembler but doesn't understand the --version flag. + +Fixes the symptom +checking whether ld is GNU ld... no +checking for /usr/libexec/gcc/darwin/ppc/as... /usr/libexec/gcc/darwin/ppc/as +checking version of /usr/libexec/gcc/darwin/ppc/as... + + +--- glibc-2.3.2/configure~ Wed Feb 26 09:20:48 2003 ++++ glibc-2.3.2/configure Fri Feb 27 13:12:53 2004 +@@ -4039,7 +4039,7 @@ + # Found it, now check the version. + echo "$as_me:$LINENO: checking version of $AS" >&5 + echo $ECHO_N "checking version of $AS... $ECHO_C" >&6 +- ac_prog_version=`$AS --version 2>&1 | sed -n 's/^.*GNU assembler.* \([0-9]*\.[0-9.]*\).*$/\1/p'` ++ ac_prog_version=`$AS -v &1 | sed -n 's/^.*GNU assembler.* \([0-9]*\.[0-9.]*\).*$/\1/p'` + case $ac_prog_version in + '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;; + 2.1[3-9]*) + +Signed-off-by: Robert P. J. Day diff --git a/patches/glibc/2.6.1/150-glibc-2.3.6-fix-pr631.patch b/patches/glibc/2.6.1/150-glibc-2.3.6-fix-pr631.patch new file mode 100644 index 0000000..13688df --- /dev/null +++ b/patches/glibc/2.6.1/150-glibc-2.3.6-fix-pr631.patch @@ -0,0 +1,45 @@ +From dank@kegel.com +Wed Jun 15 09:12:43 PDT 2005 + +Fixes + +build-glibc/libc.a(nsswitch.o)(.data+0x64): undefined reference to `_nss_files_getaliasent_r' +build-glibc/libc.a(nsswitch.o)(.data+0x6c): undefined reference to `_nss_files_endaliasent' +... 53 lines deleted ... +build-glibc/libc.a(nsswitch.o)(.data+0x21c): undefined reference to `_nss_files_getspnam_r' +collect2: ld returned 1 exit status +make[2]: *** [/build/gcc-3.4.3-glibc-2.3.5-hdrs-2.6.11.2/i686-unknown-linux-gnu/build-glibc/elf/ldconfig] Error 1 + +when building glibc with --enable-static-nss. + +See http://sources.redhat.com/bugzilla/show_bug.cgi?id=631 + +--- glibc-2.3.5/Makeconfig.old Wed Jun 15 08:13:12 2005 ++++ glibc-2.3.5/Makeconfig Wed Jun 15 08:13:14 2005 +@@ -510,7 +510,7 @@ + + # The static libraries. + ifeq (yes,$(build-static)) +-link-libc-static = $(common-objpfx)libc.a $(static-gnulib) $(common-objpfx)libc.a ++link-libc-static = $(common-objpfx)libc.a $(static-gnulib) $(otherlibs) $(common-objpfx)libc.a + else + ifeq (yes,$(build-shared)) + # We can try to link the programs with lib*_pic.a... +--- glibc-2.3.5/elf/Makefile.old Wed Jun 15 07:46:49 2005 ++++ glibc-2.3.5/elf/Makefile Wed Jun 15 08:14:00 2005 +@@ -120,6 +120,13 @@ + install-bin-script = ldd + endif + ++ifeq (yes,$(build-static-nss)) ++nssobjdir := $(patsubst ../$(subdir),.,$(common-objpfx)nss) ++resolvobjdir := $(patsubst ../$(subdir),.,$(common-objpfx)resolv) ++otherlibs += $(nssobjdir)/libnss_files.a $(resolvobjdir)/libnss_dns.a \ ++ $(resolvobjdir)/libresolv.a ++endif ++ + others = sprof sln + install-bin = sprof + others-static = sln + +Signed-off-by: Robert P. J. Day diff --git a/patches/glibc/2.6.1/160-glibc-2.4-i686-assembler.patch b/patches/glibc/2.6.1/160-glibc-2.4-i686-assembler.patch new file mode 100644 index 0000000..9904efb --- /dev/null +++ b/patches/glibc/2.6.1/160-glibc-2.4-i686-assembler.patch @@ -0,0 +1,38 @@ +2007-02-15 Khem Raj + + * sysdeps/unix/sysv/linux/i386/sysdep.h: Re-define __i686. + * nptl/sysdeps/pthread/pt-initfini.c: Ditto. + + + +Index: glibc-2.4/sysdeps/unix/sysv/linux/i386/sysdep.h +=================================================================== +--- glibc-2.4/sysdeps/unix/sysv/linux/i386/sysdep.h (revision 1469) ++++ glibc-2.4/sysdeps/unix/sysv/linux/i386/sysdep.h (working copy) +@@ -29,6 +29,10 @@ + #include + #include + ++#if defined __i686 && defined __ASSEMBLER__ ++#undef __i686 ++#define __i686 __i686 ++#endif + + /* For Linux we can use the system call table in the header file + /usr/include/asm/unistd.h +Index: glibc-2.4/nptl/sysdeps/pthread/pt-initfini.c +=================================================================== +--- glibc-2.4/nptl/sysdeps/pthread/pt-initfini.c (revision 1469) ++++ glibc-2.4/nptl/sysdeps/pthread/pt-initfini.c (working copy) +@@ -45,6 +45,11 @@ + /* Embed an #include to pull in the alignment and .end directives. */ + asm ("\n#include \"defs.h\""); + ++asm ("\n#if defined __i686 && defined __ASSEMBLER__"); ++asm ("\n#undef __i686"); ++asm ("\n#define __i686 __i686"); ++asm ("\n#endif"); ++ + /* The initial common code ends here. */ + asm ("\n/*@HEADER_ENDS*/"); + diff --git a/patches/glibc/2.6.1/170-glibc-i386-preferred-stack-boundary.patch b/patches/glibc/2.6.1/170-glibc-i386-preferred-stack-boundary.patch new file mode 100644 index 0000000..449821d --- /dev/null +++ b/patches/glibc/2.6.1/170-glibc-i386-preferred-stack-boundary.patch @@ -0,0 +1,18 @@ +(C) 2007 Yann E. MORIN +License: LGPL v2.1 + +Shut off a stupid warning: preffered-stack-boundary must be between 4 ad 12, +and 2 is not. + +diff -dur glibc-2.5.orig/sysdeps/i386/Makefile glibc-2.5/sysdeps/i386/Makefile +--- glibc-2.5.orig/sysdeps/i386/Makefile 2005-03-06 01:18:16.000000000 +0100 ++++ glibc-2.5/sysdeps/i386/Makefile 2007-05-27 17:49:37.000000000 +0200 +@@ -36,7 +36,7 @@ + ifeq ($(subdir),csu) + sysdep-CFLAGS += -mpreferred-stack-boundary=4 + else +-sysdep-CFLAGS += -mpreferred-stack-boundary=2 ++sysdep-CFLAGS += -mpreferred-stack-boundary=4 + # Likewise, any function which calls user callbacks + uses-callbacks += -mpreferred-stack-boundary=4 + # Likewise, any stack alignment tests diff --git a/patches/glibc/2.6.1/fix-pr398.patch b/patches/glibc/2.6.1/fix-pr398.patch deleted file mode 100644 index d5d0309..0000000 --- a/patches/glibc/2.6.1/fix-pr398.patch +++ /dev/null @@ -1,70 +0,0 @@ -Fixes error - -dl-runtime.c:222: error: parse error before "CFI_STARTPROC" -make[2]: *** [crosstool-0.28-rc35/build/s390-unknown-linux-gnu/gcc-3.4.1-glibc-20040822/build-glibc/elf/dl-runtim -e.o] Error 1 -make[2]: Leaving directory `crosstool-0.28-rc35/build/s390-unknown-linux-gnu/gcc-3.4.1-glibc-20040822/glibc-20040 -822/elf' -make[1]: *** [elf/subdir_lib] Error 2 -make[1]: Leaving directory `crosstool-0.28-rc35/build/s390-unknown-linux-gnu/gcc-3.4.1-glibc-20040822/glibc-20040 -822' -make: *** [all] Error 2 - ------------------ - -See http://sources.redhat.com/bugzilla/show_bug.cgi?id=398 -http://sources.redhat.com/ml/libc-alpha/2004-07/msg00023.html - ------------------ - -CVSROOT: /cvs/glibc -Module name: libc -Branch: glibc-2_3-branch -Changes by: roland@sources.redhat.com 2006-02-23 22:36:51 - -Modified files: - sysdeps/s390/s390-64: dl-machine.h - sysdeps/s390/s390-32: dl-machine.h - -Log message: - 2004-07-10 GOTO Masanori - - [BZ #398] - * sysdeps/s390/s390-32/dl-machine.h: Include for CFI - directive. - * sysdeps/s390/s390-64/dl-machine.h: Likewise. - -Patches: -http://sources.redhat.com/cgi-bin/cvsweb.cgi/libc/sysdeps/s390/s390-64/dl-machine.h.diff?cvsroot=glibc&only_with_tag=glibc-2_3-branch&r1=1.19.4.1&r2=1.19.4.2 -http://sources.redhat.com/cgi-bin/cvsweb.cgi/libc/sysdeps/s390/s390-32/dl-machine.h.diff?cvsroot=glibc&only_with_tag=glibc-2_3-branch&r1=1.20.4.1&r2=1.20.4.2 - -=================================================================== -RCS file: /cvs/glibc/libc/sysdeps/s390/s390-64/dl-machine.h,v -retrieving revision 1.19.4.1 -retrieving revision 1.19.4.2 -diff -u -r1.19.4.1 -r1.19.4.2 ---- libc/sysdeps/s390/s390-64/dl-machine.h 2005/10/17 04:57:27 1.19.4.1 -+++ libc/sysdeps/s390/s390-64/dl-machine.h 2006/02/23 22:36:51 1.19.4.2 -@@ -27,6 +27,7 @@ - #include - #include - #include -+#include - - /* This is an older, now obsolete value. */ - #define EM_S390_OLD 0xA390 -=================================================================== -RCS file: /cvs/glibc/libc/sysdeps/s390/s390-32/dl-machine.h,v -retrieving revision 1.20.4.1 -retrieving revision 1.20.4.2 -diff -u -r1.20.4.1 -r1.20.4.2 ---- libc/sysdeps/s390/s390-32/dl-machine.h 2005/10/17 04:57:27 1.20.4.1 -+++ libc/sysdeps/s390/s390-32/dl-machine.h 2006/02/23 22:36:51 1.20.4.2 -@@ -27,6 +27,7 @@ - #include - #include - #include -+#include - - /* This is an older, now obsolete value. */ - #define EM_S390_OLD 0xA390 diff --git a/patches/glibc/2.6.1/glibc-2.3.5-allow-gcc4-wcstol_l.patch b/patches/glibc/2.6.1/glibc-2.3.5-allow-gcc4-wcstol_l.patch deleted file mode 100644 index 0e6776f..0000000 --- a/patches/glibc/2.6.1/glibc-2.3.5-allow-gcc4-wcstol_l.patch +++ /dev/null @@ -1,59 +0,0 @@ -Fixes -../sysdeps/wordsize-64/wcstol_l.c:11: error: '____wcstoll_l_internal' aliased to undefined symbol '____wcstol_l_internal' -../sysdeps/wordsize-64/wcstol_l.c:12: error: '__wcstoll_l' aliased to undefined symbol '__wcstol_l' -../sysdeps/wordsize-64/wcstol_l.c:13: error: 'wcstoll_l' aliased to undefined symbol '__wcstol_l' -make[2]: *** [/home/dkegel/queue/jobdir.produser_cpsm10/crosstool-0.32/build/x86_64-unknown-linux-gnu/gcc-4.0.0-20050410-glibc-2.3.4/build-glibc/wcsmbs/wcstoul_l.o] Error 1 - -https://www.redhat.com/archives/fedora-cvs-commits/2005-March/msg00408.html -%changelog -+* Fri Mar 25 2005 Jakub Jelinek 2.3.4-18 -+- fix build on 64-bit arches with new GCC - -Revision 1.4.2.1, Fri Mar 25 11:59:01 2005 UTC (3 weeks, 4 days ago) by jakub -Branch: fedora-branch -CVS Tags: fedora-glibc-2_3_4-18 -Changes since 1.4: +2 -0 lines -Diff to previous 1.4 (colored) - - * sysdeps/wordsize-64/strtol_l.c: Don't add aliases if UNSIGNED. - * sysdeps/wordsize-64/wcstol_l.c: Likewise. - - -http://sourceware.org/cgi-bin/cvsweb.cgi/libc/sysdeps/wordsize-64/strtol_l.c.diff?r1=1.4&r2=1.4.2.1&cvsroot=glibc -http://sourceware.org/cgi-bin/cvsweb.cgi/libc/sysdeps/wordsize-64/wcstol_l.c.diff?r1=1.4&r2=1.4.2.1&cvsroot=glibc - -=================================================================== -RCS file: /cvs/glibc/libc/sysdeps/wordsize-64/strtol_l.c,v -retrieving revision 1.4 -retrieving revision 1.4.2.1 -diff -u -r1.4 -r1.4.2.1 ---- libc/sysdeps/wordsize-64/strtol_l.c 2003/03/03 09:45:12 1.4 -+++ libc/sysdeps/wordsize-64/strtol_l.c 2005/03/25 11:59:01 1.4.2.1 -@@ -8,7 +8,9 @@ - #undef ____strtoll_l_internal - #undef __strtoll_l - #undef strtoll_l -+#if !UNSIGNED - strong_alias (____strtol_l_internal, ____strtoll_l_internal) - libc_hidden_ver (____strtol_l_internal, ____strtoll_l_internal) - weak_alias (__strtol_l, __strtoll_l) - weak_alias (__strtol_l, strtoll_l) -+#endif -=================================================================== -RCS file: /cvs/glibc/libc/sysdeps/wordsize-64/wcstol_l.c,v -retrieving revision 1.4 -retrieving revision 1.4.2.1 -diff -u -r1.4 -r1.4.2.1 ---- libc/sysdeps/wordsize-64/wcstol_l.c 2002/08/08 11:44:51 1.4 -+++ libc/sysdeps/wordsize-64/wcstol_l.c 2005/03/25 11:59:01 1.4.2.1 -@@ -8,6 +8,8 @@ - #undef ____wcstoll_l_internal - #undef __wcstoll_l - #undef wcstoll_l -+#if !UNSIGNED - strong_alias (____wcstol_l_internal, ____wcstoll_l_internal) - weak_alias (__wcstol_l, __wcstoll_l) - weak_alias (__wcstol_l, wcstoll_l) -+#endif - -Signed-off-by: Robert P. J. Day diff --git a/patches/glibc/2.6.1/glibc-2.3.5-cygwin.patch b/patches/glibc/2.6.1/glibc-2.3.5-cygwin.patch deleted file mode 100644 index 3c0cd7d..0000000 --- a/patches/glibc/2.6.1/glibc-2.3.5-cygwin.patch +++ /dev/null @@ -1,187 +0,0 @@ -Fixes -elf/librtld.os: In function `process_envvars': : undefined reference to `__access' -... -when building glibc-2.3.x on cygwin - -Idea from -http://sources.redhat.com/ml/bug-glibc/2002-01/msg00071/glibc-2.2-cygin-shared.patch -Basically, make glibc use .oST as suffix for 'object static' -instead of .oS, since cygwin has trouble distinguishing .os from .oS -(Original patch had .on, but .oST is more mnemonic for 'object static') - -glibc-linuxthreads-2.3.5 also requires a patch, see -../glibc-linuxthreads-2.3.5/glibc-linuxthreads-2.3.5-cygwin.patch - -[ forward ported to glibc-2.3.5 by Petr Cvachoucek: - -Message-ID: <4282FCBA.3040000@unicontrols.cz> -Date: Thu, 12 May 2005 08:50:34 +0200 -From: Petr Cvachoucek -To: Dan Kegel -CC: crossgcc@sources.redhat.com -Subject: Patches to build gcc 3.4.3 / glibc 2.3.5 on cygwin - -Hi Dan, -following patches are needed to build gcc-3.4.3/glibc-2.3.5 toolchain -on cygwin. Tested to build toolchains for powerpc 604 and 750 targets. - --- - Petr Cvachoucek - Unicontrols a.s. - http://www.unicontrols.cz -] - -diff -aur glibc-2.3.5/Makeconfig glibc-2.3.5-cygwin/Makeconfig ---- glibc-2.3.5/Makeconfig 2005-02-16 11:50:19.000000000 +0100 -+++ glibc-2.3.5-cygwin/Makeconfig 2005-05-11 08:24:51.046875000 +0200 -@@ -472,7 +472,7 @@ - # run the linked programs. - link-libc = -Wl,-rpath-link=$(rpath-link) \ - $(common-objpfx)libc.so$(libc.so-version) \ -- $(common-objpfx)$(patsubst %,$(libtype.oS),c) $(gnulib) -+ $(common-objpfx)$(patsubst %,$(libtype.oST),c) $(gnulib) - # This is how to find at build-time things that will be installed there. - rpath-dirs = math elf dlfcn nss nis rt resolv crypt - endif -@@ -693,7 +693,7 @@ - # The compilation rules use $(CPPFLAGS-${SUFFIX}) and $(CFLAGS-${SUFFIX}) - # to pass different flags for each flavor. - libtypes = $(foreach o,$(object-suffixes-for-libc),$(libtype$o)) --all-object-suffixes := .o .os .op .og .ob .oS -+all-object-suffixes := .o .os .op .og .ob .oST - object-suffixes := - CPPFLAGS-.o = $(pic-default) - CFLAGS-.o = $(filter %frame-pointer,$(+cflags)) -@@ -749,14 +749,14 @@ - - ifeq (yes,$(build-shared)) - # Build special library that contains the static-only routines for libc. --object-suffixes-for-libc += .oS -+object-suffixes-for-libc += .oST - - # Must build the routines as PIC, though, because they can end up in (users') - # shared objects. We don't want to use CFLAGS-os because users may, for - # example, make that processor-specific. --CFLAGS-.oS = $(CFLAGS-.o) $(PIC-ccflag) --CPPFLAGS-.oS = $(CPPFLAGS-.o) -DPIC -DLIBC_NONSHARED=1 --libtype.oS = lib%_nonshared.a -+CFLAGS-.oST = $(CFLAGS-.o) $(PIC-ccflag) -+CPPFLAGS-.oST = $(CPPFLAGS-.o) -DPIC -DLIBC_NONSHARED=1 -+libtype.oST = lib%_nonshared.a - endif - - # The assembler can generate debug information too. -diff -aur glibc-2.3.5/Makerules glibc-2.3.5-cygwin/Makerules ---- glibc-2.3.5/Makerules 2004-12-15 19:52:39.000000000 +0100 -+++ glibc-2.3.5-cygwin/Makerules 2005-05-11 08:25:33.578125000 +0200 -@@ -417,7 +417,7 @@ - # Bounded pointer thunks are only built for *.ob - elide-bp-thunks = $(addprefix $(bppfx),$(bp-thunks)) - --elide-routines.oS += $(filter-out $(static-only-routines),\ -+elide-routines.oST += $(filter-out $(static-only-routines),\ - $(routines) $(aux) $(sysdep_routines)) \ - $(elide-bp-thunks) - elide-routines.os += $(static-only-routines) $(elide-bp-thunks) -@@ -981,7 +981,7 @@ - install: $(inst_libdir)/libc.so - $(inst_libdir)/libc.so: $(common-objpfx)format.lds \ - $(common-objpfx)libc.so$(libc.so-version) \ -- $(inst_libdir)/$(patsubst %,$(libtype.oS),\ -+ $(inst_libdir)/$(patsubst %,$(libtype.oST),\ - $(libprefix)$(libc-name)) \ - $(+force) - (echo '/* GNU ld script';\ -@@ -989,7 +989,7 @@ - echo ' the static library, so try that secondarily. */';\ - cat $<; \ - echo 'GROUP ( $(slibdir)/libc.so$(libc.so-version)' \ -- '$(libdir)/$(patsubst %,$(libtype.oS),$(libprefix)$(libc-name))'\ -+ '$(libdir)/$(patsubst %,$(libtype.oST),$(libprefix)$(libc-name))'\ - ' AS_NEEDED (' $(slibdir)/$(rtld-installed-name) ') )' \ - ) > $@.new - mv -f $@.new $@ -diff -aur glibc-2.3.5/extra-lib.mk glibc-2.3.5-cygwin/extra-lib.mk ---- glibc-2.3.5/extra-lib.mk 2004-12-02 23:54:47.000000000 +0100 -+++ glibc-2.3.5-cygwin/extra-lib.mk 2005-05-11 08:27:28.156250000 +0200 -@@ -13,7 +13,7 @@ - - ifneq (,$($(lib)-static-only-routines)) - ifneq (,$(filter yesyes%,$(build-shared)$(elf)$($(lib).so-version))) --object-suffixes-$(lib) += $(filter-out $($(lib)-inhibit-o),.oS) -+object-suffixes-$(lib) += $(filter-out $($(lib)-inhibit-o),.oST) - endif - endif - -@@ -29,7 +29,7 @@ - - # Add each flavor of library to the lists of things to build and install. - install-lib += $(foreach o,$(object-suffixes-$(lib)),$(lib:lib%=$(libtype$o))) --extra-objs += $(foreach o,$(filter-out .os .oS,$(object-suffixes-$(lib))),\ -+extra-objs += $(foreach o,$(filter-out .os .oST,$(object-suffixes-$(lib))),\ - $(patsubst %,%$o,$(filter-out \ - $($(lib)-shared-only-routines),\ - $(all-$(lib)-routines)))) -@@ -57,7 +57,7 @@ - - - # Use o-iterator.mk to generate a rule for each flavor of library. --ifneq (,$(filter-out .os .oS,$(object-suffixes-$(lib)))) -+ifneq (,$(filter-out .os .oST,$(object-suffixes-$(lib)))) - define o-iterator-doit - $(objpfx)$(patsubst %,$(libtype$o),$(lib:lib%=%)): \ - $(patsubst %,$(objpfx)%$o,\ -@@ -65,7 +65,7 @@ - $(all-$(lib)-routines))); \ - $$(build-extra-lib) - endef --object-suffixes-left = $(filter-out .os .oS,$(object-suffixes-$(lib))) -+object-suffixes-left = $(filter-out .os .oST,$(object-suffixes-$(lib))) - include $(patsubst %,$(..)o-iterator.mk,$(object-suffixes-left)) - endif - -@@ -77,9 +77,9 @@ - $(build-extra-lib) - endif - --ifneq (,$(filter .oS,$(object-suffixes-$(lib)))) --$(objpfx)$(patsubst %,$(libtype.oS),$(lib:lib%=%)): \ -- $(patsubst %,$(objpfx)%.oS,\ -+ifneq (,$(filter .oST,$(object-suffixes-$(lib)))) -+$(objpfx)$(patsubst %,$(libtype.oST),$(lib:lib%=%)): \ -+ $(patsubst %,$(objpfx)%.oST,\ - $(filter $($(lib)-static-only-routines),\ - $(all-$(lib)-routines))) - $(build-extra-lib) -diff -aur glibc-2.3.5/nptl/Makefile glibc-2.3.5-cygwin/nptl/Makefile ---- glibc-2.3.5/nptl/Makefile 2005-02-16 09:45:56.000000000 +0100 -+++ glibc-2.3.5-cygwin/nptl/Makefile 2005-05-11 08:26:01.812500000 +0200 -@@ -375,7 +375,7 @@ - - $(inst_libdir)/libpthread.so: $(common-objpfx)format.lds \ - $(objpfx)libpthread.so$(libpthread.so-version) \ -- $(inst_libdir)/$(patsubst %,$(libtype.oS),\ -+ $(inst_libdir)/$(patsubst %,$(libtype.oST),\ - $(libprefix)pthread) \ - $(+force) - (echo '/* GNU ld script';\ -@@ -383,7 +383,7 @@ - echo ' the static library, so try that secondarily. */';\ - cat $<; \ - echo 'GROUP ( $(slibdir)/libpthread.so$(libpthread.so-version)' \ -- '$(libdir)/$(patsubst %,$(libtype.oS),$(libprefix)pthread)'\ -+ '$(libdir)/$(patsubst %,$(libtype.oST),$(libprefix)pthread)'\ - ')' \ - ) > $@.new - mv -f $@.new $@ -diff -aur glibc-2.3.5/sysdeps/sparc/sparc32/sparcv9/Makefile glibc-2.3.5-cygwin/sysdeps/sparc/sparc32/sparcv9/Makefile ---- glibc-2.3.5/sysdeps/sparc/sparc32/sparcv9/Makefile 2004-08-16 08:46:14.000000000 +0200 -+++ glibc-2.3.5-cygwin/sysdeps/sparc/sparc32/sparcv9/Makefile 2005-05-11 08:26:25.937500000 +0200 -@@ -10,4 +10,4 @@ - ASFLAGS-.op += -Wa,-Av9a - ASFLAGS-.og += -Wa,-Av9a - ASFLAGS-.ob += -Wa,-Av9a --ASFLAGS-.oS += -Wa,-Av9a -+ASFLAGS-.oST += -Wa,-Av9a - -Signed-off-by: Robert P. J. Day diff --git a/patches/glibc/2.6.1/glibc-2.3.6-allow-gcc-4.0-elf.patch b/patches/glibc/2.6.1/glibc-2.3.6-allow-gcc-4.0-elf.patch deleted file mode 100644 index 87860fa..0000000 --- a/patches/glibc/2.6.1/glibc-2.3.6-allow-gcc-4.0-elf.patch +++ /dev/null @@ -1,67 +0,0 @@ -From http://www.mail-archive.com/pld-cvs-commit@pld-linux.org/msg00229.html -Fixes - rtld.c: In function '_dl_start': - dynamic-link.h:47: error: nested function 'elf_machine_rela_relative' declared but never defined - dynamic-link.h:41: error: nested function 'elf_machine_rela' declared but never defined -when compiling glibc-2.3.4 with gcc-4.0 - -But see also -http://sources.redhat.com/ml/libc-hacker/2005-02/msg00000.html -and -http://sources.redhat.com/ml/libc-hacker/2005-03/msg00008.html -which seem to propose less radical fixes? - -Aha. See also http://sources.redhat.com/bugzilla/show_bug.cgi?id=721 - ---- glibc-2.3.6.orig/elf/dynamic-link.h 2005-03-12 18:12:37.000000000 -0800 -+++ glibc-2.3.6/elf/dynamic-link.h 2005-03-12 18:12:59.777820848 -0800 -@@ -19,47 +19,6 @@ - - #include - #include -- --#ifdef RESOLVE_MAP --/* We pass reloc_addr as a pointer to void, as opposed to a pointer to -- ElfW(Addr), because not all architectures can assume that the -- relocated address is properly aligned, whereas the compiler is -- entitled to assume that a pointer to a type is properly aligned for -- the type. Even if we cast the pointer back to some other type with -- less strict alignment requirements, the compiler might still -- remember that the pointer was originally more aligned, thereby -- optimizing away alignment tests or using word instructions for -- copying memory, breaking the very code written to handle the -- unaligned cases. */ --# if ! ELF_MACHINE_NO_REL --auto inline void __attribute__((always_inline)) --elf_machine_rel (struct link_map *map, const ElfW(Rel) *reloc, -- const ElfW(Sym) *sym, const struct r_found_version *version, -- void *const reloc_addr); --auto inline void __attribute__((always_inline)) --elf_machine_rel_relative (ElfW(Addr) l_addr, const ElfW(Rel) *reloc, -- void *const reloc_addr); --# endif --# if ! ELF_MACHINE_NO_RELA --auto inline void __attribute__((always_inline)) --elf_machine_rela (struct link_map *map, const ElfW(Rela) *reloc, -- const ElfW(Sym) *sym, const struct r_found_version *version, -- void *const reloc_addr); --auto inline void __attribute__((always_inline)) --elf_machine_rela_relative (ElfW(Addr) l_addr, const ElfW(Rela) *reloc, -- void *const reloc_addr); --# endif --# if ELF_MACHINE_NO_RELA || defined ELF_MACHINE_PLT_REL --auto inline void __attribute__((always_inline)) --elf_machine_lazy_rel (struct link_map *map, -- ElfW(Addr) l_addr, const ElfW(Rel) *reloc); --# else --auto inline void __attribute__((always_inline)) --elf_machine_lazy_rel (struct link_map *map, -- ElfW(Addr) l_addr, const ElfW(Rela) *reloc); --# endif --#endif -- - #include - - #ifndef VERSYMIDX - -Signed-off-by: Robert P. J. Day diff --git a/patches/glibc/2.6.1/glibc-2.3.6-configure-apple-as.patch b/patches/glibc/2.6.1/glibc-2.3.6-configure-apple-as.patch deleted file mode 100644 index 78a1324..0000000 --- a/patches/glibc/2.6.1/glibc-2.3.6-configure-apple-as.patch +++ /dev/null @@ -1,25 +0,0 @@ -http://in3www.epfl.ch/~schaffne/glibc-configure-apple-as.patch -http://sources.redhat.com/ml/crossgcc/2004-02/msg00151.html - -The following makes it possible to configure glibc-2.3.2 on Mac OS X, -where the assembler but doesn't understand the --version flag. - -Fixes the symptom -checking whether ld is GNU ld... no -checking for /usr/libexec/gcc/darwin/ppc/as... /usr/libexec/gcc/darwin/ppc/as -checking version of /usr/libexec/gcc/darwin/ppc/as... - - ---- glibc-2.3.2/configure~ Wed Feb 26 09:20:48 2003 -+++ glibc-2.3.2/configure Fri Feb 27 13:12:53 2004 -@@ -4039,7 +4039,7 @@ - # Found it, now check the version. - echo "$as_me:$LINENO: checking version of $AS" >&5 - echo $ECHO_N "checking version of $AS... $ECHO_C" >&6 -- ac_prog_version=`$AS --version 2>&1 | sed -n 's/^.*GNU assembler.* \([0-9]*\.[0-9.]*\).*$/\1/p'` -+ ac_prog_version=`$AS -v &1 | sed -n 's/^.*GNU assembler.* \([0-9]*\.[0-9.]*\).*$/\1/p'` - case $ac_prog_version in - '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;; - 2.1[3-9]*) - -Signed-off-by: Robert P. J. Day diff --git a/patches/glibc/2.6.1/glibc-2.3.6-fix-pr631.patch b/patches/glibc/2.6.1/glibc-2.3.6-fix-pr631.patch deleted file mode 100644 index 13688df..0000000 --- a/patches/glibc/2.6.1/glibc-2.3.6-fix-pr631.patch +++ /dev/null @@ -1,45 +0,0 @@ -From dank@kegel.com -Wed Jun 15 09:12:43 PDT 2005 - -Fixes - -build-glibc/libc.a(nsswitch.o)(.data+0x64): undefined reference to `_nss_files_getaliasent_r' -build-glibc/libc.a(nsswitch.o)(.data+0x6c): undefined reference to `_nss_files_endaliasent' -... 53 lines deleted ... -build-glibc/libc.a(nsswitch.o)(.data+0x21c): undefined reference to `_nss_files_getspnam_r' -collect2: ld returned 1 exit status -make[2]: *** [/build/gcc-3.4.3-glibc-2.3.5-hdrs-2.6.11.2/i686-unknown-linux-gnu/build-glibc/elf/ldconfig] Error 1 - -when building glibc with --enable-static-nss. - -See http://sources.redhat.com/bugzilla/show_bug.cgi?id=631 - ---- glibc-2.3.5/Makeconfig.old Wed Jun 15 08:13:12 2005 -+++ glibc-2.3.5/Makeconfig Wed Jun 15 08:13:14 2005 -@@ -510,7 +510,7 @@ - - # The static libraries. - ifeq (yes,$(build-static)) --link-libc-static = $(common-objpfx)libc.a $(static-gnulib) $(common-objpfx)libc.a -+link-libc-static = $(common-objpfx)libc.a $(static-gnulib) $(otherlibs) $(common-objpfx)libc.a - else - ifeq (yes,$(build-shared)) - # We can try to link the programs with lib*_pic.a... ---- glibc-2.3.5/elf/Makefile.old Wed Jun 15 07:46:49 2005 -+++ glibc-2.3.5/elf/Makefile Wed Jun 15 08:14:00 2005 -@@ -120,6 +120,13 @@ - install-bin-script = ldd - endif - -+ifeq (yes,$(build-static-nss)) -+nssobjdir := $(patsubst ../$(subdir),.,$(common-objpfx)nss) -+resolvobjdir := $(patsubst ../$(subdir),.,$(common-objpfx)resolv) -+otherlibs += $(nssobjdir)/libnss_files.a $(resolvobjdir)/libnss_dns.a \ -+ $(resolvobjdir)/libresolv.a -+endif -+ - others = sprof sln - install-bin = sprof - others-static = sln - -Signed-off-by: Robert P. J. Day diff --git a/patches/glibc/2.6.1/glibc-2.4-i686-assembler.patch b/patches/glibc/2.6.1/glibc-2.4-i686-assembler.patch deleted file mode 100644 index 9904efb..0000000 --- a/patches/glibc/2.6.1/glibc-2.4-i686-assembler.patch +++ /dev/null @@ -1,38 +0,0 @@ -2007-02-15 Khem Raj - - * sysdeps/unix/sysv/linux/i386/sysdep.h: Re-define __i686. - * nptl/sysdeps/pthread/pt-initfini.c: Ditto. - - - -Index: glibc-2.4/sysdeps/unix/sysv/linux/i386/sysdep.h -=================================================================== ---- glibc-2.4/sysdeps/unix/sysv/linux/i386/sysdep.h (revision 1469) -+++ glibc-2.4/sysdeps/unix/sysv/linux/i386/sysdep.h (working copy) -@@ -29,6 +29,10 @@ - #include - #include - -+#if defined __i686 && defined __ASSEMBLER__ -+#undef __i686 -+#define __i686 __i686 -+#endif - - /* For Linux we can use the system call table in the header file - /usr/include/asm/unistd.h -Index: glibc-2.4/nptl/sysdeps/pthread/pt-initfini.c -=================================================================== ---- glibc-2.4/nptl/sysdeps/pthread/pt-initfini.c (revision 1469) -+++ glibc-2.4/nptl/sysdeps/pthread/pt-initfini.c (working copy) -@@ -45,6 +45,11 @@ - /* Embed an #include to pull in the alignment and .end directives. */ - asm ("\n#include \"defs.h\""); - -+asm ("\n#if defined __i686 && defined __ASSEMBLER__"); -+asm ("\n#undef __i686"); -+asm ("\n#define __i686 __i686"); -+asm ("\n#endif"); -+ - /* The initial common code ends here. */ - asm ("\n/*@HEADER_ENDS*/"); - diff --git a/patches/glibc/2.6.1/glibc-i386-preferred-stack-boundary.patch b/patches/glibc/2.6.1/glibc-i386-preferred-stack-boundary.patch deleted file mode 100644 index 449821d..0000000 --- a/patches/glibc/2.6.1/glibc-i386-preferred-stack-boundary.patch +++ /dev/null @@ -1,18 +0,0 @@ -(C) 2007 Yann E. MORIN -License: LGPL v2.1 - -Shut off a stupid warning: preffered-stack-boundary must be between 4 ad 12, -and 2 is not. - -diff -dur glibc-2.5.orig/sysdeps/i386/Makefile glibc-2.5/sysdeps/i386/Makefile ---- glibc-2.5.orig/sysdeps/i386/Makefile 2005-03-06 01:18:16.000000000 +0100 -+++ glibc-2.5/sysdeps/i386/Makefile 2007-05-27 17:49:37.000000000 +0200 -@@ -36,7 +36,7 @@ - ifeq ($(subdir),csu) - sysdep-CFLAGS += -mpreferred-stack-boundary=4 - else --sysdep-CFLAGS += -mpreferred-stack-boundary=2 -+sysdep-CFLAGS += -mpreferred-stack-boundary=4 - # Likewise, any function which calls user callbacks - uses-callbacks += -mpreferred-stack-boundary=4 - # Likewise, any stack alignment tests diff --git a/patches/glibc/2.6/100-fix-pr398.patch b/patches/glibc/2.6/100-fix-pr398.patch new file mode 100644 index 0000000..d5d0309 --- /dev/null +++ b/patches/glibc/2.6/100-fix-pr398.patch @@ -0,0 +1,70 @@ +Fixes error + +dl-runtime.c:222: error: parse error before "CFI_STARTPROC" +make[2]: *** [crosstool-0.28-rc35/build/s390-unknown-linux-gnu/gcc-3.4.1-glibc-20040822/build-glibc/elf/dl-runtim +e.o] Error 1 +make[2]: Leaving directory `crosstool-0.28-rc35/build/s390-unknown-linux-gnu/gcc-3.4.1-glibc-20040822/glibc-20040 +822/elf' +make[1]: *** [elf/subdir_lib] Error 2 +make[1]: Leaving directory `crosstool-0.28-rc35/build/s390-unknown-linux-gnu/gcc-3.4.1-glibc-20040822/glibc-20040 +822' +make: *** [all] Error 2 + +----------------- + +See http://sources.redhat.com/bugzilla/show_bug.cgi?id=398 +http://sources.redhat.com/ml/libc-alpha/2004-07/msg00023.html + +----------------- + +CVSROOT: /cvs/glibc +Module name: libc +Branch: glibc-2_3-branch +Changes by: roland@sources.redhat.com 2006-02-23 22:36:51 + +Modified files: + sysdeps/s390/s390-64: dl-machine.h + sysdeps/s390/s390-32: dl-machine.h + +Log message: + 2004-07-10 GOTO Masanori + + [BZ #398] + * sysdeps/s390/s390-32/dl-machine.h: Include for CFI + directive. + * sysdeps/s390/s390-64/dl-machine.h: Likewise. + +Patches: +http://sources.redhat.com/cgi-bin/cvsweb.cgi/libc/sysdeps/s390/s390-64/dl-machine.h.diff?cvsroot=glibc&only_with_tag=glibc-2_3-branch&r1=1.19.4.1&r2=1.19.4.2 +http://sources.redhat.com/cgi-bin/cvsweb.cgi/libc/sysdeps/s390/s390-32/dl-machine.h.diff?cvsroot=glibc&only_with_tag=glibc-2_3-branch&r1=1.20.4.1&r2=1.20.4.2 + +=================================================================== +RCS file: /cvs/glibc/libc/sysdeps/s390/s390-64/dl-machine.h,v +retrieving revision 1.19.4.1 +retrieving revision 1.19.4.2 +diff -u -r1.19.4.1 -r1.19.4.2 +--- libc/sysdeps/s390/s390-64/dl-machine.h 2005/10/17 04:57:27 1.19.4.1 ++++ libc/sysdeps/s390/s390-64/dl-machine.h 2006/02/23 22:36:51 1.19.4.2 +@@ -27,6 +27,7 @@ + #include + #include + #include ++#include + + /* This is an older, now obsolete value. */ + #define EM_S390_OLD 0xA390 +=================================================================== +RCS file: /cvs/glibc/libc/sysdeps/s390/s390-32/dl-machine.h,v +retrieving revision 1.20.4.1 +retrieving revision 1.20.4.2 +diff -u -r1.20.4.1 -r1.20.4.2 +--- libc/sysdeps/s390/s390-32/dl-machine.h 2005/10/17 04:57:27 1.20.4.1 ++++ libc/sysdeps/s390/s390-32/dl-machine.h 2006/02/23 22:36:51 1.20.4.2 +@@ -27,6 +27,7 @@ + #include + #include + #include ++#include + + /* This is an older, now obsolete value. */ + #define EM_S390_OLD 0xA390 diff --git a/patches/glibc/2.6/110-glibc-2.3.5-allow-gcc4-wcstol_l.patch b/patches/glibc/2.6/110-glibc-2.3.5-allow-gcc4-wcstol_l.patch new file mode 100644 index 0000000..0e6776f --- /dev/null +++ b/patches/glibc/2.6/110-glibc-2.3.5-allow-gcc4-wcstol_l.patch @@ -0,0 +1,59 @@ +Fixes +../sysdeps/wordsize-64/wcstol_l.c:11: error: '____wcstoll_l_internal' aliased to undefined symbol '____wcstol_l_internal' +../sysdeps/wordsize-64/wcstol_l.c:12: error: '__wcstoll_l' aliased to undefined symbol '__wcstol_l' +../sysdeps/wordsize-64/wcstol_l.c:13: error: 'wcstoll_l' aliased to undefined symbol '__wcstol_l' +make[2]: *** [/home/dkegel/queue/jobdir.produser_cpsm10/crosstool-0.32/build/x86_64-unknown-linux-gnu/gcc-4.0.0-20050410-glibc-2.3.4/build-glibc/wcsmbs/wcstoul_l.o] Error 1 + +https://www.redhat.com/archives/fedora-cvs-commits/2005-March/msg00408.html +%changelog ++* Fri Mar 25 2005 Jakub Jelinek 2.3.4-18 ++- fix build on 64-bit arches with new GCC + +Revision 1.4.2.1, Fri Mar 25 11:59:01 2005 UTC (3 weeks, 4 days ago) by jakub +Branch: fedora-branch +CVS Tags: fedora-glibc-2_3_4-18 +Changes since 1.4: +2 -0 lines +Diff to previous 1.4 (colored) + + * sysdeps/wordsize-64/strtol_l.c: Don't add aliases if UNSIGNED. + * sysdeps/wordsize-64/wcstol_l.c: Likewise. + + +http://sourceware.org/cgi-bin/cvsweb.cgi/libc/sysdeps/wordsize-64/strtol_l.c.diff?r1=1.4&r2=1.4.2.1&cvsroot=glibc +http://sourceware.org/cgi-bin/cvsweb.cgi/libc/sysdeps/wordsize-64/wcstol_l.c.diff?r1=1.4&r2=1.4.2.1&cvsroot=glibc + +=================================================================== +RCS file: /cvs/glibc/libc/sysdeps/wordsize-64/strtol_l.c,v +retrieving revision 1.4 +retrieving revision 1.4.2.1 +diff -u -r1.4 -r1.4.2.1 +--- libc/sysdeps/wordsize-64/strtol_l.c 2003/03/03 09:45:12 1.4 ++++ libc/sysdeps/wordsize-64/strtol_l.c 2005/03/25 11:59:01 1.4.2.1 +@@ -8,7 +8,9 @@ + #undef ____strtoll_l_internal + #undef __strtoll_l + #undef strtoll_l ++#if !UNSIGNED + strong_alias (____strtol_l_internal, ____strtoll_l_internal) + libc_hidden_ver (____strtol_l_internal, ____strtoll_l_internal) + weak_alias (__strtol_l, __strtoll_l) + weak_alias (__strtol_l, strtoll_l) ++#endif +=================================================================== +RCS file: /cvs/glibc/libc/sysdeps/wordsize-64/wcstol_l.c,v +retrieving revision 1.4 +retrieving revision 1.4.2.1 +diff -u -r1.4 -r1.4.2.1 +--- libc/sysdeps/wordsize-64/wcstol_l.c 2002/08/08 11:44:51 1.4 ++++ libc/sysdeps/wordsize-64/wcstol_l.c 2005/03/25 11:59:01 1.4.2.1 +@@ -8,6 +8,8 @@ + #undef ____wcstoll_l_internal + #undef __wcstoll_l + #undef wcstoll_l ++#if !UNSIGNED + strong_alias (____wcstol_l_internal, ____wcstoll_l_internal) + weak_alias (__wcstol_l, __wcstoll_l) + weak_alias (__wcstol_l, wcstoll_l) ++#endif + +Signed-off-by: Robert P. J. Day diff --git a/patches/glibc/2.6/120-glibc-2.3.5-cygwin.patch b/patches/glibc/2.6/120-glibc-2.3.5-cygwin.patch new file mode 100644 index 0000000..3c0cd7d --- /dev/null +++ b/patches/glibc/2.6/120-glibc-2.3.5-cygwin.patch @@ -0,0 +1,187 @@ +Fixes +elf/librtld.os: In function `process_envvars': : undefined reference to `__access' +... +when building glibc-2.3.x on cygwin + +Idea from +http://sources.redhat.com/ml/bug-glibc/2002-01/msg00071/glibc-2.2-cygin-shared.patch +Basically, make glibc use .oST as suffix for 'object static' +instead of .oS, since cygwin has trouble distinguishing .os from .oS +(Original patch had .on, but .oST is more mnemonic for 'object static') + +glibc-linuxthreads-2.3.5 also requires a patch, see +../glibc-linuxthreads-2.3.5/glibc-linuxthreads-2.3.5-cygwin.patch + +[ forward ported to glibc-2.3.5 by Petr Cvachoucek: + +Message-ID: <4282FCBA.3040000@unicontrols.cz> +Date: Thu, 12 May 2005 08:50:34 +0200 +From: Petr Cvachoucek +To: Dan Kegel +CC: crossgcc@sources.redhat.com +Subject: Patches to build gcc 3.4.3 / glibc 2.3.5 on cygwin + +Hi Dan, +following patches are needed to build gcc-3.4.3/glibc-2.3.5 toolchain +on cygwin. Tested to build toolchains for powerpc 604 and 750 targets. + +-- + Petr Cvachoucek + Unicontrols a.s. + http://www.unicontrols.cz +] + +diff -aur glibc-2.3.5/Makeconfig glibc-2.3.5-cygwin/Makeconfig +--- glibc-2.3.5/Makeconfig 2005-02-16 11:50:19.000000000 +0100 ++++ glibc-2.3.5-cygwin/Makeconfig 2005-05-11 08:24:51.046875000 +0200 +@@ -472,7 +472,7 @@ + # run the linked programs. + link-libc = -Wl,-rpath-link=$(rpath-link) \ + $(common-objpfx)libc.so$(libc.so-version) \ +- $(common-objpfx)$(patsubst %,$(libtype.oS),c) $(gnulib) ++ $(common-objpfx)$(patsubst %,$(libtype.oST),c) $(gnulib) + # This is how to find at build-time things that will be installed there. + rpath-dirs = math elf dlfcn nss nis rt resolv crypt + endif +@@ -693,7 +693,7 @@ + # The compilation rules use $(CPPFLAGS-${SUFFIX}) and $(CFLAGS-${SUFFIX}) + # to pass different flags for each flavor. + libtypes = $(foreach o,$(object-suffixes-for-libc),$(libtype$o)) +-all-object-suffixes := .o .os .op .og .ob .oS ++all-object-suffixes := .o .os .op .og .ob .oST + object-suffixes := + CPPFLAGS-.o = $(pic-default) + CFLAGS-.o = $(filter %frame-pointer,$(+cflags)) +@@ -749,14 +749,14 @@ + + ifeq (yes,$(build-shared)) + # Build special library that contains the static-only routines for libc. +-object-suffixes-for-libc += .oS ++object-suffixes-for-libc += .oST + + # Must build the routines as PIC, though, because they can end up in (users') + # shared objects. We don't want to use CFLAGS-os because users may, for + # example, make that processor-specific. +-CFLAGS-.oS = $(CFLAGS-.o) $(PIC-ccflag) +-CPPFLAGS-.oS = $(CPPFLAGS-.o) -DPIC -DLIBC_NONSHARED=1 +-libtype.oS = lib%_nonshared.a ++CFLAGS-.oST = $(CFLAGS-.o) $(PIC-ccflag) ++CPPFLAGS-.oST = $(CPPFLAGS-.o) -DPIC -DLIBC_NONSHARED=1 ++libtype.oST = lib%_nonshared.a + endif + + # The assembler can generate debug information too. +diff -aur glibc-2.3.5/Makerules glibc-2.3.5-cygwin/Makerules +--- glibc-2.3.5/Makerules 2004-12-15 19:52:39.000000000 +0100 ++++ glibc-2.3.5-cygwin/Makerules 2005-05-11 08:25:33.578125000 +0200 +@@ -417,7 +417,7 @@ + # Bounded pointer thunks are only built for *.ob + elide-bp-thunks = $(addprefix $(bppfx),$(bp-thunks)) + +-elide-routines.oS += $(filter-out $(static-only-routines),\ ++elide-routines.oST += $(filter-out $(static-only-routines),\ + $(routines) $(aux) $(sysdep_routines)) \ + $(elide-bp-thunks) + elide-routines.os += $(static-only-routines) $(elide-bp-thunks) +@@ -981,7 +981,7 @@ + install: $(inst_libdir)/libc.so + $(inst_libdir)/libc.so: $(common-objpfx)format.lds \ + $(common-objpfx)libc.so$(libc.so-version) \ +- $(inst_libdir)/$(patsubst %,$(libtype.oS),\ ++ $(inst_libdir)/$(patsubst %,$(libtype.oST),\ + $(libprefix)$(libc-name)) \ + $(+force) + (echo '/* GNU ld script';\ +@@ -989,7 +989,7 @@ + echo ' the static library, so try that secondarily. */';\ + cat $<; \ + echo 'GROUP ( $(slibdir)/libc.so$(libc.so-version)' \ +- '$(libdir)/$(patsubst %,$(libtype.oS),$(libprefix)$(libc-name))'\ ++ '$(libdir)/$(patsubst %,$(libtype.oST),$(libprefix)$(libc-name))'\ + ' AS_NEEDED (' $(slibdir)/$(rtld-installed-name) ') )' \ + ) > $@.new + mv -f $@.new $@ +diff -aur glibc-2.3.5/extra-lib.mk glibc-2.3.5-cygwin/extra-lib.mk +--- glibc-2.3.5/extra-lib.mk 2004-12-02 23:54:47.000000000 +0100 ++++ glibc-2.3.5-cygwin/extra-lib.mk 2005-05-11 08:27:28.156250000 +0200 +@@ -13,7 +13,7 @@ + + ifneq (,$($(lib)-static-only-routines)) + ifneq (,$(filter yesyes%,$(build-shared)$(elf)$($(lib).so-version))) +-object-suffixes-$(lib) += $(filter-out $($(lib)-inhibit-o),.oS) ++object-suffixes-$(lib) += $(filter-out $($(lib)-inhibit-o),.oST) + endif + endif + +@@ -29,7 +29,7 @@ + + # Add each flavor of library to the lists of things to build and install. + install-lib += $(foreach o,$(object-suffixes-$(lib)),$(lib:lib%=$(libtype$o))) +-extra-objs += $(foreach o,$(filter-out .os .oS,$(object-suffixes-$(lib))),\ ++extra-objs += $(foreach o,$(filter-out .os .oST,$(object-suffixes-$(lib))),\ + $(patsubst %,%$o,$(filter-out \ + $($(lib)-shared-only-routines),\ + $(all-$(lib)-routines)))) +@@ -57,7 +57,7 @@ + + + # Use o-iterator.mk to generate a rule for each flavor of library. +-ifneq (,$(filter-out .os .oS,$(object-suffixes-$(lib)))) ++ifneq (,$(filter-out .os .oST,$(object-suffixes-$(lib)))) + define o-iterator-doit + $(objpfx)$(patsubst %,$(libtype$o),$(lib:lib%=%)): \ + $(patsubst %,$(objpfx)%$o,\ +@@ -65,7 +65,7 @@ + $(all-$(lib)-routines))); \ + $$(build-extra-lib) + endef +-object-suffixes-left = $(filter-out .os .oS,$(object-suffixes-$(lib))) ++object-suffixes-left = $(filter-out .os .oST,$(object-suffixes-$(lib))) + include $(patsubst %,$(..)o-iterator.mk,$(object-suffixes-left)) + endif + +@@ -77,9 +77,9 @@ + $(build-extra-lib) + endif + +-ifneq (,$(filter .oS,$(object-suffixes-$(lib)))) +-$(objpfx)$(patsubst %,$(libtype.oS),$(lib:lib%=%)): \ +- $(patsubst %,$(objpfx)%.oS,\ ++ifneq (,$(filter .oST,$(object-suffixes-$(lib)))) ++$(objpfx)$(patsubst %,$(libtype.oST),$(lib:lib%=%)): \ ++ $(patsubst %,$(objpfx)%.oST,\ + $(filter $($(lib)-static-only-routines),\ + $(all-$(lib)-routines))) + $(build-extra-lib) +diff -aur glibc-2.3.5/nptl/Makefile glibc-2.3.5-cygwin/nptl/Makefile +--- glibc-2.3.5/nptl/Makefile 2005-02-16 09:45:56.000000000 +0100 ++++ glibc-2.3.5-cygwin/nptl/Makefile 2005-05-11 08:26:01.812500000 +0200 +@@ -375,7 +375,7 @@ + + $(inst_libdir)/libpthread.so: $(common-objpfx)format.lds \ + $(objpfx)libpthread.so$(libpthread.so-version) \ +- $(inst_libdir)/$(patsubst %,$(libtype.oS),\ ++ $(inst_libdir)/$(patsubst %,$(libtype.oST),\ + $(libprefix)pthread) \ + $(+force) + (echo '/* GNU ld script';\ +@@ -383,7 +383,7 @@ + echo ' the static library, so try that secondarily. */';\ + cat $<; \ + echo 'GROUP ( $(slibdir)/libpthread.so$(libpthread.so-version)' \ +- '$(libdir)/$(patsubst %,$(libtype.oS),$(libprefix)pthread)'\ ++ '$(libdir)/$(patsubst %,$(libtype.oST),$(libprefix)pthread)'\ + ')' \ + ) > $@.new + mv -f $@.new $@ +diff -aur glibc-2.3.5/sysdeps/sparc/sparc32/sparcv9/Makefile glibc-2.3.5-cygwin/sysdeps/sparc/sparc32/sparcv9/Makefile +--- glibc-2.3.5/sysdeps/sparc/sparc32/sparcv9/Makefile 2004-08-16 08:46:14.000000000 +0200 ++++ glibc-2.3.5-cygwin/sysdeps/sparc/sparc32/sparcv9/Makefile 2005-05-11 08:26:25.937500000 +0200 +@@ -10,4 +10,4 @@ + ASFLAGS-.op += -Wa,-Av9a + ASFLAGS-.og += -Wa,-Av9a + ASFLAGS-.ob += -Wa,-Av9a +-ASFLAGS-.oS += -Wa,-Av9a ++ASFLAGS-.oST += -Wa,-Av9a + +Signed-off-by: Robert P. J. Day diff --git a/patches/glibc/2.6/130-glibc-2.3.6-allow-gcc-4.0-elf.patch b/patches/glibc/2.6/130-glibc-2.3.6-allow-gcc-4.0-elf.patch new file mode 100644 index 0000000..87860fa --- /dev/null +++ b/patches/glibc/2.6/130-glibc-2.3.6-allow-gcc-4.0-elf.patch @@ -0,0 +1,67 @@ +From http://www.mail-archive.com/pld-cvs-commit@pld-linux.org/msg00229.html +Fixes + rtld.c: In function '_dl_start': + dynamic-link.h:47: error: nested function 'elf_machine_rela_relative' declared but never defined + dynamic-link.h:41: error: nested function 'elf_machine_rela' declared but never defined +when compiling glibc-2.3.4 with gcc-4.0 + +But see also +http://sources.redhat.com/ml/libc-hacker/2005-02/msg00000.html +and +http://sources.redhat.com/ml/libc-hacker/2005-03/msg00008.html +which seem to propose less radical fixes? + +Aha. See also http://sources.redhat.com/bugzilla/show_bug.cgi?id=721 + +--- glibc-2.3.6.orig/elf/dynamic-link.h 2005-03-12 18:12:37.000000000 -0800 ++++ glibc-2.3.6/elf/dynamic-link.h 2005-03-12 18:12:59.777820848 -0800 +@@ -19,47 +19,6 @@ + + #include + #include +- +-#ifdef RESOLVE_MAP +-/* We pass reloc_addr as a pointer to void, as opposed to a pointer to +- ElfW(Addr), because not all architectures can assume that the +- relocated address is properly aligned, whereas the compiler is +- entitled to assume that a pointer to a type is properly aligned for +- the type. Even if we cast the pointer back to some other type with +- less strict alignment requirements, the compiler might still +- remember that the pointer was originally more aligned, thereby +- optimizing away alignment tests or using word instructions for +- copying memory, breaking the very code written to handle the +- unaligned cases. */ +-# if ! ELF_MACHINE_NO_REL +-auto inline void __attribute__((always_inline)) +-elf_machine_rel (struct link_map *map, const ElfW(Rel) *reloc, +- const ElfW(Sym) *sym, const struct r_found_version *version, +- void *const reloc_addr); +-auto inline void __attribute__((always_inline)) +-elf_machine_rel_relative (ElfW(Addr) l_addr, const ElfW(Rel) *reloc, +- void *const reloc_addr); +-# endif +-# if ! ELF_MACHINE_NO_RELA +-auto inline void __attribute__((always_inline)) +-elf_machine_rela (struct link_map *map, const ElfW(Rela) *reloc, +- const ElfW(Sym) *sym, const struct r_found_version *version, +- void *const reloc_addr); +-auto inline void __attribute__((always_inline)) +-elf_machine_rela_relative (ElfW(Addr) l_addr, const ElfW(Rela) *reloc, +- void *const reloc_addr); +-# endif +-# if ELF_MACHINE_NO_RELA || defined ELF_MACHINE_PLT_REL +-auto inline void __attribute__((always_inline)) +-elf_machine_lazy_rel (struct link_map *map, +- ElfW(Addr) l_addr, const ElfW(Rel) *reloc); +-# else +-auto inline void __attribute__((always_inline)) +-elf_machine_lazy_rel (struct link_map *map, +- ElfW(Addr) l_addr, const ElfW(Rela) *reloc); +-# endif +-#endif +- + #include + + #ifndef VERSYMIDX + +Signed-off-by: Robert P. J. Day diff --git a/patches/glibc/2.6/140-glibc-2.3.6-configure-apple-as.patch b/patches/glibc/2.6/140-glibc-2.3.6-configure-apple-as.patch new file mode 100644 index 0000000..78a1324 --- /dev/null +++ b/patches/glibc/2.6/140-glibc-2.3.6-configure-apple-as.patch @@ -0,0 +1,25 @@ +http://in3www.epfl.ch/~schaffne/glibc-configure-apple-as.patch +http://sources.redhat.com/ml/crossgcc/2004-02/msg00151.html + +The following makes it possible to configure glibc-2.3.2 on Mac OS X, +where the assembler but doesn't understand the --version flag. + +Fixes the symptom +checking whether ld is GNU ld... no +checking for /usr/libexec/gcc/darwin/ppc/as... /usr/libexec/gcc/darwin/ppc/as +checking version of /usr/libexec/gcc/darwin/ppc/as... + + +--- glibc-2.3.2/configure~ Wed Feb 26 09:20:48 2003 ++++ glibc-2.3.2/configure Fri Feb 27 13:12:53 2004 +@@ -4039,7 +4039,7 @@ + # Found it, now check the version. + echo "$as_me:$LINENO: checking version of $AS" >&5 + echo $ECHO_N "checking version of $AS... $ECHO_C" >&6 +- ac_prog_version=`$AS --version 2>&1 | sed -n 's/^.*GNU assembler.* \([0-9]*\.[0-9.]*\).*$/\1/p'` ++ ac_prog_version=`$AS -v &1 | sed -n 's/^.*GNU assembler.* \([0-9]*\.[0-9.]*\).*$/\1/p'` + case $ac_prog_version in + '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;; + 2.1[3-9]*) + +Signed-off-by: Robert P. J. Day diff --git a/patches/glibc/2.6/150-glibc-2.3.6-fix-pr631.patch b/patches/glibc/2.6/150-glibc-2.3.6-fix-pr631.patch new file mode 100644 index 0000000..13688df --- /dev/null +++ b/patches/glibc/2.6/150-glibc-2.3.6-fix-pr631.patch @@ -0,0 +1,45 @@ +From dank@kegel.com +Wed Jun 15 09:12:43 PDT 2005 + +Fixes + +build-glibc/libc.a(nsswitch.o)(.data+0x64): undefined reference to `_nss_files_getaliasent_r' +build-glibc/libc.a(nsswitch.o)(.data+0x6c): undefined reference to `_nss_files_endaliasent' +... 53 lines deleted ... +build-glibc/libc.a(nsswitch.o)(.data+0x21c): undefined reference to `_nss_files_getspnam_r' +collect2: ld returned 1 exit status +make[2]: *** [/build/gcc-3.4.3-glibc-2.3.5-hdrs-2.6.11.2/i686-unknown-linux-gnu/build-glibc/elf/ldconfig] Error 1 + +when building glibc with --enable-static-nss. + +See http://sources.redhat.com/bugzilla/show_bug.cgi?id=631 + +--- glibc-2.3.5/Makeconfig.old Wed Jun 15 08:13:12 2005 ++++ glibc-2.3.5/Makeconfig Wed Jun 15 08:13:14 2005 +@@ -510,7 +510,7 @@ + + # The static libraries. + ifeq (yes,$(build-static)) +-link-libc-static = $(common-objpfx)libc.a $(static-gnulib) $(common-objpfx)libc.a ++link-libc-static = $(common-objpfx)libc.a $(static-gnulib) $(otherlibs) $(common-objpfx)libc.a + else + ifeq (yes,$(build-shared)) + # We can try to link the programs with lib*_pic.a... +--- glibc-2.3.5/elf/Makefile.old Wed Jun 15 07:46:49 2005 ++++ glibc-2.3.5/elf/Makefile Wed Jun 15 08:14:00 2005 +@@ -120,6 +120,13 @@ + install-bin-script = ldd + endif + ++ifeq (yes,$(build-static-nss)) ++nssobjdir := $(patsubst ../$(subdir),.,$(common-objpfx)nss) ++resolvobjdir := $(patsubst ../$(subdir),.,$(common-objpfx)resolv) ++otherlibs += $(nssobjdir)/libnss_files.a $(resolvobjdir)/libnss_dns.a \ ++ $(resolvobjdir)/libresolv.a ++endif ++ + others = sprof sln + install-bin = sprof + others-static = sln + +Signed-off-by: Robert P. J. Day diff --git a/patches/glibc/2.6/160-glibc-2.4-i686-assembler.patch b/patches/glibc/2.6/160-glibc-2.4-i686-assembler.patch new file mode 100644 index 0000000..9904efb --- /dev/null +++ b/patches/glibc/2.6/160-glibc-2.4-i686-assembler.patch @@ -0,0 +1,38 @@ +2007-02-15 Khem Raj + + * sysdeps/unix/sysv/linux/i386/sysdep.h: Re-define __i686. + * nptl/sysdeps/pthread/pt-initfini.c: Ditto. + + + +Index: glibc-2.4/sysdeps/unix/sysv/linux/i386/sysdep.h +=================================================================== +--- glibc-2.4/sysdeps/unix/sysv/linux/i386/sysdep.h (revision 1469) ++++ glibc-2.4/sysdeps/unix/sysv/linux/i386/sysdep.h (working copy) +@@ -29,6 +29,10 @@ + #include + #include + ++#if defined __i686 && defined __ASSEMBLER__ ++#undef __i686 ++#define __i686 __i686 ++#endif + + /* For Linux we can use the system call table in the header file + /usr/include/asm/unistd.h +Index: glibc-2.4/nptl/sysdeps/pthread/pt-initfini.c +=================================================================== +--- glibc-2.4/nptl/sysdeps/pthread/pt-initfini.c (revision 1469) ++++ glibc-2.4/nptl/sysdeps/pthread/pt-initfini.c (working copy) +@@ -45,6 +45,11 @@ + /* Embed an #include to pull in the alignment and .end directives. */ + asm ("\n#include \"defs.h\""); + ++asm ("\n#if defined __i686 && defined __ASSEMBLER__"); ++asm ("\n#undef __i686"); ++asm ("\n#define __i686 __i686"); ++asm ("\n#endif"); ++ + /* The initial common code ends here. */ + asm ("\n/*@HEADER_ENDS*/"); + diff --git a/patches/glibc/2.6/170-glibc-i386-preferred-stack-boundary.patch b/patches/glibc/2.6/170-glibc-i386-preferred-stack-boundary.patch new file mode 100644 index 0000000..449821d --- /dev/null +++ b/patches/glibc/2.6/170-glibc-i386-preferred-stack-boundary.patch @@ -0,0 +1,18 @@ +(C) 2007 Yann E. MORIN +License: LGPL v2.1 + +Shut off a stupid warning: preffered-stack-boundary must be between 4 ad 12, +and 2 is not. + +diff -dur glibc-2.5.orig/sysdeps/i386/Makefile glibc-2.5/sysdeps/i386/Makefile +--- glibc-2.5.orig/sysdeps/i386/Makefile 2005-03-06 01:18:16.000000000 +0100 ++++ glibc-2.5/sysdeps/i386/Makefile 2007-05-27 17:49:37.000000000 +0200 +@@ -36,7 +36,7 @@ + ifeq ($(subdir),csu) + sysdep-CFLAGS += -mpreferred-stack-boundary=4 + else +-sysdep-CFLAGS += -mpreferred-stack-boundary=2 ++sysdep-CFLAGS += -mpreferred-stack-boundary=4 + # Likewise, any function which calls user callbacks + uses-callbacks += -mpreferred-stack-boundary=4 + # Likewise, any stack alignment tests diff --git a/patches/glibc/2.6/fix-pr398.patch b/patches/glibc/2.6/fix-pr398.patch deleted file mode 100644 index d5d0309..0000000 --- a/patches/glibc/2.6/fix-pr398.patch +++ /dev/null @@ -1,70 +0,0 @@ -Fixes error - -dl-runtime.c:222: error: parse error before "CFI_STARTPROC" -make[2]: *** [crosstool-0.28-rc35/build/s390-unknown-linux-gnu/gcc-3.4.1-glibc-20040822/build-glibc/elf/dl-runtim -e.o] Error 1 -make[2]: Leaving directory `crosstool-0.28-rc35/build/s390-unknown-linux-gnu/gcc-3.4.1-glibc-20040822/glibc-20040 -822/elf' -make[1]: *** [elf/subdir_lib] Error 2 -make[1]: Leaving directory `crosstool-0.28-rc35/build/s390-unknown-linux-gnu/gcc-3.4.1-glibc-20040822/glibc-20040 -822' -make: *** [all] Error 2 - ------------------ - -See http://sources.redhat.com/bugzilla/show_bug.cgi?id=398 -http://sources.redhat.com/ml/libc-alpha/2004-07/msg00023.html - ------------------ - -CVSROOT: /cvs/glibc -Module name: libc -Branch: glibc-2_3-branch -Changes by: roland@sources.redhat.com 2006-02-23 22:36:51 - -Modified files: - sysdeps/s390/s390-64: dl-machine.h - sysdeps/s390/s390-32: dl-machine.h - -Log message: - 2004-07-10 GOTO Masanori - - [BZ #398] - * sysdeps/s390/s390-32/dl-machine.h: Include for CFI - directive. - * sysdeps/s390/s390-64/dl-machine.h: Likewise. - -Patches: -http://sources.redhat.com/cgi-bin/cvsweb.cgi/libc/sysdeps/s390/s390-64/dl-machine.h.diff?cvsroot=glibc&only_with_tag=glibc-2_3-branch&r1=1.19.4.1&r2=1.19.4.2 -http://sources.redhat.com/cgi-bin/cvsweb.cgi/libc/sysdeps/s390/s390-32/dl-machine.h.diff?cvsroot=glibc&only_with_tag=glibc-2_3-branch&r1=1.20.4.1&r2=1.20.4.2 - -=================================================================== -RCS file: /cvs/glibc/libc/sysdeps/s390/s390-64/dl-machine.h,v -retrieving revision 1.19.4.1 -retrieving revision 1.19.4.2 -diff -u -r1.19.4.1 -r1.19.4.2 ---- libc/sysdeps/s390/s390-64/dl-machine.h 2005/10/17 04:57:27 1.19.4.1 -+++ libc/sysdeps/s390/s390-64/dl-machine.h 2006/02/23 22:36:51 1.19.4.2 -@@ -27,6 +27,7 @@ - #include - #include - #include -+#include - - /* This is an older, now obsolete value. */ - #define EM_S390_OLD 0xA390 -=================================================================== -RCS file: /cvs/glibc/libc/sysdeps/s390/s390-32/dl-machine.h,v -retrieving revision 1.20.4.1 -retrieving revision 1.20.4.2 -diff -u -r1.20.4.1 -r1.20.4.2 ---- libc/sysdeps/s390/s390-32/dl-machine.h 2005/10/17 04:57:27 1.20.4.1 -+++ libc/sysdeps/s390/s390-32/dl-machine.h 2006/02/23 22:36:51 1.20.4.2 -@@ -27,6 +27,7 @@ - #include - #include - #include -+#include - - /* This is an older, now obsolete value. */ - #define EM_S390_OLD 0xA390 diff --git a/patches/glibc/2.6/glibc-2.3.5-allow-gcc4-wcstol_l.patch b/patches/glibc/2.6/glibc-2.3.5-allow-gcc4-wcstol_l.patch deleted file mode 100644 index 0e6776f..0000000 --- a/patches/glibc/2.6/glibc-2.3.5-allow-gcc4-wcstol_l.patch +++ /dev/null @@ -1,59 +0,0 @@ -Fixes -../sysdeps/wordsize-64/wcstol_l.c:11: error: '____wcstoll_l_internal' aliased to undefined symbol '____wcstol_l_internal' -../sysdeps/wordsize-64/wcstol_l.c:12: error: '__wcstoll_l' aliased to undefined symbol '__wcstol_l' -../sysdeps/wordsize-64/wcstol_l.c:13: error: 'wcstoll_l' aliased to undefined symbol '__wcstol_l' -make[2]: *** [/home/dkegel/queue/jobdir.produser_cpsm10/crosstool-0.32/build/x86_64-unknown-linux-gnu/gcc-4.0.0-20050410-glibc-2.3.4/build-glibc/wcsmbs/wcstoul_l.o] Error 1 - -https://www.redhat.com/archives/fedora-cvs-commits/2005-March/msg00408.html -%changelog -+* Fri Mar 25 2005 Jakub Jelinek 2.3.4-18 -+- fix build on 64-bit arches with new GCC - -Revision 1.4.2.1, Fri Mar 25 11:59:01 2005 UTC (3 weeks, 4 days ago) by jakub -Branch: fedora-branch -CVS Tags: fedora-glibc-2_3_4-18 -Changes since 1.4: +2 -0 lines -Diff to previous 1.4 (colored) - - * sysdeps/wordsize-64/strtol_l.c: Don't add aliases if UNSIGNED. - * sysdeps/wordsize-64/wcstol_l.c: Likewise. - - -http://sourceware.org/cgi-bin/cvsweb.cgi/libc/sysdeps/wordsize-64/strtol_l.c.diff?r1=1.4&r2=1.4.2.1&cvsroot=glibc -http://sourceware.org/cgi-bin/cvsweb.cgi/libc/sysdeps/wordsize-64/wcstol_l.c.diff?r1=1.4&r2=1.4.2.1&cvsroot=glibc - -=================================================================== -RCS file: /cvs/glibc/libc/sysdeps/wordsize-64/strtol_l.c,v -retrieving revision 1.4 -retrieving revision 1.4.2.1 -diff -u -r1.4 -r1.4.2.1 ---- libc/sysdeps/wordsize-64/strtol_l.c 2003/03/03 09:45:12 1.4 -+++ libc/sysdeps/wordsize-64/strtol_l.c 2005/03/25 11:59:01 1.4.2.1 -@@ -8,7 +8,9 @@ - #undef ____strtoll_l_internal - #undef __strtoll_l - #undef strtoll_l -+#if !UNSIGNED - strong_alias (____strtol_l_internal, ____strtoll_l_internal) - libc_hidden_ver (____strtol_l_internal, ____strtoll_l_internal) - weak_alias (__strtol_l, __strtoll_l) - weak_alias (__strtol_l, strtoll_l) -+#endif -=================================================================== -RCS file: /cvs/glibc/libc/sysdeps/wordsize-64/wcstol_l.c,v -retrieving revision 1.4 -retrieving revision 1.4.2.1 -diff -u -r1.4 -r1.4.2.1 ---- libc/sysdeps/wordsize-64/wcstol_l.c 2002/08/08 11:44:51 1.4 -+++ libc/sysdeps/wordsize-64/wcstol_l.c 2005/03/25 11:59:01 1.4.2.1 -@@ -8,6 +8,8 @@ - #undef ____wcstoll_l_internal - #undef __wcstoll_l - #undef wcstoll_l -+#if !UNSIGNED - strong_alias (____wcstol_l_internal, ____wcstoll_l_internal) - weak_alias (__wcstol_l, __wcstoll_l) - weak_alias (__wcstol_l, wcstoll_l) -+#endif - -Signed-off-by: Robert P. J. Day diff --git a/patches/glibc/2.6/glibc-2.3.5-cygwin.patch b/patches/glibc/2.6/glibc-2.3.5-cygwin.patch deleted file mode 100644 index 3c0cd7d..0000000 --- a/patches/glibc/2.6/glibc-2.3.5-cygwin.patch +++ /dev/null @@ -1,187 +0,0 @@ -Fixes -elf/librtld.os: In function `process_envvars': : undefined reference to `__access' -... -when building glibc-2.3.x on cygwin - -Idea from -http://sources.redhat.com/ml/bug-glibc/2002-01/msg00071/glibc-2.2-cygin-shared.patch -Basically, make glibc use .oST as suffix for 'object static' -instead of .oS, since cygwin has trouble distinguishing .os from .oS -(Original patch had .on, but .oST is more mnemonic for 'object static') - -glibc-linuxthreads-2.3.5 also requires a patch, see -../glibc-linuxthreads-2.3.5/glibc-linuxthreads-2.3.5-cygwin.patch - -[ forward ported to glibc-2.3.5 by Petr Cvachoucek: - -Message-ID: <4282FCBA.3040000@unicontrols.cz> -Date: Thu, 12 May 2005 08:50:34 +0200 -From: Petr Cvachoucek -To: Dan Kegel -CC: crossgcc@sources.redhat.com -Subject: Patches to build gcc 3.4.3 / glibc 2.3.5 on cygwin - -Hi Dan, -following patches are needed to build gcc-3.4.3/glibc-2.3.5 toolchain -on cygwin. Tested to build toolchains for powerpc 604 and 750 targets. - --- - Petr Cvachoucek - Unicontrols a.s. - http://www.unicontrols.cz -] - -diff -aur glibc-2.3.5/Makeconfig glibc-2.3.5-cygwin/Makeconfig ---- glibc-2.3.5/Makeconfig 2005-02-16 11:50:19.000000000 +0100 -+++ glibc-2.3.5-cygwin/Makeconfig 2005-05-11 08:24:51.046875000 +0200 -@@ -472,7 +472,7 @@ - # run the linked programs. - link-libc = -Wl,-rpath-link=$(rpath-link) \ - $(common-objpfx)libc.so$(libc.so-version) \ -- $(common-objpfx)$(patsubst %,$(libtype.oS),c) $(gnulib) -+ $(common-objpfx)$(patsubst %,$(libtype.oST),c) $(gnulib) - # This is how to find at build-time things that will be installed there. - rpath-dirs = math elf dlfcn nss nis rt resolv crypt - endif -@@ -693,7 +693,7 @@ - # The compilation rules use $(CPPFLAGS-${SUFFIX}) and $(CFLAGS-${SUFFIX}) - # to pass different flags for each flavor. - libtypes = $(foreach o,$(object-suffixes-for-libc),$(libtype$o)) --all-object-suffixes := .o .os .op .og .ob .oS -+all-object-suffixes := .o .os .op .og .ob .oST - object-suffixes := - CPPFLAGS-.o = $(pic-default) - CFLAGS-.o = $(filter %frame-pointer,$(+cflags)) -@@ -749,14 +749,14 @@ - - ifeq (yes,$(build-shared)) - # Build special library that contains the static-only routines for libc. --object-suffixes-for-libc += .oS -+object-suffixes-for-libc += .oST - - # Must build the routines as PIC, though, because they can end up in (users') - # shared objects. We don't want to use CFLAGS-os because users may, for - # example, make that processor-specific. --CFLAGS-.oS = $(CFLAGS-.o) $(PIC-ccflag) --CPPFLAGS-.oS = $(CPPFLAGS-.o) -DPIC -DLIBC_NONSHARED=1 --libtype.oS = lib%_nonshared.a -+CFLAGS-.oST = $(CFLAGS-.o) $(PIC-ccflag) -+CPPFLAGS-.oST = $(CPPFLAGS-.o) -DPIC -DLIBC_NONSHARED=1 -+libtype.oST = lib%_nonshared.a - endif - - # The assembler can generate debug information too. -diff -aur glibc-2.3.5/Makerules glibc-2.3.5-cygwin/Makerules ---- glibc-2.3.5/Makerules 2004-12-15 19:52:39.000000000 +0100 -+++ glibc-2.3.5-cygwin/Makerules 2005-05-11 08:25:33.578125000 +0200 -@@ -417,7 +417,7 @@ - # Bounded pointer thunks are only built for *.ob - elide-bp-thunks = $(addprefix $(bppfx),$(bp-thunks)) - --elide-routines.oS += $(filter-out $(static-only-routines),\ -+elide-routines.oST += $(filter-out $(static-only-routines),\ - $(routines) $(aux) $(sysdep_routines)) \ - $(elide-bp-thunks) - elide-routines.os += $(static-only-routines) $(elide-bp-thunks) -@@ -981,7 +981,7 @@ - install: $(inst_libdir)/libc.so - $(inst_libdir)/libc.so: $(common-objpfx)format.lds \ - $(common-objpfx)libc.so$(libc.so-version) \ -- $(inst_libdir)/$(patsubst %,$(libtype.oS),\ -+ $(inst_libdir)/$(patsubst %,$(libtype.oST),\ - $(libprefix)$(libc-name)) \ - $(+force) - (echo '/* GNU ld script';\ -@@ -989,7 +989,7 @@ - echo ' the static library, so try that secondarily. */';\ - cat $<; \ - echo 'GROUP ( $(slibdir)/libc.so$(libc.so-version)' \ -- '$(libdir)/$(patsubst %,$(libtype.oS),$(libprefix)$(libc-name))'\ -+ '$(libdir)/$(patsubst %,$(libtype.oST),$(libprefix)$(libc-name))'\ - ' AS_NEEDED (' $(slibdir)/$(rtld-installed-name) ') )' \ - ) > $@.new - mv -f $@.new $@ -diff -aur glibc-2.3.5/extra-lib.mk glibc-2.3.5-cygwin/extra-lib.mk ---- glibc-2.3.5/extra-lib.mk 2004-12-02 23:54:47.000000000 +0100 -+++ glibc-2.3.5-cygwin/extra-lib.mk 2005-05-11 08:27:28.156250000 +0200 -@@ -13,7 +13,7 @@ - - ifneq (,$($(lib)-static-only-routines)) - ifneq (,$(filter yesyes%,$(build-shared)$(elf)$($(lib).so-version))) --object-suffixes-$(lib) += $(filter-out $($(lib)-inhibit-o),.oS) -+object-suffixes-$(lib) += $(filter-out $($(lib)-inhibit-o),.oST) - endif - endif - -@@ -29,7 +29,7 @@ - - # Add each flavor of library to the lists of things to build and install. - install-lib += $(foreach o,$(object-suffixes-$(lib)),$(lib:lib%=$(libtype$o))) --extra-objs += $(foreach o,$(filter-out .os .oS,$(object-suffixes-$(lib))),\ -+extra-objs += $(foreach o,$(filter-out .os .oST,$(object-suffixes-$(lib))),\ - $(patsubst %,%$o,$(filter-out \ - $($(lib)-shared-only-routines),\ - $(all-$(lib)-routines)))) -@@ -57,7 +57,7 @@ - - - # Use o-iterator.mk to generate a rule for each flavor of library. --ifneq (,$(filter-out .os .oS,$(object-suffixes-$(lib)))) -+ifneq (,$(filter-out .os .oST,$(object-suffixes-$(lib)))) - define o-iterator-doit - $(objpfx)$(patsubst %,$(libtype$o),$(lib:lib%=%)): \ - $(patsubst %,$(objpfx)%$o,\ -@@ -65,7 +65,7 @@ - $(all-$(lib)-routines))); \ - $$(build-extra-lib) - endef --object-suffixes-left = $(filter-out .os .oS,$(object-suffixes-$(lib))) -+object-suffixes-left = $(filter-out .os .oST,$(object-suffixes-$(lib))) - include $(patsubst %,$(..)o-iterator.mk,$(object-suffixes-left)) - endif - -@@ -77,9 +77,9 @@ - $(build-extra-lib) - endif - --ifneq (,$(filter .oS,$(object-suffixes-$(lib)))) --$(objpfx)$(patsubst %,$(libtype.oS),$(lib:lib%=%)): \ -- $(patsubst %,$(objpfx)%.oS,\ -+ifneq (,$(filter .oST,$(object-suffixes-$(lib)))) -+$(objpfx)$(patsubst %,$(libtype.oST),$(lib:lib%=%)): \ -+ $(patsubst %,$(objpfx)%.oST,\ - $(filter $($(lib)-static-only-routines),\ - $(all-$(lib)-routines))) - $(build-extra-lib) -diff -aur glibc-2.3.5/nptl/Makefile glibc-2.3.5-cygwin/nptl/Makefile ---- glibc-2.3.5/nptl/Makefile 2005-02-16 09:45:56.000000000 +0100 -+++ glibc-2.3.5-cygwin/nptl/Makefile 2005-05-11 08:26:01.812500000 +0200 -@@ -375,7 +375,7 @@ - - $(inst_libdir)/libpthread.so: $(common-objpfx)format.lds \ - $(objpfx)libpthread.so$(libpthread.so-version) \ -- $(inst_libdir)/$(patsubst %,$(libtype.oS),\ -+ $(inst_libdir)/$(patsubst %,$(libtype.oST),\ - $(libprefix)pthread) \ - $(+force) - (echo '/* GNU ld script';\ -@@ -383,7 +383,7 @@ - echo ' the static library, so try that secondarily. */';\ - cat $<; \ - echo 'GROUP ( $(slibdir)/libpthread.so$(libpthread.so-version)' \ -- '$(libdir)/$(patsubst %,$(libtype.oS),$(libprefix)pthread)'\ -+ '$(libdir)/$(patsubst %,$(libtype.oST),$(libprefix)pthread)'\ - ')' \ - ) > $@.new - mv -f $@.new $@ -diff -aur glibc-2.3.5/sysdeps/sparc/sparc32/sparcv9/Makefile glibc-2.3.5-cygwin/sysdeps/sparc/sparc32/sparcv9/Makefile ---- glibc-2.3.5/sysdeps/sparc/sparc32/sparcv9/Makefile 2004-08-16 08:46:14.000000000 +0200 -+++ glibc-2.3.5-cygwin/sysdeps/sparc/sparc32/sparcv9/Makefile 2005-05-11 08:26:25.937500000 +0200 -@@ -10,4 +10,4 @@ - ASFLAGS-.op += -Wa,-Av9a - ASFLAGS-.og += -Wa,-Av9a - ASFLAGS-.ob += -Wa,-Av9a --ASFLAGS-.oS += -Wa,-Av9a -+ASFLAGS-.oST += -Wa,-Av9a - -Signed-off-by: Robert P. J. Day diff --git a/patches/glibc/2.6/glibc-2.3.6-allow-gcc-4.0-elf.patch b/patches/glibc/2.6/glibc-2.3.6-allow-gcc-4.0-elf.patch deleted file mode 100644 index 87860fa..0000000 --- a/patches/glibc/2.6/glibc-2.3.6-allow-gcc-4.0-elf.patch +++ /dev/null @@ -1,67 +0,0 @@ -From http://www.mail-archive.com/pld-cvs-commit@pld-linux.org/msg00229.html -Fixes - rtld.c: In function '_dl_start': - dynamic-link.h:47: error: nested function 'elf_machine_rela_relative' declared but never defined - dynamic-link.h:41: error: nested function 'elf_machine_rela' declared but never defined -when compiling glibc-2.3.4 with gcc-4.0 - -But see also -http://sources.redhat.com/ml/libc-hacker/2005-02/msg00000.html -and -http://sources.redhat.com/ml/libc-hacker/2005-03/msg00008.html -which seem to propose less radical fixes? - -Aha. See also http://sources.redhat.com/bugzilla/show_bug.cgi?id=721 - ---- glibc-2.3.6.orig/elf/dynamic-link.h 2005-03-12 18:12:37.000000000 -0800 -+++ glibc-2.3.6/elf/dynamic-link.h 2005-03-12 18:12:59.777820848 -0800 -@@ -19,47 +19,6 @@ - - #include - #include -- --#ifdef RESOLVE_MAP --/* We pass reloc_addr as a pointer to void, as opposed to a pointer to -- ElfW(Addr), because not all architectures can assume that the -- relocated address is properly aligned, whereas the compiler is -- entitled to assume that a pointer to a type is properly aligned for -- the type. Even if we cast the pointer back to some other type with -- less strict alignment requirements, the compiler might still -- remember that the pointer was originally more aligned, thereby -- optimizing away alignment tests or using word instructions for -- copying memory, breaking the very code written to handle the -- unaligned cases. */ --# if ! ELF_MACHINE_NO_REL --auto inline void __attribute__((always_inline)) --elf_machine_rel (struct link_map *map, const ElfW(Rel) *reloc, -- const ElfW(Sym) *sym, const struct r_found_version *version, -- void *const reloc_addr); --auto inline void __attribute__((always_inline)) --elf_machine_rel_relative (ElfW(Addr) l_addr, const ElfW(Rel) *reloc, -- void *const reloc_addr); --# endif --# if ! ELF_MACHINE_NO_RELA --auto inline void __attribute__((always_inline)) --elf_machine_rela (struct link_map *map, const ElfW(Rela) *reloc, -- const ElfW(Sym) *sym, const struct r_found_version *version, -- void *const reloc_addr); --auto inline void __attribute__((always_inline)) --elf_machine_rela_relative (ElfW(Addr) l_addr, const ElfW(Rela) *reloc, -- void *const reloc_addr); --# endif --# if ELF_MACHINE_NO_RELA || defined ELF_MACHINE_PLT_REL --auto inline void __attribute__((always_inline)) --elf_machine_lazy_rel (struct link_map *map, -- ElfW(Addr) l_addr, const ElfW(Rel) *reloc); --# else --auto inline void __attribute__((always_inline)) --elf_machine_lazy_rel (struct link_map *map, -- ElfW(Addr) l_addr, const ElfW(Rela) *reloc); --# endif --#endif -- - #include - - #ifndef VERSYMIDX - -Signed-off-by: Robert P. J. Day diff --git a/patches/glibc/2.6/glibc-2.3.6-configure-apple-as.patch b/patches/glibc/2.6/glibc-2.3.6-configure-apple-as.patch deleted file mode 100644 index 78a1324..0000000 --- a/patches/glibc/2.6/glibc-2.3.6-configure-apple-as.patch +++ /dev/null @@ -1,25 +0,0 @@ -http://in3www.epfl.ch/~schaffne/glibc-configure-apple-as.patch -http://sources.redhat.com/ml/crossgcc/2004-02/msg00151.html - -The following makes it possible to configure glibc-2.3.2 on Mac OS X, -where the assembler but doesn't understand the --version flag. - -Fixes the symptom -checking whether ld is GNU ld... no -checking for /usr/libexec/gcc/darwin/ppc/as... /usr/libexec/gcc/darwin/ppc/as -checking version of /usr/libexec/gcc/darwin/ppc/as... - - ---- glibc-2.3.2/configure~ Wed Feb 26 09:20:48 2003 -+++ glibc-2.3.2/configure Fri Feb 27 13:12:53 2004 -@@ -4039,7 +4039,7 @@ - # Found it, now check the version. - echo "$as_me:$LINENO: checking version of $AS" >&5 - echo $ECHO_N "checking version of $AS... $ECHO_C" >&6 -- ac_prog_version=`$AS --version 2>&1 | sed -n 's/^.*GNU assembler.* \([0-9]*\.[0-9.]*\).*$/\1/p'` -+ ac_prog_version=`$AS -v &1 | sed -n 's/^.*GNU assembler.* \([0-9]*\.[0-9.]*\).*$/\1/p'` - case $ac_prog_version in - '') ac_prog_version="v. ?.??, bad"; ac_verc_fail=yes;; - 2.1[3-9]*) - -Signed-off-by: Robert P. J. Day diff --git a/patches/glibc/2.6/glibc-2.3.6-fix-pr631.patch b/patches/glibc/2.6/glibc-2.3.6-fix-pr631.patch deleted file mode 100644 index 13688df..0000000 --- a/patches/glibc/2.6/glibc-2.3.6-fix-pr631.patch +++ /dev/null @@ -1,45 +0,0 @@ -From dank@kegel.com -Wed Jun 15 09:12:43 PDT 2005 - -Fixes - -build-glibc/libc.a(nsswitch.o)(.data+0x64): undefined reference to `_nss_files_getaliasent_r' -build-glibc/libc.a(nsswitch.o)(.data+0x6c): undefined reference to `_nss_files_endaliasent' -... 53 lines deleted ... -build-glibc/libc.a(nsswitch.o)(.data+0x21c): undefined reference to `_nss_files_getspnam_r' -collect2: ld returned 1 exit status -make[2]: *** [/build/gcc-3.4.3-glibc-2.3.5-hdrs-2.6.11.2/i686-unknown-linux-gnu/build-glibc/elf/ldconfig] Error 1 - -when building glibc with --enable-static-nss. - -See http://sources.redhat.com/bugzilla/show_bug.cgi?id=631 - ---- glibc-2.3.5/Makeconfig.old Wed Jun 15 08:13:12 2005 -+++ glibc-2.3.5/Makeconfig Wed Jun 15 08:13:14 2005 -@@ -510,7 +510,7 @@ - - # The static libraries. - ifeq (yes,$(build-static)) --link-libc-static = $(common-objpfx)libc.a $(static-gnulib) $(common-objpfx)libc.a -+link-libc-static = $(common-objpfx)libc.a $(static-gnulib) $(otherlibs) $(common-objpfx)libc.a - else - ifeq (yes,$(build-shared)) - # We can try to link the programs with lib*_pic.a... ---- glibc-2.3.5/elf/Makefile.old Wed Jun 15 07:46:49 2005 -+++ glibc-2.3.5/elf/Makefile Wed Jun 15 08:14:00 2005 -@@ -120,6 +120,13 @@ - install-bin-script = ldd - endif - -+ifeq (yes,$(build-static-nss)) -+nssobjdir := $(patsubst ../$(subdir),.,$(common-objpfx)nss) -+resolvobjdir := $(patsubst ../$(subdir),.,$(common-objpfx)resolv) -+otherlibs += $(nssobjdir)/libnss_files.a $(resolvobjdir)/libnss_dns.a \ -+ $(resolvobjdir)/libresolv.a -+endif -+ - others = sprof sln - install-bin = sprof - others-static = sln - -Signed-off-by: Robert P. J. Day diff --git a/patches/glibc/2.6/glibc-2.4-i686-assembler.patch b/patches/glibc/2.6/glibc-2.4-i686-assembler.patch deleted file mode 100644 index 9904efb..0000000 --- a/patches/glibc/2.6/glibc-2.4-i686-assembler.patch +++ /dev/null @@ -1,38 +0,0 @@ -2007-02-15 Khem Raj - - * sysdeps/unix/sysv/linux/i386/sysdep.h: Re-define __i686. - * nptl/sysdeps/pthread/pt-initfini.c: Ditto. - - - -Index: glibc-2.4/sysdeps/unix/sysv/linux/i386/sysdep.h -=================================================================== ---- glibc-2.4/sysdeps/unix/sysv/linux/i386/sysdep.h (revision 1469) -+++ glibc-2.4/sysdeps/unix/sysv/linux/i386/sysdep.h (working copy) -@@ -29,6 +29,10 @@ - #include - #include - -+#if defined __i686 && defined __ASSEMBLER__ -+#undef __i686 -+#define __i686 __i686 -+#endif - - /* For Linux we can use the system call table in the header file - /usr/include/asm/unistd.h -Index: glibc-2.4/nptl/sysdeps/pthread/pt-initfini.c -=================================================================== ---- glibc-2.4/nptl/sysdeps/pthread/pt-initfini.c (revision 1469) -+++ glibc-2.4/nptl/sysdeps/pthread/pt-initfini.c (working copy) -@@ -45,6 +45,11 @@ - /* Embed an #include to pull in the alignment and .end directives. */ - asm ("\n#include \"defs.h\""); - -+asm ("\n#if defined __i686 && defined __ASSEMBLER__"); -+asm ("\n#undef __i686"); -+asm ("\n#define __i686 __i686"); -+asm ("\n#endif"); -+ - /* The initial common code ends here. */ - asm ("\n/*@HEADER_ENDS*/"); - diff --git a/patches/glibc/2.6/glibc-i386-preferred-stack-boundary.patch b/patches/glibc/2.6/glibc-i386-preferred-stack-boundary.patch deleted file mode 100644 index 449821d..0000000 --- a/patches/glibc/2.6/glibc-i386-preferred-stack-boundary.patch +++ /dev/null @@ -1,18 +0,0 @@ -(C) 2007 Yann E. MORIN -License: LGPL v2.1 - -Shut off a stupid warning: preffered-stack-boundary must be between 4 ad 12, -and 2 is not. - -diff -dur glibc-2.5.orig/sysdeps/i386/Makefile glibc-2.5/sysdeps/i386/Makefile ---- glibc-2.5.orig/sysdeps/i386/Makefile 2005-03-06 01:18:16.000000000 +0100 -+++ glibc-2.5/sysdeps/i386/Makefile 2007-05-27 17:49:37.000000000 +0200 -@@ -36,7 +36,7 @@ - ifeq ($(subdir),csu) - sysdep-CFLAGS += -mpreferred-stack-boundary=4 - else --sysdep-CFLAGS += -mpreferred-stack-boundary=2 -+sysdep-CFLAGS += -mpreferred-stack-boundary=4 - # Likewise, any function which calls user callbacks - uses-callbacks += -mpreferred-stack-boundary=4 - # Likewise, any stack alignment tests diff --git a/patches/glibc/linuxthreads-2.3.6/100-glibc-linuxthreads-2.3.5-cygwin.patch b/patches/glibc/linuxthreads-2.3.6/100-glibc-linuxthreads-2.3.5-cygwin.patch new file mode 100644 index 0000000..0c0dac0 --- /dev/null +++ b/patches/glibc/linuxthreads-2.3.6/100-glibc-linuxthreads-2.3.5-cygwin.patch @@ -0,0 +1,37 @@ +Fixes +elf/librtld.os: In function `process_envvars': : undefined reference to `__access' +... +when building glibc-2.3.3 on cygwin + +Idea from +http://sources.redhat.com/ml/bug-glibc/2002-01/msg00071/glibc-2.2-cygin-shared.patch +Basically, make glibc use .oST as suffix for 'object static' +instead of .oS, since cygwin has trouble distinguishing .os from .oS +(Original patch had .on, but .oST is more mnemonic for 'object static') + +glibc-linuxthreads-2.3.3 also requires a patch, see +../glibc-linuxthreads-2.3.3/glibc-linuxthreads-2.3.3-cygwin.patch + +[ rediffed against glibc-2.3.5 ] + +diff -aur glibc-2.3.5/linuxthreads/Makefile glibc-2.3.5-cygwin/linuxthreads/Makefile +--- glibc-2.3.5/linuxthreads/Makefile 2005-02-16 12:26:38.000000000 +0100 ++++ glibc-2.3.5-cygwin/linuxthreads/Makefile 2005-05-11 08:32:50.453125000 +0200 +@@ -159,7 +159,7 @@ + install: $(inst_libdir)/libpthread.so + $(inst_libdir)/libpthread.so: $(common-objpfx)format.lds \ + $(objpfx)libpthread.so$(libpthread.so-version) \ +- $(inst_libdir)/$(patsubst %,$(libtype.oS),\ ++ $(inst_libdir)/$(patsubst %,$(libtype.oST),\ + $(libprefix)pthread) \ + $(+force) + (echo '/* GNU ld script';\ +@@ -167,7 +167,7 @@ + echo ' the static library, so try that secondarily. */';\ + cat $<; \ + echo 'GROUP ( $(slibdir)/libpthread.so$(libpthread.so-version)' \ +- '$(libdir)/$(patsubst %,$(libtype.oS),$(libprefix)pthread)'\ ++ '$(libdir)/$(patsubst %,$(libtype.oST),$(libprefix)pthread)'\ + ')' \ + ) > $@.new + mv -f $@.new $@ diff --git a/patches/glibc/linuxthreads-2.3.6/glibc-linuxthreads-2.3.5-cygwin.patch b/patches/glibc/linuxthreads-2.3.6/glibc-linuxthreads-2.3.5-cygwin.patch deleted file mode 100644 index 0c0dac0..0000000 --- a/patches/glibc/linuxthreads-2.3.6/glibc-linuxthreads-2.3.5-cygwin.patch +++ /dev/null @@ -1,37 +0,0 @@ -Fixes -elf/librtld.os: In function `process_envvars': : undefined reference to `__access' -... -when building glibc-2.3.3 on cygwin - -Idea from -http://sources.redhat.com/ml/bug-glibc/2002-01/msg00071/glibc-2.2-cygin-shared.patch -Basically, make glibc use .oST as suffix for 'object static' -instead of .oS, since cygwin has trouble distinguishing .os from .oS -(Original patch had .on, but .oST is more mnemonic for 'object static') - -glibc-linuxthreads-2.3.3 also requires a patch, see -../glibc-linuxthreads-2.3.3/glibc-linuxthreads-2.3.3-cygwin.patch - -[ rediffed against glibc-2.3.5 ] - -diff -aur glibc-2.3.5/linuxthreads/Makefile glibc-2.3.5-cygwin/linuxthreads/Makefile ---- glibc-2.3.5/linuxthreads/Makefile 2005-02-16 12:26:38.000000000 +0100 -+++ glibc-2.3.5-cygwin/linuxthreads/Makefile 2005-05-11 08:32:50.453125000 +0200 -@@ -159,7 +159,7 @@ - install: $(inst_libdir)/libpthread.so - $(inst_libdir)/libpthread.so: $(common-objpfx)format.lds \ - $(objpfx)libpthread.so$(libpthread.so-version) \ -- $(inst_libdir)/$(patsubst %,$(libtype.oS),\ -+ $(inst_libdir)/$(patsubst %,$(libtype.oST),\ - $(libprefix)pthread) \ - $(+force) - (echo '/* GNU ld script';\ -@@ -167,7 +167,7 @@ - echo ' the static library, so try that secondarily. */';\ - cat $<; \ - echo 'GROUP ( $(slibdir)/libpthread.so$(libpthread.so-version)' \ -- '$(libdir)/$(patsubst %,$(libtype.oS),$(libprefix)pthread)'\ -+ '$(libdir)/$(patsubst %,$(libtype.oST),$(libprefix)pthread)'\ - ')' \ - ) > $@.new - mv -f $@.new $@ diff --git a/patches/linux/2.4.26/01-kmap-types-cleanup.patch b/patches/linux/2.4.26/01-kmap-types-cleanup.patch deleted file mode 100644 index 4a900bc..0000000 --- a/patches/linux/2.4.26/01-kmap-types-cleanup.patch +++ /dev/null @@ -1,306 +0,0 @@ -From http://www.uwsg.iu.edu/hypermail/linux/kernel/0307.2/att-1234/01-kmap-types-cleanup.patch -See http://www.uwsg.iu.edu/hypermail/linux/kernel/0307.2/1234.html - -From: Marc-Christian Petersen (m.c.p@wolk-project.de) - -> > on alpha: -> > internal.h:19:28: asm/kmap_types.h: No such file or directory -> Same on s390 and some other platforms.We should just get rid of -> this problem by providing a generic kmap_types header. -I agree on this but your patch is bogus. Please use the attached one instead. - -Marcello, please apply this one instead. Against 2.4.22-BK (2.4.21-bk14) - -[ I commented out the hunk -#+++ b/include/asm-mips/kmap_types.h 1970-01-01 01:00:00.000000000 +0100 -to get this to apply to linux-2.4.26. -- dank] - -diff -Naurp a/crypto/internal.h b/crypto/internal.h ---- a/crypto/internal.h 2003-07-19 14:09:06.000000000 +0200 -+++ b/crypto/internal.h 2003-07-19 14:18:58.000000000 +0200 -@@ -14,9 +14,9 @@ - #include - #include - #include -+#include - #include - #include --#include - - extern enum km_type crypto_km_types[]; - -diff -Naurp a/include/asm-i386/fixmap.h b/include/asm-i386/fixmap.h ---- a/include/asm-i386/fixmap.h 2003-07-19 14:09:31.000000000 +0200 -+++ b/include/asm-i386/fixmap.h 2003-07-19 14:18:58.000000000 +0200 -@@ -20,7 +20,7 @@ - #include - #ifdef CONFIG_HIGHMEM - #include --#include -+#include - #endif - - /* -diff -Naurp a/include/asm-i386/highmem.h b/include/asm-i386/highmem.h ---- a/include/asm-i386/highmem.h 2003-07-15 10:28:54.000000000 +0200 -+++ b/include/asm-i386/highmem.h 2003-07-19 14:18:58.000000000 +0200 -@@ -23,7 +23,6 @@ - #include - #include - #include --#include - #include - - #ifdef CONFIG_DEBUG_HIGHMEM -diff -Naurp a/include/asm-i386/kmap_types.h b/include/asm-i386/kmap_types.h ---- a/include/asm-i386/kmap_types.h 2003-07-19 14:09:31.000000000 +0200 -+++ b/include/asm-i386/kmap_types.h 1970-01-01 01:00:00.000000000 +0100 -@@ -1,16 +0,0 @@ --#ifndef _ASM_KMAP_TYPES_H --#define _ASM_KMAP_TYPES_H -- --enum km_type { -- KM_BOUNCE_READ, -- KM_SKB_SUNRPC_DATA, -- KM_SKB_DATA_SOFTIRQ, -- KM_USER0, -- KM_USER1, -- KM_BH_IRQ, -- KM_SOFTIRQ0, -- KM_SOFTIRQ1, -- KM_TYPE_NR --}; -- --#endif -diff -Naurp a/include/asm-m68k/kmap_types.h b/include/asm-m68k/kmap_types.h ---- a/include/asm-m68k/kmap_types.h 2003-07-19 14:09:33.000000000 +0200 -+++ b/include/asm-m68k/kmap_types.h 1970-01-01 01:00:00.000000000 +0100 -@@ -1,18 +0,0 @@ --#ifdef __KERNEL__ --#ifndef _ASM_KMAP_TYPES_H --#define _ASM_KMAP_TYPES_H -- --enum km_type { -- KM_BOUNCE_READ, -- KM_SKB_SUNRPC_DATA, -- KM_SKB_DATA_SOFTIRQ, -- KM_USER0, -- KM_USER1, -- KM_BH_IRQ, -- KM_SOFTIRQ0, -- KM_SOFTIRQ1, -- KM_TYPE_NR --}; -- --#endif --#endif /* __KERNEL__ */ -diff -Naurp a/include/asm-mips/fixmap.h b/include/asm-mips/fixmap.h ---- a/include/asm-mips/fixmap.h 2002-09-27 23:26:03.000000000 +0200 -+++ b/include/asm-mips/fixmap.h 2003-07-19 14:18:58.000000000 +0200 -@@ -18,7 +18,7 @@ - #include - #ifdef CONFIG_HIGHMEM - #include --#include -+#include - #endif - - /* -diff -Naurp a/include/asm-mips/highmem.h b/include/asm-mips/highmem.h ---- a/include/asm-mips/highmem.h 2002-12-18 01:03:59.000000000 +0100 -+++ b/include/asm-mips/highmem.h 2003-07-19 14:18:58.000000000 +0200 -@@ -22,7 +22,6 @@ - - #include - #include --#include - #include - - /* undef for production */ -#diff -Naurp a/include/asm-mips/kmap_types.h b/include/asm-mips/kmap_types.h -#--- a/include/asm-mips/kmap_types.h 2002-12-18 01:03:59.000000000 +0100 -#+++ b/include/asm-mips/kmap_types.h 1970-01-01 01:00:00.000000000 +0100 -#@@ -1,14 +0,0 @@ -#-#ifndef _ASM_KMAP_TYPES_H -#-#define _ASM_KMAP_TYPES_H -#- -#-enum km_type { -#- KM_BOUNCE_READ, -#- KM_SKB_SUNRPC_DATA, -#- KM_SKB_DATA_SOFTIRQ, -#- KM_USER0, -#- KM_USER1, -#- KM_BIO_IRQ, -#- KM_TYPE_NR -#-}; -#- -#-#endif -diff -Naurp a/include/asm-ppc/highmem.h b/include/asm-ppc/highmem.h ---- a/include/asm-ppc/highmem.h 2003-07-19 14:09:33.000000000 +0200 -+++ b/include/asm-ppc/highmem.h 2003-07-19 14:18:58.000000000 +0200 -@@ -24,7 +24,7 @@ - - #include - #include --#include -+#include - #include - - /* undef for production */ -diff -Naurp a/include/asm-ppc/kmap_types.h b/include/asm-ppc/kmap_types.h ---- a/include/asm-ppc/kmap_types.h 2003-07-19 14:09:33.000000000 +0200 -+++ b/include/asm-ppc/kmap_types.h 1970-01-01 01:00:00.000000000 +0100 -@@ -1,18 +0,0 @@ --#ifdef __KERNEL__ --#ifndef _ASM_KMAP_TYPES_H --#define _ASM_KMAP_TYPES_H -- --enum km_type { -- KM_BOUNCE_READ, -- KM_SKB_SUNRPC_DATA, -- KM_SKB_DATA_SOFTIRQ, -- KM_USER0, -- KM_USER1, -- KM_BH_IRQ, -- KM_SOFTIRQ0, -- KM_SOFTIRQ1, -- KM_TYPE_NR --}; -- --#endif --#endif /* __KERNEL__ */ -diff -Naurp a/include/asm-ppc64/kmap_types.h b/include/asm-ppc64/kmap_types.h ---- a/include/asm-ppc64/kmap_types.h 2003-07-19 14:09:35.000000000 +0200 -+++ b/include/asm-ppc64/kmap_types.h 1970-01-01 01:00:00.000000000 +0100 -@@ -1,23 +0,0 @@ --#ifdef __KERNEL__ --#ifndef _ASM_KMAP_TYPES_H --#define _ASM_KMAP_TYPES_H -- --enum km_type { -- KM_BOUNCE_READ, -- KM_SKB_SUNRPC_DATA, -- KM_SKB_DATA_SOFTIRQ, -- KM_USER0, -- KM_USER1, -- KM_BIO_SRC_IRQ, -- KM_BIO_DST_IRQ, -- KM_PTE0, -- KM_PTE1, -- KM_IRQ0, -- KM_IRQ1, -- KM_SOFTIRQ0, -- KM_SOFTIRQ1, -- KM_TYPE_NR --}; -- --#endif --#endif /* __KERNEL__ */ -diff -Naurp a/include/asm-sparc/highmem.h b/include/asm-sparc/highmem.h ---- a/include/asm-sparc/highmem.h 2003-07-15 10:28:56.000000000 +0200 -+++ b/include/asm-sparc/highmem.h 2003-07-19 14:18:58.000000000 +0200 -@@ -21,7 +21,7 @@ - #ifdef __KERNEL__ - - #include --#include -+#include - - /* undef for production */ - #define HIGHMEM_DEBUG 1 -diff -Naurp a/include/asm-sparc/kmap_types.h b/include/asm-sparc/kmap_types.h ---- a/include/asm-sparc/kmap_types.h 2003-07-19 14:09:37.000000000 +0200 -+++ b/include/asm-sparc/kmap_types.h 1970-01-01 01:00:00.000000000 +0100 -@@ -1,16 +0,0 @@ --#ifndef _ASM_KMAP_TYPES_H --#define _ASM_KMAP_TYPES_H -- --enum km_type { -- KM_BOUNCE_READ, -- KM_SKB_SUNRPC_DATA, -- KM_SKB_DATA_SOFTIRQ, -- KM_USER0, -- KM_USER1, -- KM_BH_IRQ, -- KM_SOFTIRQ0, -- KM_SOFTIRQ1, -- KM_TYPE_NR --}; -- --#endif -diff -Naurp a/include/asm-sparc64/kmap_types.h b/include/asm-sparc64/kmap_types.h ---- a/include/asm-sparc64/kmap_types.h 2003-07-19 14:09:37.000000000 +0200 -+++ b/include/asm-sparc64/kmap_types.h 1970-01-01 01:00:00.000000000 +0100 -@@ -1,20 +0,0 @@ --#ifndef _ASM_KMAP_TYPES_H --#define _ASM_KMAP_TYPES_H -- --/* Dummy header just to define km_type. None of this -- * is actually used on sparc64. -DaveM -- */ -- --enum km_type { -- KM_BOUNCE_READ, -- KM_SKB_SUNRPC_DATA, -- KM_SKB_DATA_SOFTIRQ, -- KM_USER0, -- KM_USER1, -- KM_BH_IRQ, -- KM_SOFTIRQ0, -- KM_SOFTIRQ1, -- KM_TYPE_NR --}; -- --#endif -diff -Naurp a/include/asm-x86_64/kmap_types.h b/include/asm-x86_64/kmap_types.h ---- a/include/asm-x86_64/kmap_types.h 2003-07-19 14:09:37.000000000 +0200 -+++ b/include/asm-x86_64/kmap_types.h 1970-01-01 01:00:00.000000000 +0100 -@@ -1,15 +0,0 @@ --#ifndef _ASM_KMAP_TYPES_H --#define _ASM_KMAP_TYPES_H -- --enum km_type { -- KM_BOUNCE_READ, -- KM_SKB_DATA, -- KM_SKB_DATA_SOFTIRQ, -- KM_USER0, -- KM_USER1, -- KM_SOFTIRQ0, -- KM_SOFTIRQ1, -- KM_TYPE_NR --}; -- --#endif -diff -Naurp a/include/linux/highmem.h b/include/linux/highmem.h ---- a/include/linux/highmem.h 2003-07-19 14:09:37.000000000 +0200 -+++ b/include/linux/highmem.h 2003-07-19 14:18:58.000000000 +0200 -@@ -2,6 +2,7 @@ - #define _LINUX_HIGHMEM_H - - #include -+#include - #include - - #ifdef CONFIG_HIGHMEM -diff -Naurp a/include/linux/kmap_types.h b/include/linux/kmap_types.h ---- a/include/linux/kmap_types.h 1970-01-01 01:00:00.000000000 +0100 -+++ b/include/linux/kmap_types.h 2003-07-19 14:18:58.000000000 +0200 -@@ -0,0 +1,16 @@ -+#ifndef _LINUX_KMAP_TYPES_H -+#define _LINUX_KMAP_TYPES_H -+ -+enum km_type { -+ KM_BOUNCE_READ, -+ KM_SKB_SUNRPC_DATA, -+ KM_SKB_DATA_SOFTIRQ, -+ KM_USER0, -+ KM_USER1, -+ KM_BH_IRQ, -+ KM_SOFTIRQ0, -+ KM_SOFTIRQ1, -+ KM_TYPE_NR -+}; -+ -+#endif - diff --git a/patches/linux/2.4.26/100-kmap-types-cleanup.patch b/patches/linux/2.4.26/100-kmap-types-cleanup.patch new file mode 100644 index 0000000..4a900bc --- /dev/null +++ b/patches/linux/2.4.26/100-kmap-types-cleanup.patch @@ -0,0 +1,306 @@ +From http://www.uwsg.iu.edu/hypermail/linux/kernel/0307.2/att-1234/01-kmap-types-cleanup.patch +See http://www.uwsg.iu.edu/hypermail/linux/kernel/0307.2/1234.html + +From: Marc-Christian Petersen (m.c.p@wolk-project.de) + +> > on alpha: +> > internal.h:19:28: asm/kmap_types.h: No such file or directory +> Same on s390 and some other platforms.We should just get rid of +> this problem by providing a generic kmap_types header. +I agree on this but your patch is bogus. Please use the attached one instead. + +Marcello, please apply this one instead. Against 2.4.22-BK (2.4.21-bk14) + +[ I commented out the hunk +#+++ b/include/asm-mips/kmap_types.h 1970-01-01 01:00:00.000000000 +0100 +to get this to apply to linux-2.4.26. +- dank] + +diff -Naurp a/crypto/internal.h b/crypto/internal.h +--- a/crypto/internal.h 2003-07-19 14:09:06.000000000 +0200 ++++ b/crypto/internal.h 2003-07-19 14:18:58.000000000 +0200 +@@ -14,9 +14,9 @@ + #include + #include + #include ++#include + #include + #include +-#include + + extern enum km_type crypto_km_types[]; + +diff -Naurp a/include/asm-i386/fixmap.h b/include/asm-i386/fixmap.h +--- a/include/asm-i386/fixmap.h 2003-07-19 14:09:31.000000000 +0200 ++++ b/include/asm-i386/fixmap.h 2003-07-19 14:18:58.000000000 +0200 +@@ -20,7 +20,7 @@ + #include + #ifdef CONFIG_HIGHMEM + #include +-#include ++#include + #endif + + /* +diff -Naurp a/include/asm-i386/highmem.h b/include/asm-i386/highmem.h +--- a/include/asm-i386/highmem.h 2003-07-15 10:28:54.000000000 +0200 ++++ b/include/asm-i386/highmem.h 2003-07-19 14:18:58.000000000 +0200 +@@ -23,7 +23,6 @@ + #include + #include + #include +-#include + #include + + #ifdef CONFIG_DEBUG_HIGHMEM +diff -Naurp a/include/asm-i386/kmap_types.h b/include/asm-i386/kmap_types.h +--- a/include/asm-i386/kmap_types.h 2003-07-19 14:09:31.000000000 +0200 ++++ b/include/asm-i386/kmap_types.h 1970-01-01 01:00:00.000000000 +0100 +@@ -1,16 +0,0 @@ +-#ifndef _ASM_KMAP_TYPES_H +-#define _ASM_KMAP_TYPES_H +- +-enum km_type { +- KM_BOUNCE_READ, +- KM_SKB_SUNRPC_DATA, +- KM_SKB_DATA_SOFTIRQ, +- KM_USER0, +- KM_USER1, +- KM_BH_IRQ, +- KM_SOFTIRQ0, +- KM_SOFTIRQ1, +- KM_TYPE_NR +-}; +- +-#endif +diff -Naurp a/include/asm-m68k/kmap_types.h b/include/asm-m68k/kmap_types.h +--- a/include/asm-m68k/kmap_types.h 2003-07-19 14:09:33.000000000 +0200 ++++ b/include/asm-m68k/kmap_types.h 1970-01-01 01:00:00.000000000 +0100 +@@ -1,18 +0,0 @@ +-#ifdef __KERNEL__ +-#ifndef _ASM_KMAP_TYPES_H +-#define _ASM_KMAP_TYPES_H +- +-enum km_type { +- KM_BOUNCE_READ, +- KM_SKB_SUNRPC_DATA, +- KM_SKB_DATA_SOFTIRQ, +- KM_USER0, +- KM_USER1, +- KM_BH_IRQ, +- KM_SOFTIRQ0, +- KM_SOFTIRQ1, +- KM_TYPE_NR +-}; +- +-#endif +-#endif /* __KERNEL__ */ +diff -Naurp a/include/asm-mips/fixmap.h b/include/asm-mips/fixmap.h +--- a/include/asm-mips/fixmap.h 2002-09-27 23:26:03.000000000 +0200 ++++ b/include/asm-mips/fixmap.h 2003-07-19 14:18:58.000000000 +0200 +@@ -18,7 +18,7 @@ + #include + #ifdef CONFIG_HIGHMEM + #include +-#include ++#include + #endif + + /* +diff -Naurp a/include/asm-mips/highmem.h b/include/asm-mips/highmem.h +--- a/include/asm-mips/highmem.h 2002-12-18 01:03:59.000000000 +0100 ++++ b/include/asm-mips/highmem.h 2003-07-19 14:18:58.000000000 +0200 +@@ -22,7 +22,6 @@ + + #include + #include +-#include + #include + + /* undef for production */ +#diff -Naurp a/include/asm-mips/kmap_types.h b/include/asm-mips/kmap_types.h +#--- a/include/asm-mips/kmap_types.h 2002-12-18 01:03:59.000000000 +0100 +#+++ b/include/asm-mips/kmap_types.h 1970-01-01 01:00:00.000000000 +0100 +#@@ -1,14 +0,0 @@ +#-#ifndef _ASM_KMAP_TYPES_H +#-#define _ASM_KMAP_TYPES_H +#- +#-enum km_type { +#- KM_BOUNCE_READ, +#- KM_SKB_SUNRPC_DATA, +#- KM_SKB_DATA_SOFTIRQ, +#- KM_USER0, +#- KM_USER1, +#- KM_BIO_IRQ, +#- KM_TYPE_NR +#-}; +#- +#-#endif +diff -Naurp a/include/asm-ppc/highmem.h b/include/asm-ppc/highmem.h +--- a/include/asm-ppc/highmem.h 2003-07-19 14:09:33.000000000 +0200 ++++ b/include/asm-ppc/highmem.h 2003-07-19 14:18:58.000000000 +0200 +@@ -24,7 +24,7 @@ + + #include + #include +-#include ++#include + #include + + /* undef for production */ +diff -Naurp a/include/asm-ppc/kmap_types.h b/include/asm-ppc/kmap_types.h +--- a/include/asm-ppc/kmap_types.h 2003-07-19 14:09:33.000000000 +0200 ++++ b/include/asm-ppc/kmap_types.h 1970-01-01 01:00:00.000000000 +0100 +@@ -1,18 +0,0 @@ +-#ifdef __KERNEL__ +-#ifndef _ASM_KMAP_TYPES_H +-#define _ASM_KMAP_TYPES_H +- +-enum km_type { +- KM_BOUNCE_READ, +- KM_SKB_SUNRPC_DATA, +- KM_SKB_DATA_SOFTIRQ, +- KM_USER0, +- KM_USER1, +- KM_BH_IRQ, +- KM_SOFTIRQ0, +- KM_SOFTIRQ1, +- KM_TYPE_NR +-}; +- +-#endif +-#endif /* __KERNEL__ */ +diff -Naurp a/include/asm-ppc64/kmap_types.h b/include/asm-ppc64/kmap_types.h +--- a/include/asm-ppc64/kmap_types.h 2003-07-19 14:09:35.000000000 +0200 ++++ b/include/asm-ppc64/kmap_types.h 1970-01-01 01:00:00.000000000 +0100 +@@ -1,23 +0,0 @@ +-#ifdef __KERNEL__ +-#ifndef _ASM_KMAP_TYPES_H +-#define _ASM_KMAP_TYPES_H +- +-enum km_type { +- KM_BOUNCE_READ, +- KM_SKB_SUNRPC_DATA, +- KM_SKB_DATA_SOFTIRQ, +- KM_USER0, +- KM_USER1, +- KM_BIO_SRC_IRQ, +- KM_BIO_DST_IRQ, +- KM_PTE0, +- KM_PTE1, +- KM_IRQ0, +- KM_IRQ1, +- KM_SOFTIRQ0, +- KM_SOFTIRQ1, +- KM_TYPE_NR +-}; +- +-#endif +-#endif /* __KERNEL__ */ +diff -Naurp a/include/asm-sparc/highmem.h b/include/asm-sparc/highmem.h +--- a/include/asm-sparc/highmem.h 2003-07-15 10:28:56.000000000 +0200 ++++ b/include/asm-sparc/highmem.h 2003-07-19 14:18:58.000000000 +0200 +@@ -21,7 +21,7 @@ + #ifdef __KERNEL__ + + #include +-#include ++#include + + /* undef for production */ + #define HIGHMEM_DEBUG 1 +diff -Naurp a/include/asm-sparc/kmap_types.h b/include/asm-sparc/kmap_types.h +--- a/include/asm-sparc/kmap_types.h 2003-07-19 14:09:37.000000000 +0200 ++++ b/include/asm-sparc/kmap_types.h 1970-01-01 01:00:00.000000000 +0100 +@@ -1,16 +0,0 @@ +-#ifndef _ASM_KMAP_TYPES_H +-#define _ASM_KMAP_TYPES_H +- +-enum km_type { +- KM_BOUNCE_READ, +- KM_SKB_SUNRPC_DATA, +- KM_SKB_DATA_SOFTIRQ, +- KM_USER0, +- KM_USER1, +- KM_BH_IRQ, +- KM_SOFTIRQ0, +- KM_SOFTIRQ1, +- KM_TYPE_NR +-}; +- +-#endif +diff -Naurp a/include/asm-sparc64/kmap_types.h b/include/asm-sparc64/kmap_types.h +--- a/include/asm-sparc64/kmap_types.h 2003-07-19 14:09:37.000000000 +0200 ++++ b/include/asm-sparc64/kmap_types.h 1970-01-01 01:00:00.000000000 +0100 +@@ -1,20 +0,0 @@ +-#ifndef _ASM_KMAP_TYPES_H +-#define _ASM_KMAP_TYPES_H +- +-/* Dummy header just to define km_type. None of this +- * is actually used on sparc64. -DaveM +- */ +- +-enum km_type { +- KM_BOUNCE_READ, +- KM_SKB_SUNRPC_DATA, +- KM_SKB_DATA_SOFTIRQ, +- KM_USER0, +- KM_USER1, +- KM_BH_IRQ, +- KM_SOFTIRQ0, +- KM_SOFTIRQ1, +- KM_TYPE_NR +-}; +- +-#endif +diff -Naurp a/include/asm-x86_64/kmap_types.h b/include/asm-x86_64/kmap_types.h +--- a/include/asm-x86_64/kmap_types.h 2003-07-19 14:09:37.000000000 +0200 ++++ b/include/asm-x86_64/kmap_types.h 1970-01-01 01:00:00.000000000 +0100 +@@ -1,15 +0,0 @@ +-#ifndef _ASM_KMAP_TYPES_H +-#define _ASM_KMAP_TYPES_H +- +-enum km_type { +- KM_BOUNCE_READ, +- KM_SKB_DATA, +- KM_SKB_DATA_SOFTIRQ, +- KM_USER0, +- KM_USER1, +- KM_SOFTIRQ0, +- KM_SOFTIRQ1, +- KM_TYPE_NR +-}; +- +-#endif +diff -Naurp a/include/linux/highmem.h b/include/linux/highmem.h +--- a/include/linux/highmem.h 2003-07-19 14:09:37.000000000 +0200 ++++ b/include/linux/highmem.h 2003-07-19 14:18:58.000000000 +0200 +@@ -2,6 +2,7 @@ + #define _LINUX_HIGHMEM_H + + #include ++#include + #include + + #ifdef CONFIG_HIGHMEM +diff -Naurp a/include/linux/kmap_types.h b/include/linux/kmap_types.h +--- a/include/linux/kmap_types.h 1970-01-01 01:00:00.000000000 +0100 ++++ b/include/linux/kmap_types.h 2003-07-19 14:18:58.000000000 +0200 +@@ -0,0 +1,16 @@ ++#ifndef _LINUX_KMAP_TYPES_H ++#define _LINUX_KMAP_TYPES_H ++ ++enum km_type { ++ KM_BOUNCE_READ, ++ KM_SKB_SUNRPC_DATA, ++ KM_SKB_DATA_SOFTIRQ, ++ KM_USER0, ++ KM_USER1, ++ KM_BH_IRQ, ++ KM_SOFTIRQ0, ++ KM_SOFTIRQ1, ++ KM_TYPE_NR ++}; ++ ++#endif + diff --git a/patches/linux/2.4.26/110-kaz-types.patch b/patches/linux/2.4.26/110-kaz-types.patch new file mode 100644 index 0000000..ec5de36 --- /dev/null +++ b/patches/linux/2.4.26/110-kaz-types.patch @@ -0,0 +1,60 @@ +The following fixes an error that occurs when building glibc-2.3.2 (but not glibc-2.2.5) for sh4: + +In file included from sys/ustat.h:30, + from ../sysdeps/unix/sysv/linux/ustat.c:21: +../sysdeps/generic/bits/ustat.h:26: error: redefinition of `struct ustat' +make[2]: *** [/home3/dank/crosstool-0.7/build/sh4-unknown-linux-gnu/gcc-3.3-glibc-2.3.2/build-glibc/misc/ustat.o] Error 1 +make[2]: Leaving directory `/home3/dank/crosstool-0.7/build/sh4-unknown-linux-gnu/gcc-3.3-glibc-2.3.2/glibc-2.3.2/misc' +make[1]: *** [misc/subdir_lib] Error 2 +make[1]: Leaving directory `/home3/dank/crosstool-0.7/build/sh4-unknown-linux-gnu/gcc-3.3-glibc-2.3.2/glibc-2.3.2' +make: *** [all] Error 2 + +----------- snip --------------- + +Date: Fri, 06 Jun 2003 08:00:00 +0900 +From: kaz Kojima +Subject: [linux-sh:02770] Re: Compiling glibc-2.3.2 for sh4 fails with "include/asm/user.h:32: + error: redefinition of `struct user_fpu_struct'" +To: linux-sh@m17n.org +Message-Id: <200306052250.h55Moeb08707@r-rr.iij4u.or.jp> + +Hi, + +Dan Kegel wrote: +> When I try to build glibc-2.3.2 for sh4, it fails with the error +[snip] +> /home3/dank/crosstool-0.3/result/sh4-linux/gcc-3.3-glibc-2.3.2/sh4-linux/include/asm/user.h:32: error: redefinition of `struct user_fpu_struct' +> /home3/dank/crosstool-0.3/result/sh4-linux/gcc-3.3-glibc-2.3.2/sh4-linux/include/asm/user.h:39: error: redefinition of `struct user' +[snip] +> The error reminds me of the kind of thing fixed by +> http://www.kegel.com/crossgcc/crosstool-0.4/glibc-2.3.2-patches/sh-user.patch + +It seems that the definitions in asm/user.h and the above patch collide. +I'm not sure why you need this patch, but is it needed for the problem +about struct ustat that you pointed out in this list, isn't it? +I found why I don't hit ustat problem - my local kernel tree includes +the following patch, though I can't recall about it. + +Regards, + kaz +-- +diff -u linux-2.5.69-sf-orig/include/linux/types.h /usr/local/sh4-unknown-linux-gnu/include/linux/types.h +--- linux-2.5.69-sf-orig/include/linux/types.h Wed Mar 5 12:29:34 2003 ++++ sh4-unknown-linux-gnu/include/linux/types.h Sat Apr 19 10:05:52 2003 +@@ -141,6 +141,7 @@ + + #endif /* __KERNEL_STRICT_NAMES */ + ++#ifdef __KERNEL__ + /* + * Below are truly Linux-specific types that should never collide with + * any application/library that wants linux/types.h. +@@ -152,5 +153,6 @@ + char f_fname[6]; + char f_fpack[6]; + }; ++#endif + + #endif /* _LINUX_TYPES_H */ + + diff --git a/patches/linux/2.4.26/120-linux-2.4.21-allow-gcc-3.3-arm-lib.patch b/patches/linux/2.4.26/120-linux-2.4.21-allow-gcc-3.3-arm-lib.patch new file mode 100644 index 0000000..8f8ddd6 --- /dev/null +++ b/patches/linux/2.4.26/120-linux-2.4.21-allow-gcc-3.3-arm-lib.patch @@ -0,0 +1,203 @@ +Reconstructed from http://lists.arm.linux.org.uk/pipermail/linux-arm-kernel/2003-December/018647.html +See also http://www.arm.linux.org.uk/developer/patches/viewpatch.php?id=1540 + +Message-ID: +Subject: Help cross compiling the kernel for arm. +From: dirk.behme at de.bosch.com + +Aitor Garcia wrote: +> Hello everybody, +> +> I am having problems cross compiling the kernel for arm. +> +> This is the error message I get: +> +> blkpg.c: In function `blk_ioctl': +> blkpg.c:252: error: asm-specifier for variable `__r1' conflicts with asm clobber list +> blkpg.c:252: confused by earlier errors, bailing out make[3]: *** [blkpg.o] Error 1 +> make[3]: Leaving directory `/root/toolchain/kernel-arm/linux-2.4.21/drivers/block' +> make[2]: *** [first_rule] Error 2 +> make[2]: Leaving directory `/root/toolchain/kernel-arm/linux-2.4.21/drivers/block' +> make[1]: *** [_subdir_block] Error 2 +> make[1]: Leaving directory `/root/toolchain/kernel-arm/linux-2.4.21/drivers' +> make: *** [_dir_drivers] Error 2 +> +> These are the toolchain versions I am using: +> host=i686-pc-linux-gnu +> binutils_version=2.14 +> gcc_version=3.3.2 +> glibc_version=2.3.2 +> kernel_version=2.4.21 +> and applied the kernel patch for arm. 2.4.21-rmk1. +> ... +> I have also seen references to this bug in ARM linux +> Developer. Patch Number = 1540. But this patch is +> classified as discarded. + +You need something like 1540 to compile 2.4.21 with gcc 3.3.2. 1540 was +discarded because of AFLAGS change. + +Try the attachment. + +Dirk +-------------- next part -------------- +--- linux/arch/arm/lib/getuser.S.orig Mon Nov 17 07:41:51 2003 ++++ linux/arch/arm/lib/getuser.S Mon Nov 17 07:43:16 2003 +@@ -17,7 +17,7 @@ + * + * Inputs: r0 contains the address + * Outputs: r0 is the error code +- * r1, r2 contains the zero-extended value ++ * r1, ip contains the zero-extended value + * lr corrupted + * + * No other registers must be altered. (see include/asm-arm/uaccess.h +@@ -42,14 +42,14 @@ __get_user_1: + + .global __get_user_2 + __get_user_2: +- bic r2, sp, #0x1f00 +- bic r2, r2, #0x00ff +- ldr r2, [r2, #TSK_ADDR_LIMIT] +- sub r2, r2, #2 +- cmp r0, r2 ++ bic ip, sp, #0x1f00 ++ bic ip, ip, #0x00ff ++ ldr ip, [ip, #TSK_ADDR_LIMIT] ++ sub ip, ip, #2 ++ cmp r0, ip + 2: ldrlsbt r1, [r0], #1 +-3: ldrlsbt r2, [r0] +- orrls r1, r1, r2, lsl #8 ++3: ldrlsbt ip, [r0] ++ orrls r1, r1, ip, lsl #8 + movls r0, #0 + movls pc, lr + b __get_user_bad +@@ -68,20 +68,20 @@ __get_user_4: + + .global __get_user_8 + __get_user_8: +- bic r2, sp, #0x1f00 +- bic r2, r2, #0x00ff +- ldr r2, [r2, #TSK_ADDR_LIMIT] +- sub r2, r2, #8 +- cmp r0, r2 ++ bic ip, sp, #0x1f00 ++ bic ip, ip, #0x00ff ++ ldr ip, [ip, #TSK_ADDR_LIMIT] ++ sub ip, ip, #8 ++ cmp r0, ip + 5: ldrlst r1, [r0], #4 +-6: ldrlst r2, [r0] ++6: ldrlst ip, [r0] + movls r0, #0 + movls pc, lr + + /* fall through */ + + __get_user_bad_8: +- mov r2, #0 ++ mov ip, #0 + __get_user_bad: + mov r1, #0 + mov r0, #-14 +--- linux/arch/arm/lib/putuser.S.orig Mon Nov 17 07:41:57 2003 ++++ linux/arch/arm/lib/putuser.S Mon Nov 17 07:42:26 2003 +@@ -16,7 +16,7 @@ + * __put_user_X + * + * Inputs: r0 contains the address +- * r1, r2 contains the value ++ * r1, ip contains the value + * Outputs: r0 is the error code + * lr corrupted + * +@@ -30,11 +30,11 @@ + + .global __put_user_1 + __put_user_1: +- bic r2, sp, #0x1f00 +- bic r2, r2, #0x00ff +- ldr r2, [r2, #TSK_ADDR_LIMIT] +- sub r2, r2, #1 +- cmp r0, r2 ++ bic ip, sp, #0x1f00 ++ bic ip, ip, #0x00ff ++ ldr ip, [ip, #TSK_ADDR_LIMIT] ++ sub ip, ip, #1 ++ cmp r0, ip + 1: strlsbt r1, [r0] + movls r0, #0 + movls pc, lr +@@ -42,11 +42,11 @@ __put_user_1: + + .global __put_user_2 + __put_user_2: +- bic r2, sp, #0x1f00 +- bic r2, r2, #0x00ff +- ldr r2, [r2, #TSK_ADDR_LIMIT] +- sub r2, r2, #2 +- cmp r0, r2 ++ bic ip, sp, #0x1f00 ++ bic ip, ip, #0x00ff ++ ldr ip, [ip, #TSK_ADDR_LIMIT] ++ sub ip, ip, #2 ++ cmp r0, ip + 2: strlsbt r1, [r0], #1 + movls r1, r1, lsr #8 + 3: strlsbt r1, [r0] +@@ -56,11 +56,11 @@ __put_user_2: + + .global __put_user_4 + __put_user_4: +- bic r2, sp, #0x1f00 +- bic r2, r2, #0x00ff +- ldr r2, [r2, #TSK_ADDR_LIMIT] +- sub r2, r2, #4 +- cmp r0, r2 ++ bic ip, sp, #0x1f00 ++ bic ip, ip, #0x00ff ++ ldr ip, [ip, #TSK_ADDR_LIMIT] ++ sub ip, ip, #4 ++ cmp r0, ip + 4: strlst r1, [r0] + movls r0, #0 + movls pc, lr +@@ -74,7 +74,7 @@ __put_user_8: + sub ip, ip, #8 + cmp r0, ip + 5: strlst r1, [r0], #4 +-6: strlst r2, [r0] ++6: strlst ip, [r0] + movls r0, #0 + movls pc, lr + +--- linux/include/asm-arm/uaccess.h.orig Mon Nov 17 07:41:04 2003 ++++ linux/include/asm-arm/uaccess.h Mon Nov 17 07:41:37 2003 +@@ -86,7 +86,7 @@ extern int __get_user_bad(void); + __get_user_x(__r1, __p, __e, 1, "lr"); \ + break; \ + case 2: \ +- __get_user_x(__r1, __p, __e, 2, "r2", "lr"); \ ++ __get_user_x(__r1, __p, __e, 2, "ip", "lr"); \ + break; \ + case 4: \ + __get_user_x(__r1, __p, __e, 4, "lr"); \ +@@ -122,13 +122,13 @@ extern int __put_user_bad(void); + register int __e asm("r0"); \ + switch (sizeof(*(p))) { \ + case 1: \ +- __put_user_x(__r1, __p, __e, 1, "r2", "lr"); \ ++ __put_user_x(__r1, __p, __e, 1, "ip", "lr"); \ + break; \ + case 2: \ +- __put_user_x(__r1, __p, __e, 2, "r2", "lr"); \ ++ __put_user_x(__r1, __p, __e, 2, "ip", "lr"); \ + break; \ + case 4: \ +- __put_user_x(__r1, __p, __e, 4, "r2", "lr"); \ ++ __put_user_x(__r1, __p, __e, 4, "ip", "lr"); \ + break; \ + case 8: \ + __put_user_x(__r1, __p, __e, 8, "ip", "lr"); \ diff --git a/patches/linux/2.4.26/130-linux-2.4.26-allow-gcc-3.4-arm-kernel.patch b/patches/linux/2.4.26/130-linux-2.4.26-allow-gcc-3.4-arm-kernel.patch new file mode 100644 index 0000000..384926d --- /dev/null +++ b/patches/linux/2.4.26/130-linux-2.4.26-allow-gcc-3.4-arm-kernel.patch @@ -0,0 +1,23 @@ +Fixes +semaphore.c:180:5: missing terminating " character +semaphore.c:213:9: missing terminating " character +make[1]: *** [semaphore.o] Error 1 +make[1]: Leaving directory `/home/dank/queue/jobdir.fast/crosstool-dev/build/arm-unknown-linux-gnu/gcc-3.3.4-glibc-2.2.5/linux-2.4.26/arch/arm/kernel' +make: *** [_dir_arch/arm/kernel] Error 2 + +when building kernel.org 2.4.26 for arm with gcc-3.3.x +(Note: one probably wants to apply ftp://ftp.arm.linux.org.uk/pub/armlinux/source/kernel-patches/v2.4/patch-2.4.26-vrs1.bz2 +instead of my patches when really building 2.4.26 for arm; +my patches only include the bare minimum to get the vanilla kernel to compile.) + +--- linux-2.4.26/arch/arm/kernel/semaphore.c.old Mon Mar 21 06:50:38 2005 ++++ linux-2.4.26/arch/arm/kernel/semaphore.c Mon Mar 21 06:50:55 2005 +@@ -193,7 +193,7 @@ + bl __down_interruptible \n\ + mov ip, r0 \n\ + ldmfd sp!, {r0 - r3, pc}^ \n\ +- ++ \n\ + .align 5 \n\ + .globl __down_trylock_failed \n\ + __down_trylock_failed: \n\ diff --git a/patches/linux/2.4.26/140-linux-2.4.26-arm-nonofpu.patch b/patches/linux/2.4.26/140-linux-2.4.26-arm-nonofpu.patch new file mode 100644 index 0000000..1dd0b5e --- /dev/null +++ b/patches/linux/2.4.26/140-linux-2.4.26-arm-nonofpu.patch @@ -0,0 +1,40 @@ +Backport of linux-2.6.8-arm-nonofpu.patch. +Fixes error when building linux-2.4.26 kernel with gcc-3.4 on arm. + +/opt/crosstool/arm-unknown-linux-gnu/gcc-3.4.2-glibc-2.2.5/bin/arm-unknown-linux-gnu-gcc -D__KERNEL__ -I/home/dank/wk/crosstool-0.28-rc37/build/arm-unknown-linux-gnu/gcc-3.4.2-glibc-2.2.5/linux-2.4.26/include -Wall -Wstrict-prototypes -Wno-trigraphs -Os -fno-strict-aliasing -fno-common -Uarm -fno-common -pipe -mapcs-32 -D__LINUX_ARM_ARCH__=4 -march=armv4 -mtune=strongarm110 -mshort-load-bytes -msoft-float -Uarm -S -o constants.h.tmp.1 getconstants.c +cc1: error: invalid option `short-load-bytes' +make[2]: *** [constants.h] Error 1 +make[2]: Leaving directory `/home/dank/wk/crosstool-0.28-rc37/build/arm-unknown-linux-gnu/gcc-3.4.2-glibc-2.2.5/linux-2.4.26/arch/arm/tools' +make[1]: *** [dep] Error 2 +make[1]: Leaving directory `/home/dank/wk/crosstool-0.28-rc37/build/arm-unknown-linux-gnu/gcc-3.4.2-glibc-2.2.5/linux-2.4.26/arch/arm/tools' +make: *** [archdep] Error 2 + + +--- linux-2.4.26/Makefile.old Thu Sep 30 23:21:14 2004 ++++ linux-2.4.26/Makefile Thu Sep 30 23:24:12 2004 +@@ -21,6 +21,10 @@ + + CROSS_COMPILE = + ++# From linux-2.6 ++check_gcc = $(shell if $(CC) $(CFLAGS) $(1) -S -o /dev/null -xc /dev/null > /dev/null 2>&1; then echo "$(1)"; else echo "$(2)"; fi ;) ++export check_gcc ++ + # + # Include the make variables (CC, etc...) + # +--- linux-2.4.26/arch/arm/Makefile.old Thu Sep 30 23:16:49 2004 ++++ linux-2.4.26/arch/arm/Makefile Thu Sep 30 23:25:27 2004 +@@ -50,9 +50,9 @@ + tune-$(CONFIG_CPU_SA110) :=-mtune=strongarm110 + tune-$(CONFIG_CPU_SA1100) :=-mtune=strongarm1100 + +-CFLAGS_BOOT :=$(apcs-y) $(arch-y) $(tune-y) -mshort-load-bytes -msoft-float -Uarm +-CFLAGS +=$(apcs-y) $(arch-y) $(tune-y) -mshort-load-bytes -msoft-float -Uarm +-AFLAGS +=$(apcs-y) $(arch-y) -mno-fpu -msoft-float ++CFLAGS_BOOT :=$(apcs-y) $(arch-y) $(tune-y) $(call check_gcc,-malignment-traps,-mshort-load-bytes) -msoft-float -Uarm ++CFLAGS +=$(apcs-y) $(arch-y) $(tune-y) $(call check_gcc,-malignment-traps,-mshort-load-bytes) -msoft-float -Uarm ++AFLAGS +=$(apcs-y) $(arch-y) -msoft-float + + ifeq ($(CONFIG_CPU_26),y) + PROCESSOR := armo diff --git a/patches/linux/2.4.26/150-linux-2.4.26-mkdep-xargs.patch b/patches/linux/2.4.26/150-linux-2.4.26-mkdep-xargs.patch new file mode 100644 index 0000000..60c68ef --- /dev/null +++ b/patches/linux/2.4.26/150-linux-2.4.26-mkdep-xargs.patch @@ -0,0 +1,28 @@ +About ten times, various people have noticed that 'make dep' uses +really, really long commandlines. This breaks sh even on linux sometimes. + +For 2.4, see e.g. +http://marc.theaimsgroup.com/?l=linux-kernel&m=96589814004919&w=2 +http://marc.theaimsgroup.com/?l=linux-kernel&m=96589814004919&q=p3 +http://www.xraylith.wisc.edu/~khan/software/gnu-win32/cygwin-to-linux-cross-howto.txt +http://www.uclinux.org/pub/uClinux/archive/1728.html + +Fixes error when building linux kernel for some default arm configurations: + +scripts/mkdep -- `find /home/dank/wk/crosstool-0.28-rc36/build/arm-unknown-linux-gnu/gcc-3.3.4-glibc-2.3.2/linux-2.4.26/include/asm /home/dank/wk/crosstool-0.28-rc36/build/arm-unknown-linux-gnu/gcc-3.3.4-glibc-2.3.2/linux-2.4.26/include/linux /home/dank/wk/crosstool-0.28-rc36/build/arm-unknown-linux-gnu/gcc-3.3.4-glibc-2.3.2/linux-2.4.26/include/scsi /home/dank/wk/crosstool-0.28-rc36/build/arm-unknown-linux-gnu/gcc-3.3.4-glibc-2.3.2/linux-2.4.26/include/net /home/dank/wk/crosstool-0.28-rc36/build/arm-unknown-linux-gnu/gcc-3.3.4-glibc-2.3.2/linux-2.4.26/include/math-emu \( -name SCCS -o -name .svn \) -prune -o -follow -name \*.h ! -name modversions.h -print` > .hdepend +/bin/sh: line 1: scripts/mkdep: Argument list too long +make: *** [dep-files] Error 126 + +[ For linux-2.4.26 ] + +--- linux-2.4.26/Makefile.old 2004-04-14 06:05:41.000000000 -0700 ++++ linux-2.4.26/Makefile 2004-09-13 21:27:39.000000000 -0700 +@@ -500,7 +500,7 @@ + ifdef CONFIG_MODVERSIONS + $(MAKE) update-modverfile + endif +- scripts/mkdep -- `find $(FINDHPATH) \( -name SCCS -o -name .svn \) -prune -o -follow -name \*.h ! -name modversions.h -print` > .hdepend ++ find $(FINDHPATH) \( -name SCCS -o -name .svn \) -prune -o -follow -name \*.h ! -name modversions.h -print | xargs scripts/mkdep | cat > .hdepend + scripts/mkdep -- init/*.c > .depend + + ifdef CONFIG_MODVERSIONS diff --git a/patches/linux/2.4.26/160-linux-2.4.26-wdt977-uaccess.patch b/patches/linux/2.4.26/160-linux-2.4.26-wdt977-uaccess.patch new file mode 100644 index 0000000..3dc0a48 --- /dev/null +++ b/patches/linux/2.4.26/160-linux-2.4.26-wdt977-uaccess.patch @@ -0,0 +1,17 @@ +Fixes drivers/char/char.o(.text+0x178a4): In function `$a': +: undefined reference to `get_user' + +Part of ftp://ftp.arm.linux.org.uk/pub/armlinux/source/kernel-patches/v2.4/patch-2.4.26-vrs1.bz2 + +diff -urN linux-2.4.26/drivers/char/wdt977.c linux-2.4.26-vrs1/drivers/char/wdt977.c +--- linux-2.4.26/drivers/char/wdt977.c 2002-11-28 23:53:12.000000000 +0000 ++++ linux-2.4.26-vrs1/drivers/char/wdt977.c 2004-01-14 21:32:25.000000000 +0000 +@@ -27,6 +27,7 @@ + #include + #include + #include ++#include + + #define WATCHDOG_MINOR 130 + + diff --git a/patches/linux/2.4.26/170-linux-2.4-bsd-expr.patch b/patches/linux/2.4.26/170-linux-2.4-bsd-expr.patch new file mode 100644 index 0000000..17625e5 --- /dev/null +++ b/patches/linux/2.4.26/170-linux-2.4-bsd-expr.patch @@ -0,0 +1,25 @@ +# http://in3www.epfl.ch/~schaffne/linux-2.4-bsd-expr.patch +The following makes it possible to compile linux 2.4.19 to 2.4.25 on Mac OS X, +where "expr" doesn't understand the "length" construct +(which it doesn't have to, according to SuSv3 +(see http://www.opengroup.org/onlinepubs/007904975/utilities/expr.html) +See also http://sources.redhat.com/ml/crossgcc/2004-02/msg00131.html + +Fixes error + expr: syntax error + KERNELRELEASE "2.4.21" exceeds 64 characters + make: *** [include/linux/version.h] Error 1 + + +diff -ur linux-2.4.23-old/Makefile linux-2.4.23/Makefile +--- linux-2.4.23-old/Makefile 2003-12-09 14:27:56.000000000 +0100 ++++ linux-2.4.23/Makefile 2003-12-09 14:28:37.000000000 +0100 +@@ -353,7 +353,7 @@ + @rm -f .ver1 + + include/linux/version.h: ./Makefile +- @expr length "$(KERNELRELEASE)" \<= $(uts_len) > /dev/null || \ ++ @expr "$(KERNELRELEASE)" : '.*' \<= $(uts_len) > /dev/null || \ + (echo KERNELRELEASE \"$(KERNELRELEASE)\" exceeds $(uts_len) characters >&2; false) + @echo \#define UTS_RELEASE \"$(KERNELRELEASE)\" > .ver + @echo \#define LINUX_VERSION_CODE `expr $(VERSION) \\* 65536 + $(PATCHLEVEL) \\* 256 + $(SUBLEVEL)` >> .ver diff --git a/patches/linux/2.4.26/kaz-types.patch b/patches/linux/2.4.26/kaz-types.patch deleted file mode 100644 index ec5de36..0000000 --- a/patches/linux/2.4.26/kaz-types.patch +++ /dev/null @@ -1,60 +0,0 @@ -The following fixes an error that occurs when building glibc-2.3.2 (but not glibc-2.2.5) for sh4: - -In file included from sys/ustat.h:30, - from ../sysdeps/unix/sysv/linux/ustat.c:21: -../sysdeps/generic/bits/ustat.h:26: error: redefinition of `struct ustat' -make[2]: *** [/home3/dank/crosstool-0.7/build/sh4-unknown-linux-gnu/gcc-3.3-glibc-2.3.2/build-glibc/misc/ustat.o] Error 1 -make[2]: Leaving directory `/home3/dank/crosstool-0.7/build/sh4-unknown-linux-gnu/gcc-3.3-glibc-2.3.2/glibc-2.3.2/misc' -make[1]: *** [misc/subdir_lib] Error 2 -make[1]: Leaving directory `/home3/dank/crosstool-0.7/build/sh4-unknown-linux-gnu/gcc-3.3-glibc-2.3.2/glibc-2.3.2' -make: *** [all] Error 2 - ------------ snip --------------- - -Date: Fri, 06 Jun 2003 08:00:00 +0900 -From: kaz Kojima -Subject: [linux-sh:02770] Re: Compiling glibc-2.3.2 for sh4 fails with "include/asm/user.h:32: - error: redefinition of `struct user_fpu_struct'" -To: linux-sh@m17n.org -Message-Id: <200306052250.h55Moeb08707@r-rr.iij4u.or.jp> - -Hi, - -Dan Kegel wrote: -> When I try to build glibc-2.3.2 for sh4, it fails with the error -[snip] -> /home3/dank/crosstool-0.3/result/sh4-linux/gcc-3.3-glibc-2.3.2/sh4-linux/include/asm/user.h:32: error: redefinition of `struct user_fpu_struct' -> /home3/dank/crosstool-0.3/result/sh4-linux/gcc-3.3-glibc-2.3.2/sh4-linux/include/asm/user.h:39: error: redefinition of `struct user' -[snip] -> The error reminds me of the kind of thing fixed by -> http://www.kegel.com/crossgcc/crosstool-0.4/glibc-2.3.2-patches/sh-user.patch - -It seems that the definitions in asm/user.h and the above patch collide. -I'm not sure why you need this patch, but is it needed for the problem -about struct ustat that you pointed out in this list, isn't it? -I found why I don't hit ustat problem - my local kernel tree includes -the following patch, though I can't recall about it. - -Regards, - kaz --- -diff -u linux-2.5.69-sf-orig/include/linux/types.h /usr/local/sh4-unknown-linux-gnu/include/linux/types.h ---- linux-2.5.69-sf-orig/include/linux/types.h Wed Mar 5 12:29:34 2003 -+++ sh4-unknown-linux-gnu/include/linux/types.h Sat Apr 19 10:05:52 2003 -@@ -141,6 +141,7 @@ - - #endif /* __KERNEL_STRICT_NAMES */ - -+#ifdef __KERNEL__ - /* - * Below are truly Linux-specific types that should never collide with - * any application/library that wants linux/types.h. -@@ -152,5 +153,6 @@ - char f_fname[6]; - char f_fpack[6]; - }; -+#endif - - #endif /* _LINUX_TYPES_H */ - - diff --git a/patches/linux/2.4.26/linux-2.4-bsd-expr.patch b/patches/linux/2.4.26/linux-2.4-bsd-expr.patch deleted file mode 100644 index 17625e5..0000000 --- a/patches/linux/2.4.26/linux-2.4-bsd-expr.patch +++ /dev/null @@ -1,25 +0,0 @@ -# http://in3www.epfl.ch/~schaffne/linux-2.4-bsd-expr.patch -The following makes it possible to compile linux 2.4.19 to 2.4.25 on Mac OS X, -where "expr" doesn't understand the "length" construct -(which it doesn't have to, according to SuSv3 -(see http://www.opengroup.org/onlinepubs/007904975/utilities/expr.html) -See also http://sources.redhat.com/ml/crossgcc/2004-02/msg00131.html - -Fixes error - expr: syntax error - KERNELRELEASE "2.4.21" exceeds 64 characters - make: *** [include/linux/version.h] Error 1 - - -diff -ur linux-2.4.23-old/Makefile linux-2.4.23/Makefile ---- linux-2.4.23-old/Makefile 2003-12-09 14:27:56.000000000 +0100 -+++ linux-2.4.23/Makefile 2003-12-09 14:28:37.000000000 +0100 -@@ -353,7 +353,7 @@ - @rm -f .ver1 - - include/linux/version.h: ./Makefile -- @expr length "$(KERNELRELEASE)" \<= $(uts_len) > /dev/null || \ -+ @expr "$(KERNELRELEASE)" : '.*' \<= $(uts_len) > /dev/null || \ - (echo KERNELRELEASE \"$(KERNELRELEASE)\" exceeds $(uts_len) characters >&2; false) - @echo \#define UTS_RELEASE \"$(KERNELRELEASE)\" > .ver - @echo \#define LINUX_VERSION_CODE `expr $(VERSION) \\* 65536 + $(PATCHLEVEL) \\* 256 + $(SUBLEVEL)` >> .ver diff --git a/patches/linux/2.4.26/linux-2.4.21-allow-gcc-3.3-arm-lib.patch b/patches/linux/2.4.26/linux-2.4.21-allow-gcc-3.3-arm-lib.patch deleted file mode 100644 index 8f8ddd6..0000000 --- a/patches/linux/2.4.26/linux-2.4.21-allow-gcc-3.3-arm-lib.patch +++ /dev/null @@ -1,203 +0,0 @@ -Reconstructed from http://lists.arm.linux.org.uk/pipermail/linux-arm-kernel/2003-December/018647.html -See also http://www.arm.linux.org.uk/developer/patches/viewpatch.php?id=1540 - -Message-ID: -Subject: Help cross compiling the kernel for arm. -From: dirk.behme at de.bosch.com - -Aitor Garcia wrote: -> Hello everybody, -> -> I am having problems cross compiling the kernel for arm. -> -> This is the error message I get: -> -> blkpg.c: In function `blk_ioctl': -> blkpg.c:252: error: asm-specifier for variable `__r1' conflicts with asm clobber list -> blkpg.c:252: confused by earlier errors, bailing out make[3]: *** [blkpg.o] Error 1 -> make[3]: Leaving directory `/root/toolchain/kernel-arm/linux-2.4.21/drivers/block' -> make[2]: *** [first_rule] Error 2 -> make[2]: Leaving directory `/root/toolchain/kernel-arm/linux-2.4.21/drivers/block' -> make[1]: *** [_subdir_block] Error 2 -> make[1]: Leaving directory `/root/toolchain/kernel-arm/linux-2.4.21/drivers' -> make: *** [_dir_drivers] Error 2 -> -> These are the toolchain versions I am using: -> host=i686-pc-linux-gnu -> binutils_version=2.14 -> gcc_version=3.3.2 -> glibc_version=2.3.2 -> kernel_version=2.4.21 -> and applied the kernel patch for arm. 2.4.21-rmk1. -> ... -> I have also seen references to this bug in ARM linux -> Developer. Patch Number = 1540. But this patch is -> classified as discarded. - -You need something like 1540 to compile 2.4.21 with gcc 3.3.2. 1540 was -discarded because of AFLAGS change. - -Try the attachment. - -Dirk --------------- next part -------------- ---- linux/arch/arm/lib/getuser.S.orig Mon Nov 17 07:41:51 2003 -+++ linux/arch/arm/lib/getuser.S Mon Nov 17 07:43:16 2003 -@@ -17,7 +17,7 @@ - * - * Inputs: r0 contains the address - * Outputs: r0 is the error code -- * r1, r2 contains the zero-extended value -+ * r1, ip contains the zero-extended value - * lr corrupted - * - * No other registers must be altered. (see include/asm-arm/uaccess.h -@@ -42,14 +42,14 @@ __get_user_1: - - .global __get_user_2 - __get_user_2: -- bic r2, sp, #0x1f00 -- bic r2, r2, #0x00ff -- ldr r2, [r2, #TSK_ADDR_LIMIT] -- sub r2, r2, #2 -- cmp r0, r2 -+ bic ip, sp, #0x1f00 -+ bic ip, ip, #0x00ff -+ ldr ip, [ip, #TSK_ADDR_LIMIT] -+ sub ip, ip, #2 -+ cmp r0, ip - 2: ldrlsbt r1, [r0], #1 --3: ldrlsbt r2, [r0] -- orrls r1, r1, r2, lsl #8 -+3: ldrlsbt ip, [r0] -+ orrls r1, r1, ip, lsl #8 - movls r0, #0 - movls pc, lr - b __get_user_bad -@@ -68,20 +68,20 @@ __get_user_4: - - .global __get_user_8 - __get_user_8: -- bic r2, sp, #0x1f00 -- bic r2, r2, #0x00ff -- ldr r2, [r2, #TSK_ADDR_LIMIT] -- sub r2, r2, #8 -- cmp r0, r2 -+ bic ip, sp, #0x1f00 -+ bic ip, ip, #0x00ff -+ ldr ip, [ip, #TSK_ADDR_LIMIT] -+ sub ip, ip, #8 -+ cmp r0, ip - 5: ldrlst r1, [r0], #4 --6: ldrlst r2, [r0] -+6: ldrlst ip, [r0] - movls r0, #0 - movls pc, lr - - /* fall through */ - - __get_user_bad_8: -- mov r2, #0 -+ mov ip, #0 - __get_user_bad: - mov r1, #0 - mov r0, #-14 ---- linux/arch/arm/lib/putuser.S.orig Mon Nov 17 07:41:57 2003 -+++ linux/arch/arm/lib/putuser.S Mon Nov 17 07:42:26 2003 -@@ -16,7 +16,7 @@ - * __put_user_X - * - * Inputs: r0 contains the address -- * r1, r2 contains the value -+ * r1, ip contains the value - * Outputs: r0 is the error code - * lr corrupted - * -@@ -30,11 +30,11 @@ - - .global __put_user_1 - __put_user_1: -- bic r2, sp, #0x1f00 -- bic r2, r2, #0x00ff -- ldr r2, [r2, #TSK_ADDR_LIMIT] -- sub r2, r2, #1 -- cmp r0, r2 -+ bic ip, sp, #0x1f00 -+ bic ip, ip, #0x00ff -+ ldr ip, [ip, #TSK_ADDR_LIMIT] -+ sub ip, ip, #1 -+ cmp r0, ip - 1: strlsbt r1, [r0] - movls r0, #0 - movls pc, lr -@@ -42,11 +42,11 @@ __put_user_1: - - .global __put_user_2 - __put_user_2: -- bic r2, sp, #0x1f00 -- bic r2, r2, #0x00ff -- ldr r2, [r2, #TSK_ADDR_LIMIT] -- sub r2, r2, #2 -- cmp r0, r2 -+ bic ip, sp, #0x1f00 -+ bic ip, ip, #0x00ff -+ ldr ip, [ip, #TSK_ADDR_LIMIT] -+ sub ip, ip, #2 -+ cmp r0, ip - 2: strlsbt r1, [r0], #1 - movls r1, r1, lsr #8 - 3: strlsbt r1, [r0] -@@ -56,11 +56,11 @@ __put_user_2: - - .global __put_user_4 - __put_user_4: -- bic r2, sp, #0x1f00 -- bic r2, r2, #0x00ff -- ldr r2, [r2, #TSK_ADDR_LIMIT] -- sub r2, r2, #4 -- cmp r0, r2 -+ bic ip, sp, #0x1f00 -+ bic ip, ip, #0x00ff -+ ldr ip, [ip, #TSK_ADDR_LIMIT] -+ sub ip, ip, #4 -+ cmp r0, ip - 4: strlst r1, [r0] - movls r0, #0 - movls pc, lr -@@ -74,7 +74,7 @@ __put_user_8: - sub ip, ip, #8 - cmp r0, ip - 5: strlst r1, [r0], #4 --6: strlst r2, [r0] -+6: strlst ip, [r0] - movls r0, #0 - movls pc, lr - ---- linux/include/asm-arm/uaccess.h.orig Mon Nov 17 07:41:04 2003 -+++ linux/include/asm-arm/uaccess.h Mon Nov 17 07:41:37 2003 -@@ -86,7 +86,7 @@ extern int __get_user_bad(void); - __get_user_x(__r1, __p, __e, 1, "lr"); \ - break; \ - case 2: \ -- __get_user_x(__r1, __p, __e, 2, "r2", "lr"); \ -+ __get_user_x(__r1, __p, __e, 2, "ip", "lr"); \ - break; \ - case 4: \ - __get_user_x(__r1, __p, __e, 4, "lr"); \ -@@ -122,13 +122,13 @@ extern int __put_user_bad(void); - register int __e asm("r0"); \ - switch (sizeof(*(p))) { \ - case 1: \ -- __put_user_x(__r1, __p, __e, 1, "r2", "lr"); \ -+ __put_user_x(__r1, __p, __e, 1, "ip", "lr"); \ - break; \ - case 2: \ -- __put_user_x(__r1, __p, __e, 2, "r2", "lr"); \ -+ __put_user_x(__r1, __p, __e, 2, "ip", "lr"); \ - break; \ - case 4: \ -- __put_user_x(__r1, __p, __e, 4, "r2", "lr"); \ -+ __put_user_x(__r1, __p, __e, 4, "ip", "lr"); \ - break; \ - case 8: \ - __put_user_x(__r1, __p, __e, 8, "ip", "lr"); \ diff --git a/patches/linux/2.4.26/linux-2.4.26-allow-gcc-3.4-arm-kernel.patch b/patches/linux/2.4.26/linux-2.4.26-allow-gcc-3.4-arm-kernel.patch deleted file mode 100644 index 384926d..0000000 --- a/patches/linux/2.4.26/linux-2.4.26-allow-gcc-3.4-arm-kernel.patch +++ /dev/null @@ -1,23 +0,0 @@ -Fixes -semaphore.c:180:5: missing terminating " character -semaphore.c:213:9: missing terminating " character -make[1]: *** [semaphore.o] Error 1 -make[1]: Leaving directory `/home/dank/queue/jobdir.fast/crosstool-dev/build/arm-unknown-linux-gnu/gcc-3.3.4-glibc-2.2.5/linux-2.4.26/arch/arm/kernel' -make: *** [_dir_arch/arm/kernel] Error 2 - -when building kernel.org 2.4.26 for arm with gcc-3.3.x -(Note: one probably wants to apply ftp://ftp.arm.linux.org.uk/pub/armlinux/source/kernel-patches/v2.4/patch-2.4.26-vrs1.bz2 -instead of my patches when really building 2.4.26 for arm; -my patches only include the bare minimum to get the vanilla kernel to compile.) - ---- linux-2.4.26/arch/arm/kernel/semaphore.c.old Mon Mar 21 06:50:38 2005 -+++ linux-2.4.26/arch/arm/kernel/semaphore.c Mon Mar 21 06:50:55 2005 -@@ -193,7 +193,7 @@ - bl __down_interruptible \n\ - mov ip, r0 \n\ - ldmfd sp!, {r0 - r3, pc}^ \n\ -- -+ \n\ - .align 5 \n\ - .globl __down_trylock_failed \n\ - __down_trylock_failed: \n\ diff --git a/patches/linux/2.4.26/linux-2.4.26-arm-nonofpu.patch b/patches/linux/2.4.26/linux-2.4.26-arm-nonofpu.patch deleted file mode 100644 index 1dd0b5e..0000000 --- a/patches/linux/2.4.26/linux-2.4.26-arm-nonofpu.patch +++ /dev/null @@ -1,40 +0,0 @@ -Backport of linux-2.6.8-arm-nonofpu.patch. -Fixes error when building linux-2.4.26 kernel with gcc-3.4 on arm. - -/opt/crosstool/arm-unknown-linux-gnu/gcc-3.4.2-glibc-2.2.5/bin/arm-unknown-linux-gnu-gcc -D__KERNEL__ -I/home/dank/wk/crosstool-0.28-rc37/build/arm-unknown-linux-gnu/gcc-3.4.2-glibc-2.2.5/linux-2.4.26/include -Wall -Wstrict-prototypes -Wno-trigraphs -Os -fno-strict-aliasing -fno-common -Uarm -fno-common -pipe -mapcs-32 -D__LINUX_ARM_ARCH__=4 -march=armv4 -mtune=strongarm110 -mshort-load-bytes -msoft-float -Uarm -S -o constants.h.tmp.1 getconstants.c -cc1: error: invalid option `short-load-bytes' -make[2]: *** [constants.h] Error 1 -make[2]: Leaving directory `/home/dank/wk/crosstool-0.28-rc37/build/arm-unknown-linux-gnu/gcc-3.4.2-glibc-2.2.5/linux-2.4.26/arch/arm/tools' -make[1]: *** [dep] Error 2 -make[1]: Leaving directory `/home/dank/wk/crosstool-0.28-rc37/build/arm-unknown-linux-gnu/gcc-3.4.2-glibc-2.2.5/linux-2.4.26/arch/arm/tools' -make: *** [archdep] Error 2 - - ---- linux-2.4.26/Makefile.old Thu Sep 30 23:21:14 2004 -+++ linux-2.4.26/Makefile Thu Sep 30 23:24:12 2004 -@@ -21,6 +21,10 @@ - - CROSS_COMPILE = - -+# From linux-2.6 -+check_gcc = $(shell if $(CC) $(CFLAGS) $(1) -S -o /dev/null -xc /dev/null > /dev/null 2>&1; then echo "$(1)"; else echo "$(2)"; fi ;) -+export check_gcc -+ - # - # Include the make variables (CC, etc...) - # ---- linux-2.4.26/arch/arm/Makefile.old Thu Sep 30 23:16:49 2004 -+++ linux-2.4.26/arch/arm/Makefile Thu Sep 30 23:25:27 2004 -@@ -50,9 +50,9 @@ - tune-$(CONFIG_CPU_SA110) :=-mtune=strongarm110 - tune-$(CONFIG_CPU_SA1100) :=-mtune=strongarm1100 - --CFLAGS_BOOT :=$(apcs-y) $(arch-y) $(tune-y) -mshort-load-bytes -msoft-float -Uarm --CFLAGS +=$(apcs-y) $(arch-y) $(tune-y) -mshort-load-bytes -msoft-float -Uarm --AFLAGS +=$(apcs-y) $(arch-y) -mno-fpu -msoft-float -+CFLAGS_BOOT :=$(apcs-y) $(arch-y) $(tune-y) $(call check_gcc,-malignment-traps,-mshort-load-bytes) -msoft-float -Uarm -+CFLAGS +=$(apcs-y) $(arch-y) $(tune-y) $(call check_gcc,-malignment-traps,-mshort-load-bytes) -msoft-float -Uarm -+AFLAGS +=$(apcs-y) $(arch-y) -msoft-float - - ifeq ($(CONFIG_CPU_26),y) - PROCESSOR := armo diff --git a/patches/linux/2.4.26/linux-2.4.26-mkdep-xargs.patch b/patches/linux/2.4.26/linux-2.4.26-mkdep-xargs.patch deleted file mode 100644 index 60c68ef..0000000 --- a/patches/linux/2.4.26/linux-2.4.26-mkdep-xargs.patch +++ /dev/null @@ -1,28 +0,0 @@ -About ten times, various people have noticed that 'make dep' uses -really, really long commandlines. This breaks sh even on linux sometimes. - -For 2.4, see e.g. -http://marc.theaimsgroup.com/?l=linux-kernel&m=96589814004919&w=2 -http://marc.theaimsgroup.com/?l=linux-kernel&m=96589814004919&q=p3 -http://www.xraylith.wisc.edu/~khan/software/gnu-win32/cygwin-to-linux-cross-howto.txt -http://www.uclinux.org/pub/uClinux/archive/1728.html - -Fixes error when building linux kernel for some default arm configurations: - -scripts/mkdep -- `find /home/dank/wk/crosstool-0.28-rc36/build/arm-unknown-linux-gnu/gcc-3.3.4-glibc-2.3.2/linux-2.4.26/include/asm /home/dank/wk/crosstool-0.28-rc36/build/arm-unknown-linux-gnu/gcc-3.3.4-glibc-2.3.2/linux-2.4.26/include/linux /home/dank/wk/crosstool-0.28-rc36/build/arm-unknown-linux-gnu/gcc-3.3.4-glibc-2.3.2/linux-2.4.26/include/scsi /home/dank/wk/crosstool-0.28-rc36/build/arm-unknown-linux-gnu/gcc-3.3.4-glibc-2.3.2/linux-2.4.26/include/net /home/dank/wk/crosstool-0.28-rc36/build/arm-unknown-linux-gnu/gcc-3.3.4-glibc-2.3.2/linux-2.4.26/include/math-emu \( -name SCCS -o -name .svn \) -prune -o -follow -name \*.h ! -name modversions.h -print` > .hdepend -/bin/sh: line 1: scripts/mkdep: Argument list too long -make: *** [dep-files] Error 126 - -[ For linux-2.4.26 ] - ---- linux-2.4.26/Makefile.old 2004-04-14 06:05:41.000000000 -0700 -+++ linux-2.4.26/Makefile 2004-09-13 21:27:39.000000000 -0700 -@@ -500,7 +500,7 @@ - ifdef CONFIG_MODVERSIONS - $(MAKE) update-modverfile - endif -- scripts/mkdep -- `find $(FINDHPATH) \( -name SCCS -o -name .svn \) -prune -o -follow -name \*.h ! -name modversions.h -print` > .hdepend -+ find $(FINDHPATH) \( -name SCCS -o -name .svn \) -prune -o -follow -name \*.h ! -name modversions.h -print | xargs scripts/mkdep | cat > .hdepend - scripts/mkdep -- init/*.c > .depend - - ifdef CONFIG_MODVERSIONS diff --git a/patches/linux/2.4.26/linux-2.4.26-wdt977-uaccess.patch b/patches/linux/2.4.26/linux-2.4.26-wdt977-uaccess.patch deleted file mode 100644 index 3dc0a48..0000000 --- a/patches/linux/2.4.26/linux-2.4.26-wdt977-uaccess.patch +++ /dev/null @@ -1,17 +0,0 @@ -Fixes drivers/char/char.o(.text+0x178a4): In function `$a': -: undefined reference to `get_user' - -Part of ftp://ftp.arm.linux.org.uk/pub/armlinux/source/kernel-patches/v2.4/patch-2.4.26-vrs1.bz2 - -diff -urN linux-2.4.26/drivers/char/wdt977.c linux-2.4.26-vrs1/drivers/char/wdt977.c ---- linux-2.4.26/drivers/char/wdt977.c 2002-11-28 23:53:12.000000000 +0000 -+++ linux-2.4.26-vrs1/drivers/char/wdt977.c 2004-01-14 21:32:25.000000000 +0000 -@@ -27,6 +27,7 @@ - #include - #include - #include -+#include - - #define WATCHDOG_MINOR 130 - - diff --git a/patches/linux/2.6.11.3/100-arch_alpha_kernel_srcons.patch b/patches/linux/2.6.11.3/100-arch_alpha_kernel_srcons.patch new file mode 100644 index 0000000..c163a1e --- /dev/null +++ b/patches/linux/2.6.11.3/100-arch_alpha_kernel_srcons.patch @@ -0,0 +1,134 @@ +Date: Sun, 20 Mar 2005 20:26:02 -0800 +From: Richard Henderson +To: Andrew Morton +Cc: Dan Kegel , jbglaw@lug-owl.de, + linux-kernel@vger.kernel.org, torvalds@osdl.org +Subject: Re: 2.6.11.3 build problem in arch/alpha/kernel/srcons.c with gcc-4.0 +Message-ID: <20050321042602.GA3795@twiddle.net> +Mail-Followup-To: Andrew Morton , Dan Kegel , + jbglaw@lug-owl.de, linux-kernel@vger.kernel.org, torvalds@osdl.org +References: <423E238F.3030805@kegel.com> <20050320190352.65cc1396.akpm@osdl.org> +Mime-Version: 1.0 +Content-Type: text/plain; charset=us-ascii +Content-Disposition: inline +In-Reply-To: <20050320190352.65cc1396.akpm@osdl.org> +User-Agent: Mutt/1.4.1i + +On Sun, Mar 20, 2005 at 07:03:52PM -0800, Andrew Morton wrote: +> Dan Kegel wrote: +> > +> > Anyone with an alpha care to suggest a fix for this? +> > +> > arch/alpha/kernel/srmcons.c: In function 'srmcons_open': +> > arch/alpha/kernel/srmcons.c:196: warning: 'srmconsp' may be used uninitialized in this function +> > make[1]: *** [arch/alpha/kernel/srmcons.o] Error 1 +> > make: *** [arch/alpha/kernel] Error 2 +> > +> > I get this when building the 2.6.11.3 kernel with a recent gcc-4.0 snapshot. +> > +> +> It's beyond gcc's ability to figure out that the code is OK. Options would +> be to disable -Werror, or to artificially initialise that variable. + +Fixed thus. + +Note that even with a _raw_read_trylock implementation, smp still +doesn't work. Everything that init spawns dies immediately. I +havn't had a chance to find out why yet... + +[ Note: deleted changes to smp.c, since they didn't apply cleanly + to 2.6.11.3 (the function had moved, I guess), and they seemed unrelated.] + +r~ + + + +You can import this changeset into BK by piping this whole message to: +'| bk receive [path to repository]' or apply the patch as usual. + +=================================================================== + + +ChangeSet@1.2289, 2005-03-20 12:29:41-08:00, rth@kanga.twiddle.home + [ALPHA] Elimitate two warnings from gcc4. + + + smp.c | 43 ------------------------------------------- + srmcons.c | 27 ++++++++++----------------- + 2 files changed, 10 insertions(+), 60 deletions(-) + + +diff -Nru a/arch/alpha/kernel/srmcons.c b/arch/alpha/kernel/srmcons.c +--- a/arch/alpha/kernel/srmcons.c 2005-03-20 20:23:28 -08:00 ++++ b/arch/alpha/kernel/srmcons.c 2005-03-20 20:23:28 -08:00 +@@ -164,29 +164,22 @@ + unsigned long flags; + int retval = 0; + +- spin_lock_irqsave(&srmconsp_lock, flags); +- +- do { +- if (srmconsp != NULL) { +- *ps = srmconsp; +- break; +- } ++ if (srmconsp == NULL) { ++ spin_lock_irqsave(&srmconsp_lock, flags); + + srmconsp = kmalloc(sizeof(*srmconsp), GFP_KERNEL); +- if (srmconsp == NULL) { ++ if (srmconsp == NULL) + retval = -ENOMEM; +- break; ++ else { ++ srmconsp->tty = NULL; ++ spin_lock_init(&srmconsp->lock); ++ init_timer(&srmconsp->timer); + } + +- srmconsp->tty = NULL; +- spin_lock_init(&srmconsp->lock); +- init_timer(&srmconsp->timer); +- +- *ps = srmconsp; +- } while(0); +- +- spin_unlock_irqrestore(&srmconsp_lock, flags); ++ spin_unlock_irqrestore(&srmconsp_lock, flags); ++ } + ++ *ps = srmconsp; + return retval; + } + + +=================================================================== + + +This BitKeeper patch contains the following changesets: +1.2289 +## Wrapped with gzip_uu ## + + +M'XL( $!,/D( [56[V_;-A#]+/X5!Q38FFV628KZY4XSH8D1KK%-F#@>'J\]^[>V6_@6@LU\919H#?PL=%F +MXG$E?+,N\[P2OA3&QJ^:QL;'BZ868YLY?O=YS&_;$?4C9$\ON3:P:O]%YY3=J_D^4 +M$ (\R^')V? +M@82,8'2Y5Q6-7OA""'.,3AZA:?O>)3BWJA?I3?Z"*G>@#RND49R&PW0_0\O-^RN)C,R\ +MNCVM2MD9UB_#4'" X8@&$8D?A5+ +M7(FU*JT1[@J?S869M:I<67/,M%%=9D!W;MTLN(&?6@VE!EZM^4:#>] (Z;O +Subject: [linux-sh:02770] Re: Compiling glibc-2.3.2 for sh4 fails with "include/asm/user.h:32: + error: redefinition of `struct user_fpu_struct'" +To: linux-sh@m17n.org +Message-Id: <200306052250.h55Moeb08707@r-rr.iij4u.or.jp> + +Hi, + +Dan Kegel wrote: +> When I try to build glibc-2.3.2 for sh4, it fails with the error +[snip] +> /home3/dank/crosstool-0.3/result/sh4-linux/gcc-3.3-glibc-2.3.2/sh4-linux/include/asm/user.h:32: error: redefinition of `struct user_fpu_struct' +> /home3/dank/crosstool-0.3/result/sh4-linux/gcc-3.3-glibc-2.3.2/sh4-linux/include/asm/user.h:39: error: redefinition of `struct user' +[snip] +> The error reminds me of the kind of thing fixed by +> http://www.kegel.com/crossgcc/crosstool-0.4/glibc-2.3.2-patches/sh-user.patch + +It seems that the definitions in asm/user.h and the above patch collide. +I'm not sure why you need this patch, but is it needed for the problem +about struct ustat that you pointed out in this list, isn't it? +I found why I don't hit ustat problem - my local kernel tree includes +the following patch, though I can't recall about it. + +Regards, + kaz +-- +diff -u linux-2.5.69-sf-orig/include/linux/types.h /usr/local/sh4-unknown-linux-gnu/include/linux/types.h +--- linux-2.5.69-sf-orig/include/linux/types.h Wed Mar 5 12:29:34 2003 ++++ sh4-unknown-linux-gnu/include/linux/types.h Sat Apr 19 10:05:52 2003 +@@ -141,6 +141,7 @@ + + #endif /* __KERNEL_STRICT_NAMES */ + ++#ifdef __KERNEL__ + /* + * Below are truly Linux-specific types that should never collide with + * any application/library that wants linux/types.h. +@@ -152,5 +153,6 @@ + char f_fname[6]; + char f_fpack[6]; + }; ++#endif + + #endif /* _LINUX_TYPES_H */ + + diff --git a/patches/linux/2.6.11.3/120-linux-2.6.11-allow-gcc-4.0-asm-i386.patch b/patches/linux/2.6.11.3/120-linux-2.6.11-allow-gcc-4.0-asm-i386.patch new file mode 100644 index 0000000..1193a8c --- /dev/null +++ b/patches/linux/2.6.11.3/120-linux-2.6.11-allow-gcc-4.0-asm-i386.patch @@ -0,0 +1,150 @@ +Fixes + +In file included from include/asm/thread_info.h:16, + from include/linux/thread_info.h:21, + from include/linux/spinlock.h:12, + from include/linux/capability.h:45, + from include/linux/sched.h:7, + from arch/i386/kernel/asm-offsets.c:7: +include/asm/processor.h:87: error: array type has incomplete element type +make[1]: *** [arch/i386/kernel/asm-offsets.asm] Error 1 + +--- linux-2.6.11.3/include/asm-i386/processor.h.old Tue Mar 15 06:45:26 2005 ++++ linux-2.6.11.3/include/asm-i386/processor.h Tue Mar 15 06:46:45 2005 +@@ -81,6 +81,64 @@ + #define X86_VENDOR_UNKNOWN 0xff + + /* ++ * Size of io_bitmap. ++ */ ++#define IO_BITMAP_BITS 65536 ++#define IO_BITMAP_BYTES (IO_BITMAP_BITS/8) ++#define IO_BITMAP_LONGS (IO_BITMAP_BYTES/sizeof(long)) ++#define INVALID_IO_BITMAP_OFFSET 0x8000 ++#define INVALID_IO_BITMAP_OFFSET_LAZY 0x9000 ++ ++struct tss_struct { ++ unsigned short back_link,__blh; ++ unsigned long esp0; ++ unsigned short ss0,__ss0h; ++ unsigned long esp1; ++ unsigned short ss1,__ss1h; /* ss1 is used to cache MSR_IA32_SYSENTER_CS */ ++ unsigned long esp2; ++ unsigned short ss2,__ss2h; ++ unsigned long __cr3; ++ unsigned long eip; ++ unsigned long eflags; ++ unsigned long eax,ecx,edx,ebx; ++ unsigned long esp; ++ unsigned long ebp; ++ unsigned long esi; ++ unsigned long edi; ++ unsigned short es, __esh; ++ unsigned short cs, __csh; ++ unsigned short ss, __ssh; ++ unsigned short ds, __dsh; ++ unsigned short fs, __fsh; ++ unsigned short gs, __gsh; ++ unsigned short ldt, __ldth; ++ unsigned short trace, io_bitmap_base; ++ /* ++ * The extra 1 is there because the CPU will access an ++ * additional byte beyond the end of the IO permission ++ * bitmap. The extra byte must be all 1 bits, and must ++ * be within the limit. ++ */ ++ unsigned long io_bitmap[IO_BITMAP_LONGS + 1]; ++ /* ++ * Cache the current maximum and the last task that used the bitmap: ++ */ ++ unsigned long io_bitmap_max; ++ struct thread_struct *io_bitmap_owner; ++ /* ++ * pads the TSS to be cacheline-aligned (size is 0x100) ++ */ ++ unsigned long __cacheline_filler[35]; ++ /* ++ * .. and then another 0x100 bytes for emergency kernel stack ++ */ ++ unsigned long stack[64]; ++} __attribute__((packed)); ++ ++#define IO_BITMAP_OFFSET offsetof(struct tss_struct,io_bitmap) ++#define ARCH_MIN_TASKALIGN 16 ++ ++/* + * capabilities of CPUs + */ + +@@ -308,16 +366,6 @@ + + #define HAVE_ARCH_PICK_MMAP_LAYOUT + +-/* +- * Size of io_bitmap. +- */ +-#define IO_BITMAP_BITS 65536 +-#define IO_BITMAP_BYTES (IO_BITMAP_BITS/8) +-#define IO_BITMAP_LONGS (IO_BITMAP_BYTES/sizeof(long)) +-#define IO_BITMAP_OFFSET offsetof(struct tss_struct,io_bitmap) +-#define INVALID_IO_BITMAP_OFFSET 0x8000 +-#define INVALID_IO_BITMAP_OFFSET_LAZY 0x9000 +- + struct i387_fsave_struct { + long cwd; + long swd; +@@ -371,54 +419,6 @@ + } mm_segment_t; + + struct thread_struct; +- +-struct tss_struct { +- unsigned short back_link,__blh; +- unsigned long esp0; +- unsigned short ss0,__ss0h; +- unsigned long esp1; +- unsigned short ss1,__ss1h; /* ss1 is used to cache MSR_IA32_SYSENTER_CS */ +- unsigned long esp2; +- unsigned short ss2,__ss2h; +- unsigned long __cr3; +- unsigned long eip; +- unsigned long eflags; +- unsigned long eax,ecx,edx,ebx; +- unsigned long esp; +- unsigned long ebp; +- unsigned long esi; +- unsigned long edi; +- unsigned short es, __esh; +- unsigned short cs, __csh; +- unsigned short ss, __ssh; +- unsigned short ds, __dsh; +- unsigned short fs, __fsh; +- unsigned short gs, __gsh; +- unsigned short ldt, __ldth; +- unsigned short trace, io_bitmap_base; +- /* +- * The extra 1 is there because the CPU will access an +- * additional byte beyond the end of the IO permission +- * bitmap. The extra byte must be all 1 bits, and must +- * be within the limit. +- */ +- unsigned long io_bitmap[IO_BITMAP_LONGS + 1]; +- /* +- * Cache the current maximum and the last task that used the bitmap: +- */ +- unsigned long io_bitmap_max; +- struct thread_struct *io_bitmap_owner; +- /* +- * pads the TSS to be cacheline-aligned (size is 0x100) +- */ +- unsigned long __cacheline_filler[35]; +- /* +- * .. and then another 0x100 bytes for emergency kernel stack +- */ +- unsigned long stack[64]; +-} __attribute__((packed)); +- +-#define ARCH_MIN_TASKALIGN 16 + + struct thread_struct { + /* cached TLS descriptors. */ diff --git a/patches/linux/2.6.11.3/130-linux-2.6.11-allow-gcc-4.0-asm-m68k.patch b/patches/linux/2.6.11.3/130-linux-2.6.11-allow-gcc-4.0-asm-m68k.patch new file mode 100644 index 0000000..b349ee0 --- /dev/null +++ b/patches/linux/2.6.11.3/130-linux-2.6.11-allow-gcc-4.0-asm-m68k.patch @@ -0,0 +1,32 @@ +Fixes + +In file included from include/asm/setup.h:8, + from include/asm/machdep.h:8, + from include/asm/irq.h:6, + from include/asm/hardirq.h:8, + from include/linux/hardirq.h:6, + from include/asm-generic/local.h:6, + from include/asm/local.h:4, + from include/linux/module.h:21, + from init/main.c:16: +include/asm-m68k/setup.h:365: error: array type has incomplete element type + +when compiling with gcc-4.0. (Affects ppc, too, for some reason.) + +--- linux-2.6.11.3/include/asm-m68k/setup.h.old Fri Mar 18 13:48:03 2005 ++++ linux-2.6.11.3/include/asm-m68k/setup.h Fri Mar 18 13:48:14 2005 +@@ -362,12 +362,13 @@ + #ifndef __ASSEMBLY__ + extern int m68k_num_memory; /* # of memory blocks found (and used) */ + extern int m68k_realnum_memory; /* real # of memory blocks found */ +-extern struct mem_info m68k_memory[NUM_MEMINFO];/* memory description */ + + struct mem_info { + unsigned long addr; /* physical address of memory chunk */ + unsigned long size; /* length of memory chunk (in bytes) */ + }; ++ ++extern struct mem_info m68k_memory[NUM_MEMINFO];/* memory description */ + #endif + + #endif /* __KERNEL__ */ diff --git a/patches/linux/2.6.11.3/140-linux-2.6.11-allow-gcc-4.0-asm-ppc64.patch b/patches/linux/2.6.11.3/140-linux-2.6.11-allow-gcc-4.0-asm-ppc64.patch new file mode 100644 index 0000000..58e376d --- /dev/null +++ b/patches/linux/2.6.11.3/140-linux-2.6.11-allow-gcc-4.0-asm-ppc64.patch @@ -0,0 +1,30 @@ +Fixes + +In file included from include/asm/current.h:4, + from include/linux/wait.h:27, + from include/asm/semaphore.h:15, + from include/linux/sched.h:19, + from arch/ppc64/kernel/asm-offsets.c:18: +include/asm/paca.h:25: error: array type has incomplete element type +make[1]: *** [arch/ppc64/kernel/asm-offsets.s] Error 1 + +when building with gcc-4.0 + +--- linux-2.6.11.3/include/asm-ppc64/paca.h.old Fri Mar 18 13:23:40 2005 ++++ linux-2.6.11.3/include/asm-ppc64/paca.h Fri Mar 18 13:24:04 2005 +@@ -22,7 +22,6 @@ + #include + #include + +-extern struct paca_struct paca[]; + register struct paca_struct *local_paca asm("r13"); + #define get_paca() local_paca + +@@ -114,5 +113,7 @@ + struct ItLpRegSave reg_save; + #endif + }; ++ ++extern struct paca_struct paca[]; + + #endif /* _PPC64_PACA_H */ diff --git a/patches/linux/2.6.11.3/150-linux-2.6.11-allow-gcc-4.0-asm-x86_64.patch b/patches/linux/2.6.11.3/150-linux-2.6.11-allow-gcc-4.0-asm-x86_64.patch new file mode 100644 index 0000000..a87e12e --- /dev/null +++ b/patches/linux/2.6.11.3/150-linux-2.6.11-allow-gcc-4.0-asm-x86_64.patch @@ -0,0 +1,28 @@ +Fixes: + +In file included from include/linux/spinlock.h:16, + from include/linux/capability.h:45, + from include/linux/sched.h:7, + from arch/x86_64/kernel/asm-offsets.c:7: +include/asm/processor.h:79: error: array type has incomplete element type +make[1]: *** [arch/x86_64/kernel/asm-offsets.asm] Error 1 + +--- linux-2.6.11.3/include/asm-x86_64/processor.h.old Tue Mar 15 07:05:07 2005 ++++ linux-2.6.11.3/include/asm-x86_64/processor.h Tue Mar 15 07:09:53 2005 +@@ -179,7 +179,6 @@ + #define IO_BITMAP_BITS 65536 + #define IO_BITMAP_BYTES (IO_BITMAP_BITS/8) + #define IO_BITMAP_LONGS (IO_BITMAP_BYTES/sizeof(long)) +-#define IO_BITMAP_OFFSET offsetof(struct tss_struct,io_bitmap) + #define INVALID_IO_BITMAP_OFFSET 0x8000 + + struct i387_fxsave_struct { +@@ -222,6 +221,8 @@ + */ + unsigned long io_bitmap[IO_BITMAP_LONGS + 1]; + } __attribute__((packed)) ____cacheline_aligned; ++ ++#define IO_BITMAP_OFFSET offsetof(struct tss_struct,io_bitmap) + + extern struct cpuinfo_x86 boot_cpu_data; + DECLARE_PER_CPU(struct tss_struct,init_tss); diff --git a/patches/linux/2.6.11.3/160-linux-2.6.11-allow-gcc-4.0-i2c.patch b/patches/linux/2.6.11.3/160-linux-2.6.11-allow-gcc-4.0-i2c.patch new file mode 100644 index 0000000..c1df43d --- /dev/null +++ b/patches/linux/2.6.11.3/160-linux-2.6.11-allow-gcc-4.0-i2c.patch @@ -0,0 +1,58 @@ +Fixes + +In file included from fs/compat_ioctl.c:69, + from arch/ppc64/kernel/ioctl32.c:24: +include/linux/i2c.h:58: error: array type has incomplete element type +include/linux/i2c.h:197: error: array type has incomplete element type + +when compiling with gcc-4.0. + +--- linux-2.6.11.3/include/linux/i2c.h.old 2005-03-19 10:59:09.000000000 -0800 ++++ linux-2.6.11.3/include/linux/i2c.h 2005-03-19 11:01:37.000000000 -0800 +@@ -36,7 +36,22 @@ + + /* --- General options ------------------------------------------------ */ + +-struct i2c_msg; ++/* ++ * I2C Message - used for pure i2c transaction, also from /dev interface ++ */ ++struct i2c_msg { ++ __u16 addr; /* slave address */ ++ __u16 flags; ++#define I2C_M_TEN 0x10 /* we have a ten bit chip address */ ++#define I2C_M_RD 0x01 ++#define I2C_M_NOSTART 0x4000 ++#define I2C_M_REV_DIR_ADDR 0x2000 ++#define I2C_M_IGNORE_NAK 0x1000 ++#define I2C_M_NO_RD_ACK 0x0800 ++ __u16 len; /* msg length */ ++ __u8 *buf; /* pointer to msg data */ ++}; ++ + struct i2c_algorithm; + struct i2c_adapter; + struct i2c_client; +@@ -379,22 +394,6 @@ + /* Return 1 if adapter supports everything we need, 0 if not. */ + extern int i2c_check_functionality (struct i2c_adapter *adap, u32 func); + +-/* +- * I2C Message - used for pure i2c transaction, also from /dev interface +- */ +-struct i2c_msg { +- __u16 addr; /* slave address */ +- __u16 flags; +-#define I2C_M_TEN 0x10 /* we have a ten bit chip address */ +-#define I2C_M_RD 0x01 +-#define I2C_M_NOSTART 0x4000 +-#define I2C_M_REV_DIR_ADDR 0x2000 +-#define I2C_M_IGNORE_NAK 0x1000 +-#define I2C_M_NO_RD_ACK 0x0800 +- __u16 len; /* msg length */ +- __u8 *buf; /* pointer to msg data */ +-}; +- + /* To determine what functionality is present */ + + #define I2C_FUNC_I2C 0x00000001 diff --git a/patches/linux/2.6.11.3/170-linux-2.6.11-allow-gcc-4.0-ppc-mikpe.patch b/patches/linux/2.6.11.3/170-linux-2.6.11-allow-gcc-4.0-ppc-mikpe.patch new file mode 100644 index 0000000..60f02e3 --- /dev/null +++ b/patches/linux/2.6.11.3/170-linux-2.6.11-allow-gcc-4.0-ppc-mikpe.patch @@ -0,0 +1,86 @@ + +Fixes + +In file included from arch/ppc/kernel/time.c:68: +arch/ppc/kernel/time.c:92: error: static declaration of 'time_offset' follows non-static declaration +include/linux/timex.h:236: error: previous declaration of 'time_offset' was here +make[1]: *** [arch/ppc/kernel/time.o] Error 1 + +when compiling with gcc-4.0 + +Taken from +http://user.it.uu.se/~mikpe/linux/patches/2.6/patch-gcc4-fixes-v2-2.6.11 +Also removes some obsolete externs that caused problems for Mike +Mike's patch has a bit more stuff in it, but this was enough for me + + +diff -rupN linux-2.6.11/arch/ppc/kernel/time.c linux-2.6.11.gcc4-fixes-v2/arch/ppc/kernel/time.c +--- linux-2.6.11/arch/ppc/kernel/time.c 2005-03-02 19:24:14.000000000 +0100 ++++ linux-2.6.11.gcc4-fixes-v2/arch/ppc/kernel/time.c 2005-03-02 19:36:26.000000000 +0100 +@@ -89,7 +89,7 @@ unsigned long tb_to_ns_scale; + + extern unsigned long wall_jiffies; + +-static long time_offset; ++static long ppc_time_offset; + + DEFINE_SPINLOCK(rtc_lock); + +@@ -172,7 +172,7 @@ void timer_interrupt(struct pt_regs * re + xtime.tv_sec - last_rtc_update >= 659 && + abs((xtime.tv_nsec / 1000) - (1000000-1000000/HZ)) < 500000/HZ && + jiffies - wall_jiffies == 1) { +- if (ppc_md.set_rtc_time(xtime.tv_sec+1 + time_offset) == 0) ++ if (ppc_md.set_rtc_time(xtime.tv_sec+1 + ppc_time_offset) == 0) + last_rtc_update = xtime.tv_sec+1; + else + /* Try again one minute later */ +@@ -289,7 +289,7 @@ void __init time_init(void) + unsigned old_stamp, stamp, elapsed; + + if (ppc_md.time_init != NULL) +- time_offset = ppc_md.time_init(); ++ ppc_time_offset = ppc_md.time_init(); + + if (__USE_RTC()) { + /* 601 processor: dec counts down by 128 every 128ns */ +@@ -334,10 +334,10 @@ void __init time_init(void) + set_dec(tb_ticks_per_jiffy); + + /* If platform provided a timezone (pmac), we correct the time */ +- if (time_offset) { +- sys_tz.tz_minuteswest = -time_offset / 60; ++ if (ppc_time_offset) { ++ sys_tz.tz_minuteswest = -ppc_time_offset / 60; + sys_tz.tz_dsttime = 0; +- xtime.tv_sec -= time_offset; ++ xtime.tv_sec -= ppc_time_offset; + } + set_normalized_timespec(&wall_to_monotonic, + -xtime.tv_sec, -xtime.tv_nsec); +diff -rupN linux-2.6.11/arch/ppc/syslib/open_pic_defs.h linux-2.6.11.gcc4-fixes-v2/arch/ppc/syslib/open_pic_defs.h +--- linux-2.6.11/arch/ppc/syslib/open_pic_defs.h 2005-03-02 19:24:14.000000000 +0100 ++++ linux-2.6.11.gcc4-fixes-v2/arch/ppc/syslib/open_pic_defs.h 2005-03-02 19:36:26.000000000 +0100 +@@ -172,9 +172,6 @@ struct OpenPIC { + OpenPIC_Processor Processor[OPENPIC_MAX_PROCESSORS]; + }; + +-extern volatile struct OpenPIC __iomem *OpenPIC; +- +- + /* + * Current Task Priority Register + */ +diff -rupN linux-2.6.11/include/asm-ppc/prom.h linux-2.6.11.gcc4-fixes-v2/include/asm-ppc/prom.h +--- linux-2.6.11/include/asm-ppc/prom.h 2003-09-28 12:19:57.000000000 +0200 ++++ linux-2.6.11.gcc4-fixes-v2/include/asm-ppc/prom.h 2005-03-02 19:36:26.000000000 +0100 +@@ -13,9 +13,6 @@ + typedef void *phandle; + typedef void *ihandle; + +-extern char *prom_display_paths[]; +-extern unsigned int prom_num_displays; +- + struct address_range { + unsigned int space; + unsigned int address; diff --git a/patches/linux/2.6.11.3/arch_alpha_kernel_srcons.patch b/patches/linux/2.6.11.3/arch_alpha_kernel_srcons.patch deleted file mode 100644 index c163a1e..0000000 --- a/patches/linux/2.6.11.3/arch_alpha_kernel_srcons.patch +++ /dev/null @@ -1,134 +0,0 @@ -Date: Sun, 20 Mar 2005 20:26:02 -0800 -From: Richard Henderson -To: Andrew Morton -Cc: Dan Kegel , jbglaw@lug-owl.de, - linux-kernel@vger.kernel.org, torvalds@osdl.org -Subject: Re: 2.6.11.3 build problem in arch/alpha/kernel/srcons.c with gcc-4.0 -Message-ID: <20050321042602.GA3795@twiddle.net> -Mail-Followup-To: Andrew Morton , Dan Kegel , - jbglaw@lug-owl.de, linux-kernel@vger.kernel.org, torvalds@osdl.org -References: <423E238F.3030805@kegel.com> <20050320190352.65cc1396.akpm@osdl.org> -Mime-Version: 1.0 -Content-Type: text/plain; charset=us-ascii -Content-Disposition: inline -In-Reply-To: <20050320190352.65cc1396.akpm@osdl.org> -User-Agent: Mutt/1.4.1i - -On Sun, Mar 20, 2005 at 07:03:52PM -0800, Andrew Morton wrote: -> Dan Kegel wrote: -> > -> > Anyone with an alpha care to suggest a fix for this? -> > -> > arch/alpha/kernel/srmcons.c: In function 'srmcons_open': -> > arch/alpha/kernel/srmcons.c:196: warning: 'srmconsp' may be used uninitialized in this function -> > make[1]: *** [arch/alpha/kernel/srmcons.o] Error 1 -> > make: *** [arch/alpha/kernel] Error 2 -> > -> > I get this when building the 2.6.11.3 kernel with a recent gcc-4.0 snapshot. -> > -> -> It's beyond gcc's ability to figure out that the code is OK. Options would -> be to disable -Werror, or to artificially initialise that variable. - -Fixed thus. - -Note that even with a _raw_read_trylock implementation, smp still -doesn't work. Everything that init spawns dies immediately. I -havn't had a chance to find out why yet... - -[ Note: deleted changes to smp.c, since they didn't apply cleanly - to 2.6.11.3 (the function had moved, I guess), and they seemed unrelated.] - -r~ - - - -You can import this changeset into BK by piping this whole message to: -'| bk receive [path to repository]' or apply the patch as usual. - -=================================================================== - - -ChangeSet@1.2289, 2005-03-20 12:29:41-08:00, rth@kanga.twiddle.home - [ALPHA] Elimitate two warnings from gcc4. - - - smp.c | 43 ------------------------------------------- - srmcons.c | 27 ++++++++++----------------- - 2 files changed, 10 insertions(+), 60 deletions(-) - - -diff -Nru a/arch/alpha/kernel/srmcons.c b/arch/alpha/kernel/srmcons.c ---- a/arch/alpha/kernel/srmcons.c 2005-03-20 20:23:28 -08:00 -+++ b/arch/alpha/kernel/srmcons.c 2005-03-20 20:23:28 -08:00 -@@ -164,29 +164,22 @@ - unsigned long flags; - int retval = 0; - -- spin_lock_irqsave(&srmconsp_lock, flags); -- -- do { -- if (srmconsp != NULL) { -- *ps = srmconsp; -- break; -- } -+ if (srmconsp == NULL) { -+ spin_lock_irqsave(&srmconsp_lock, flags); - - srmconsp = kmalloc(sizeof(*srmconsp), GFP_KERNEL); -- if (srmconsp == NULL) { -+ if (srmconsp == NULL) - retval = -ENOMEM; -- break; -+ else { -+ srmconsp->tty = NULL; -+ spin_lock_init(&srmconsp->lock); -+ init_timer(&srmconsp->timer); - } - -- srmconsp->tty = NULL; -- spin_lock_init(&srmconsp->lock); -- init_timer(&srmconsp->timer); -- -- *ps = srmconsp; -- } while(0); -- -- spin_unlock_irqrestore(&srmconsp_lock, flags); -+ spin_unlock_irqrestore(&srmconsp_lock, flags); -+ } - -+ *ps = srmconsp; - return retval; - } - - -=================================================================== - - -This BitKeeper patch contains the following changesets: -1.2289 -## Wrapped with gzip_uu ## - - -M'XL( $!,/D( [56[V_;-A#]+/X5!Q38FFV628KZY4XSH8D1KK%-F#@>'J\]^[>V6_@6@LU\919H#?PL=%F -MXG$E?+,N\[P2OA3&QJ^:QL;'BZ868YLY?O=YS&_;$?4C9$\ON3:P:O]%YY3=J_D^4 -M$ (\R^')V? -M@82,8'2Y5Q6-7OA""'.,3AZA:?O>)3BWJA?I3?Z"*G>@#RND49R&PW0_0\O-^RN)C,R\ -MNCVM2MD9UB_#4'" X8@&$8D?A5+ -M7(FU*JT1[@J?S869M:I<67/,M%%=9D!W;MTLN(&?6@VE!EZM^4:#>] (Z;O -Subject: [linux-sh:02770] Re: Compiling glibc-2.3.2 for sh4 fails with "include/asm/user.h:32: - error: redefinition of `struct user_fpu_struct'" -To: linux-sh@m17n.org -Message-Id: <200306052250.h55Moeb08707@r-rr.iij4u.or.jp> - -Hi, - -Dan Kegel wrote: -> When I try to build glibc-2.3.2 for sh4, it fails with the error -[snip] -> /home3/dank/crosstool-0.3/result/sh4-linux/gcc-3.3-glibc-2.3.2/sh4-linux/include/asm/user.h:32: error: redefinition of `struct user_fpu_struct' -> /home3/dank/crosstool-0.3/result/sh4-linux/gcc-3.3-glibc-2.3.2/sh4-linux/include/asm/user.h:39: error: redefinition of `struct user' -[snip] -> The error reminds me of the kind of thing fixed by -> http://www.kegel.com/crossgcc/crosstool-0.4/glibc-2.3.2-patches/sh-user.patch - -It seems that the definitions in asm/user.h and the above patch collide. -I'm not sure why you need this patch, but is it needed for the problem -about struct ustat that you pointed out in this list, isn't it? -I found why I don't hit ustat problem - my local kernel tree includes -the following patch, though I can't recall about it. - -Regards, - kaz --- -diff -u linux-2.5.69-sf-orig/include/linux/types.h /usr/local/sh4-unknown-linux-gnu/include/linux/types.h ---- linux-2.5.69-sf-orig/include/linux/types.h Wed Mar 5 12:29:34 2003 -+++ sh4-unknown-linux-gnu/include/linux/types.h Sat Apr 19 10:05:52 2003 -@@ -141,6 +141,7 @@ - - #endif /* __KERNEL_STRICT_NAMES */ - -+#ifdef __KERNEL__ - /* - * Below are truly Linux-specific types that should never collide with - * any application/library that wants linux/types.h. -@@ -152,5 +153,6 @@ - char f_fname[6]; - char f_fpack[6]; - }; -+#endif - - #endif /* _LINUX_TYPES_H */ - - diff --git a/patches/linux/2.6.11.3/linux-2.6.11-allow-gcc-4.0-asm-i386.patch b/patches/linux/2.6.11.3/linux-2.6.11-allow-gcc-4.0-asm-i386.patch deleted file mode 100644 index 1193a8c..0000000 --- a/patches/linux/2.6.11.3/linux-2.6.11-allow-gcc-4.0-asm-i386.patch +++ /dev/null @@ -1,150 +0,0 @@ -Fixes - -In file included from include/asm/thread_info.h:16, - from include/linux/thread_info.h:21, - from include/linux/spinlock.h:12, - from include/linux/capability.h:45, - from include/linux/sched.h:7, - from arch/i386/kernel/asm-offsets.c:7: -include/asm/processor.h:87: error: array type has incomplete element type -make[1]: *** [arch/i386/kernel/asm-offsets.asm] Error 1 - ---- linux-2.6.11.3/include/asm-i386/processor.h.old Tue Mar 15 06:45:26 2005 -+++ linux-2.6.11.3/include/asm-i386/processor.h Tue Mar 15 06:46:45 2005 -@@ -81,6 +81,64 @@ - #define X86_VENDOR_UNKNOWN 0xff - - /* -+ * Size of io_bitmap. -+ */ -+#define IO_BITMAP_BITS 65536 -+#define IO_BITMAP_BYTES (IO_BITMAP_BITS/8) -+#define IO_BITMAP_LONGS (IO_BITMAP_BYTES/sizeof(long)) -+#define INVALID_IO_BITMAP_OFFSET 0x8000 -+#define INVALID_IO_BITMAP_OFFSET_LAZY 0x9000 -+ -+struct tss_struct { -+ unsigned short back_link,__blh; -+ unsigned long esp0; -+ unsigned short ss0,__ss0h; -+ unsigned long esp1; -+ unsigned short ss1,__ss1h; /* ss1 is used to cache MSR_IA32_SYSENTER_CS */ -+ unsigned long esp2; -+ unsigned short ss2,__ss2h; -+ unsigned long __cr3; -+ unsigned long eip; -+ unsigned long eflags; -+ unsigned long eax,ecx,edx,ebx; -+ unsigned long esp; -+ unsigned long ebp; -+ unsigned long esi; -+ unsigned long edi; -+ unsigned short es, __esh; -+ unsigned short cs, __csh; -+ unsigned short ss, __ssh; -+ unsigned short ds, __dsh; -+ unsigned short fs, __fsh; -+ unsigned short gs, __gsh; -+ unsigned short ldt, __ldth; -+ unsigned short trace, io_bitmap_base; -+ /* -+ * The extra 1 is there because the CPU will access an -+ * additional byte beyond the end of the IO permission -+ * bitmap. The extra byte must be all 1 bits, and must -+ * be within the limit. -+ */ -+ unsigned long io_bitmap[IO_BITMAP_LONGS + 1]; -+ /* -+ * Cache the current maximum and the last task that used the bitmap: -+ */ -+ unsigned long io_bitmap_max; -+ struct thread_struct *io_bitmap_owner; -+ /* -+ * pads the TSS to be cacheline-aligned (size is 0x100) -+ */ -+ unsigned long __cacheline_filler[35]; -+ /* -+ * .. and then another 0x100 bytes for emergency kernel stack -+ */ -+ unsigned long stack[64]; -+} __attribute__((packed)); -+ -+#define IO_BITMAP_OFFSET offsetof(struct tss_struct,io_bitmap) -+#define ARCH_MIN_TASKALIGN 16 -+ -+/* - * capabilities of CPUs - */ - -@@ -308,16 +366,6 @@ - - #define HAVE_ARCH_PICK_MMAP_LAYOUT - --/* -- * Size of io_bitmap. -- */ --#define IO_BITMAP_BITS 65536 --#define IO_BITMAP_BYTES (IO_BITMAP_BITS/8) --#define IO_BITMAP_LONGS (IO_BITMAP_BYTES/sizeof(long)) --#define IO_BITMAP_OFFSET offsetof(struct tss_struct,io_bitmap) --#define INVALID_IO_BITMAP_OFFSET 0x8000 --#define INVALID_IO_BITMAP_OFFSET_LAZY 0x9000 -- - struct i387_fsave_struct { - long cwd; - long swd; -@@ -371,54 +419,6 @@ - } mm_segment_t; - - struct thread_struct; -- --struct tss_struct { -- unsigned short back_link,__blh; -- unsigned long esp0; -- unsigned short ss0,__ss0h; -- unsigned long esp1; -- unsigned short ss1,__ss1h; /* ss1 is used to cache MSR_IA32_SYSENTER_CS */ -- unsigned long esp2; -- unsigned short ss2,__ss2h; -- unsigned long __cr3; -- unsigned long eip; -- unsigned long eflags; -- unsigned long eax,ecx,edx,ebx; -- unsigned long esp; -- unsigned long ebp; -- unsigned long esi; -- unsigned long edi; -- unsigned short es, __esh; -- unsigned short cs, __csh; -- unsigned short ss, __ssh; -- unsigned short ds, __dsh; -- unsigned short fs, __fsh; -- unsigned short gs, __gsh; -- unsigned short ldt, __ldth; -- unsigned short trace, io_bitmap_base; -- /* -- * The extra 1 is there because the CPU will access an -- * additional byte beyond the end of the IO permission -- * bitmap. The extra byte must be all 1 bits, and must -- * be within the limit. -- */ -- unsigned long io_bitmap[IO_BITMAP_LONGS + 1]; -- /* -- * Cache the current maximum and the last task that used the bitmap: -- */ -- unsigned long io_bitmap_max; -- struct thread_struct *io_bitmap_owner; -- /* -- * pads the TSS to be cacheline-aligned (size is 0x100) -- */ -- unsigned long __cacheline_filler[35]; -- /* -- * .. and then another 0x100 bytes for emergency kernel stack -- */ -- unsigned long stack[64]; --} __attribute__((packed)); -- --#define ARCH_MIN_TASKALIGN 16 - - struct thread_struct { - /* cached TLS descriptors. */ diff --git a/patches/linux/2.6.11.3/linux-2.6.11-allow-gcc-4.0-asm-m68k.patch b/patches/linux/2.6.11.3/linux-2.6.11-allow-gcc-4.0-asm-m68k.patch deleted file mode 100644 index b349ee0..0000000 --- a/patches/linux/2.6.11.3/linux-2.6.11-allow-gcc-4.0-asm-m68k.patch +++ /dev/null @@ -1,32 +0,0 @@ -Fixes - -In file included from include/asm/setup.h:8, - from include/asm/machdep.h:8, - from include/asm/irq.h:6, - from include/asm/hardirq.h:8, - from include/linux/hardirq.h:6, - from include/asm-generic/local.h:6, - from include/asm/local.h:4, - from include/linux/module.h:21, - from init/main.c:16: -include/asm-m68k/setup.h:365: error: array type has incomplete element type - -when compiling with gcc-4.0. (Affects ppc, too, for some reason.) - ---- linux-2.6.11.3/include/asm-m68k/setup.h.old Fri Mar 18 13:48:03 2005 -+++ linux-2.6.11.3/include/asm-m68k/setup.h Fri Mar 18 13:48:14 2005 -@@ -362,12 +362,13 @@ - #ifndef __ASSEMBLY__ - extern int m68k_num_memory; /* # of memory blocks found (and used) */ - extern int m68k_realnum_memory; /* real # of memory blocks found */ --extern struct mem_info m68k_memory[NUM_MEMINFO];/* memory description */ - - struct mem_info { - unsigned long addr; /* physical address of memory chunk */ - unsigned long size; /* length of memory chunk (in bytes) */ - }; -+ -+extern struct mem_info m68k_memory[NUM_MEMINFO];/* memory description */ - #endif - - #endif /* __KERNEL__ */ diff --git a/patches/linux/2.6.11.3/linux-2.6.11-allow-gcc-4.0-asm-ppc64.patch b/patches/linux/2.6.11.3/linux-2.6.11-allow-gcc-4.0-asm-ppc64.patch deleted file mode 100644 index 58e376d..0000000 --- a/patches/linux/2.6.11.3/linux-2.6.11-allow-gcc-4.0-asm-ppc64.patch +++ /dev/null @@ -1,30 +0,0 @@ -Fixes - -In file included from include/asm/current.h:4, - from include/linux/wait.h:27, - from include/asm/semaphore.h:15, - from include/linux/sched.h:19, - from arch/ppc64/kernel/asm-offsets.c:18: -include/asm/paca.h:25: error: array type has incomplete element type -make[1]: *** [arch/ppc64/kernel/asm-offsets.s] Error 1 - -when building with gcc-4.0 - ---- linux-2.6.11.3/include/asm-ppc64/paca.h.old Fri Mar 18 13:23:40 2005 -+++ linux-2.6.11.3/include/asm-ppc64/paca.h Fri Mar 18 13:24:04 2005 -@@ -22,7 +22,6 @@ - #include - #include - --extern struct paca_struct paca[]; - register struct paca_struct *local_paca asm("r13"); - #define get_paca() local_paca - -@@ -114,5 +113,7 @@ - struct ItLpRegSave reg_save; - #endif - }; -+ -+extern struct paca_struct paca[]; - - #endif /* _PPC64_PACA_H */ diff --git a/patches/linux/2.6.11.3/linux-2.6.11-allow-gcc-4.0-asm-x86_64.patch b/patches/linux/2.6.11.3/linux-2.6.11-allow-gcc-4.0-asm-x86_64.patch deleted file mode 100644 index a87e12e..0000000 --- a/patches/linux/2.6.11.3/linux-2.6.11-allow-gcc-4.0-asm-x86_64.patch +++ /dev/null @@ -1,28 +0,0 @@ -Fixes: - -In file included from include/linux/spinlock.h:16, - from include/linux/capability.h:45, - from include/linux/sched.h:7, - from arch/x86_64/kernel/asm-offsets.c:7: -include/asm/processor.h:79: error: array type has incomplete element type -make[1]: *** [arch/x86_64/kernel/asm-offsets.asm] Error 1 - ---- linux-2.6.11.3/include/asm-x86_64/processor.h.old Tue Mar 15 07:05:07 2005 -+++ linux-2.6.11.3/include/asm-x86_64/processor.h Tue Mar 15 07:09:53 2005 -@@ -179,7 +179,6 @@ - #define IO_BITMAP_BITS 65536 - #define IO_BITMAP_BYTES (IO_BITMAP_BITS/8) - #define IO_BITMAP_LONGS (IO_BITMAP_BYTES/sizeof(long)) --#define IO_BITMAP_OFFSET offsetof(struct tss_struct,io_bitmap) - #define INVALID_IO_BITMAP_OFFSET 0x8000 - - struct i387_fxsave_struct { -@@ -222,6 +221,8 @@ - */ - unsigned long io_bitmap[IO_BITMAP_LONGS + 1]; - } __attribute__((packed)) ____cacheline_aligned; -+ -+#define IO_BITMAP_OFFSET offsetof(struct tss_struct,io_bitmap) - - extern struct cpuinfo_x86 boot_cpu_data; - DECLARE_PER_CPU(struct tss_struct,init_tss); diff --git a/patches/linux/2.6.11.3/linux-2.6.11-allow-gcc-4.0-i2c.patch b/patches/linux/2.6.11.3/linux-2.6.11-allow-gcc-4.0-i2c.patch deleted file mode 100644 index c1df43d..0000000 --- a/patches/linux/2.6.11.3/linux-2.6.11-allow-gcc-4.0-i2c.patch +++ /dev/null @@ -1,58 +0,0 @@ -Fixes - -In file included from fs/compat_ioctl.c:69, - from arch/ppc64/kernel/ioctl32.c:24: -include/linux/i2c.h:58: error: array type has incomplete element type -include/linux/i2c.h:197: error: array type has incomplete element type - -when compiling with gcc-4.0. - ---- linux-2.6.11.3/include/linux/i2c.h.old 2005-03-19 10:59:09.000000000 -0800 -+++ linux-2.6.11.3/include/linux/i2c.h 2005-03-19 11:01:37.000000000 -0800 -@@ -36,7 +36,22 @@ - - /* --- General options ------------------------------------------------ */ - --struct i2c_msg; -+/* -+ * I2C Message - used for pure i2c transaction, also from /dev interface -+ */ -+struct i2c_msg { -+ __u16 addr; /* slave address */ -+ __u16 flags; -+#define I2C_M_TEN 0x10 /* we have a ten bit chip address */ -+#define I2C_M_RD 0x01 -+#define I2C_M_NOSTART 0x4000 -+#define I2C_M_REV_DIR_ADDR 0x2000 -+#define I2C_M_IGNORE_NAK 0x1000 -+#define I2C_M_NO_RD_ACK 0x0800 -+ __u16 len; /* msg length */ -+ __u8 *buf; /* pointer to msg data */ -+}; -+ - struct i2c_algorithm; - struct i2c_adapter; - struct i2c_client; -@@ -379,22 +394,6 @@ - /* Return 1 if adapter supports everything we need, 0 if not. */ - extern int i2c_check_functionality (struct i2c_adapter *adap, u32 func); - --/* -- * I2C Message - used for pure i2c transaction, also from /dev interface -- */ --struct i2c_msg { -- __u16 addr; /* slave address */ -- __u16 flags; --#define I2C_M_TEN 0x10 /* we have a ten bit chip address */ --#define I2C_M_RD 0x01 --#define I2C_M_NOSTART 0x4000 --#define I2C_M_REV_DIR_ADDR 0x2000 --#define I2C_M_IGNORE_NAK 0x1000 --#define I2C_M_NO_RD_ACK 0x0800 -- __u16 len; /* msg length */ -- __u8 *buf; /* pointer to msg data */ --}; -- - /* To determine what functionality is present */ - - #define I2C_FUNC_I2C 0x00000001 diff --git a/patches/linux/2.6.11.3/linux-2.6.11-allow-gcc-4.0-ppc-mikpe.patch b/patches/linux/2.6.11.3/linux-2.6.11-allow-gcc-4.0-ppc-mikpe.patch deleted file mode 100644 index 60f02e3..0000000 --- a/patches/linux/2.6.11.3/linux-2.6.11-allow-gcc-4.0-ppc-mikpe.patch +++ /dev/null @@ -1,86 +0,0 @@ - -Fixes - -In file included from arch/ppc/kernel/time.c:68: -arch/ppc/kernel/time.c:92: error: static declaration of 'time_offset' follows non-static declaration -include/linux/timex.h:236: error: previous declaration of 'time_offset' was here -make[1]: *** [arch/ppc/kernel/time.o] Error 1 - -when compiling with gcc-4.0 - -Taken from -http://user.it.uu.se/~mikpe/linux/patches/2.6/patch-gcc4-fixes-v2-2.6.11 -Also removes some obsolete externs that caused problems for Mike -Mike's patch has a bit more stuff in it, but this was enough for me - - -diff -rupN linux-2.6.11/arch/ppc/kernel/time.c linux-2.6.11.gcc4-fixes-v2/arch/ppc/kernel/time.c ---- linux-2.6.11/arch/ppc/kernel/time.c 2005-03-02 19:24:14.000000000 +0100 -+++ linux-2.6.11.gcc4-fixes-v2/arch/ppc/kernel/time.c 2005-03-02 19:36:26.000000000 +0100 -@@ -89,7 +89,7 @@ unsigned long tb_to_ns_scale; - - extern unsigned long wall_jiffies; - --static long time_offset; -+static long ppc_time_offset; - - DEFINE_SPINLOCK(rtc_lock); - -@@ -172,7 +172,7 @@ void timer_interrupt(struct pt_regs * re - xtime.tv_sec - last_rtc_update >= 659 && - abs((xtime.tv_nsec / 1000) - (1000000-1000000/HZ)) < 500000/HZ && - jiffies - wall_jiffies == 1) { -- if (ppc_md.set_rtc_time(xtime.tv_sec+1 + time_offset) == 0) -+ if (ppc_md.set_rtc_time(xtime.tv_sec+1 + ppc_time_offset) == 0) - last_rtc_update = xtime.tv_sec+1; - else - /* Try again one minute later */ -@@ -289,7 +289,7 @@ void __init time_init(void) - unsigned old_stamp, stamp, elapsed; - - if (ppc_md.time_init != NULL) -- time_offset = ppc_md.time_init(); -+ ppc_time_offset = ppc_md.time_init(); - - if (__USE_RTC()) { - /* 601 processor: dec counts down by 128 every 128ns */ -@@ -334,10 +334,10 @@ void __init time_init(void) - set_dec(tb_ticks_per_jiffy); - - /* If platform provided a timezone (pmac), we correct the time */ -- if (time_offset) { -- sys_tz.tz_minuteswest = -time_offset / 60; -+ if (ppc_time_offset) { -+ sys_tz.tz_minuteswest = -ppc_time_offset / 60; - sys_tz.tz_dsttime = 0; -- xtime.tv_sec -= time_offset; -+ xtime.tv_sec -= ppc_time_offset; - } - set_normalized_timespec(&wall_to_monotonic, - -xtime.tv_sec, -xtime.tv_nsec); -diff -rupN linux-2.6.11/arch/ppc/syslib/open_pic_defs.h linux-2.6.11.gcc4-fixes-v2/arch/ppc/syslib/open_pic_defs.h ---- linux-2.6.11/arch/ppc/syslib/open_pic_defs.h 2005-03-02 19:24:14.000000000 +0100 -+++ linux-2.6.11.gcc4-fixes-v2/arch/ppc/syslib/open_pic_defs.h 2005-03-02 19:36:26.000000000 +0100 -@@ -172,9 +172,6 @@ struct OpenPIC { - OpenPIC_Processor Processor[OPENPIC_MAX_PROCESSORS]; - }; - --extern volatile struct OpenPIC __iomem *OpenPIC; -- -- - /* - * Current Task Priority Register - */ -diff -rupN linux-2.6.11/include/asm-ppc/prom.h linux-2.6.11.gcc4-fixes-v2/include/asm-ppc/prom.h ---- linux-2.6.11/include/asm-ppc/prom.h 2003-09-28 12:19:57.000000000 +0200 -+++ linux-2.6.11.gcc4-fixes-v2/include/asm-ppc/prom.h 2005-03-02 19:36:26.000000000 +0100 -@@ -13,9 +13,6 @@ - typedef void *phandle; - typedef void *ihandle; - --extern char *prom_display_paths[]; --extern unsigned int prom_num_displays; -- - struct address_range { - unsigned int space; - unsigned int address; diff --git a/patches/linux/2.6.5/100-linux-2.6.5-x86_64-unistd.patch b/patches/linux/2.6.5/100-linux-2.6.5-x86_64-unistd.patch new file mode 100644 index 0000000..829f0d9 --- /dev/null +++ b/patches/linux/2.6.5/100-linux-2.6.5-x86_64-unistd.patch @@ -0,0 +1,80 @@ +Retrieved with wget http://www.x86-64.org/lists/discuss/msg04963.html +then tabs fixed up by rediffing + +Message-Id: EFF62C7EE88E71429E38641A1172F4C2077104@net.teracruz.com +To: discuss@xxxxxxxxxx +Subject: Compile error with glibc 2.3.2 + Linux 2.6.5 ARCH=x86_64 +From: "David Lee" david.lee@xxxxxxxxxxxx +Date: Wed, 21 Apr 2004 15:26:04 -0500 + +I am getting compiler errors when trying to compile glibc 2.3.2 using +the kernel headers from linux 2.6.5. The headers from linux 2.6.3 work +fine. + +I've traced the cause of the problem to a change made in +./include/asm-x86_64/unistd.h in the 2.6.4 release. + ++#ifndef __ASSEMBLY__ ++ ++#include ++#include ++#include ++#include ++ ++asmlinkage long sys_ptrace(long request, long pid, ++ unsigned long addr, long data); ++asmlinkage long sys_iopl(unsigned int level, struct pt_regs regs); ++asmlinkage long sys_ioperm(unsigned long from, unsigned long num, int +turn_on); ++struct sigaction; ++asmlinkage long sys_rt_sigaction(int sig, ++ const struct sigaction __user *act, ++ struct sigaction __user *oact, ++ size_t sigsetsize); ++ ++#endif /* __ASSEMBLY__ */ + +Within glibc, ./sysdeps/unix/sysv/linux/x86_64/syscall.S ends up +including this file, which chokes the assembler with the struct +declarations in the above #include's. + +/home/dlee/vcs/Products/Breeze/Dev/Prj/LinuxRH8/tscale2/tools/x86_64/x86 +_64-linux/glibcinclude/linux/posix_types.h: Assembler messages: +/home/dlee/vcs/Products/Breeze/Dev/Prj/LinuxRH8/tscale2/tools/x86_64/x86 +_64-linux/glibcinclude/linux/posix_types.h:36: Error: no such +instruction: `typedef struct{' + +There are also errors about conflicting re-declarations further along in +the glibc build. + +../posix/sys/types.h:62: error: conflicting types for `dev_t' +/home/dlee/vcs/Products/Breeze/Dev/Prj/LinuxRH8/tscale2/tools/x86_64/x86 +_64-linux/glibcinclude/linux/types.h:23: error: previous declaration of +`dev_t' + +Changing the '#ifndef __ASSEMBLY__' to '#if ((!defined __ASSEMBLY__) && +(defined __KERNEL__))' clears up the problem. My patch is below. + +dave + + +--- linux-2.6.5/include/asm-x86_64/unistd.h.old 2004-04-03 19:37:36.000000000 -0800 ++++ linux-2.6.5/include/asm-x86_64/unistd.h 2004-05-05 11:07:11.000000000 -0700 +@@ -713,7 +713,7 @@ + + #endif /* __KERNEL_SYSCALLS__ */ + +-#ifndef __ASSEMBLY__ ++#if ((!defined __ASSEMBLY__) && (defined __KERNEL__)) + + #include + #include +@@ -730,7 +730,7 @@ + struct sigaction __user *oact, + size_t sigsetsize); + +-#endif /* __ASSEMBLY__ */ ++#endif /* ((!defined __ASSEMBLY__) && (defined __KERNEL__) */ + + #endif /* __NO_STUBS */ + diff --git a/patches/linux/2.6.5/linux-2.6.5-x86_64-unistd.patch b/patches/linux/2.6.5/linux-2.6.5-x86_64-unistd.patch deleted file mode 100644 index 829f0d9..0000000 --- a/patches/linux/2.6.5/linux-2.6.5-x86_64-unistd.patch +++ /dev/null @@ -1,80 +0,0 @@ -Retrieved with wget http://www.x86-64.org/lists/discuss/msg04963.html -then tabs fixed up by rediffing - -Message-Id: EFF62C7EE88E71429E38641A1172F4C2077104@net.teracruz.com -To: discuss@xxxxxxxxxx -Subject: Compile error with glibc 2.3.2 + Linux 2.6.5 ARCH=x86_64 -From: "David Lee" david.lee@xxxxxxxxxxxx -Date: Wed, 21 Apr 2004 15:26:04 -0500 - -I am getting compiler errors when trying to compile glibc 2.3.2 using -the kernel headers from linux 2.6.5. The headers from linux 2.6.3 work -fine. - -I've traced the cause of the problem to a change made in -./include/asm-x86_64/unistd.h in the 2.6.4 release. - -+#ifndef __ASSEMBLY__ -+ -+#include -+#include -+#include -+#include -+ -+asmlinkage long sys_ptrace(long request, long pid, -+ unsigned long addr, long data); -+asmlinkage long sys_iopl(unsigned int level, struct pt_regs regs); -+asmlinkage long sys_ioperm(unsigned long from, unsigned long num, int -turn_on); -+struct sigaction; -+asmlinkage long sys_rt_sigaction(int sig, -+ const struct sigaction __user *act, -+ struct sigaction __user *oact, -+ size_t sigsetsize); -+ -+#endif /* __ASSEMBLY__ */ - -Within glibc, ./sysdeps/unix/sysv/linux/x86_64/syscall.S ends up -including this file, which chokes the assembler with the struct -declarations in the above #include's. - -/home/dlee/vcs/Products/Breeze/Dev/Prj/LinuxRH8/tscale2/tools/x86_64/x86 -_64-linux/glibcinclude/linux/posix_types.h: Assembler messages: -/home/dlee/vcs/Products/Breeze/Dev/Prj/LinuxRH8/tscale2/tools/x86_64/x86 -_64-linux/glibcinclude/linux/posix_types.h:36: Error: no such -instruction: `typedef struct{' - -There are also errors about conflicting re-declarations further along in -the glibc build. - -../posix/sys/types.h:62: error: conflicting types for `dev_t' -/home/dlee/vcs/Products/Breeze/Dev/Prj/LinuxRH8/tscale2/tools/x86_64/x86 -_64-linux/glibcinclude/linux/types.h:23: error: previous declaration of -`dev_t' - -Changing the '#ifndef __ASSEMBLY__' to '#if ((!defined __ASSEMBLY__) && -(defined __KERNEL__))' clears up the problem. My patch is below. - -dave - - ---- linux-2.6.5/include/asm-x86_64/unistd.h.old 2004-04-03 19:37:36.000000000 -0800 -+++ linux-2.6.5/include/asm-x86_64/unistd.h 2004-05-05 11:07:11.000000000 -0700 -@@ -713,7 +713,7 @@ - - #endif /* __KERNEL_SYSCALLS__ */ - --#ifndef __ASSEMBLY__ -+#if ((!defined __ASSEMBLY__) && (defined __KERNEL__)) - - #include - #include -@@ -730,7 +730,7 @@ - struct sigaction __user *oact, - size_t sigsetsize); - --#endif /* __ASSEMBLY__ */ -+#endif /* ((!defined __ASSEMBLY__) && (defined __KERNEL__) */ - - #endif /* __NO_STUBS */ - diff --git a/patches/linux/2.6.6/100-kaz-types.patch b/patches/linux/2.6.6/100-kaz-types.patch new file mode 100644 index 0000000..ec5de36 --- /dev/null +++ b/patches/linux/2.6.6/100-kaz-types.patch @@ -0,0 +1,60 @@ +The following fixes an error that occurs when building glibc-2.3.2 (but not glibc-2.2.5) for sh4: + +In file included from sys/ustat.h:30, + from ../sysdeps/unix/sysv/linux/ustat.c:21: +../sysdeps/generic/bits/ustat.h:26: error: redefinition of `struct ustat' +make[2]: *** [/home3/dank/crosstool-0.7/build/sh4-unknown-linux-gnu/gcc-3.3-glibc-2.3.2/build-glibc/misc/ustat.o] Error 1 +make[2]: Leaving directory `/home3/dank/crosstool-0.7/build/sh4-unknown-linux-gnu/gcc-3.3-glibc-2.3.2/glibc-2.3.2/misc' +make[1]: *** [misc/subdir_lib] Error 2 +make[1]: Leaving directory `/home3/dank/crosstool-0.7/build/sh4-unknown-linux-gnu/gcc-3.3-glibc-2.3.2/glibc-2.3.2' +make: *** [all] Error 2 + +----------- snip --------------- + +Date: Fri, 06 Jun 2003 08:00:00 +0900 +From: kaz Kojima +Subject: [linux-sh:02770] Re: Compiling glibc-2.3.2 for sh4 fails with "include/asm/user.h:32: + error: redefinition of `struct user_fpu_struct'" +To: linux-sh@m17n.org +Message-Id: <200306052250.h55Moeb08707@r-rr.iij4u.or.jp> + +Hi, + +Dan Kegel wrote: +> When I try to build glibc-2.3.2 for sh4, it fails with the error +[snip] +> /home3/dank/crosstool-0.3/result/sh4-linux/gcc-3.3-glibc-2.3.2/sh4-linux/include/asm/user.h:32: error: redefinition of `struct user_fpu_struct' +> /home3/dank/crosstool-0.3/result/sh4-linux/gcc-3.3-glibc-2.3.2/sh4-linux/include/asm/user.h:39: error: redefinition of `struct user' +[snip] +> The error reminds me of the kind of thing fixed by +> http://www.kegel.com/crossgcc/crosstool-0.4/glibc-2.3.2-patches/sh-user.patch + +It seems that the definitions in asm/user.h and the above patch collide. +I'm not sure why you need this patch, but is it needed for the problem +about struct ustat that you pointed out in this list, isn't it? +I found why I don't hit ustat problem - my local kernel tree includes +the following patch, though I can't recall about it. + +Regards, + kaz +-- +diff -u linux-2.5.69-sf-orig/include/linux/types.h /usr/local/sh4-unknown-linux-gnu/include/linux/types.h +--- linux-2.5.69-sf-orig/include/linux/types.h Wed Mar 5 12:29:34 2003 ++++ sh4-unknown-linux-gnu/include/linux/types.h Sat Apr 19 10:05:52 2003 +@@ -141,6 +141,7 @@ + + #endif /* __KERNEL_STRICT_NAMES */ + ++#ifdef __KERNEL__ + /* + * Below are truly Linux-specific types that should never collide with + * any application/library that wants linux/types.h. +@@ -152,5 +153,6 @@ + char f_fname[6]; + char f_fpack[6]; + }; ++#endif + + #endif /* _LINUX_TYPES_H */ + + diff --git a/patches/linux/2.6.6/110-linux-2.6.5-x86_64-unistd.patch b/patches/linux/2.6.6/110-linux-2.6.5-x86_64-unistd.patch new file mode 100644 index 0000000..829f0d9 --- /dev/null +++ b/patches/linux/2.6.6/110-linux-2.6.5-x86_64-unistd.patch @@ -0,0 +1,80 @@ +Retrieved with wget http://www.x86-64.org/lists/discuss/msg04963.html +then tabs fixed up by rediffing + +Message-Id: EFF62C7EE88E71429E38641A1172F4C2077104@net.teracruz.com +To: discuss@xxxxxxxxxx +Subject: Compile error with glibc 2.3.2 + Linux 2.6.5 ARCH=x86_64 +From: "David Lee" david.lee@xxxxxxxxxxxx +Date: Wed, 21 Apr 2004 15:26:04 -0500 + +I am getting compiler errors when trying to compile glibc 2.3.2 using +the kernel headers from linux 2.6.5. The headers from linux 2.6.3 work +fine. + +I've traced the cause of the problem to a change made in +./include/asm-x86_64/unistd.h in the 2.6.4 release. + ++#ifndef __ASSEMBLY__ ++ ++#include ++#include ++#include ++#include ++ ++asmlinkage long sys_ptrace(long request, long pid, ++ unsigned long addr, long data); ++asmlinkage long sys_iopl(unsigned int level, struct pt_regs regs); ++asmlinkage long sys_ioperm(unsigned long from, unsigned long num, int +turn_on); ++struct sigaction; ++asmlinkage long sys_rt_sigaction(int sig, ++ const struct sigaction __user *act, ++ struct sigaction __user *oact, ++ size_t sigsetsize); ++ ++#endif /* __ASSEMBLY__ */ + +Within glibc, ./sysdeps/unix/sysv/linux/x86_64/syscall.S ends up +including this file, which chokes the assembler with the struct +declarations in the above #include's. + +/home/dlee/vcs/Products/Breeze/Dev/Prj/LinuxRH8/tscale2/tools/x86_64/x86 +_64-linux/glibcinclude/linux/posix_types.h: Assembler messages: +/home/dlee/vcs/Products/Breeze/Dev/Prj/LinuxRH8/tscale2/tools/x86_64/x86 +_64-linux/glibcinclude/linux/posix_types.h:36: Error: no such +instruction: `typedef struct{' + +There are also errors about conflicting re-declarations further along in +the glibc build. + +../posix/sys/types.h:62: error: conflicting types for `dev_t' +/home/dlee/vcs/Products/Breeze/Dev/Prj/LinuxRH8/tscale2/tools/x86_64/x86 +_64-linux/glibcinclude/linux/types.h:23: error: previous declaration of +`dev_t' + +Changing the '#ifndef __ASSEMBLY__' to '#if ((!defined __ASSEMBLY__) && +(defined __KERNEL__))' clears up the problem. My patch is below. + +dave + + +--- linux-2.6.5/include/asm-x86_64/unistd.h.old 2004-04-03 19:37:36.000000000 -0800 ++++ linux-2.6.5/include/asm-x86_64/unistd.h 2004-05-05 11:07:11.000000000 -0700 +@@ -713,7 +713,7 @@ + + #endif /* __KERNEL_SYSCALLS__ */ + +-#ifndef __ASSEMBLY__ ++#if ((!defined __ASSEMBLY__) && (defined __KERNEL__)) + + #include + #include +@@ -730,7 +730,7 @@ + struct sigaction __user *oact, + size_t sigsetsize); + +-#endif /* __ASSEMBLY__ */ ++#endif /* ((!defined __ASSEMBLY__) && (defined __KERNEL__) */ + + #endif /* __NO_STUBS */ + diff --git a/patches/linux/2.6.6/120-linux-2.6.8-noshared-kconfig.patch b/patches/linux/2.6.6/120-linux-2.6.8-noshared-kconfig.patch new file mode 100644 index 0000000..326cdcd --- /dev/null +++ b/patches/linux/2.6.6/120-linux-2.6.8-noshared-kconfig.patch @@ -0,0 +1,28 @@ +Lets you run 'make oldconfig' and 'make menuconfig' on systems +where shared libraries aren't easy. (There's no harm in using the +static version of libkconfig.) +Idea mentioned by Bertrand Marquis, but this patch is a bit simpler than his. + + +--- linux-2.6.8.1/scripts/kconfig/Makefile.old 2004-09-09 20:30:25.000000000 -0700 ++++ linux-2.6.8.1/scripts/kconfig/Makefile 2004-09-09 20:47:51.000000000 -0700 +@@ -68,8 +68,8 @@ + libkconfig-objs := zconf.tab.o + + host-progs := conf mconf qconf gconf +-conf-objs := conf.o libkconfig.so +-mconf-objs := mconf.o libkconfig.so ++conf-objs := conf.o $(libkconfig-objs) ++mconf-objs := mconf.o $(libkconfig-objs) + + ifeq ($(MAKECMDGOALS),xconfig) + qconf-target := 1 +@@ -88,7 +88,7 @@ + gconf-objs := gconf.o kconfig_load.o + endif + +-clean-files := libkconfig.so lkc_defs.h qconf.moc .tmp_qtcheck \ ++clean-files := $(libkconfig-objs) lkc_defs.h qconf.moc .tmp_qtcheck \ + .tmp_gtkcheck zconf.tab.c zconf.tab.h lex.zconf.c + + # generated files seem to need this to find local include files diff --git a/patches/linux/2.6.6/kaz-types.patch b/patches/linux/2.6.6/kaz-types.patch deleted file mode 100644 index ec5de36..0000000 --- a/patches/linux/2.6.6/kaz-types.patch +++ /dev/null @@ -1,60 +0,0 @@ -The following fixes an error that occurs when building glibc-2.3.2 (but not glibc-2.2.5) for sh4: - -In file included from sys/ustat.h:30, - from ../sysdeps/unix/sysv/linux/ustat.c:21: -../sysdeps/generic/bits/ustat.h:26: error: redefinition of `struct ustat' -make[2]: *** [/home3/dank/crosstool-0.7/build/sh4-unknown-linux-gnu/gcc-3.3-glibc-2.3.2/build-glibc/misc/ustat.o] Error 1 -make[2]: Leaving directory `/home3/dank/crosstool-0.7/build/sh4-unknown-linux-gnu/gcc-3.3-glibc-2.3.2/glibc-2.3.2/misc' -make[1]: *** [misc/subdir_lib] Error 2 -make[1]: Leaving directory `/home3/dank/crosstool-0.7/build/sh4-unknown-linux-gnu/gcc-3.3-glibc-2.3.2/glibc-2.3.2' -make: *** [all] Error 2 - ------------ snip --------------- - -Date: Fri, 06 Jun 2003 08:00:00 +0900 -From: kaz Kojima -Subject: [linux-sh:02770] Re: Compiling glibc-2.3.2 for sh4 fails with "include/asm/user.h:32: - error: redefinition of `struct user_fpu_struct'" -To: linux-sh@m17n.org -Message-Id: <200306052250.h55Moeb08707@r-rr.iij4u.or.jp> - -Hi, - -Dan Kegel wrote: -> When I try to build glibc-2.3.2 for sh4, it fails with the error -[snip] -> /home3/dank/crosstool-0.3/result/sh4-linux/gcc-3.3-glibc-2.3.2/sh4-linux/include/asm/user.h:32: error: redefinition of `struct user_fpu_struct' -> /home3/dank/crosstool-0.3/result/sh4-linux/gcc-3.3-glibc-2.3.2/sh4-linux/include/asm/user.h:39: error: redefinition of `struct user' -[snip] -> The error reminds me of the kind of thing fixed by -> http://www.kegel.com/crossgcc/crosstool-0.4/glibc-2.3.2-patches/sh-user.patch - -It seems that the definitions in asm/user.h and the above patch collide. -I'm not sure why you need this patch, but is it needed for the problem -about struct ustat that you pointed out in this list, isn't it? -I found why I don't hit ustat problem - my local kernel tree includes -the following patch, though I can't recall about it. - -Regards, - kaz --- -diff -u linux-2.5.69-sf-orig/include/linux/types.h /usr/local/sh4-unknown-linux-gnu/include/linux/types.h ---- linux-2.5.69-sf-orig/include/linux/types.h Wed Mar 5 12:29:34 2003 -+++ sh4-unknown-linux-gnu/include/linux/types.h Sat Apr 19 10:05:52 2003 -@@ -141,6 +141,7 @@ - - #endif /* __KERNEL_STRICT_NAMES */ - -+#ifdef __KERNEL__ - /* - * Below are truly Linux-specific types that should never collide with - * any application/library that wants linux/types.h. -@@ -152,5 +153,6 @@ - char f_fname[6]; - char f_fpack[6]; - }; -+#endif - - #endif /* _LINUX_TYPES_H */ - - diff --git a/patches/linux/2.6.6/linux-2.6.5-x86_64-unistd.patch b/patches/linux/2.6.6/linux-2.6.5-x86_64-unistd.patch deleted file mode 100644 index 829f0d9..0000000 --- a/patches/linux/2.6.6/linux-2.6.5-x86_64-unistd.patch +++ /dev/null @@ -1,80 +0,0 @@ -Retrieved with wget http://www.x86-64.org/lists/discuss/msg04963.html -then tabs fixed up by rediffing - -Message-Id: EFF62C7EE88E71429E38641A1172F4C2077104@net.teracruz.com -To: discuss@xxxxxxxxxx -Subject: Compile error with glibc 2.3.2 + Linux 2.6.5 ARCH=x86_64 -From: "David Lee" david.lee@xxxxxxxxxxxx -Date: Wed, 21 Apr 2004 15:26:04 -0500 - -I am getting compiler errors when trying to compile glibc 2.3.2 using -the kernel headers from linux 2.6.5. The headers from linux 2.6.3 work -fine. - -I've traced the cause of the problem to a change made in -./include/asm-x86_64/unistd.h in the 2.6.4 release. - -+#ifndef __ASSEMBLY__ -+ -+#include -+#include -+#include -+#include -+ -+asmlinkage long sys_ptrace(long request, long pid, -+ unsigned long addr, long data); -+asmlinkage long sys_iopl(unsigned int level, struct pt_regs regs); -+asmlinkage long sys_ioperm(unsigned long from, unsigned long num, int -turn_on); -+struct sigaction; -+asmlinkage long sys_rt_sigaction(int sig, -+ const struct sigaction __user *act, -+ struct sigaction __user *oact, -+ size_t sigsetsize); -+ -+#endif /* __ASSEMBLY__ */ - -Within glibc, ./sysdeps/unix/sysv/linux/x86_64/syscall.S ends up -including this file, which chokes the assembler with the struct -declarations in the above #include's. - -/home/dlee/vcs/Products/Breeze/Dev/Prj/LinuxRH8/tscale2/tools/x86_64/x86 -_64-linux/glibcinclude/linux/posix_types.h: Assembler messages: -/home/dlee/vcs/Products/Breeze/Dev/Prj/LinuxRH8/tscale2/tools/x86_64/x86 -_64-linux/glibcinclude/linux/posix_types.h:36: Error: no such -instruction: `typedef struct{' - -There are also errors about conflicting re-declarations further along in -the glibc build. - -../posix/sys/types.h:62: error: conflicting types for `dev_t' -/home/dlee/vcs/Products/Breeze/Dev/Prj/LinuxRH8/tscale2/tools/x86_64/x86 -_64-linux/glibcinclude/linux/types.h:23: error: previous declaration of -`dev_t' - -Changing the '#ifndef __ASSEMBLY__' to '#if ((!defined __ASSEMBLY__) && -(defined __KERNEL__))' clears up the problem. My patch is below. - -dave - - ---- linux-2.6.5/include/asm-x86_64/unistd.h.old 2004-04-03 19:37:36.000000000 -0800 -+++ linux-2.6.5/include/asm-x86_64/unistd.h 2004-05-05 11:07:11.000000000 -0700 -@@ -713,7 +713,7 @@ - - #endif /* __KERNEL_SYSCALLS__ */ - --#ifndef __ASSEMBLY__ -+#if ((!defined __ASSEMBLY__) && (defined __KERNEL__)) - - #include - #include -@@ -730,7 +730,7 @@ - struct sigaction __user *oact, - size_t sigsetsize); - --#endif /* __ASSEMBLY__ */ -+#endif /* ((!defined __ASSEMBLY__) && (defined __KERNEL__) */ - - #endif /* __NO_STUBS */ - diff --git a/patches/linux/2.6.6/linux-2.6.8-noshared-kconfig.patch b/patches/linux/2.6.6/linux-2.6.8-noshared-kconfig.patch deleted file mode 100644 index 326cdcd..0000000 --- a/patches/linux/2.6.6/linux-2.6.8-noshared-kconfig.patch +++ /dev/null @@ -1,28 +0,0 @@ -Lets you run 'make oldconfig' and 'make menuconfig' on systems -where shared libraries aren't easy. (There's no harm in using the -static version of libkconfig.) -Idea mentioned by Bertrand Marquis, but this patch is a bit simpler than his. - - ---- linux-2.6.8.1/scripts/kconfig/Makefile.old 2004-09-09 20:30:25.000000000 -0700 -+++ linux-2.6.8.1/scripts/kconfig/Makefile 2004-09-09 20:47:51.000000000 -0700 -@@ -68,8 +68,8 @@ - libkconfig-objs := zconf.tab.o - - host-progs := conf mconf qconf gconf --conf-objs := conf.o libkconfig.so --mconf-objs := mconf.o libkconfig.so -+conf-objs := conf.o $(libkconfig-objs) -+mconf-objs := mconf.o $(libkconfig-objs) - - ifeq ($(MAKECMDGOALS),xconfig) - qconf-target := 1 -@@ -88,7 +88,7 @@ - gconf-objs := gconf.o kconfig_load.o - endif - --clean-files := libkconfig.so lkc_defs.h qconf.moc .tmp_qtcheck \ -+clean-files := $(libkconfig-objs) lkc_defs.h qconf.moc .tmp_qtcheck \ - .tmp_gtkcheck zconf.tab.c zconf.tab.h lex.zconf.c - - # generated files seem to need this to find local include files diff --git a/patches/linux/2.6.7/100-kaz-types.patch b/patches/linux/2.6.7/100-kaz-types.patch new file mode 100644 index 0000000..ec5de36 --- /dev/null +++ b/patches/linux/2.6.7/100-kaz-types.patch @@ -0,0 +1,60 @@ +The following fixes an error that occurs when building glibc-2.3.2 (but not glibc-2.2.5) for sh4: + +In file included from sys/ustat.h:30, + from ../sysdeps/unix/sysv/linux/ustat.c:21: +../sysdeps/generic/bits/ustat.h:26: error: redefinition of `struct ustat' +make[2]: *** [/home3/dank/crosstool-0.7/build/sh4-unknown-linux-gnu/gcc-3.3-glibc-2.3.2/build-glibc/misc/ustat.o] Error 1 +make[2]: Leaving directory `/home3/dank/crosstool-0.7/build/sh4-unknown-linux-gnu/gcc-3.3-glibc-2.3.2/glibc-2.3.2/misc' +make[1]: *** [misc/subdir_lib] Error 2 +make[1]: Leaving directory `/home3/dank/crosstool-0.7/build/sh4-unknown-linux-gnu/gcc-3.3-glibc-2.3.2/glibc-2.3.2' +make: *** [all] Error 2 + +----------- snip --------------- + +Date: Fri, 06 Jun 2003 08:00:00 +0900 +From: kaz Kojima +Subject: [linux-sh:02770] Re: Compiling glibc-2.3.2 for sh4 fails with "include/asm/user.h:32: + error: redefinition of `struct user_fpu_struct'" +To: linux-sh@m17n.org +Message-Id: <200306052250.h55Moeb08707@r-rr.iij4u.or.jp> + +Hi, + +Dan Kegel wrote: +> When I try to build glibc-2.3.2 for sh4, it fails with the error +[snip] +> /home3/dank/crosstool-0.3/result/sh4-linux/gcc-3.3-glibc-2.3.2/sh4-linux/include/asm/user.h:32: error: redefinition of `struct user_fpu_struct' +> /home3/dank/crosstool-0.3/result/sh4-linux/gcc-3.3-glibc-2.3.2/sh4-linux/include/asm/user.h:39: error: redefinition of `struct user' +[snip] +> The error reminds me of the kind of thing fixed by +> http://www.kegel.com/crossgcc/crosstool-0.4/glibc-2.3.2-patches/sh-user.patch + +It seems that the definitions in asm/user.h and the above patch collide. +I'm not sure why you need this patch, but is it needed for the problem +about struct ustat that you pointed out in this list, isn't it? +I found why I don't hit ustat problem - my local kernel tree includes +the following patch, though I can't recall about it. + +Regards, + kaz +-- +diff -u linux-2.5.69-sf-orig/include/linux/types.h /usr/local/sh4-unknown-linux-gnu/include/linux/types.h +--- linux-2.5.69-sf-orig/include/linux/types.h Wed Mar 5 12:29:34 2003 ++++ sh4-unknown-linux-gnu/include/linux/types.h Sat Apr 19 10:05:52 2003 +@@ -141,6 +141,7 @@ + + #endif /* __KERNEL_STRICT_NAMES */ + ++#ifdef __KERNEL__ + /* + * Below are truly Linux-specific types that should never collide with + * any application/library that wants linux/types.h. +@@ -152,5 +153,6 @@ + char f_fname[6]; + char f_fpack[6]; + }; ++#endif + + #endif /* _LINUX_TYPES_H */ + + diff --git a/patches/linux/2.6.7/110-linux-2.6.7-build_on_case_insensitive_fs-1.patch b/patches/linux/2.6.7/110-linux-2.6.7-build_on_case_insensitive_fs-1.patch new file mode 100644 index 0000000..c9e0dd3 --- /dev/null +++ b/patches/linux/2.6.7/110-linux-2.6.7-build_on_case_insensitive_fs-1.patch @@ -0,0 +1,679 @@ +Submitted By: Martin Schaffner +Date: 2004-06-19 +Initial Package Version: 2.6.7 +Upstream Status: Not submitted +Origin: Martin Schaffner +Description: Enables build on case-insensitive file systems +URL: http://mirror.vtx.ch/lfs/patches/downloads/linux/linux-2.6.7-build_on_case_insensitive_fs-1.patch + +diff -ur linux-2.6.7/Makefile linux-2.6.7-mod/Makefile +--- linux-2.6.7/Makefile Fri Jun 18 22:51:03 2004 ++++ linux-2.6.7-mod/Makefile Sat Jun 19 12:43:10 2004 +@@ -549,7 +549,7 @@ + $(NM) $@ | grep -v '\(compiled\)\|\(\.o$$\)\|\( [aUw] \)\|\(\.\.ng$$\)\|\(LASH[RL]DI\)' | sort > System.map + endef + +-LDFLAGS_vmlinux += -T arch/$(ARCH)/kernel/vmlinux.lds.s ++LDFLAGS_vmlinux += -T arch/$(ARCH)/kernel/vmlinux.lds.asm + + # Generate section listing all symbols and add it into vmlinux + # It's a three stage process: +@@ -575,23 +575,23 @@ + .tmp_kallsyms%.S: .tmp_vmlinux% + $(call cmd,kallsyms) + +-.tmp_vmlinux1: $(vmlinux-objs) arch/$(ARCH)/kernel/vmlinux.lds.s FORCE ++.tmp_vmlinux1: $(vmlinux-objs) arch/$(ARCH)/kernel/vmlinux.lds.asm FORCE + +$(call if_changed_rule,vmlinux__) + +-.tmp_vmlinux2: $(vmlinux-objs) .tmp_kallsyms1.o arch/$(ARCH)/kernel/vmlinux.lds.s FORCE ++.tmp_vmlinux2: $(vmlinux-objs) .tmp_kallsyms1.o arch/$(ARCH)/kernel/vmlinux.lds.asm FORCE + $(call if_changed_rule,vmlinux__) + + endif + + # Finally the vmlinux rule + +-vmlinux: $(vmlinux-objs) $(kallsyms.o) arch/$(ARCH)/kernel/vmlinux.lds.s FORCE ++vmlinux: $(vmlinux-objs) $(kallsyms.o) arch/$(ARCH)/kernel/vmlinux.lds.asm FORCE + $(call if_changed_rule,vmlinux) + + # The actual objects are generated when descending, + # make sure no implicit rule kicks in + +-$(sort $(vmlinux-objs)) arch/$(ARCH)/kernel/vmlinux.lds.s: $(vmlinux-dirs) ; ++$(sort $(vmlinux-objs)) arch/$(ARCH)/kernel/vmlinux.lds.asm: $(vmlinux-dirs) ; + + # Handle descending into subdirectories listed in $(vmlinux-dirs) + +@@ -640,7 +640,7 @@ + # Single targets + # --------------------------------------------------------------------------- + +-%.s: %.c scripts FORCE ++%.asm: %.c scripts FORCE + $(Q)$(MAKE) $(build)=$(@D) $@ + %.i: %.c scripts FORCE + $(Q)$(MAKE) $(build)=$(@D) $@ +@@ -650,7 +650,7 @@ + $(Q)$(MAKE) KBUILD_MODULES=$(if $(CONFIG_MODULES),1) $(build)=$(@D) + %.lst: %.c scripts FORCE + $(Q)$(MAKE) $(build)=$(@D) $@ +-%.s: %.S scripts FORCE ++%.asm: %.S scripts FORCE + $(Q)$(MAKE) $(build)=$(@D) $@ + %.o: %.S scripts FORCE + $(Q)$(MAKE) $(build)=$(@D) $@ +diff -ur linux-2.6.7/arch/alpha/Makefile linux-2.6.7-mod/arch/alpha/Makefile +--- linux-2.6.7/arch/alpha/Makefile Fri Jun 18 22:51:03 2004 ++++ linux-2.6.7-mod/arch/alpha/Makefile Sat Jun 19 12:46:32 2004 +@@ -114,10 +114,10 @@ + + prepare: include/asm-$(ARCH)/asm_offsets.h + +-arch/$(ARCH)/kernel/asm-offsets.s: include/asm include/linux/version.h \ ++arch/$(ARCH)/kernel/asm-offsets.asm: include/asm include/linux/version.h \ + include/config/MARKER + +-include/asm-$(ARCH)/asm_offsets.h: arch/$(ARCH)/kernel/asm-offsets.s ++include/asm-$(ARCH)/asm_offsets.h: arch/$(ARCH)/kernel/asm-offsets.asm + $(call filechk,gen-asm-offsets) + + archclean: +diff -ur linux-2.6.7/arch/alpha/kernel/Makefile linux-2.6.7-mod/arch/alpha/kernel/Makefile +--- linux-2.6.7/arch/alpha/kernel/Makefile Mon May 10 04:32:29 2004 ++++ linux-2.6.7-mod/arch/alpha/kernel/Makefile Sat Jun 19 12:46:48 2004 +@@ -2,7 +2,7 @@ + # Makefile for the linux kernel. + # + +-extra-y := head.o vmlinux.lds.s ++extra-y := head.o vmlinux.lds.asm + EXTRA_AFLAGS := $(CFLAGS) + EXTRA_CFLAGS := -Werror -Wno-sign-compare + +diff -ur linux-2.6.7/arch/arm/Makefile linux-2.6.7-mod/arch/arm/Makefile +--- linux-2.6.7/arch/arm/Makefile Fri Jun 18 22:51:04 2004 ++++ linux-2.6.7-mod/arch/arm/Makefile Sat Jun 19 12:47:07 2004 +@@ -175,10 +175,10 @@ + i:; $(Q)$(MAKE) $(build)=$(boot) install + zi:; $(Q)$(MAKE) $(build)=$(boot) zinstall + +-arch/$(ARCH)/kernel/asm-offsets.s: include/asm include/linux/version.h \ ++arch/$(ARCH)/kernel/asm-offsets.asm: include/asm include/linux/version.h \ + include/asm-arm/.arch + +-include/asm-$(ARCH)/constants.h: arch/$(ARCH)/kernel/asm-offsets.s ++include/asm-$(ARCH)/constants.h: arch/$(ARCH)/kernel/asm-offsets.asm + $(call filechk,gen-asm-offsets) + + define archhelp +diff -ur linux-2.6.7/arch/arm/kernel/Makefile linux-2.6.7-mod/arch/arm/kernel/Makefile +--- linux-2.6.7/arch/arm/kernel/Makefile Mon May 10 04:33:19 2004 ++++ linux-2.6.7-mod/arch/arm/kernel/Makefile Sat Jun 19 12:47:25 2004 +@@ -27,7 +27,7 @@ + head-y := head.o + obj-$(CONFIG_DEBUG_LL) += debug.o + +-extra-y := $(head-y) init_task.o vmlinux.lds.s ++extra-y := $(head-y) init_task.o vmlinux.lds.asm + + # Spell out some dependencies that aren't automatically figured out + $(obj)/entry-armv.o: $(obj)/entry-header.S include/asm-arm/constants.h +diff -ur linux-2.6.7/arch/arm26/Makefile linux-2.6.7-mod/arch/arm26/Makefile +--- linux-2.6.7/arch/arm26/Makefile Mon May 10 04:32:28 2004 ++++ linux-2.6.7-mod/arch/arm26/Makefile Sat Jun 19 12:48:24 2004 +@@ -101,10 +101,10 @@ + fi; \ + ) + +-arch/$(ARCH)/kernel/asm-offsets.s: include/asm include/linux/version.h \ ++arch/$(ARCH)/kernel/asm-offsets.asm: include/asm include/linux/version.h \ + include/config/MARKER + +-include/asm-$(ARCH)/asm_offsets.h: arch/$(ARCH)/kernel/asm-offsets.s ++include/asm-$(ARCH)/asm_offsets.h: arch/$(ARCH)/kernel/asm-offsets.asm + $(call filechk,gen-asm-offsets) + + define archhelp +diff -ur linux-2.6.7/arch/arm26/kernel/Makefile linux-2.6.7-mod/arch/arm26/kernel/Makefile +--- linux-2.6.7/arch/arm26/kernel/Makefile Mon May 10 04:32:29 2004 ++++ linux-2.6.7-mod/arch/arm26/kernel/Makefile Sat Jun 19 12:48:30 2004 +@@ -14,5 +14,5 @@ + obj-$(CONFIG_FIQ) += fiq.o + obj-$(CONFIG_MODULES) += armksyms.o + +-extra-y := init_task.o vmlinux.lds.s ++extra-y := init_task.o vmlinux.lds.asm + +diff -ur linux-2.6.7/arch/cris/Makefile linux-2.6.7-mod/arch/cris/Makefile +--- linux-2.6.7/arch/cris/Makefile Fri Jun 18 22:51:07 2004 ++++ linux-2.6.7-mod/arch/cris/Makefile Sat Jun 19 12:48:47 2004 +@@ -107,8 +107,8 @@ + @ln -sf $(SARCH) include/asm-$(ARCH)/arch + @touch $@ + +-arch/$(ARCH)/$(SARCH)/kernel/asm-offsets.s: include/asm include/linux/version.h \ ++arch/$(ARCH)/$(SARCH)/kernel/asm-offsets.asm: include/asm include/linux/version.h \ + include/config/MARKER + +-include/asm-$(ARCH)/$(SARCH)/offset.h: arch/$(ARCH)/$(SARCH)/kernel/asm-offsets.s ++include/asm-$(ARCH)/$(SARCH)/offset.h: arch/$(ARCH)/$(SARCH)/kernel/asm-offsets.asm + $(call filechk,gen-asm-offsets) +diff -ur linux-2.6.7/arch/cris/kernel/Makefile linux-2.6.7-mod/arch/cris/kernel/Makefile +--- linux-2.6.7/arch/cris/kernel/Makefile Fri Jun 18 22:51:09 2004 ++++ linux-2.6.7-mod/arch/cris/kernel/Makefile Sat Jun 19 12:48:53 2004 +@@ -3,7 +3,7 @@ + # Makefile for the linux kernel. + # + +-extra-y := vmlinux.lds.s ++extra-y := vmlinux.lds.asm + + obj-y := process.o traps.o irq.o ptrace.o setup.o \ + time.o sys_cris.o semaphore.o +diff -ur linux-2.6.7/arch/h8300/Makefile linux-2.6.7-mod/arch/h8300/Makefile +--- linux-2.6.7/arch/h8300/Makefile Fri Jun 18 22:51:09 2004 ++++ linux-2.6.7-mod/arch/h8300/Makefile Sat Jun 19 12:49:12 2004 +@@ -64,7 +64,7 @@ + + prepare: include/asm-$(ARCH)/asm-offsets.h + +-include/asm-$(ARCH)/asm-offsets.h: arch/$(ARCH)/kernel/asm-offsets.s \ ++include/asm-$(ARCH)/asm-offsets.h: arch/$(ARCH)/kernel/asm-offsets.asm \ + include/asm include/linux/version.h + $(call filechk,gen-asm-offsets) + +diff -ur linux-2.6.7/arch/h8300/kernel/Makefile linux-2.6.7-mod/arch/h8300/kernel/Makefile +--- linux-2.6.7/arch/h8300/kernel/Makefile Fri Jun 18 22:51:09 2004 ++++ linux-2.6.7-mod/arch/h8300/kernel/Makefile Sat Jun 19 12:49:32 2004 +@@ -2,7 +2,7 @@ + # Makefile for the linux kernel. + # + +-extra-y := vmlinux.lds.s ++extra-y := vmlinux.lds.asm + + obj-y := process.o traps.o ptrace.o ints.o \ + sys_h8300.o time.o semaphore.o signal.o \ +diff -ur linux-2.6.7/arch/i386/Makefile linux-2.6.7-mod/arch/i386/Makefile +--- linux-2.6.7/arch/i386/Makefile Fri Jun 18 22:51:10 2004 ++++ linux-2.6.7-mod/arch/i386/Makefile Sat Jun 19 12:49:43 2004 +@@ -141,10 +141,10 @@ + prepare: include/asm-$(ARCH)/asm_offsets.h + CLEAN_FILES += include/asm-$(ARCH)/asm_offsets.h + +-arch/$(ARCH)/kernel/asm-offsets.s: include/asm include/linux/version.h \ ++arch/$(ARCH)/kernel/asm-offsets.asm: include/asm include/linux/version.h \ + include/config/MARKER + +-include/asm-$(ARCH)/asm_offsets.h: arch/$(ARCH)/kernel/asm-offsets.s ++include/asm-$(ARCH)/asm_offsets.h: arch/$(ARCH)/kernel/asm-offsets.asm + $(call filechk,gen-asm-offsets) + + archclean: +diff -ur linux-2.6.7/arch/i386/kernel/Makefile linux-2.6.7-mod/arch/i386/kernel/Makefile +--- linux-2.6.7/arch/i386/kernel/Makefile Mon May 10 04:32:02 2004 ++++ linux-2.6.7-mod/arch/i386/kernel/Makefile Sat Jun 19 12:49:54 2004 +@@ -2,7 +2,7 @@ + # Makefile for the linux kernel. + # + +-extra-y := head.o init_task.o vmlinux.lds.s ++extra-y := head.o init_task.o vmlinux.lds.asm + + obj-y := process.o semaphore.o signal.o entry.o traps.o irq.o vm86.o \ + ptrace.o i8259.o ioport.o ldt.o setup.o time.o sys_i386.o \ +diff -ur linux-2.6.7/arch/ia64/Makefile linux-2.6.7-mod/arch/ia64/Makefile +--- linux-2.6.7/arch/ia64/Makefile Mon May 10 04:31:59 2004 ++++ linux-2.6.7-mod/arch/ia64/Makefile Sat Jun 19 12:50:12 2004 +@@ -88,12 +88,12 @@ + + prepare: include/asm-ia64/offsets.h + +-arch/ia64/kernel/asm-offsets.s: include/asm include/linux/version.h include/config/MARKER ++arch/ia64/kernel/asm-offsets.asm: include/asm include/linux/version.h include/config/MARKER + +-include/asm-ia64/offsets.h: arch/ia64/kernel/asm-offsets.s ++include/asm-ia64/offsets.h: arch/ia64/kernel/asm-offsets.asm + $(call filechk,gen-asm-offsets) + +-arch/ia64/kernel/asm-offsets.s: include/asm-ia64/.offsets.h.stamp ++arch/ia64/kernel/asm-offsets.asm: include/asm-ia64/.offsets.h.stamp + + include/asm-ia64/.offsets.h.stamp: + mkdir -p include/asm-ia64 +diff -ur linux-2.6.7/arch/ia64/kernel/Makefile linux-2.6.7-mod/arch/ia64/kernel/Makefile +--- linux-2.6.7/arch/ia64/kernel/Makefile Fri Jun 18 22:51:13 2004 ++++ linux-2.6.7-mod/arch/ia64/kernel/Makefile Sat Jun 19 12:52:14 2004 +@@ -2,7 +2,7 @@ + # Makefile for the linux kernel. + # + +-extra-y := head.o init_task.o vmlinux.lds.s ++extra-y := head.o init_task.o vmlinux.lds.asm + + obj-y := acpi.o entry.o efi.o efi_stub.o gate-data.o fsys.o ia64_ksyms.o irq.o irq_ia64.o \ + irq_lsapic.o ivt.o machvec.o pal.o patch.o process.o perfmon.o ptrace.o sal.o \ +@@ -21,7 +21,7 @@ + # The gate DSO image is built using a special linker script. + targets += gate.so gate-syms.o + +-extra-y += gate.so gate-syms.o gate.lds.s gate.o ++extra-y += gate.so gate-syms.o gate.lds.asm gate.o + + # fp_emulate() expects f2-f5,f16-f31 to contain the user-level state. + CFLAGS_traps.o += -mfixed-range=f2-f5,f16-f31 +@@ -32,14 +32,14 @@ + cmd_gate = $(CC) -nostdlib $(GATECFLAGS_$(@F)) -Wl,-T,$(filter-out FORCE,$^) -o $@ + + GATECFLAGS_gate.so = -shared -s -Wl,-soname=linux-gate.so.1 +-$(obj)/gate.so: $(obj)/gate.lds.s $(obj)/gate.o FORCE ++$(obj)/gate.so: $(obj)/gate.lds.asm $(obj)/gate.o FORCE + $(call if_changed,gate) + + $(obj)/built-in.o: $(obj)/gate-syms.o + $(obj)/built-in.o: ld_flags += -R $(obj)/gate-syms.o + + GATECFLAGS_gate-syms.o = -r +-$(obj)/gate-syms.o: $(src)/gate.lds.s $(obj)/gate.o FORCE ++$(obj)/gate-syms.o: $(src)/gate.lds.asm $(obj)/gate.o FORCE + $(call if_changed,gate) + + # gate-data.o contains the gate DSO image as data in section .data.gate. +diff -ur linux-2.6.7/arch/m68k/Makefile linux-2.6.7-mod/arch/m68k/Makefile +--- linux-2.6.7/arch/m68k/Makefile Fri Jun 18 22:51:14 2004 ++++ linux-2.6.7-mod/arch/m68k/Makefile Sat Jun 19 12:52:30 2004 +@@ -114,10 +114,10 @@ + prepare: include/asm-$(ARCH)/offsets.h + CLEAN_FILES += include/asm-$(ARCH)/offsets.h + +-arch/$(ARCH)/kernel/asm-offsets.s: include/asm include/linux/version.h \ ++arch/$(ARCH)/kernel/asm-offsets.asm: include/asm include/linux/version.h \ + include/config/MARKER + +-include/asm-$(ARCH)/offsets.h: arch/$(ARCH)/kernel/asm-offsets.s ++include/asm-$(ARCH)/offsets.h: arch/$(ARCH)/kernel/asm-offsets.asm + $(call filechk,gen-asm-offsets) + + archclean: +diff -ur linux-2.6.7/arch/m68k/kernel/Makefile linux-2.6.7-mod/arch/m68k/kernel/Makefile +--- linux-2.6.7/arch/m68k/kernel/Makefile Mon May 10 04:33:10 2004 ++++ linux-2.6.7-mod/arch/m68k/kernel/Makefile Sat Jun 19 12:52:35 2004 +@@ -7,7 +7,7 @@ + else + extra-y := sun3-head.o + endif +-extra-y += vmlinux.lds.s ++extra-y += vmlinux.lds.asm + + obj-y := entry.o process.o traps.o ints.o signal.o ptrace.o \ + sys_m68k.o time.o semaphore.o setup.o m68k_ksyms.o +diff -ur linux-2.6.7/arch/m68knommu/Makefile linux-2.6.7-mod/arch/m68knommu/Makefile +--- linux-2.6.7/arch/m68knommu/Makefile Mon May 10 04:32:54 2004 ++++ linux-2.6.7-mod/arch/m68knommu/Makefile Sat Jun 19 12:52:57 2004 +@@ -89,7 +89,7 @@ + head-y := arch/m68knommu/platform/$(platform-y)/$(board-y)/crt0_$(model-y).o + + CLEAN_FILES := include/asm-$(ARCH)/asm-offsets.h \ +- arch/$(ARCH)/kernel/asm-offsets.s ++ arch/$(ARCH)/kernel/asm-offsets.asm + + core-y += arch/m68knommu/kernel/ \ + arch/m68knommu/mm/ \ +@@ -102,7 +102,7 @@ + archclean: + $(call descend arch/$(ARCH)/boot, subdirclean) + +-include/asm-$(ARCH)/asm-offsets.h: arch/$(ARCH)/kernel/asm-offsets.s \ ++include/asm-$(ARCH)/asm-offsets.h: arch/$(ARCH)/kernel/asm-offsets.asm \ + include/asm include/linux/version.h \ + include/config/MARKER + $(call filechk,gen-asm-offsets) +diff -ur linux-2.6.7/arch/m68knommu/kernel/Makefile linux-2.6.7-mod/arch/m68knommu/kernel/Makefile +--- linux-2.6.7/arch/m68knommu/kernel/Makefile Mon May 10 04:32:26 2004 ++++ linux-2.6.7-mod/arch/m68knommu/kernel/Makefile Sat Jun 19 12:53:20 2004 +@@ -2,7 +2,7 @@ + # Makefile for arch/m68knommu/kernel. + # + +-extra-y := vmlinux.lds.s ++extra-y := vmlinux.lds.asm + + obj-y += dma.o entry.o init_task.o m68k_ksyms.o process.o ptrace.o semaphore.o \ + setup.o signal.o syscalltable.o sys_m68k.o time.o traps.o +diff -ur linux-2.6.7/arch/mips/Makefile linux-2.6.7-mod/arch/mips/Makefile +--- linux-2.6.7/arch/mips/Makefile Fri Jun 18 22:51:19 2004 ++++ linux-2.6.7-mod/arch/mips/Makefile Sat Jun 19 12:53:35 2004 +@@ -752,12 +752,12 @@ + prepare: include/asm-$(ARCH)/offset.h \ + include/asm-$(ARCH)/reg.h + +-arch/$(ARCH)/kernel/offset.s: include/asm include/linux/version.h \ ++arch/$(ARCH)/kernel/offset.asm: include/asm include/linux/version.h \ + include/config/MARKER + +-include/asm-$(ARCH)/offset.h: arch/$(ARCH)/kernel/offset.s ++include/asm-$(ARCH)/offset.h: arch/$(ARCH)/kernel/offset.asm + $(call filechk,gen-asm-offset.h) +-include/asm-$(ARCH)/reg.h: arch/$(ARCH)/kernel/reg.s ++include/asm-$(ARCH)/reg.h: arch/$(ARCH)/kernel/reg.asm + $(call filechk,gen-asm-reg.h) + + CLEAN_FILES += include/asm-$(ARCH)/offset.h.tmp \ +diff -ur linux-2.6.7/arch/mips/kernel/Makefile linux-2.6.7-mod/arch/mips/kernel/Makefile +--- linux-2.6.7/arch/mips/kernel/Makefile Mon May 10 04:32:28 2004 ++++ linux-2.6.7-mod/arch/mips/kernel/Makefile Sat Jun 19 12:53:41 2004 +@@ -2,7 +2,7 @@ + # Makefile for the Linux/MIPS kernel. + # + +-extra-y := head.o init_task.o vmlinux.lds.s ++extra-y := head.o init_task.o vmlinux.lds.asm + + obj-y += cpu-probe.o branch.o entry.o genex.o irq.o process.o \ + ptrace.o reset.o semaphore.o setup.o signal.o syscall.o \ +diff -ur linux-2.6.7/arch/parisc/Makefile linux-2.6.7-mod/arch/parisc/Makefile +--- linux-2.6.7/arch/parisc/Makefile Fri Jun 18 22:51:21 2004 ++++ linux-2.6.7-mod/arch/parisc/Makefile Sat Jun 19 12:53:47 2004 +@@ -88,10 +88,10 @@ + + prepare: include/asm-parisc/offsets.h + +-arch/parisc/kernel/asm-offsets.s: include/asm include/linux/version.h \ ++arch/parisc/kernel/asm-offsets.asm: include/asm include/linux/version.h \ + include/config/MARKER + +-include/asm-parisc/offsets.h: arch/parisc/kernel/asm-offsets.s ++include/asm-parisc/offsets.h: arch/parisc/kernel/asm-offsets.asm + $(call filechk,gen-asm-offsets) + + CLEAN_FILES += lifimage include/asm-parisc/offsets.h +diff -ur linux-2.6.7/arch/parisc/kernel/Makefile linux-2.6.7-mod/arch/parisc/kernel/Makefile +--- linux-2.6.7/arch/parisc/kernel/Makefile Fri Jun 18 22:51:21 2004 ++++ linux-2.6.7-mod/arch/parisc/kernel/Makefile Sat Jun 19 12:53:53 2004 +@@ -4,7 +4,7 @@ + + head-y := head.o + head-$(CONFIG_PARISC64) := head64.o +-extra-y := init_task.o $(head-y) vmlinux.lds.s ++extra-y := init_task.o $(head-y) vmlinux.lds.asm + + AFLAGS_entry.o := -traditional + AFLAGS_pacache.o := -traditional +diff -ur linux-2.6.7/arch/ppc/Makefile linux-2.6.7-mod/arch/ppc/Makefile +--- linux-2.6.7/arch/ppc/Makefile Fri Jun 18 22:51:22 2004 ++++ linux-2.6.7-mod/arch/ppc/Makefile Sat Jun 19 12:54:09 2004 +@@ -78,10 +78,10 @@ + + prepare: include/asm-$(ARCH)/offsets.h checkbin + +-arch/$(ARCH)/kernel/asm-offsets.s: include/asm include/linux/version.h \ ++arch/$(ARCH)/kernel/asm-offsets.asm: include/asm include/linux/version.h \ + include/config/MARKER + +-include/asm-$(ARCH)/offsets.h: arch/$(ARCH)/kernel/asm-offsets.s ++include/asm-$(ARCH)/offsets.h: arch/$(ARCH)/kernel/asm-offsets.asm + $(call filechk,gen-asm-offsets) + + ifdef CONFIG_6xx +@@ -104,4 +104,4 @@ + endif + + CLEAN_FILES += include/asm-$(ARCH)/offsets.h \ +- arch/$(ARCH)/kernel/asm-offsets.s ++ arch/$(ARCH)/kernel/asm-offsets.asm +diff -ur linux-2.6.7/arch/ppc/kernel/Makefile linux-2.6.7-mod/arch/ppc/kernel/Makefile +--- linux-2.6.7/arch/ppc/kernel/Makefile Fri Jun 18 22:51:24 2004 ++++ linux-2.6.7-mod/arch/ppc/kernel/Makefile Sat Jun 19 12:43:10 2004 +@@ -15,7 +15,7 @@ + extra-$(CONFIG_8xx) := head_8xx.o + extra-$(CONFIG_6xx) += idle_6xx.o + extra-$(CONFIG_POWER4) += idle_power4.o +-extra-y += vmlinux.lds.s ++extra-y += vmlinux.lds.asm + + obj-y := entry.o traps.o irq.o idle.o time.o misc.o \ + process.o signal.o ptrace.o align.o \ +diff -ur linux-2.6.7/arch/ppc64/Makefile linux-2.6.7-mod/arch/ppc64/Makefile +--- linux-2.6.7/arch/ppc64/Makefile Fri Jun 18 22:51:26 2004 ++++ linux-2.6.7-mod/arch/ppc64/Makefile Sat Jun 19 12:54:32 2004 +@@ -67,10 +67,10 @@ + + prepare: include/asm-ppc64/offsets.h + +-arch/ppc64/kernel/asm-offsets.s: include/asm include/linux/version.h \ ++arch/ppc64/kernel/asm-offsets.asm: include/asm include/linux/version.h \ + include/config/MARKER + +-include/asm-ppc64/offsets.h: arch/ppc64/kernel/asm-offsets.s ++include/asm-ppc64/offsets.h: arch/ppc64/kernel/asm-offsets.asm + $(call filechk,gen-asm-offsets) + + define archhelp +diff -ur linux-2.6.7/arch/ppc64/kernel/Makefile linux-2.6.7-mod/arch/ppc64/kernel/Makefile +--- linux-2.6.7/arch/ppc64/kernel/Makefile Mon May 10 04:33:20 2004 ++++ linux-2.6.7-mod/arch/ppc64/kernel/Makefile Sat Jun 19 12:54:39 2004 +@@ -3,7 +3,7 @@ + # + + EXTRA_CFLAGS += -mno-minimal-toc +-extra-y := head.o vmlinux.lds.s ++extra-y := head.o vmlinux.lds.asm + + obj-y := setup.o entry.o traps.o irq.o idle.o dma.o \ + time.o process.o signal.o syscalls.o misc.o ptrace.o \ +diff -ur linux-2.6.7/arch/s390/Makefile linux-2.6.7-mod/arch/s390/Makefile +--- linux-2.6.7/arch/s390/Makefile Mon May 10 04:32:02 2004 ++++ linux-2.6.7-mod/arch/s390/Makefile Sat Jun 19 12:54:46 2004 +@@ -68,10 +68,10 @@ + + prepare: include/asm-$(ARCH)/offsets.h + +-arch/$(ARCH)/kernel/asm-offsets.s: include/asm include/linux/version.h \ ++arch/$(ARCH)/kernel/asm-offsets.asm: include/asm include/linux/version.h \ + include/config/MARKER + +-include/asm-$(ARCH)/offsets.h: arch/$(ARCH)/kernel/asm-offsets.s ++include/asm-$(ARCH)/offsets.h: arch/$(ARCH)/kernel/asm-offsets.asm + $(call filechk,gen-asm-offsets) + + CLEAN_FILES += include/asm-$(ARCH)/offsets.h +diff -ur linux-2.6.7/arch/s390/kernel/Makefile linux-2.6.7-mod/arch/s390/kernel/Makefile +--- linux-2.6.7/arch/s390/kernel/Makefile Mon May 10 04:33:20 2004 ++++ linux-2.6.7-mod/arch/s390/kernel/Makefile Sat Jun 19 12:54:52 2004 +@@ -10,7 +10,7 @@ + + extra-$(CONFIG_ARCH_S390_31) += head.o + extra-$(CONFIG_ARCH_S390X) += head64.o +-extra-y += init_task.o vmlinux.lds.s ++extra-y += init_task.o vmlinux.lds.asm + + obj-$(CONFIG_MODULES) += s390_ksyms.o module.o + obj-$(CONFIG_SMP) += smp.o +diff -ur linux-2.6.7/arch/sh/kernel/Makefile linux-2.6.7-mod/arch/sh/kernel/Makefile +--- linux-2.6.7/arch/sh/kernel/Makefile Mon May 10 04:32:39 2004 ++++ linux-2.6.7-mod/arch/sh/kernel/Makefile Sat Jun 19 12:55:33 2004 +@@ -2,7 +2,7 @@ + # Makefile for the Linux/SuperH kernel. + # + +-extra-y := head.o init_task.o vmlinux.lds.s ++extra-y := head.o init_task.o vmlinux.lds.asm + + obj-y := process.o signal.o entry.o traps.o irq.o \ + ptrace.o setup.o time.o sys_sh.o semaphore.o \ +diff -ur linux-2.6.7/arch/sparc/Makefile linux-2.6.7-mod/arch/sparc/Makefile +--- linux-2.6.7/arch/sparc/Makefile Fri Jun 18 22:51:29 2004 ++++ linux-2.6.7-mod/arch/sparc/Makefile Sat Jun 19 12:55:48 2004 +@@ -61,14 +61,14 @@ + + prepare: include/asm-$(ARCH)/asm_offsets.h + +-arch/$(ARCH)/kernel/asm-offsets.s: include/asm include/linux/version.h \ ++arch/$(ARCH)/kernel/asm-offsets.asm: include/asm include/linux/version.h \ + include/config/MARKER + +-include/asm-$(ARCH)/asm_offsets.h: arch/$(ARCH)/kernel/asm-offsets.s ++include/asm-$(ARCH)/asm_offsets.h: arch/$(ARCH)/kernel/asm-offsets.asm + $(call filechk,gen-asm-offsets) + + CLEAN_FILES += include/asm-$(ARCH)/asm_offsets.h \ +- arch/$(ARCH)/kernel/asm-offsets.s \ ++ arch/$(ARCH)/kernel/asm-offsets.asm \ + arch/$(ARCH)/boot/System.map + + # Don't use tabs in echo arguments. +diff -ur linux-2.6.7/arch/sparc/kernel/Makefile linux-2.6.7-mod/arch/sparc/kernel/Makefile +--- linux-2.6.7/arch/sparc/kernel/Makefile Mon May 10 04:33:13 2004 ++++ linux-2.6.7-mod/arch/sparc/kernel/Makefile Sat Jun 19 12:55:52 2004 +@@ -2,7 +2,7 @@ + # Makefile for the linux kernel. + # + +-extra-y := head.o init_task.o vmlinux.lds.s ++extra-y := head.o init_task.o vmlinux.lds.asm + + EXTRA_AFLAGS := -ansi + +diff -ur linux-2.6.7/arch/sparc64/kernel/Makefile linux-2.6.7-mod/arch/sparc64/kernel/Makefile +--- linux-2.6.7/arch/sparc64/kernel/Makefile Mon May 10 04:32:02 2004 ++++ linux-2.6.7-mod/arch/sparc64/kernel/Makefile Sat Jun 19 12:56:24 2004 +@@ -5,7 +5,7 @@ + EXTRA_AFLAGS := -ansi + EXTRA_CFLAGS := -Werror + +-extra-y := head.o init_task.o vmlinux.lds.s ++extra-y := head.o init_task.o vmlinux.lds.asm + + obj-y := process.o setup.o cpu.o idprom.o \ + traps.o devices.o auxio.o \ +diff -ur linux-2.6.7/arch/um/Makefile linux-2.6.7-mod/arch/um/Makefile +--- linux-2.6.7/arch/um/Makefile Mon May 10 04:32:52 2004 ++++ linux-2.6.7-mod/arch/um/Makefile Sat Jun 19 12:57:07 2004 +@@ -77,7 +77,7 @@ + # CONFIG_MODE_SKAS + CONFIG_STATIC_LINK case. + + LINK_TT = -static +-LD_SCRIPT_TT := uml.lds.s ++LD_SCRIPT_TT := uml.lds.asm + + ifeq ($(CONFIG_STATIC_LINK),y) + LINK-y += $(LINK_TT) +@@ -103,11 +103,11 @@ + -DELF_FORMAT=\"$(ELF_FORMAT)\" $(CPP_MODE_TT) \ + -DKERNEL_STACK_SIZE=$(STACK_SIZE) + +-AFLAGS_$(LD_SCRIPT-y:.s=).o = $(AFLAGS_vmlinux.lds.o) -P -C -Uum ++AFLAGS_$(LD_SCRIPT-y:.asm=).o = $(AFLAGS_vmlinux.lds.o) -P -C -Uum + + LD_SCRIPT-y := $(ARCH_DIR)/$(LD_SCRIPT-y) + +-$(LD_SCRIPT-y) : $(LD_SCRIPT-y:.s=.S) scripts FORCE ++$(LD_SCRIPT-y) : $(LD_SCRIPT-y:.asm=.S) scripts FORCE + $(call if_changed_dep,as_s_S) + + linux: vmlinux $(LD_SCRIPT-y) +@@ -122,8 +122,8 @@ + # To get a definition of F_SETSIG + USER_CFLAGS += -D_GNU_SOURCE + +-CLEAN_FILES += linux x.i gmon.out $(ARCH_DIR)/uml.lds.s \ +- $(ARCH_DIR)/dyn_link.ld.s $(GEN_HEADERS) ++CLEAN_FILES += linux x.i gmon.out $(ARCH_DIR)/uml.lds.asm \ ++ $(ARCH_DIR)/dyn_link.ld.asm $(GEN_HEADERS) + + $(ARCH_DIR)/main.o: $(ARCH_DIR)/main.c + $(CC) $(USER_CFLAGS) $(EXTRA_CFLAGS) -c -o $@ $< +diff -ur linux-2.6.7/arch/um/kernel/Makefile linux-2.6.7-mod/arch/um/kernel/Makefile +--- linux-2.6.7/arch/um/kernel/Makefile Mon May 10 04:32:53 2004 ++++ linux-2.6.7-mod/arch/um/kernel/Makefile Sat Jun 19 12:57:15 2004 +@@ -3,7 +3,7 @@ + # Licensed under the GPL + # + +-extra-y := vmlinux.lds.s ++extra-y := vmlinux.lds.asm + + obj-y = checksum.o config.o exec_kern.o exitcode.o frame_kern.o frame.o \ + helper.o init_task.o irq.o irq_user.o ksyms.o mem.o mem_user.o \ +diff -ur linux-2.6.7/arch/v850/Makefile linux-2.6.7-mod/arch/v850/Makefile +--- linux-2.6.7/arch/v850/Makefile Mon May 10 04:33:21 2004 ++++ linux-2.6.7-mod/arch/v850/Makefile Sat Jun 19 12:57:59 2004 +@@ -52,12 +52,12 @@ + prepare: include/asm-$(ARCH)/asm-consts.h + + # Generate constants from C code for use by asm files +-arch/$(ARCH)/kernel/asm-consts.s: include/asm include/linux/version.h \ ++arch/$(ARCH)/kernel/asm-consts.asm: include/asm include/linux/version.h \ + include/config/MARKER + +-include/asm-$(ARCH)/asm-consts.h: arch/$(ARCH)/kernel/asm-consts.s ++include/asm-$(ARCH)/asm-consts.h: arch/$(ARCH)/kernel/asm-consts.asm + $(call filechk,gen-asm-offsets) + + CLEAN_FILES += include/asm-$(ARCH)/asm-consts.h \ +- arch/$(ARCH)/kernel/asm-consts.s \ ++ arch/$(ARCH)/kernel/asm-consts.asm \ + root_fs_image.o +diff -ur linux-2.6.7/arch/v850/kernel/Makefile linux-2.6.7-mod/arch/v850/kernel/Makefile +--- linux-2.6.7/arch/v850/kernel/Makefile Mon May 10 04:33:21 2004 ++++ linux-2.6.7-mod/arch/v850/kernel/Makefile Sat Jun 19 12:58:04 2004 +@@ -9,7 +9,7 @@ + # for more details. + # + +-extra-y := head.o init_task.o vmlinux.lds.s ++extra-y := head.o init_task.o vmlinux.lds.asm + + obj-y += intv.o entry.o process.o syscalls.o time.o semaphore.o setup.o \ + signal.o irq.o mach.o ptrace.o bug.o +diff -ur linux-2.6.7/arch/x86_64/Makefile linux-2.6.7-mod/arch/x86_64/Makefile +--- linux-2.6.7/arch/x86_64/Makefile Mon May 10 04:33:19 2004 ++++ linux-2.6.7-mod/arch/x86_64/Makefile Sat Jun 19 12:58:10 2004 +@@ -93,10 +93,10 @@ + + prepare: include/asm-$(ARCH)/offset.h + +-arch/$(ARCH)/kernel/asm-offsets.s: include/asm include/linux/version.h \ ++arch/$(ARCH)/kernel/asm-offsets.asm: include/asm include/linux/version.h \ + include/config/MARKER + +-include/asm-$(ARCH)/offset.h: arch/$(ARCH)/kernel/asm-offsets.s ++include/asm-$(ARCH)/offset.h: arch/$(ARCH)/kernel/asm-offsets.asm + $(call filechk,gen-asm-offsets) + + CLEAN_FILES += include/asm-$(ARCH)/offset.h +diff -ur linux-2.6.7/arch/x86_64/kernel/Makefile linux-2.6.7-mod/arch/x86_64/kernel/Makefile +--- linux-2.6.7/arch/x86_64/kernel/Makefile Fri Jun 18 22:51:32 2004 ++++ linux-2.6.7-mod/arch/x86_64/kernel/Makefile Sat Jun 19 12:58:17 2004 +@@ -2,7 +2,7 @@ + # Makefile for the linux kernel. + # + +-extra-y := head.o head64.o init_task.o vmlinux.lds.s ++extra-y := head.o head64.o init_task.o vmlinux.lds.asm + EXTRA_AFLAGS := -traditional + obj-y := process.o semaphore.o signal.o entry.o traps.o irq.o \ + ptrace.o i8259.o ioport.o ldt.o setup.o time.o sys_x86_64.o \ +diff -ur linux-2.6.7/scripts/Makefile.build linux-2.6.7-mod/scripts/Makefile.build +--- linux-2.6.7/scripts/Makefile.build Mon May 10 04:33:13 2004 ++++ linux-2.6.7-mod/scripts/Makefile.build Sat Jun 19 12:43:10 2004 +@@ -110,7 +110,7 @@ + quiet_cmd_cc_s_c = CC $(quiet_modtag) $@ + cmd_cc_s_c = $(CC) $(c_flags) -S -o $@ $< + +-%.s: %.c FORCE ++%.asm: %.c FORCE + $(call if_changed_dep,cc_s_c) + + quiet_cmd_cc_i_c = CPP $(quiet_modtag) $@ +@@ -197,7 +197,7 @@ + quiet_cmd_as_s_S = CPP $(quiet_modtag) $@ + cmd_as_s_S = $(CPP) $(a_flags) -o $@ $< + +-%.s: %.S FORCE ++%.asm: %.S FORCE + $(call if_changed_dep,as_s_S) + + quiet_cmd_as_o_S = AS $(quiet_modtag) $@ diff --git a/patches/linux/2.6.7/120-linux-2.6.8-noshared-kconfig.patch b/patches/linux/2.6.7/120-linux-2.6.8-noshared-kconfig.patch new file mode 100644 index 0000000..326cdcd --- /dev/null +++ b/patches/linux/2.6.7/120-linux-2.6.8-noshared-kconfig.patch @@ -0,0 +1,28 @@ +Lets you run 'make oldconfig' and 'make menuconfig' on systems +where shared libraries aren't easy. (There's no harm in using the +static version of libkconfig.) +Idea mentioned by Bertrand Marquis, but this patch is a bit simpler than his. + + +--- linux-2.6.8.1/scripts/kconfig/Makefile.old 2004-09-09 20:30:25.000000000 -0700 ++++ linux-2.6.8.1/scripts/kconfig/Makefile 2004-09-09 20:47:51.000000000 -0700 +@@ -68,8 +68,8 @@ + libkconfig-objs := zconf.tab.o + + host-progs := conf mconf qconf gconf +-conf-objs := conf.o libkconfig.so +-mconf-objs := mconf.o libkconfig.so ++conf-objs := conf.o $(libkconfig-objs) ++mconf-objs := mconf.o $(libkconfig-objs) + + ifeq ($(MAKECMDGOALS),xconfig) + qconf-target := 1 +@@ -88,7 +88,7 @@ + gconf-objs := gconf.o kconfig_load.o + endif + +-clean-files := libkconfig.so lkc_defs.h qconf.moc .tmp_qtcheck \ ++clean-files := $(libkconfig-objs) lkc_defs.h qconf.moc .tmp_qtcheck \ + .tmp_gtkcheck zconf.tab.c zconf.tab.h lex.zconf.c + + # generated files seem to need this to find local include files diff --git a/patches/linux/2.6.7/kaz-types.patch b/patches/linux/2.6.7/kaz-types.patch deleted file mode 100644 index ec5de36..0000000 --- a/patches/linux/2.6.7/kaz-types.patch +++ /dev/null @@ -1,60 +0,0 @@ -The following fixes an error that occurs when building glibc-2.3.2 (but not glibc-2.2.5) for sh4: - -In file included from sys/ustat.h:30, - from ../sysdeps/unix/sysv/linux/ustat.c:21: -../sysdeps/generic/bits/ustat.h:26: error: redefinition of `struct ustat' -make[2]: *** [/home3/dank/crosstool-0.7/build/sh4-unknown-linux-gnu/gcc-3.3-glibc-2.3.2/build-glibc/misc/ustat.o] Error 1 -make[2]: Leaving directory `/home3/dank/crosstool-0.7/build/sh4-unknown-linux-gnu/gcc-3.3-glibc-2.3.2/glibc-2.3.2/misc' -make[1]: *** [misc/subdir_lib] Error 2 -make[1]: Leaving directory `/home3/dank/crosstool-0.7/build/sh4-unknown-linux-gnu/gcc-3.3-glibc-2.3.2/glibc-2.3.2' -make: *** [all] Error 2 - ------------ snip --------------- - -Date: Fri, 06 Jun 2003 08:00:00 +0900 -From: kaz Kojima -Subject: [linux-sh:02770] Re: Compiling glibc-2.3.2 for sh4 fails with "include/asm/user.h:32: - error: redefinition of `struct user_fpu_struct'" -To: linux-sh@m17n.org -Message-Id: <200306052250.h55Moeb08707@r-rr.iij4u.or.jp> - -Hi, - -Dan Kegel wrote: -> When I try to build glibc-2.3.2 for sh4, it fails with the error -[snip] -> /home3/dank/crosstool-0.3/result/sh4-linux/gcc-3.3-glibc-2.3.2/sh4-linux/include/asm/user.h:32: error: redefinition of `struct user_fpu_struct' -> /home3/dank/crosstool-0.3/result/sh4-linux/gcc-3.3-glibc-2.3.2/sh4-linux/include/asm/user.h:39: error: redefinition of `struct user' -[snip] -> The error reminds me of the kind of thing fixed by -> http://www.kegel.com/crossgcc/crosstool-0.4/glibc-2.3.2-patches/sh-user.patch - -It seems that the definitions in asm/user.h and the above patch collide. -I'm not sure why you need this patch, but is it needed for the problem -about struct ustat that you pointed out in this list, isn't it? -I found why I don't hit ustat problem - my local kernel tree includes -the following patch, though I can't recall about it. - -Regards, - kaz --- -diff -u linux-2.5.69-sf-orig/include/linux/types.h /usr/local/sh4-unknown-linux-gnu/include/linux/types.h ---- linux-2.5.69-sf-orig/include/linux/types.h Wed Mar 5 12:29:34 2003 -+++ sh4-unknown-linux-gnu/include/linux/types.h Sat Apr 19 10:05:52 2003 -@@ -141,6 +141,7 @@ - - #endif /* __KERNEL_STRICT_NAMES */ - -+#ifdef __KERNEL__ - /* - * Below are truly Linux-specific types that should never collide with - * any application/library that wants linux/types.h. -@@ -152,5 +153,6 @@ - char f_fname[6]; - char f_fpack[6]; - }; -+#endif - - #endif /* _LINUX_TYPES_H */ - - diff --git a/patches/linux/2.6.7/linux-2.6.7-build_on_case_insensitive_fs-1.patch b/patches/linux/2.6.7/linux-2.6.7-build_on_case_insensitive_fs-1.patch deleted file mode 100644 index c9e0dd3..0000000 --- a/patches/linux/2.6.7/linux-2.6.7-build_on_case_insensitive_fs-1.patch +++ /dev/null @@ -1,679 +0,0 @@ -Submitted By: Martin Schaffner -Date: 2004-06-19 -Initial Package Version: 2.6.7 -Upstream Status: Not submitted -Origin: Martin Schaffner -Description: Enables build on case-insensitive file systems -URL: http://mirror.vtx.ch/lfs/patches/downloads/linux/linux-2.6.7-build_on_case_insensitive_fs-1.patch - -diff -ur linux-2.6.7/Makefile linux-2.6.7-mod/Makefile ---- linux-2.6.7/Makefile Fri Jun 18 22:51:03 2004 -+++ linux-2.6.7-mod/Makefile Sat Jun 19 12:43:10 2004 -@@ -549,7 +549,7 @@ - $(NM) $@ | grep -v '\(compiled\)\|\(\.o$$\)\|\( [aUw] \)\|\(\.\.ng$$\)\|\(LASH[RL]DI\)' | sort > System.map - endef - --LDFLAGS_vmlinux += -T arch/$(ARCH)/kernel/vmlinux.lds.s -+LDFLAGS_vmlinux += -T arch/$(ARCH)/kernel/vmlinux.lds.asm - - # Generate section listing all symbols and add it into vmlinux - # It's a three stage process: -@@ -575,23 +575,23 @@ - .tmp_kallsyms%.S: .tmp_vmlinux% - $(call cmd,kallsyms) - --.tmp_vmlinux1: $(vmlinux-objs) arch/$(ARCH)/kernel/vmlinux.lds.s FORCE -+.tmp_vmlinux1: $(vmlinux-objs) arch/$(ARCH)/kernel/vmlinux.lds.asm FORCE - +$(call if_changed_rule,vmlinux__) - --.tmp_vmlinux2: $(vmlinux-objs) .tmp_kallsyms1.o arch/$(ARCH)/kernel/vmlinux.lds.s FORCE -+.tmp_vmlinux2: $(vmlinux-objs) .tmp_kallsyms1.o arch/$(ARCH)/kernel/vmlinux.lds.asm FORCE - $(call if_changed_rule,vmlinux__) - - endif - - # Finally the vmlinux rule - --vmlinux: $(vmlinux-objs) $(kallsyms.o) arch/$(ARCH)/kernel/vmlinux.lds.s FORCE -+vmlinux: $(vmlinux-objs) $(kallsyms.o) arch/$(ARCH)/kernel/vmlinux.lds.asm FORCE - $(call if_changed_rule,vmlinux) - - # The actual objects are generated when descending, - # make sure no implicit rule kicks in - --$(sort $(vmlinux-objs)) arch/$(ARCH)/kernel/vmlinux.lds.s: $(vmlinux-dirs) ; -+$(sort $(vmlinux-objs)) arch/$(ARCH)/kernel/vmlinux.lds.asm: $(vmlinux-dirs) ; - - # Handle descending into subdirectories listed in $(vmlinux-dirs) - -@@ -640,7 +640,7 @@ - # Single targets - # --------------------------------------------------------------------------- - --%.s: %.c scripts FORCE -+%.asm: %.c scripts FORCE - $(Q)$(MAKE) $(build)=$(@D) $@ - %.i: %.c scripts FORCE - $(Q)$(MAKE) $(build)=$(@D) $@ -@@ -650,7 +650,7 @@ - $(Q)$(MAKE) KBUILD_MODULES=$(if $(CONFIG_MODULES),1) $(build)=$(@D) - %.lst: %.c scripts FORCE - $(Q)$(MAKE) $(build)=$(@D) $@ --%.s: %.S scripts FORCE -+%.asm: %.S scripts FORCE - $(Q)$(MAKE) $(build)=$(@D) $@ - %.o: %.S scripts FORCE - $(Q)$(MAKE) $(build)=$(@D) $@ -diff -ur linux-2.6.7/arch/alpha/Makefile linux-2.6.7-mod/arch/alpha/Makefile ---- linux-2.6.7/arch/alpha/Makefile Fri Jun 18 22:51:03 2004 -+++ linux-2.6.7-mod/arch/alpha/Makefile Sat Jun 19 12:46:32 2004 -@@ -114,10 +114,10 @@ - - prepare: include/asm-$(ARCH)/asm_offsets.h - --arch/$(ARCH)/kernel/asm-offsets.s: include/asm include/linux/version.h \ -+arch/$(ARCH)/kernel/asm-offsets.asm: include/asm include/linux/version.h \ - include/config/MARKER - --include/asm-$(ARCH)/asm_offsets.h: arch/$(ARCH)/kernel/asm-offsets.s -+include/asm-$(ARCH)/asm_offsets.h: arch/$(ARCH)/kernel/asm-offsets.asm - $(call filechk,gen-asm-offsets) - - archclean: -diff -ur linux-2.6.7/arch/alpha/kernel/Makefile linux-2.6.7-mod/arch/alpha/kernel/Makefile ---- linux-2.6.7/arch/alpha/kernel/Makefile Mon May 10 04:32:29 2004 -+++ linux-2.6.7-mod/arch/alpha/kernel/Makefile Sat Jun 19 12:46:48 2004 -@@ -2,7 +2,7 @@ - # Makefile for the linux kernel. - # - --extra-y := head.o vmlinux.lds.s -+extra-y := head.o vmlinux.lds.asm - EXTRA_AFLAGS := $(CFLAGS) - EXTRA_CFLAGS := -Werror -Wno-sign-compare - -diff -ur linux-2.6.7/arch/arm/Makefile linux-2.6.7-mod/arch/arm/Makefile ---- linux-2.6.7/arch/arm/Makefile Fri Jun 18 22:51:04 2004 -+++ linux-2.6.7-mod/arch/arm/Makefile Sat Jun 19 12:47:07 2004 -@@ -175,10 +175,10 @@ - i:; $(Q)$(MAKE) $(build)=$(boot) install - zi:; $(Q)$(MAKE) $(build)=$(boot) zinstall - --arch/$(ARCH)/kernel/asm-offsets.s: include/asm include/linux/version.h \ -+arch/$(ARCH)/kernel/asm-offsets.asm: include/asm include/linux/version.h \ - include/asm-arm/.arch - --include/asm-$(ARCH)/constants.h: arch/$(ARCH)/kernel/asm-offsets.s -+include/asm-$(ARCH)/constants.h: arch/$(ARCH)/kernel/asm-offsets.asm - $(call filechk,gen-asm-offsets) - - define archhelp -diff -ur linux-2.6.7/arch/arm/kernel/Makefile linux-2.6.7-mod/arch/arm/kernel/Makefile ---- linux-2.6.7/arch/arm/kernel/Makefile Mon May 10 04:33:19 2004 -+++ linux-2.6.7-mod/arch/arm/kernel/Makefile Sat Jun 19 12:47:25 2004 -@@ -27,7 +27,7 @@ - head-y := head.o - obj-$(CONFIG_DEBUG_LL) += debug.o - --extra-y := $(head-y) init_task.o vmlinux.lds.s -+extra-y := $(head-y) init_task.o vmlinux.lds.asm - - # Spell out some dependencies that aren't automatically figured out - $(obj)/entry-armv.o: $(obj)/entry-header.S include/asm-arm/constants.h -diff -ur linux-2.6.7/arch/arm26/Makefile linux-2.6.7-mod/arch/arm26/Makefile ---- linux-2.6.7/arch/arm26/Makefile Mon May 10 04:32:28 2004 -+++ linux-2.6.7-mod/arch/arm26/Makefile Sat Jun 19 12:48:24 2004 -@@ -101,10 +101,10 @@ - fi; \ - ) - --arch/$(ARCH)/kernel/asm-offsets.s: include/asm include/linux/version.h \ -+arch/$(ARCH)/kernel/asm-offsets.asm: include/asm include/linux/version.h \ - include/config/MARKER - --include/asm-$(ARCH)/asm_offsets.h: arch/$(ARCH)/kernel/asm-offsets.s -+include/asm-$(ARCH)/asm_offsets.h: arch/$(ARCH)/kernel/asm-offsets.asm - $(call filechk,gen-asm-offsets) - - define archhelp -diff -ur linux-2.6.7/arch/arm26/kernel/Makefile linux-2.6.7-mod/arch/arm26/kernel/Makefile ---- linux-2.6.7/arch/arm26/kernel/Makefile Mon May 10 04:32:29 2004 -+++ linux-2.6.7-mod/arch/arm26/kernel/Makefile Sat Jun 19 12:48:30 2004 -@@ -14,5 +14,5 @@ - obj-$(CONFIG_FIQ) += fiq.o - obj-$(CONFIG_MODULES) += armksyms.o - --extra-y := init_task.o vmlinux.lds.s -+extra-y := init_task.o vmlinux.lds.asm - -diff -ur linux-2.6.7/arch/cris/Makefile linux-2.6.7-mod/arch/cris/Makefile ---- linux-2.6.7/arch/cris/Makefile Fri Jun 18 22:51:07 2004 -+++ linux-2.6.7-mod/arch/cris/Makefile Sat Jun 19 12:48:47 2004 -@@ -107,8 +107,8 @@ - @ln -sf $(SARCH) include/asm-$(ARCH)/arch - @touch $@ - --arch/$(ARCH)/$(SARCH)/kernel/asm-offsets.s: include/asm include/linux/version.h \ -+arch/$(ARCH)/$(SARCH)/kernel/asm-offsets.asm: include/asm include/linux/version.h \ - include/config/MARKER - --include/asm-$(ARCH)/$(SARCH)/offset.h: arch/$(ARCH)/$(SARCH)/kernel/asm-offsets.s -+include/asm-$(ARCH)/$(SARCH)/offset.h: arch/$(ARCH)/$(SARCH)/kernel/asm-offsets.asm - $(call filechk,gen-asm-offsets) -diff -ur linux-2.6.7/arch/cris/kernel/Makefile linux-2.6.7-mod/arch/cris/kernel/Makefile ---- linux-2.6.7/arch/cris/kernel/Makefile Fri Jun 18 22:51:09 2004 -+++ linux-2.6.7-mod/arch/cris/kernel/Makefile Sat Jun 19 12:48:53 2004 -@@ -3,7 +3,7 @@ - # Makefile for the linux kernel. - # - --extra-y := vmlinux.lds.s -+extra-y := vmlinux.lds.asm - - obj-y := process.o traps.o irq.o ptrace.o setup.o \ - time.o sys_cris.o semaphore.o -diff -ur linux-2.6.7/arch/h8300/Makefile linux-2.6.7-mod/arch/h8300/Makefile ---- linux-2.6.7/arch/h8300/Makefile Fri Jun 18 22:51:09 2004 -+++ linux-2.6.7-mod/arch/h8300/Makefile Sat Jun 19 12:49:12 2004 -@@ -64,7 +64,7 @@ - - prepare: include/asm-$(ARCH)/asm-offsets.h - --include/asm-$(ARCH)/asm-offsets.h: arch/$(ARCH)/kernel/asm-offsets.s \ -+include/asm-$(ARCH)/asm-offsets.h: arch/$(ARCH)/kernel/asm-offsets.asm \ - include/asm include/linux/version.h - $(call filechk,gen-asm-offsets) - -diff -ur linux-2.6.7/arch/h8300/kernel/Makefile linux-2.6.7-mod/arch/h8300/kernel/Makefile ---- linux-2.6.7/arch/h8300/kernel/Makefile Fri Jun 18 22:51:09 2004 -+++ linux-2.6.7-mod/arch/h8300/kernel/Makefile Sat Jun 19 12:49:32 2004 -@@ -2,7 +2,7 @@ - # Makefile for the linux kernel. - # - --extra-y := vmlinux.lds.s -+extra-y := vmlinux.lds.asm - - obj-y := process.o traps.o ptrace.o ints.o \ - sys_h8300.o time.o semaphore.o signal.o \ -diff -ur linux-2.6.7/arch/i386/Makefile linux-2.6.7-mod/arch/i386/Makefile ---- linux-2.6.7/arch/i386/Makefile Fri Jun 18 22:51:10 2004 -+++ linux-2.6.7-mod/arch/i386/Makefile Sat Jun 19 12:49:43 2004 -@@ -141,10 +141,10 @@ - prepare: include/asm-$(ARCH)/asm_offsets.h - CLEAN_FILES += include/asm-$(ARCH)/asm_offsets.h - --arch/$(ARCH)/kernel/asm-offsets.s: include/asm include/linux/version.h \ -+arch/$(ARCH)/kernel/asm-offsets.asm: include/asm include/linux/version.h \ - include/config/MARKER - --include/asm-$(ARCH)/asm_offsets.h: arch/$(ARCH)/kernel/asm-offsets.s -+include/asm-$(ARCH)/asm_offsets.h: arch/$(ARCH)/kernel/asm-offsets.asm - $(call filechk,gen-asm-offsets) - - archclean: -diff -ur linux-2.6.7/arch/i386/kernel/Makefile linux-2.6.7-mod/arch/i386/kernel/Makefile ---- linux-2.6.7/arch/i386/kernel/Makefile Mon May 10 04:32:02 2004 -+++ linux-2.6.7-mod/arch/i386/kernel/Makefile Sat Jun 19 12:49:54 2004 -@@ -2,7 +2,7 @@ - # Makefile for the linux kernel. - # - --extra-y := head.o init_task.o vmlinux.lds.s -+extra-y := head.o init_task.o vmlinux.lds.asm - - obj-y := process.o semaphore.o signal.o entry.o traps.o irq.o vm86.o \ - ptrace.o i8259.o ioport.o ldt.o setup.o time.o sys_i386.o \ -diff -ur linux-2.6.7/arch/ia64/Makefile linux-2.6.7-mod/arch/ia64/Makefile ---- linux-2.6.7/arch/ia64/Makefile Mon May 10 04:31:59 2004 -+++ linux-2.6.7-mod/arch/ia64/Makefile Sat Jun 19 12:50:12 2004 -@@ -88,12 +88,12 @@ - - prepare: include/asm-ia64/offsets.h - --arch/ia64/kernel/asm-offsets.s: include/asm include/linux/version.h include/config/MARKER -+arch/ia64/kernel/asm-offsets.asm: include/asm include/linux/version.h include/config/MARKER - --include/asm-ia64/offsets.h: arch/ia64/kernel/asm-offsets.s -+include/asm-ia64/offsets.h: arch/ia64/kernel/asm-offsets.asm - $(call filechk,gen-asm-offsets) - --arch/ia64/kernel/asm-offsets.s: include/asm-ia64/.offsets.h.stamp -+arch/ia64/kernel/asm-offsets.asm: include/asm-ia64/.offsets.h.stamp - - include/asm-ia64/.offsets.h.stamp: - mkdir -p include/asm-ia64 -diff -ur linux-2.6.7/arch/ia64/kernel/Makefile linux-2.6.7-mod/arch/ia64/kernel/Makefile ---- linux-2.6.7/arch/ia64/kernel/Makefile Fri Jun 18 22:51:13 2004 -+++ linux-2.6.7-mod/arch/ia64/kernel/Makefile Sat Jun 19 12:52:14 2004 -@@ -2,7 +2,7 @@ - # Makefile for the linux kernel. - # - --extra-y := head.o init_task.o vmlinux.lds.s -+extra-y := head.o init_task.o vmlinux.lds.asm - - obj-y := acpi.o entry.o efi.o efi_stub.o gate-data.o fsys.o ia64_ksyms.o irq.o irq_ia64.o \ - irq_lsapic.o ivt.o machvec.o pal.o patch.o process.o perfmon.o ptrace.o sal.o \ -@@ -21,7 +21,7 @@ - # The gate DSO image is built using a special linker script. - targets += gate.so gate-syms.o - --extra-y += gate.so gate-syms.o gate.lds.s gate.o -+extra-y += gate.so gate-syms.o gate.lds.asm gate.o - - # fp_emulate() expects f2-f5,f16-f31 to contain the user-level state. - CFLAGS_traps.o += -mfixed-range=f2-f5,f16-f31 -@@ -32,14 +32,14 @@ - cmd_gate = $(CC) -nostdlib $(GATECFLAGS_$(@F)) -Wl,-T,$(filter-out FORCE,$^) -o $@ - - GATECFLAGS_gate.so = -shared -s -Wl,-soname=linux-gate.so.1 --$(obj)/gate.so: $(obj)/gate.lds.s $(obj)/gate.o FORCE -+$(obj)/gate.so: $(obj)/gate.lds.asm $(obj)/gate.o FORCE - $(call if_changed,gate) - - $(obj)/built-in.o: $(obj)/gate-syms.o - $(obj)/built-in.o: ld_flags += -R $(obj)/gate-syms.o - - GATECFLAGS_gate-syms.o = -r --$(obj)/gate-syms.o: $(src)/gate.lds.s $(obj)/gate.o FORCE -+$(obj)/gate-syms.o: $(src)/gate.lds.asm $(obj)/gate.o FORCE - $(call if_changed,gate) - - # gate-data.o contains the gate DSO image as data in section .data.gate. -diff -ur linux-2.6.7/arch/m68k/Makefile linux-2.6.7-mod/arch/m68k/Makefile ---- linux-2.6.7/arch/m68k/Makefile Fri Jun 18 22:51:14 2004 -+++ linux-2.6.7-mod/arch/m68k/Makefile Sat Jun 19 12:52:30 2004 -@@ -114,10 +114,10 @@ - prepare: include/asm-$(ARCH)/offsets.h - CLEAN_FILES += include/asm-$(ARCH)/offsets.h - --arch/$(ARCH)/kernel/asm-offsets.s: include/asm include/linux/version.h \ -+arch/$(ARCH)/kernel/asm-offsets.asm: include/asm include/linux/version.h \ - include/config/MARKER - --include/asm-$(ARCH)/offsets.h: arch/$(ARCH)/kernel/asm-offsets.s -+include/asm-$(ARCH)/offsets.h: arch/$(ARCH)/kernel/asm-offsets.asm - $(call filechk,gen-asm-offsets) - - archclean: -diff -ur linux-2.6.7/arch/m68k/kernel/Makefile linux-2.6.7-mod/arch/m68k/kernel/Makefile ---- linux-2.6.7/arch/m68k/kernel/Makefile Mon May 10 04:33:10 2004 -+++ linux-2.6.7-mod/arch/m68k/kernel/Makefile Sat Jun 19 12:52:35 2004 -@@ -7,7 +7,7 @@ - else - extra-y := sun3-head.o - endif --extra-y += vmlinux.lds.s -+extra-y += vmlinux.lds.asm - - obj-y := entry.o process.o traps.o ints.o signal.o ptrace.o \ - sys_m68k.o time.o semaphore.o setup.o m68k_ksyms.o -diff -ur linux-2.6.7/arch/m68knommu/Makefile linux-2.6.7-mod/arch/m68knommu/Makefile ---- linux-2.6.7/arch/m68knommu/Makefile Mon May 10 04:32:54 2004 -+++ linux-2.6.7-mod/arch/m68knommu/Makefile Sat Jun 19 12:52:57 2004 -@@ -89,7 +89,7 @@ - head-y := arch/m68knommu/platform/$(platform-y)/$(board-y)/crt0_$(model-y).o - - CLEAN_FILES := include/asm-$(ARCH)/asm-offsets.h \ -- arch/$(ARCH)/kernel/asm-offsets.s -+ arch/$(ARCH)/kernel/asm-offsets.asm - - core-y += arch/m68knommu/kernel/ \ - arch/m68knommu/mm/ \ -@@ -102,7 +102,7 @@ - archclean: - $(call descend arch/$(ARCH)/boot, subdirclean) - --include/asm-$(ARCH)/asm-offsets.h: arch/$(ARCH)/kernel/asm-offsets.s \ -+include/asm-$(ARCH)/asm-offsets.h: arch/$(ARCH)/kernel/asm-offsets.asm \ - include/asm include/linux/version.h \ - include/config/MARKER - $(call filechk,gen-asm-offsets) -diff -ur linux-2.6.7/arch/m68knommu/kernel/Makefile linux-2.6.7-mod/arch/m68knommu/kernel/Makefile ---- linux-2.6.7/arch/m68knommu/kernel/Makefile Mon May 10 04:32:26 2004 -+++ linux-2.6.7-mod/arch/m68knommu/kernel/Makefile Sat Jun 19 12:53:20 2004 -@@ -2,7 +2,7 @@ - # Makefile for arch/m68knommu/kernel. - # - --extra-y := vmlinux.lds.s -+extra-y := vmlinux.lds.asm - - obj-y += dma.o entry.o init_task.o m68k_ksyms.o process.o ptrace.o semaphore.o \ - setup.o signal.o syscalltable.o sys_m68k.o time.o traps.o -diff -ur linux-2.6.7/arch/mips/Makefile linux-2.6.7-mod/arch/mips/Makefile ---- linux-2.6.7/arch/mips/Makefile Fri Jun 18 22:51:19 2004 -+++ linux-2.6.7-mod/arch/mips/Makefile Sat Jun 19 12:53:35 2004 -@@ -752,12 +752,12 @@ - prepare: include/asm-$(ARCH)/offset.h \ - include/asm-$(ARCH)/reg.h - --arch/$(ARCH)/kernel/offset.s: include/asm include/linux/version.h \ -+arch/$(ARCH)/kernel/offset.asm: include/asm include/linux/version.h \ - include/config/MARKER - --include/asm-$(ARCH)/offset.h: arch/$(ARCH)/kernel/offset.s -+include/asm-$(ARCH)/offset.h: arch/$(ARCH)/kernel/offset.asm - $(call filechk,gen-asm-offset.h) --include/asm-$(ARCH)/reg.h: arch/$(ARCH)/kernel/reg.s -+include/asm-$(ARCH)/reg.h: arch/$(ARCH)/kernel/reg.asm - $(call filechk,gen-asm-reg.h) - - CLEAN_FILES += include/asm-$(ARCH)/offset.h.tmp \ -diff -ur linux-2.6.7/arch/mips/kernel/Makefile linux-2.6.7-mod/arch/mips/kernel/Makefile ---- linux-2.6.7/arch/mips/kernel/Makefile Mon May 10 04:32:28 2004 -+++ linux-2.6.7-mod/arch/mips/kernel/Makefile Sat Jun 19 12:53:41 2004 -@@ -2,7 +2,7 @@ - # Makefile for the Linux/MIPS kernel. - # - --extra-y := head.o init_task.o vmlinux.lds.s -+extra-y := head.o init_task.o vmlinux.lds.asm - - obj-y += cpu-probe.o branch.o entry.o genex.o irq.o process.o \ - ptrace.o reset.o semaphore.o setup.o signal.o syscall.o \ -diff -ur linux-2.6.7/arch/parisc/Makefile linux-2.6.7-mod/arch/parisc/Makefile ---- linux-2.6.7/arch/parisc/Makefile Fri Jun 18 22:51:21 2004 -+++ linux-2.6.7-mod/arch/parisc/Makefile Sat Jun 19 12:53:47 2004 -@@ -88,10 +88,10 @@ - - prepare: include/asm-parisc/offsets.h - --arch/parisc/kernel/asm-offsets.s: include/asm include/linux/version.h \ -+arch/parisc/kernel/asm-offsets.asm: include/asm include/linux/version.h \ - include/config/MARKER - --include/asm-parisc/offsets.h: arch/parisc/kernel/asm-offsets.s -+include/asm-parisc/offsets.h: arch/parisc/kernel/asm-offsets.asm - $(call filechk,gen-asm-offsets) - - CLEAN_FILES += lifimage include/asm-parisc/offsets.h -diff -ur linux-2.6.7/arch/parisc/kernel/Makefile linux-2.6.7-mod/arch/parisc/kernel/Makefile ---- linux-2.6.7/arch/parisc/kernel/Makefile Fri Jun 18 22:51:21 2004 -+++ linux-2.6.7-mod/arch/parisc/kernel/Makefile Sat Jun 19 12:53:53 2004 -@@ -4,7 +4,7 @@ - - head-y := head.o - head-$(CONFIG_PARISC64) := head64.o --extra-y := init_task.o $(head-y) vmlinux.lds.s -+extra-y := init_task.o $(head-y) vmlinux.lds.asm - - AFLAGS_entry.o := -traditional - AFLAGS_pacache.o := -traditional -diff -ur linux-2.6.7/arch/ppc/Makefile linux-2.6.7-mod/arch/ppc/Makefile ---- linux-2.6.7/arch/ppc/Makefile Fri Jun 18 22:51:22 2004 -+++ linux-2.6.7-mod/arch/ppc/Makefile Sat Jun 19 12:54:09 2004 -@@ -78,10 +78,10 @@ - - prepare: include/asm-$(ARCH)/offsets.h checkbin - --arch/$(ARCH)/kernel/asm-offsets.s: include/asm include/linux/version.h \ -+arch/$(ARCH)/kernel/asm-offsets.asm: include/asm include/linux/version.h \ - include/config/MARKER - --include/asm-$(ARCH)/offsets.h: arch/$(ARCH)/kernel/asm-offsets.s -+include/asm-$(ARCH)/offsets.h: arch/$(ARCH)/kernel/asm-offsets.asm - $(call filechk,gen-asm-offsets) - - ifdef CONFIG_6xx -@@ -104,4 +104,4 @@ - endif - - CLEAN_FILES += include/asm-$(ARCH)/offsets.h \ -- arch/$(ARCH)/kernel/asm-offsets.s -+ arch/$(ARCH)/kernel/asm-offsets.asm -diff -ur linux-2.6.7/arch/ppc/kernel/Makefile linux-2.6.7-mod/arch/ppc/kernel/Makefile ---- linux-2.6.7/arch/ppc/kernel/Makefile Fri Jun 18 22:51:24 2004 -+++ linux-2.6.7-mod/arch/ppc/kernel/Makefile Sat Jun 19 12:43:10 2004 -@@ -15,7 +15,7 @@ - extra-$(CONFIG_8xx) := head_8xx.o - extra-$(CONFIG_6xx) += idle_6xx.o - extra-$(CONFIG_POWER4) += idle_power4.o --extra-y += vmlinux.lds.s -+extra-y += vmlinux.lds.asm - - obj-y := entry.o traps.o irq.o idle.o time.o misc.o \ - process.o signal.o ptrace.o align.o \ -diff -ur linux-2.6.7/arch/ppc64/Makefile linux-2.6.7-mod/arch/ppc64/Makefile ---- linux-2.6.7/arch/ppc64/Makefile Fri Jun 18 22:51:26 2004 -+++ linux-2.6.7-mod/arch/ppc64/Makefile Sat Jun 19 12:54:32 2004 -@@ -67,10 +67,10 @@ - - prepare: include/asm-ppc64/offsets.h - --arch/ppc64/kernel/asm-offsets.s: include/asm include/linux/version.h \ -+arch/ppc64/kernel/asm-offsets.asm: include/asm include/linux/version.h \ - include/config/MARKER - --include/asm-ppc64/offsets.h: arch/ppc64/kernel/asm-offsets.s -+include/asm-ppc64/offsets.h: arch/ppc64/kernel/asm-offsets.asm - $(call filechk,gen-asm-offsets) - - define archhelp -diff -ur linux-2.6.7/arch/ppc64/kernel/Makefile linux-2.6.7-mod/arch/ppc64/kernel/Makefile ---- linux-2.6.7/arch/ppc64/kernel/Makefile Mon May 10 04:33:20 2004 -+++ linux-2.6.7-mod/arch/ppc64/kernel/Makefile Sat Jun 19 12:54:39 2004 -@@ -3,7 +3,7 @@ - # - - EXTRA_CFLAGS += -mno-minimal-toc --extra-y := head.o vmlinux.lds.s -+extra-y := head.o vmlinux.lds.asm - - obj-y := setup.o entry.o traps.o irq.o idle.o dma.o \ - time.o process.o signal.o syscalls.o misc.o ptrace.o \ -diff -ur linux-2.6.7/arch/s390/Makefile linux-2.6.7-mod/arch/s390/Makefile ---- linux-2.6.7/arch/s390/Makefile Mon May 10 04:32:02 2004 -+++ linux-2.6.7-mod/arch/s390/Makefile Sat Jun 19 12:54:46 2004 -@@ -68,10 +68,10 @@ - - prepare: include/asm-$(ARCH)/offsets.h - --arch/$(ARCH)/kernel/asm-offsets.s: include/asm include/linux/version.h \ -+arch/$(ARCH)/kernel/asm-offsets.asm: include/asm include/linux/version.h \ - include/config/MARKER - --include/asm-$(ARCH)/offsets.h: arch/$(ARCH)/kernel/asm-offsets.s -+include/asm-$(ARCH)/offsets.h: arch/$(ARCH)/kernel/asm-offsets.asm - $(call filechk,gen-asm-offsets) - - CLEAN_FILES += include/asm-$(ARCH)/offsets.h -diff -ur linux-2.6.7/arch/s390/kernel/Makefile linux-2.6.7-mod/arch/s390/kernel/Makefile ---- linux-2.6.7/arch/s390/kernel/Makefile Mon May 10 04:33:20 2004 -+++ linux-2.6.7-mod/arch/s390/kernel/Makefile Sat Jun 19 12:54:52 2004 -@@ -10,7 +10,7 @@ - - extra-$(CONFIG_ARCH_S390_31) += head.o - extra-$(CONFIG_ARCH_S390X) += head64.o --extra-y += init_task.o vmlinux.lds.s -+extra-y += init_task.o vmlinux.lds.asm - - obj-$(CONFIG_MODULES) += s390_ksyms.o module.o - obj-$(CONFIG_SMP) += smp.o -diff -ur linux-2.6.7/arch/sh/kernel/Makefile linux-2.6.7-mod/arch/sh/kernel/Makefile ---- linux-2.6.7/arch/sh/kernel/Makefile Mon May 10 04:32:39 2004 -+++ linux-2.6.7-mod/arch/sh/kernel/Makefile Sat Jun 19 12:55:33 2004 -@@ -2,7 +2,7 @@ - # Makefile for the Linux/SuperH kernel. - # - --extra-y := head.o init_task.o vmlinux.lds.s -+extra-y := head.o init_task.o vmlinux.lds.asm - - obj-y := process.o signal.o entry.o traps.o irq.o \ - ptrace.o setup.o time.o sys_sh.o semaphore.o \ -diff -ur linux-2.6.7/arch/sparc/Makefile linux-2.6.7-mod/arch/sparc/Makefile ---- linux-2.6.7/arch/sparc/Makefile Fri Jun 18 22:51:29 2004 -+++ linux-2.6.7-mod/arch/sparc/Makefile Sat Jun 19 12:55:48 2004 -@@ -61,14 +61,14 @@ - - prepare: include/asm-$(ARCH)/asm_offsets.h - --arch/$(ARCH)/kernel/asm-offsets.s: include/asm include/linux/version.h \ -+arch/$(ARCH)/kernel/asm-offsets.asm: include/asm include/linux/version.h \ - include/config/MARKER - --include/asm-$(ARCH)/asm_offsets.h: arch/$(ARCH)/kernel/asm-offsets.s -+include/asm-$(ARCH)/asm_offsets.h: arch/$(ARCH)/kernel/asm-offsets.asm - $(call filechk,gen-asm-offsets) - - CLEAN_FILES += include/asm-$(ARCH)/asm_offsets.h \ -- arch/$(ARCH)/kernel/asm-offsets.s \ -+ arch/$(ARCH)/kernel/asm-offsets.asm \ - arch/$(ARCH)/boot/System.map - - # Don't use tabs in echo arguments. -diff -ur linux-2.6.7/arch/sparc/kernel/Makefile linux-2.6.7-mod/arch/sparc/kernel/Makefile ---- linux-2.6.7/arch/sparc/kernel/Makefile Mon May 10 04:33:13 2004 -+++ linux-2.6.7-mod/arch/sparc/kernel/Makefile Sat Jun 19 12:55:52 2004 -@@ -2,7 +2,7 @@ - # Makefile for the linux kernel. - # - --extra-y := head.o init_task.o vmlinux.lds.s -+extra-y := head.o init_task.o vmlinux.lds.asm - - EXTRA_AFLAGS := -ansi - -diff -ur linux-2.6.7/arch/sparc64/kernel/Makefile linux-2.6.7-mod/arch/sparc64/kernel/Makefile ---- linux-2.6.7/arch/sparc64/kernel/Makefile Mon May 10 04:32:02 2004 -+++ linux-2.6.7-mod/arch/sparc64/kernel/Makefile Sat Jun 19 12:56:24 2004 -@@ -5,7 +5,7 @@ - EXTRA_AFLAGS := -ansi - EXTRA_CFLAGS := -Werror - --extra-y := head.o init_task.o vmlinux.lds.s -+extra-y := head.o init_task.o vmlinux.lds.asm - - obj-y := process.o setup.o cpu.o idprom.o \ - traps.o devices.o auxio.o \ -diff -ur linux-2.6.7/arch/um/Makefile linux-2.6.7-mod/arch/um/Makefile ---- linux-2.6.7/arch/um/Makefile Mon May 10 04:32:52 2004 -+++ linux-2.6.7-mod/arch/um/Makefile Sat Jun 19 12:57:07 2004 -@@ -77,7 +77,7 @@ - # CONFIG_MODE_SKAS + CONFIG_STATIC_LINK case. - - LINK_TT = -static --LD_SCRIPT_TT := uml.lds.s -+LD_SCRIPT_TT := uml.lds.asm - - ifeq ($(CONFIG_STATIC_LINK),y) - LINK-y += $(LINK_TT) -@@ -103,11 +103,11 @@ - -DELF_FORMAT=\"$(ELF_FORMAT)\" $(CPP_MODE_TT) \ - -DKERNEL_STACK_SIZE=$(STACK_SIZE) - --AFLAGS_$(LD_SCRIPT-y:.s=).o = $(AFLAGS_vmlinux.lds.o) -P -C -Uum -+AFLAGS_$(LD_SCRIPT-y:.asm=).o = $(AFLAGS_vmlinux.lds.o) -P -C -Uum - - LD_SCRIPT-y := $(ARCH_DIR)/$(LD_SCRIPT-y) - --$(LD_SCRIPT-y) : $(LD_SCRIPT-y:.s=.S) scripts FORCE -+$(LD_SCRIPT-y) : $(LD_SCRIPT-y:.asm=.S) scripts FORCE - $(call if_changed_dep,as_s_S) - - linux: vmlinux $(LD_SCRIPT-y) -@@ -122,8 +122,8 @@ - # To get a definition of F_SETSIG - USER_CFLAGS += -D_GNU_SOURCE - --CLEAN_FILES += linux x.i gmon.out $(ARCH_DIR)/uml.lds.s \ -- $(ARCH_DIR)/dyn_link.ld.s $(GEN_HEADERS) -+CLEAN_FILES += linux x.i gmon.out $(ARCH_DIR)/uml.lds.asm \ -+ $(ARCH_DIR)/dyn_link.ld.asm $(GEN_HEADERS) - - $(ARCH_DIR)/main.o: $(ARCH_DIR)/main.c - $(CC) $(USER_CFLAGS) $(EXTRA_CFLAGS) -c -o $@ $< -diff -ur linux-2.6.7/arch/um/kernel/Makefile linux-2.6.7-mod/arch/um/kernel/Makefile ---- linux-2.6.7/arch/um/kernel/Makefile Mon May 10 04:32:53 2004 -+++ linux-2.6.7-mod/arch/um/kernel/Makefile Sat Jun 19 12:57:15 2004 -@@ -3,7 +3,7 @@ - # Licensed under the GPL - # - --extra-y := vmlinux.lds.s -+extra-y := vmlinux.lds.asm - - obj-y = checksum.o config.o exec_kern.o exitcode.o frame_kern.o frame.o \ - helper.o init_task.o irq.o irq_user.o ksyms.o mem.o mem_user.o \ -diff -ur linux-2.6.7/arch/v850/Makefile linux-2.6.7-mod/arch/v850/Makefile ---- linux-2.6.7/arch/v850/Makefile Mon May 10 04:33:21 2004 -+++ linux-2.6.7-mod/arch/v850/Makefile Sat Jun 19 12:57:59 2004 -@@ -52,12 +52,12 @@ - prepare: include/asm-$(ARCH)/asm-consts.h - - # Generate constants from C code for use by asm files --arch/$(ARCH)/kernel/asm-consts.s: include/asm include/linux/version.h \ -+arch/$(ARCH)/kernel/asm-consts.asm: include/asm include/linux/version.h \ - include/config/MARKER - --include/asm-$(ARCH)/asm-consts.h: arch/$(ARCH)/kernel/asm-consts.s -+include/asm-$(ARCH)/asm-consts.h: arch/$(ARCH)/kernel/asm-consts.asm - $(call filechk,gen-asm-offsets) - - CLEAN_FILES += include/asm-$(ARCH)/asm-consts.h \ -- arch/$(ARCH)/kernel/asm-consts.s \ -+ arch/$(ARCH)/kernel/asm-consts.asm \ - root_fs_image.o -diff -ur linux-2.6.7/arch/v850/kernel/Makefile linux-2.6.7-mod/arch/v850/kernel/Makefile ---- linux-2.6.7/arch/v850/kernel/Makefile Mon May 10 04:33:21 2004 -+++ linux-2.6.7-mod/arch/v850/kernel/Makefile Sat Jun 19 12:58:04 2004 -@@ -9,7 +9,7 @@ - # for more details. - # - --extra-y := head.o init_task.o vmlinux.lds.s -+extra-y := head.o init_task.o vmlinux.lds.asm - - obj-y += intv.o entry.o process.o syscalls.o time.o semaphore.o setup.o \ - signal.o irq.o mach.o ptrace.o bug.o -diff -ur linux-2.6.7/arch/x86_64/Makefile linux-2.6.7-mod/arch/x86_64/Makefile ---- linux-2.6.7/arch/x86_64/Makefile Mon May 10 04:33:19 2004 -+++ linux-2.6.7-mod/arch/x86_64/Makefile Sat Jun 19 12:58:10 2004 -@@ -93,10 +93,10 @@ - - prepare: include/asm-$(ARCH)/offset.h - --arch/$(ARCH)/kernel/asm-offsets.s: include/asm include/linux/version.h \ -+arch/$(ARCH)/kernel/asm-offsets.asm: include/asm include/linux/version.h \ - include/config/MARKER - --include/asm-$(ARCH)/offset.h: arch/$(ARCH)/kernel/asm-offsets.s -+include/asm-$(ARCH)/offset.h: arch/$(ARCH)/kernel/asm-offsets.asm - $(call filechk,gen-asm-offsets) - - CLEAN_FILES += include/asm-$(ARCH)/offset.h -diff -ur linux-2.6.7/arch/x86_64/kernel/Makefile linux-2.6.7-mod/arch/x86_64/kernel/Makefile ---- linux-2.6.7/arch/x86_64/kernel/Makefile Fri Jun 18 22:51:32 2004 -+++ linux-2.6.7-mod/arch/x86_64/kernel/Makefile Sat Jun 19 12:58:17 2004 -@@ -2,7 +2,7 @@ - # Makefile for the linux kernel. - # - --extra-y := head.o head64.o init_task.o vmlinux.lds.s -+extra-y := head.o head64.o init_task.o vmlinux.lds.asm - EXTRA_AFLAGS := -traditional - obj-y := process.o semaphore.o signal.o entry.o traps.o irq.o \ - ptrace.o i8259.o ioport.o ldt.o setup.o time.o sys_x86_64.o \ -diff -ur linux-2.6.7/scripts/Makefile.build linux-2.6.7-mod/scripts/Makefile.build ---- linux-2.6.7/scripts/Makefile.build Mon May 10 04:33:13 2004 -+++ linux-2.6.7-mod/scripts/Makefile.build Sat Jun 19 12:43:10 2004 -@@ -110,7 +110,7 @@ - quiet_cmd_cc_s_c = CC $(quiet_modtag) $@ - cmd_cc_s_c = $(CC) $(c_flags) -S -o $@ $< - --%.s: %.c FORCE -+%.asm: %.c FORCE - $(call if_changed_dep,cc_s_c) - - quiet_cmd_cc_i_c = CPP $(quiet_modtag) $@ -@@ -197,7 +197,7 @@ - quiet_cmd_as_s_S = CPP $(quiet_modtag) $@ - cmd_as_s_S = $(CPP) $(a_flags) -o $@ $< - --%.s: %.S FORCE -+%.asm: %.S FORCE - $(call if_changed_dep,as_s_S) - - quiet_cmd_as_o_S = AS $(quiet_modtag) $@ diff --git a/patches/linux/2.6.7/linux-2.6.8-noshared-kconfig.patch b/patches/linux/2.6.7/linux-2.6.8-noshared-kconfig.patch deleted file mode 100644 index 326cdcd..0000000 --- a/patches/linux/2.6.7/linux-2.6.8-noshared-kconfig.patch +++ /dev/null @@ -1,28 +0,0 @@ -Lets you run 'make oldconfig' and 'make menuconfig' on systems -where shared libraries aren't easy. (There's no harm in using the -static version of libkconfig.) -Idea mentioned by Bertrand Marquis, but this patch is a bit simpler than his. - - ---- linux-2.6.8.1/scripts/kconfig/Makefile.old 2004-09-09 20:30:25.000000000 -0700 -+++ linux-2.6.8.1/scripts/kconfig/Makefile 2004-09-09 20:47:51.000000000 -0700 -@@ -68,8 +68,8 @@ - libkconfig-objs := zconf.tab.o - - host-progs := conf mconf qconf gconf --conf-objs := conf.o libkconfig.so --mconf-objs := mconf.o libkconfig.so -+conf-objs := conf.o $(libkconfig-objs) -+mconf-objs := mconf.o $(libkconfig-objs) - - ifeq ($(MAKECMDGOALS),xconfig) - qconf-target := 1 -@@ -88,7 +88,7 @@ - gconf-objs := gconf.o kconfig_load.o - endif - --clean-files := libkconfig.so lkc_defs.h qconf.moc .tmp_qtcheck \ -+clean-files := $(libkconfig-objs) lkc_defs.h qconf.moc .tmp_qtcheck \ - .tmp_gtkcheck zconf.tab.c zconf.tab.h lex.zconf.c - - # generated files seem to need this to find local include files diff --git a/patches/linux/2.6.8/100-kaz-types.patch b/patches/linux/2.6.8/100-kaz-types.patch new file mode 100644 index 0000000..ec5de36 --- /dev/null +++ b/patches/linux/2.6.8/100-kaz-types.patch @@ -0,0 +1,60 @@ +The following fixes an error that occurs when building glibc-2.3.2 (but not glibc-2.2.5) for sh4: + +In file included from sys/ustat.h:30, + from ../sysdeps/unix/sysv/linux/ustat.c:21: +../sysdeps/generic/bits/ustat.h:26: error: redefinition of `struct ustat' +make[2]: *** [/home3/dank/crosstool-0.7/build/sh4-unknown-linux-gnu/gcc-3.3-glibc-2.3.2/build-glibc/misc/ustat.o] Error 1 +make[2]: Leaving directory `/home3/dank/crosstool-0.7/build/sh4-unknown-linux-gnu/gcc-3.3-glibc-2.3.2/glibc-2.3.2/misc' +make[1]: *** [misc/subdir_lib] Error 2 +make[1]: Leaving directory `/home3/dank/crosstool-0.7/build/sh4-unknown-linux-gnu/gcc-3.3-glibc-2.3.2/glibc-2.3.2' +make: *** [all] Error 2 + +----------- snip --------------- + +Date: Fri, 06 Jun 2003 08:00:00 +0900 +From: kaz Kojima +Subject: [linux-sh:02770] Re: Compiling glibc-2.3.2 for sh4 fails with "include/asm/user.h:32: + error: redefinition of `struct user_fpu_struct'" +To: linux-sh@m17n.org +Message-Id: <200306052250.h55Moeb08707@r-rr.iij4u.or.jp> + +Hi, + +Dan Kegel wrote: +> When I try to build glibc-2.3.2 for sh4, it fails with the error +[snip] +> /home3/dank/crosstool-0.3/result/sh4-linux/gcc-3.3-glibc-2.3.2/sh4-linux/include/asm/user.h:32: error: redefinition of `struct user_fpu_struct' +> /home3/dank/crosstool-0.3/result/sh4-linux/gcc-3.3-glibc-2.3.2/sh4-linux/include/asm/user.h:39: error: redefinition of `struct user' +[snip] +> The error reminds me of the kind of thing fixed by +> http://www.kegel.com/crossgcc/crosstool-0.4/glibc-2.3.2-patches/sh-user.patch + +It seems that the definitions in asm/user.h and the above patch collide. +I'm not sure why you need this patch, but is it needed for the problem +about struct ustat that you pointed out in this list, isn't it? +I found why I don't hit ustat problem - my local kernel tree includes +the following patch, though I can't recall about it. + +Regards, + kaz +-- +diff -u linux-2.5.69-sf-orig/include/linux/types.h /usr/local/sh4-unknown-linux-gnu/include/linux/types.h +--- linux-2.5.69-sf-orig/include/linux/types.h Wed Mar 5 12:29:34 2003 ++++ sh4-unknown-linux-gnu/include/linux/types.h Sat Apr 19 10:05:52 2003 +@@ -141,6 +141,7 @@ + + #endif /* __KERNEL_STRICT_NAMES */ + ++#ifdef __KERNEL__ + /* + * Below are truly Linux-specific types that should never collide with + * any application/library that wants linux/types.h. +@@ -152,5 +153,6 @@ + char f_fname[6]; + char f_fpack[6]; + }; ++#endif + + #endif /* _LINUX_TYPES_H */ + + diff --git a/patches/linux/2.6.8/110-linux-2.6.8-allow-gcc-4.0-asm-i386.patch b/patches/linux/2.6.8/110-linux-2.6.8-allow-gcc-4.0-asm-i386.patch new file mode 100644 index 0000000..71d4e23 --- /dev/null +++ b/patches/linux/2.6.8/110-linux-2.6.8-allow-gcc-4.0-asm-i386.patch @@ -0,0 +1,138 @@ +Fixes + +In file included from include/asm/thread_info.h:16, + from include/linux/thread_info.h:21, + from include/linux/spinlock.h:12, + from include/linux/capability.h:45, + from include/linux/sched.h:7, + from arch/i386/kernel/asm-offsets.c:7: +include/asm/processor.h:87: error: array type has incomplete element type +make[1]: *** [arch/i386/kernel/asm-offsets.asm] Error 1 + +--- linux-2.6.8/include/asm-i386/processor.h.old Tue Mar 15 00:14:42 2005 ++++ linux-2.6.8/include/asm-i386/processor.h Tue Mar 15 00:18:45 2005 +@@ -79,6 +79,58 @@ + #define X86_VENDOR_UNKNOWN 0xff + + /* ++ * Size of io_bitmap. ++ */ ++#define IO_BITMAP_BITS 65536 ++#define IO_BITMAP_BYTES (IO_BITMAP_BITS/8) ++#define IO_BITMAP_LONGS (IO_BITMAP_BYTES/sizeof(long)) ++#define IO_BITMAP_OFFSET offsetof(struct tss_struct,io_bitmap) ++#define INVALID_IO_BITMAP_OFFSET 0x8000 ++ ++struct tss_struct { ++ unsigned short back_link,__blh; ++ unsigned long esp0; ++ unsigned short ss0,__ss0h; ++ unsigned long esp1; ++ unsigned short ss1,__ss1h; /* ss1 is used to cache MSR_IA32_SYSENTER_CS */ ++ unsigned long esp2; ++ unsigned short ss2,__ss2h; ++ unsigned long __cr3; ++ unsigned long eip; ++ unsigned long eflags; ++ unsigned long eax,ecx,edx,ebx; ++ unsigned long esp; ++ unsigned long ebp; ++ unsigned long esi; ++ unsigned long edi; ++ unsigned short es, __esh; ++ unsigned short cs, __csh; ++ unsigned short ss, __ssh; ++ unsigned short ds, __dsh; ++ unsigned short fs, __fsh; ++ unsigned short gs, __gsh; ++ unsigned short ldt, __ldth; ++ unsigned short trace, io_bitmap_base; ++ /* ++ * The extra 1 is there because the CPU will access an ++ * additional byte beyond the end of the IO permission ++ * bitmap. The extra byte must be all 1 bits, and must ++ * be within the limit. ++ */ ++ unsigned long io_bitmap[IO_BITMAP_LONGS + 1]; ++ /* ++ * pads the TSS to be cacheline-aligned (size is 0x100) ++ */ ++ unsigned long __cacheline_filler[37]; ++ /* ++ * .. and then another 0x100 bytes for emergency kernel stack ++ */ ++ unsigned long stack[64]; ++} __attribute__((packed)); ++ ++#define ARCH_MIN_TASKALIGN 16 ++ ++/* + * capabilities of CPUs + */ + +@@ -296,15 +348,6 @@ + */ + #define TASK_UNMAPPED_BASE (PAGE_ALIGN(TASK_SIZE / 3)) + +-/* +- * Size of io_bitmap. +- */ +-#define IO_BITMAP_BITS 65536 +-#define IO_BITMAP_BYTES (IO_BITMAP_BITS/8) +-#define IO_BITMAP_LONGS (IO_BITMAP_BYTES/sizeof(long)) +-#define IO_BITMAP_OFFSET offsetof(struct tss_struct,io_bitmap) +-#define INVALID_IO_BITMAP_OFFSET 0x8000 +- + struct i387_fsave_struct { + long cwd; + long swd; +@@ -356,49 +399,6 @@ + typedef struct { + unsigned long seg; + } mm_segment_t; +- +-struct tss_struct { +- unsigned short back_link,__blh; +- unsigned long esp0; +- unsigned short ss0,__ss0h; +- unsigned long esp1; +- unsigned short ss1,__ss1h; /* ss1 is used to cache MSR_IA32_SYSENTER_CS */ +- unsigned long esp2; +- unsigned short ss2,__ss2h; +- unsigned long __cr3; +- unsigned long eip; +- unsigned long eflags; +- unsigned long eax,ecx,edx,ebx; +- unsigned long esp; +- unsigned long ebp; +- unsigned long esi; +- unsigned long edi; +- unsigned short es, __esh; +- unsigned short cs, __csh; +- unsigned short ss, __ssh; +- unsigned short ds, __dsh; +- unsigned short fs, __fsh; +- unsigned short gs, __gsh; +- unsigned short ldt, __ldth; +- unsigned short trace, io_bitmap_base; +- /* +- * The extra 1 is there because the CPU will access an +- * additional byte beyond the end of the IO permission +- * bitmap. The extra byte must be all 1 bits, and must +- * be within the limit. +- */ +- unsigned long io_bitmap[IO_BITMAP_LONGS + 1]; +- /* +- * pads the TSS to be cacheline-aligned (size is 0x100) +- */ +- unsigned long __cacheline_filler[37]; +- /* +- * .. and then another 0x100 bytes for emergency kernel stack +- */ +- unsigned long stack[64]; +-} __attribute__((packed)); +- +-#define ARCH_MIN_TASKALIGN 16 + + struct thread_struct { + /* cached TLS descriptors. */ diff --git a/patches/linux/2.6.8/120-linux-2.6.8-arm-nonofpu.patch b/patches/linux/2.6.8/120-linux-2.6.8-arm-nonofpu.patch new file mode 100644 index 0000000..f638a00 --- /dev/null +++ b/patches/linux/2.6.8/120-linux-2.6.8-arm-nonofpu.patch @@ -0,0 +1,50 @@ +http://www.spinics.net/lists/arm/msg08012.html + +To: Dimitry Andric +Subject: Re: Kernel Compile Error: use of old and new-style options to set FPU type +From: Marc Britten +Date: Wed, 16 Jun 2004 03:03:15 -0400 +Cc: linux-arm@xxxxxxxxxxxxxxxxxxxxxx +In-reply-to: <1525495613.20040615202902@andric.com> + +Dimitry Andric wrote: + +>>Assembler messages: +>>Error: use of old and new-style options to set FPU type +> Try removing -Wa,-mno-fpu from CFLAGS (and possibly AFLAGS, but I'm +> not sure, depends on what your compiler generates by default) in +> arch/arm/Makefile. + +Just to let people know, this was successful. + +Thanks, + +Marc Britten + +-------- + +Fixes error + +... +make -f scripts/Makefile.build obj=scripts/mod + /opt/crosstool/arm-unknown-linux-gnu/gcc-3.4.1-glibc-2.3.3/bin/arm-unknown-linux-gnu-gcc -Wp,-MD,scripts/mod/.empty.o.d -nostdinc -iwithprefix include -D__KERNEL__ -Iinclude -Wall -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -fno-omit-frame-pointer -mapcs -mno-sched-prolog -mlittle-endian -mapcs-32 -malignment-traps -msoft-float -Wa,-mno-fpu -Uarm -Os -Wdeclaration-after-statement -DKBUILD_BASENAME=empty -DKBUILD_MODNAME=empty -c -o scripts/mod/empty.o scripts/mod/empty.c +Assembler messages: +Error: use of old and new-style options to set FPU type +make[2]: *** [scripts/mod/empty.o] Error 1 +make[1]: *** [scripts/mod] Error 2 +make: *** [scripts] Error 2 + + +--- linux-2.6.8/arch/arm/Makefile.old 2004-09-01 21:27:07.000000000 -0700 ++++ linux-2.6.8/arch/arm/Makefile 2004-09-01 21:27:31.000000000 -0700 +@@ -55,8 +55,8 @@ + tune-$(CONFIG_CPU_V6) :=-mtune=strongarm + + # Need -Uarm for gcc < 3.x +-CFLAGS +=-mapcs-32 $(arch-y) $(tune-y) $(call check_gcc,-malignment-traps,-mshort-load-bytes) -msoft-float -Wa,-mno-fpu -Uarm +-AFLAGS +=-mapcs-32 $(arch-y) $(tune-y) -msoft-float -Wa,-mno-fpu ++CFLAGS +=-mapcs-32 $(arch-y) $(tune-y) $(call check_gcc,-malignment-traps,-mshort-load-bytes) -msoft-float -Uarm ++AFLAGS +=-mapcs-32 $(arch-y) $(tune-y) -msoft-float + + CHECK := $(CHECK) -D__arm__=1 + diff --git a/patches/linux/2.6.8/130-linux-2.6.8-build_on_case_insensitive_fs.patch b/patches/linux/2.6.8/130-linux-2.6.8-build_on_case_insensitive_fs.patch new file mode 100644 index 0000000..6472c17 --- /dev/null +++ b/patches/linux/2.6.8/130-linux-2.6.8-build_on_case_insensitive_fs.patch @@ -0,0 +1,725 @@ +Submitted By: Martin Schaffner +Date: 2004-06-19 +Initial Package Version: 2.6.7 +Upstream Status: Not submitted +Origin: Martin Schaffner +Description: Enables build on case-insensitive file systems +URL: xxxhttp://mirror.vtx.ch/lfs/patches/downloads/linux/linux-2.6.7-build_on_case_insensitive_fs-1.patch +--- Rediffed against 2.6.8 by dank@kegel.com +--- plus a few missing hunks added to fix sparc32 build + +--- linux-2.6.8/Makefile.orig 2004-08-13 22:37:25.000000000 -0700 ++++ linux-2.6.8/Makefile 2004-09-01 21:39:39.000000000 -0700 +@@ -540,7 +540,7 @@ + + do_system_map = $(NM) $(1) | grep -v '\(compiled\)\|\(\.o$$\)\|\( [aUw] \)\|\(\.\.ng$$\)\|\(LASH[RL]DI\)' | sort > $(2) + +-LDFLAGS_vmlinux += -T arch/$(ARCH)/kernel/vmlinux.lds.s ++LDFLAGS_vmlinux += -T arch/$(ARCH)/kernel/vmlinux.lds.asm + + # Generate section listing all symbols and add it into vmlinux + # It's a three stage process: +@@ -584,13 +584,13 @@ + .tmp_kallsyms%.S: .tmp_vmlinux% + $(call cmd,kallsyms) + +-.tmp_vmlinux1: $(vmlinux-objs) arch/$(ARCH)/kernel/vmlinux.lds.s FORCE ++.tmp_vmlinux1: $(vmlinux-objs) arch/$(ARCH)/kernel/vmlinux.lds.asm FORCE + $(call if_changed_rule,vmlinux__) + +-.tmp_vmlinux2: $(vmlinux-objs) .tmp_kallsyms1.o arch/$(ARCH)/kernel/vmlinux.lds.s FORCE ++.tmp_vmlinux2: $(vmlinux-objs) .tmp_kallsyms1.o arch/$(ARCH)/kernel/vmlinux.lds.asm FORCE + $(call if_changed_rule,vmlinux__) + +-.tmp_vmlinux3: $(vmlinux-objs) .tmp_kallsyms2.o arch/$(ARCH)/kernel/vmlinux.lds.s FORCE ++.tmp_vmlinux3: $(vmlinux-objs) .tmp_kallsyms2.o arch/$(ARCH)/kernel/vmlinux.lds.asm FORCE + $(call if_changed_rule,vmlinux__) + + endif +@@ -603,13 +603,13 @@ + $(rule_verify_kallsyms) + endef + +-vmlinux: $(vmlinux-objs) $(kallsyms.o) arch/$(ARCH)/kernel/vmlinux.lds.s FORCE ++vmlinux: $(vmlinux-objs) $(kallsyms.o) arch/$(ARCH)/kernel/vmlinux.lds.asm FORCE + $(call if_changed_rule,vmlinux) + + # The actual objects are generated when descending, + # make sure no implicit rule kicks in + +-$(sort $(vmlinux-objs)) arch/$(ARCH)/kernel/vmlinux.lds.s: $(vmlinux-dirs) ; ++$(sort $(vmlinux-objs)) arch/$(ARCH)/kernel/vmlinux.lds.asm: $(vmlinux-dirs) ; + + # Handle descending into subdirectories listed in $(vmlinux-dirs) + # Preset locale variables to speed up the build process. Limit locale +@@ -672,7 +672,7 @@ + # Single targets + # --------------------------------------------------------------------------- + +-%.s: %.c scripts FORCE ++%.asm: %.c scripts FORCE + $(Q)$(MAKE) $(build)=$(@D) $@ + %.i: %.c scripts FORCE + $(Q)$(MAKE) $(build)=$(@D) $@ +@@ -682,7 +682,7 @@ + $(Q)$(MAKE) KBUILD_MODULES=$(if $(CONFIG_MODULES),1) $(build)=$(@D) + %.lst: %.c scripts FORCE + $(Q)$(MAKE) $(build)=$(@D) $@ +-%.s: %.S scripts FORCE ++%.asm: %.S scripts FORCE + $(Q)$(MAKE) $(build)=$(@D) $@ + %.o: %.S scripts FORCE + $(Q)$(MAKE) $(build)=$(@D) $@ +diff -ur linux-2.6.7/arch/alpha/Makefile linux-2.6.7-mod/arch/alpha/Makefile +--- linux-2.6.7/arch/alpha/Makefile Fri Jun 18 22:51:03 2004 ++++ linux-2.6.7-mod/arch/alpha/Makefile Sat Jun 19 12:46:32 2004 +@@ -114,10 +114,10 @@ + + prepare: include/asm-$(ARCH)/asm_offsets.h + +-arch/$(ARCH)/kernel/asm-offsets.s: include/asm include/linux/version.h \ ++arch/$(ARCH)/kernel/asm-offsets.asm: include/asm include/linux/version.h \ + include/config/MARKER + +-include/asm-$(ARCH)/asm_offsets.h: arch/$(ARCH)/kernel/asm-offsets.s ++include/asm-$(ARCH)/asm_offsets.h: arch/$(ARCH)/kernel/asm-offsets.asm + $(call filechk,gen-asm-offsets) + + archclean: +diff -ur linux-2.6.7/arch/alpha/kernel/Makefile linux-2.6.7-mod/arch/alpha/kernel/Makefile +--- linux-2.6.7/arch/alpha/kernel/Makefile Mon May 10 04:32:29 2004 ++++ linux-2.6.7-mod/arch/alpha/kernel/Makefile Sat Jun 19 12:46:48 2004 +@@ -2,7 +2,7 @@ + # Makefile for the linux kernel. + # + +-extra-y := head.o vmlinux.lds.s ++extra-y := head.o vmlinux.lds.asm + EXTRA_AFLAGS := $(CFLAGS) + EXTRA_CFLAGS := -Werror -Wno-sign-compare + +--- linux-2.6.8/arch/arm/Makefile.orig 2004-08-13 22:36:56.000000000 -0700 ++++ linux-2.6.8/arch/arm/Makefile 2004-09-01 21:40:21.000000000 -0700 +@@ -176,10 +176,10 @@ + bp:; $(Q)$(MAKE) $(build)=$(boot) $(boot)/bootpImage + i zi:; $(Q)$(MAKE) $(build)=$(boot) $@ + +-arch/$(ARCH)/kernel/asm-offsets.s: include/asm include/linux/version.h \ ++arch/$(ARCH)/kernel/asm-offsets.asm: include/asm include/linux/version.h \ + include/asm-arm/.arch + +-include/asm-$(ARCH)/constants.h: arch/$(ARCH)/kernel/asm-offsets.s ++include/asm-$(ARCH)/constants.h: arch/$(ARCH)/kernel/asm-offsets.asm + $(call filechk,gen-asm-offsets) + + define archhelp +diff -ur linux-2.6.7/arch/arm/kernel/Makefile linux-2.6.7-mod/arch/arm/kernel/Makefile +--- linux-2.6.7/arch/arm/kernel/Makefile Mon May 10 04:33:19 2004 ++++ linux-2.6.7-mod/arch/arm/kernel/Makefile Sat Jun 19 12:47:25 2004 +@@ -27,7 +27,7 @@ + head-y := head.o + obj-$(CONFIG_DEBUG_LL) += debug.o + +-extra-y := $(head-y) init_task.o vmlinux.lds.s ++extra-y := $(head-y) init_task.o vmlinux.lds.asm + + # Spell out some dependencies that aren't automatically figured out + $(obj)/entry-armv.o: $(obj)/entry-header.S include/asm-arm/constants.h +diff -ur linux-2.6.7/arch/arm26/Makefile linux-2.6.7-mod/arch/arm26/Makefile +--- linux-2.6.7/arch/arm26/Makefile Mon May 10 04:32:28 2004 ++++ linux-2.6.7-mod/arch/arm26/Makefile Sat Jun 19 12:48:24 2004 +@@ -101,10 +101,10 @@ + fi; \ + ) + +-arch/$(ARCH)/kernel/asm-offsets.s: include/asm include/linux/version.h \ ++arch/$(ARCH)/kernel/asm-offsets.asm: include/asm include/linux/version.h \ + include/config/MARKER + +-include/asm-$(ARCH)/asm_offsets.h: arch/$(ARCH)/kernel/asm-offsets.s ++include/asm-$(ARCH)/asm_offsets.h: arch/$(ARCH)/kernel/asm-offsets.asm + $(call filechk,gen-asm-offsets) + + define archhelp +diff -ur linux-2.6.7/arch/arm26/kernel/Makefile linux-2.6.7-mod/arch/arm26/kernel/Makefile +--- linux-2.6.7/arch/arm26/kernel/Makefile Mon May 10 04:32:29 2004 ++++ linux-2.6.7-mod/arch/arm26/kernel/Makefile Sat Jun 19 12:48:30 2004 +@@ -14,5 +14,5 @@ + obj-$(CONFIG_FIQ) += fiq.o + obj-$(CONFIG_MODULES) += armksyms.o + +-extra-y := init_task.o vmlinux.lds.s ++extra-y := init_task.o vmlinux.lds.asm + +diff -ur linux-2.6.7/arch/cris/Makefile linux-2.6.7-mod/arch/cris/Makefile +--- linux-2.6.7/arch/cris/Makefile Fri Jun 18 22:51:07 2004 ++++ linux-2.6.7-mod/arch/cris/Makefile Sat Jun 19 12:48:47 2004 +@@ -107,8 +107,8 @@ + @ln -sf $(SARCH) include/asm-$(ARCH)/arch + @touch $@ + +-arch/$(ARCH)/$(SARCH)/kernel/asm-offsets.s: include/asm include/linux/version.h \ ++arch/$(ARCH)/$(SARCH)/kernel/asm-offsets.asm: include/asm include/linux/version.h \ + include/config/MARKER + +-include/asm-$(ARCH)/$(SARCH)/offset.h: arch/$(ARCH)/$(SARCH)/kernel/asm-offsets.s ++include/asm-$(ARCH)/$(SARCH)/offset.h: arch/$(ARCH)/$(SARCH)/kernel/asm-offsets.asm + $(call filechk,gen-asm-offsets) +diff -ur linux-2.6.7/arch/cris/kernel/Makefile linux-2.6.7-mod/arch/cris/kernel/Makefile +--- linux-2.6.7/arch/cris/kernel/Makefile Fri Jun 18 22:51:09 2004 ++++ linux-2.6.7-mod/arch/cris/kernel/Makefile Sat Jun 19 12:48:53 2004 +@@ -3,7 +3,7 @@ + # Makefile for the linux kernel. + # + +-extra-y := vmlinux.lds.s ++extra-y := vmlinux.lds.asm + + obj-y := process.o traps.o irq.o ptrace.o setup.o \ + time.o sys_cris.o semaphore.o +diff -ur linux-2.6.7/arch/h8300/Makefile linux-2.6.7-mod/arch/h8300/Makefile +--- linux-2.6.7/arch/h8300/Makefile Fri Jun 18 22:51:09 2004 ++++ linux-2.6.7-mod/arch/h8300/Makefile Sat Jun 19 12:49:12 2004 +@@ -64,7 +64,7 @@ + + prepare: include/asm-$(ARCH)/asm-offsets.h + +-include/asm-$(ARCH)/asm-offsets.h: arch/$(ARCH)/kernel/asm-offsets.s \ ++include/asm-$(ARCH)/asm-offsets.h: arch/$(ARCH)/kernel/asm-offsets.asm \ + include/asm include/linux/version.h + $(call filechk,gen-asm-offsets) + +diff -ur linux-2.6.7/arch/h8300/kernel/Makefile linux-2.6.7-mod/arch/h8300/kernel/Makefile +--- linux-2.6.7/arch/h8300/kernel/Makefile Fri Jun 18 22:51:09 2004 ++++ linux-2.6.7-mod/arch/h8300/kernel/Makefile Sat Jun 19 12:49:32 2004 +@@ -2,7 +2,7 @@ + # Makefile for the linux kernel. + # + +-extra-y := vmlinux.lds.s ++extra-y := vmlinux.lds.asm + + obj-y := process.o traps.o ptrace.o ints.o \ + sys_h8300.o time.o semaphore.o signal.o \ +diff -ur linux-2.6.7/arch/i386/Makefile linux-2.6.7-mod/arch/i386/Makefile +--- linux-2.6.7/arch/i386/Makefile Fri Jun 18 22:51:10 2004 ++++ linux-2.6.7-mod/arch/i386/Makefile Sat Jun 19 12:49:43 2004 +@@ -141,10 +141,10 @@ + prepare: include/asm-$(ARCH)/asm_offsets.h + CLEAN_FILES += include/asm-$(ARCH)/asm_offsets.h + +-arch/$(ARCH)/kernel/asm-offsets.s: include/asm include/linux/version.h \ ++arch/$(ARCH)/kernel/asm-offsets.asm: include/asm include/linux/version.h \ + include/config/MARKER + +-include/asm-$(ARCH)/asm_offsets.h: arch/$(ARCH)/kernel/asm-offsets.s ++include/asm-$(ARCH)/asm_offsets.h: arch/$(ARCH)/kernel/asm-offsets.asm + $(call filechk,gen-asm-offsets) + + archclean: +diff -ur linux-2.6.7/arch/i386/kernel/Makefile linux-2.6.7-mod/arch/i386/kernel/Makefile +--- linux-2.6.7/arch/i386/kernel/Makefile Mon May 10 04:32:02 2004 ++++ linux-2.6.7-mod/arch/i386/kernel/Makefile Sat Jun 19 12:49:54 2004 +@@ -2,7 +2,7 @@ + # Makefile for the linux kernel. + # + +-extra-y := head.o init_task.o vmlinux.lds.s ++extra-y := head.o init_task.o vmlinux.lds.asm + + obj-y := process.o semaphore.o signal.o entry.o traps.o irq.o vm86.o \ + ptrace.o i8259.o ioport.o ldt.o setup.o time.o sys_i386.o \ +diff -ur linux-2.6.7/arch/ia64/Makefile linux-2.6.7-mod/arch/ia64/Makefile +--- linux-2.6.7/arch/ia64/Makefile Mon May 10 04:31:59 2004 ++++ linux-2.6.7-mod/arch/ia64/Makefile Sat Jun 19 12:50:12 2004 +@@ -88,12 +88,12 @@ + + prepare: include/asm-ia64/offsets.h + +-arch/ia64/kernel/asm-offsets.s: include/asm include/linux/version.h include/config/MARKER ++arch/ia64/kernel/asm-offsets.asm: include/asm include/linux/version.h include/config/MARKER + +-include/asm-ia64/offsets.h: arch/ia64/kernel/asm-offsets.s ++include/asm-ia64/offsets.h: arch/ia64/kernel/asm-offsets.asm + $(call filechk,gen-asm-offsets) + +-arch/ia64/kernel/asm-offsets.s: include/asm-ia64/.offsets.h.stamp ++arch/ia64/kernel/asm-offsets.asm: include/asm-ia64/.offsets.h.stamp + + include/asm-ia64/.offsets.h.stamp: + mkdir -p include/asm-ia64 +diff -ur linux-2.6.7/arch/ia64/kernel/Makefile linux-2.6.7-mod/arch/ia64/kernel/Makefile +--- linux-2.6.7/arch/ia64/kernel/Makefile Fri Jun 18 22:51:13 2004 ++++ linux-2.6.7-mod/arch/ia64/kernel/Makefile Sat Jun 19 12:52:14 2004 +@@ -2,7 +2,7 @@ + # Makefile for the linux kernel. + # + +-extra-y := head.o init_task.o vmlinux.lds.s ++extra-y := head.o init_task.o vmlinux.lds.asm + + obj-y := acpi.o entry.o efi.o efi_stub.o gate-data.o fsys.o ia64_ksyms.o irq.o irq_ia64.o \ + irq_lsapic.o ivt.o machvec.o pal.o patch.o process.o perfmon.o ptrace.o sal.o \ +@@ -21,7 +21,7 @@ + # The gate DSO image is built using a special linker script. + targets += gate.so gate-syms.o + +-extra-y += gate.so gate-syms.o gate.lds.s gate.o ++extra-y += gate.so gate-syms.o gate.lds.asm gate.o + + # fp_emulate() expects f2-f5,f16-f31 to contain the user-level state. + CFLAGS_traps.o += -mfixed-range=f2-f5,f16-f31 +@@ -32,14 +32,14 @@ + cmd_gate = $(CC) -nostdlib $(GATECFLAGS_$(@F)) -Wl,-T,$(filter-out FORCE,$^) -o $@ + + GATECFLAGS_gate.so = -shared -s -Wl,-soname=linux-gate.so.1 +-$(obj)/gate.so: $(obj)/gate.lds.s $(obj)/gate.o FORCE ++$(obj)/gate.so: $(obj)/gate.lds.asm $(obj)/gate.o FORCE + $(call if_changed,gate) + + $(obj)/built-in.o: $(obj)/gate-syms.o + $(obj)/built-in.o: ld_flags += -R $(obj)/gate-syms.o + + GATECFLAGS_gate-syms.o = -r +-$(obj)/gate-syms.o: $(src)/gate.lds.s $(obj)/gate.o FORCE ++$(obj)/gate-syms.o: $(src)/gate.lds.asm $(obj)/gate.o FORCE + $(call if_changed,gate) + + # gate-data.o contains the gate DSO image as data in section .data.gate. +diff -ur linux-2.6.7/arch/m68k/Makefile linux-2.6.7-mod/arch/m68k/Makefile +--- linux-2.6.7/arch/m68k/Makefile Fri Jun 18 22:51:14 2004 ++++ linux-2.6.7-mod/arch/m68k/Makefile Sat Jun 19 12:52:30 2004 +@@ -114,10 +114,10 @@ + prepare: include/asm-$(ARCH)/offsets.h + CLEAN_FILES += include/asm-$(ARCH)/offsets.h + +-arch/$(ARCH)/kernel/asm-offsets.s: include/asm include/linux/version.h \ ++arch/$(ARCH)/kernel/asm-offsets.asm: include/asm include/linux/version.h \ + include/config/MARKER + +-include/asm-$(ARCH)/offsets.h: arch/$(ARCH)/kernel/asm-offsets.s ++include/asm-$(ARCH)/offsets.h: arch/$(ARCH)/kernel/asm-offsets.asm + $(call filechk,gen-asm-offsets) + + archclean: +diff -ur linux-2.6.7/arch/m68k/kernel/Makefile linux-2.6.7-mod/arch/m68k/kernel/Makefile +--- linux-2.6.7/arch/m68k/kernel/Makefile Mon May 10 04:33:10 2004 ++++ linux-2.6.7-mod/arch/m68k/kernel/Makefile Sat Jun 19 12:52:35 2004 +@@ -7,7 +7,7 @@ + else + extra-y := sun3-head.o + endif +-extra-y += vmlinux.lds.s ++extra-y += vmlinux.lds.asm + + obj-y := entry.o process.o traps.o ints.o signal.o ptrace.o \ + sys_m68k.o time.o semaphore.o setup.o m68k_ksyms.o +diff -ur linux-2.6.7/arch/m68knommu/Makefile linux-2.6.7-mod/arch/m68knommu/Makefile +--- linux-2.6.7/arch/m68knommu/Makefile Mon May 10 04:32:54 2004 ++++ linux-2.6.7-mod/arch/m68knommu/Makefile Sat Jun 19 12:52:57 2004 +@@ -89,7 +89,7 @@ + head-y := arch/m68knommu/platform/$(platform-y)/$(board-y)/crt0_$(model-y).o + + CLEAN_FILES := include/asm-$(ARCH)/asm-offsets.h \ +- arch/$(ARCH)/kernel/asm-offsets.s ++ arch/$(ARCH)/kernel/asm-offsets.asm + + core-y += arch/m68knommu/kernel/ \ + arch/m68knommu/mm/ \ +@@ -102,7 +102,7 @@ + archclean: + $(call descend arch/$(ARCH)/boot, subdirclean) + +-include/asm-$(ARCH)/asm-offsets.h: arch/$(ARCH)/kernel/asm-offsets.s \ ++include/asm-$(ARCH)/asm-offsets.h: arch/$(ARCH)/kernel/asm-offsets.asm \ + include/asm include/linux/version.h \ + include/config/MARKER + $(call filechk,gen-asm-offsets) +diff -ur linux-2.6.7/arch/m68knommu/kernel/Makefile linux-2.6.7-mod/arch/m68knommu/kernel/Makefile +--- linux-2.6.7/arch/m68knommu/kernel/Makefile Mon May 10 04:32:26 2004 ++++ linux-2.6.7-mod/arch/m68knommu/kernel/Makefile Sat Jun 19 12:53:20 2004 +@@ -2,7 +2,7 @@ + # Makefile for arch/m68knommu/kernel. + # + +-extra-y := vmlinux.lds.s ++extra-y := vmlinux.lds.asm + + obj-y += dma.o entry.o init_task.o m68k_ksyms.o process.o ptrace.o semaphore.o \ + setup.o signal.o syscalltable.o sys_m68k.o time.o traps.o +diff -ur linux-2.6.7/arch/mips/Makefile linux-2.6.7-mod/arch/mips/Makefile +--- linux-2.6.7/arch/mips/Makefile Fri Jun 18 22:51:19 2004 ++++ linux-2.6.7-mod/arch/mips/Makefile Sat Jun 19 12:53:35 2004 +@@ -752,12 +752,12 @@ + prepare: include/asm-$(ARCH)/offset.h \ + include/asm-$(ARCH)/reg.h + +-arch/$(ARCH)/kernel/offset.s: include/asm include/linux/version.h \ ++arch/$(ARCH)/kernel/offset.asm: include/asm include/linux/version.h \ + include/config/MARKER + +-include/asm-$(ARCH)/offset.h: arch/$(ARCH)/kernel/offset.s ++include/asm-$(ARCH)/offset.h: arch/$(ARCH)/kernel/offset.asm + $(call filechk,gen-asm-offset.h) +-include/asm-$(ARCH)/reg.h: arch/$(ARCH)/kernel/reg.s ++include/asm-$(ARCH)/reg.h: arch/$(ARCH)/kernel/reg.asm + $(call filechk,gen-asm-reg.h) + + CLEAN_FILES += include/asm-$(ARCH)/offset.h.tmp \ +diff -ur linux-2.6.7/arch/mips/kernel/Makefile linux-2.6.7-mod/arch/mips/kernel/Makefile +--- linux-2.6.7/arch/mips/kernel/Makefile Mon May 10 04:32:28 2004 ++++ linux-2.6.7-mod/arch/mips/kernel/Makefile Sat Jun 19 12:53:41 2004 +@@ -2,7 +2,7 @@ + # Makefile for the Linux/MIPS kernel. + # + +-extra-y := head.o init_task.o vmlinux.lds.s ++extra-y := head.o init_task.o vmlinux.lds.asm + + obj-y += cpu-probe.o branch.o entry.o genex.o irq.o process.o \ + ptrace.o reset.o semaphore.o setup.o signal.o syscall.o \ +diff -ur linux-2.6.7/arch/parisc/Makefile linux-2.6.7-mod/arch/parisc/Makefile +--- linux-2.6.7/arch/parisc/Makefile Fri Jun 18 22:51:21 2004 ++++ linux-2.6.7-mod/arch/parisc/Makefile Sat Jun 19 12:53:47 2004 +@@ -88,10 +88,10 @@ + + prepare: include/asm-parisc/offsets.h + +-arch/parisc/kernel/asm-offsets.s: include/asm include/linux/version.h \ ++arch/parisc/kernel/asm-offsets.asm: include/asm include/linux/version.h \ + include/config/MARKER + +-include/asm-parisc/offsets.h: arch/parisc/kernel/asm-offsets.s ++include/asm-parisc/offsets.h: arch/parisc/kernel/asm-offsets.asm + $(call filechk,gen-asm-offsets) + + CLEAN_FILES += lifimage include/asm-parisc/offsets.h +diff -ur linux-2.6.7/arch/parisc/kernel/Makefile linux-2.6.7-mod/arch/parisc/kernel/Makefile +--- linux-2.6.7/arch/parisc/kernel/Makefile Fri Jun 18 22:51:21 2004 ++++ linux-2.6.7-mod/arch/parisc/kernel/Makefile Sat Jun 19 12:53:53 2004 +@@ -4,7 +4,7 @@ + + head-y := head.o + head-$(CONFIG_PARISC64) := head64.o +-extra-y := init_task.o $(head-y) vmlinux.lds.s ++extra-y := init_task.o $(head-y) vmlinux.lds.asm + + AFLAGS_entry.o := -traditional + AFLAGS_pacache.o := -traditional +diff -ur linux-2.6.7/arch/ppc/Makefile linux-2.6.7-mod/arch/ppc/Makefile +--- linux-2.6.7/arch/ppc/Makefile Fri Jun 18 22:51:22 2004 ++++ linux-2.6.7-mod/arch/ppc/Makefile Sat Jun 19 12:54:09 2004 +@@ -78,10 +78,10 @@ + + prepare: include/asm-$(ARCH)/offsets.h checkbin + +-arch/$(ARCH)/kernel/asm-offsets.s: include/asm include/linux/version.h \ ++arch/$(ARCH)/kernel/asm-offsets.asm: include/asm include/linux/version.h \ + include/config/MARKER + +-include/asm-$(ARCH)/offsets.h: arch/$(ARCH)/kernel/asm-offsets.s ++include/asm-$(ARCH)/offsets.h: arch/$(ARCH)/kernel/asm-offsets.asm + $(call filechk,gen-asm-offsets) + + ifdef CONFIG_6xx +@@ -104,4 +104,4 @@ + endif + + CLEAN_FILES += include/asm-$(ARCH)/offsets.h \ +- arch/$(ARCH)/kernel/asm-offsets.s ++ arch/$(ARCH)/kernel/asm-offsets.asm +diff -ur linux-2.6.7/arch/ppc/kernel/Makefile linux-2.6.7-mod/arch/ppc/kernel/Makefile +--- linux-2.6.7/arch/ppc/kernel/Makefile Fri Jun 18 22:51:24 2004 ++++ linux-2.6.7-mod/arch/ppc/kernel/Makefile Sat Jun 19 12:43:10 2004 +@@ -15,7 +15,7 @@ + extra-$(CONFIG_8xx) := head_8xx.o + extra-$(CONFIG_6xx) += idle_6xx.o + extra-$(CONFIG_POWER4) += idle_power4.o +-extra-y += vmlinux.lds.s ++extra-y += vmlinux.lds.asm + + obj-y := entry.o traps.o irq.o idle.o time.o misc.o \ + process.o signal.o ptrace.o align.o \ +diff -ur linux-2.6.7/arch/ppc64/Makefile linux-2.6.7-mod/arch/ppc64/Makefile +--- linux-2.6.7/arch/ppc64/Makefile Fri Jun 18 22:51:26 2004 ++++ linux-2.6.7-mod/arch/ppc64/Makefile Sat Jun 19 12:54:32 2004 +@@ -67,10 +67,10 @@ + + prepare: include/asm-ppc64/offsets.h + +-arch/ppc64/kernel/asm-offsets.s: include/asm include/linux/version.h \ ++arch/ppc64/kernel/asm-offsets.asm: include/asm include/linux/version.h \ + include/config/MARKER + +-include/asm-ppc64/offsets.h: arch/ppc64/kernel/asm-offsets.s ++include/asm-ppc64/offsets.h: arch/ppc64/kernel/asm-offsets.asm + $(call filechk,gen-asm-offsets) + + define archhelp +diff -ur linux-2.6.7/arch/ppc64/kernel/Makefile linux-2.6.7-mod/arch/ppc64/kernel/Makefile +--- linux-2.6.7/arch/ppc64/kernel/Makefile Mon May 10 04:33:20 2004 ++++ linux-2.6.7-mod/arch/ppc64/kernel/Makefile Sat Jun 19 12:54:39 2004 +@@ -3,7 +3,7 @@ + # + + EXTRA_CFLAGS += -mno-minimal-toc +-extra-y := head.o vmlinux.lds.s ++extra-y := head.o vmlinux.lds.asm + + obj-y := setup.o entry.o traps.o irq.o idle.o dma.o \ + time.o process.o signal.o syscalls.o misc.o ptrace.o \ +diff -ur linux-2.6.7/arch/s390/Makefile linux-2.6.7-mod/arch/s390/Makefile +--- linux-2.6.7/arch/s390/Makefile Mon May 10 04:32:02 2004 ++++ linux-2.6.7-mod/arch/s390/Makefile Sat Jun 19 12:54:46 2004 +@@ -68,10 +68,10 @@ + + prepare: include/asm-$(ARCH)/offsets.h + +-arch/$(ARCH)/kernel/asm-offsets.s: include/asm include/linux/version.h \ ++arch/$(ARCH)/kernel/asm-offsets.asm: include/asm include/linux/version.h \ + include/config/MARKER + +-include/asm-$(ARCH)/offsets.h: arch/$(ARCH)/kernel/asm-offsets.s ++include/asm-$(ARCH)/offsets.h: arch/$(ARCH)/kernel/asm-offsets.asm + $(call filechk,gen-asm-offsets) + + CLEAN_FILES += include/asm-$(ARCH)/offsets.h +diff -ur linux-2.6.7/arch/s390/kernel/Makefile linux-2.6.7-mod/arch/s390/kernel/Makefile +--- linux-2.6.7/arch/s390/kernel/Makefile Mon May 10 04:33:20 2004 ++++ linux-2.6.7-mod/arch/s390/kernel/Makefile Sat Jun 19 12:54:52 2004 +@@ -10,7 +10,7 @@ + + extra-$(CONFIG_ARCH_S390_31) += head.o + extra-$(CONFIG_ARCH_S390X) += head64.o +-extra-y += init_task.o vmlinux.lds.s ++extra-y += init_task.o vmlinux.lds.asm + + obj-$(CONFIG_MODULES) += s390_ksyms.o module.o + obj-$(CONFIG_SMP) += smp.o +diff -ur linux-2.6.7/arch/sh/kernel/Makefile linux-2.6.7-mod/arch/sh/kernel/Makefile +--- linux-2.6.7/arch/sh/kernel/Makefile Mon May 10 04:32:39 2004 ++++ linux-2.6.7-mod/arch/sh/kernel/Makefile Sat Jun 19 12:55:33 2004 +@@ -2,7 +2,7 @@ + # Makefile for the Linux/SuperH kernel. + # + +-extra-y := head.o init_task.o vmlinux.lds.s ++extra-y := head.o init_task.o vmlinux.lds.asm + + obj-y := process.o signal.o entry.o traps.o irq.o \ + ptrace.o setup.o time.o sys_sh.o semaphore.o \ +diff -ur linux-2.6.7/arch/sparc/Makefile linux-2.6.7-mod/arch/sparc/Makefile +--- linux-2.6.7/arch/sparc/Makefile Fri Jun 18 22:51:29 2004 ++++ linux-2.6.7-mod/arch/sparc/Makefile Sat Jun 19 12:55:48 2004 +@@ -61,14 +61,14 @@ + + prepare: include/asm-$(ARCH)/asm_offsets.h + +-arch/$(ARCH)/kernel/asm-offsets.s: include/asm include/linux/version.h \ ++arch/$(ARCH)/kernel/asm-offsets.asm: include/asm include/linux/version.h \ + include/config/MARKER + +-include/asm-$(ARCH)/asm_offsets.h: arch/$(ARCH)/kernel/asm-offsets.s ++include/asm-$(ARCH)/asm_offsets.h: arch/$(ARCH)/kernel/asm-offsets.asm + $(call filechk,gen-asm-offsets) + + CLEAN_FILES += include/asm-$(ARCH)/asm_offsets.h \ +- arch/$(ARCH)/kernel/asm-offsets.s \ ++ arch/$(ARCH)/kernel/asm-offsets.asm \ + arch/$(ARCH)/boot/System.map + + # Don't use tabs in echo arguments. +diff -ur linux-2.6.7/arch/sparc/kernel/Makefile linux-2.6.7-mod/arch/sparc/kernel/Makefile +--- linux-2.6.7/arch/sparc/kernel/Makefile Mon May 10 04:33:13 2004 ++++ linux-2.6.7-mod/arch/sparc/kernel/Makefile Sat Jun 19 12:55:52 2004 +@@ -2,7 +2,7 @@ + # Makefile for the linux kernel. + # + +-extra-y := head.o init_task.o vmlinux.lds.s ++extra-y := head.o init_task.o vmlinux.lds.asm + + EXTRA_AFLAGS := -ansi + +diff -ur linux-2.6.7/arch/sparc64/kernel/Makefile linux-2.6.7-mod/arch/sparc64/kernel/Makefile +--- linux-2.6.7/arch/sparc64/kernel/Makefile Mon May 10 04:32:02 2004 ++++ linux-2.6.7-mod/arch/sparc64/kernel/Makefile Sat Jun 19 12:56:24 2004 +@@ -5,7 +5,7 @@ + EXTRA_AFLAGS := -ansi + EXTRA_CFLAGS := -Werror + +-extra-y := head.o init_task.o vmlinux.lds.s ++extra-y := head.o init_task.o vmlinux.lds.asm + + obj-y := process.o setup.o cpu.o idprom.o \ + traps.o devices.o auxio.o \ +diff -ur linux-2.6.7/arch/um/Makefile linux-2.6.7-mod/arch/um/Makefile +--- linux-2.6.7/arch/um/Makefile Mon May 10 04:32:52 2004 ++++ linux-2.6.7-mod/arch/um/Makefile Sat Jun 19 12:57:07 2004 +@@ -77,7 +77,7 @@ + # CONFIG_MODE_SKAS + CONFIG_STATIC_LINK case. + + LINK_TT = -static +-LD_SCRIPT_TT := uml.lds.s ++LD_SCRIPT_TT := uml.lds.asm + + ifeq ($(CONFIG_STATIC_LINK),y) + LINK-y += $(LINK_TT) +@@ -103,11 +103,11 @@ + -DELF_FORMAT=\"$(ELF_FORMAT)\" $(CPP_MODE_TT) \ + -DKERNEL_STACK_SIZE=$(STACK_SIZE) + +-AFLAGS_$(LD_SCRIPT-y:.s=).o = $(AFLAGS_vmlinux.lds.o) -P -C -Uum ++AFLAGS_$(LD_SCRIPT-y:.asm=).o = $(AFLAGS_vmlinux.lds.o) -P -C -Uum + + LD_SCRIPT-y := $(ARCH_DIR)/$(LD_SCRIPT-y) + +-$(LD_SCRIPT-y) : $(LD_SCRIPT-y:.s=.S) scripts FORCE ++$(LD_SCRIPT-y) : $(LD_SCRIPT-y:.asm=.S) scripts FORCE + $(call if_changed_dep,as_s_S) + + linux: vmlinux $(LD_SCRIPT-y) +@@ -122,8 +122,8 @@ + # To get a definition of F_SETSIG + USER_CFLAGS += -D_GNU_SOURCE + +-CLEAN_FILES += linux x.i gmon.out $(ARCH_DIR)/uml.lds.s \ +- $(ARCH_DIR)/dyn_link.ld.s $(GEN_HEADERS) ++CLEAN_FILES += linux x.i gmon.out $(ARCH_DIR)/uml.lds.asm \ ++ $(ARCH_DIR)/dyn_link.ld.asm $(GEN_HEADERS) + + $(ARCH_DIR)/main.o: $(ARCH_DIR)/main.c + $(CC) $(USER_CFLAGS) $(EXTRA_CFLAGS) -c -o $@ $< +diff -ur linux-2.6.7/arch/um/kernel/Makefile linux-2.6.7-mod/arch/um/kernel/Makefile +--- linux-2.6.7/arch/um/kernel/Makefile Mon May 10 04:32:53 2004 ++++ linux-2.6.7-mod/arch/um/kernel/Makefile Sat Jun 19 12:57:15 2004 +@@ -3,7 +3,7 @@ + # Licensed under the GPL + # + +-extra-y := vmlinux.lds.s ++extra-y := vmlinux.lds.asm + + obj-y = checksum.o config.o exec_kern.o exitcode.o frame_kern.o frame.o \ + helper.o init_task.o irq.o irq_user.o ksyms.o mem.o mem_user.o \ +diff -ur linux-2.6.7/arch/v850/Makefile linux-2.6.7-mod/arch/v850/Makefile +--- linux-2.6.7/arch/v850/Makefile Mon May 10 04:33:21 2004 ++++ linux-2.6.7-mod/arch/v850/Makefile Sat Jun 19 12:57:59 2004 +@@ -52,12 +52,12 @@ + prepare: include/asm-$(ARCH)/asm-consts.h + + # Generate constants from C code for use by asm files +-arch/$(ARCH)/kernel/asm-consts.s: include/asm include/linux/version.h \ ++arch/$(ARCH)/kernel/asm-consts.asm: include/asm include/linux/version.h \ + include/config/MARKER + +-include/asm-$(ARCH)/asm-consts.h: arch/$(ARCH)/kernel/asm-consts.s ++include/asm-$(ARCH)/asm-consts.h: arch/$(ARCH)/kernel/asm-consts.asm + $(call filechk,gen-asm-offsets) + + CLEAN_FILES += include/asm-$(ARCH)/asm-consts.h \ +- arch/$(ARCH)/kernel/asm-consts.s \ ++ arch/$(ARCH)/kernel/asm-consts.asm \ + root_fs_image.o +diff -ur linux-2.6.7/arch/v850/kernel/Makefile linux-2.6.7-mod/arch/v850/kernel/Makefile +--- linux-2.6.7/arch/v850/kernel/Makefile Mon May 10 04:33:21 2004 ++++ linux-2.6.7-mod/arch/v850/kernel/Makefile Sat Jun 19 12:58:04 2004 +@@ -9,7 +9,7 @@ + # for more details. + # + +-extra-y := head.o init_task.o vmlinux.lds.s ++extra-y := head.o init_task.o vmlinux.lds.asm + + obj-y += intv.o entry.o process.o syscalls.o time.o semaphore.o setup.o \ + signal.o irq.o mach.o ptrace.o bug.o +diff -ur linux-2.6.7/arch/x86_64/Makefile linux-2.6.7-mod/arch/x86_64/Makefile +--- linux-2.6.7/arch/x86_64/Makefile Mon May 10 04:33:19 2004 ++++ linux-2.6.7-mod/arch/x86_64/Makefile Sat Jun 19 12:58:10 2004 +@@ -93,10 +93,10 @@ + + prepare: include/asm-$(ARCH)/offset.h + +-arch/$(ARCH)/kernel/asm-offsets.s: include/asm include/linux/version.h \ ++arch/$(ARCH)/kernel/asm-offsets.asm: include/asm include/linux/version.h \ + include/config/MARKER + +-include/asm-$(ARCH)/offset.h: arch/$(ARCH)/kernel/asm-offsets.s ++include/asm-$(ARCH)/offset.h: arch/$(ARCH)/kernel/asm-offsets.asm + $(call filechk,gen-asm-offsets) + + CLEAN_FILES += include/asm-$(ARCH)/offset.h +diff -ur linux-2.6.7/arch/x86_64/kernel/Makefile linux-2.6.7-mod/arch/x86_64/kernel/Makefile +--- linux-2.6.7/arch/x86_64/kernel/Makefile Fri Jun 18 22:51:32 2004 ++++ linux-2.6.7-mod/arch/x86_64/kernel/Makefile Sat Jun 19 12:58:17 2004 +@@ -2,7 +2,7 @@ + # Makefile for the linux kernel. + # + +-extra-y := head.o head64.o init_task.o vmlinux.lds.s ++extra-y := head.o head64.o init_task.o vmlinux.lds.asm + EXTRA_AFLAGS := -traditional + obj-y := process.o semaphore.o signal.o entry.o traps.o irq.o \ + ptrace.o i8259.o ioport.o ldt.o setup.o time.o sys_x86_64.o \ +diff -ur linux-2.6.7/scripts/Makefile.build linux-2.6.7-mod/scripts/Makefile.build +--- linux-2.6.7/scripts/Makefile.build Mon May 10 04:33:13 2004 ++++ linux-2.6.7-mod/scripts/Makefile.build Sat Jun 19 12:43:10 2004 +@@ -110,7 +110,7 @@ + quiet_cmd_cc_s_c = CC $(quiet_modtag) $@ + cmd_cc_s_c = $(CC) $(c_flags) -S -o $@ $< + +-%.s: %.c FORCE ++%.asm: %.c FORCE + $(call if_changed_dep,cc_s_c) + + quiet_cmd_cc_i_c = CPP $(quiet_modtag) $@ +@@ -197,7 +197,7 @@ + quiet_cmd_as_s_S = CPP $(quiet_modtag) $@ + cmd_as_s_S = $(CPP) $(a_flags) -o $@ $< + +-%.s: %.S FORCE ++%.asm: %.S FORCE + $(call if_changed_dep,as_s_S) + + quiet_cmd_as_o_S = AS $(quiet_modtag) $@ +--- linux-2.6.8/arch/sparc/boot/Makefile.old 2004-09-21 21:46:18.000000000 -0700 ++++ linux-2.6.8/arch/sparc/boot/Makefile 2004-09-21 21:52:35.000000000 -0700 +@@ -19,7 +19,7 @@ + + BTOBJS := $(HEAD_Y) $(INIT_Y) + BTLIBS := $(CORE_Y) $(LIBS_Y) $(DRIVERS_Y) $(NET_Y) +-LDFLAGS_image := -T arch/sparc/kernel/vmlinux.lds.s $(BTOBJS) --start-group $(BTLIBS) --end-group $(kallsyms.o) ++LDFLAGS_image := -T arch/sparc/kernel/vmlinux.lds.asm $(BTOBJS) --start-group $(BTLIBS) --end-group $(kallsyms.o) + + # Actual linking + $(obj)/image: $(obj)/btfix.o FORCE +--- linux-2.6.8/arch/sh64/Makefile.old 2004-09-21 21:46:18.000000000 -0700 ++++ linux-2.6.8/arch/sh64/Makefile 2004-09-21 21:54:31.000000000 -0700 +@@ -71,7 +71,7 @@ + + prepare: include/asm-$(ARCH)/asm-offsets.h arch/$(ARCH)/lib/syscalltab.h + +-include/asm-$(ARCH)/asm-offsets.h: arch/$(ARCH)/kernel/asm-offsets.s \ ++include/asm-$(ARCH)/asm-offsets.h: arch/$(ARCH)/kernel/asm-offsets.asm \ + include/asm include/linux/version.h + $(call filechk,gen-asm-offsets) + +--- linux-2.6.8/arch/sh64/boot/compressed/Makefile.old 2004-09-21 21:46:18.000000000 -0700 ++++ linux-2.6.8/arch/sh64/boot/compressed/Makefile 2004-09-21 21:54:41.000000000 -0700 +@@ -25,7 +25,7 @@ + ZIMAGE_OFFSET = $(shell printf "0x%8x" $$[$(CONFIG_MEMORY_START)+0x400000+0x10000]) + + LDFLAGS_vmlinux := -Ttext $(ZIMAGE_OFFSET) -e startup \ +- -T $(obj)/../../kernel/vmlinux.lds.s \ ++ -T $(obj)/../../kernel/vmlinux.lds.asm \ + --no-warn-mismatch + + $(obj)/vmlinux: $(OBJECTS) $(obj)/piggy.o FORCE +@@ -41,6 +41,6 @@ + LDFLAGS_piggy.o := -r --format binary --oformat elf32-sh64-linux -T + OBJCOPYFLAGS += -R .empty_zero_page + +-$(obj)/piggy.o: $(obj)/vmlinux.lds.s $(obj)/vmlinux.bin.gz FORCE ++$(obj)/piggy.o: $(obj)/vmlinux.lds.asm $(obj)/vmlinux.bin.gz FORCE + $(call if_changed,ld) + diff --git a/patches/linux/2.6.8/140-linux-2.6.8-m68k-kludge.patch b/patches/linux/2.6.8/140-linux-2.6.8-m68k-kludge.patch new file mode 100644 index 0000000..9cef549 --- /dev/null +++ b/patches/linux/2.6.8/140-linux-2.6.8-m68k-kludge.patch @@ -0,0 +1,285 @@ +[ This patch not accepted into kernel for now - it touches the core too much - + but it's ok for crosstool since we just want to check whether toolchain is ok, + I think. I had to rediff the sched.h changes with -U5 to get them to + apply properly -- patch got confused with just three lines of context?! -dank ] + +Date: Sun, 5 Sep 2004 12:41:08 +0200 (CEST) +From: Geert Uytterhoeven +Sender: geert@linux-m68k.org +To: Dan Kegel +cc: Roman Zippel , + Matthias Urlichs , + Linux Kernel Mailing List , + Linux/m68k +Subject: Re: Getting kernel.org kernel to build for m68k? +In-Reply-To: +Message-ID: + +On Wed, 1 Sep 2004, Geert Uytterhoeven wrote: +> On Tue, 31 Aug 2004, Dan Kegel wrote: +> > I noticed today that Linus's m68k kernel can't be built (at least with gcc-3.4.1). +> > +> > The first problem I ran into, +> > CC arch/m68k/kernel/asm-offsets.s +> > In file included from include/linux/spinlock.h:12, +> > from include/linux/capability.h:45, +> > from include/linux/sched.h:7, +> > from arch/m68k/kernel/asm-offsets.c:12: +> > include/linux/thread_info.h:30: error: parse error before '{' token +> > is solved already in the m68k tree. +> > (In particular, +> > the #ifndef __HAVE_THREAD_FUNCTIONS ... #endif in +> > http://linux-m68k-cvs.apia.dhs.org/c/cvsweb/linux/include/linux/thread_info.h?rev=1.5;content-type=text%2Fplain +> > probably solves it.) +> > There are other problems after that. +> +> Roman Zippel changed the threading stuff on m68k. Since it would affect other +> architectures, I never submitted it on my own. +> +> In short, we never really compile this code, since the m68k tree doesn't use it +> anymore. And yes, it even fails with older compiler versions, like 2.95.2. + +The second part doesn't seem to be true: the code is used. And it does compile +after applying the fixes below, even with gcc 3.4.1. + +> > Any chance you could spend a bit of time sending Linus enough +> > patches for his kernel to build for m68k, if not run? +> +> I'll make sure a plain kernel.org kernel can build an m68k kernel. + +The patch below makes the plain kernel.org 2.6.8.1 compile for m68k, +using gcc 2.95.2 or 3.3.3 (3.4.1 needs a few more changes in random +places). The resulting kernel (I booted the gcc 2.95.2 case) works fine on my +Amiga. + +It's more or less the patch created by Matthias Urlichs last year, so +the credits are his: + +| This change implements a reasonable compromise between the task_info->flags +| variable in other ports, which is too much work in the syscall path on m68k, +| and moving the whole structure to thread_struct, which is way too intrusive +| on other ports. + +The patch does affect generic code a bit, but the collateral damage is +kept to a minimum. + +We can still keep Roman's thread info abstractions[*] in Linux/m68k CVS, but +I'd really like the plain kernel.org kernel to be in a working state as well. +That way more people may do cross-compile tests for m68k. + +Hence if no one objects, I'll submit the patch to Andrew and Linus. + +All comments are welcome! + +--- linux-2.6.8.1/arch/m68k/kernel/asm-offsets.c 2004-04-28 15:48:59.000000000 +0200 ++++ linux-m68k-2.6.8.1/arch/m68k/kernel/asm-offsets.c 2004-09-05 12:04:00.000000000 +0200 +@@ -31,6 +31,7 @@ int main(void) + DEFINE(TASK_SIGPENDING, offsetof(struct task_struct, thread.work.sigpending)); + DEFINE(TASK_NOTIFY_RESUME, offsetof(struct task_struct, thread.work.notify_resume)); + DEFINE(TASK_THREAD, offsetof(struct task_struct, thread)); ++ DEFINE(TASK_TINFO, offsetof(struct task_struct, thread_info)); + DEFINE(TASK_MM, offsetof(struct task_struct, mm)); + DEFINE(TASK_ACTIVE_MM, offsetof(struct task_struct, active_mm)); + +@@ -45,6 +46,9 @@ int main(void) + DEFINE(THREAD_FPCNTL, offsetof(struct thread_struct, fpcntl)); + DEFINE(THREAD_FPSTATE, offsetof(struct thread_struct, fpstate)); + ++ /* offsets into the thread_info struct */ ++ DEFINE(TINFO_PREEMPT, offsetof(struct thread_info, preempt_count)); ++ + /* offsets into the pt_regs */ + DEFINE(PT_D0, offsetof(struct pt_regs, d0)); + DEFINE(PT_ORIG_D0, offsetof(struct pt_regs, orig_d0)); +--- linux-2.6.8.1/arch/m68k/kernel/entry.S 2004-05-24 11:13:22.000000000 +0200 ++++ linux-m68k-2.6.8.1/arch/m68k/kernel/entry.S 2004-09-02 20:13:12.000000000 +0200 +@@ -134,13 +134,13 @@ ENTRY(system_call) + + syscall_exit_work: + btst #5,%sp@(PT_SR) | check if returning to kernel +- bnes 1b | if so, skip resched, signals ++ bnes 1b | if so, skip everything + tstw %d0 +- jeq do_signal_return ++ jeq do_signal_return | jump if only sig_pending or notify_resume + tstb %d0 +- jne do_delayed_trace ++ jne do_delayed_trace | jump if delayed_trace + +- pea resume_userspace ++ pea resume_userspace | need_resched is set + jmp schedule + + ret_from_exception: +@@ -223,10 +223,14 @@ ENTRY(nmi_handler) + */ + inthandler: + SAVE_ALL_INT +- GET_CURRENT(%d0) +- addqb #1,%curptr@(TASK_INFO+TINFO_PREEMPT+2) +- | put exception # in d0 +- bfextu %sp@(PT_VECTOR){#4,#10},%d0 ++ /* GET_CURRENT(%d0) */ ++ movel %sp,%d0 ++ andw #-THREAD_SIZE,%d0 ++ movel %d0,%a1 ++ addqb #1,%a1@(TINFO_PREEMPT+2) ++ movel %a1@,%curptr ++ ++ bfextu %sp@(PT_VECTOR){#4,#10},%d0 | put exception # in d0 + + movel %sp,%sp@- + movel %d0,%sp@- | put vector # on stack +@@ -243,7 +247,8 @@ inthandler: + 3: addql #8,%sp | pop parameters off stack + + ret_from_interrupt: +- subqb #1,%curptr@(TASK_INFO+TINFO_PREEMPT+2) ++ movel %curptr@(TASK_TINFO),%a1 ++ subqb #1,%a1@(TINFO_PREEMPT+2) + jeq 1f + 2: + RESTORE_ALL +--- linux-2.6.8.1/include/asm-m68k/processor.h 2004-04-28 15:49:03.000000000 +0200 ++++ linux-m68k-2.6.8.1/include/asm-m68k/processor.h 2004-09-02 20:29:32.000000000 +0200 +@@ -84,7 +84,6 @@ struct thread_struct { + ksp: sizeof(init_stack) + (unsigned long) init_stack, \ + sr: PS_S, \ + fs: __KERNEL_DS, \ +- info: INIT_THREAD_INFO(init_task) \ + } + + /* +--- linux-2.6.8.1/include/asm-m68k/thread_info.h 2004-05-24 11:13:53.000000000 +0200 ++++ linux-m68k-2.6.8.1/include/asm-m68k/thread_info.h 2004-09-05 12:19:47.000000000 +0200 +@@ -6,7 +6,7 @@ + #include + + struct thread_info { +- struct task_struct *task; /* main task structure */ ++ struct task_struct *task; /* main task structure, must be first! */ + struct exec_domain *exec_domain; /* execution domain */ + __s32 preempt_count; /* 0 => preemptable, <0 => BUG */ + __u32 cpu; /* should always be 0 on m68k */ +@@ -21,7 +21,8 @@ struct thread_info { + { \ + .task = &tsk, \ + .exec_domain = &default_exec_domain, \ +- .restart_block = { \ ++ .preempt_count = 1, \ ++ .restart_block = { \ + .fn = do_no_restart_syscall, \ + }, \ + } +@@ -35,10 +36,11 @@ struct thread_info { + #define free_thread_info(ti) free_pages((unsigned long)(ti),1) + #endif /* PAGE_SHIFT == 13 */ + +-//#define init_thread_info (init_task.thread.info) ++#define init_thread_info (init_thread_union.thread_info) + #define init_stack (init_thread_union.stack) + +-#define current_thread_info() (current->thread_info) ++register __u32 current_thread_info_reg asm("sp"); ++#define current_thread_info() ((struct thread_info *)(current_thread_info_reg & ~0x1fff)) + + + #define __HAVE_THREAD_FUNCTIONS +@@ -91,8 +93,12 @@ extern int thread_flag_fixme(void); + }) + + #define __get_set_tsk_thread_flag(tsk, flag, val) ({ \ +- int __res = __get_tsk_thread_flag(tsk, flag); \ ++ int __res; \ ++ unsigned long __flags; \ ++ local_irq_save(__flags); \ ++ __res = __get_tsk_thread_flag(tsk, flag); \ + __set_tsk_thread_flag(tsk, flag, val); \ ++ local_irq_restore(__flags); \ + __res; \ + }) + +@@ -105,7 +111,4 @@ extern int thread_flag_fixme(void); + #define clear_thread_flag(flag) clear_tsk_thread_flag(current, flag) + #define test_thread_flag(flag) test_tsk_thread_flag(current, flag) + +-#define set_need_resched() set_thread_flag(TIF_NEED_RESCHED) +-#define clear_need_resched() clear_thread_flag(TIF_NEED_RESCHED) +- + #endif /* _ASM_M68K_THREAD_INFO_H */ +--- linux-2.6.8/include/linux/sched.h.old 2004-09-13 21:48:58.000000000 -0700 ++++ linux-2.6.8/include/linux/sched.h 2004-09-13 21:50:26.000000000 -0700 +@@ -975,10 +975,11 @@ + task_unlock(task); + + return mm; + } + ++#ifndef __HAVE_THREAD_FUNCTIONS + + /* set thread flags in other task's structures + * - see asm/thread_info.h for TIF_xxxx flags available + */ + static inline void set_tsk_thread_flag(struct task_struct *tsk, int flag) +@@ -1004,10 +1005,12 @@ + static inline int test_tsk_thread_flag(struct task_struct *tsk, int flag) + { + return test_ti_thread_flag(tsk->thread_info,flag); + } + ++#endif /* __HAVE_THREAD_FUNCTIONS */ ++ + static inline void set_tsk_need_resched(struct task_struct *tsk) + { + set_tsk_thread_flag(tsk,TIF_NEED_RESCHED); + } + +--- linux-2.6.8.1/include/linux/thread_info.h 2004-04-27 20:42:22.000000000 +0200 ++++ linux-m68k-2.6.8.1/include/linux/thread_info.h 2004-09-04 21:24:36.000000000 +0200 +@@ -21,6 +21,7 @@ extern long do_no_restart_syscall(struct + #include + + #ifdef __KERNEL__ ++#ifndef __HAVE_THREAD_FUNCTIONS + + /* + * flag set/clear/test wrappers +@@ -77,16 +78,11 @@ static inline int test_ti_thread_flag(st + return test_bit(flag,&ti->flags); + } + +-static inline void set_need_resched(void) +-{ +- set_thread_flag(TIF_NEED_RESCHED); +-} ++#endif /* __HAVE_THREAD_FUNCTIONS */ + +-static inline void clear_need_resched(void) +-{ +- clear_thread_flag(TIF_NEED_RESCHED); +-} ++#define set_need_resched() set_thread_flag(TIF_NEED_RESCHED) ++#define clear_need_resched(void) clear_thread_flag(TIF_NEED_RESCHED) + +-#endif ++#endif /* __KERNEL__ */ + + #endif /* _LINUX_THREAD_INFO_H */ + +Gr{oetje,eeting}s, + + Geert + +[*] For reference: + + http://linux-m68k-cvs.ubb.ca/~geert/linux-m68k-2.6.x-merging/POSTPONED/156-thread_info.diff + +-- +Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org + +In personal conversations with technical people, I call myself a hacker. But +when I'm talking to journalists I just say "programmer" or something like that. + -- Linus Torvalds + + + diff --git a/patches/linux/2.6.8/150-linux-2.6.8-noshared-kconfig.patch b/patches/linux/2.6.8/150-linux-2.6.8-noshared-kconfig.patch new file mode 100644 index 0000000..326cdcd --- /dev/null +++ b/patches/linux/2.6.8/150-linux-2.6.8-noshared-kconfig.patch @@ -0,0 +1,28 @@ +Lets you run 'make oldconfig' and 'make menuconfig' on systems +where shared libraries aren't easy. (There's no harm in using the +static version of libkconfig.) +Idea mentioned by Bertrand Marquis, but this patch is a bit simpler than his. + + +--- linux-2.6.8.1/scripts/kconfig/Makefile.old 2004-09-09 20:30:25.000000000 -0700 ++++ linux-2.6.8.1/scripts/kconfig/Makefile 2004-09-09 20:47:51.000000000 -0700 +@@ -68,8 +68,8 @@ + libkconfig-objs := zconf.tab.o + + host-progs := conf mconf qconf gconf +-conf-objs := conf.o libkconfig.so +-mconf-objs := mconf.o libkconfig.so ++conf-objs := conf.o $(libkconfig-objs) ++mconf-objs := mconf.o $(libkconfig-objs) + + ifeq ($(MAKECMDGOALS),xconfig) + qconf-target := 1 +@@ -88,7 +88,7 @@ + gconf-objs := gconf.o kconfig_load.o + endif + +-clean-files := libkconfig.so lkc_defs.h qconf.moc .tmp_qtcheck \ ++clean-files := $(libkconfig-objs) lkc_defs.h qconf.moc .tmp_qtcheck \ + .tmp_gtkcheck zconf.tab.c zconf.tab.h lex.zconf.c + + # generated files seem to need this to find local include files diff --git a/patches/linux/2.6.8/kaz-types.patch b/patches/linux/2.6.8/kaz-types.patch deleted file mode 100644 index ec5de36..0000000 --- a/patches/linux/2.6.8/kaz-types.patch +++ /dev/null @@ -1,60 +0,0 @@ -The following fixes an error that occurs when building glibc-2.3.2 (but not glibc-2.2.5) for sh4: - -In file included from sys/ustat.h:30, - from ../sysdeps/unix/sysv/linux/ustat.c:21: -../sysdeps/generic/bits/ustat.h:26: error: redefinition of `struct ustat' -make[2]: *** [/home3/dank/crosstool-0.7/build/sh4-unknown-linux-gnu/gcc-3.3-glibc-2.3.2/build-glibc/misc/ustat.o] Error 1 -make[2]: Leaving directory `/home3/dank/crosstool-0.7/build/sh4-unknown-linux-gnu/gcc-3.3-glibc-2.3.2/glibc-2.3.2/misc' -make[1]: *** [misc/subdir_lib] Error 2 -make[1]: Leaving directory `/home3/dank/crosstool-0.7/build/sh4-unknown-linux-gnu/gcc-3.3-glibc-2.3.2/glibc-2.3.2' -make: *** [all] Error 2 - ------------ snip --------------- - -Date: Fri, 06 Jun 2003 08:00:00 +0900 -From: kaz Kojima -Subject: [linux-sh:02770] Re: Compiling glibc-2.3.2 for sh4 fails with "include/asm/user.h:32: - error: redefinition of `struct user_fpu_struct'" -To: linux-sh@m17n.org -Message-Id: <200306052250.h55Moeb08707@r-rr.iij4u.or.jp> - -Hi, - -Dan Kegel wrote: -> When I try to build glibc-2.3.2 for sh4, it fails with the error -[snip] -> /home3/dank/crosstool-0.3/result/sh4-linux/gcc-3.3-glibc-2.3.2/sh4-linux/include/asm/user.h:32: error: redefinition of `struct user_fpu_struct' -> /home3/dank/crosstool-0.3/result/sh4-linux/gcc-3.3-glibc-2.3.2/sh4-linux/include/asm/user.h:39: error: redefinition of `struct user' -[snip] -> The error reminds me of the kind of thing fixed by -> http://www.kegel.com/crossgcc/crosstool-0.4/glibc-2.3.2-patches/sh-user.patch - -It seems that the definitions in asm/user.h and the above patch collide. -I'm not sure why you need this patch, but is it needed for the problem -about struct ustat that you pointed out in this list, isn't it? -I found why I don't hit ustat problem - my local kernel tree includes -the following patch, though I can't recall about it. - -Regards, - kaz --- -diff -u linux-2.5.69-sf-orig/include/linux/types.h /usr/local/sh4-unknown-linux-gnu/include/linux/types.h ---- linux-2.5.69-sf-orig/include/linux/types.h Wed Mar 5 12:29:34 2003 -+++ sh4-unknown-linux-gnu/include/linux/types.h Sat Apr 19 10:05:52 2003 -@@ -141,6 +141,7 @@ - - #endif /* __KERNEL_STRICT_NAMES */ - -+#ifdef __KERNEL__ - /* - * Below are truly Linux-specific types that should never collide with - * any application/library that wants linux/types.h. -@@ -152,5 +153,6 @@ - char f_fname[6]; - char f_fpack[6]; - }; -+#endif - - #endif /* _LINUX_TYPES_H */ - - diff --git a/patches/linux/2.6.8/linux-2.6.8-allow-gcc-4.0-asm-i386.patch b/patches/linux/2.6.8/linux-2.6.8-allow-gcc-4.0-asm-i386.patch deleted file mode 100644 index 71d4e23..0000000 --- a/patches/linux/2.6.8/linux-2.6.8-allow-gcc-4.0-asm-i386.patch +++ /dev/null @@ -1,138 +0,0 @@ -Fixes - -In file included from include/asm/thread_info.h:16, - from include/linux/thread_info.h:21, - from include/linux/spinlock.h:12, - from include/linux/capability.h:45, - from include/linux/sched.h:7, - from arch/i386/kernel/asm-offsets.c:7: -include/asm/processor.h:87: error: array type has incomplete element type -make[1]: *** [arch/i386/kernel/asm-offsets.asm] Error 1 - ---- linux-2.6.8/include/asm-i386/processor.h.old Tue Mar 15 00:14:42 2005 -+++ linux-2.6.8/include/asm-i386/processor.h Tue Mar 15 00:18:45 2005 -@@ -79,6 +79,58 @@ - #define X86_VENDOR_UNKNOWN 0xff - - /* -+ * Size of io_bitmap. -+ */ -+#define IO_BITMAP_BITS 65536 -+#define IO_BITMAP_BYTES (IO_BITMAP_BITS/8) -+#define IO_BITMAP_LONGS (IO_BITMAP_BYTES/sizeof(long)) -+#define IO_BITMAP_OFFSET offsetof(struct tss_struct,io_bitmap) -+#define INVALID_IO_BITMAP_OFFSET 0x8000 -+ -+struct tss_struct { -+ unsigned short back_link,__blh; -+ unsigned long esp0; -+ unsigned short ss0,__ss0h; -+ unsigned long esp1; -+ unsigned short ss1,__ss1h; /* ss1 is used to cache MSR_IA32_SYSENTER_CS */ -+ unsigned long esp2; -+ unsigned short ss2,__ss2h; -+ unsigned long __cr3; -+ unsigned long eip; -+ unsigned long eflags; -+ unsigned long eax,ecx,edx,ebx; -+ unsigned long esp; -+ unsigned long ebp; -+ unsigned long esi; -+ unsigned long edi; -+ unsigned short es, __esh; -+ unsigned short cs, __csh; -+ unsigned short ss, __ssh; -+ unsigned short ds, __dsh; -+ unsigned short fs, __fsh; -+ unsigned short gs, __gsh; -+ unsigned short ldt, __ldth; -+ unsigned short trace, io_bitmap_base; -+ /* -+ * The extra 1 is there because the CPU will access an -+ * additional byte beyond the end of the IO permission -+ * bitmap. The extra byte must be all 1 bits, and must -+ * be within the limit. -+ */ -+ unsigned long io_bitmap[IO_BITMAP_LONGS + 1]; -+ /* -+ * pads the TSS to be cacheline-aligned (size is 0x100) -+ */ -+ unsigned long __cacheline_filler[37]; -+ /* -+ * .. and then another 0x100 bytes for emergency kernel stack -+ */ -+ unsigned long stack[64]; -+} __attribute__((packed)); -+ -+#define ARCH_MIN_TASKALIGN 16 -+ -+/* - * capabilities of CPUs - */ - -@@ -296,15 +348,6 @@ - */ - #define TASK_UNMAPPED_BASE (PAGE_ALIGN(TASK_SIZE / 3)) - --/* -- * Size of io_bitmap. -- */ --#define IO_BITMAP_BITS 65536 --#define IO_BITMAP_BYTES (IO_BITMAP_BITS/8) --#define IO_BITMAP_LONGS (IO_BITMAP_BYTES/sizeof(long)) --#define IO_BITMAP_OFFSET offsetof(struct tss_struct,io_bitmap) --#define INVALID_IO_BITMAP_OFFSET 0x8000 -- - struct i387_fsave_struct { - long cwd; - long swd; -@@ -356,49 +399,6 @@ - typedef struct { - unsigned long seg; - } mm_segment_t; -- --struct tss_struct { -- unsigned short back_link,__blh; -- unsigned long esp0; -- unsigned short ss0,__ss0h; -- unsigned long esp1; -- unsigned short ss1,__ss1h; /* ss1 is used to cache MSR_IA32_SYSENTER_CS */ -- unsigned long esp2; -- unsigned short ss2,__ss2h; -- unsigned long __cr3; -- unsigned long eip; -- unsigned long eflags; -- unsigned long eax,ecx,edx,ebx; -- unsigned long esp; -- unsigned long ebp; -- unsigned long esi; -- unsigned long edi; -- unsigned short es, __esh; -- unsigned short cs, __csh; -- unsigned short ss, __ssh; -- unsigned short ds, __dsh; -- unsigned short fs, __fsh; -- unsigned short gs, __gsh; -- unsigned short ldt, __ldth; -- unsigned short trace, io_bitmap_base; -- /* -- * The extra 1 is there because the CPU will access an -- * additional byte beyond the end of the IO permission -- * bitmap. The extra byte must be all 1 bits, and must -- * be within the limit. -- */ -- unsigned long io_bitmap[IO_BITMAP_LONGS + 1]; -- /* -- * pads the TSS to be cacheline-aligned (size is 0x100) -- */ -- unsigned long __cacheline_filler[37]; -- /* -- * .. and then another 0x100 bytes for emergency kernel stack -- */ -- unsigned long stack[64]; --} __attribute__((packed)); -- --#define ARCH_MIN_TASKALIGN 16 - - struct thread_struct { - /* cached TLS descriptors. */ diff --git a/patches/linux/2.6.8/linux-2.6.8-arm-nonofpu.patch b/patches/linux/2.6.8/linux-2.6.8-arm-nonofpu.patch deleted file mode 100644 index f638a00..0000000 --- a/patches/linux/2.6.8/linux-2.6.8-arm-nonofpu.patch +++ /dev/null @@ -1,50 +0,0 @@ -http://www.spinics.net/lists/arm/msg08012.html - -To: Dimitry Andric -Subject: Re: Kernel Compile Error: use of old and new-style options to set FPU type -From: Marc Britten -Date: Wed, 16 Jun 2004 03:03:15 -0400 -Cc: linux-arm@xxxxxxxxxxxxxxxxxxxxxx -In-reply-to: <1525495613.20040615202902@andric.com> - -Dimitry Andric wrote: - ->>Assembler messages: ->>Error: use of old and new-style options to set FPU type -> Try removing -Wa,-mno-fpu from CFLAGS (and possibly AFLAGS, but I'm -> not sure, depends on what your compiler generates by default) in -> arch/arm/Makefile. - -Just to let people know, this was successful. - -Thanks, - -Marc Britten - --------- - -Fixes error - -... -make -f scripts/Makefile.build obj=scripts/mod - /opt/crosstool/arm-unknown-linux-gnu/gcc-3.4.1-glibc-2.3.3/bin/arm-unknown-linux-gnu-gcc -Wp,-MD,scripts/mod/.empty.o.d -nostdinc -iwithprefix include -D__KERNEL__ -Iinclude -Wall -Wstrict-prototypes -Wno-trigraphs -fno-strict-aliasing -fno-common -fno-omit-frame-pointer -mapcs -mno-sched-prolog -mlittle-endian -mapcs-32 -malignment-traps -msoft-float -Wa,-mno-fpu -Uarm -Os -Wdeclaration-after-statement -DKBUILD_BASENAME=empty -DKBUILD_MODNAME=empty -c -o scripts/mod/empty.o scripts/mod/empty.c -Assembler messages: -Error: use of old and new-style options to set FPU type -make[2]: *** [scripts/mod/empty.o] Error 1 -make[1]: *** [scripts/mod] Error 2 -make: *** [scripts] Error 2 - - ---- linux-2.6.8/arch/arm/Makefile.old 2004-09-01 21:27:07.000000000 -0700 -+++ linux-2.6.8/arch/arm/Makefile 2004-09-01 21:27:31.000000000 -0700 -@@ -55,8 +55,8 @@ - tune-$(CONFIG_CPU_V6) :=-mtune=strongarm - - # Need -Uarm for gcc < 3.x --CFLAGS +=-mapcs-32 $(arch-y) $(tune-y) $(call check_gcc,-malignment-traps,-mshort-load-bytes) -msoft-float -Wa,-mno-fpu -Uarm --AFLAGS +=-mapcs-32 $(arch-y) $(tune-y) -msoft-float -Wa,-mno-fpu -+CFLAGS +=-mapcs-32 $(arch-y) $(tune-y) $(call check_gcc,-malignment-traps,-mshort-load-bytes) -msoft-float -Uarm -+AFLAGS +=-mapcs-32 $(arch-y) $(tune-y) -msoft-float - - CHECK := $(CHECK) -D__arm__=1 - diff --git a/patches/linux/2.6.8/linux-2.6.8-build_on_case_insensitive_fs.patch b/patches/linux/2.6.8/linux-2.6.8-build_on_case_insensitive_fs.patch deleted file mode 100644 index 6472c17..0000000 --- a/patches/linux/2.6.8/linux-2.6.8-build_on_case_insensitive_fs.patch +++ /dev/null @@ -1,725 +0,0 @@ -Submitted By: Martin Schaffner -Date: 2004-06-19 -Initial Package Version: 2.6.7 -Upstream Status: Not submitted -Origin: Martin Schaffner -Description: Enables build on case-insensitive file systems -URL: xxxhttp://mirror.vtx.ch/lfs/patches/downloads/linux/linux-2.6.7-build_on_case_insensitive_fs-1.patch ---- Rediffed against 2.6.8 by dank@kegel.com ---- plus a few missing hunks added to fix sparc32 build - ---- linux-2.6.8/Makefile.orig 2004-08-13 22:37:25.000000000 -0700 -+++ linux-2.6.8/Makefile 2004-09-01 21:39:39.000000000 -0700 -@@ -540,7 +540,7 @@ - - do_system_map = $(NM) $(1) | grep -v '\(compiled\)\|\(\.o$$\)\|\( [aUw] \)\|\(\.\.ng$$\)\|\(LASH[RL]DI\)' | sort > $(2) - --LDFLAGS_vmlinux += -T arch/$(ARCH)/kernel/vmlinux.lds.s -+LDFLAGS_vmlinux += -T arch/$(ARCH)/kernel/vmlinux.lds.asm - - # Generate section listing all symbols and add it into vmlinux - # It's a three stage process: -@@ -584,13 +584,13 @@ - .tmp_kallsyms%.S: .tmp_vmlinux% - $(call cmd,kallsyms) - --.tmp_vmlinux1: $(vmlinux-objs) arch/$(ARCH)/kernel/vmlinux.lds.s FORCE -+.tmp_vmlinux1: $(vmlinux-objs) arch/$(ARCH)/kernel/vmlinux.lds.asm FORCE - $(call if_changed_rule,vmlinux__) - --.tmp_vmlinux2: $(vmlinux-objs) .tmp_kallsyms1.o arch/$(ARCH)/kernel/vmlinux.lds.s FORCE -+.tmp_vmlinux2: $(vmlinux-objs) .tmp_kallsyms1.o arch/$(ARCH)/kernel/vmlinux.lds.asm FORCE - $(call if_changed_rule,vmlinux__) - --.tmp_vmlinux3: $(vmlinux-objs) .tmp_kallsyms2.o arch/$(ARCH)/kernel/vmlinux.lds.s FORCE -+.tmp_vmlinux3: $(vmlinux-objs) .tmp_kallsyms2.o arch/$(ARCH)/kernel/vmlinux.lds.asm FORCE - $(call if_changed_rule,vmlinux__) - - endif -@@ -603,13 +603,13 @@ - $(rule_verify_kallsyms) - endef - --vmlinux: $(vmlinux-objs) $(kallsyms.o) arch/$(ARCH)/kernel/vmlinux.lds.s FORCE -+vmlinux: $(vmlinux-objs) $(kallsyms.o) arch/$(ARCH)/kernel/vmlinux.lds.asm FORCE - $(call if_changed_rule,vmlinux) - - # The actual objects are generated when descending, - # make sure no implicit rule kicks in - --$(sort $(vmlinux-objs)) arch/$(ARCH)/kernel/vmlinux.lds.s: $(vmlinux-dirs) ; -+$(sort $(vmlinux-objs)) arch/$(ARCH)/kernel/vmlinux.lds.asm: $(vmlinux-dirs) ; - - # Handle descending into subdirectories listed in $(vmlinux-dirs) - # Preset locale variables to speed up the build process. Limit locale -@@ -672,7 +672,7 @@ - # Single targets - # --------------------------------------------------------------------------- - --%.s: %.c scripts FORCE -+%.asm: %.c scripts FORCE - $(Q)$(MAKE) $(build)=$(@D) $@ - %.i: %.c scripts FORCE - $(Q)$(MAKE) $(build)=$(@D) $@ -@@ -682,7 +682,7 @@ - $(Q)$(MAKE) KBUILD_MODULES=$(if $(CONFIG_MODULES),1) $(build)=$(@D) - %.lst: %.c scripts FORCE - $(Q)$(MAKE) $(build)=$(@D) $@ --%.s: %.S scripts FORCE -+%.asm: %.S scripts FORCE - $(Q)$(MAKE) $(build)=$(@D) $@ - %.o: %.S scripts FORCE - $(Q)$(MAKE) $(build)=$(@D) $@ -diff -ur linux-2.6.7/arch/alpha/Makefile linux-2.6.7-mod/arch/alpha/Makefile ---- linux-2.6.7/arch/alpha/Makefile Fri Jun 18 22:51:03 2004 -+++ linux-2.6.7-mod/arch/alpha/Makefile Sat Jun 19 12:46:32 2004 -@@ -114,10 +114,10 @@ - - prepare: include/asm-$(ARCH)/asm_offsets.h - --arch/$(ARCH)/kernel/asm-offsets.s: include/asm include/linux/version.h \ -+arch/$(ARCH)/kernel/asm-offsets.asm: include/asm include/linux/version.h \ - include/config/MARKER - --include/asm-$(ARCH)/asm_offsets.h: arch/$(ARCH)/kernel/asm-offsets.s -+include/asm-$(ARCH)/asm_offsets.h: arch/$(ARCH)/kernel/asm-offsets.asm - $(call filechk,gen-asm-offsets) - - archclean: -diff -ur linux-2.6.7/arch/alpha/kernel/Makefile linux-2.6.7-mod/arch/alpha/kernel/Makefile ---- linux-2.6.7/arch/alpha/kernel/Makefile Mon May 10 04:32:29 2004 -+++ linux-2.6.7-mod/arch/alpha/kernel/Makefile Sat Jun 19 12:46:48 2004 -@@ -2,7 +2,7 @@ - # Makefile for the linux kernel. - # - --extra-y := head.o vmlinux.lds.s -+extra-y := head.o vmlinux.lds.asm - EXTRA_AFLAGS := $(CFLAGS) - EXTRA_CFLAGS := -Werror -Wno-sign-compare - ---- linux-2.6.8/arch/arm/Makefile.orig 2004-08-13 22:36:56.000000000 -0700 -+++ linux-2.6.8/arch/arm/Makefile 2004-09-01 21:40:21.000000000 -0700 -@@ -176,10 +176,10 @@ - bp:; $(Q)$(MAKE) $(build)=$(boot) $(boot)/bootpImage - i zi:; $(Q)$(MAKE) $(build)=$(boot) $@ - --arch/$(ARCH)/kernel/asm-offsets.s: include/asm include/linux/version.h \ -+arch/$(ARCH)/kernel/asm-offsets.asm: include/asm include/linux/version.h \ - include/asm-arm/.arch - --include/asm-$(ARCH)/constants.h: arch/$(ARCH)/kernel/asm-offsets.s -+include/asm-$(ARCH)/constants.h: arch/$(ARCH)/kernel/asm-offsets.asm - $(call filechk,gen-asm-offsets) - - define archhelp -diff -ur linux-2.6.7/arch/arm/kernel/Makefile linux-2.6.7-mod/arch/arm/kernel/Makefile ---- linux-2.6.7/arch/arm/kernel/Makefile Mon May 10 04:33:19 2004 -+++ linux-2.6.7-mod/arch/arm/kernel/Makefile Sat Jun 19 12:47:25 2004 -@@ -27,7 +27,7 @@ - head-y := head.o - obj-$(CONFIG_DEBUG_LL) += debug.o - --extra-y := $(head-y) init_task.o vmlinux.lds.s -+extra-y := $(head-y) init_task.o vmlinux.lds.asm - - # Spell out some dependencies that aren't automatically figured out - $(obj)/entry-armv.o: $(obj)/entry-header.S include/asm-arm/constants.h -diff -ur linux-2.6.7/arch/arm26/Makefile linux-2.6.7-mod/arch/arm26/Makefile ---- linux-2.6.7/arch/arm26/Makefile Mon May 10 04:32:28 2004 -+++ linux-2.6.7-mod/arch/arm26/Makefile Sat Jun 19 12:48:24 2004 -@@ -101,10 +101,10 @@ - fi; \ - ) - --arch/$(ARCH)/kernel/asm-offsets.s: include/asm include/linux/version.h \ -+arch/$(ARCH)/kernel/asm-offsets.asm: include/asm include/linux/version.h \ - include/config/MARKER - --include/asm-$(ARCH)/asm_offsets.h: arch/$(ARCH)/kernel/asm-offsets.s -+include/asm-$(ARCH)/asm_offsets.h: arch/$(ARCH)/kernel/asm-offsets.asm - $(call filechk,gen-asm-offsets) - - define archhelp -diff -ur linux-2.6.7/arch/arm26/kernel/Makefile linux-2.6.7-mod/arch/arm26/kernel/Makefile ---- linux-2.6.7/arch/arm26/kernel/Makefile Mon May 10 04:32:29 2004 -+++ linux-2.6.7-mod/arch/arm26/kernel/Makefile Sat Jun 19 12:48:30 2004 -@@ -14,5 +14,5 @@ - obj-$(CONFIG_FIQ) += fiq.o - obj-$(CONFIG_MODULES) += armksyms.o - --extra-y := init_task.o vmlinux.lds.s -+extra-y := init_task.o vmlinux.lds.asm - -diff -ur linux-2.6.7/arch/cris/Makefile linux-2.6.7-mod/arch/cris/Makefile ---- linux-2.6.7/arch/cris/Makefile Fri Jun 18 22:51:07 2004 -+++ linux-2.6.7-mod/arch/cris/Makefile Sat Jun 19 12:48:47 2004 -@@ -107,8 +107,8 @@ - @ln -sf $(SARCH) include/asm-$(ARCH)/arch - @touch $@ - --arch/$(ARCH)/$(SARCH)/kernel/asm-offsets.s: include/asm include/linux/version.h \ -+arch/$(ARCH)/$(SARCH)/kernel/asm-offsets.asm: include/asm include/linux/version.h \ - include/config/MARKER - --include/asm-$(ARCH)/$(SARCH)/offset.h: arch/$(ARCH)/$(SARCH)/kernel/asm-offsets.s -+include/asm-$(ARCH)/$(SARCH)/offset.h: arch/$(ARCH)/$(SARCH)/kernel/asm-offsets.asm - $(call filechk,gen-asm-offsets) -diff -ur linux-2.6.7/arch/cris/kernel/Makefile linux-2.6.7-mod/arch/cris/kernel/Makefile ---- linux-2.6.7/arch/cris/kernel/Makefile Fri Jun 18 22:51:09 2004 -+++ linux-2.6.7-mod/arch/cris/kernel/Makefile Sat Jun 19 12:48:53 2004 -@@ -3,7 +3,7 @@ - # Makefile for the linux kernel. - # - --extra-y := vmlinux.lds.s -+extra-y := vmlinux.lds.asm - - obj-y := process.o traps.o irq.o ptrace.o setup.o \ - time.o sys_cris.o semaphore.o -diff -ur linux-2.6.7/arch/h8300/Makefile linux-2.6.7-mod/arch/h8300/Makefile ---- linux-2.6.7/arch/h8300/Makefile Fri Jun 18 22:51:09 2004 -+++ linux-2.6.7-mod/arch/h8300/Makefile Sat Jun 19 12:49:12 2004 -@@ -64,7 +64,7 @@ - - prepare: include/asm-$(ARCH)/asm-offsets.h - --include/asm-$(ARCH)/asm-offsets.h: arch/$(ARCH)/kernel/asm-offsets.s \ -+include/asm-$(ARCH)/asm-offsets.h: arch/$(ARCH)/kernel/asm-offsets.asm \ - include/asm include/linux/version.h - $(call filechk,gen-asm-offsets) - -diff -ur linux-2.6.7/arch/h8300/kernel/Makefile linux-2.6.7-mod/arch/h8300/kernel/Makefile ---- linux-2.6.7/arch/h8300/kernel/Makefile Fri Jun 18 22:51:09 2004 -+++ linux-2.6.7-mod/arch/h8300/kernel/Makefile Sat Jun 19 12:49:32 2004 -@@ -2,7 +2,7 @@ - # Makefile for the linux kernel. - # - --extra-y := vmlinux.lds.s -+extra-y := vmlinux.lds.asm - - obj-y := process.o traps.o ptrace.o ints.o \ - sys_h8300.o time.o semaphore.o signal.o \ -diff -ur linux-2.6.7/arch/i386/Makefile linux-2.6.7-mod/arch/i386/Makefile ---- linux-2.6.7/arch/i386/Makefile Fri Jun 18 22:51:10 2004 -+++ linux-2.6.7-mod/arch/i386/Makefile Sat Jun 19 12:49:43 2004 -@@ -141,10 +141,10 @@ - prepare: include/asm-$(ARCH)/asm_offsets.h - CLEAN_FILES += include/asm-$(ARCH)/asm_offsets.h - --arch/$(ARCH)/kernel/asm-offsets.s: include/asm include/linux/version.h \ -+arch/$(ARCH)/kernel/asm-offsets.asm: include/asm include/linux/version.h \ - include/config/MARKER - --include/asm-$(ARCH)/asm_offsets.h: arch/$(ARCH)/kernel/asm-offsets.s -+include/asm-$(ARCH)/asm_offsets.h: arch/$(ARCH)/kernel/asm-offsets.asm - $(call filechk,gen-asm-offsets) - - archclean: -diff -ur linux-2.6.7/arch/i386/kernel/Makefile linux-2.6.7-mod/arch/i386/kernel/Makefile ---- linux-2.6.7/arch/i386/kernel/Makefile Mon May 10 04:32:02 2004 -+++ linux-2.6.7-mod/arch/i386/kernel/Makefile Sat Jun 19 12:49:54 2004 -@@ -2,7 +2,7 @@ - # Makefile for the linux kernel. - # - --extra-y := head.o init_task.o vmlinux.lds.s -+extra-y := head.o init_task.o vmlinux.lds.asm - - obj-y := process.o semaphore.o signal.o entry.o traps.o irq.o vm86.o \ - ptrace.o i8259.o ioport.o ldt.o setup.o time.o sys_i386.o \ -diff -ur linux-2.6.7/arch/ia64/Makefile linux-2.6.7-mod/arch/ia64/Makefile ---- linux-2.6.7/arch/ia64/Makefile Mon May 10 04:31:59 2004 -+++ linux-2.6.7-mod/arch/ia64/Makefile Sat Jun 19 12:50:12 2004 -@@ -88,12 +88,12 @@ - - prepare: include/asm-ia64/offsets.h - --arch/ia64/kernel/asm-offsets.s: include/asm include/linux/version.h include/config/MARKER -+arch/ia64/kernel/asm-offsets.asm: include/asm include/linux/version.h include/config/MARKER - --include/asm-ia64/offsets.h: arch/ia64/kernel/asm-offsets.s -+include/asm-ia64/offsets.h: arch/ia64/kernel/asm-offsets.asm - $(call filechk,gen-asm-offsets) - --arch/ia64/kernel/asm-offsets.s: include/asm-ia64/.offsets.h.stamp -+arch/ia64/kernel/asm-offsets.asm: include/asm-ia64/.offsets.h.stamp - - include/asm-ia64/.offsets.h.stamp: - mkdir -p include/asm-ia64 -diff -ur linux-2.6.7/arch/ia64/kernel/Makefile linux-2.6.7-mod/arch/ia64/kernel/Makefile ---- linux-2.6.7/arch/ia64/kernel/Makefile Fri Jun 18 22:51:13 2004 -+++ linux-2.6.7-mod/arch/ia64/kernel/Makefile Sat Jun 19 12:52:14 2004 -@@ -2,7 +2,7 @@ - # Makefile for the linux kernel. - # - --extra-y := head.o init_task.o vmlinux.lds.s -+extra-y := head.o init_task.o vmlinux.lds.asm - - obj-y := acpi.o entry.o efi.o efi_stub.o gate-data.o fsys.o ia64_ksyms.o irq.o irq_ia64.o \ - irq_lsapic.o ivt.o machvec.o pal.o patch.o process.o perfmon.o ptrace.o sal.o \ -@@ -21,7 +21,7 @@ - # The gate DSO image is built using a special linker script. - targets += gate.so gate-syms.o - --extra-y += gate.so gate-syms.o gate.lds.s gate.o -+extra-y += gate.so gate-syms.o gate.lds.asm gate.o - - # fp_emulate() expects f2-f5,f16-f31 to contain the user-level state. - CFLAGS_traps.o += -mfixed-range=f2-f5,f16-f31 -@@ -32,14 +32,14 @@ - cmd_gate = $(CC) -nostdlib $(GATECFLAGS_$(@F)) -Wl,-T,$(filter-out FORCE,$^) -o $@ - - GATECFLAGS_gate.so = -shared -s -Wl,-soname=linux-gate.so.1 --$(obj)/gate.so: $(obj)/gate.lds.s $(obj)/gate.o FORCE -+$(obj)/gate.so: $(obj)/gate.lds.asm $(obj)/gate.o FORCE - $(call if_changed,gate) - - $(obj)/built-in.o: $(obj)/gate-syms.o - $(obj)/built-in.o: ld_flags += -R $(obj)/gate-syms.o - - GATECFLAGS_gate-syms.o = -r --$(obj)/gate-syms.o: $(src)/gate.lds.s $(obj)/gate.o FORCE -+$(obj)/gate-syms.o: $(src)/gate.lds.asm $(obj)/gate.o FORCE - $(call if_changed,gate) - - # gate-data.o contains the gate DSO image as data in section .data.gate. -diff -ur linux-2.6.7/arch/m68k/Makefile linux-2.6.7-mod/arch/m68k/Makefile ---- linux-2.6.7/arch/m68k/Makefile Fri Jun 18 22:51:14 2004 -+++ linux-2.6.7-mod/arch/m68k/Makefile Sat Jun 19 12:52:30 2004 -@@ -114,10 +114,10 @@ - prepare: include/asm-$(ARCH)/offsets.h - CLEAN_FILES += include/asm-$(ARCH)/offsets.h - --arch/$(ARCH)/kernel/asm-offsets.s: include/asm include/linux/version.h \ -+arch/$(ARCH)/kernel/asm-offsets.asm: include/asm include/linux/version.h \ - include/config/MARKER - --include/asm-$(ARCH)/offsets.h: arch/$(ARCH)/kernel/asm-offsets.s -+include/asm-$(ARCH)/offsets.h: arch/$(ARCH)/kernel/asm-offsets.asm - $(call filechk,gen-asm-offsets) - - archclean: -diff -ur linux-2.6.7/arch/m68k/kernel/Makefile linux-2.6.7-mod/arch/m68k/kernel/Makefile ---- linux-2.6.7/arch/m68k/kernel/Makefile Mon May 10 04:33:10 2004 -+++ linux-2.6.7-mod/arch/m68k/kernel/Makefile Sat Jun 19 12:52:35 2004 -@@ -7,7 +7,7 @@ - else - extra-y := sun3-head.o - endif --extra-y += vmlinux.lds.s -+extra-y += vmlinux.lds.asm - - obj-y := entry.o process.o traps.o ints.o signal.o ptrace.o \ - sys_m68k.o time.o semaphore.o setup.o m68k_ksyms.o -diff -ur linux-2.6.7/arch/m68knommu/Makefile linux-2.6.7-mod/arch/m68knommu/Makefile ---- linux-2.6.7/arch/m68knommu/Makefile Mon May 10 04:32:54 2004 -+++ linux-2.6.7-mod/arch/m68knommu/Makefile Sat Jun 19 12:52:57 2004 -@@ -89,7 +89,7 @@ - head-y := arch/m68knommu/platform/$(platform-y)/$(board-y)/crt0_$(model-y).o - - CLEAN_FILES := include/asm-$(ARCH)/asm-offsets.h \ -- arch/$(ARCH)/kernel/asm-offsets.s -+ arch/$(ARCH)/kernel/asm-offsets.asm - - core-y += arch/m68knommu/kernel/ \ - arch/m68knommu/mm/ \ -@@ -102,7 +102,7 @@ - archclean: - $(call descend arch/$(ARCH)/boot, subdirclean) - --include/asm-$(ARCH)/asm-offsets.h: arch/$(ARCH)/kernel/asm-offsets.s \ -+include/asm-$(ARCH)/asm-offsets.h: arch/$(ARCH)/kernel/asm-offsets.asm \ - include/asm include/linux/version.h \ - include/config/MARKER - $(call filechk,gen-asm-offsets) -diff -ur linux-2.6.7/arch/m68knommu/kernel/Makefile linux-2.6.7-mod/arch/m68knommu/kernel/Makefile ---- linux-2.6.7/arch/m68knommu/kernel/Makefile Mon May 10 04:32:26 2004 -+++ linux-2.6.7-mod/arch/m68knommu/kernel/Makefile Sat Jun 19 12:53:20 2004 -@@ -2,7 +2,7 @@ - # Makefile for arch/m68knommu/kernel. - # - --extra-y := vmlinux.lds.s -+extra-y := vmlinux.lds.asm - - obj-y += dma.o entry.o init_task.o m68k_ksyms.o process.o ptrace.o semaphore.o \ - setup.o signal.o syscalltable.o sys_m68k.o time.o traps.o -diff -ur linux-2.6.7/arch/mips/Makefile linux-2.6.7-mod/arch/mips/Makefile ---- linux-2.6.7/arch/mips/Makefile Fri Jun 18 22:51:19 2004 -+++ linux-2.6.7-mod/arch/mips/Makefile Sat Jun 19 12:53:35 2004 -@@ -752,12 +752,12 @@ - prepare: include/asm-$(ARCH)/offset.h \ - include/asm-$(ARCH)/reg.h - --arch/$(ARCH)/kernel/offset.s: include/asm include/linux/version.h \ -+arch/$(ARCH)/kernel/offset.asm: include/asm include/linux/version.h \ - include/config/MARKER - --include/asm-$(ARCH)/offset.h: arch/$(ARCH)/kernel/offset.s -+include/asm-$(ARCH)/offset.h: arch/$(ARCH)/kernel/offset.asm - $(call filechk,gen-asm-offset.h) --include/asm-$(ARCH)/reg.h: arch/$(ARCH)/kernel/reg.s -+include/asm-$(ARCH)/reg.h: arch/$(ARCH)/kernel/reg.asm - $(call filechk,gen-asm-reg.h) - - CLEAN_FILES += include/asm-$(ARCH)/offset.h.tmp \ -diff -ur linux-2.6.7/arch/mips/kernel/Makefile linux-2.6.7-mod/arch/mips/kernel/Makefile ---- linux-2.6.7/arch/mips/kernel/Makefile Mon May 10 04:32:28 2004 -+++ linux-2.6.7-mod/arch/mips/kernel/Makefile Sat Jun 19 12:53:41 2004 -@@ -2,7 +2,7 @@ - # Makefile for the Linux/MIPS kernel. - # - --extra-y := head.o init_task.o vmlinux.lds.s -+extra-y := head.o init_task.o vmlinux.lds.asm - - obj-y += cpu-probe.o branch.o entry.o genex.o irq.o process.o \ - ptrace.o reset.o semaphore.o setup.o signal.o syscall.o \ -diff -ur linux-2.6.7/arch/parisc/Makefile linux-2.6.7-mod/arch/parisc/Makefile ---- linux-2.6.7/arch/parisc/Makefile Fri Jun 18 22:51:21 2004 -+++ linux-2.6.7-mod/arch/parisc/Makefile Sat Jun 19 12:53:47 2004 -@@ -88,10 +88,10 @@ - - prepare: include/asm-parisc/offsets.h - --arch/parisc/kernel/asm-offsets.s: include/asm include/linux/version.h \ -+arch/parisc/kernel/asm-offsets.asm: include/asm include/linux/version.h \ - include/config/MARKER - --include/asm-parisc/offsets.h: arch/parisc/kernel/asm-offsets.s -+include/asm-parisc/offsets.h: arch/parisc/kernel/asm-offsets.asm - $(call filechk,gen-asm-offsets) - - CLEAN_FILES += lifimage include/asm-parisc/offsets.h -diff -ur linux-2.6.7/arch/parisc/kernel/Makefile linux-2.6.7-mod/arch/parisc/kernel/Makefile ---- linux-2.6.7/arch/parisc/kernel/Makefile Fri Jun 18 22:51:21 2004 -+++ linux-2.6.7-mod/arch/parisc/kernel/Makefile Sat Jun 19 12:53:53 2004 -@@ -4,7 +4,7 @@ - - head-y := head.o - head-$(CONFIG_PARISC64) := head64.o --extra-y := init_task.o $(head-y) vmlinux.lds.s -+extra-y := init_task.o $(head-y) vmlinux.lds.asm - - AFLAGS_entry.o := -traditional - AFLAGS_pacache.o := -traditional -diff -ur linux-2.6.7/arch/ppc/Makefile linux-2.6.7-mod/arch/ppc/Makefile ---- linux-2.6.7/arch/ppc/Makefile Fri Jun 18 22:51:22 2004 -+++ linux-2.6.7-mod/arch/ppc/Makefile Sat Jun 19 12:54:09 2004 -@@ -78,10 +78,10 @@ - - prepare: include/asm-$(ARCH)/offsets.h checkbin - --arch/$(ARCH)/kernel/asm-offsets.s: include/asm include/linux/version.h \ -+arch/$(ARCH)/kernel/asm-offsets.asm: include/asm include/linux/version.h \ - include/config/MARKER - --include/asm-$(ARCH)/offsets.h: arch/$(ARCH)/kernel/asm-offsets.s -+include/asm-$(ARCH)/offsets.h: arch/$(ARCH)/kernel/asm-offsets.asm - $(call filechk,gen-asm-offsets) - - ifdef CONFIG_6xx -@@ -104,4 +104,4 @@ - endif - - CLEAN_FILES += include/asm-$(ARCH)/offsets.h \ -- arch/$(ARCH)/kernel/asm-offsets.s -+ arch/$(ARCH)/kernel/asm-offsets.asm -diff -ur linux-2.6.7/arch/ppc/kernel/Makefile linux-2.6.7-mod/arch/ppc/kernel/Makefile ---- linux-2.6.7/arch/ppc/kernel/Makefile Fri Jun 18 22:51:24 2004 -+++ linux-2.6.7-mod/arch/ppc/kernel/Makefile Sat Jun 19 12:43:10 2004 -@@ -15,7 +15,7 @@ - extra-$(CONFIG_8xx) := head_8xx.o - extra-$(CONFIG_6xx) += idle_6xx.o - extra-$(CONFIG_POWER4) += idle_power4.o --extra-y += vmlinux.lds.s -+extra-y += vmlinux.lds.asm - - obj-y := entry.o traps.o irq.o idle.o time.o misc.o \ - process.o signal.o ptrace.o align.o \ -diff -ur linux-2.6.7/arch/ppc64/Makefile linux-2.6.7-mod/arch/ppc64/Makefile ---- linux-2.6.7/arch/ppc64/Makefile Fri Jun 18 22:51:26 2004 -+++ linux-2.6.7-mod/arch/ppc64/Makefile Sat Jun 19 12:54:32 2004 -@@ -67,10 +67,10 @@ - - prepare: include/asm-ppc64/offsets.h - --arch/ppc64/kernel/asm-offsets.s: include/asm include/linux/version.h \ -+arch/ppc64/kernel/asm-offsets.asm: include/asm include/linux/version.h \ - include/config/MARKER - --include/asm-ppc64/offsets.h: arch/ppc64/kernel/asm-offsets.s -+include/asm-ppc64/offsets.h: arch/ppc64/kernel/asm-offsets.asm - $(call filechk,gen-asm-offsets) - - define archhelp -diff -ur linux-2.6.7/arch/ppc64/kernel/Makefile linux-2.6.7-mod/arch/ppc64/kernel/Makefile ---- linux-2.6.7/arch/ppc64/kernel/Makefile Mon May 10 04:33:20 2004 -+++ linux-2.6.7-mod/arch/ppc64/kernel/Makefile Sat Jun 19 12:54:39 2004 -@@ -3,7 +3,7 @@ - # - - EXTRA_CFLAGS += -mno-minimal-toc --extra-y := head.o vmlinux.lds.s -+extra-y := head.o vmlinux.lds.asm - - obj-y := setup.o entry.o traps.o irq.o idle.o dma.o \ - time.o process.o signal.o syscalls.o misc.o ptrace.o \ -diff -ur linux-2.6.7/arch/s390/Makefile linux-2.6.7-mod/arch/s390/Makefile ---- linux-2.6.7/arch/s390/Makefile Mon May 10 04:32:02 2004 -+++ linux-2.6.7-mod/arch/s390/Makefile Sat Jun 19 12:54:46 2004 -@@ -68,10 +68,10 @@ - - prepare: include/asm-$(ARCH)/offsets.h - --arch/$(ARCH)/kernel/asm-offsets.s: include/asm include/linux/version.h \ -+arch/$(ARCH)/kernel/asm-offsets.asm: include/asm include/linux/version.h \ - include/config/MARKER - --include/asm-$(ARCH)/offsets.h: arch/$(ARCH)/kernel/asm-offsets.s -+include/asm-$(ARCH)/offsets.h: arch/$(ARCH)/kernel/asm-offsets.asm - $(call filechk,gen-asm-offsets) - - CLEAN_FILES += include/asm-$(ARCH)/offsets.h -diff -ur linux-2.6.7/arch/s390/kernel/Makefile linux-2.6.7-mod/arch/s390/kernel/Makefile ---- linux-2.6.7/arch/s390/kernel/Makefile Mon May 10 04:33:20 2004 -+++ linux-2.6.7-mod/arch/s390/kernel/Makefile Sat Jun 19 12:54:52 2004 -@@ -10,7 +10,7 @@ - - extra-$(CONFIG_ARCH_S390_31) += head.o - extra-$(CONFIG_ARCH_S390X) += head64.o --extra-y += init_task.o vmlinux.lds.s -+extra-y += init_task.o vmlinux.lds.asm - - obj-$(CONFIG_MODULES) += s390_ksyms.o module.o - obj-$(CONFIG_SMP) += smp.o -diff -ur linux-2.6.7/arch/sh/kernel/Makefile linux-2.6.7-mod/arch/sh/kernel/Makefile ---- linux-2.6.7/arch/sh/kernel/Makefile Mon May 10 04:32:39 2004 -+++ linux-2.6.7-mod/arch/sh/kernel/Makefile Sat Jun 19 12:55:33 2004 -@@ -2,7 +2,7 @@ - # Makefile for the Linux/SuperH kernel. - # - --extra-y := head.o init_task.o vmlinux.lds.s -+extra-y := head.o init_task.o vmlinux.lds.asm - - obj-y := process.o signal.o entry.o traps.o irq.o \ - ptrace.o setup.o time.o sys_sh.o semaphore.o \ -diff -ur linux-2.6.7/arch/sparc/Makefile linux-2.6.7-mod/arch/sparc/Makefile ---- linux-2.6.7/arch/sparc/Makefile Fri Jun 18 22:51:29 2004 -+++ linux-2.6.7-mod/arch/sparc/Makefile Sat Jun 19 12:55:48 2004 -@@ -61,14 +61,14 @@ - - prepare: include/asm-$(ARCH)/asm_offsets.h - --arch/$(ARCH)/kernel/asm-offsets.s: include/asm include/linux/version.h \ -+arch/$(ARCH)/kernel/asm-offsets.asm: include/asm include/linux/version.h \ - include/config/MARKER - --include/asm-$(ARCH)/asm_offsets.h: arch/$(ARCH)/kernel/asm-offsets.s -+include/asm-$(ARCH)/asm_offsets.h: arch/$(ARCH)/kernel/asm-offsets.asm - $(call filechk,gen-asm-offsets) - - CLEAN_FILES += include/asm-$(ARCH)/asm_offsets.h \ -- arch/$(ARCH)/kernel/asm-offsets.s \ -+ arch/$(ARCH)/kernel/asm-offsets.asm \ - arch/$(ARCH)/boot/System.map - - # Don't use tabs in echo arguments. -diff -ur linux-2.6.7/arch/sparc/kernel/Makefile linux-2.6.7-mod/arch/sparc/kernel/Makefile ---- linux-2.6.7/arch/sparc/kernel/Makefile Mon May 10 04:33:13 2004 -+++ linux-2.6.7-mod/arch/sparc/kernel/Makefile Sat Jun 19 12:55:52 2004 -@@ -2,7 +2,7 @@ - # Makefile for the linux kernel. - # - --extra-y := head.o init_task.o vmlinux.lds.s -+extra-y := head.o init_task.o vmlinux.lds.asm - - EXTRA_AFLAGS := -ansi - -diff -ur linux-2.6.7/arch/sparc64/kernel/Makefile linux-2.6.7-mod/arch/sparc64/kernel/Makefile ---- linux-2.6.7/arch/sparc64/kernel/Makefile Mon May 10 04:32:02 2004 -+++ linux-2.6.7-mod/arch/sparc64/kernel/Makefile Sat Jun 19 12:56:24 2004 -@@ -5,7 +5,7 @@ - EXTRA_AFLAGS := -ansi - EXTRA_CFLAGS := -Werror - --extra-y := head.o init_task.o vmlinux.lds.s -+extra-y := head.o init_task.o vmlinux.lds.asm - - obj-y := process.o setup.o cpu.o idprom.o \ - traps.o devices.o auxio.o \ -diff -ur linux-2.6.7/arch/um/Makefile linux-2.6.7-mod/arch/um/Makefile ---- linux-2.6.7/arch/um/Makefile Mon May 10 04:32:52 2004 -+++ linux-2.6.7-mod/arch/um/Makefile Sat Jun 19 12:57:07 2004 -@@ -77,7 +77,7 @@ - # CONFIG_MODE_SKAS + CONFIG_STATIC_LINK case. - - LINK_TT = -static --LD_SCRIPT_TT := uml.lds.s -+LD_SCRIPT_TT := uml.lds.asm - - ifeq ($(CONFIG_STATIC_LINK),y) - LINK-y += $(LINK_TT) -@@ -103,11 +103,11 @@ - -DELF_FORMAT=\"$(ELF_FORMAT)\" $(CPP_MODE_TT) \ - -DKERNEL_STACK_SIZE=$(STACK_SIZE) - --AFLAGS_$(LD_SCRIPT-y:.s=).o = $(AFLAGS_vmlinux.lds.o) -P -C -Uum -+AFLAGS_$(LD_SCRIPT-y:.asm=).o = $(AFLAGS_vmlinux.lds.o) -P -C -Uum - - LD_SCRIPT-y := $(ARCH_DIR)/$(LD_SCRIPT-y) - --$(LD_SCRIPT-y) : $(LD_SCRIPT-y:.s=.S) scripts FORCE -+$(LD_SCRIPT-y) : $(LD_SCRIPT-y:.asm=.S) scripts FORCE - $(call if_changed_dep,as_s_S) - - linux: vmlinux $(LD_SCRIPT-y) -@@ -122,8 +122,8 @@ - # To get a definition of F_SETSIG - USER_CFLAGS += -D_GNU_SOURCE - --CLEAN_FILES += linux x.i gmon.out $(ARCH_DIR)/uml.lds.s \ -- $(ARCH_DIR)/dyn_link.ld.s $(GEN_HEADERS) -+CLEAN_FILES += linux x.i gmon.out $(ARCH_DIR)/uml.lds.asm \ -+ $(ARCH_DIR)/dyn_link.ld.asm $(GEN_HEADERS) - - $(ARCH_DIR)/main.o: $(ARCH_DIR)/main.c - $(CC) $(USER_CFLAGS) $(EXTRA_CFLAGS) -c -o $@ $< -diff -ur linux-2.6.7/arch/um/kernel/Makefile linux-2.6.7-mod/arch/um/kernel/Makefile ---- linux-2.6.7/arch/um/kernel/Makefile Mon May 10 04:32:53 2004 -+++ linux-2.6.7-mod/arch/um/kernel/Makefile Sat Jun 19 12:57:15 2004 -@@ -3,7 +3,7 @@ - # Licensed under the GPL - # - --extra-y := vmlinux.lds.s -+extra-y := vmlinux.lds.asm - - obj-y = checksum.o config.o exec_kern.o exitcode.o frame_kern.o frame.o \ - helper.o init_task.o irq.o irq_user.o ksyms.o mem.o mem_user.o \ -diff -ur linux-2.6.7/arch/v850/Makefile linux-2.6.7-mod/arch/v850/Makefile ---- linux-2.6.7/arch/v850/Makefile Mon May 10 04:33:21 2004 -+++ linux-2.6.7-mod/arch/v850/Makefile Sat Jun 19 12:57:59 2004 -@@ -52,12 +52,12 @@ - prepare: include/asm-$(ARCH)/asm-consts.h - - # Generate constants from C code for use by asm files --arch/$(ARCH)/kernel/asm-consts.s: include/asm include/linux/version.h \ -+arch/$(ARCH)/kernel/asm-consts.asm: include/asm include/linux/version.h \ - include/config/MARKER - --include/asm-$(ARCH)/asm-consts.h: arch/$(ARCH)/kernel/asm-consts.s -+include/asm-$(ARCH)/asm-consts.h: arch/$(ARCH)/kernel/asm-consts.asm - $(call filechk,gen-asm-offsets) - - CLEAN_FILES += include/asm-$(ARCH)/asm-consts.h \ -- arch/$(ARCH)/kernel/asm-consts.s \ -+ arch/$(ARCH)/kernel/asm-consts.asm \ - root_fs_image.o -diff -ur linux-2.6.7/arch/v850/kernel/Makefile linux-2.6.7-mod/arch/v850/kernel/Makefile ---- linux-2.6.7/arch/v850/kernel/Makefile Mon May 10 04:33:21 2004 -+++ linux-2.6.7-mod/arch/v850/kernel/Makefile Sat Jun 19 12:58:04 2004 -@@ -9,7 +9,7 @@ - # for more details. - # - --extra-y := head.o init_task.o vmlinux.lds.s -+extra-y := head.o init_task.o vmlinux.lds.asm - - obj-y += intv.o entry.o process.o syscalls.o time.o semaphore.o setup.o \ - signal.o irq.o mach.o ptrace.o bug.o -diff -ur linux-2.6.7/arch/x86_64/Makefile linux-2.6.7-mod/arch/x86_64/Makefile ---- linux-2.6.7/arch/x86_64/Makefile Mon May 10 04:33:19 2004 -+++ linux-2.6.7-mod/arch/x86_64/Makefile Sat Jun 19 12:58:10 2004 -@@ -93,10 +93,10 @@ - - prepare: include/asm-$(ARCH)/offset.h - --arch/$(ARCH)/kernel/asm-offsets.s: include/asm include/linux/version.h \ -+arch/$(ARCH)/kernel/asm-offsets.asm: include/asm include/linux/version.h \ - include/config/MARKER - --include/asm-$(ARCH)/offset.h: arch/$(ARCH)/kernel/asm-offsets.s -+include/asm-$(ARCH)/offset.h: arch/$(ARCH)/kernel/asm-offsets.asm - $(call filechk,gen-asm-offsets) - - CLEAN_FILES += include/asm-$(ARCH)/offset.h -diff -ur linux-2.6.7/arch/x86_64/kernel/Makefile linux-2.6.7-mod/arch/x86_64/kernel/Makefile ---- linux-2.6.7/arch/x86_64/kernel/Makefile Fri Jun 18 22:51:32 2004 -+++ linux-2.6.7-mod/arch/x86_64/kernel/Makefile Sat Jun 19 12:58:17 2004 -@@ -2,7 +2,7 @@ - # Makefile for the linux kernel. - # - --extra-y := head.o head64.o init_task.o vmlinux.lds.s -+extra-y := head.o head64.o init_task.o vmlinux.lds.asm - EXTRA_AFLAGS := -traditional - obj-y := process.o semaphore.o signal.o entry.o traps.o irq.o \ - ptrace.o i8259.o ioport.o ldt.o setup.o time.o sys_x86_64.o \ -diff -ur linux-2.6.7/scripts/Makefile.build linux-2.6.7-mod/scripts/Makefile.build ---- linux-2.6.7/scripts/Makefile.build Mon May 10 04:33:13 2004 -+++ linux-2.6.7-mod/scripts/Makefile.build Sat Jun 19 12:43:10 2004 -@@ -110,7 +110,7 @@ - quiet_cmd_cc_s_c = CC $(quiet_modtag) $@ - cmd_cc_s_c = $(CC) $(c_flags) -S -o $@ $< - --%.s: %.c FORCE -+%.asm: %.c FORCE - $(call if_changed_dep,cc_s_c) - - quiet_cmd_cc_i_c = CPP $(quiet_modtag) $@ -@@ -197,7 +197,7 @@ - quiet_cmd_as_s_S = CPP $(quiet_modtag) $@ - cmd_as_s_S = $(CPP) $(a_flags) -o $@ $< - --%.s: %.S FORCE -+%.asm: %.S FORCE - $(call if_changed_dep,as_s_S) - - quiet_cmd_as_o_S = AS $(quiet_modtag) $@ ---- linux-2.6.8/arch/sparc/boot/Makefile.old 2004-09-21 21:46:18.000000000 -0700 -+++ linux-2.6.8/arch/sparc/boot/Makefile 2004-09-21 21:52:35.000000000 -0700 -@@ -19,7 +19,7 @@ - - BTOBJS := $(HEAD_Y) $(INIT_Y) - BTLIBS := $(CORE_Y) $(LIBS_Y) $(DRIVERS_Y) $(NET_Y) --LDFLAGS_image := -T arch/sparc/kernel/vmlinux.lds.s $(BTOBJS) --start-group $(BTLIBS) --end-group $(kallsyms.o) -+LDFLAGS_image := -T arch/sparc/kernel/vmlinux.lds.asm $(BTOBJS) --start-group $(BTLIBS) --end-group $(kallsyms.o) - - # Actual linking - $(obj)/image: $(obj)/btfix.o FORCE ---- linux-2.6.8/arch/sh64/Makefile.old 2004-09-21 21:46:18.000000000 -0700 -+++ linux-2.6.8/arch/sh64/Makefile 2004-09-21 21:54:31.000000000 -0700 -@@ -71,7 +71,7 @@ - - prepare: include/asm-$(ARCH)/asm-offsets.h arch/$(ARCH)/lib/syscalltab.h - --include/asm-$(ARCH)/asm-offsets.h: arch/$(ARCH)/kernel/asm-offsets.s \ -+include/asm-$(ARCH)/asm-offsets.h: arch/$(ARCH)/kernel/asm-offsets.asm \ - include/asm include/linux/version.h - $(call filechk,gen-asm-offsets) - ---- linux-2.6.8/arch/sh64/boot/compressed/Makefile.old 2004-09-21 21:46:18.000000000 -0700 -+++ linux-2.6.8/arch/sh64/boot/compressed/Makefile 2004-09-21 21:54:41.000000000 -0700 -@@ -25,7 +25,7 @@ - ZIMAGE_OFFSET = $(shell printf "0x%8x" $$[$(CONFIG_MEMORY_START)+0x400000+0x10000]) - - LDFLAGS_vmlinux := -Ttext $(ZIMAGE_OFFSET) -e startup \ -- -T $(obj)/../../kernel/vmlinux.lds.s \ -+ -T $(obj)/../../kernel/vmlinux.lds.asm \ - --no-warn-mismatch - - $(obj)/vmlinux: $(OBJECTS) $(obj)/piggy.o FORCE -@@ -41,6 +41,6 @@ - LDFLAGS_piggy.o := -r --format binary --oformat elf32-sh64-linux -T - OBJCOPYFLAGS += -R .empty_zero_page - --$(obj)/piggy.o: $(obj)/vmlinux.lds.s $(obj)/vmlinux.bin.gz FORCE -+$(obj)/piggy.o: $(obj)/vmlinux.lds.asm $(obj)/vmlinux.bin.gz FORCE - $(call if_changed,ld) - diff --git a/patches/linux/2.6.8/linux-2.6.8-m68k-kludge.patch b/patches/linux/2.6.8/linux-2.6.8-m68k-kludge.patch deleted file mode 100644 index 9cef549..0000000 --- a/patches/linux/2.6.8/linux-2.6.8-m68k-kludge.patch +++ /dev/null @@ -1,285 +0,0 @@ -[ This patch not accepted into kernel for now - it touches the core too much - - but it's ok for crosstool since we just want to check whether toolchain is ok, - I think. I had to rediff the sched.h changes with -U5 to get them to - apply properly -- patch got confused with just three lines of context?! -dank ] - -Date: Sun, 5 Sep 2004 12:41:08 +0200 (CEST) -From: Geert Uytterhoeven -Sender: geert@linux-m68k.org -To: Dan Kegel -cc: Roman Zippel , - Matthias Urlichs , - Linux Kernel Mailing List , - Linux/m68k -Subject: Re: Getting kernel.org kernel to build for m68k? -In-Reply-To: -Message-ID: - -On Wed, 1 Sep 2004, Geert Uytterhoeven wrote: -> On Tue, 31 Aug 2004, Dan Kegel wrote: -> > I noticed today that Linus's m68k kernel can't be built (at least with gcc-3.4.1). -> > -> > The first problem I ran into, -> > CC arch/m68k/kernel/asm-offsets.s -> > In file included from include/linux/spinlock.h:12, -> > from include/linux/capability.h:45, -> > from include/linux/sched.h:7, -> > from arch/m68k/kernel/asm-offsets.c:12: -> > include/linux/thread_info.h:30: error: parse error before '{' token -> > is solved already in the m68k tree. -> > (In particular, -> > the #ifndef __HAVE_THREAD_FUNCTIONS ... #endif in -> > http://linux-m68k-cvs.apia.dhs.org/c/cvsweb/linux/include/linux/thread_info.h?rev=1.5;content-type=text%2Fplain -> > probably solves it.) -> > There are other problems after that. -> -> Roman Zippel changed the threading stuff on m68k. Since it would affect other -> architectures, I never submitted it on my own. -> -> In short, we never really compile this code, since the m68k tree doesn't use it -> anymore. And yes, it even fails with older compiler versions, like 2.95.2. - -The second part doesn't seem to be true: the code is used. And it does compile -after applying the fixes below, even with gcc 3.4.1. - -> > Any chance you could spend a bit of time sending Linus enough -> > patches for his kernel to build for m68k, if not run? -> -> I'll make sure a plain kernel.org kernel can build an m68k kernel. - -The patch below makes the plain kernel.org 2.6.8.1 compile for m68k, -using gcc 2.95.2 or 3.3.3 (3.4.1 needs a few more changes in random -places). The resulting kernel (I booted the gcc 2.95.2 case) works fine on my -Amiga. - -It's more or less the patch created by Matthias Urlichs last year, so -the credits are his: - -| This change implements a reasonable compromise between the task_info->flags -| variable in other ports, which is too much work in the syscall path on m68k, -| and moving the whole structure to thread_struct, which is way too intrusive -| on other ports. - -The patch does affect generic code a bit, but the collateral damage is -kept to a minimum. - -We can still keep Roman's thread info abstractions[*] in Linux/m68k CVS, but -I'd really like the plain kernel.org kernel to be in a working state as well. -That way more people may do cross-compile tests for m68k. - -Hence if no one objects, I'll submit the patch to Andrew and Linus. - -All comments are welcome! - ---- linux-2.6.8.1/arch/m68k/kernel/asm-offsets.c 2004-04-28 15:48:59.000000000 +0200 -+++ linux-m68k-2.6.8.1/arch/m68k/kernel/asm-offsets.c 2004-09-05 12:04:00.000000000 +0200 -@@ -31,6 +31,7 @@ int main(void) - DEFINE(TASK_SIGPENDING, offsetof(struct task_struct, thread.work.sigpending)); - DEFINE(TASK_NOTIFY_RESUME, offsetof(struct task_struct, thread.work.notify_resume)); - DEFINE(TASK_THREAD, offsetof(struct task_struct, thread)); -+ DEFINE(TASK_TINFO, offsetof(struct task_struct, thread_info)); - DEFINE(TASK_MM, offsetof(struct task_struct, mm)); - DEFINE(TASK_ACTIVE_MM, offsetof(struct task_struct, active_mm)); - -@@ -45,6 +46,9 @@ int main(void) - DEFINE(THREAD_FPCNTL, offsetof(struct thread_struct, fpcntl)); - DEFINE(THREAD_FPSTATE, offsetof(struct thread_struct, fpstate)); - -+ /* offsets into the thread_info struct */ -+ DEFINE(TINFO_PREEMPT, offsetof(struct thread_info, preempt_count)); -+ - /* offsets into the pt_regs */ - DEFINE(PT_D0, offsetof(struct pt_regs, d0)); - DEFINE(PT_ORIG_D0, offsetof(struct pt_regs, orig_d0)); ---- linux-2.6.8.1/arch/m68k/kernel/entry.S 2004-05-24 11:13:22.000000000 +0200 -+++ linux-m68k-2.6.8.1/arch/m68k/kernel/entry.S 2004-09-02 20:13:12.000000000 +0200 -@@ -134,13 +134,13 @@ ENTRY(system_call) - - syscall_exit_work: - btst #5,%sp@(PT_SR) | check if returning to kernel -- bnes 1b | if so, skip resched, signals -+ bnes 1b | if so, skip everything - tstw %d0 -- jeq do_signal_return -+ jeq do_signal_return | jump if only sig_pending or notify_resume - tstb %d0 -- jne do_delayed_trace -+ jne do_delayed_trace | jump if delayed_trace - -- pea resume_userspace -+ pea resume_userspace | need_resched is set - jmp schedule - - ret_from_exception: -@@ -223,10 +223,14 @@ ENTRY(nmi_handler) - */ - inthandler: - SAVE_ALL_INT -- GET_CURRENT(%d0) -- addqb #1,%curptr@(TASK_INFO+TINFO_PREEMPT+2) -- | put exception # in d0 -- bfextu %sp@(PT_VECTOR){#4,#10},%d0 -+ /* GET_CURRENT(%d0) */ -+ movel %sp,%d0 -+ andw #-THREAD_SIZE,%d0 -+ movel %d0,%a1 -+ addqb #1,%a1@(TINFO_PREEMPT+2) -+ movel %a1@,%curptr -+ -+ bfextu %sp@(PT_VECTOR){#4,#10},%d0 | put exception # in d0 - - movel %sp,%sp@- - movel %d0,%sp@- | put vector # on stack -@@ -243,7 +247,8 @@ inthandler: - 3: addql #8,%sp | pop parameters off stack - - ret_from_interrupt: -- subqb #1,%curptr@(TASK_INFO+TINFO_PREEMPT+2) -+ movel %curptr@(TASK_TINFO),%a1 -+ subqb #1,%a1@(TINFO_PREEMPT+2) - jeq 1f - 2: - RESTORE_ALL ---- linux-2.6.8.1/include/asm-m68k/processor.h 2004-04-28 15:49:03.000000000 +0200 -+++ linux-m68k-2.6.8.1/include/asm-m68k/processor.h 2004-09-02 20:29:32.000000000 +0200 -@@ -84,7 +84,6 @@ struct thread_struct { - ksp: sizeof(init_stack) + (unsigned long) init_stack, \ - sr: PS_S, \ - fs: __KERNEL_DS, \ -- info: INIT_THREAD_INFO(init_task) \ - } - - /* ---- linux-2.6.8.1/include/asm-m68k/thread_info.h 2004-05-24 11:13:53.000000000 +0200 -+++ linux-m68k-2.6.8.1/include/asm-m68k/thread_info.h 2004-09-05 12:19:47.000000000 +0200 -@@ -6,7 +6,7 @@ - #include - - struct thread_info { -- struct task_struct *task; /* main task structure */ -+ struct task_struct *task; /* main task structure, must be first! */ - struct exec_domain *exec_domain; /* execution domain */ - __s32 preempt_count; /* 0 => preemptable, <0 => BUG */ - __u32 cpu; /* should always be 0 on m68k */ -@@ -21,7 +21,8 @@ struct thread_info { - { \ - .task = &tsk, \ - .exec_domain = &default_exec_domain, \ -- .restart_block = { \ -+ .preempt_count = 1, \ -+ .restart_block = { \ - .fn = do_no_restart_syscall, \ - }, \ - } -@@ -35,10 +36,11 @@ struct thread_info { - #define free_thread_info(ti) free_pages((unsigned long)(ti),1) - #endif /* PAGE_SHIFT == 13 */ - --//#define init_thread_info (init_task.thread.info) -+#define init_thread_info (init_thread_union.thread_info) - #define init_stack (init_thread_union.stack) - --#define current_thread_info() (current->thread_info) -+register __u32 current_thread_info_reg asm("sp"); -+#define current_thread_info() ((struct thread_info *)(current_thread_info_reg & ~0x1fff)) - - - #define __HAVE_THREAD_FUNCTIONS -@@ -91,8 +93,12 @@ extern int thread_flag_fixme(void); - }) - - #define __get_set_tsk_thread_flag(tsk, flag, val) ({ \ -- int __res = __get_tsk_thread_flag(tsk, flag); \ -+ int __res; \ -+ unsigned long __flags; \ -+ local_irq_save(__flags); \ -+ __res = __get_tsk_thread_flag(tsk, flag); \ - __set_tsk_thread_flag(tsk, flag, val); \ -+ local_irq_restore(__flags); \ - __res; \ - }) - -@@ -105,7 +111,4 @@ extern int thread_flag_fixme(void); - #define clear_thread_flag(flag) clear_tsk_thread_flag(current, flag) - #define test_thread_flag(flag) test_tsk_thread_flag(current, flag) - --#define set_need_resched() set_thread_flag(TIF_NEED_RESCHED) --#define clear_need_resched() clear_thread_flag(TIF_NEED_RESCHED) -- - #endif /* _ASM_M68K_THREAD_INFO_H */ ---- linux-2.6.8/include/linux/sched.h.old 2004-09-13 21:48:58.000000000 -0700 -+++ linux-2.6.8/include/linux/sched.h 2004-09-13 21:50:26.000000000 -0700 -@@ -975,10 +975,11 @@ - task_unlock(task); - - return mm; - } - -+#ifndef __HAVE_THREAD_FUNCTIONS - - /* set thread flags in other task's structures - * - see asm/thread_info.h for TIF_xxxx flags available - */ - static inline void set_tsk_thread_flag(struct task_struct *tsk, int flag) -@@ -1004,10 +1005,12 @@ - static inline int test_tsk_thread_flag(struct task_struct *tsk, int flag) - { - return test_ti_thread_flag(tsk->thread_info,flag); - } - -+#endif /* __HAVE_THREAD_FUNCTIONS */ -+ - static inline void set_tsk_need_resched(struct task_struct *tsk) - { - set_tsk_thread_flag(tsk,TIF_NEED_RESCHED); - } - ---- linux-2.6.8.1/include/linux/thread_info.h 2004-04-27 20:42:22.000000000 +0200 -+++ linux-m68k-2.6.8.1/include/linux/thread_info.h 2004-09-04 21:24:36.000000000 +0200 -@@ -21,6 +21,7 @@ extern long do_no_restart_syscall(struct - #include - - #ifdef __KERNEL__ -+#ifndef __HAVE_THREAD_FUNCTIONS - - /* - * flag set/clear/test wrappers -@@ -77,16 +78,11 @@ static inline int test_ti_thread_flag(st - return test_bit(flag,&ti->flags); - } - --static inline void set_need_resched(void) --{ -- set_thread_flag(TIF_NEED_RESCHED); --} -+#endif /* __HAVE_THREAD_FUNCTIONS */ - --static inline void clear_need_resched(void) --{ -- clear_thread_flag(TIF_NEED_RESCHED); --} -+#define set_need_resched() set_thread_flag(TIF_NEED_RESCHED) -+#define clear_need_resched(void) clear_thread_flag(TIF_NEED_RESCHED) - --#endif -+#endif /* __KERNEL__ */ - - #endif /* _LINUX_THREAD_INFO_H */ - -Gr{oetje,eeting}s, - - Geert - -[*] For reference: - - http://linux-m68k-cvs.ubb.ca/~geert/linux-m68k-2.6.x-merging/POSTPONED/156-thread_info.diff - --- -Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org - -In personal conversations with technical people, I call myself a hacker. But -when I'm talking to journalists I just say "programmer" or something like that. - -- Linus Torvalds - - - diff --git a/patches/linux/2.6.8/linux-2.6.8-noshared-kconfig.patch b/patches/linux/2.6.8/linux-2.6.8-noshared-kconfig.patch deleted file mode 100644 index 326cdcd..0000000 --- a/patches/linux/2.6.8/linux-2.6.8-noshared-kconfig.patch +++ /dev/null @@ -1,28 +0,0 @@ -Lets you run 'make oldconfig' and 'make menuconfig' on systems -where shared libraries aren't easy. (There's no harm in using the -static version of libkconfig.) -Idea mentioned by Bertrand Marquis, but this patch is a bit simpler than his. - - ---- linux-2.6.8.1/scripts/kconfig/Makefile.old 2004-09-09 20:30:25.000000000 -0700 -+++ linux-2.6.8.1/scripts/kconfig/Makefile 2004-09-09 20:47:51.000000000 -0700 -@@ -68,8 +68,8 @@ - libkconfig-objs := zconf.tab.o - - host-progs := conf mconf qconf gconf --conf-objs := conf.o libkconfig.so --mconf-objs := mconf.o libkconfig.so -+conf-objs := conf.o $(libkconfig-objs) -+mconf-objs := mconf.o $(libkconfig-objs) - - ifeq ($(MAKECMDGOALS),xconfig) - qconf-target := 1 -@@ -88,7 +88,7 @@ - gconf-objs := gconf.o kconfig_load.o - endif - --clean-files := libkconfig.so lkc_defs.h qconf.moc .tmp_qtcheck \ -+clean-files := $(libkconfig-objs) lkc_defs.h qconf.moc .tmp_qtcheck \ - .tmp_gtkcheck zconf.tab.c zconf.tab.h lex.zconf.c - - # generated files seem to need this to find local include files diff --git a/scripts/crosstool.sh b/scripts/crosstool.sh index 5a12fd1..779bf90 100755 --- a/scripts/crosstool.sh +++ b/scripts/crosstool.sh @@ -42,22 +42,6 @@ CT_DoLog DEBUG "Unsetting and unexporting MAKEFLAGS" unset MAKEFLAGS export MAKEFLAGS -# Enable known ordering of files in directory listings: -CT_Test "crosstool-NG might not work as expected with LANG=\"${LANG}\"" -n "${LANG}" -case "${LC_COLLATE},${LC_ALL}" in - # These four combinations are known to sort files in the correct order: - fr_FR*,) ;; - en_US*,) ;; - *,fr_FR*) ;; - *,en_US*) ;; - # Anything else is destined to be borked if not gracefuly handled: - *) CT_DoLog WARN "Either LC_COLLATE=\"${LC_COLLATE}\" or LC_ALL=\"${LC_ALL}\" is not supported." - export LC_ALL=`locale -a |egrep "^(fr_FR|en_US)" |head -n 1` - CT_TestOrAbort "Neither en_US* nor fr_FR* locales found on your system." -n "${LC_ALL}" - CT_DoLog WARN "Forcing to known working LC_ALL=\"${LC_ALL}\"." - ;; -esac - # Other environment sanity checks CT_TestAndAbort "Don't set LD_LIBRARY_PATH. It screws up the build." -n "${LD_LIBRARY_PATH}" CT_TestAndAbort "Don't set CFLAGS. It screws up the build." -n "${CFLAGS}" -- cgit v0.10.2-6-g49f6