diff options
author | William Lallemand <wlallemand@irq6.net> | 2013-05-09 11:12:57 +0200 |
---|---|---|
committer | William Lallemand <wlallemand@irq6.net> | 2013-05-09 11:12:57 +0200 |
commit | 54c819b283621ce338a993b3e94c99dc359b788c (patch) | |
tree | 437d40c31473c854c5027746c6d0bc30da40981e /sys-devel/gcc/files | |
parent | digikam 3.2.0-beta1 (diff) | |
download | sekh-54c819b283621ce338a993b3e94c99dc359b788c.tar.gz sekh-54c819b283621ce338a993b3e94c99dc359b788c.tar.bz2 sekh-54c819b283621ce338a993b3e94c99dc359b788c.zip |
gcc linaro 4.7-2013.04 tests
Diffstat (limited to 'sys-devel/gcc/files')
46 files changed, 3827 insertions, 0 deletions
diff --git a/sys-devel/gcc/files/3.2.1/gcc31-loop-load-final-value.patch b/sys-devel/gcc/files/3.2.1/gcc31-loop-load-final-value.patch new file mode 100644 index 0000000..525262c --- /dev/null +++ b/sys-devel/gcc/files/3.2.1/gcc31-loop-load-final-value.patch @@ -0,0 +1,79 @@ +2002-04-22 Jan Hubicka <jh@suse.cz> + + * loop.c (gen_load_of_final_value): New. + (loop_givs_rescan, strength_reduce, check_dbra_loop): Use it. + +--- gcc-3.1-20020515/gcc/loop.c.loop-load-final-value 2002-05-17 00:15:52.000000000 +0200 ++++ gcc-3.1-20020515/gcc/loop.c 2002-05-17 00:32:20.000000000 +0200 +@@ -354,6 +354,7 @@ static rtx loop_insn_sink_or_swim PARAMS + static void loop_dump_aux PARAMS ((const struct loop *, FILE *, int)); + static void loop_delete_insns PARAMS ((rtx, rtx)); + static HOST_WIDE_INT remove_constant_addition PARAMS ((rtx *)); ++static rtx gen_load_of_final_value PARAMS ((rtx, rtx)); + void debug_ivs PARAMS ((const struct loop *)); + void debug_iv_class PARAMS ((const struct iv_class *)); + void debug_biv PARAMS ((const struct induction *)); +@@ -4797,7 +4798,8 @@ loop_givs_rescan (loop, bl, reg_map) + v->mult_val, v->add_val, v->dest_reg); + else if (v->final_value) + loop_insn_sink_or_swim (loop, +- gen_move_insn (v->dest_reg, v->final_value)); ++ gen_load_of_final_value (v->dest_reg, ++ v->final_value)); + + if (loop_dump_stream) + { +@@ -5154,8 +5156,9 @@ strength_reduce (loop, flags) + value, so we don't need another one. We can't calculate the + proper final value for such a biv here anyways. */ + if (bl->final_value && ! bl->reversed) +- loop_insn_sink_or_swim (loop, gen_move_insn +- (bl->biv->dest_reg, bl->final_value)); ++ loop_insn_sink_or_swim (loop, ++ gen_load_of_final_value (bl->biv->dest_reg, ++ bl->final_value)); + + if (loop_dump_stream) + fprintf (loop_dump_stream, "Reg %d: biv eliminated\n", +@@ -5164,8 +5167,8 @@ strength_reduce (loop, flags) + /* See above note wrt final_value. But since we couldn't eliminate + the biv, we must set the value after the loop instead of before. */ + else if (bl->final_value && ! bl->reversed) +- loop_insn_sink (loop, gen_move_insn (bl->biv->dest_reg, +- bl->final_value)); ++ loop_insn_sink (loop, gen_load_of_final_value (bl->biv->dest_reg, ++ bl->final_value)); + } + + /* Go through all the instructions in the loop, making all the +@@ -8360,7 +8363,7 @@ check_dbra_loop (loop, insn_count) + if ((REGNO_LAST_UID (bl->regno) != INSN_UID (first_compare)) + || ! bl->init_insn + || REGNO_FIRST_UID (bl->regno) != INSN_UID (bl->init_insn)) +- loop_insn_sink (loop, gen_move_insn (reg, final_value)); ++ loop_insn_sink (loop, gen_load_of_final_value (reg, final_value)); + + /* Delete compare/branch at end of loop. */ + delete_related_insns (PREV_INSN (loop_end)); +@@ -10355,6 +10358,21 @@ loop_insn_sink (loop, pattern) + return loop_insn_emit_before (loop, 0, loop->sink, pattern); + } + ++/* bl->final_value can be eighter general_operand or PLUS of general_operand ++ and constant. Emit sequence of intructions to load it into REG */ ++static rtx ++gen_load_of_final_value (reg, final_value) ++ rtx reg, final_value; ++{ ++ rtx seq; ++ start_sequence (); ++ final_value = force_operand (final_value, reg); ++ if (final_value != reg) ++ emit_move_insn (reg, final_value); ++ seq = gen_sequence (); ++ end_sequence (); ++ return seq; ++} + + /* If the loop has multiple exits, emit insn for PATTERN before the + loop to ensure that it will always be executed no matter how the diff --git a/sys-devel/gcc/files/3.2.1/gcc32-arm-disable-mathf.patch b/sys-devel/gcc/files/3.2.1/gcc32-arm-disable-mathf.patch new file mode 100644 index 0000000..fbb8a84 --- /dev/null +++ b/sys-devel/gcc/files/3.2.1/gcc32-arm-disable-mathf.patch @@ -0,0 +1,142 @@ +--- gcc-3.1/libstdc++-v3/configure Tue May 7 23:27:59 2002 ++++ gcc-3.1-patched/libstdc++-v3/configure Thu Aug 8 11:01:35 2002 +@@ -5034,10 +5034,6 @@ + EOF + + cat >> confdefs.h <<\EOF +-#define HAVE_FREXPF 1 +-EOF +- +- cat >> confdefs.h <<\EOF + #define HAVE_HYPOTF 1 + EOF + +@@ -7873,128 +7869,6 @@ + cat >> confdefs.h <<\EOF + #define HAVE_MMAP 1 + EOF +- +- +- cat >> confdefs.h <<\EOF +-#define HAVE_ACOSF 1 +-EOF +- +- cat >> confdefs.h <<\EOF +-#define HAVE_ASINF 1 +-EOF +- +- cat >> confdefs.h <<\EOF +-#define HAVE_ATAN2F 1 +-EOF +- +- cat >> confdefs.h <<\EOF +-#define HAVE_ATANF 1 +-EOF +- +- cat >> confdefs.h <<\EOF +-#define HAVE_CEILF 1 +-EOF +- +- cat >> confdefs.h <<\EOF +-#define HAVE_COPYSIGN 1 +-EOF +- +- cat >> confdefs.h <<\EOF +-#define HAVE_COPYSIGNF 1 +-EOF +- +- cat >> confdefs.h <<\EOF +-#define HAVE_COSF 1 +-EOF +- +- cat >> confdefs.h <<\EOF +-#define HAVE_COSHF 1 +-EOF +- +- cat >> confdefs.h <<\EOF +-#define HAVE_EXPF 1 +-EOF +- +- cat >> confdefs.h <<\EOF +-#define HAVE_FABSF 1 +-EOF +- +- cat >> confdefs.h <<\EOF +-#define HAVE_FINITE 1 +-EOF +- +- cat >> confdefs.h <<\EOF +-#define HAVE_FINITEF 1 +-EOF +- +- cat >> confdefs.h <<\EOF +-#define HAVE_FLOORF 1 +-EOF +- +- cat >> confdefs.h <<\EOF +-#define HAVE_FMODF 1 +-EOF +- +- cat >> confdefs.h <<\EOF +-#define HAVE_FREXPF 1 +-EOF +- +- cat >> confdefs.h <<\EOF +-#define HAVE_ISINF 1 +-EOF +- +- cat >> confdefs.h <<\EOF +-#define HAVE_ISINFF 1 +-EOF +- +- cat >> confdefs.h <<\EOF +-#define HAVE_ISNAN 1 +-EOF +- +- cat >> confdefs.h <<\EOF +-#define HAVE_ISNANF 1 +-EOF +- +- cat >> confdefs.h <<\EOF +-#define HAVE_LDEXPF 1 +-EOF +- +- cat >> confdefs.h <<\EOF +-#define HAVE_LOG10F 1 +-EOF +- +- cat >> confdefs.h <<\EOF +-#define HAVE_LOGF 1 +-EOF +- +- cat >> confdefs.h <<\EOF +-#define HAVE_MODFF 1 +-EOF +- +- cat >> confdefs.h <<\EOF +-#define HAVE_POWF 1 +-EOF +- +- cat >> confdefs.h <<\EOF +-#define HAVE_SINF 1 +-EOF +- +- cat >> confdefs.h <<\EOF +-#define HAVE_SINHF 1 +-EOF +- +- cat >> confdefs.h <<\EOF +-#define HAVE_SQRTF 1 +-EOF +- +- cat >> confdefs.h <<\EOF +-#define HAVE_TANF 1 +-EOF +- +- cat >> confdefs.h <<\EOF +-#define HAVE_TANHF 1 +-EOF +- + ;; + esac + diff --git a/sys-devel/gcc/files/3.2.1/gcc32-arm-reload1-fix.patch b/sys-devel/gcc/files/3.2.1/gcc32-arm-reload1-fix.patch new file mode 100644 index 0000000..0d5588e --- /dev/null +++ b/sys-devel/gcc/files/3.2.1/gcc32-arm-reload1-fix.patch @@ -0,0 +1,21 @@ +--- gcc-3.2.1/gcc/reload1.c.orig 2002-10-10 09:40:20.000000000 -0600 ++++ gcc-3.2.1/gcc/reload1.c 2003-01-30 12:15:05.000000000 -0700 +@@ -8674,7 +8674,9 @@ + ... (MEM (PLUS (REGZ) (REGY)))... . + + First, check that we have (set (REGX) (PLUS (REGX) (REGY))) +- and that we know all uses of REGX before it dies. */ ++ and that we know all uses of REGX before it dies. ++ Also, explicitly check that REGX != REGY; our life information ++ does not yet show whether REGY changes in this insn. */ + set = single_set (insn); + if (set != NULL_RTX + && GET_CODE (SET_DEST (set)) == REG +@@ -8684,6 +8686,7 @@ + && GET_CODE (SET_SRC (set)) == PLUS + && GET_CODE (XEXP (SET_SRC (set), 1)) == REG + && rtx_equal_p (XEXP (SET_SRC (set), 0), SET_DEST (set)) ++ && !rtx_equal_p (XEXP (SET_SRC (set), 1), SET_DEST (set)) + && last_label_ruid < reg_state[REGNO (SET_DEST (set))].use_ruid) + { + rtx reg = SET_DEST (set); diff --git a/sys-devel/gcc/files/3.2.1/gcc32-athlon-alignment.patch b/sys-devel/gcc/files/3.2.1/gcc32-athlon-alignment.patch new file mode 100644 index 0000000..0019eee --- /dev/null +++ b/sys-devel/gcc/files/3.2.1/gcc32-athlon-alignment.patch @@ -0,0 +1,11 @@ +--- gcc-3.2/gcc/config/i386/i386.c.athlon-alignment 2002-09-20 13:58:03.000000000 +0200 ++++ gcc-3.2/gcc/config/i386/i386.c 2002-09-20 14:03:59.000000000 +0200 +@@ -857,7 +857,7 @@ override_options () + {&pentium_cost, 0, 0, 16, 7, 16, 7, 16, 1}, + {&pentiumpro_cost, 0, 0, 16, 15, 16, 7, 16, 1}, + {&k6_cost, 0, 0, 32, 7, 32, 7, 32, 1}, +- {&athlon_cost, 0, 0, 16, 7, 64, 7, 16, 1}, ++ {&athlon_cost, 0, 0, 16, 7, 16, 7, 16, 1}, + {&pentium4_cost, 0, 0, 0, 0, 0, 0, 0, 1} + }; + diff --git a/sys-devel/gcc/files/3.2.1/gcc32-sparc32-hack.patch b/sys-devel/gcc/files/3.2.1/gcc32-sparc32-hack.patch new file mode 100644 index 0000000..0e03e36 --- /dev/null +++ b/sys-devel/gcc/files/3.2.1/gcc32-sparc32-hack.patch @@ -0,0 +1,66 @@ +This is an optimization hack which should only be present +in a sparc 32bit driver of the compiler compiled with +host/target/build sparc64-redhat-linux --with-cpu=v7. +As long long HOST_WIDE_INT slows things down, we can have in +addition to the sparc64-*/3.2/{cc1,cc1plus} +sparc-*/3.2/{cc1,cc1plus} binaries which are suitable for compiling +-m32 code only, but use long HOST_WIDE_INT. + +--- gcc/gcc.c.jj Thu Aug 1 17:41:31 2002 ++++ gcc/gcc.c Fri Sep 6 16:48:10 2002 +@@ -3184,6 +3184,8 @@ process_command (argc, argv) + int have_c = 0; + int have_o = 0; + int lang_n_infiles = 0; ++ int m64 = 0; ++ int used_B = 0; + #ifdef MODIFY_TARGET_NAME + int is_modify_target_name; + int j; +@@ -3565,6 +3567,7 @@ warranty; not even for MERCHANTABILITY o + spec_machine = p + 1; + + warn_std_ptr = &warn_std; ++ used_B = 1; + break; + + case 'B': +@@ -3627,6 +3630,7 @@ warranty; not even for MERCHANTABILITY o + PREFIX_PRIORITY_B_OPT, 0, &warn_B, 0); + add_prefix (&include_prefixes, concat (value, "include", NULL), + NULL, PREFIX_PRIORITY_B_OPT, 0, NULL, 0); ++ used_B = 1; + n_switches++; + } + break; +@@ -3731,6 +3735,13 @@ warranty; not even for MERCHANTABILITY o + #endif + goto normal_switch; + ++ /* HACK START */ ++ case 'm': ++ if (p[1] == '6' && p[2] == '4') ++ m64 = 1; ++ /* FALLTHROUGH */ ++ /* HACK END */ ++ + default: + normal_switch: + +@@ -3798,6 +3809,16 @@ warranty; not even for MERCHANTABILITY o + /* Use 2 as fourth arg meaning try just the machine as a suffix, + as well as trying the machine and the version. */ + #ifndef OS2 ++ /* HACK START */ ++ if (!m64 && !used_B && !strncmp (spec_machine, "sparc64-", 8)) ++ { ++ const char *sparc32_exec_prefix = ++ concat (standard_exec_prefix, "sparc-", spec_machine + 8, ++ dir_separator_str, spec_version, dir_separator_str, NULL); ++ add_prefix (&exec_prefixes, sparc32_exec_prefix, "GCC", ++ PREFIX_PRIORITY_LAST, 0, warn_std_ptr, 0); ++ } ++ /* HACK END */ + add_prefix (&exec_prefixes, standard_exec_prefix, "GCC", + PREFIX_PRIORITY_LAST, 1, warn_std_ptr, 0); + add_prefix (&exec_prefixes, standard_exec_prefix, "BINUTILS", diff --git a/sys-devel/gcc/files/3.2.1/gcc32-strip-dotdot.patch b/sys-devel/gcc/files/3.2.1/gcc32-strip-dotdot.patch new file mode 100644 index 0000000..088c307 --- /dev/null +++ b/sys-devel/gcc/files/3.2.1/gcc32-strip-dotdot.patch @@ -0,0 +1,84 @@ +2002-07-17 Alan Modra <amodra@bigpond.net.au> + + * prefix.c (update_path): Strip ".." components when prior dir + doesn't exist. Pass correct var to UPDATE_PATH_HOST_CANONICALIZE. + +--- gcc-3.2/gcc/prefix.c.strip-dotdot 2001-10-11 05:15:55.000000000 +0200 ++++ gcc-3.2/gcc/prefix.c 2002-08-17 09:37:01.000000000 +0200 +@@ -251,7 +252,7 @@ update_path (path, key) + const char *path; + const char *key; + { +- char *result; ++ char *result, *p; + + if (! strncmp (path, std_prefix, strlen (std_prefix)) && key != 0) + { +@@ -271,9 +272,66 @@ update_path (path, key) + else + result = xstrdup (path); + ++#ifndef ALWAYS_STRIP_DOTDOT ++#define ALWAYS_STRIP_DOTDOT 0 ++#endif ++ ++ p = result; ++ while (1) ++ { ++ char *src, *dest; ++ ++ p = strchr (p, '.'); ++ if (p == NULL) ++ break; ++ /* Look for `/../' */ ++ if (p[1] == '.' ++ && IS_DIR_SEPARATOR (p[2]) ++ && (p != result && IS_DIR_SEPARATOR (p[-1]))) ++ { ++ *p = 0; ++ if (!ALWAYS_STRIP_DOTDOT && access (result, X_OK) == 0) ++ { ++ *p = '.'; ++ break; ++ } ++ else ++ { ++ /* We can't access the dir, so we won't be able to ++ access dir/.. either. Strip out `dir/../'. If `dir' ++ turns out to be `.', strip one more path component. */ ++ dest = p; ++ do ++ { ++ --dest; ++ while (dest != result && IS_DIR_SEPARATOR (*dest)) ++ --dest; ++ while (dest != result && !IS_DIR_SEPARATOR (dest[-1])) ++ --dest; ++ } ++ while (dest != result && *dest == '.'); ++ /* If we have something like `./..' or `/..', don't ++ strip anything more. */ ++ if (*dest == '.' || IS_DIR_SEPARATOR (*dest)) ++ { ++ *p = '.'; ++ break; ++ } ++ src = p + 3; ++ while (IS_DIR_SEPARATOR (*src)) ++ ++src; ++ p = dest; ++ while ((*dest++ = *src++) != 0) ++ ; ++ } ++ } ++ else ++ ++p; ++ } ++ + #ifdef UPDATE_PATH_HOST_CANONICALIZE + /* Perform host dependent canonicalization when needed. */ +- UPDATE_PATH_HOST_CANONICALIZE (path); ++ UPDATE_PATH_HOST_CANONICALIZE (result); + #endif + + #ifdef DIR_SEPARATOR_2 diff --git a/sys-devel/gcc/files/3.2.2/gcc-3.2.2-cross-compile.patch b/sys-devel/gcc/files/3.2.2/gcc-3.2.2-cross-compile.patch new file mode 100644 index 0000000..076cbf1 --- /dev/null +++ b/sys-devel/gcc/files/3.2.2/gcc-3.2.2-cross-compile.patch @@ -0,0 +1,11 @@ +--- gcc/configure.orig 2005-08-20 04:28:13.000000000 -0400 ++++ gcc/configure 2005-08-20 04:28:38.000000000 -0400 +@@ -6790,7 +6790,7 @@ + # This prevents libgcc2 from containing any code which requires libc + # support. + inhibit_libc= +-if test x$host != x$target && test x$with_headers = x; then ++if test x$host != x$target && { test "x$with_headers" = x || test "x$with_headers" = xno ; } ; then + inhibit_libc=-Dinhibit_libc + else + if test x$with_newlib = xyes; then diff --git a/sys-devel/gcc/files/3.2.2/gcc-3.2.2-no-COPYING-cross-compile.patch b/sys-devel/gcc/files/3.2.2/gcc-3.2.2-no-COPYING-cross-compile.patch new file mode 100644 index 0000000..6f42e74 --- /dev/null +++ b/sys-devel/gcc/files/3.2.2/gcc-3.2.2-no-COPYING-cross-compile.patch @@ -0,0 +1,40 @@ +--- gcc-3.2.2/configure.in ++++ gcc-3.2.2/configure.in +@@ -517,37 +517,6 @@ + esac + fi + +-# Handle ${copy_dirs} +-set fnord ${copy_dirs} +-shift +-while [ $# != 0 ]; do +- if [ -f $2/COPIED ] && [ x"`cat $2/COPIED`" = x"$1" ]; then +- : +- else +- echo Copying $1 to $2 +- +- # Use the install script to create the directory and all required +- # parent directories. +- if [ -d $2 ]; then +- : +- else +- echo >config.temp +- ${srcdir}/install-sh -c -m 644 config.temp $2/COPIED +- fi +- +- # Copy the directory, assuming we have tar. +- # FIXME: Should we use B in the second tar? Not all systems support it. +- (cd $1; tar -cf - .) | (cd $2; tar -xpf -) +- +- # It is the responsibility of the user to correctly adjust all +- # symlinks. If somebody can figure out how to handle them correctly +- # here, feel free to add the code. +- +- echo $1 > $2/COPIED +- fi +- shift; shift +-done +- + # Configure extra directories which are host specific + + case "${host}" in diff --git a/sys-devel/gcc/files/3.2.2/gcc32-pr7768.patch b/sys-devel/gcc/files/3.2.2/gcc32-pr7768.patch new file mode 100644 index 0000000..72b4910 --- /dev/null +++ b/sys-devel/gcc/files/3.2.2/gcc32-pr7768.patch @@ -0,0 +1,65 @@ +2002-09-14 Nathan Sidwell <nathan@codesourcery.com> + + PR c++/7768 + * pt.c (build_template_decl): Copy DECL_DESTRUCTOR_P. + +2002-09-15 Nathan Sidwell <nathan@codesourcery.com> + + * g++.dg/template/pretty1.C: New test. + +--- gcc-3.2.1/gcc/cp/pt.c.pr7768 2003-01-20 14:14:15.000000000 +0100 ++++ gcc-3.2.1/gcc/cp/pt.c 2003-02-08 14:42:15.000000000 +0100 +@@ -2108,6 +2108,7 @@ build_template_decl (decl, parms) + DECL_VIRTUAL_CONTEXT (tmpl) = DECL_VIRTUAL_CONTEXT (decl); + DECL_STATIC_FUNCTION_P (tmpl) = DECL_STATIC_FUNCTION_P (decl); + DECL_CONSTRUCTOR_P (tmpl) = DECL_CONSTRUCTOR_P (decl); ++ DECL_DESTRUCTOR_P (tmpl) = DECL_DESTRUCTOR_P (decl); + DECL_NONCONVERTING_P (tmpl) = DECL_NONCONVERTING_P (decl); + DECL_ASSIGNMENT_OPERATOR_P (tmpl) = DECL_ASSIGNMENT_OPERATOR_P (decl); + if (DECL_OVERLOADED_OPERATOR_P (decl)) +--- gcc-3.2.1/gcc/testsuite/g++.dg/template/pretty1.C.pr7768 2003-02-08 14:42:03.000000000 +0100 ++++ gcc-3.2.1/gcc/testsuite/g++.dg/template/pretty1.C 2003-02-08 14:41:52.000000000 +0100 +@@ -0,0 +1,43 @@ ++// { dg-do run } ++ ++// Copyright (C) 2002 Free Software Foundation, Inc. ++// Contributed by Nathan Sidwell 14 Sep 2002 <nathan@codesourcery.com> ++ ++// PR 7768 template dtor pretty function wrong ++ ++#include <string.h> ++ ++static size_t current = 0; ++static bool error = false; ++ ++static char const *names[] = ++{ ++ "X<T>::X() [with T = void]", ++ "X<T>::~X() [with T = void]", ++ 0 ++}; ++ ++void Verify (char const *ptr) ++{ ++ error = strcmp (ptr, names[current++]); ++} ++ ++template <typename T> ++struct X ++{ ++ X() { Verify (__PRETTY_FUNCTION__); } ++ ~X() { Verify (__PRETTY_FUNCTION__); } ++}; ++ ++int main() ++{ ++ { ++ X<void> x; ++ ++ if (error) ++ return current; ++ } ++ if (error) ++ return current; ++ return 0; ++} diff --git a/sys-devel/gcc/files/3.2.2/gcc32-pr8213.patch b/sys-devel/gcc/files/3.2.2/gcc32-pr8213.patch new file mode 100644 index 0000000..762d198 --- /dev/null +++ b/sys-devel/gcc/files/3.2.2/gcc32-pr8213.patch @@ -0,0 +1,69 @@ +2002-10-30 Jan Hubicka <jh@suse.cz> + + PR target/8213 + * config/i386/i386.c (ix86_expand_int_movcc): Fix RTL sharing problem. + +2002-11-04 Gwenole Beauchesne <gbeauchesne@mandrakesoft.com> + + * testsuite/gcc.c-torture/execute/20021104.c: New test. + +--- gcc-3.2/gcc/config/i386/i386.c.pr8213 2002-11-04 12:56:37.000000000 -0500 ++++ gcc-3.2/gcc/config/i386/i386.c 2002-11-04 13:21:22.000000000 -0500 +@@ -8274,11 +8274,11 @@ ix86_expand_int_movcc (operands) + /* On x86_64 the lea instruction operates on Pmode, so we need to get arithmetics + done in proper mode to match. */ + if (diff == 1) +- tmp = out; ++ tmp = copy_rtx (out); + else + { + rtx out1; +- out1 = out; ++ out1 = copy_rtx (out); + tmp = gen_rtx_MULT (mode, out1, GEN_INT (diff & ~1)); + nops++; + if (diff & 1) +@@ -8302,12 +8302,12 @@ ix86_expand_int_movcc (operands) + clob = gen_rtx_REG (CCmode, FLAGS_REG); + clob = gen_rtx_CLOBBER (VOIDmode, clob); + +- tmp = gen_rtx_SET (VOIDmode, out, tmp); ++ tmp = gen_rtx_SET (VOIDmode, copy_rtx (out), tmp); + tmp = gen_rtx_PARALLEL (VOIDmode, gen_rtvec (2, copy_rtx (tmp), clob)); + emit_insn (tmp); + } + else +- emit_insn (gen_rtx_SET (VOIDmode, out, tmp)); ++ emit_insn (gen_rtx_SET (VOIDmode, copy_rtx (out), tmp)); + } + if (out != operands[0]) + emit_move_insn (operands[0], copy_rtx (out)); +--- gcc-3.2/gcc/testsuite/gcc.c-torture/execute/20021104.c.pr8213 2002-11-04 13:22:33.000000000 -0500 ++++ gcc-3.2/gcc/testsuite/gcc.c-torture/execute/20021104.c 2002-11-04 13:24:12.000000000 -0500 +@@ -0,0 +1,26 @@ ++/* PR target/8213 ++ This testcase, distilled from GNU gmp 4.1, was miscompiled on x86-64 ++ because of RTL sharing problems. */ ++ ++int f(long x, long y) ++{ ++ if ((x < 0) == (y < 0)) ++ { ++ if (x == 0) ++ return -(y != 0); ++ if (y == 0) ++ return x != 0; ++ } ++ else ++ { ++ return x >= 0 ? 1 : -1; ++ } ++} ++ ++int main(void) ++{ ++ if (f(-1, 1) != -1) ++ abort(); ++ ++ return 0; ++} diff --git a/sys-devel/gcc/files/3.2.2/gcc322-ggc_page-speedup.patch b/sys-devel/gcc/files/3.2.2/gcc322-ggc_page-speedup.patch new file mode 100644 index 0000000..564433d --- /dev/null +++ b/sys-devel/gcc/files/3.2.2/gcc322-ggc_page-speedup.patch @@ -0,0 +1,17 @@ +--- gcc-3.2.2/gcc/ggc-page.c.orig 2003-03-22 03:52:54.000000000 +0200 ++++ gcc-3.2.2/gcc/ggc-page.c 2003-03-22 03:54:17.000000000 +0200 +@@ -344,11 +344,11 @@ + this factor times the allocation at the end of the last collection. + In other words, total allocation must expand by (this factor minus + one) before collection is performed. */ +-#define GGC_MIN_EXPAND_FOR_GC (1.3) ++#define GGC_MIN_EXPAND_FOR_GC (2.0) + +-/* Bound `allocated_last_gc' to 16MB, to prevent the memory expansion ++/* Bound `allocated_last_gc' to 32MB, to prevent the memory expansion + test from triggering too often when the heap is small. */ +-#define GGC_MIN_LAST_ALLOCATED (16 * 1024 * 1024) ++#define GGC_MIN_LAST_ALLOCATED (32 * 1024 * 1024) + + /* Allocate pages in chunks of this size, to throttle calls to memory + allocation routines. The first page is used, the rest go onto the diff --git a/sys-devel/gcc/files/3.2.3/gcc-3.2.3-mergel-fix.patch b/sys-devel/gcc/files/3.2.3/gcc-3.2.3-mergel-fix.patch new file mode 100644 index 0000000..bc763ae --- /dev/null +++ b/sys-devel/gcc/files/3.2.3/gcc-3.2.3-mergel-fix.patch @@ -0,0 +1,61 @@ +diff -ruN gcc-3.2.3.orig/gcc/config/rs6000/altivec.h gcc-3.2.3/gcc/config/rs6000/altivec.h +--- gcc-3.2.3.orig/gcc/config/rs6000/altivec.h 2003-07-03 02:47:36.000000000 +0200 ++++ gcc-3.2.3/gcc/config/rs6000/altivec.h 2003-07-03 02:49:17.000000000 +0200 +@@ -8535,4 +8535,57 @@ + + #endif /* __cplusplus */ + ++/*lu_zero@gentoo.org mergel issue workaround*/ ++static inline vector signed char my_vmrglb (vector signed char const A, ++ vector signed char const B) ++{ ++ static const vector unsigned char lowbyte = { ++ 0x08, 0x18, 0x09, 0x19, 0x0a, 0x1a, 0x0b, 0x1b, ++ 0x0c, 0x1c, 0x0d, 0x1d, 0x0e, 0x1e, 0x0f, 0x1f ++ }; ++ return vec_perm (A, B, lowbyte); ++} ++ ++static inline vector signed short my_vmrglh (vector signed short const A, ++ vector signed short const B) ++{ ++ static const vector unsigned char lowhalf = { ++ 0x08, 0x09, 0x18, 0x19, 0x0a, 0x0b, 0x1a, 0x1b, ++ 0x0c, 0x0d, 0x1c, 0x1d, 0x0e, 0x0f, 0x1e, 0x1f ++ }; ++ return vec_perm (A, B, lowhalf); ++} ++ ++static inline vector signed int my_vmrglw (vector signed int const A, ++ vector signed int const B) ++{ ++ static const vector unsigned char lowword = { ++ 0x08, 0x09, 0x0a, 0x0b, 0x18, 0x19, 0x1a, 0x1b, ++ 0x0c, 0x0d, 0x0e, 0x0f, 0x1c, 0x1d, 0x1e, 0x1f ++ }; ++ return vec_perm (A, B, lowword); ++} ++/*#define my_vmrglb my_vmrglb ++#define my_vmrglh my_vmrglh ++#define my_vmrglw my_vmrglw ++*/ ++#undef vec_mergel ++ ++#define vec_mergel(a1, a2) \ ++__ch (__bin_args_eq (vector signed char, (a1), vector signed char, (a2)), \ ++ ((vector signed char) my_vmrglb ((vector signed char) (a1), (vector signed char) (a2))), \ ++__ch (__bin_args_eq (vector unsigned char, (a1), vector unsigned char, (a2)), \ ++ ((vector unsigned char) my_vmrglb ((vector signed char) (a1), (vector signed char) (a2))), \ ++__ch (__bin_args_eq (vector signed short, (a1), vector signed short, (a2)), \ ++ ((vector signed short) my_vmrglh ((vector signed short) (a1), (vector signed short) (a2))), \ ++__ch (__bin_args_eq (vector unsigned short, (a1), vector unsigned short, (a2)), \ ++ ((vector unsigned short) my_vmrglh ((vector signed short) (a1), (vector signed short) (a2))), \ ++__ch (__bin_args_eq (vector float, (a1), vector float, (a2)), \ ++ ((vector float) my_vmrglw ((vector signed int) (a1), (vector signed int) (a2))), \ ++__ch (__bin_args_eq (vector signed int, (a1), vector signed int, (a2)), \ ++ ((vector signed int) my_vmrglw ((vector signed int) (a1), (vector signed int) (a2))), \ ++__ch (__bin_args_eq (vector unsigned int, (a1), vector unsigned int, (a2)), \ ++ ((vector unsigned int) my_vmrglw ((vector signed int) (a1), (vector signed int) (a2))), \ ++ __altivec_link_error_invalid_argument ()))))))) ++ + #endif /* _ALTIVEC_H */ diff --git a/sys-devel/gcc/files/3.2.3/gcc-3.2.3-move-propolice-into-glibc.patch b/sys-devel/gcc/files/3.2.3/gcc-3.2.3-move-propolice-into-glibc.patch new file mode 100644 index 0000000..d037cd1 --- /dev/null +++ b/sys-devel/gcc/files/3.2.3/gcc-3.2.3-move-propolice-into-glibc.patch @@ -0,0 +1,120 @@ +diff -u -r -N gcc-3.2.3.ORIG/gcc/libgcc-std.ver gcc-3.2.3/gcc/libgcc-std.ver +--- gcc-3.2.3.ORIG/gcc/libgcc-std.ver 2003-11-11 18:12:52.000000000 +0100 ++++ gcc-3.2.3/gcc/libgcc-std.ver 2003-11-11 18:19:31.000000000 +0100 +@@ -176,6 +176,7 @@ + _Unwind_SjLj_Resume + + # stack smash handler symbols +- __guard +- __stack_smash_handler ++ # these can be found in glibc now ++ # __guard ++ # __stack_smash_handler + } +diff -u -r -N gcc-3.2.3.ORIG/gcc/libgcc2.c gcc-3.2.3/gcc/libgcc2.c +--- gcc-3.2.3.ORIG/gcc/libgcc2.c 2003-11-11 18:12:52.000000000 +0100 ++++ gcc-3.2.3/gcc/libgcc2.c 2003-11-11 18:20:44.000000000 +0100 +@@ -2052,100 +2052,7 @@ + #endif /* L_exit */ + + #ifdef L_stack_smash_handler +-#include <stdio.h> +-#include <string.h> +-#include <fcntl.h> +-#include <unistd.h> +- +-#ifdef _POSIX_SOURCE +-#include <signal.h> +-#endif +- +-#if defined(HAVE_SYSLOG) +-#include <sys/types.h> +-#include <sys/socket.h> +-#include <sys/un.h> +- +-#include <sys/syslog.h> +-#ifndef _PATH_LOG +-#define _PATH_LOG "/dev/log" +-#endif +-#endif +- +-long __guard[8] = {0,0,0,0,0,0,0,0}; +-static void __guard_setup (void) __attribute__ ((constructor)) ; +-static void __guard_setup (void) +-{ +- int fd; +- if (__guard[0]!=0) return; +- fd = open ("/dev/urandom", 0); +- if (fd != -1) { +- ssize_t size = read (fd, (char*)&__guard, sizeof(__guard)); +- close (fd) ; +- if (size == sizeof(__guard)) return; +- } +- /* If a random generator can't be used, the protector switches the guard +- to the "terminator canary" */ +- ((char*)__guard)[0] = 0; ((char*)__guard)[1] = 0; +- ((char*)__guard)[2] = '\n'; ((char*)__guard)[3] = 255; +-} +-void __stack_smash_handler (char func[], int damaged ATTRIBUTE_UNUSED) +-{ +-#if defined (__GNU_LIBRARY__) +- extern char * __progname; +-#endif +- const char message[] = ": stack smashing attack in function "; +- int bufsz = 256, len; +- char buf[bufsz]; +-#if defined(HAVE_SYSLOG) +- int LogFile; +- struct sockaddr_un SyslogAddr; /* AF_UNIX address of local logger */ +-#endif +-#ifdef _POSIX_SOURCE +- { +- sigset_t mask; +- sigfillset(&mask); +- sigdelset(&mask, SIGABRT); /* Block all signal handlers */ +- sigprocmask(SIG_BLOCK, &mask, NULL); /* except SIGABRT */ +- } +-#endif +- +- strcpy(buf, "<2>"); len=3; /* send LOG_CRIT */ +-#if defined (__GNU_LIBRARY__) +- strncat(buf, __progname, bufsz-len-1); len = strlen(buf); +-#endif +- if (bufsz>len) {strncat(buf, message, bufsz-len-1); len = strlen(buf);} +- if (bufsz>len) {strncat(buf, func, bufsz-len-1); len = strlen(buf);} +- +- /* print error message */ +- write (STDERR_FILENO, buf+3, len-3); +-#if defined(HAVE_SYSLOG) +- if ((LogFile = socket(AF_UNIX, SOCK_DGRAM, 0)) != -1) { +- +- /* +- * Send "found" message to the "/dev/log" path +- */ +- SyslogAddr.sun_family = AF_UNIX; +- (void)strncpy(SyslogAddr.sun_path, _PATH_LOG, +- sizeof(SyslogAddr.sun_path) - 1); +- SyslogAddr.sun_path[sizeof(SyslogAddr.sun_path) - 1] = '\0'; +- sendto(LogFile, buf, len, 0, (struct sockaddr *)&SyslogAddr, +- sizeof(SyslogAddr)); +- } +-#endif +- +-#ifdef _POSIX_SOURCE +- { /* Make sure the default handler is associated with SIGABRT */ +- struct sigaction sa; +- +- memset(&sa, 0, sizeof(struct sigaction)); +- sigfillset(&sa.sa_mask); /* Block all signals */ +- sa.sa_flags = 0; +- sa.sa_handler = SIG_DFL; +- sigaction(SIGABRT, &sa, NULL); +- (void)kill(getpid(), SIGABRT); +- } +-#endif +- _exit(127); +-} ++extern long __guard[8]; ++extern void __guard_setup (void); ++extern void __stack_smash_handler (char func[], int damaged); + #endif diff --git a/sys-devel/gcc/files/3.2.3/gcc-3.2.3-poisoned-malloc.patch b/sys-devel/gcc/files/3.2.3/gcc-3.2.3-poisoned-malloc.patch new file mode 100644 index 0000000..2bdd26d --- /dev/null +++ b/sys-devel/gcc/files/3.2.3/gcc-3.2.3-poisoned-malloc.patch @@ -0,0 +1,41 @@ +fix building gcc-3.2.3 with newer versions of gcc + +http://bugs.gentoo.org/225743 +http://gcc.gnu.org/ml/gcc-help/2008-01/msg00040.html +http://www.archivum.info/gnu.gcc.help/2008-05/msg00093.html + +--- gcc-3.2.3/gcc/read-rtl.c ++++ gcc-3.2.3/gcc/read-rtl.c +@@ -659,7 +659,7 @@ + { + ungetc (c, infile); + list_counter++; +- obstack_ptr_grow (&vector_stack, (PTR) read_rtx (infile)); ++ obstack_ptr_grow (&vector_stack, read_rtx (infile)); + } + if (list_counter > 0) + { +--- gcc-3.2.3/gcc/system.h ++++ gcc-3.2.3/gcc/system.h +@@ -589,7 +589,9 @@ + #undef realloc + #undef calloc + #undef strdup ++#if ! (defined(FLEX_SCANNER) || defined(YYBISON) || defined(YYBYACC)) + #pragma GCC poison malloc realloc calloc strdup ++#endif + + /* Old target macros that have moved to the target hooks structure. */ + #pragma GCC poison ASM_OPEN_PAREN ASM_CLOSE_PAREN \ +@@ -628,4 +630,11 @@ + + #endif /* GCC >= 3.0 */ + ++#if defined(FLEX_SCANNER) || defined(YYBISON) || defined(YYBYACC) ++/* Flex and bison use malloc and realloc. Yuk. Note that this means ++ really_call_* cannot be used in a .l or .y file. */ ++#define malloc xmalloc ++#define realloc xrealloc ++#endif ++ + #endif /* ! GCC_SYSTEM_H */ diff --git a/sys-devel/gcc/files/3.2.3/gcc-323-propolice-version.patch b/sys-devel/gcc/files/3.2.3/gcc-323-propolice-version.patch new file mode 100644 index 0000000..61b5eed --- /dev/null +++ b/sys-devel/gcc/files/3.2.3/gcc-323-propolice-version.patch @@ -0,0 +1,17 @@ +--- gcc/version.c.old 2003-03-26 10:43:47.000000000 -0500 ++++ gcc/version.c 2003-03-26 10:44:13.000000000 -0500 +@@ -1,4 +1,4 @@ + #include "ansidecl.h" + #include "version.h" + +-const char *const version_string = "3.2.3 20030422 (Gentoo Linux 1.4 @PV@)"; ++const char *const version_string = "3.2.3 20030422 (Gentoo Linux 1.4 @PV@, propolice)"; + +--- gcc/f/version.c.old 2003-03-26 10:43:54.000000000 -0500 ++++ gcc/f/version.c 2003-03-26 10:44:27.000000000 -0500 +@@ -1,4 +1,4 @@ + #include "ansidecl.h" + #include "f/version.h" + +-const char *const ffe_version_string = "3.2.3 20030422 (Gentoo Linux 1.4 @PV@)"; ++const char *const ffe_version_string = "3.2.3 20030422 (Gentoo Linux 1.4 @PV@), propolice)"; diff --git a/sys-devel/gcc/files/3.2.3/gcc32-c++-classfn-member-template.patch b/sys-devel/gcc/files/3.2.3/gcc32-c++-classfn-member-template.patch new file mode 100644 index 0000000..7e2e328 --- /dev/null +++ b/sys-devel/gcc/files/3.2.3/gcc32-c++-classfn-member-template.patch @@ -0,0 +1,108 @@ +2003-03-29 Gwenole Beauchesne <gbeauchesne@mandrakesoft.com> + + Backport from 3.3-branch: + + 2003-03-11 Jason Merrill <jason@redhat.com> + + PR c++/8660 + * cp/decl2.c (check_classfn): A member template only matches a + member template. + +2003-03-29 Gwenole Beauchesne <gbeauchesne@mandrakesoft.com> + + PR c++/10265 + * testsuite/g++.dg/template/member3.C: New test. + +--- gcc-3.2.2/gcc/cp/decl2.c.c++-classfn-member-template 2003-03-20 10:11:54.000000000 +0100 ++++ gcc-3.2.2/gcc/cp/decl2.c 2003-04-02 11:14:29.000000000 +0200 +@@ -1288,6 +1288,7 @@ check_classfn (ctype, function) + tree method_vec = CLASSTYPE_METHOD_VEC (complete_type (ctype)); + tree *methods = 0; + tree *end = 0; ++ int is_template; + + if (DECL_USE_TEMPLATE (function) + && !(TREE_CODE (function) == TEMPLATE_DECL +@@ -1305,6 +1306,10 @@ check_classfn (ctype, function) + find the method, but we don't complain. */ + return NULL_TREE; + ++ /* OK, is this a definition of a member template? */ ++ is_template = (TREE_CODE (function) == TEMPLATE_DECL ++ || (processing_template_decl - template_class_depth (ctype))); ++ + if (method_vec != 0) + { + methods = &TREE_VEC_ELT (method_vec, 0); +@@ -1344,6 +1349,11 @@ check_classfn (ctype, function) + && TREE_CODE (TREE_TYPE (function)) == METHOD_TYPE) + p1 = TREE_CHAIN (p1); + ++ /* A member template definition only matches a member template ++ declaration. */ ++ if (is_template != (TREE_CODE (fndecl) == TEMPLATE_DECL)) ++ continue; ++ + if (same_type_p (TREE_TYPE (TREE_TYPE (function)), + TREE_TYPE (TREE_TYPE (fndecl))) + && compparms (p1, p2) +--- gcc-3.2.2/gcc/testsuite/g++.dg/template/member2.C.c++-classfn-member-template 2003-04-02 11:14:29.000000000 +0200 ++++ gcc-3.2.2/gcc/testsuite/g++.dg/template/member2.C 2003-04-02 11:14:29.000000000 +0200 +@@ -0,0 +1,15 @@ ++// PR c++/8660 ++// Bug: we were treating the definition of the non-template as a definition ++// of the template, which broke. ++ ++/* { dg-do compile } */ ++ ++struct BadgerBuf ++{ ++ void ReadPod(); ++ template<class B> ++ void ReadPod(); ++}; ++ ++void BadgerBuf::ReadPod () ++ { ReadPod<int> (); } +--- gcc-3.2.2/gcc/testsuite/g++.dg/template/member3.C.c++-classfn-member-template 2003-04-02 11:14:29.000000000 +0200 ++++ gcc-3.2.2/gcc/testsuite/g++.dg/template/member3.C 2003-04-02 11:14:29.000000000 +0200 +@@ -0,0 +1,28 @@ ++// PR c++/10265 ++// Bug: we were treating the definition of the non-template as a definition ++// of the template, which broke. ++ ++/* { dg-do compile } */ ++ ++struct A { ++ template<class T> void f(); ++ void f(); ++}; ++ ++template<class T> void A::f() { } ++void A::f() { } ++ ++struct B { ++ template<class T> void f() { } ++ void f() { } ++}; ++ ++int main() ++{ ++ A a; ++ a.f(); ++ a.f<int>(); ++ B b; ++ b.f(); ++ b.f<int>(); ++} +--- gcc-3.2.2/gcc/testsuite/g++.old-deja/g++.mike/err1.C.c++-classfn-member-template 1998-12-16 22:44:46.000000000 +0100 ++++ gcc-3.2.2/gcc/testsuite/g++.old-deja/g++.mike/err1.C 2003-04-02 12:47:12.000000000 +0200 +@@ -2,7 +2,7 @@ + + struct gorf { + int stuff; +- void snarf(); ++ void snarf(); // ERROR - + }; + + template <class T> void gorf::snarf() { return; } // ERROR - diff --git a/sys-devel/gcc/files/3.2.3/gcc32-mklibgcc-serialize-crtfiles.patch b/sys-devel/gcc/files/3.2.3/gcc32-mklibgcc-serialize-crtfiles.patch new file mode 100644 index 0000000..42db8fd --- /dev/null +++ b/sys-devel/gcc/files/3.2.3/gcc32-mklibgcc-serialize-crtfiles.patch @@ -0,0 +1,27 @@ +--- gcc-3.2.2/gcc/mklibgcc.in.mklibgcc-serialize-crtfiles 2003-02-04 05:04:51.000000000 -0500 ++++ gcc-3.2.2/gcc/mklibgcc.in 2003-03-16 18:01:48.000000000 -0500 +@@ -404,6 +404,9 @@ echo ' if [ -d $$d ]; then true; else + echo ' done' + echo ' if [ -f stmp-dirs ]; then true; else touch stmp-dirs; fi' + ++# serialize build, since they may have to generate a new c-parse.y but ++# two jobs could be started in parallel thus colliding ++prev_out="" + for f in $EXTRA_MULTILIB_PARTS; do + for ml in $MULTILIBS; do + dir=`echo ${ml} | sed -e 's/;.*$//' -e 's/=/$(EQ)/g'` +@@ -418,12 +421,13 @@ for f in $EXTRA_MULTILIB_PARTS; do + *) targ=$out ;; + esac + +- echo $out: stmp-dirs ++ echo $out: stmp-dirs $prev_out + echo " $make_compile" \\ + echo ' LIBGCC2_CFLAGS="$(LIBGCC2_CFLAGS)' $flags '" ' \\ + echo ' MULTILIB_CFLAGS="'$flags'"' T=$t $targ + + all="$all $out" ++ prev_out="$out" + done + done + diff --git a/sys-devel/gcc/files/3.2.3/gcc323-gentoo-branding.patch b/sys-devel/gcc/files/3.2.3/gcc323-gentoo-branding.patch new file mode 100644 index 0000000..65fc1b5 --- /dev/null +++ b/sys-devel/gcc/files/3.2.3/gcc323-gentoo-branding.patch @@ -0,0 +1,42 @@ +diff -Naurp gcc-3.2.3.orig/gcc/ada/gnatvsn.ads gcc-3.2.3/gcc/ada/gnatvsn.ads +--- gcc-3.2.3.orig/gcc/ada/gnatvsn.ads 2003-04-22 02:16:06.000000000 -0400 ++++ gcc-3.2.3/gcc/ada/gnatvsn.ads 2003-04-26 12:20:22.000000000 -0400 +@@ -38,7 +38,7 @@ + + package Gnatvsn is + +- Gnat_Version_String : constant String := "3.2.3 20030422 (release)"; ++ Gnat_Version_String : constant String := "3.2.3 20030422 (Gentoo 1.4)"; + -- Version output when GNAT (compiler), or its related tools, including + -- GNATBIND, GNATCHOP, GNATFIND, GNATLINK, GNATMAKE, GNATXREF, are run + -- (with appropriate verbose option switch set). +diff -Naurp gcc-3.2.3.orig/gcc/f/version.c gcc-3.2.3/gcc/f/version.c +--- gcc-3.2.3.orig/gcc/f/version.c 2003-04-22 02:16:09.000000000 -0400 ++++ gcc-3.2.3/gcc/f/version.c 2003-04-26 12:25:38.000000000 -0400 +@@ -1,4 +1,4 @@ + #include "ansidecl.h" + #include "f/version.h" + +-const char *const ffe_version_string = "3.2.3 20030422 (release)"; ++const char *const ffe_version_string = "3.2.3 20030422 (Gentoo Linux 1.4 @PV@)"; +diff -Naurp gcc-3.2.3.orig/gcc/system.h gcc-3.2.3/gcc/system.h +--- gcc-3.2.3.orig/gcc/system.h 2003-03-30 20:14:02.000000000 -0500 ++++ gcc-3.2.3/gcc/system.h 2003-04-26 12:24:55.000000000 -0400 +@@ -26,7 +26,7 @@ Software Foundation, 59 Temple Place - S + /* This is the location of the online document giving information how + to report bugs. If you change this string, also check for strings + not under control of the preprocessor. */ +-#define GCCBUGURL "<URL:http://gcc.gnu.org/bugs.html>" ++#define GCCBUGURL "<URL:http://bugs.gentoo.org/>" + + /* We must include stdarg.h/varargs.h before stdio.h. */ + #ifdef ANSI_PROTOTYPES +diff -Naurp gcc-3.2.3.orig/gcc/version.c gcc-3.2.3/gcc/version.c +--- gcc-3.2.3.orig/gcc/version.c 2003-04-22 02:16:03.000000000 -0400 ++++ gcc-3.2.3/gcc/version.c 2003-04-26 12:25:28.000000000 -0400 +@@ -1,4 +1,4 @@ + #include "ansidecl.h" + #include "version.h" + +-const char *const version_string = "3.2.3"; ++const char *const version_string = "3.2.3 20030422 (Gentoo Linux 1.4 @PV@)"; diff --git a/sys-devel/gcc/files/3.2.3/gcc323-hppa-default_assemble_visibility.patch b/sys-devel/gcc/files/3.2.3/gcc323-hppa-default_assemble_visibility.patch new file mode 100644 index 0000000..d968487 --- /dev/null +++ b/sys-devel/gcc/files/3.2.3/gcc323-hppa-default_assemble_visibility.patch @@ -0,0 +1,17 @@ +diff -u -r -N gcc-3.2.3.orig/gcc/output.h gcc-3.2.3/gcc/output.h +--- gcc-3.2.3.orig/gcc/output.h 2003-07-14 17:55:33.000000000 +0200 ++++ gcc-3.2.3/gcc/output.h 2003-07-14 17:58:16.000000000 +0200 +@@ -257,8 +257,13 @@ + + extern void assemble_alias PARAMS ((tree, tree)); + ++#endif ++ ++/* hppa breaks when this is put into TREE_CODE */ + extern void default_assemble_visibility PARAMS ((tree, const char *)); + ++#ifdef TREE_CODE ++ + /* Output a string of literal assembler code + for an `asm' keyword used between functions. */ + extern void assemble_asm PARAMS ((tree)); diff --git a/sys-devel/gcc/files/3.3.4/libffi-without-libgcj.patch b/sys-devel/gcc/files/3.3.4/libffi-without-libgcj.patch new file mode 100644 index 0000000..507d42f --- /dev/null +++ b/sys-devel/gcc/files/3.3.4/libffi-without-libgcj.patch @@ -0,0 +1,22 @@ +--- configure.in.old 2004-06-26 07:01:06.000000000 +0200 ++++ configure.in 2004-06-26 07:02:55.000000000 +0200 +@@ -52,8 +52,7 @@ + host_tools="texinfo byacc flex bison binutils ld gas gcc sid sim gdb make patch prms send-pr gprof etc expect dejagnu ash bash bzip2 m4 autoconf automake libtool grep diff rcs fileutils shellutils time textutils wdiff find uudecode hello tar gzip indent recode release sed utils guile perl gawk findutils snavigator libtool gettext zip fastjar" + + # libgcj represents the runtime libraries only used by gcj. +-libgcj="target-libffi \ +- target-boehm-gc \ ++libgcj="target-boehm-gc \ + target-zlib \ + target-qthreads \ + target-libjava" +@@ -66,7 +65,8 @@ + target-newlib \ + ${libstdcxx_version} \ + target-libf2c \ +- ${libgcj} ++ ${libgcj} \ ++ target-libffi \ + target-libobjc" + + # these tools are built using the target libs, and are intended to run only diff --git a/sys-devel/gcc/files/3.3.6/gcc-3.3.6-cross-compile.patch b/sys-devel/gcc/files/3.3.6/gcc-3.3.6-cross-compile.patch new file mode 100644 index 0000000..ff9b42b --- /dev/null +++ b/sys-devel/gcc/files/3.3.6/gcc-3.3.6-cross-compile.patch @@ -0,0 +1,62 @@ +Some notes on the 'bootstrap with or without libc headers' debate: +http://linuxfromscratch.org/pipermail/lfs-dev/2005-July/052409.html +http://gcc.gnu.org/ml/gcc/2005-07/msg01195.html + +--- gcc/configure.in ++++ gcc/configure.in +@@ -1276,8 +1276,9 @@ + # This prevents libgcc2 from containing any code which requires libc + # support. + inhibit_libc= +-if { test x$host != x$target && test "x$with_headers" = x && +- test "x$with_sysroot" = x ; } || test x$with_newlib = xyes ; then ++if { { test x$host != x$target && test "x$with_sysroot" = x ; } || ++ test x$with_newlib = xyes ; } && ++ { test "x$with_headers" = x || test "x$with_headers" = xno ; } ; then + inhibit_libc=-Dinhibit_libc + fi + AC_SUBST(inhibit_libc) +--- gcc/configure ++++ gcc/configure +@@ -1276,8 +1276,9 @@ + # This prevents libgcc2 from containing any code which requires libc + # support. + inhibit_libc= +-if { test x$host != x$target && test "x$with_headers" = x && +- test "x$with_sysroot" = x ; } || test x$with_newlib = xyes ; then ++if { { test x$host != x$target && test "x$with_sysroot" = x ; } || ++ test x$with_newlib = xyes ; } && ++ { test "x$with_headers" = x || test "x$with_headers" = xno ; } ; then + inhibit_libc=-Dinhibit_libc + fi + AC_SUBST(inhibit_libc) +--- gcc/config/alpha/linux.h ++++ gcc/config/alpha/linux.h +@@ -72,6 +72,7 @@ + /* Do code reading to identify a signal frame, and set the frame + state data appropriately. See unwind-dw2.c for the structs. */ + ++#ifndef inhibit_libc + #ifdef IN_LIBGCC2 + #include <signal.h> + #include <sys/ucontext.h> +@@ -121,3 +122,4 @@ + (FS)->retaddr_column = 64; \ + goto SUCCESS; \ + } while (0) ++#endif /* inhibit_libc */ +--- gcc/config/i386/linux.h ++++ gcc/config/i386/linux.h +@@ -240,6 +240,7 @@ + /* Do code reading to identify a signal frame, and set the frame + state data appropriately. See unwind-dw2.c for the structs. */ + ++#ifndef inhibit_libc + #ifdef IN_LIBGCC2 + /* There's no sys/ucontext.h for some (all?) libc1, so no + signal-turned-exceptions for them. There's also no configure-run for +@@ -304,3 +305,4 @@ + } while (0) + #endif /* not USE_GNULIBC_1 */ + #endif /* IN_LIBGCC2 */ ++#endif /* inhibit_libc */ diff --git a/sys-devel/gcc/files/3.4.0/gcc-3.4.0-cc1-no-stack-protector.patch b/sys-devel/gcc/files/3.4.0/gcc-3.4.0-cc1-no-stack-protector.patch new file mode 100644 index 0000000..72bce28 --- /dev/null +++ b/sys-devel/gcc/files/3.4.0/gcc-3.4.0-cc1-no-stack-protector.patch @@ -0,0 +1,11 @@ +--- gcc/Makefile.in.mps 2004-06-01 22:06:17.000000000 +0200 ++++ gcc/Makefile.in 2004-06-01 22:06:56.000000000 +0200 +@@ -1845,7 +1845,7 @@ $(out_object_file): $(out_file) $(CONFIG + output.h $(INSN_ATTR_H) $(SYSTEM_H) toplev.h $(TARGET_H) libfuncs.h \ + $(TARGET_DEF_H) function.h sched-int.h $(TM_P_H) $(EXPR_H) $(OPTABS_H) \ + langhooks.h +- $(CC) -c $(ALL_CFLAGS) $(ALL_CPPFLAGS) $(INCLUDES) \ ++ $(CC) -c $(ALL_CFLAGS) -fno-stack-protector $(ALL_CPPFLAGS) $(INCLUDES) \ + $(out_file) $(OUTPUT_OPTION) + + # Build auxiliary files that support ecoff format. diff --git a/sys-devel/gcc/files/3.4.1/gcc-3.4.1-mips-n32only.patch b/sys-devel/gcc/files/3.4.1/gcc-3.4.1-mips-n32only.patch new file mode 100644 index 0000000..6fba12b --- /dev/null +++ b/sys-devel/gcc/files/3.4.1/gcc-3.4.1-mips-n32only.patch @@ -0,0 +1,17 @@ +Index: gcc/config/mips/t-linux64 +=================================================================== +RCS file: /cvsroot/gcc/gcc/gcc/config/mips/t-linux64,v +retrieving revision 1.3 +diff -u -r1.3 t-linux64 +--- gcc/config/mips/t-linux64 4 Jun 2003 05:35:15 -0000 1.3 ++++ gcc/config/mips/t-linux64 10 Aug 2004 18:26:26 -0000 +@@ -1,6 +1,6 @@ +-MULTILIB_OPTIONS = mabi=32/mabi=n32/mabi=64 +-MULTILIB_DIRNAMES = o32 32 64 +-MULTILIB_OSDIRNAMES = ../lib ../lib32 ../lib64 ++MULTILIB_OPTIONS = mabi=n32 ++MULTILIB_DIRNAMES = ++MULTILIB_OSDIRNAMES = + + EXTRA_MULTILIB_PARTS=crtbegin.o crtend.o crtbeginS.o crtendS.o crtbeginT.o + diff --git a/sys-devel/gcc/files/3.4.1/gcc-3.4.1-mips-n64only.patch b/sys-devel/gcc/files/3.4.1/gcc-3.4.1-mips-n64only.patch new file mode 100644 index 0000000..81baf62 --- /dev/null +++ b/sys-devel/gcc/files/3.4.1/gcc-3.4.1-mips-n64only.patch @@ -0,0 +1,17 @@ +Index: gcc/config/mips/t-linux64 +=================================================================== +RCS file: /cvsroot/gcc/gcc/gcc/config/mips/t-linux64,v +retrieving revision 1.3 +diff -u -r1.3 t-linux64 +--- gcc/config/mips/t-linux64 4 Jun 2003 05:35:15 -0000 1.3 ++++ gcc/config/mips/t-linux64 10 Aug 2004 18:26:53 -0000 +@@ -1,6 +1,6 @@ +-MULTILIB_OPTIONS = mabi=32/mabi=n32/mabi=64 +-MULTILIB_DIRNAMES = o32 32 64 +-MULTILIB_OSDIRNAMES = ../lib ../lib32 ../lib64 ++MULTILIB_OPTIONS = mabi=n64 ++MULTILIB_DIRNAMES = ++MULTILIB_OSDIRNAMES = + + EXTRA_MULTILIB_PARTS=crtbegin.o crtend.o crtbeginS.o crtendS.o crtbeginT.o + diff --git a/sys-devel/gcc/files/3.4.1/gcc-3.4.1-r2-gentoo-branding.patch b/sys-devel/gcc/files/3.4.1/gcc-3.4.1-r2-gentoo-branding.patch new file mode 100644 index 0000000..88c2cfa --- /dev/null +++ b/sys-devel/gcc/files/3.4.1/gcc-3.4.1-r2-gentoo-branding.patch @@ -0,0 +1,17 @@ +--- gcc/version.c.old 2004-05-20 05:20:46.352804640 -0400 ++++ gcc/version.c 2004-05-20 05:23:53.833303272 -0400 +@@ -5,7 +5,7 @@ + please modify this string to indicate that, e.g. by putting your + organization's name in parentheses at the end of the string. */ + +-const char version_string[] = "3.4.2 20040803 (prerelease)"; ++const char version_string[] = "3.4.1 @GENTOO@"; + + /* This is the location of the online document giving instructions for + reporting bugs. If you distribute a modified version of GCC, +@@ -14,4 +14,4 @@ + forward us bugs reported to you, if you determine that they are + not bugs in your modifications.) */ + +-const char bug_report_url[] = "<URL:http://gcc.gnu.org/bugs.html>"; ++const char bug_report_url[] = "<URL:http://bugs.gentoo.org/>"; diff --git a/sys-devel/gcc/files/3.4.2/gcc-3.4.2-mips-ip28_cache_barriers-v4.patch b/sys-devel/gcc/files/3.4.2/gcc-3.4.2-mips-ip28_cache_barriers-v4.patch new file mode 100644 index 0000000..02edc37 --- /dev/null +++ b/sys-devel/gcc/files/3.4.2/gcc-3.4.2-mips-ip28_cache_barriers-v4.patch @@ -0,0 +1,366 @@ +diff -Naurp gcc-3.4.6.orig/gcc/config/mips/mips.c gcc-3.4.6/gcc/config/mips/mips.c +--- gcc-3.4.6.orig/gcc/config/mips/mips.c 2005-07-31 04:35:15.000000000 -0400 ++++ gcc-3.4.6/gcc/config/mips/mips.c 2006-04-08 17:41:44.000000000 -0400 +@@ -8801,6 +8801,11 @@ mips_reorg (void) + dbr_schedule (get_insns (), rtl_dump_file); + mips_avoid_hazards (); + } ++ if (mips_r10k_cache_barrier) ++ { ++ static int r10k_insert_cache_barriers (void); ++ r10k_insert_cache_barriers (); ++ } + } + + /* We need to use a special set of functions to handle hard floating +@@ -9661,5 +9666,5 @@ irix_section_type_flags (tree decl, cons + } + + #endif /* TARGET_IRIX */ +- ++#include "r10k-cacheb.c" + #include "gt-mips.h" +diff -Naurp gcc-3.4.6.orig/gcc/config/mips/mips.h gcc-3.4.6/gcc/config/mips/mips.h +--- gcc-3.4.6.orig/gcc/config/mips/mips.h 2004-07-14 20:42:49.000000000 -0400 ++++ gcc-3.4.6/gcc/config/mips/mips.h 2006-04-08 17:41:01.000000000 -0400 +@@ -122,6 +122,7 @@ extern const char *mips_tune_string; + extern const char *mips_isa_string; /* for -mips{1,2,3,4} */ + extern const char *mips_abi_string; /* for -mabi={32,n32,64} */ + extern const char *mips_cache_flush_func;/* for -mflush-func= and -mno-flush-func */ ++extern const char *mips_r10k_cache_barrier;/* for -mr10k-cache-barrier[={1,2}] */ + extern int mips_string_length; /* length of strings for mips16 */ + extern const struct mips_cpu_info mips_cpu_info_table[]; + extern const struct mips_cpu_info *mips_arch_info; +@@ -752,6 +753,10 @@ extern const struct mips_cpu_info *mips_ + N_("Don't call any cache flush functions"), 0}, \ + { "flush-func=", &mips_cache_flush_func, \ + N_("Specify cache flush function"), 0}, \ ++ { "r10k-cache-barrier", &mips_r10k_cache_barrier, \ ++ N_("[=1|2]\tGenerate cache barriers for SGI Indigo2/O2 R10k"), 0}, \ ++ { "ip28-cache-barrier", &mips_r10k_cache_barrier, \ ++ N_(""), 0}, \ + } + + /* This is meant to be redefined in the host dependent files. */ +diff -Naurp gcc-3.4.6.orig/gcc/config/mips/r10k-cacheb.c gcc-3.4.6/gcc/config/mips/r10k-cacheb.c +--- gcc-3.4.6.orig/gcc/config/mips/r10k-cacheb.c 1969-12-31 19:00:00.000000000 -0500 ++++ gcc-3.4.6/gcc/config/mips/r10k-cacheb.c 2006-04-08 17:41:22.000000000 -0400 +@@ -0,0 +1,318 @@ ++/* Subroutines used for MIPS code generation: generate cache-barriers ++ for SiliconGraphics IP28 and IP32/R10000 kernel-code. ++ Copyright (C) 2005,2006 peter fuerst, pf@net.alphadv.de. ++ ++This file is intended to become part of GCC. ++ ++This file is free software; you can redistribute it and/or modify it ++under the terms of the GNU General Public License as published ++by the Free Software Foundation; either version 2, or (at your ++option) any later version. ++ ++This file is distributed in the hope that it will be useful, ++but WITHOUT ANY WARRANTY; without even the implied warranty of ++MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++GNU General Public License for more details. ++ ++You should have received a copy of the GNU General Public License ++along with GCC; see the file COPYING. If not, write to the ++Free Software Foundation, 51 Franklin Street, Fifth Floor, Boston, ++MA 02110-1301 USA. */ ++ ++ ++#define ASM_R10K_CACHE_BARRIER "cache 0x14,0($sp)" ++ ++/* Some macros, ported back from 4.x ... */ ++ ++#define CALL_P(X) (GET_CODE (X) == CALL_INSN) ++#define MEM_P(X) (GET_CODE (X) == MEM) ++#define NONJUMP_INSN_P(X) (GET_CODE (X) == INSN) ++ ++#define SEQ_BEGIN(insn) \ ++ (INSN_P (insn) && GET_CODE (PATTERN (insn)) == SEQUENCE \ ++ ? XVECEXP (PATTERN (insn), 0, 0) \ ++ : (insn)) ++ ++#define SEQ_END(insn) \ ++ (INSN_P (insn) && GET_CODE (PATTERN (insn)) == SEQUENCE \ ++ ? XVECEXP (PATTERN (insn), 0, XVECLEN (PATTERN (insn), 0) - 1) \ ++ : (insn)) ++ ++#define FOR_EACH_SUBINSN(subinsn, insn) \ ++ for ((subinsn) = SEQ_BEGIN (insn); \ ++ (subinsn) != NEXT_INSN (SEQ_END (insn)); \ ++ (subinsn) = NEXT_INSN (subinsn)) ++ ++ ++/* Nonzero means generate special cache barriers to inhibit speculative ++ stores which might endanger cache coherency or reference invalid ++ addresses (especially on SGI's Indigo2 R10k (IP28)). */ ++const char *mips_r10k_cache_barrier; ++static int TARGET_R10K_SPECEX; ++ ++/* Check, whether an instruction is a possibly harmful store instruction, ++ i.e. a store which might cause damage, if speculatively executed. */ ++ ++/* Return truth value whether the expression `*memx' instantiates ++ (mem:M (not (stackpointer_address or constant))). */ ++ ++static int ++is_stack_pointer (rtx *x, void *data) ++{ ++ return (*x == stack_pointer_rtx); ++} ++ ++static int ++check_p_mem_expr (rtx *memx, void *data) ++{ ++ if (!MEM_P (*memx) || for_each_rtx (memx, is_stack_pointer, 0)) ++ return 0; ++ ++ /* Stores/Loads to/from constant addresses can be considered ++ harmless, since: ++ 1) the address is always valid, even when taken speculatively. ++ 2a) the location is (hopefully) never used as a dma-target, thus ++ there is no danger of cache-inconsistency. ++ 2b) uncached loads/stores are guaranteed to be non-speculative. */ ++ if ( CONSTANT_P(XEXP (*memx, 0)) ) ++ return 0; ++ ++ return 1; ++} ++ ++/* Return truth value whether we find (set (mem:M (non_stackpointer_address) ++ ...)) in instruction-pattern `body'. ++ Here we assume, that addressing with the stackpointer accesses neither ++ uncached-aliased nor invalid memory. ++ (May be, this applies to the global pointer and frame pointer also, ++ but its saver not to assume it. And probably it's not worthwile to ++ regard these registers) ++ ++ Speculative loads from invalid addresses also cause bus errors... ++ So check for (set (reg:M ...) (mem:M (non_stackpointer_address))) ++ too, unless there is an enhanced bus-error handler. */ ++ ++static int ++check_p_pattern_for_store (rtx *body, void *data) ++{ ++ if (*body && GET_CODE (*body) == SET) ++ { ++ /* Cache-barriers for SET_SRC may be requested as well. */ ++ if (!(TARGET_R10K_SPECEX & 2)) ++ body = &SET_DEST(*body); ++ ++ if (for_each_rtx (body, check_p_mem_expr, 0)) ++ return 1; ++ ++ /* Don't traverse sub-expressions again. */ ++ return -1; ++ } ++ return 0; ++} ++ ++static int ++strmatch (const char *txt, const char *match) ++{ ++ return !strncmp(txt, match, strlen (match)); ++} ++ ++/* Check for (ins (set (mem:M (dangerous_address)) ...)) or end of the ++ current basic block in instruction `insn'. ++ `state': (internal) recursion-counter and delayslot-flag ++ Criteria to recognize end-of/next basic-block are reduplicated here ++ from final_scan_insn. ++ return >0: `insn' is critical. ++ return <0: `insn' is at end of current basic-block. ++ return 0: `insn' can be ignored. */ ++ ++static int ++check_insn_for_store (int state, rtx insn) ++{ ++ rtx body; ++ ++ if (INSN_DELETED_P (insn)) ++ return 0; ++ ++ if (LABEL_P (insn)) ++ return -1; ++ ++ if (CALL_P (insn) || JUMP_P (insn) || NONJUMP_INSN_P (insn)) ++ { ++ body = PATTERN (insn); ++ if (GET_CODE (body) == SEQUENCE) ++ { ++ /* A delayed-branch sequence. */ ++ rtx insq; ++ FOR_EACH_SUBINSN(insq, insn) ++ if (! INSN_DELETED_P (insq)) ++ { ++ /* |1: delay-slot completely contained in sequence. */ ++ if (check_insn_for_store (8+state|1, insq) > 0) ++ return 1; ++ } ++ /* Following a (conditional) branch sequence, we have a new ++ basic block. */ ++ if (JUMP_P (SEQ_BEGIN(insn))) ++ return -1; ++ /* Handle a call sequence like a conditional branch sequence. */ ++ if (CALL_P (SEQ_BEGIN(insn))) ++ return -1; ++ } ++ if (GET_CODE (body) == PARALLEL) ++ if (for_each_rtx (&body, check_p_pattern_for_store, 0)) ++ return 1; ++ ++ /* Now, only a `simple' INSN or JUMP_INSN remains to be checked. */ ++ if (NONJUMP_INSN_P (insn)) ++ { ++ /* Since we don't know what's inside, we must take inline ++ assembly to be dangerous. */ ++ if (GET_CODE (body) == ASM_INPUT) ++ { ++ const char *t = XSTR (body, 0); ++ if (t && !strmatch(t, ASM_R10K_CACHE_BARRIER)) ++ return 1; ++ } ++ ++ if (check_p_pattern_for_store (&body, 0) > 0) ++ return 1; ++ } ++ /* Handle a CALL_INSN instruction like a conditional branch. */ ++ if (JUMP_P (insn) || CALL_P (insn)) ++ { ++ /* Following a (conditional) branch, we have a new basic block. */ ++ /* But check insn(s) in delay-slot first. If we could know in ++ advance that this jump is in `.reorder' mode, where gas will ++ insert a `nop' into the delay-slot, we could skip this test. ++ Since we don't know, always assume `.noreorder', sometimes ++ emitting a cache-barrier, that isn't needed. */ ++ /* But if we are here recursively, already checking a (pseudo-) ++ delay-slot, we are done. */ ++ if ( !(state & 1) ) ++ for (insn = NEXT_INSN (insn); insn; insn = NEXT_INSN (insn)) ++ { ++ if (LABEL_P (insn) || CALL_P (insn) || JUMP_P (insn)) ++ /* Not in delay-slot at all. */ ++ break; ++ ++ if (NONJUMP_INSN_P (insn)) ++ { ++ if (GET_CODE (PATTERN (insn)) == SEQUENCE) ++ /* Not in delay-slot at all. */ ++ break; ++ ++ if (check_insn_for_store (8+state|1, insn) > 0) ++ return 1; ++ /* We're done anyway. */ ++ break; ++ } ++ /* skip NOTE,... */; ++ } ++ return -1; ++ } ++ } ++ return 0; ++} ++ ++ ++/* Scan a basic block, starting with `insn', for a possibly harmful store ++ instruction. If found, output a cache barrier at the start of this ++ block. */ ++ ++static int ++bb_insert_store_cache_barrier (rtx head, rtx nxtb) ++{ ++ rtx insn = head; ++ ++ if (!insn || insn == nxtb) ++ return 0; ++ ++ while ((insn = NEXT_INSN (insn)) && insn != nxtb) ++ { ++ int found; ++ ++ if (NOTE_INSN_BASIC_BLOCK_P(insn)) /* See scan_1_bb_for_store() */ ++ break; ++ ++ found = check_insn_for_store (0, insn); ++ if (found < 0) ++ break; ++ if (found > 0) ++ { ++ /* found critical store instruction */ ++ insn = gen_rtx_ASM_INPUT (VOIDmode, ++ ASM_R10K_CACHE_BARRIER "\t" ++ ASM_COMMENT_START " Cache Barrier"); ++ /* Here we rely on the assumption, that an explicit delay-slot ++ - if any - is already embedded (in a sequence) in 'head'! */ ++ insn = emit_insn_after (insn, head); ++ return 1; ++ } ++ } ++ return 0; ++} ++ ++ ++/* Scan one basic block for a possibly harmful store instruction. ++ If found, insert a cache barrier at the start of this block, ++ return number of inserted cache_barriers. */ ++ ++static int ++scan_1_bb_for_store (rtx head, rtx end) ++{ ++ rtx nxtb; ++ int count; ++ ++ /* Note: 'end' is not necessarily reached from 'head' (hidden in ++ SEQUENCE, PARALLEL), but 'nxtb' is. */ ++ nxtb = NEXT_INSN (end); ++ ++ /* Each basic block starts with zero or more CODE_LABEL(s), followed ++ by one NOTE_INSN_BASIC_BLOCK. ++ Note: bb_head may equal next_insn(bb_end) already ! */ ++ while (head && head != nxtb && LABEL_P (head)) ++ head = NEXT_INSN (head); ++ ++ if (!head || head == nxtb) ++ return 0; ++ ++ /* Handle the basic block itself, at most up to next CALL_INSN. */ ++ count = bb_insert_store_cache_barrier (head, nxtb); ++ ++ /* 1) Handle any CALL_INSN instruction like a conditional branch. ++ 2) There may be "basic blocks" in the list, which are no basic blocks ++ at all. (containing CODE_LABELs in the body or gathering several ++ other basic blocks (e.g. bb5 containing bb6,bb7,bb8)). */ ++ ++ while ((head = NEXT_INSN (head)) && head != nxtb) ++ { ++ if (INSN_DELETED_P (head)) ++ continue; ++ ++ /* Later we'll be called again for this bb on its own. */ ++ if (NOTE_INSN_BASIC_BLOCK_P(head)) ++ break; ++ ++ if (CALL_P (SEQ_BEGIN (head)) || LABEL_P (head)) ++ count += bb_insert_store_cache_barrier (head, nxtb); ++ } ++ return count; ++} ++ ++static int ++r10k_insert_cache_barriers (void) ++{ ++ if (mips_r10k_cache_barrier) ++ { ++ basic_block bb; ++ ++ const char *s = mips_r10k_cache_barrier; ++ /* Default is to protect stores (only). */ ++ TARGET_R10K_SPECEX = 1 | strtol(*s != '=' ? s:s+1, (char**)0, 0); ++ ++ FOR_EACH_BB (bb) ++ if (0 <= bb->index) ++ scan_1_bb_for_store (BB_HEAD (bb), BB_END (bb)); ++ } ++ return 0; ++} diff --git a/sys-devel/gcc/files/3.4.2/gcc-3.4.x-mips-add-march-r10k.patch b/sys-devel/gcc/files/3.4.2/gcc-3.4.x-mips-add-march-r10k.patch new file mode 100644 index 0000000..d02a5e9 --- /dev/null +++ b/sys-devel/gcc/files/3.4.2/gcc-3.4.x-mips-add-march-r10k.patch @@ -0,0 +1,460 @@ +diff -Naurp gcc-3.4.1.orig/gcc/config/mips/mips.c gcc-3.4.1/gcc/config/mips/mips.c +--- gcc-3.4.1.orig/gcc/config/mips/mips.c 2004-06-28 09:58:42.000000000 -0400 ++++ gcc-3.4.1/gcc/config/mips/mips.c 2004-08-09 22:37:21.983939192 -0400 +@@ -707,6 +707,7 @@ const struct mips_cpu_info mips_cpu_info + + /* MIPS IV */ + { "r8000", PROCESSOR_R8000, 4 }, ++ { "r10000", PROCESSOR_R10000, 4 }, + { "vr5000", PROCESSOR_R5000, 4 }, + { "vr5400", PROCESSOR_R5400, 4 }, + { "vr5500", PROCESSOR_R5500, 4 }, +@@ -9401,6 +9402,9 @@ mips_issue_rate (void) + { + switch (mips_tune) + { ++ case PROCESSOR_R10000: ++ return 4; ++ + case PROCESSOR_R5400: + case PROCESSOR_R5500: + case PROCESSOR_R7000: +diff -Naurp gcc-3.4.1.orig/gcc/config/mips/mips.h gcc-3.4.1/gcc/config/mips/mips.h +--- gcc-3.4.1.orig/gcc/config/mips/mips.h 2004-03-11 16:52:33.000000000 -0500 ++++ gcc-3.4.1/gcc/config/mips/mips.h 2004-08-09 01:02:35.042149496 -0400 +@@ -66,6 +66,7 @@ enum processor_type { + PROCESSOR_R7000, + PROCESSOR_R8000, + PROCESSOR_R9000, ++ PROCESSOR_R10000, + PROCESSOR_SB1, + PROCESSOR_SR71000 + }; +diff -Naurp gcc-3.4.1.orig/gcc/config/mips/mips.md gcc-3.4.1/gcc/config/mips/mips.md +--- gcc-3.4.1.orig/gcc/config/mips/mips.md 2004-06-25 03:35:30.000000000 -0400 ++++ gcc-3.4.1/gcc/config/mips/mips.md 2004-08-09 04:55:10.158649320 -0400 +@@ -103,6 +103,7 @@ + ;; arith integer arithmetic instruction + ;; darith double precision integer arithmetic instructions + ;; const load constant ++;; shift integer shift + ;; imul integer multiply + ;; imadd integer multiply-add + ;; idiv integer divide +@@ -120,7 +121,7 @@ + ;; multi multiword sequence (or user asm statements) + ;; nop no operation + (define_attr "type" +- "unknown,branch,jump,call,load,store,prefetch,prefetchx,move,condmove,xfer,hilo,const,arith,darith,imul,imadd,idiv,icmp,fadd,fmul,fmadd,fdiv,fabs,fneg,fcmp,fcvt,fsqrt,frsqrt,multi,nop" ++ "unknown,branch,jump,call,load,store,prefetch,prefetchx,move,condmove,xfer,hilo,const,arith,darith,shift,imul,imadd,idiv,icmp,fadd,fmul,fmadd,fdiv,fabs,fneg,fcmp,fcvt,fsqrt,frsqrt,multi,nop" + (cond [(eq_attr "jal" "!unset") (const_string "call") + (eq_attr "got" "load") (const_string "load")] + (const_string "unknown"))) +@@ -214,7 +215,7 @@ + ;; Attribute describing the processor. This attribute must match exactly + ;; with the processor_type enumeration in mips.h. + (define_attr "cpu" +- "default,4kc,5kc,20kc,m4k,r3000,r3900,r6000,r4000,r4100,r4111,r4120,r4300,r4600,r4650,r5000,r5400,r5500,r7000,r8000,r9000,sb1,sr71000" ++ "default,4kc,5kc,20kc,m4k,r3000,r3900,r6000,r4000,r4100,r4111,r4120,r4300,r4600,r4650,r5000,r5400,r5500,r7000,r8000,r9000,r10000,sb1,sr71000" + (const (symbol_ref "mips_tune"))) + + ;; The type of hardware hazard associated with this instruction. +@@ -305,12 +306,12 @@ + + (define_function_unit "memory" 1 0 + (and (eq_attr "type" "load") +- (eq_attr "cpu" "!r3000,r3900,r4600,r4650,r4100,r4120,r4300,r5000")) ++ (eq_attr "cpu" "!r3000,r3900,r4600,r4650,r4100,r4120,r4300,r5000,r10000")) + 3 0) + + (define_function_unit "memory" 1 0 + (and (eq_attr "type" "load") +- (eq_attr "cpu" "r3000,r3900,r4600,r4650,r4100,r4120,r4300,r5000")) ++ (eq_attr "cpu" "r3000,r3900,r4600,r4650,r4100,r4120,r4300,r5000,r10000")) + 2 0) + + (define_function_unit "memory" 1 0 (eq_attr "type" "store") 1 0) +@@ -323,7 +324,7 @@ + + (define_function_unit "imuldiv" 1 0 + (and (eq_attr "type" "imul,imadd") +- (eq_attr "cpu" "!r3000,r3900,r4000,r4600,r4650,r4100,r4120,r4300,r5000")) ++ (eq_attr "cpu" "!r3000,r3900,r4000,r4600,r4650,r4100,r4120,r4300,r5000,r10000")) + 17 17) + + ;; On them mips16, we want to stronly discourage a mult from appearing +@@ -375,7 +376,7 @@ + + (define_function_unit "imuldiv" 1 0 + (and (eq_attr "type" "idiv") +- (eq_attr "cpu" "!r3000,r3900,r4000,r4600,r4650,r4100,r4120,r4300,r5000")) ++ (eq_attr "cpu" "!r3000,r3900,r4000,r4600,r4650,r4100,r4120,r4300,r5000,r10000")) + 38 38) + + (define_function_unit "imuldiv" 1 0 +@@ -424,6 +425,40 @@ + (and (eq_attr "mode" "DI") (eq_attr "cpu" "r5000"))) + 68 68) + ++;; R10000 has 2 integer ALUs ++(define_function_unit "alu" 2 0 ++ (and (eq_attr "type" "arith,darith,shift") ++ (eq_attr "cpu" "r10000")) ++ 1 0) ++ ++;; Only ALU1 can do shifts. We model shifts as an additional unit ++(define_function_unit "alu1" 1 0 ++ (and (eq_attr "type" "shift") ++ (eq_attr "cpu" "r10000")) ++ 1 0) ++ ++;; only ALU2 does multiplications and divisions ++(define_function_unit "alu2" 1 0 ++ (and (eq_attr "type" "imul") ++ (and (eq_attr "mode" "SI") (eq_attr "cpu" "r10000"))) ++ 6 6) ++ ++(define_function_unit "alu2" 1 0 ++ (and (eq_attr "type" "imul") ++ (and (eq_attr "mode" "DI") (eq_attr "cpu" "r10000"))) ++ 10 10) ++ ++(define_function_unit "alu2" 1 0 ++ (and (eq_attr "type" "idiv") ++ (and (eq_attr "mode" "SI") (eq_attr "cpu" "r10000"))) ++ 35 35) ++ ++(define_function_unit "alu2" 1 0 ++ (and (eq_attr "type" "idiv") ++ (and (eq_attr "mode" "DI") (eq_attr "cpu" "r10000"))) ++ 67 67) ++ ++ + ;; The R4300 does *NOT* have a separate Floating Point Unit, instead + ;; the FP hardware is part of the normal ALU circuitry. This means FP + ;; instructions affect the pipe-line, and no functional unit +@@ -432,11 +467,11 @@ + ;; instructions to be processed in the "imuldiv" unit. + + (define_function_unit "adder" 1 1 +- (and (eq_attr "type" "fcmp") (eq_attr "cpu" "!r3000,r3900,r6000,r4300,r5000")) ++ (and (eq_attr "type" "fcmp") (eq_attr "cpu" "!r3000,r3900,r6000,r4300,r5000,r10000")) + 3 0) + + (define_function_unit "adder" 1 1 +- (and (eq_attr "type" "fcmp") (eq_attr "cpu" "r3000,r3900,r6000")) ++ (and (eq_attr "type" "fcmp") (eq_attr "cpu" "r3000,r3900,r6000,r10000")) + 2 0) + + (define_function_unit "adder" 1 1 +@@ -444,7 +479,7 @@ + 1 0) + + (define_function_unit "adder" 1 1 +- (and (eq_attr "type" "fadd") (eq_attr "cpu" "!r3000,r3900,r6000,r4300")) ++ (and (eq_attr "type" "fadd") (eq_attr "cpu" "!r3000,r3900,r6000,r4300,r10000")) + 4 0) + + (define_function_unit "adder" 1 1 +@@ -456,6 +491,10 @@ + 3 0) + + (define_function_unit "adder" 1 1 ++ (and (eq_attr "type" "fadd,fmadd") (eq_attr "cpu" "r10000")) ++ 2 0) ++ ++(define_function_unit "adder" 1 1 + (and (eq_attr "type" "fabs,fneg") + (eq_attr "cpu" "!r3000,r3900,r4600,r4650,r4300,r5000")) + 2 0) +@@ -467,7 +506,7 @@ + (define_function_unit "mult" 1 1 + (and (eq_attr "type" "fmul") + (and (eq_attr "mode" "SF") +- (eq_attr "cpu" "!r3000,r3900,r6000,r4600,r4650,r4300,r5000"))) ++ (eq_attr "cpu" "!r3000,r3900,r6000,r4600,r4650,r4300,r5000,r10000"))) + 7 0) + + (define_function_unit "mult" 1 1 +@@ -487,7 +526,7 @@ + + (define_function_unit "mult" 1 1 + (and (eq_attr "type" "fmul") +- (and (eq_attr "mode" "DF") (eq_attr "cpu" "!r3000,r3900,r6000,r4300,r5000"))) ++ (and (eq_attr "mode" "DF") (eq_attr "cpu" "!r3000,r3900,r6000,r4300,r5000,r10000"))) + 8 0) + + (define_function_unit "mult" 1 1 +@@ -500,10 +539,14 @@ + (and (eq_attr "mode" "DF") (eq_attr "cpu" "r6000"))) + 6 0) + ++(define_function_unit "mult" 1 1 ++ (and (eq_attr "type" "fmul,fmadd") (eq_attr "cpu" "r10000")) ++ 2 0) ++ + (define_function_unit "divide" 1 1 + (and (eq_attr "type" "fdiv") + (and (eq_attr "mode" "SF") +- (eq_attr "cpu" "!r3000,r3900,r6000,r4600,r4650,r4300,r5000"))) ++ (eq_attr "cpu" "!r3000,r3900,r6000,r4600,r4650,r4300,r5000,r10000"))) + 23 0) + + (define_function_unit "divide" 1 1 +@@ -529,7 +572,7 @@ + (define_function_unit "divide" 1 1 + (and (eq_attr "type" "fdiv") + (and (eq_attr "mode" "DF") +- (eq_attr "cpu" "!r3000,r3900,r6000,r4600,r4650,r4300"))) ++ (eq_attr "cpu" "!r3000,r3900,r6000,r4600,r4650,r4300,r10000"))) + 36 0) + + (define_function_unit "divide" 1 1 +@@ -547,10 +590,21 @@ + (and (eq_attr "mode" "DF") (eq_attr "cpu" "r4600,r4650"))) + 61 0) + ++;; divisions keep multiplier busy on R10000 ++(define_function_unit "mult" 1 1 ++ (and (eq_attr "type" "fdiv") ++ (and (eq_attr "mode" "SF") (eq_attr "cpu" "r10000"))) ++ 12 14) ++ ++(define_function_unit "mult" 1 1 ++ (and (eq_attr "type" "fdiv") ++ (and (eq_attr "mode" "DF") (eq_attr "cpu" "r10000"))) ++ 19 21) ++ + ;;; ??? Is this number right? + (define_function_unit "divide" 1 1 + (and (eq_attr "type" "fsqrt,frsqrt") +- (and (eq_attr "mode" "SF") (eq_attr "cpu" "!r4600,r4650,r4300,r5000"))) ++ (and (eq_attr "mode" "SF") (eq_attr "cpu" "!r4600,r4650,r4300,r5000,r10000"))) + 54 0) + + (define_function_unit "divide" 1 1 +@@ -566,7 +620,7 @@ + ;;; ??? Is this number right? + (define_function_unit "divide" 1 1 + (and (eq_attr "type" "fsqrt,frsqrt") +- (and (eq_attr "mode" "DF") (eq_attr "cpu" "!r4600,r4650,r4300,r5000"))) ++ (and (eq_attr "mode" "DF") (eq_attr "cpu" "!r4600,r4650,r4300,r5000,r10000"))) + 112 0) + + (define_function_unit "divide" 1 1 +@@ -579,6 +633,17 @@ + (and (eq_attr "mode" "DF") (eq_attr "cpu" "r5000"))) + 36 0) + ++;; sqrt is executed by multiplier on R10000 ++(define_function_unit "mult" 1 1 ++ (and (eq_attr "type" "fsqrt") ++ (and (eq_attr "mode" "SF") (eq_attr "cpu" "r10000"))) ++ 18 20) ++ ++(define_function_unit "mult" 1 1 ++ (and (eq_attr "type" "fsqrt") ++ (and (eq_attr "mode" "DF") (eq_attr "cpu" "r10000"))) ++ 33 35) ++ + ;; R4300 FP instruction classes treated as part of the "imuldiv" + ;; functional unit: + +@@ -3157,7 +3222,7 @@ dsrl\t%3,%3,1\n\ + "@ + sll\t%0,%1,0 + sw\t%1,%0" +- [(set_attr "type" "darith,store") ++ [(set_attr "type" "shift,store") + (set_attr "mode" "SI") + (set_attr "extended_mips16" "yes,*")]) + +@@ -3191,7 +3256,7 @@ dsrl\t%3,%3,1\n\ + (match_operand:DI 2 "small_int" "I"))))] + "TARGET_64BIT && !TARGET_MIPS16 && INTVAL (operands[2]) >= 32" + "dsra\t%0,%1,%2" +- [(set_attr "type" "darith") ++ [(set_attr "type" "shift") + (set_attr "mode" "SI")]) + + (define_insn "" +@@ -3200,7 +3265,7 @@ dsrl\t%3,%3,1\n\ + (const_int 32))))] + "TARGET_64BIT && !TARGET_MIPS16" + "dsra\t%0,%1,32" +- [(set_attr "type" "darith") ++ [(set_attr "type" "shift") + (set_attr "mode" "SI")]) + + +@@ -5241,7 +5306,7 @@ dsrl\t%3,%3,1\n\ + + return "sll\t%0,%1,%2"; + } +- [(set_attr "type" "arith") ++ [(set_attr "type" "shift") + (set_attr "mode" "SI")]) + + (define_insn "ashlsi3_internal1_extend" +@@ -5255,7 +5320,7 @@ dsrl\t%3,%3,1\n\ + + return "sll\t%0,%1,%2"; + } +- [(set_attr "type" "arith") ++ [(set_attr "type" "shift") + (set_attr "mode" "DI")]) + + +@@ -5273,7 +5338,7 @@ dsrl\t%3,%3,1\n\ + + return "sll\t%0,%1,%2"; + } +- [(set_attr "type" "arith") ++ [(set_attr "type" "shift") + (set_attr "mode" "SI") + (set_attr_alternative "length" + [(const_int 4) +@@ -5374,7 +5439,7 @@ sll\t%L0,%L1,%2\n\ + operands[2] = GEN_INT (INTVAL (operands[2]) & 0x1f); + return "sll\t%M0,%L1,%2\;move\t%L0,%."; + } +- [(set_attr "type" "darith") ++ [(set_attr "type" "shift") + (set_attr "mode" "DI") + (set_attr "length" "8")]) + +@@ -5429,7 +5494,7 @@ sll\t%L0,%L1,%2\n\ + + return "sll\t%M0,%M1,%2\;srl\t%3,%L1,%4\;or\t%M0,%M0,%3\;sll\t%L0,%L1,%2"; + } +- [(set_attr "type" "darith") ++ [(set_attr "type" "shift") + (set_attr "mode" "DI") + (set_attr "length" "16")]) + +@@ -5513,7 +5578,7 @@ sll\t%L0,%L1,%2\n\ + + return "dsll\t%0,%1,%2"; + } +- [(set_attr "type" "arith") ++ [(set_attr "type" "shift") + (set_attr "mode" "DI")]) + + (define_insn "" +@@ -5530,7 +5595,7 @@ sll\t%L0,%L1,%2\n\ + + return "dsll\t%0,%1,%2"; + } +- [(set_attr "type" "arith") ++ [(set_attr "type" "shift") + (set_attr "mode" "DI") + (set_attr_alternative "length" + [(const_int 4) +@@ -5591,7 +5656,7 @@ sll\t%L0,%L1,%2\n\ + + return "sra\t%0,%1,%2"; + } +- [(set_attr "type" "arith") ++ [(set_attr "type" "shift") + (set_attr "mode" "SI")]) + + (define_insn "ashrsi3_internal2" +@@ -5608,7 +5673,7 @@ sll\t%L0,%L1,%2\n\ + + return "sra\t%0,%1,%2"; + } +- [(set_attr "type" "arith") ++ [(set_attr "type" "shift") + (set_attr "mode" "SI") + (set_attr_alternative "length" + [(const_int 4) +@@ -5705,7 +5770,7 @@ sra\t%M0,%M1,%2\n\ + operands[2] = GEN_INT (INTVAL (operands[2]) & 0x1f); + return "sra\t%L0,%M1,%2\;sra\t%M0,%M1,31"; + } +- [(set_attr "type" "darith") ++ [(set_attr "type" "shift") + (set_attr "mode" "DI") + (set_attr "length" "8")]) + +@@ -5760,7 +5825,7 @@ sra\t%M0,%M1,%2\n\ + + return "srl\t%L0,%L1,%2\;sll\t%3,%M1,%4\;or\t%L0,%L0,%3\;sra\t%M0,%M1,%2"; + } +- [(set_attr "type" "darith") ++ [(set_attr "type" "shift") + (set_attr "mode" "DI") + (set_attr "length" "16")]) + +@@ -5844,7 +5909,7 @@ sra\t%M0,%M1,%2\n\ + + return "dsra\t%0,%1,%2"; + } +- [(set_attr "type" "arith") ++ [(set_attr "type" "shift") + (set_attr "mode" "DI")]) + + (define_insn "" +@@ -5858,7 +5923,7 @@ sra\t%M0,%M1,%2\n\ + + return "dsra\t%0,%2"; + } +- [(set_attr "type" "arith") ++ [(set_attr "type" "shift") + (set_attr "mode" "DI") + (set_attr_alternative "length" + [(const_int 4) +@@ -5918,7 +5983,7 @@ sra\t%M0,%M1,%2\n\ + + return "srl\t%0,%1,%2"; + } +- [(set_attr "type" "arith") ++ [(set_attr "type" "shift") + (set_attr "mode" "SI")]) + + (define_insn "lshrsi3_internal2" +@@ -5935,7 +6000,7 @@ sra\t%M0,%M1,%2\n\ + + return "srl\t%0,%1,%2"; + } +- [(set_attr "type" "arith") ++ [(set_attr "type" "shift") + (set_attr "mode" "SI") + (set_attr_alternative "length" + [(const_int 4) +@@ -6056,7 +6121,7 @@ srl\t%M0,%M1,%2\n\ + operands[2] = GEN_INT (INTVAL (operands[2]) & 0x1f); + return "srl\t%L0,%M1,%2\;move\t%M0,%."; + } +- [(set_attr "type" "darith") ++ [(set_attr "type" "shift") + (set_attr "mode" "DI") + (set_attr "length" "8")]) + +@@ -6111,7 +6176,7 @@ srl\t%M0,%M1,%2\n\ + + return "srl\t%L0,%L1,%2\;sll\t%3,%M1,%4\;or\t%L0,%L0,%3\;srl\t%M0,%M1,%2"; + } +- [(set_attr "type" "darith") ++ [(set_attr "type" "shift") + (set_attr "mode" "DI") + (set_attr "length" "16")]) + +@@ -6195,7 +6260,7 @@ srl\t%M0,%M1,%2\n\ + + return "dsrl\t%0,%1,%2"; + } +- [(set_attr "type" "arith") ++ [(set_attr "type" "shift") + (set_attr "mode" "DI")]) + + (define_insn "" +@@ -6209,7 +6274,7 @@ srl\t%M0,%M1,%2\n\ + + return "dsrl\t%0,%2"; + } +- [(set_attr "type" "arith") ++ [(set_attr "type" "shift") + (set_attr "mode" "DI") + (set_attr_alternative "length" + [(const_int 4) diff --git a/sys-devel/gcc/files/3.4.3/libffi-nogcj-lib-path-fix.patch b/sys-devel/gcc/files/3.4.3/libffi-nogcj-lib-path-fix.patch new file mode 100644 index 0000000..b5195e4 --- /dev/null +++ b/sys-devel/gcc/files/3.4.3/libffi-nogcj-lib-path-fix.patch @@ -0,0 +1,40 @@ +diff -ur gcc-3.4.3/libffi/Makefile.in gcc-3.4.3-ffi-fixes/libffi/Makefile.in +--- gcc-3.4.3/libffi/Makefile.in 2003-11-22 08:41:32.000000000 -0500 ++++ gcc-3.4.3-ffi-fixes/libffi/Makefile.in 2004-11-28 17:31:50.000000000 -0500 +@@ -89,7 +89,7 @@ + libffi_basedir = @libffi_basedir@ + tool_include_dir = @tool_include_dir@ + toolexecdir = @toolexecdir@ +-toolexeclibdir = @toolexeclibdir@ ++toolexeclibdir = @toolexeclibdir@/@gcc_version@ + + AUTOMAKE_OPTIONS = cygnus + +diff -ur gcc-3.4.3/libffi/configure gcc-3.4.3-ffi-fixes/libffi/configure +--- gcc-3.4.3/libffi/configure 2004-05-18 05:08:39.000000000 -0400 ++++ gcc-3.4.3-ffi-fixes/libffi/configure 2004-11-28 17:48:19.000000000 -0500 +@@ -3800,8 +3800,8 @@ + toolexecdir='$(exec_prefix)/$(target_alias)' + toolexeclibdir='$(toolexecdir)/lib' + else +- toolexecdir='$(libdir)/gcc-lib/$(target_alias)' +- toolexeclibdir='$(libdir)' ++ toolexecdir='$(libdir)/gcc/$(target_alias)' ++ toolexeclibdir='$(libdir)/gcc/$(target_alias)/$(gcc-version)' + fi + multi_os_directory=`$CC -print-multi-os-directory` + case $multi_os_directory in +diff -ur gcc-3.4.3/libffi/configure.in gcc-3.4.3-ffi-fixes/libffi/configure.in +--- gcc-3.4.3/libffi/configure.in 2004-04-27 01:10:19.000000000 -0400 ++++ gcc-3.4.3-ffi-fixes/libffi/configure.in 2004-11-28 17:40:30.000000000 -0500 +@@ -225,8 +225,8 @@ + toolexecdir='$(exec_prefix)/$(target_alias)' + toolexeclibdir='$(toolexecdir)/lib' + else +- toolexecdir='$(libdir)/gcc-lib/$(target_alias)' +- toolexeclibdir='$(libdir)' ++ toolexecdir='$(libdir)/gcc/$(target_alias)' ++ toolexeclibdir='$(libdir)/gcc/$(target_alias)/$(gcc_version)' + fi + multi_os_directory=`$CC -print-multi-os-directory` + case $multi_os_directory in diff --git a/sys-devel/gcc/files/3.4.3/libffi-without-libgcj.patch b/sys-devel/gcc/files/3.4.3/libffi-without-libgcj.patch new file mode 100644 index 0000000..b270a06 --- /dev/null +++ b/sys-devel/gcc/files/3.4.3/libffi-without-libgcj.patch @@ -0,0 +1,40 @@ +--- configure.in.orig 2004-08-03 00:53:36.000000000 +0200 ++++ configure.in 2004-08-03 00:52:35.000000000 +0200 +@@ -136,8 +136,7 @@ + host_tools="texinfo byacc flex bison binutils gas ld gcc sid sim gdb make patch prms send-pr gprof etc expect dejagnu ash bash bzip2 m4 autoconf automake libtool diff rcs fileutils shellutils time textutils wdiff find uudecode hello tar gzip indent recode release sed utils guile perl gawk findutils gettext zip fastjar" + + # libgcj represents the runtime libraries only used by gcj. +-libgcj="target-libffi \ +- target-boehm-gc \ ++libgcj="target-boehm-gc \ + target-zlib \ + target-qthreads \ + target-libjava" +@@ -150,6 +150,7 @@ + target-libstdc++-v3 \ + target-libf2c \ + ${libgcj} \ ++ target-libffi \ + target-libobjc" + + # these tools are built using the target libraries, and are intended to +--- configure~ 2004-08-28 02:31:04.000000000 +0200 ++++ configure 2004-08-28 10:55:28.000000000 +0200 +@@ -876,8 +876,7 @@ + host_tools="texinfo byacc flex bison binutils gas ld gcc sid sim gdb make patch prms send-pr gprof etc expect dejagnu ash bash bzip2 m4 autoconf automake libtool diff rcs fileutils shellutils time textutils wdiff find uudecode hello tar gzip indent recode release sed utils guile perl gawk findutils gettext zip fastjar" + + # libgcj represents the runtime libraries only used by gcj. +-libgcj="target-libffi \ +- target-boehm-gc \ ++libgcj="target-boehm-gc \ + target-zlib \ + target-qthreads \ + target-libjava" +@@ -891,6 +890,7 @@ + target-libstdc++-v3 \ + target-libf2c \ + ${libgcj} \ ++ target-libffi \ + target-libobjc" + + # these tools are built using the target libraries, and are intended to diff --git a/sys-devel/gcc/files/3.4.4/gcc-3.4.4-cross-compile.patch b/sys-devel/gcc/files/3.4.4/gcc-3.4.4-cross-compile.patch new file mode 100644 index 0000000..0389543 --- /dev/null +++ b/sys-devel/gcc/files/3.4.4/gcc-3.4.4-cross-compile.patch @@ -0,0 +1,63 @@ +Some notes on the 'bootstrap with or without libc headers' debate: +http://linuxfromscratch.org/pipermail/lfs-dev/2005-July/052409.html +http://gcc.gnu.org/ml/gcc/2005-07/msg01195.html + +--- gcc/config/sh/linux.h ++++ gcc/config/sh/linux.h +@@ -145,6 +145,7 @@ + /* Do code reading to identify a signal frame, and set the frame + state data appropriately. See unwind-dw2.c for the structs. */ + ++#ifndef inhibit_libc + #ifdef IN_LIBGCC2 + #include <signal.h> + #include <sys/ucontext.h> +@@ -295,6 +296,7 @@ + + #endif /* defined (__SH5__) */ + #endif /* IN_LIBGCC2 */ ++#endif /* inhibit_libc */ + + /* For SH3 and SH4, we use a slot of the unwind frame which correspond + to a fake register number 16 as a placeholder for the return address +--- gcc/config/i386/linux.h ++++ gcc/config/i386/linux.h +@@ -208,6 +208,7 @@ + /* Do code reading to identify a signal frame, and set the frame + state data appropriately. See unwind-dw2.c for the structs. */ + ++#ifndef inhibit_libc + #ifdef IN_LIBGCC2 + /* There's no sys/ucontext.h for some (all?) libc1, so no + signal-turned-exceptions for them. There's also no configure-run for +@@ -272,3 +273,4 @@ + } while (0) + #endif /* not USE_GNULIBC_1 */ + #endif /* IN_LIBGCC2 */ ++#endif /* inhibit_libc */ +--- gcc/config/alpha/linux.h ++++ gcc/config/alpha/linux.h +@@ -73,6 +73,7 @@ + /* Do code reading to identify a signal frame, and set the frame + state data appropriately. See unwind-dw2.c for the structs. */ + ++#ifndef inhibit_libc + #ifdef IN_LIBGCC2 + #include <signal.h> + #include <sys/ucontext.h> +@@ -122,3 +123,4 @@ + (FS)->retaddr_column = 64; \ + goto SUCCESS; \ + } while (0) ++#endif /* inhibit_libc */ +--- gcc/config.gcc ++++ gcc/config.gcc +@@ -321,7 +321,7 @@ + need_64bit_hwint=yes + ;; + # Note the 'l'; we need to be able to match e.g. "shle" or "shl". +-sh[123456789l]*-*-*) ++sh[123456789lbe]*-*-*) + cpu_type=sh + need_64bit_hwint=yes + ;; diff --git a/sys-devel/gcc/files/3.4.4/gcc-3.4.4-softfloat.patch b/sys-devel/gcc/files/3.4.4/gcc-3.4.4-softfloat.patch new file mode 100644 index 0000000..9646bed --- /dev/null +++ b/sys-devel/gcc/files/3.4.4/gcc-3.4.4-softfloat.patch @@ -0,0 +1,156 @@ +The hunk for gcc/config/arm/t-linux comes from: +http://gcc.gnu.org/PR14352 + +The rest is a custom job by Yuri Vasilevski. + +The idea here is that we add soft float support into the spec file +so that we don't have to worry about packages stripping out softfloat +flags from CFLAGS/CXXFLAGS. + +http://bugs.gentoo.org/75585 + +--- gcc-3.4.4/gcc/config/arm/coff.h ++++ gcc-3.4.4/gcc/config/arm/coff.h +@@ -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. */ +--- gcc-3.4.4/gcc/config/arm/elf.h ++++ gcc-3.4.4/gcc/config/arm/elf.h +@@ -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=softvfp} %{!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 +--- gcc-3.4.4/gcc/config/arm/linux-elf.h ++++ gcc-3.4.4/gcc/config/arm/linux-elf.h +@@ -44,20 +44,33 @@ + #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_SOFT_FLOAT | \ ++ ARM_FLAG_VFP | \ + ARM_FLAG_MMU_TRAPS | \ + TARGET_ENDIAN_DEFAULT ) + ++#undef SUBTARGET_EXTRA_ASM_SPEC ++#define SUBTARGET_EXTRA_ASM_SPEC "%{mhard-float:-mfpu=fpa} \ ++%{!mhard-float: %{msoft-float:-mfpu=softvfp} %{!msoft-float:-mfpu=softvfp}}" ++ + #define SUBTARGET_CPU_DEFAULT TARGET_CPU_arm6 + + #define SUBTARGET_EXTRA_LINK_SPEC " -m " TARGET_LINKER_EMULATION " -p" + + #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 +85,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 +--- gcc-3.4.4/gcc/config/arm/t-linux ++++ gcc-3.4.4/gcc/config/arm/t-linux +@@ -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 +--- gcc-3.4.4/gcc/config/arm/unknown-elf.h ++++ gcc-3.4.4/gcc/config/arm/unknown-elf.h +@@ -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. */ +--- gcc-3.4.4/gcc/config/arm/xscale-elf.h ++++ gcc-3.4.4/gcc/config/arm/xscale-elf.h +@@ -51,9 +51,9 @@ + + #define SUBTARGET_EXTRA_ASM_SPEC "%{!mcpu=*:-mcpu=xscale} \ + %{mhard-float:-mfpu=fpa} \ +- %{!mhard-float: %{msoft-float:-mfpu=softfpa;:-mfpu=softvfp}}" ++ %{!mhard-float: %{msoft-float:-mfpu=softvfp} %{!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/sys-devel/gcc/files/4.0.2/gcc-4.0.2-cross-compile.patch b/sys-devel/gcc/files/4.0.2/gcc-4.0.2-cross-compile.patch new file mode 100644 index 0000000..e14b57a --- /dev/null +++ b/sys-devel/gcc/files/4.0.2/gcc-4.0.2-cross-compile.patch @@ -0,0 +1,40 @@ +Some notes on the 'bootstrap with or without libc headers' debate: +http://linuxfromscratch.org/pipermail/lfs-dev/2005-July/052409.html +http://gcc.gnu.org/ml/gcc/2005-07/msg01195.html + +--- gcc/unwind-dw2.c ++++ gcc/unwind-dw2.c +@@ -253,9 +253,11 @@ + } + #endif + ++#ifndef inhibit_libc + #ifdef MD_UNWIND_SUPPORT + #include MD_UNWIND_SUPPORT + #endif ++#endif + + /* Extract any interesting information from the CIE for the translation + unit F belongs to. Return a pointer to the byte after the augmentation, +--- gcc/configure ++++ gcc/configure +@@ -12857,7 +12857,7 @@ then + | powerpc*-*-*,powerpc64*-*-*) + CROSS="$CROSS -DNATIVE_CROSS" ;; + esac +-elif test "x$TARGET_SYSTEM_ROOT" != x; then ++elif test "x$TARGET_SYSTEM_ROOT" != x -o $build != $host; then + # This is just $(TARGET_SYSTEM_ROOT)$(NATIVE_SYSTEM_HEADER_DIR) + SYSTEM_HEADER_DIR='$(CROSS_SYSTEM_HEADER_DIR)' + fi +--- gcc/configure.ac ++++ gcc/configure.ac +@@ -1717,7 +1717,7 @@ then + | powerpc*-*-*,powerpc64*-*-*) + CROSS="$CROSS -DNATIVE_CROSS" ;; + esac +-elif test "x$TARGET_SYSTEM_ROOT" != x; then ++elif test "x$TARGET_SYSTEM_ROOT" != x -o $build != $host; then + # This is just $(TARGET_SYSTEM_ROOT)$(NATIVE_SYSTEM_HEADER_DIR) + SYSTEM_HEADER_DIR='$(CROSS_SYSTEM_HEADER_DIR)' + fi diff --git a/sys-devel/gcc/files/4.0.2/gcc-4.0.2-softfloat.patch b/sys-devel/gcc/files/4.0.2/gcc-4.0.2-softfloat.patch new file mode 100644 index 0000000..e49fea6 --- /dev/null +++ b/sys-devel/gcc/files/4.0.2/gcc-4.0.2-softfloat.patch @@ -0,0 +1,84 @@ +The hunk for gcc/config/arm/t-linux comes from: +http://gcc.gnu.org/PR14352 + +The rest is a custom job by Yuri Vasilevski. + +The idea here is that we add soft float support into the spec file +so that we don't have to worry about packages stripping out softfloat +flags from CFLAGS/CXXFLAGS. + +http://bugs.gentoo.org/75585 + +--- gcc-4.0.2/gcc/config/arm/elf.h ++++ gcc-4.0.2/gcc/config/arm/elf.h +@@ -45,8 +45,9 @@ + #endif + + #ifndef SUBTARGET_ASM_FLOAT_SPEC +-#define SUBTARGET_ASM_FLOAT_SPEC "\ +-%{mapcs-float:-mfloat}" ++#define SUBTARGET_ASM_FLOAT_SPEC "%{mapcs-float:-mfloat} \ ++ %{mhard-float:-mfpu=fpa} \ ++ %{!mhard-float: %{msoft-float:-mfpu=softfpa;:-mfpu=softvfp}}" + #endif + + #ifndef ASM_SPEC +@@ -58,8 +59,6 @@ + %{mapcs-*:-mapcs-%*} \ + %(subtarget_asm_float_spec) \ + %{mthumb-interwork:-mthumb-interwork} \ +-%{msoft-float:-mfloat-abi=soft} %{mhard-float:-mfloat-abi=hard} \ +-%{mfloat-abi=*} %{mfpu=*} \ + %(subtarget_extra_asm_spec)" + #endif + +--- gcc-4.0.2/gcc/config/arm/linux-elf.h ++++ gcc-4.0.2/gcc/config/arm/linux-elf.h +@@ -32,18 +32,22 @@ + #endif + + #undef TARGET_DEFAULT_FLOAT_ABI +-#define TARGET_DEFAULT_FLOAT_ABI ARM_FLOAT_ABI_HARD ++#define TARGET_DEFAULT_FLOAT_ABI ARM_FLOAT_ABI_SOFT + + #undef TARGET_DEFAULT + #define TARGET_DEFAULT (TARGET_ENDIAN_DEFAULT) + ++#undef SUBTARGET_EXTRA_ASM_SPEC ++#define SUBTARGET_EXTRA_ASM_SPEC "%{mhard-float:-mfpu=fpa} \ ++ %{!mhard-float: %{msoft-float:-mfpu=softfpa;:-mfpu=softvfp}}" ++ + #define SUBTARGET_CPU_DEFAULT TARGET_CPU_arm6 + + #define SUBTARGET_EXTRA_LINK_SPEC " -m " TARGET_LINKER_EMULATION " -p" + + #undef MULTILIB_DEFAULTS + #define MULTILIB_DEFAULTS \ +- { "marm", TARGET_ENDIAN_OPTION, "mhard-float", "mno-thumb-interwork" } ++ { "marm", TARGET_ENDIAN_OPTION, "msoft-float", "mno-thumb-interwork" } + + /* The GNU C++ standard library requires that these macros be defined. */ + #undef CPLUSPLUS_CPP_SPEC +@@ -56,7 +60,7 @@ + %{shared:-lc} \ + %{!shared:%{profile:-lc_p}%{!profile:-lc}}" + +-#define LIBGCC_SPEC "%{msoft-float:-lfloat} %{mfloat-abi=soft*:-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 +--- gcc-4.0.2/gcc/config/arm/t-linux ++++ gcc-4.0.2/gcc/config/arm/t-linux +@@ -4,7 +4,10 @@ TARGET_LIBGCC2_CFLAGS = -fomit-frame-poi + 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 _floatdidf _floatdisf + + # MULTILIB_OPTIONS = mhard-float/msoft-float + # MULTILIB_DIRNAMES = hard-float soft-float diff --git a/sys-devel/gcc/files/4.1.0/gcc-4.1.0-cross-compile.patch b/sys-devel/gcc/files/4.1.0/gcc-4.1.0-cross-compile.patch new file mode 100644 index 0000000..523caa4 --- /dev/null +++ b/sys-devel/gcc/files/4.1.0/gcc-4.1.0-cross-compile.patch @@ -0,0 +1,40 @@ +Some notes on the 'bootstrap with or without libc headers' debate: +http://linuxfromscratch.org/pipermail/lfs-dev/2005-July/052409.html +http://gcc.gnu.org/ml/gcc/2005-07/msg01195.html + +--- gcc/unwind-dw2.c ++++ gcc/unwind-dw2.c +@@ -253,9 +253,11 @@ + } + #endif + ++#ifndef inhibit_libc + #ifdef MD_UNWIND_SUPPORT + #include MD_UNWIND_SUPPORT + #endif ++#endif + + /* Extract any interesting information from the CIE for the translation + unit F belongs to. Return a pointer to the byte after the augmentation, +--- gcc/configure ++++ gcc/configure +@@ -12857,7 +12857,7 @@ then + | powerpc*-*-*,powerpc64*-*-*) + CROSS="$CROSS -DNATIVE_CROSS" ;; + esac +-elif test "x$TARGET_SYSTEM_ROOT" != x; then ++elif test "x$TARGET_SYSTEM_ROOT" != x -o $build != $host; then + SYSTEM_HEADER_DIR=$build_system_header_dir + fi + +--- gcc/configure.ac ++++ gcc/configure.ac +@@ -1717,7 +1717,7 @@ then + | powerpc*-*-*,powerpc64*-*-*) + CROSS="$CROSS -DNATIVE_CROSS" ;; + esac +-elif test "x$TARGET_SYSTEM_ROOT" != x; then ++elif test "x$TARGET_SYSTEM_ROOT" != x -o $build != $host; then + SYSTEM_HEADER_DIR=$build_system_header_dir + fi + diff --git a/sys-devel/gcc/files/4.1.0/gcc-4.1.0-fast-math-i386-Os-workaround.patch b/sys-devel/gcc/files/4.1.0/gcc-4.1.0-fast-math-i386-Os-workaround.patch new file mode 100644 index 0000000..6090d66 --- /dev/null +++ b/sys-devel/gcc/files/4.1.0/gcc-4.1.0-fast-math-i386-Os-workaround.patch @@ -0,0 +1,64 @@ +workaround for lame stack packing on i386 ... + + - build gcc with -Os (crtfastmath.o to be specific) + - crtfastmath.o is installed into gcc libdir + - run gcc with -ffast-math and get crtfastmath.o linked in + - resulting compiled app segfaults due to init code in + crtfastmath.o that has mis-aligned structure on stack + +http://bugs.gentoo.org/147020 +http://gcc.gnu.org/PR28621 + +this is supposed to be fixed in current 4.1 branch, but i'm unable to get +the fix to work so until i can figure out what i'm doing wrong, we'll use +this workaround for now. + +--- gcc-4.1.1/gcc/config/i386/crtfastmath.c ++++ gcc-4.1.1/gcc/config/i386/crtfastmath.c +@@ -37,6 +37,23 @@ + #define FXSAVE (1 << 24) + #define SSE (1 << 25) + ++struct ++{ ++ unsigned short int cwd; ++ unsigned short int swd; ++ unsigned short int twd; ++ unsigned short int fop; ++ long int fip; ++ long int fcs; ++ long int foo; ++ long int fos; ++ long int mxcsr; ++ long int mxcsr_mask; ++ long int st_space[32]; ++ long int xmm_space[32]; ++ long int padding[56]; ++} __attribute__ ((aligned (16))) fxsave; ++ + static void __attribute__((constructor)) + set_fast_math (void) + { +@@ -75,22 +92,6 @@ + if (edx & FXSAVE) + { + /* Check if DAZ is available. */ +- struct +- { +- unsigned short int cwd; +- unsigned short int swd; +- unsigned short int twd; +- unsigned short int fop; +- long int fip; +- long int fcs; +- long int foo; +- long int fos; +- long int mxcsr; +- long int mxcsr_mask; +- long int st_space[32]; +- long int xmm_space[32]; +- long int padding[56]; +- } __attribute__ ((aligned (16))) fxsave; + + __builtin_memset (&fxsave, 0, sizeof (fxsave)); + diff --git a/sys-devel/gcc/files/4.3.2/gcc-4.3.2-softfloat.patch b/sys-devel/gcc/files/4.3.2/gcc-4.3.2-softfloat.patch new file mode 100644 index 0000000..f530b6a --- /dev/null +++ b/sys-devel/gcc/files/4.3.2/gcc-4.3.2-softfloat.patch @@ -0,0 +1,88 @@ +The hunk for gcc/config/arm/t-linux comes from: +http://gcc.gnu.org/PR14352 + +The rest is a custom job by Yuri Vasilevski. + +The idea here is that we add soft float support into the spec file +so that we don't have to worry about packages stripping out softfloat +flags from CFLAGS/CXXFLAGS. + +http://bugs.gentoo.org/75585 + +--- gcc-4.0.2/gcc/config/arm/elf.h ++++ gcc-4.0.2/gcc/config/arm/elf.h +@@ -45,8 +45,9 @@ + #endif + + #ifndef SUBTARGET_ASM_FLOAT_SPEC +-#define SUBTARGET_ASM_FLOAT_SPEC "\ +-%{mapcs-float:-mfloat}" ++#define SUBTARGET_ASM_FLOAT_SPEC "%{mapcs-float:-mfloat} \ ++ %{mhard-float:-mfpu=fpa} \ ++ %{!mhard-float: %{msoft-float:-mfpu=softfpa;:-mfpu=softvfp}}" + #endif + + #ifndef ASM_SPEC +@@ -58,8 +59,6 @@ + %{mapcs-*:-mapcs-%*} \ + %(subtarget_asm_float_spec) \ + %{mthumb-interwork:-mthumb-interwork} \ +-%{msoft-float:-mfloat-abi=soft} %{mhard-float:-mfloat-abi=hard} \ +-%{mfloat-abi=*} %{mfpu=*} \ + %(subtarget_extra_asm_spec)" + #endif + +--- gcc-4.0.2/gcc/config/arm/linux-elf.h ++++ gcc-4.0.2/gcc/config/arm/linux-elf.h +@@ -28,7 +28,7 @@ + #define TARGET_VERSION fputs (" (ARM GNU/Linux with ELF)", stderr); + + #undef TARGET_DEFAULT_FLOAT_ABI +-#define TARGET_DEFAULT_FLOAT_ABI ARM_FLOAT_ABI_HARD ++#define TARGET_DEFAULT_FLOAT_ABI ARM_FLOAT_ABI_SOFT + + /* TARGET_BIG_ENDIAN_DEFAULT is set in + config.gcc for big endian configurations. */ +@@ -44,6 +44,10 @@ + + #undef TARGET_DEFAULT + #define TARGET_DEFAULT (TARGET_ENDIAN_DEFAULT) ++#undef SUBTARGET_EXTRA_ASM_SPEC ++#define SUBTARGET_EXTRA_ASM_SPEC "%{mhard-float:-mfpu=fpa} \ ++ %{!mhard-float: %{msoft-float:-mfpu=softfpa;:-mfpu=softvfp}}" ++ + + #define SUBTARGET_CPU_DEFAULT TARGET_CPU_arm6 + +@@ -51,7 +55,7 @@ + + #undef MULTILIB_DEFAULTS + #define MULTILIB_DEFAULTS \ +- { "marm", "mlittle-endian", "mhard-float", "mno-thumb-interwork" } ++ { "marm", TARGET_ENDIAN_OPTION, "msoft-float", "mno-thumb-interwork" } + + /* Now we define the strings used to build the spec file. */ + #undef LIB_SPEC +@@ -60,7 +64,7 @@ + %{shared:-lc} \ + %{!shared:%{profile:-lc_p}%{!profile:-lc}}" + +-#define LIBGCC_SPEC "%{msoft-float:-lfloat} %{mfloat-abi=soft*:-lfloat} -lgcc" ++#define LIBGCC_SPEC "-lgcc" + + #define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2" + +--- gcc-4.0.2/gcc/config/arm/t-linux ++++ gcc-4.0.2/gcc/config/arm/t-linux +@@ -4,7 +4,10 @@ TARGET_LIBGCC2_CFLAGS = -fomit-frame-poi + 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 _floatdidf _floatdisf + + # MULTILIB_OPTIONS = mhard-float/msoft-float + # MULTILIB_DIRNAMES = hard-float soft-float diff --git a/sys-devel/gcc/files/4.4.0/gcc-4.4.0-softfloat.patch b/sys-devel/gcc/files/4.4.0/gcc-4.4.0-softfloat.patch new file mode 100644 index 0000000..bf8d718 --- /dev/null +++ b/sys-devel/gcc/files/4.4.0/gcc-4.4.0-softfloat.patch @@ -0,0 +1,89 @@ +The hunk for gcc/config/arm/t-linux comes from: +http://gcc.gnu.org/PR14352 + +The rest is a custom job by Yuri Vasilevski. + +The idea here is that we add soft float support into the spec file +so that we don't have to worry about packages stripping out softfloat +flags from CFLAGS/CXXFLAGS. + +http://bugs.gentoo.org/75585 + +--- gcc-4.0.2/gcc/config/arm/elf.h ++++ gcc-4.0.2/gcc/config/arm/elf.h +@@ -45,8 +45,9 @@ + #endif + + #ifndef SUBTARGET_ASM_FLOAT_SPEC +-#define SUBTARGET_ASM_FLOAT_SPEC "\ +-%{mapcs-float:-mfloat}" ++#define SUBTARGET_ASM_FLOAT_SPEC "%{mapcs-float:-mfloat} \ ++ %{mhard-float:-mfpu=fpa} \ ++ %{!mhard-float: %{msoft-float:-mfpu=softfpa;:-mfpu=softvfp}}" + #endif + + #ifndef ASM_SPEC +@@ -58,8 +59,6 @@ + %{mapcs-*:-mapcs-%*} \ + %(subtarget_asm_float_spec) \ + %{mthumb-interwork:-mthumb-interwork} \ +-%{msoft-float:-mfloat-abi=soft} %{mhard-float:-mfloat-abi=hard} \ +-%{mfloat-abi=*} %{mfpu=*} \ + %(subtarget_extra_asm_spec)" + #endif + +--- gcc-4.0.2/gcc/config/arm/linux-elf.h ++++ gcc-4.0.2/gcc/config/arm/linux-elf.h +@@ -28,7 +28,7 @@ + #define TARGET_VERSION fputs (" (ARM GNU/Linux with ELF)", stderr); + + #undef TARGET_DEFAULT_FLOAT_ABI +-#define TARGET_DEFAULT_FLOAT_ABI ARM_FLOAT_ABI_HARD ++#define TARGET_DEFAULT_FLOAT_ABI ARM_FLOAT_ABI_SOFT + + /* TARGET_BIG_ENDIAN_DEFAULT is set in + config.gcc for big endian configurations. */ +@@ -44,6 +44,10 @@ + + #undef TARGET_DEFAULT + #define TARGET_DEFAULT (TARGET_ENDIAN_DEFAULT) ++#undef SUBTARGET_EXTRA_ASM_SPEC ++#define SUBTARGET_EXTRA_ASM_SPEC "%{mhard-float:-mfpu=fpa} \ ++ %{!mhard-float: %{msoft-float:-mfpu=softfpa;:-mfpu=softvfp}}" ++ + + #define SUBTARGET_CPU_DEFAULT TARGET_CPU_arm6 + +@@ -51,7 +55,7 @@ + + #undef MULTILIB_DEFAULTS + #define MULTILIB_DEFAULTS \ +- { "marm", "mlittle-endian", "mhard-float", "mno-thumb-interwork" } ++ { "marm", TARGET_ENDIAN_OPTION, "msoft-float", "mno-thumb-interwork" } + + /* Now we define the strings used to build the spec file. */ + #undef LIB_SPEC +@@ -60,7 +64,7 @@ + %{shared:-lc} \ + %{!shared:%{profile:-lc_p}%{!profile:-lc}}" + +-#define LIBGCC_SPEC "%{msoft-float:-lfloat} %{mfloat-abi=soft*:-lfloat} -lgcc" ++#define LIBGCC_SPEC "-lgcc" + + #define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2" + +--- gcc-4.0.2/gcc/config/arm/t-linux ++++ gcc-4.0.2/gcc/config/arm/t-linux +@@ -3,8 +3,10 @@ + TARGET_LIBGCC2_CFLAGS = -fomit-frame-pointer -fPIC + + LIB1ASMSRC = arm/lib1funcs.asm +-LIB1ASMFUNCS = _udivsi3 _divsi3 _umodsi3 _modsi3 _dvmd_lnx _clzsi2 _clzdi2 \ +- _arm_addsubdf3 _arm_addsubsf3 ++LIB1ASMFUNCS = _udivsi3 _divsi3 _umodsi3 _modsi3 _dvmd_lnx \ ++ _negdf2 _addsubdf3 _muldivdf3 _cmpdf2 _unorddf2 _fixdfsi _fixunsdfsi \ ++ _truncdfsf2 _negsf2 _addsubsf3 _muldivsf3 _cmpsf2 _unordsf2 \ ++ _fixsfsi _fixunssfsi _floatdidf _floatdisf + + # MULTILIB_OPTIONS = mhard-float/msoft-float + # MULTILIB_DIRNAMES = hard-float soft-float diff --git a/sys-devel/gcc/files/awk/fixlafiles.awk b/sys-devel/gcc/files/awk/fixlafiles.awk new file mode 100644 index 0000000..ffade96 --- /dev/null +++ b/sys-devel/gcc/files/awk/fixlafiles.awk @@ -0,0 +1,314 @@ +# Copyright 1999-2005 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/sys-devel/gcc/files/awk/fixlafiles.awk,v 1.15 2008/02/19 05:47:29 vapier Exp $ + +# +# Helper functions +# +function printn(string) { + printf("%s", string) +} +function einfo(string) { + printf(" \033[32;01m*\033[0m %s\n", string) +} +function einfon(string) { + printf(" \033[32;01m*\033[0m %s", string) +} +function ewarn(string) { + printf(" \033[33;01m*\033[0m %s\n", string) +} +function ewarnn(string) { + printf(" \033[33;01m*\033[0m %s", string) +} +function eerror(string) { + printf(" \033[31;01m*\033[0m %s\n", string) +} + +# +# assert(condition, errmsg) +# assert that a condition is true. Otherwise exit. +# +function assert(condition, string) { + if (! condition) { + printf("%s:%d: assertion failed: %s\n", + FILENAME, FNR, string) > "/dev/stderr" + _assert_exit = 1 + exit 1 + } +} + +# +# system(command, return) +# wrapper that normalizes return codes ... +# +function dosystem(command, ret) { + ret = 0 + ret = system(command) + if (ret == 0) + return 1 + else + return 0 +} + +BEGIN { + # + # Get our variables from environment + # + OLDVER = ENVIRON["OLDVER"] + OLDCHOST = ENVIRON["OLDCHOST"] + + if (OLDVER == "") { + eerror("Could not get OLDVER!"); + exit 1 + } + + # Setup some sane defaults + LIBCOUNT = 2 + HAVE_GCC34 = 0 + DIRLIST[1] = "/lib" + DIRLIST[2] = "/usr/lib" + + # + # Walk /etc/ld.so.conf to discover all our library paths + # + pipe = "cat /etc/ld.so.conf | sort 2>/dev/null" + while(((pipe) | getline ldsoconf_data) > 0) { + if (ldsoconf_data !~ /^[[:space:]]*#/) { + if (ldsoconf_data == "") continue + + # Remove any trailing comments + sub(/#.*$/, "", ldsoconf_data) + # Remove any trailing spaces + sub(/[[:space:]]+$/, "", ldsoconf_data) + + # If there's more than one path per line, split + # it up as if they were sep lines + split(ldsoconf_data, nodes, /[:,[:space:]]/) + + # Now add the rest from ld.so.conf + for (x in nodes) { + # wtf does this line do ? + sub(/=.*/, "", nodes[x]) + # Prune trailing / + sub(/\/$/, "", nodes[x]) + + if (nodes[x] == "") continue + + # + # Drop the directory if its a child directory of + # one that was already added ... + # For example, if we have: + # /usr/lib /usr/libexec /usr/lib/mozilla /usr/lib/nss + # We really just want to save /usr/lib /usr/libexec + # + CHILD = 0 + for (y in DIRLIST) { + if (nodes[x] ~ "^" DIRLIST[y] "(/|$)") { + CHILD = 1 + break + } + } + if (CHILD) continue + + DIRLIST[++LIBCOUNT] = nodes[x] + } + } + } + close(pipe) + + # + # Get line from gcc's output containing CHOST + # + pipe = "gcc -print-file-name=libgcc.a 2>/dev/null" + if ((!((pipe) | getline TMP_CHOST)) || (TMP_CHOST == "")) { + close(pipe) + + # If we fail to get the CHOST, see if we can get the CHOST + # portage thinks we are using ... + pipe = "/usr/bin/portageq envvar 'CHOST'" + assert(((pipe) | getline CHOST), "(" pipe ") | getline CHOST") + } else { + # Check pre gcc-3.4.x versions + CHOST = gensub("^.+lib/gcc-lib/([^/]+)/[0-9]+.+$", "\\1", 1, TMP_CHOST) + + if (CHOST == TMP_CHOST || CHOST == "") { + # Check gcc-3.4.x or later + CHOST = gensub("^.+lib/gcc/([^/]+)/[0-9]+.+$", "\\1", 1, TMP_CHOST); + + if (CHOST == TMP_CHOST || CHOST == "") + CHOST = "" + else + HAVE_GCC34 = 1 + } + } + close(pipe) + + if (CHOST == "") { + eerror("Could not get gcc's CHOST!") + exit 1 + } + + if (OLDCHOST != "") + if (OLDCHOST == CHOST) + OLDCHOST = "" + + GCCLIBPREFIX_OLD = "/usr/lib/gcc-lib/" + GCCLIBPREFIX_NEW = "/usr/lib/gcc/" + + if (HAVE_GCC34) + GCCLIBPREFIX = GCCLIBPREFIX_NEW + else + GCCLIBPREFIX = GCCLIBPREFIX_OLD + + GCCLIB = GCCLIBPREFIX CHOST + + if (OLDCHOST != "") { + OLDGCCLIB1 = GCCLIBPREFIX_OLD OLDCHOST + OLDGCCLIB2 = GCCLIBPREFIX_NEW OLDCHOST + } + + # Get current gcc's version + pipe = "gcc -dumpversion" + assert(((pipe) | getline NEWVER), "(" pipe ") | getline NEWVER)") + close(pipe) + + if (NEWVER == "") { + eerror("Could not get gcc's version!") + exit 1 + } + + # Nothing to do ? + if ((OLDVER == NEWVER) && (OLDCHOST == "")) + exit 0 + + # + # Ok, now let's scan for the .la files and actually fix them up + # + for (x = 1; x <= LIBCOUNT; x++) { + # Do nothing if the target dir is gcc's internal library path + if (DIRLIST[x] ~ GCCLIBPREFIX_OLD || + DIRLIST[x] ~ GCCLIBPREFIX_NEW) + continue + + einfo(" [" x "/" LIBCOUNT "] Scanning " DIRLIST[x] " ...") + + pipe = "find " DIRLIST[x] "/ -name '*.la' 2>/dev/null" + while (((pipe) | getline la_files) > 0) { + + # Do nothing if the .la file is located in gcc's internal lib path + if (la_files ~ GCCLIBPREFIX_OLD || + la_files ~ GCCLIBPREFIX_NEW) + continue + + CHANGED = 0 + CHOST_CHANGED = 0 + + # See if we need to fix the .la file + while ((getline la_data < (la_files)) > 0) { + if (OLDCHOST != "") { + if ((gsub(OLDGCCLIB1 "[/[:space:]]+", + GCCLIB, la_data) > 0) || + (gsub(OLDGCCLIB2 "[/[:space:]]+", + GCCLIB, la_data) > 0)) { + CHANGED = 1 + CHOST_CHANGED = 1 + } + } + if (OLDVER != NEWVER) { + if ((gsub(GCCLIBPREFIX_OLD CHOST "/" OLDVER "[/[:space:]]*", + GCCLIB "/" NEWVER, la_data) > 0) || + (gsub(GCCLIBPREFIX_NEW CHOST "/" OLDVER "[/[:space:]]*", + GCCLIB "/" NEWVER, la_data) > 0)) + CHANGED = 1 + } + } + close(la_files) + + # Do the actual changes in a second loop, as we can then + # verify that CHOST_CHANGED among things is correct ... + if (CHANGED) { + ewarnn(" FIXING: " la_files " ...") + + if (CHANGED) + printn("[") + + # Clear the temp file (removing rather than '>foo' is better + # out of a security point of view?) + dosystem("rm -f " la_files ".new") + + while ((getline la_data < (la_files)) > 0) { + if (OLDCHOST != "") { + tmpstr = gensub(OLDGCCLIB1 "([/[:space:]]+)", + GCCLIB "\\1", "g", la_data) + tmpstr = gensub(OLDGCCLIB2 "([/[:space:]]+)", + GCCLIB "\\1", "g", tmpstr) + + if (la_data != tmpstr) { + printn("c") + la_data = tmpstr + } + + if (CHOST_CHANGED > 0) { + # We try to be careful about CHOST changes outside + # the gcc library path (meaning we cannot match it + # via /GCCLIBPREFIX CHOST/) ... + + # Catch: + # + # dependency_libs=' -L/usr/CHOST/{bin,lib}' + # + gsub("-L/usr/" OLDCHOST "/", + "-L/usr/" CHOST "/", la_data) + # Catch: + # + # dependency_libs=' -L/usr/lib/gcc-lib/CHOST/VER/../../../../CHOST/lib' + # + la_data = gensub("(" GCCLIB "/[^[:space:]]+)/" OLDCHOST "/", + "\\1/" CHOST "/", "g", la_data) + } + } + + if (OLDVER != NEWVER) { + # Catch: + # + # dependency_libs=' -L/usr/lib/gcc/CHOST/VER' + # + tmpstr = gensub(GCCLIBPREFIX_OLD CHOST "/" OLDVER "([/[:space:]]+)", + GCCLIB "/" NEWVER "\\1", "g", la_data) + tmpstr = gensub(GCCLIBPREFIX_NEW CHOST "/" OLDVER "([/[:space:]]+)", + GCCLIB "/" NEWVER "\\1", "g", tmpstr) + + if (la_data != tmpstr) { + # Catch: + # + # dependency_libs=' -L/usr/lib/gcc-lib/../../CHOST/lib' + # + # in cases where we have gcc34 + tmpstr = gensub(GCCLIBPREFIX_OLD "(../../" CHOST "/lib)", + GCCLIBPREFIX "\\1", "g", tmpstr) + tmpstr = gensub(GCCLIBPREFIX_NEW "(../../" CHOST "/lib)", + GCCLIBPREFIX "\\1", "g", tmpstr) + printn("v") + la_data = tmpstr + } + } + + print la_data >> (la_files ".new") + } + + if (CHANGED) + print "]" + + close(la_files) + close(la_files ".new") + + assert(dosystem("mv -f " la_files ".new " la_files), + "dosystem(\"mv -f " la_files ".new " la_files "\")") + } + } + + close(pipe) + } +} + +# vim:ts=4 diff --git a/sys-devel/gcc/files/awk/fixlafiles.awk-no_gcc_la b/sys-devel/gcc/files/awk/fixlafiles.awk-no_gcc_la new file mode 100644 index 0000000..346bd16 --- /dev/null +++ b/sys-devel/gcc/files/awk/fixlafiles.awk-no_gcc_la @@ -0,0 +1,335 @@ +# Copyright 1999-2005 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/sys-devel/gcc/files/awk/fixlafiles.awk-no_gcc_la,v 1.4 2010/03/19 23:53:07 vapier Exp $ + +# +# Helper functions +# +function printn(string) { + printf("%s", string) +} +function einfo(string) { + printf(" \033[32;01m*\033[0m %s\n", string) +} +function einfon(string) { + printf(" \033[32;01m*\033[0m %s", string) +} +function ewarn(string) { + printf(" \033[33;01m*\033[0m %s\n", string) +} +function ewarnn(string) { + printf(" \033[33;01m*\033[0m %s", string) +} +function eerror(string) { + printf(" \033[31;01m*\033[0m %s\n", string) +} + +# +# assert(condition, errmsg) +# assert that a condition is true. Otherwise exit. +# +function assert(condition, string) { + if (! condition) { + printf("%s:%d: assertion failed: %s\n", + FILENAME, FNR, string) > "/dev/stderr" + _assert_exit = 1 + exit 1 + } +} + +# +# system(command, return) +# wrapper that normalizes return codes ... +# +function dosystem(command, ret) { + ret = 0 + ret = system(command) + if (ret == 0) + return 1 + else + return 0 +} + +# +# parse_ld_conf(config_file) +# +function parse_ld_conf(conf, pipe, ldsoconf_data, CHILD, y) { + pipe = "cd /etc; cat " conf " | sort 2>/dev/null" + while(((pipe) | getline ldsoconf_data) > 0) { + if (ldsoconf_data ~ /^[[:space:]]*#/) + continue + if (ldsoconf_data == "") + continue + + # Handle the "include" keyword + if (ldsoconf_data ~ /^include /) { + sub(/^include /, "", ldsoconf_data) + parse_ld_conf(ldsoconf_data) + continue + } + + # Remove any trailing comments + sub(/#.*$/, "", ldsoconf_data) + # Remove any trailing spaces + sub(/[[:space:]]+$/, "", ldsoconf_data) + # Eat duplicate slashes + sub(/\/\//, "/", ldsoconf_data) + # Prune trailing / + sub(/\/$/, "", ldsoconf_data) + + # + # Drop the directory if its a child directory of + # one that was already added ... + # For example, if we have: + # /usr/lib /usr/libexec /usr/lib/mozilla /usr/lib/nss + # We really just want to save /usr/lib /usr/libexec + # + CHILD = 0 + for (y in DIRLIST) { + if (ldsoconf_data ~ "^" DIRLIST[y] "(/|$)") { + CHILD = 1 + break + } + } + if (CHILD) continue + + DIRLIST[++LIBCOUNT] = ldsoconf_data + } + close(pipe) +} + +BEGIN { + # + # Get our variables from environment + # + OLDVER = ENVIRON["OLDVER"] + OLDCHOST = ENVIRON["OLDCHOST"] + + if (OLDVER == "") { + eerror("Could not get OLDVER!"); + exit 1 + } + + # Setup some sane defaults + LIBCOUNT = 2 + HAVE_GCC34 = 0 + DIRLIST[1] = "/lib" + DIRLIST[2] = "/usr/lib" + + # + # Walk /etc/ld.so.conf to discover all our library paths + # + parse_ld_conf("/etc/ld.so.conf") + + # + # Get line from gcc's output containing CHOST + # + pipe = "gcc -print-file-name=libgcc.a 2>/dev/null" + if ((!((pipe) | getline TMP_CHOST)) || (TMP_CHOST == "")) { + close(pipe) + + # If we fail to get the CHOST, see if we can get the CHOST + # portage thinks we are using ... + pipe = "/usr/bin/portageq envvar 'CHOST'" + assert(((pipe) | getline CHOST), "(" pipe ") | getline CHOST") + } else { + # Check pre gcc-3.4.x versions + CHOST = gensub("^.+lib/gcc-lib/([^/]+)/[0-9]+.+$", "\\1", 1, TMP_CHOST) + + if (CHOST == TMP_CHOST || CHOST == "") { + # Check gcc-3.4.x or later + CHOST = gensub("^.+lib/gcc/([^/]+)/[0-9]+.+$", "\\1", 1, TMP_CHOST); + + if (CHOST == TMP_CHOST || CHOST == "") + CHOST = "" + else + HAVE_GCC34 = 1 + } + } + close(pipe) + + if (CHOST == "") { + eerror("Could not get gcc's CHOST!") + exit 1 + } + + if (OLDCHOST != "") + if (OLDCHOST == CHOST) + OLDCHOST = "" + + GCCLIBPREFIX_OLD = "/usr/lib/gcc-lib/" + GCCLIBPREFIX_NEW = "/usr/lib/gcc/" + + if (HAVE_GCC34) + GCCLIBPREFIX = GCCLIBPREFIX_NEW + else + GCCLIBPREFIX = GCCLIBPREFIX_OLD + + GCCLIB = GCCLIBPREFIX CHOST + + if (OLDCHOST != "") { + OLDGCCLIB1 = GCCLIBPREFIX_OLD OLDCHOST + OLDGCCLIB2 = GCCLIBPREFIX_NEW OLDCHOST + } + + # Get current gcc's version + pipe = "gcc -dumpversion" + assert(((pipe) | getline NEWVER), "(" pipe ") | getline NEWVER)") + close(pipe) + + if (NEWVER == "") { + eerror("Could not get gcc's version!") + exit 1 + } + + # Nothing to do ? + # NB: Do not check for (OLDVER == NEWVER) anymore, as we might need to + # replace libstdc++.la .... + if ((OLDVER == "") && (OLDCHOST == "")) + exit 0 + + # + # Ok, now let's scan for the .la files and actually fix them up + # + for (x = 1; x <= LIBCOUNT; x++) { + # Do nothing if the target dir is gcc's internal library path + if (DIRLIST[x] ~ GCCLIBPREFIX_OLD || + DIRLIST[x] ~ GCCLIBPREFIX_NEW) + continue + + einfo(" [" x "/" LIBCOUNT "] Scanning " DIRLIST[x] " ...") + + pipe = "find " DIRLIST[x] "/ -name '*.la' 2>/dev/null" + while (((pipe) | getline la_files) > 0) { + + # Do nothing if the .la file is located in gcc's internal lib path + if (la_files ~ GCCLIBPREFIX_OLD || + la_files ~ GCCLIBPREFIX_NEW) + continue + + CHANGED = 0 + CHOST_CHANGED = 0 + + # See if we need to fix the .la file + while ((getline la_data < (la_files)) > 0) { + if (OLDCHOST != "") { + if ((gsub(OLDGCCLIB1 "[/[:space:]]+", + GCCLIB, la_data) > 0) || + (gsub(OLDGCCLIB2 "[/[:space:]]+", + GCCLIB, la_data) > 0)) { + CHANGED = 1 + CHOST_CHANGED = 1 + } + } + if (OLDVER != NEWVER) { + if ((gsub(GCCLIBPREFIX_OLD CHOST "/" OLDVER "[/[:space:]]*", + GCCLIB "/" NEWVER, la_data) > 0) || + (gsub(GCCLIBPREFIX_NEW CHOST "/" OLDVER "[/[:space:]]*", + GCCLIB "/" NEWVER, la_data) > 0)) + CHANGED = 1 + } + # We now check if we have libstdc++.la, as we remove the + # libtool linker scripts for gcc ... + # We do this last, as we only match the new paths + if (gsub(GCCLIB "/" NEWVER "/libstdc\\+\\+\\.la", + "-lstdc++", la_data) > 0) + CHANGED = 1 + } + close(la_files) + + # Do the actual changes in a second loop, as we can then + # verify that CHOST_CHANGED among things is correct ... + if (CHANGED) { + ewarnn(" FIXING: " la_files " ...[") + + # Clear the temp file (removing rather than '>foo' is better + # out of a security point of view?) + dosystem("rm -f " la_files ".new") + + while ((getline la_data < (la_files)) > 0) { + if (OLDCHOST != "") { + tmpstr = gensub(OLDGCCLIB1 "([/[:space:]]+)", + GCCLIB "\\1", "g", la_data) + tmpstr = gensub(OLDGCCLIB2 "([/[:space:]]+)", + GCCLIB "\\1", "g", tmpstr) + + if (la_data != tmpstr) { + printn("c") + la_data = tmpstr + } + + if (CHOST_CHANGED > 0) { + # We try to be careful about CHOST changes outside + # the gcc library path (meaning we cannot match it + # via /GCCLIBPREFIX CHOST/) ... + + # Catch: + # + # dependency_libs=' -L/usr/CHOST/{bin,lib}' + # + gsub("-L/usr/" OLDCHOST "/", + "-L/usr/" CHOST "/", la_data) + # Catch: + # + # dependency_libs=' -L/usr/lib/gcc-lib/CHOST/VER/../../../../CHOST/lib' + # + la_data = gensub("(" GCCLIB "/[^[:space:]]+)/" OLDCHOST "/", + "\\1/" CHOST "/", "g", la_data) + } + } + + if (OLDVER != NEWVER) { + # Catch: + # + # dependency_libs=' -L/usr/lib/gcc/CHOST/VER' + # + tmpstr = gensub(GCCLIBPREFIX_OLD CHOST "/" OLDVER "([/[:space:]]+)", + GCCLIB "/" NEWVER "\\1", "g", la_data) + tmpstr = gensub(GCCLIBPREFIX_NEW CHOST "/" OLDVER "([/[:space:]]+)", + GCCLIB "/" NEWVER "\\1", "g", tmpstr) + + if (la_data != tmpstr) { + # Catch: + # + # dependency_libs=' -L/usr/lib/gcc-lib/../../CHOST/lib' + # + # in cases where we have gcc34 + tmpstr = gensub(GCCLIBPREFIX_OLD "(../../" CHOST "/lib)", + GCCLIBPREFIX "\\1", "g", tmpstr) + tmpstr = gensub(GCCLIBPREFIX_NEW "(../../" CHOST "/lib)", + GCCLIBPREFIX "\\1", "g", tmpstr) + printn("v") + la_data = tmpstr + } + } + + # We now check if we have libstdc++.la, as we remove the + # libtool linker scripts for gcc and any referencese in any + # libtool linker scripts. + # We do this last, as we only match the new paths + tmpstr = gensub(GCCLIB "/" NEWVER "/libstdc\\+\\+\\.la", + "-lstdc++", "g", la_data); + if (la_data != tmpstr) { + printn("l") + la_data = tmpstr + } + + print la_data >> (la_files ".new") + } + + if (CHANGED) + print "]" + + close(la_files) + close(la_files ".new") + + assert(dosystem("mv -f " la_files ".new " la_files), + "dosystem(\"mv -f " la_files ".new " la_files "\")") + } + } + + close(pipe) + } +} + +# vim:ts=4 diff --git a/sys-devel/gcc/files/c89 b/sys-devel/gcc/files/c89 new file mode 100755 index 0000000..cee0325 --- /dev/null +++ b/sys-devel/gcc/files/c89 @@ -0,0 +1,20 @@ +#! /bin/sh + +# Call the appropriate C compiler with options to accept ANSI/ISO C +# The following options are the same (as of gcc-2.95): +# -ansi +# -std=c89 +# -std=iso9899:1990 + +for i; do + case "$i" in + -ansi|-std=c89|-std=iso9899:1990) + ;; + -std=*) + echo >&2 "`basename $0` called with non ANSI/ISO C90 option $i" + exit 1 + ;; + esac +done + +exec gcc -std=c89 -pedantic -U_FORTIFY_SOURCE "$@" diff --git a/sys-devel/gcc/files/c99 b/sys-devel/gcc/files/c99 new file mode 100755 index 0000000..c954209 --- /dev/null +++ b/sys-devel/gcc/files/c99 @@ -0,0 +1,21 @@ +#! /bin/sh + +# Call the appropriate C compiler with options to accept ANSI/ISO C +# The following options are the same (as of gcc-3.3): +# -std=c99 +# -std=c9x +# -std=iso9899:1999 +# -std=iso9899:199x + +for i; do + case "$i" in + -std=c9[9x]|-std=iso9899:199[9x]) + ;; + -ansi|-std=*) + echo >&2 "`basename $0` called with non ANSI/ISO C99 option $i" + exit 1 + ;; + esac +done + +exec gcc -std=c99 -pedantic -U_FORTIFY_SOURCE ${1+"$@"} diff --git a/sys-devel/gcc/files/fix_libtool_files.sh b/sys-devel/gcc/files/fix_libtool_files.sh new file mode 100644 index 0000000..c55250b --- /dev/null +++ b/sys-devel/gcc/files/fix_libtool_files.sh @@ -0,0 +1,68 @@ +#!/bin/sh +# Copyright 1999-2012 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/sys-devel/gcc/files/fix_libtool_files.sh,v 1.16 2012/05/18 21:28:56 vapier Exp $ + +usage() { +cat << "USAGE_END" +Usage: fix_libtool_files.sh <old-gcc-version> [--oldarch <old-CHOST>] + + Where <old-gcc-version> is the version number of the + previous gcc version. For example, if you updated to + gcc-3.2.1, and you had gcc-3.2 installed, run: + + # fix_libtool_files.sh 3.2 + + If you updated to gcc-3.2.3, and the old CHOST was i586-pc-linux-gnu + but you now have CHOST as i686-pc-linux-gnu, run: + + # fix_libtool_files.sh 3.2 --oldarch i586-pc-linux-gnu + + Note that if only the CHOST and not the version changed, you can run + it with the current version and the '--oldarch <old-CHOST>' arguments, + and it will do the expected: + + # fix_libtool_files.sh `gcc -dumpversion` --oldarch i586-pc-linux-gnu + +USAGE_END + exit 1 +} + +case $2 in +--oldarch) [ $# -ne 3 ] && usage ;; +*) [ $# -ne 1 ] && usage ;; +esac + +ARGV1=$1 +ARGV2=$2 +ARGV3=$3 + +. /etc/profile || exit 1 +. /etc/init.d/functions.sh || exit 1 + +if [ ${EUID:-0} -ne 0 ] ; then + eerror "${0##*/}: Must be root." + exit 1 +fi + +# make sure the files come out sane +umask 0022 + +OLDCHOST= +[ "${ARGV2}" = "--oldarch" ] && OLDCHOST=${ARGV3} + +AWKDIR="/usr/share/gcc-data" + +if [ ! -r "${AWKDIR}/fixlafiles.awk" ] ; then + eerror "${0##*/}: ${AWKDIR}/fixlafiles.awk does not exist!" + exit 1 +fi + +OLDVER=${ARGV1} + +export OLDVER OLDCHOST + +einfo "Scanning libtool files for hardcoded gcc library paths..." +exec gawk -f "${AWKDIR}/fixlafiles.awk" + +# vim:ts=4 diff --git a/sys-devel/gcc/files/gcc-configure-LANG.patch b/sys-devel/gcc/files/gcc-configure-LANG.patch new file mode 100644 index 0000000..d1b1b03 --- /dev/null +++ b/sys-devel/gcc/files/gcc-configure-LANG.patch @@ -0,0 +1,64 @@ +The LANG vars aren't reset early enough so when sed tries to use [a-zA-Z] in +option parsing, it may break. + +http://bugs.gentoo.org/103483 + +--- configure ++++ configure +@@ -54,6 +54,19 @@ + infodir='${prefix}/info' + mandir='${prefix}/man' + ++# NLS nuisances. ++for as_var in \ ++ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ ++ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ ++ LC_TELEPHONE LC_TIME ++do ++ if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then ++ eval $as_var=C; export $as_var ++ else ++ unset $as_var ++ fi ++done ++ + # Initialize some other variables. + subdirs= + MFLAGS= MAKEFLAGS= +@@ -452,16 +463,6 @@ + esac + done + +-# NLS nuisances. +-# Only set these to C if already set. These must not be set unconditionally +-# because not all systems understand e.g. LANG=C (notably SCO). +-# Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'! +-# Non-C LC_CTYPE values break the ctype check. +-if test "${LANG+set}" = set; then LANG=C; export LANG; fi +-if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi +-if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi +-if test "${LC_CTYPE+set}" = set; then LC_CTYPE=C; export LC_CTYPE; fi +- + # confdefs.h avoids OS command line length limits that DEFS can exceed. + rm -rf conftest* confdefs.h + # AIX cpp loses on an empty file, so make sure it contains at least a newline. +@@ -1850,6 +1850,19 @@ + # Compiler output produced by configure, useful for debugging + # configure, is in ./config.log if it exists. + ++# NLS nuisances. ++for as_var in \ ++ LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ ++ LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ ++ LC_TELEPHONE LC_TIME ++do ++ if (set +x; test -z "`(eval \$as_var=C; export \$as_var) 2>&1`"); then ++ eval \$as_var=C; export \$as_var ++ else ++ unset \$as_var ++ fi ++done ++ + ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]" + for ac_option + do diff --git a/sys-devel/gcc/files/gcc-configure-texinfo.patch b/sys-devel/gcc/files/gcc-configure-texinfo.patch new file mode 100644 index 0000000..ddc098d --- /dev/null +++ b/sys-devel/gcc/files/gcc-configure-texinfo.patch @@ -0,0 +1,16 @@ +Chances are quite good that the installed makeinfo is sufficient. +So ignore false positives where the makeinfo installed is so new +that it violates the cheesy version grep. + +http://bugs.gentoo.org/198182 + +--- configure ++++ configure +@@ -3573,6 +3573,6 @@ + : + else +- MAKEINFO="$MISSING makeinfo" ++ : + fi + ;; + diff --git a/sys-devel/gcc/files/gcc-spec-env.patch b/sys-devel/gcc/files/gcc-spec-env.patch new file mode 100644 index 0000000..57e7567 --- /dev/null +++ b/sys-devel/gcc/files/gcc-spec-env.patch @@ -0,0 +1,42 @@ + Add support for external spec file via the GCC_SPECS env var. This + allows us to easily control pie/ssp defaults with gcc-config profiles. + + Original patch by Rob Holland + Extended to support multiple entries separated by ':' by Kevin F. Quinn + Modified to use getenv instead of poisoned GET_ENVIRONMENT by Ryan Hill + +--- gcc-4/gcc/gcc.c ++++ gcc-4/gcc/gcc.c +@@ -6482,6 +6482,32 @@ + + /* Process any user specified specs in the order given on the command + line. */ ++#if !(defined (__MSDOS__) || defined (OS2) || defined (VMS) || defined (WIN32)) ++ /* Add specs listed in GCC_SPECS. Note; in the process of separating ++ * each spec listed, the string is overwritten at token boundaries ++ * (':') with '\0', an effect of strtok_r(). ++ */ ++ specs_file = getenv ("GCC_SPECS"); ++ if (specs_file && (strlen(specs_file) > 0)) ++ { ++ char *spec, *saveptr; ++ for (spec=strtok_r(specs_file,":",&saveptr); ++ spec!=NULL; ++ spec=strtok_r(NULL,":",&saveptr)) ++ { ++ struct user_specs *user = (struct user_specs *) ++ xmalloc (sizeof (struct user_specs)); ++ ++ user->next = (struct user_specs *) 0; ++ user->filename = spec; ++ if (user_specs_tail) ++ user_specs_tail->next = user; ++ else ++ user_specs_head = user; ++ user_specs_tail = user; ++ } ++ } ++#endif + for (uptr = user_specs_head; uptr; uptr = uptr->next) + { + char *filename = find_a_file (&startfile_prefixes, uptr->filename, diff --git a/sys-devel/gcc/files/mkinfodir b/sys-devel/gcc/files/mkinfodir new file mode 100644 index 0000000..a62840e --- /dev/null +++ b/sys-devel/gcc/files/mkinfodir @@ -0,0 +1,233 @@ +#!/bin/bash +# $Id: mkinfodir,v 1.1 2001/09/01 07:56:19 drobbins Exp $ +# Generate the top-level Info node, given a directory of Info files +# and (optionally) a skeleton file. The output will be suitable for a +# top-level dir file. The skeleton file contains info topic names in the +# order they should appear in the output. There are three special +# lines that alter the behavior: a line consisting of just "--" causes +# the next line to be echoed verbatim to the output. A line +# containing just "%%" causes all the remaining filenames (wildcards +# allowed) in the rest of the file to be ignored. A line containing +# just "!!" exits the script when reached (unless preceded by a line +# containing just "--"). Once the script reaches the end of the +# skeleton file, it goes through the remaining files in the directory +# in order, putting their entries at the end. The script will use the +# ENTRY information in each info file if it exists. Otherwise it will +# make a minimal entry. + +# sent by Jeffrey Osier <jeffrey@cygnus.com>, who thinks it came from +# zoo@winternet.com (david d `zoo' zuhn) + +# modified 7 April 1995 by Joe Harrington <jh@tecate.gsfc.nasa.gov> to +# take special flags + +INFODIR=$1 +if [ $# = 2 ] ; then + SKELETON=$2 +else + SKELETON=/dev/null +fi + +skip= + +if [ $# -gt 2 ] ; then + echo usage: $0 info-directory [ skeleton-file ] 1>&2 + exit 1 +elif [ -z "${INFODIR}" ] ; then + INFODIR="%%DEFAULT_INFO_DIR%%" +else + true +fi + +if [ ! -d ${INFODIR} ] ; then + echo "$0: first argument must specify a directory" + exit 1 +fi + +### output the dir header +echo "-*- Text -*-" +echo "This file was generated automatically by $0." +echo "This version was generated on `date`" +echo "by `whoami`@`hostname` for `(cd ${INFODIR}; pwd)`" + +cat << moobler +\$Id: mkinfodir,v 1.1 2001/09/01 07:56:19 drobbins Exp $ +This is the file .../info/dir, which contains the topmost node of the +Info hierarchy. The first time you invoke Info you start off +looking at that node, which is (dir)Top. + +File: dir Node: Top This is the top of the INFO tree + + This (the Directory node) gives a menu of major topics. + Typing "q" exits, "?" lists all Info commands, "d" returns here, + "h" gives a primer for first-timers, + "mEmacs<Return>" visits the Emacs topic, etc. + + In Emacs, you can click mouse button 2 on a menu item or cross reference + to select it. + +* Menu: The list of major topics begins on the next line. + +moobler + +### go through the list of files in the skeleton. If an info file +### exists, grab the ENTRY information from it. If an entry exists +### use it, otherwise create a minimal dir entry. +### +### Then remove that file from the list of existing files. If any +### additional files remain (ones that don't have a skeleton entry), +### then generate entries for those in the same way, putting the info for +### those at the end.... + +infofiles=`(cd ${INFODIR}; /bin/ls | grep -v '\-[0-9]*\.gz$' | grep -v '\-[0-9]*$' | egrep -v '^dir$|^dir\.info$|^dir\.orig$')` + +# echoing gets clobbered by backquotes; we do it the hard way... +lines=`wc $SKELETON | awk '{print $1}'` +line=1 +while [ $lines -ge $line ] ; do + # Read one line from the file. This is so that we can echo lines with + # whitespace and quoted characters in them. + fileline=`awk NR==$line $SKELETON` + + # flag fancy features + if [ ! -z "$echoline" ] ; then # echo line + echo "$fileline" + fileline= + echoline= + elif [ "${fileline}" = "--" ] ; then # should we echo the next line? + echoline=1 + elif [ "${fileline}" = "%%" ] ; then # eliminate remaining files from dir? + skip=1 + elif [ "${fileline}" = "!!" ] ; then # quit now + exit 0 + fi + + # handle files if they exist + for file in $fileline"" ; do # expand wildcards ("" handles blank lines) + + fname= + + if [ -z "$echoline" -a ! -z "$file" ] ; then + + # Find the file to operate upon. Check both possible names. + infoname=`echo $file | sed 's/\.gz$//'` + infoname=`echo $infoname | sed 's/\.info$//'` + noext= + ext= + if [ -f ${INFODIR}/$infoname ] ; then + noext=$infoname + fi + if [ -f ${INFODIR}/${infoname}.info ] ; then + ext=${infoname}.info + fi + if [ -f ${INFODIR}/${infoname}.info.gz ] ; then + ext=${infoname}.info.gz + fi + # If it exists with both names take what was said in the file. + if [ ! -z "$ext" -a ! -z "$noext" ]; then + fname=$file + warn="### Warning: $ext and $noext both exist! Using ${file}. ###" + elif [ ! \( -z "$ext" -a -z "$noext" \) ]; then + # just take the name if it exists only once + fname=${noext}${ext} + fi + + # if we found something and aren't skipping, do the entry + if [ ! -z "$fname" ] ; then + if [ -z "$skip" ] ; then + + if [ ! -z "$warn" ] ; then # issue any warning + echo $warn + warn= + fi + if [ "${fname##*.}" = "gz" ] ; then + entry=`zcat ${INFODIR}/${fname} | sed -e '1,/START-INFO-DIR-ENTRY/d' \ + -e '/END-INFO-DIR-ENTRY/,$d' ` + else + entry=`sed -e '1,/START-INFO-DIR-ENTRY/d' \ + -e '/END-INFO-DIR-ENTRY/,$d' ${INFODIR}/$fname` + fi + if [ ! -z "${entry}" ] ; then + echo "${entry}" + else + echo "* ${infoname}: (${infoname})." + fi + fi + + # remove the name from the directory listing + infofiles=`echo "" ${infofiles} "" | sed -e "s/ ${fname} / /" -e "s/ / /g"` + + fi + + fi + + done + + line=`expr $line + 1` +done + +if [ -z "${infofiles}" ] ; then + exit 0 +elif [ $lines -gt 0 ]; then + echo +fi + +# Sort remaining files by INFO-DIR-SECTION. +prevsect= +filesectdata=`(cd ${INFODIR}; fgrep INFO-DIR-SECTION /dev/null ${infofiles} | \ + fgrep -v 'INFO-DIR-SECTION Miscellaneous' | \ + sort -t: -k2 -k1 | tr ' ' '_')` +for sectdata in ${filesectdata}; do + file=`echo ${sectdata} | cut -d: -f1` + section=`sed -n -e 's/^INFO-DIR-SECTION //p' ${INFODIR}/${file}` + infofiles=`echo "" ${infofiles} "" | sed -e "s/ ${file} / /" -e "s/ / /g"` + + if [ "${prevsect}" != "${section}" ] ; then + if [ ! -z "${prevsect}" ] ; then + echo "" + fi + echo "${section}" + prevsect="${section}" + fi + infoname=`echo $file | sed 's/\.gz$//'` + infoname=`echo $infoname | sed 's/\.info$//'` + if [ "${file##*.}" = "gz" ] ; then + entry=`zcat ${INFODIR}/$file | sed -e '1,/START-INFO-DIR-ENTRY/d' \ + -e '/END-INFO-DIR-ENTRY/,$d' ` + else + entry=`sed -e '1,/START-INFO-DIR-ENTRY/d' \ + -e '/END-INFO-DIR-ENTRY/,$d' ${INFODIR}/$file` + fi + if [ ! -z "${entry}" ] ; then + echo "${entry}" + elif [ ! -d "${INFODIR}/${file}" ] ; then + echo "* ${infoname}: (${infoname})." + fi +done + +# Process miscellaneous files. +for file in ${infofiles}; do + if [ ! -z "${prevsect}" ] ; then + echo "" + echo "Miscellaneous" + prevsect="" + fi + + infoname=`echo $file | sed 's/\.gz$//'` + infoname=`echo $infoname | sed 's/\.info$//'` + if [ "${file##*.}" = "gz" ] ; then + entry=`zcat ${INFODIR}/${file} | sed -e '1,/START-INFO-DIR-ENTRY/d' \ + -e '/END-INFO-DIR-ENTRY/,$d'` + else + entry=`sed -e '1,/START-INFO-DIR-ENTRY/d' \ + -e '/END-INFO-DIR-ENTRY/,$d' ${INFODIR}/$file` + fi + + + if [ ! -z "${entry}" ] ; then + echo "${entry}" + elif [ ! -d "${INFODIR}/${file}" ] ; then + echo "* ${infoname}: (${infoname})." + fi +done + |