From 0f3bedb1fb69a32c9a28d235114beb0fe0830c10 Mon Sep 17 00:00:00 2001 From: Martin Schlemmer Date: Mon, 16 Dec 2002 04:27:30 +0000 Subject: update with patches; multi version/arch scheme updates --- sys-devel/gcc/ChangeLog | 12 +- sys-devel/gcc/files/3.2.1/gcc32-ada-make.patch | 29 ++ .../gcc/files/3.2.1/gcc32-shared-pthread.patch | 99 +++++ sys-devel/gcc/files/3.2.1/gcc32-sparc32-hack.patch | 66 +++ sys-devel/gcc/files/3.2.1/gcc32-testsuite.patch | 17 + .../gcc/files/3.2.1/gcc32-tls-reload-fix.patch | 216 ++++++++++ sys-devel/gcc/files/cc | 3 + sys-devel/gcc/files/cpp | 3 + sys-devel/gcc/files/digest-gcc-3.2.1-r1 | 2 + sys-devel/gcc/files/digest-gcc-3.2.1-r6 | 2 + sys-devel/gcc/gcc-2.95.3-r8.ebuild | 16 +- sys-devel/gcc/gcc-3.2.1-r1.ebuild | 456 ++++++++++++++++++++ sys-devel/gcc/gcc-3.2.1-r6.ebuild | 477 +++++++++++++++++++++ 13 files changed, 1390 insertions(+), 8 deletions(-) create mode 100644 sys-devel/gcc/files/3.2.1/gcc32-ada-make.patch create mode 100644 sys-devel/gcc/files/3.2.1/gcc32-shared-pthread.patch create mode 100644 sys-devel/gcc/files/3.2.1/gcc32-sparc32-hack.patch create mode 100644 sys-devel/gcc/files/3.2.1/gcc32-testsuite.patch create mode 100644 sys-devel/gcc/files/3.2.1/gcc32-tls-reload-fix.patch create mode 100644 sys-devel/gcc/files/cc create mode 100644 sys-devel/gcc/files/cpp create mode 100644 sys-devel/gcc/files/digest-gcc-3.2.1-r1 create mode 100644 sys-devel/gcc/files/digest-gcc-3.2.1-r6 create mode 100644 sys-devel/gcc/gcc-3.2.1-r1.ebuild create mode 100644 sys-devel/gcc/gcc-3.2.1-r6.ebuild diff --git a/sys-devel/gcc/ChangeLog b/sys-devel/gcc/ChangeLog index 3f8b11f4a22a..6fab0119cfc2 100644 --- a/sys-devel/gcc/ChangeLog +++ b/sys-devel/gcc/ChangeLog @@ -1,6 +1,16 @@ # ChangeLog for sys-devel/gcc # Copyright 2002 Gentoo Technologies, Inc.; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/sys-devel/gcc/ChangeLog,v 1.50 2002/12/15 17:05:50 azarah Exp $ +# $Header: /var/cvsroot/gentoo-x86/sys-devel/gcc/ChangeLog,v 1.51 2002/12/16 04:27:29 azarah Exp $ + +*gcc-3.2.1-r1 (16 Dec 2002) +*gcc-3.2.1-r6 (16 Dec 2002) + + 16 Dec 2002; Martin Schlemmer gcc-3.2.1-r1.ebuild, + gcc-3.2.1-r6.ebuild : + + Update with patches from Redhat, and also update with patch against 2002-12-08 + CVS branch. For -r6, changed the /lib/cpp and /usr/bin/cc symlinks to wrapper + scripts, which is more generic if we do not fisically switch gcc profiles. 15 Dec 2002; Martin Schlemmer gcc-2.95.3-r*.ebuild : Fix CXX to equal 'g++'. For some reason I was under the impression that diff --git a/sys-devel/gcc/files/3.2.1/gcc32-ada-make.patch b/sys-devel/gcc/files/3.2.1/gcc32-ada-make.patch new file mode 100644 index 000000000000..6e7ea8dc3393 --- /dev/null +++ b/sys-devel/gcc/files/3.2.1/gcc32-ada-make.patch @@ -0,0 +1,29 @@ +2002-05-14 Rainer Orth + + * Make-lang.in (gnat1$(exeext), gnatbind$(exeext), gnattools): + Restore $(CONFIG_H) and prefix.o dependencies. + (ada.stage[1-4]): Depend on stage?-start. + +--- gcc/ada/Make-lang.in.jj 2002-05-02 12:13:22.000000000 +0200 ++++ gcc/ada/Make-lang.in 2002-12-09 17:45:36.000000000 +0100 +@@ -595,16 +595,16 @@ ada.maintainer-clean: + # Stage hooks: + # The main makefile has already created stage?/ada + +-ada.stage1: ++ada.stage1: stage1-start + -$(MV) ada/*$(objext) ada/*.ali ada/b_*.c stage1/ada + -$(MV) ada/stamp-* stage1/ada +-ada.stage2: ++ada.stage2: stage2-start + -$(MV) ada/*$(objext) ada/*.ali ada/b_*.c stage2/ada + -$(MV) ada/stamp-* stage2/ada +-ada.stage3: ++ada.stage3: stage3-start + -$(MV) ada/*$(objext) ada/*.ali ada/b_*.c stage3/ada + -$(MV) ada/stamp-* stage3/ada +-ada.stage4: ++ada.stage4: stage4-start + -$(MV) ada/*$(objext) ada/*.ali ada/b_*.c stage4/ada + -$(MV) ada/stamp-* stage4/ada + diff --git a/sys-devel/gcc/files/3.2.1/gcc32-shared-pthread.patch b/sys-devel/gcc/files/3.2.1/gcc32-shared-pthread.patch new file mode 100644 index 000000000000..7c389d08798b --- /dev/null +++ b/sys-devel/gcc/files/3.2.1/gcc32-shared-pthread.patch @@ -0,0 +1,99 @@ +--- gcc/config/alpha/linux-elf.h.jj 2001-12-31 12:12:33.000000000 +0100 ++++ gcc/config/alpha/linux-elf.h 2002-12-09 13:49:25.000000000 +0100 +@@ -39,5 +39,5 @@ Boston, MA 02111-1307, USA. */ + #ifndef USE_GNULIBC_1 + #undef LIB_SPEC + #define LIB_SPEC \ +-"%{shared:-lc}%{!shared:%{pthread:-lpthread }%{profile:-lc_p}%{!profile:-lc}} " ++"%{pthread:-lpthread }%{shared:-lc}%{!shared:%{profile:-lc_p}%{!profile:-lc}} " + #endif +--- gcc/config/alpha/linux.h.jj 2002-04-16 13:03:23.000000000 +0200 ++++ gcc/config/alpha/linux.h 2002-12-09 13:49:56.000000000 +0100 +@@ -34,9 +34,9 @@ SUB_CPP_PREDEFINES + + #undef LIB_SPEC + #define LIB_SPEC \ +- "%{shared: -lc} \ +- %{!shared: %{pthread:-lpthread} \ +- %{profile:-lc_p} %{!profile: -lc}}" ++ "%{pthread:-lpthread} \ ++ %{shared:-lc} \ ++ %{!shared: %{profile:-lc_p}%{!profile:-lc}}" + + /* Show that we need a GP when profiling. */ + #undef TARGET_PROFILING_NEEDS_GP +--- gcc/config/arm/linux-elf.h.jj 2002-04-16 13:03:38.000000000 +0200 ++++ gcc/config/arm/linux-elf.h 2002-12-09 13:50:39.000000000 +0100 +@@ -48,9 +48,9 @@ Boston, MA 02111-1307, USA. */ + + /* Now we define the strings used to build the spec file. */ + #define LIB_SPEC \ +- "%{shared: -lc} \ +- %{!shared: %{pthread:-lpthread} \ +- %{profile:-lc_p} %{!profile: -lc}}" ++ "%{pthread:-lpthread} \ ++ %{shared:-lc} \ ++ %{!shared:%{profile:-lc_p}%{!profile:-lc}}" + + #define LIBGCC_SPEC "%{msoft-float:-lfloat} -lgcc" + +--- gcc/config/pa/pa-linux.h.jj 2002-06-03 17:24:33.000000000 +0200 ++++ gcc/config/pa/pa-linux.h 2002-12-09 13:54:55.000000000 +0100 +@@ -33,9 +33,9 @@ Boston, MA 02111-1307, USA. */ + + #undef LIB_SPEC + #define LIB_SPEC \ +- "%{shared: -lgcc -lc} \ +- %{!shared: %{mieee-fp:-lieee} %{pthread:-lpthread} \ +- %{shared-libgcc: -lgcc} %{profile:-lc_p} %{!profile: -lc}}" ++ "%{pthread:-lpthread} \ ++ %{shared:-lgcc -lc} \ ++ %{!shared:%{mieee-fp:-lieee} %{shared-libgcc:-lgcc} %{profile:-lc_p}%{!profile:-lc}}" + + #undef ASM_SPEC + #define ASM_SPEC \ +--- gcc/config/sparc/linux.h.jj 2002-04-29 16:22:40.000000000 +0200 ++++ gcc/config/sparc/linux.h 2002-12-09 13:56:39.000000000 +0100 +@@ -123,9 +123,9 @@ Boston, MA 02111-1307, USA. */ + %{!profile:%{!ggdb:-lc} %{ggdb:-lg}}}" + #else + #define LIB_SPEC \ +- "%{shared: -lc} \ +- %{!shared: %{mieee-fp:-lieee} %{pthread:-lpthread} \ +- %{profile:-lc_p} %{!profile: -lc}}" ++ "%{pthread:-lpthread} \ ++ %{shared:-lc} \ ++ %{!shared:%{mieee-fp:-lieee} %{profile:-lc_p}%{!profile:-lc}}" + #endif + #else + #define LIB_SPEC \ +--- gcc/config/sparc/linux64.h.jj 2002-10-08 15:29:41.000000000 +0200 ++++ gcc/config/sparc/linux64.h 2002-12-09 13:56:25.000000000 +0100 +@@ -126,9 +126,9 @@ Boston, MA 02111-1307, USA. */ + + #undef LIB_SPEC + #define LIB_SPEC \ +- "%{shared: -lc} \ +- %{!shared: %{mieee-fp:-lieee} %{pthread:-lpthread} \ +- %{profile:-lc_p} %{!profile: -lc}}" ++ "%{pthread:-lpthread} \ ++ %{shared:-lc} \ ++ %{!shared: %{mieee-fp:-lieee} %{profile:-lc_p}%{!profile:-lc}}" + + /* Provide a LINK_SPEC appropriate for GNU/Linux. Here we provide support + for the special GCC options -static and -shared, which allow us to +--- gcc/config/linux.h.jj 2001-12-18 01:30:48.000000000 +0100 ++++ gcc/config/linux.h 2002-12-09 13:48:20.000000000 +0100 +@@ -93,9 +93,9 @@ Boston, MA 02111-1307, USA. */ + %{!profile:%{!ggdb:-lc} %{ggdb:-lg}}}" + #else + #define LIB_SPEC \ +- "%{shared: -lc} \ +- %{!shared: %{mieee-fp:-lieee} %{pthread:-lpthread} \ +- %{profile:-lc_p} %{!profile: -lc}}" ++ "%{pthread:-lpthread} \ ++ %{shared:-lc} \ ++ %{!shared:%{mieee-fp:-lieee} %{profile:-lc_p}%{!profile:-lc}}" + #endif + #else + #define LIB_SPEC \ 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 000000000000..0e03e36f64f6 --- /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-testsuite.patch b/sys-devel/gcc/files/3.2.1/gcc32-testsuite.patch new file mode 100644 index 000000000000..fcedc534f604 --- /dev/null +++ b/sys-devel/gcc/files/3.2.1/gcc32-testsuite.patch @@ -0,0 +1,17 @@ +--- gcc/testsuite/g++.dg/template/varmod1.C.jj 2002-12-08 21:43:53.000000000 +0100 ++++ gcc/testsuite/g++.dg/template/varmod1.C 2002-12-09 14:01:33.000000000 +0100 +@@ -6,5 +6,5 @@ void bar() + { + int i; + int A[i][i]; +- foo(A); // { dg-error } ++ foo(A); // { dg-error "" } + } +--- gcc/testsuite/g++.dg/parse/parameter-declaration-1.C.jj 2002-12-08 21:43:51.000000000 +0100 ++++ gcc/testsuite/g++.dg/parse/parameter-declaration-1.C 2002-12-09 14:04:07.000000000 +0100 +@@ -3,4 +3,4 @@ + // { dg-do compile } + + struct { +- a(void = 0; a(0), a(0) // { dg-error "" } ++ a(void = 0; a(0), a(0) // { dg-error "" "" { target *-*-* } 7 } diff --git a/sys-devel/gcc/files/3.2.1/gcc32-tls-reload-fix.patch b/sys-devel/gcc/files/3.2.1/gcc32-tls-reload-fix.patch new file mode 100644 index 000000000000..83259ffbee5a --- /dev/null +++ b/sys-devel/gcc/files/3.2.1/gcc32-tls-reload-fix.patch @@ -0,0 +1,216 @@ +--- gcc/config/i386/i386.c.jj 2002-11-15 19:50:05.000000000 +0100 ++++ gcc/config/i386/i386.c 2002-12-08 22:09:30.000000000 +0100 +@@ -707,6 +707,7 @@ struct ix86_address + }; + + static int ix86_decompose_address PARAMS ((rtx, struct ix86_address *)); ++static bool ix86_cannot_force_const_mem PARAMS ((rtx)); + + struct builtin_description; + static rtx ix86_expand_sse_comi PARAMS ((const struct builtin_description *, +@@ -837,6 +838,8 @@ static enum x86_64_reg_class merge_class + #undef TARGET_HAVE_TLS + #define TARGET_HAVE_TLS true + #endif ++#undef TARGET_CANNOT_FORCE_CONST_MEM ++#define TARGET_CANNOT_FORCE_CONST_MEM ix86_cannot_force_const_mem + + struct gcc_target targetm = TARGET_INITIALIZER; + +@@ -4952,6 +4955,13 @@ legitimate_constant_p (x) + return true; + } + ++static bool ++ix86_cannot_force_const_mem (x) ++ rtx x; ++{ ++ return !legitimate_constant_p (x); ++} ++ + /* Determine if a given RTX is a valid constant address. */ + + bool +@@ -7568,29 +7578,6 @@ ix86_expand_move (mode, operands) + op0 = operands[0]; + op1 = operands[1]; + +- /* ??? We have a slight problem. We need to say that tls symbols are +- not legitimate constants so that reload does not helpfully reload +- these constants from a REG_EQUIV, which we cannot handle. (Recall +- that general- and local-dynamic address resolution requires a +- function call.) +- +- However, if we say that tls symbols are not legitimate constants, +- then emit_move_insn helpfully drop them into the constant pool. +- +- It is far easier to work around emit_move_insn than reload. Recognize +- the MEM that we would have created and extract the symbol_ref. */ +- +- if (mode == Pmode +- && GET_CODE (op1) == MEM +- && RTX_UNCHANGING_P (op1)) +- { +- tmp = maybe_get_pool_constant (op1); +- /* Note that we only care about symbolic constants here, which +- unlike CONST_INT will always have a proper mode. */ +- if (tmp && GET_MODE (tmp) == Pmode) +- op1 = tmp; +- } +- + if (tls_symbolic_operand (op1, Pmode)) + { + op1 = legitimize_address (op1, op1, VOIDmode); +--- gcc/testsuite/gcc.dg/tls/opt-4.c.jj 2002-12-08 22:09:30.000000000 +0100 ++++ gcc/testsuite/gcc.dg/tls/opt-4.c 2002-12-08 22:09:30.000000000 +0100 +@@ -0,0 +1,53 @@ ++/* { dg-do compile } */ ++/* { dg-options "-O2" } */ ++ ++struct A ++{ ++ int a1; ++ int a2; ++}; ++ ++extern __thread const unsigned char *tcc1, **tcc2; ++ ++extern inline const unsigned char ** __attribute__ ((const)) ++foo (void) ++{ ++ const unsigned char **a = &tcc1; ++ if (*a == 0) ++ *a = *tcc2 + 128; ++ return a; ++} ++ ++extern inline int ++bar (const struct A *x) ++{ ++ int a; ++ ++ if (x->a2 & 8) ++ return 0; ++ a = x->a1; ++ return a > 0 && ((*foo ())[a] & 64); ++} ++ ++int ++baz (const struct A *x, char *y) ++{ ++ const struct A *a; ++ ++ for (a = x; !!a->a1; a++) ++ if (! (x->a2 & 8)) ++ if (bar (a)) ++ { ++ *y++ = a->a1; ++ if (x->a1) ++ *y++ = ':'; ++ *y = '\0'; ++ } ++ return 0; ++} ++ ++/* Verify tcc1 and tcc2 variables show up only in the TLS access sequences. */ ++/* { dg-final { scan-assembler "tcc1@" { target i?86-*-* x86_64-*-* } } } */ ++/* { dg-final { scan-assembler "tcc2@" { target i?86-*-* x86_64-*-* } } } */ ++/* { dg-final { scan-assembler-not "tcc1\[^@\]" { target i?86-*-* x86_64-*-* } } } */ ++/* { dg-final { scan-assembler-not "tcc2\[^@\]" { target i?86-*-* x86_64-*-* } } } */ +--- gcc/expr.c.jj 2002-11-09 18:38:42.000000000 +0100 ++++ gcc/expr.c 2002-12-08 22:15:02.000000000 +0100 +@@ -2782,6 +2782,12 @@ emit_move_insn (x, y) + { + y_cst = y; + y = force_const_mem (mode, y); ++ ++ /* If the target's cannot_force_const_mem prevented the spill, ++ assume that the target's move expanders will also take care ++ of the non-legitimate constant. */ ++ if (!y) ++ y = y_cst; + } + + /* If X or Y are memory references, verify that their addresses are valid +--- gcc/hooks.c.jj 2002-11-09 18:38:45.000000000 +0100 ++++ gcc/hooks.c 2002-12-08 22:09:29.000000000 +0100 +@@ -46,3 +46,10 @@ hook_tree_bool_false (a) + { + return false; + } ++ ++bool ++hook_bool_rtx_false (a) ++ rtx a ATTRIBUTE_UNUSED; ++{ ++ return false; ++} +--- gcc/hooks.h.jj 2002-11-09 18:38:45.000000000 +0100 ++++ gcc/hooks.h 2002-12-08 22:16:51.000000000 +0100 +@@ -25,5 +25,6 @@ Foundation, 59 Temple Place - Suite 330, + bool hook_void_bool_false PARAMS ((void)); + void hook_void_void PARAMS ((void)); + bool hook_tree_bool_false PARAMS ((tree)); ++bool hook_bool_rtx_false PARAMS ((rtx)); + + #endif +--- gcc/reload1.c.jj 2002-10-16 16:10:07.000000000 +0200 ++++ gcc/reload1.c 2002-12-08 22:09:29.000000000 +0100 +@@ -820,8 +820,12 @@ reload (first, global) + else if (LEGITIMATE_CONSTANT_P (x)) + reg_equiv_constant[i] = x; + else +- reg_equiv_memory_loc[i] +- = force_const_mem (GET_MODE (SET_DEST (set)), x); ++ { ++ reg_equiv_memory_loc[i] ++ = force_const_mem (GET_MODE (SET_DEST (set)), x); ++ if (!reg_equiv_memory_loc[i]) ++ continue; ++ } + } + else + continue; +--- gcc/target-def.h.jj 2002-09-24 15:07:32.000000000 +0200 ++++ gcc/target-def.h 2002-12-08 22:18:20.000000000 +0100 +@@ -181,6 +181,7 @@ Foundation, 59 Temple Place - Suite 330, + + /* In hook.c. */ + #define TARGET_CANNOT_MODIFY_JUMPS_P hook_void_bool_false ++#define TARGET_CANNOT_FORCE_CONST_MEM hook_bool_rtx_false + + /* The whole shebang. */ + #define TARGET_INITIALIZER \ +@@ -199,6 +200,7 @@ Foundation, 59 Temple Place - Suite 330, + TARGET_EXPAND_BUILTIN, \ + TARGET_SECTION_TYPE_FLAGS, \ + TARGET_CANNOT_MODIFY_JUMPS_P, \ ++ TARGET_CANNOT_FORCE_CONST_MEM, \ + TARGET_HAVE_NAMED_SECTIONS, \ + TARGET_HAVE_CTORS_DTORS, \ + TARGET_HAVE_TLS \ +--- gcc/target.h.jj 2002-09-24 15:07:32.000000000 +0200 ++++ gcc/target.h 2002-12-08 22:17:34.000000000 +0100 +@@ -182,6 +182,9 @@ struct gcc_target + not, at the current point in the compilation. */ + bool (* cannot_modify_jumps_p) PARAMS ((void)); + ++ /* True if the constant X cannot be placed in the constant pool. */ ++ bool (* cannot_force_const_mem) PARAMS ((rtx)); ++ + /* True if arbitrary sections are supported. */ + bool have_named_sections; + +--- gcc/varasm.c.jj 2002-11-26 17:23:47.000000000 +0100 ++++ gcc/varasm.c 2002-12-08 22:09:30.000000000 +0100 +@@ -3789,6 +3789,10 @@ force_const_mem (mode, x) + struct pool_constant *pool; + unsigned int align; + ++ /* If we're not allowed to drop X into the constant pool, don't. */ ++ if ((*targetm.cannot_force_const_mem) (x)) ++ return NULL_RTX; ++ + /* Compute hash code of X. Search the descriptors for that hash code + to see if any of them describes X. If yes, we have an rtx to use. */ + hash = const_hash_rtx (mode, x); diff --git a/sys-devel/gcc/files/cc b/sys-devel/gcc/files/cc new file mode 100644 index 000000000000..c1c24e1bd131 --- /dev/null +++ b/sys-devel/gcc/files/cc @@ -0,0 +1,3 @@ +#!/bin/sh + +gcc "$@" diff --git a/sys-devel/gcc/files/cpp b/sys-devel/gcc/files/cpp new file mode 100644 index 000000000000..e4a91acae67a --- /dev/null +++ b/sys-devel/gcc/files/cpp @@ -0,0 +1,3 @@ +#!/bin/sh + +cpp "$@" diff --git a/sys-devel/gcc/files/digest-gcc-3.2.1-r1 b/sys-devel/gcc/files/digest-gcc-3.2.1-r1 new file mode 100644 index 000000000000..a27e9247b059 --- /dev/null +++ b/sys-devel/gcc/files/digest-gcc-3.2.1-r1 @@ -0,0 +1,2 @@ +MD5 94a4a76c602b422c8edd66433eeacb7f gcc-3.2.1.tar.bz2 20605134 +MD5 e363241306dc1a8ab10ac94171906e06 gcc-3.2.1-branch-update-20021208.patch.bz2 1049463 diff --git a/sys-devel/gcc/files/digest-gcc-3.2.1-r6 b/sys-devel/gcc/files/digest-gcc-3.2.1-r6 new file mode 100644 index 000000000000..a27e9247b059 --- /dev/null +++ b/sys-devel/gcc/files/digest-gcc-3.2.1-r6 @@ -0,0 +1,2 @@ +MD5 94a4a76c602b422c8edd66433eeacb7f gcc-3.2.1.tar.bz2 20605134 +MD5 e363241306dc1a8ab10ac94171906e06 gcc-3.2.1-branch-update-20021208.patch.bz2 1049463 diff --git a/sys-devel/gcc/gcc-2.95.3-r8.ebuild b/sys-devel/gcc/gcc-2.95.3-r8.ebuild index c480549710e8..28cc20c8ef5a 100644 --- a/sys-devel/gcc/gcc-2.95.3-r8.ebuild +++ b/sys-devel/gcc/gcc-2.95.3-r8.ebuild @@ -1,6 +1,6 @@ # Copyright 1999-2002 Gentoo Technologies, Inc. # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/sys-devel/gcc/gcc-2.95.3-r8.ebuild,v 1.6 2002/12/15 17:05:50 azarah Exp $ +# $Header: /var/cvsroot/gentoo-x86/sys-devel/gcc/gcc-2.95.3-r8.ebuild,v 1.7 2002/12/16 04:27:29 azarah Exp $ IUSE="static nls bootstrap java build" @@ -61,7 +61,7 @@ KEYWORDS="~x86 ~ppc ~sparc ~alpha" # are not cross compiling, than we want SLOT to only contain # $PV, as people upgrading to new gcc layout will not have # their old gcc unmerged ... -if [ "${CHOST}" = "${CCHOST}" ] +if [ "${CHOST}" == "${CCHOST}" ] then SLOT="${MY_PV}" else @@ -74,7 +74,7 @@ DEPEND="virtual/glibc nls? ( sys-devel/gettext ) )" RDEPEND="virtual/glibc - >=sys-devel/gcc-config-1.2 + >=sys-devel/gcc-config-1.2.2 >=sys-libs/zlib-1.1.4 >=sys-apps/texinfo-4.2-r4 !build? ( >=sys-libs/ncurses-5.2-r2 )" @@ -239,9 +239,11 @@ src_install() { echo "CC=\"gcc\"" >> ${D}/etc/env.d/05gcc echo "CXX=\"g++\"" >> ${D}/etc/env.d/05gcc - # Dummies to get CONTENTS right .. will handle with gcc-config - touch ${D}/lib/cpp - touch ${D}/usr/bin/cc + # Install wrappers + exeinto /lib + doexe ${FILESDIR}/cpp + exeinto /usr/bin + doexe ${FILESDIR}/cc # Make sure we dont have stuff lying around that # can nuke multiple versions of gcc @@ -320,7 +322,7 @@ src_install() { pkg_postinst() { - if [ "${ROOT}" = "/" -a "${COMPILER}" != "gcc3" ] + if [ "${ROOT}" = "/" -a "${COMPILER}" != "gcc3" -a "${CHOST}" == "${CCHOST}" ] then gcc-config --use-portage-chost ${CCHOST}-${MY_PV_FULL} fi diff --git a/sys-devel/gcc/gcc-3.2.1-r1.ebuild b/sys-devel/gcc/gcc-3.2.1-r1.ebuild new file mode 100644 index 000000000000..cb89ca1fc604 --- /dev/null +++ b/sys-devel/gcc/gcc-3.2.1-r1.ebuild @@ -0,0 +1,456 @@ +# Copyright 1999-2002 Gentoo Technologies, Inc. +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/sys-devel/gcc/gcc-3.2.1-r1.ebuild,v 1.1 2002/12/16 04:27:29 azarah Exp $ + +IUSE="static nls bootstrap java build" + +# NOTE TO MAINTAINER: Info pages get nuked for multiple version installs. +# Ill fix it later if i get a chance. + +inherit eutils flag-o-matic libtool + +# Compile problems with these (bug #6641 among others)... +filter-flags "-fno-exceptions -fomit-frame-pointer" + +# Recently there has been a lot of stability problem in Gentoo-land. Many +# things can be the cause to this, but I believe that it is due to gcc3 +# still having issues with optimizations, or with it not filtering bad +# combinations (protecting the user maybe from himeself) yet. +# +# This can clearly be seen in large builds like glibc, where too aggressive +# CFLAGS cause the tests to fail miserbly. +# +# Quote from Nick Jones , who in my opinion +# knows what he is talking about: +# +# People really shouldn't force code-specific options on... It's a +# bad idea. The -march options aren't just to look pretty. They enable +# options that are sensible (and include sse,mmx,3dnow when apropriate). +# +# The next command strips CFLAGS and CXXFLAGS from nearly all flags. If +# you do not like it, comment it, but do not bugreport if you run into +# problems. +# +# (13 Oct 2002) +strip-flags + +LOC="/usr" +MY_PV="`echo ${PV/_pre} | cut -d. -f1,2`" +GCC_SUFFIX="-${MY_PV}" +# Dont install in /usr/include/g++-v3/, as it will nuke gcc-3.0.x installs +STDCXX_INCDIR="${LOC}/include/g++-v${MY_PV/\./}" + +# Patch tarball support ... +#PATCH_VER="1.0" +PATCH_VER="" + +# Snapshot support ... +#SNAPSHOT="2002-08-12" +SNAPSHOT="" + +# Branch update support ... +#BRANCH_UPDATE="20021208" +BRANCH_UPDATE="20021208" + +if [ -z "${SNAPSHOT}" ] +then + S="${WORKDIR}/${P}" + SRC_URI="ftp://gcc.gnu.org/pub/gcc/releases/${P}/${P}.tar.bz2" + + if [ -n "${PATCH_VER}" ] + then + SRC_URI="${SRC_URI} + mirror://gentoo/${P}-patches-${PATCH_VER}.tar.bz2" + fi + + if [ -n "${BRANCH_UPDATE}" ] + then + SRC_URI="${SRC_URI} + mirror://gentoo/${P}-branch-update-${BRANCH_UPDATE}.patch.bz2" + fi +else + S="${WORKDIR}/gcc-${SNAPSHOT//-}" + SRC_URI="ftp://sources.redhat.com/pub/gcc/snapshots/${SNAPSHOT}/gcc-${SNAPSHOT//-}.tar.bz2" +fi + +DESCRIPTION="Modern C/C++ compiler written by the GNU people" +HOMEPAGE="http://www.gnu.org/software/gcc/gcc.html" + +LICENSE="GPL-2 LGPL-2.1" +SLOT="${MY_PV}" +KEYWORDS="~x86 ~ppc ~sparc ~alpha ~mips" + +DEPEND="virtual/glibc + !build? ( >=sys-libs/ncurses-5.2-r2 + nls? ( sys-devel/gettext ) )" + +RDEPEND="virtual/glibc + >=sys-libs/zlib-1.1.4 + >=sys-apps/texinfo-4.2-r4 + !build? ( >=sys-libs/ncurses-5.2-r2 )" + + +build_multiple() { + # Try to make sure that we should build multiple + # versions of gcc (dual install of gcc2 and gcc3) + profile="`readlink /etc/make.profile`" + # [ "`gcc -dumpversion | cut -d. -f1,2`" != "`echo ${PV} | cut -d. -f1,2`" ] + # + # Check the major and minor versions only, and drop the micro version. + # This is done, as compadibility only differ when major and minor differ. + if [ -z "`use build`" ] && \ + [ -z "`use bootstrap`" ] && \ + [ "`gcc -dumpversion | cut -d. -f1,2`" != "${MY_PV}" ] && \ + [ "${profile/gcc3}" = "${profile}" ] && \ + [ "${GCCBUILD}" != "default" ] + then + return 0 + else + return 1 + fi +} + +# Used to patch Makefiles to install into the build dir +FAKE_ROOT="" + +src_unpack() { + if [ -z "${SNAPSHOT}" ] + then + unpack ${P}.tar.bz2 + else + unpack gcc-${SNAPSHOT//-}.tar.bz2 + fi + + cd ${S} + # Fixup libtool to correctly generate .la files with portage + elibtoolize --portage --shallow + + # Branch update ... + if [ -n "${BRANCH_UPDATE}" ] + then + epatch ${DISTDIR}/${P}-branch-update-${BRANCH_UPDATE}.patch.bz2 + fi + + # Do bulk patches included in ${P}-patches-${PATCH_VER}.tar.bz2 + if [ -n "${PATCH_VER}" ] + then + epatch ${WORKDIR}/patch + fi + + # Patches from Redhat ... + epatch ${FILESDIR}/${PV}/gcc32-ada-make.patch + epatch ${FILESDIR}/${PV}/gcc32-shared-pthread.patch + use sparc && epatch ${FILESDIR}/${PV}/gcc32-sparc32-hack.patch + epatch ${FILESDIR}/${PV}/gcc32-testsuite.patch + epatch ${FILESDIR}/${PV}/gcc32-tls-reload-fix.patch + + # Currently if any path is changed via the configure script, it breaks + # installing into ${D}. We should not patch it in src_install() with + # absolute paths, as some modules then gets rebuild with the wrong + # paths. Thus we use $FAKE_ROOT. + cd ${S} + for x in $(find . -name Makefile.in) + do +# cp ${x} ${x}.orig + # Fix --datadir= +# sed -e 's:datadir = @datadir@:datadir = $(FAKE_ROOT)@datadir@:' \ +# ${x}.orig > ${x} + cp ${x} ${x}.orig + # Fix --with-gxx-include-dir= + sed -e 's:gxx_include_dir = @gxx_:gxx_include_dir = $(FAKE_ROOT)@gxx_:' \ + -e 's:glibcppinstalldir = @gxx_:glibcppinstalldir = $(FAKE_ROOT)@gxx_:' \ + ${x}.orig > ${x} + rm -f ${x}.orig + done + + # This next bit is for updating libtool linker scripts ... + OLD_GCC_VERSION="`gcc -dumpversion`" + + if [ "${OLD_GCC_VERSION}" != "${PV/_pre}" ] + then + echo "${OLD_GCC_VERSION}" > ${WORKDIR}/.oldgccversion + fi +} + +src_compile() { + local myconf="" + local gcc_lang="" + if [ -z "`use build`" ] + then + myconf="${myconf} --enable-shared" + gcc_lang="c,c++,ada,f77,objc" + else + gcc_lang="c" + fi + if [ -z "`use nls`" ] || [ "`use build`" ] + then + myconf="${myconf} --disable-nls" + else + myconf="${myconf} --enable-nls --without-included-gettext" + fi + if [ -n "`use java`" ] && [ -z "`use build`" ] + then + gcc_lang="${gcc_lang},java" + fi + + # Only build with a program suffix if it is not our + # default compiler. Also check $GCCBUILD until we got + # compilers sorted out. + # + # NOTE: for software to detirmine gcc version, it will be easier + # if we have gcc, gcc-3.0 and gcc-3.1, and NOT gcc-3.0.4. + if build_multiple + then + myconf="${myconf} --program-suffix=${GCC_SUFFIX}" + fi + + # In general gcc does not like optimization + export CFLAGS="${CFLAGS//-O?}" + export CXXFLAGS="${CXXFLAGS//-O?}" + + # Build in a separate build tree + mkdir -p ${WORKDIR}/build + cd ${WORKDIR}/build + + addwrite "/dev/zero" + ${S}/configure --prefix=${LOC} \ + --mandir=${LOC}/share/man \ + --infodir=${LOC}/share/info \ + --enable-shared \ + --host=${CHOST} \ + --build=${CHOST} \ + --target=${CHOST} \ + --with-system-zlib \ + --enable-languages=${gcc_lang} \ + --enable-threads=posix \ + --enable-long-long \ + --disable-checking \ + --enable-cstdio=stdio \ + --enable-clocale=generic \ + --enable-__cxa_atexit \ + --enable-version-specific-runtime-libs \ + --with-gxx-include-dir=${STDCXX_INCDIR} \ + --with-local-prefix=${LOC}/local \ + ${myconf} || die + + touch ${S}/gcc/c-gperf.h + + if [ -z "`use static`" ] + then + # Fix for our libtool-portage.patch + S="${WORKDIR}/build" \ + emake bootstrap-lean \ + BOOT_CFLAGS="${CFLAGS}" STAGE1_CFLAGS="-O" || die + # Above FLAGS optimize and speedup build, thanks + # to Jeff Garzik + else + S="${WORKDIR}/build" \ + emake LDFLAGS=-static bootstrap \ + BOOT_CFLAGS="${CFLAGS}" STAGE1_CFLAGS="-O" || die + fi +} + +src_install() { + # Do allow symlinks in ${LOC}/lib/gcc-lib/${CHOST}/${PV}/include as + # this can break the build. + for x in cd ${WORKDIR}/build/gcc/include/* + do + if [ -L ${x} ] + then + rm -f ${x} + fi + done + + # Do the 'make install' from the build directory + cd ${WORKDIR}/build + S="${WORKDIR}/build" \ + make prefix=${D}${LOC} \ + mandir=${D}${LOC}/share/man \ + infodir=${D}${LOC}/share/info \ + FAKE_ROOT=${D} \ + install || die + + if ! build_multiple + then + GCC_SUFFIX="" + fi + + [ -e ${D}${LOC}/bin/gcc${GCC_SUFFIX} ] || die "gcc not found in ${D}" + + FULLPATH=${LOC}/lib/gcc-lib/${CHOST}/${PV/_pre} + FULLPATH_D=${D}${LOC}/lib/gcc-lib/${CHOST}/${PV/_pre} + cd ${FULLPATH_D} + dodir /lib + dodir /etc/env.d + echo "LDPATH=\"${FULLPATH}\"" > ${D}/etc/env.d/05gcc${GCC_SUFFIX} + # Also set CC and CXX + echo "CC=\"gcc\"" >> ${D}/etc/env.d/05gcc + echo "CXX=\"g++\"" >> ${D}/etc/env.d/05gcc + + if ! build_multiple + then + dosym /usr/bin/cpp /lib/cpp + dosym gcc /usr/bin/cc + fi + +# This is fixed via the linker scripts (bug #4411) .... +# +# # gcc-3.1 have a problem with the ordering of Search Directories. For +# # instance, if you have libreadline.so in /lib, and libreadline.a in +# # /usr/lib, then it will link with libreadline.a instead of .so. As far +# # as I can see from the source, /lib should be searched before /usr/lib, +# # and this also differs from gcc-2.95.3 and possibly 3.0.4, but ill have +# # to check on 3.0.4. Thanks to Daniel Robbins for noticing this oddity, +# # bugzilla bug #4411 +# # +# # Azarah - 3 Jul 2002 +# # +# cd ${FULLPATH_D} +# dosed -e "s:%{L\*} %(link_libgcc):%{L\*} -L/lib %(link_libgcc):" \ +# ${FULLPATH}/specs + + # Make sure we dont have stuff lying around that + # can nuke multiple versions of gcc + if [ -z "`use build`" ] + then + cd ${FULLPATH_D} + + # Tell libtool files where real libraries are + for LA in ${D}${LOC}/lib/*.la ${FULLPATH_D}/../*.la + do + if [ -f ${LA} ] + then + sed -e "s:/usr/lib:${FULLPATH}:" ${LA} > ${LA}.hacked + mv ${LA}.hacked ${LA} + mv ${LA} ${FULLPATH_D} + fi + done + + # Move all the libraries to version specific libdir. + for x in ${D}${LOC}/lib/*.{so,a}* ${FULLPATH_D}/../*.{so,a}* + do + [ -f ${x} ] && mv -f ${x} ${FULLPATH_D} + done + + # Move Java headers to compiler-specific dir + for x in ${D}${LOC}/include/gc*.h ${D}${LOC}/include/j*.h + do + [ -f ${x} ] && mv -f ${x} ${FULLPATH_D}/include/ + done + for x in gcj gnu java javax org + do + if [ -d ${D}${LOC}/include/${x} ] + then + mkdir -p ${FULLPATH_D}/include/${x} + mv -f ${D}${LOC}/include/${x}/* ${FULLPATH_D}/include/${x}/ + rm -rf ${D}${LOC}/include/${x} + fi + done + + # Move libgcj.spec to compiler-specific directories + [ -f ${D}${LOC}/lib/libgcj.spec ] && \ + mv -f ${D}${LOC}/lib/libgcj.spec ${FULLPATH_D}/libgcj.spec + + # Rename jar because it could clash with Kaffe's jar if this gcc is + # primary compiler (aka don't have the - extension) + cd ${D}${LOC}/bin + [ -f jar${GCC_SUFFIX} ] && mv -f jar${GCC_SUFFIX} gcj-jar${GCC_SUFFIX} + + # Move to compiler-specific directories + [ -f ${D}${STDCXX_INCDIR}/cxxabi.h ] && \ + mv -f ${D}${STDCXX_INCDIR}/cxxabi.h ${FULLPATH_D}/include/ + + if build_multiple + then + # Now fix the manpages + cd ${D}${LOC}/share/man/man1 + mv cpp.1 cpp${GCC_SUFFIX}.1 + mv gcov.1 gcov${GCC_SUFFIX}.1 + fi + fi + + # This one comes with binutils + if [ -f ${D}${LOC}/lib/libiberty.a ] + then + rm -f ${D}${LOC}/lib/libiberty.a + fi + + cd ${S} + if [ -z "`use build`" ] + then + cd ${S} + docinto / + dodoc COPYING COPYING.LIB ChangeLog FAQ GNATS MAINTAINERS README + docinto html + dohtml *.html + cd ${S}/boehm-gc + docinto boehm-gc + dodoc ChangeLog doc/{README*,barrett_diagram} + docinto boehm-gc/html + dohtml doc/*.html + cd ${S}/gcc + docinto gcc + dodoc ChangeLog* FSFChangeLog* LANGUAGES NEWS ONEWS README* SERVICE + cd ${S}/libf2c + docinto libf2c + dodoc ChangeLog README TODO *.netlib + cd ${S}/libffi + docinto libffi + dodoc ChangeLog* LICENSE README + cd ${S}/libiberty + docinto libiberty + dodoc ChangeLog COPYING.LIB README + cd ${S}/libobjc + docinto libobjc + dodoc ChangeLog README* THREADS* + cd ${S}/libstdc++-v3 + docinto libstdc++-v3 + dodoc ChangeLog* README + docinto libstdc++-v3/html + dohtml -r -a css,diff,html,txt,xml docs/html/* + cp -f docs/html/17_intro/[A-Z]* \ + ${D}/usr/share/doc/${PF}/${DOCDESTTREE}/17_intro/ + + if [ -n "`use java`" ] + then + cd ${S}/fastjar + docinto fastjar + dodoc AUTHORS CHANGES COPYING ChangeLog NEWS README + cd ${S}/libjava + docinto libjava + dodoc ChangeLog* COPYING HACKING LIBGCJ_LICENSE NEWS README THANKS + fi + else + rm -rf ${D}/usr/share/{man,info} + fi + + # Fix ncurses b0rking + find ${D}/ -name '*curses.h' -exec rm -f {} \; +} + +pkg_postinst() { + # Update libtool linker scripts to reference new gcc version ... + if [ -f ${WORKDIR}/.oldgccversion -a "${ROOT}" = "/" ] + then + OLD_GCC_VERSION="`cat ${WORKDIR}/.oldgccversion`" + + cp -f ${FILESDIR}/fix_libtool_files.sh ${T} + chmod +x ${T}/fix_libtool_files.sh + ${T}/fix_libtool_files.sh ${OLD_GCC_VERSION} + fi +} + +pkg_postrm() { + if [ ! -L ${ROOT}/lib/cpp ] + then + ln -sf /usr/bin/cpp ${ROOT}/lib/cpp + fi + if [ ! -L ${ROOT}/usr/bin/cc ] + then + ln -sf gcc ${ROOT}/usr/bin/cc + fi + + # Fix ncurses b0rking (if r5 isn't unmerged) + find ${ROOT}/usr/lib/gcc-lib -name '*curses.h' -exec rm -f {} \; +} + diff --git a/sys-devel/gcc/gcc-3.2.1-r6.ebuild b/sys-devel/gcc/gcc-3.2.1-r6.ebuild new file mode 100644 index 000000000000..9af013a34a79 --- /dev/null +++ b/sys-devel/gcc/gcc-3.2.1-r6.ebuild @@ -0,0 +1,477 @@ +# Copyright 1999-2002 Gentoo Technologies, Inc. +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/sys-devel/gcc/gcc-3.2.1-r6.ebuild,v 1.1 2002/12/16 04:27:29 azarah Exp $ + +IUSE="static nls bootstrap java build" + +inherit eutils flag-o-matic libtool + +# Compile problems with these (bug #6641 among others)... +filter-flags "-fno-exceptions -fomit-frame-pointer" + +# Recently there has been a lot of stability problem in Gentoo-land. Many +# things can be the cause to this, but I believe that it is due to gcc3 +# still having issues with optimizations, or with it not filtering bad +# combinations (protecting the user maybe from himeself) yet. +# +# This can clearly be seen in large builds like glibc, where too aggressive +# CFLAGS cause the tests to fail miserbly. +# +# Quote from Nick Jones , who in my opinion +# knows what he is talking about: +# +# People really shouldn't force code-specific options on... It's a +# bad idea. The -march options aren't just to look pretty. They enable +# options that are sensible (and include sse,mmx,3dnow when apropriate). +# +# The next command strips CFLAGS and CXXFLAGS from nearly all flags. If +# you do not like it, comment it, but do not bugreport if you run into +# problems. +# +# (13 Oct 2002) +strip-flags + +# Theoretical cross compiler support +[ ! -n "${CCHOST}" ] && export CCHOST="${CHOST}" + +LOC="/usr" +MY_PV="`echo ${PV} | awk -F. '{ gsub(/_pre.*|_alpha.*/, ""); print $1 "." $2 }'`" +MY_PV_FULL="`echo ${PV} | awk '{ gsub(/_pre.*|_alpha.*/, ""); print $0 }'`" + +LIBPATH="${LOC}/lib/gcc-lib/${CCHOST}/${MY_PV_FULL}" +BINPATH="${LOC}/${CCHOST}/gcc-bin/${MY_PV}" +DATAPATH="${LOC}/share/gcc-data/${CCHOST}/${MY_PV}" +# Dont install in /usr/include/g++-v3/, but in gcc internal directory. +# We will handle /usr/include/g++-v3/ with gcc-config ... +STDCXX_INCDIR="${LIBPATH}/include/g++-v${MY_PV/\.*/}" + +# Patch tarball support ... +#PATCH_VER="1.0" +PATCH_VER="" + +# Snapshot support ... +#SNAPSHOT="2002-08-12" +SNAPSHOT="" + +# Branch update support ... +#BRANCH_UPDATE="20021208" +BRANCH_UPDATE="20021208" + +if [ -z "${SNAPSHOT}" ] +then + S="${WORKDIR}/${P}" + SRC_URI="ftp://gcc.gnu.org/pub/gcc/releases/${P}/${P}.tar.bz2" + + if [ -n "${PATCH_VER}" ] + then + SRC_URI="${SRC_URI} + mirror://gentoo/${P}-patches-${PATCH_VER}.tar.bz2" + fi + + if [ -n "${BRANCH_UPDATE}" ] + then + SRC_URI="${SRC_URI} + mirror://gentoo/${P}-branch-update-${BRANCH_UPDATE}.patch.bz2" + fi +else + S="${WORKDIR}/gcc-${SNAPSHOT//-}" + SRC_URI="ftp://sources.redhat.com/pub/gcc/snapshots/${SNAPSHOT}/gcc-${SNAPSHOT//-}.tar.bz2" +fi + +DESCRIPTION="Modern C/C++ compiler written by the GNU people" +HOMEPAGE="http://www.gnu.org/software/gcc/gcc.html" + +LICENSE="GPL-2 LGPL-2.1" +KEYWORDS="~x86 ~ppc ~sparc ~alpha" + +# Ok, this is a hairy one again, but lets assume that we +# are not cross compiling, than we want SLOT to only contain +# $PV, as people upgrading to new gcc layout will not have +# their old gcc unmerged ... +if [ "${CHOST}" == "${CCHOST}" ] +then + SLOT="${MY_PV}" +else + SLOT="${CCHOST}-${MY_PV}" +fi + +DEPEND="virtual/glibc + >=sys-devel/gcc-config-1.2 + !build? ( >=sys-libs/ncurses-5.2-r2 + nls? ( sys-devel/gettext ) )" + +RDEPEND="virtual/glibc + >=sys-devel/gcc-config-1.2.2 + >=sys-libs/zlib-1.1.4 + >=sys-apps/texinfo-4.2-r4 + !build? ( >=sys-libs/ncurses-5.2-r2 )" + + +# Hack used to patch Makefiles to install into the build dir +FAKE_ROOT="" + +pkg_setup() { + echo + eerror "This is a very alpha ebuild and changes in here" + eerror "are not yet set in stone! Please do NOT merge" + eerror "this if you are not a developer!" +# die +} + +src_unpack() { + if [ -z "${SNAPSHOT}" ] + then + unpack ${P}.tar.bz2 + + if [ -n "${PATCH_VER}" ] + then + unpack ${P}-patches-${PATCH_VER}.tar.bz2 + fi + else + unpack gcc-${SNAPSHOT//-}.tar.bz2 + fi + + cd ${S} + # Fixup libtool to correctly generate .la files with portage + elibtoolize --portage --shallow + + # Branch update ... + if [ -n "${BRANCH_UPDATE}" ] + then + epatch ${DISTDIR}/${P}-branch-update-${BRANCH_UPDATE}.patch.bz2 + fi + + # Do bulk patches included in ${P}-patches-${PATCH_VER}.tar.bz2 + if [ -n "${PATCH_VER}" ] + then + epatch ${WORKDIR}/patch + fi + + # Patches from Redhat ... + epatch ${FILESDIR}/${PV}/gcc32-ada-make.patch + epatch ${FILESDIR}/${PV}/gcc32-shared-pthread.patch + use sparc && epatch ${FILESDIR}/${PV}/gcc32-sparc32-hack.patch + epatch ${FILESDIR}/${PV}/gcc32-testsuite.patch + epatch ${FILESDIR}/${PV}/gcc32-tls-reload-fix.patch + + # Currently if any path is changed via the configure script, it breaks + # installing into ${D}. We should not patch it in src_install() with + # absolute paths, as some modules then gets rebuild with the wrong + # paths. Thus we use $FAKE_ROOT. + cd ${S} + for x in $(find . -name Makefile.in) + do + # Fix --datadir= + cp ${x} ${x}.orig + sed -e 's:datadir = @datadir@:datadir = $(FAKE_ROOT)@datadir@:' \ + ${x}.orig > ${x} + + # Fix --bindir= + cp ${x} ${x}.orig + sed -e 's:bindir = @bindir@:bindir = $(FAKE_ROOT)@bindir@:' \ + ${x}.orig > ${x} + + # Fix --exec-prefix= + cp ${x} ${x}.orig + sed -e 's:exec_prefix = @exec_prefix@:exec_prefix = $(FAKE_ROOT)@exec_prefix@:' \ + ${x}.orig > ${x} + + # Fix --with-gxx-include-dir= + cp ${x} ${x}.orig + sed -e 's:gxx_include_dir = @gxx_:gxx_include_dir = $(FAKE_ROOT)@gxx_:' \ + -e 's:glibcppinstalldir = @gxx_:glibcppinstalldir = $(FAKE_ROOT)@gxx_:' \ + ${x}.orig > ${x} + + # Where java security stuff should be installed + cp ${x} ${x}.orig + sed -e 's:secdir = $(libdir)/security:secdir = $(FAKE_ROOT)$(LIBPATH)/security:' \ + ${x}.orig > ${x} + + rm -f ${x}.orig + done + + # This next bit is for updating libtool linker scripts ... + OLD_GCC_VERSION="`gcc -dumpversion`" + + if [ "${OLD_GCC_VERSION}" != "${MY_PV_FULL}" ] + then + echo "${OLD_GCC_VERSION}" > ${WORKDIR}/.oldgccversion + fi +} + +src_compile() { + local myconf="" + local gcc_lang="" + if [ -z "`use build`" ] + then + myconf="${myconf} --enable-shared" + gcc_lang="c,c++,ada,f77,objc" + else + gcc_lang="c" + fi + if [ -z "`use nls`" ] || [ "`use build`" ] + then + myconf="${myconf} --disable-nls" + else + myconf="${myconf} --enable-nls --without-included-gettext" + fi + if [ -n "`use java`" ] && [ -z "`use build`" ] + then + gcc_lang="${gcc_lang},java" + fi + + # In general gcc does not like optimization, and add -O2 where + # it is safe. + export CFLAGS="${CFLAGS//-O?}" + export CXXFLAGS="${CXXFLAGS//-O?}" + + # Build in a separate build tree + mkdir -p ${WORKDIR}/build + cd ${WORKDIR}/build + + einfo "Configuring GCC..." + addwrite "/dev/zero" + ${S}/configure --prefix=${LOC} \ + --bindir=${BINPATH} \ + --exec-prefix=${LOC} \ + --datadir=${DATAPATH} \ + --mandir=${DATAPATH}/man \ + --infodir=${DATAPATH}/info \ + --enable-shared \ + --host=${CHOST} \ + --target=${CCHOST} \ + --with-system-zlib \ + --enable-languages=${gcc_lang} \ + --enable-threads=posix \ + --enable-long-long \ + --disable-checking \ + --enable-cstdio=stdio \ + --enable-clocale=generic \ + --enable-__cxa_atexit \ + --enable-version-specific-runtime-libs \ + --with-gxx-include-dir=${STDCXX_INCDIR} \ + --with-local-prefix=${LOC}/local \ + ${myconf} || die + + touch ${S}/gcc/c-gperf.h + + einfo "Building GCC..." + if [ -z "`use static`" ] + then + # Fix for our libtool-portage.patch + S="${WORKDIR}/build" \ + emake bootstrap-lean \ + LIBPATH="${LIBPATH}" \ + BOOT_CFLAGS="${CFLAGS}" STAGE1_CFLAGS="-O" || die + # Above FLAGS optimize and speedup build, thanks + # to Jeff Garzik + else + S="${WORKDIR}/build" \ + emake LDFLAGS=-static bootstrap \ + LIBPATH="${LIBPATH}" \ + BOOT_CFLAGS="${CFLAGS}" STAGE1_CFLAGS="-O" || die + fi +} + +src_install() { + # Do allow symlinks in ${LOC}/lib/gcc-lib/${CHOST}/${PV}/include as + # this can break the build. + for x in cd ${WORKDIR}/build/gcc/include/* + do + if [ -L ${x} ] + then + rm -f ${x} + fi + done + + einfo "Installing GCC..." + # Do the 'make install' from the build directory + cd ${WORKDIR}/build + S="${WORKDIR}/build" \ + make prefix=${D}${LOC} \ + bindir=${D}${BINPATH} \ + exec_prefix=${D}${LOC} \ + datadir=${D}${DATAPATH} \ + mandir=${D}${DATAPATH}/man \ + infodir=${D}${DATAPATH}/info \ + LIBPATH="${LIBPATH}" \ + FAKE_ROOT="${D}" \ + install || die + + [ -r ${D}${BINPATH}/gcc ] || die "gcc not found in ${D}" + + dodir /lib /usr/bin + dodir /etc/env.d/gcc + echo "PATH=\"${BINPATH}\"" > ${D}/etc/env.d/gcc/${CCHOST}-${MY_PV_FULL} + echo "ROOTPATH=\"${BINPATH}\"" >> ${D}/etc/env.d/gcc/${CCHOST}-${MY_PV_FULL} + echo "LDPATH=\"${LIBPATH}\"" >> ${D}/etc/env.d/gcc/${CCHOST}-${MY_PV_FULL} + echo "MANPATH=\"${DATAPATH}/man\"" >> ${D}/etc/env.d/gcc/${CCHOST}-${MY_PV_FULL} + echo "INFOPATH=\"${DATAPATH}/info\"" >> ${D}/etc/env.d/gcc/${CCHOST}-${MY_PV_FULL} + echo "STDCXX_INCDIR=\"${STDCXX_INCDIR##*/}\"" >> ${D}/etc/env.d/gcc/${CCHOST}-${MY_PV_FULL} + # Also set CC and CXX + echo "CC=\"gcc\"" >> ${D}/etc/env.d/05gcc + echo "CXX=\"g++\"" >> ${D}/etc/env.d/05gcc + + # Install wrappers + exeinto /lib + doexe ${FILESDIR}/cpp + exeinto /usr/bin + doexe ${FILESDIR}/cc + +# This should be invalidated by the linker scripts we have as the latest +# fix for bug #4411 +# +# # gcc-3.1 have a problem with the ordering of Search Directories. For +# # instance, if you have libreadline.so in /lib, and libreadline.a in +# # /usr/lib, then it will link with libreadline.a instead of .so. As far +# # as I can see from the source, /lib should be searched before /usr/lib, +# # and this also differs from gcc-2.95.3 and possibly 3.0.4, but ill have +# # to check on 3.0.4. Thanks to Daniel Robbins for noticing this oddity, +# # bugzilla bug #4411 +# # +# # Azarah - 3 Jul 2002 +# # +# cd ${D}${LIBPATH} +# dosed -e "s:%{L\*} %(link_libgcc):%{L\*} -L/lib %(link_libgcc):" \ +# ${LIBPATH}/specs + + # Make sure we dont have stuff lying around that + # can nuke multiple versions of gcc + if [ -z "`use build`" ] + then + cd ${D}${LIBPATH} + + # Tell libtool files where real libraries are + for LA in ${D}${LOC}/lib/*.la ${D}${LIBPATH}/../*.la + do + if [ -f ${LA} ] + then + sed -e "s:/usr/lib:${LIBPATH}:" ${LA} > ${LA}.hacked + mv ${LA}.hacked ${LA} + mv ${LA} ${D}${LIBPATH} + fi + done + + # Move all the libraries to version specific libdir. + for x in ${D}${LOC}/lib/*.{so,a}* ${D}${LIBPATH}/../*.{so,a}* + do + [ -f ${x} ] && mv -f ${x} ${D}${LIBPATH} + done + + # Move Java headers to compiler-specific dir + for x in ${D}${LOC}/include/gc*.h ${D}${LOC}/include/j*.h + do + [ -f ${x} ] && mv -f ${x} ${D}${LIBPATH}/include/ + done + for x in gcj gnu java javax org + do + if [ -d ${D}${LOC}/include/${x} ] + then + dodir /${LIBPATH}/include/${x} + mv -f ${D}${LOC}/include/${x}/* ${D}${LIBPATH}/include/${x}/ + rm -rf ${D}${LOC}/include/${x} + fi + done + + # Move libgcj.spec to compiler-specific directories + [ -f ${D}${LOC}/lib/libgcj.spec ] && \ + mv -f ${D}${LOC}/lib/libgcj.spec ${D}${LIBPATH}/libgcj.spec + + # Rename jar because it could clash with Kaffe's jar if this gcc is + # primary compiler (aka don't have the - extension) + cd ${D}${LOC}/${CCHOST}/gcc-bin/${MY_PV} + [ -f jar ] && mv -f jar gcj-jar + + # Move to compiler-specific directories + [ -f ${D}${STDCXX_INCDIR}/cxxabi.h ] && \ + mv -f ${D}${STDCXX_INCDIR}/cxxabi.h ${D}${LIBPATH}/include/ + + # These should be symlinks + cd ${D}${BINPATH} + rm -f ${CCHOST}-{gcc,g++,c++,g77} + [ -f gcc ] && ln -sf gcc ${CCHOST}-gcc + [ -f g++ ] && ln -sf g++ ${CCHOST}-g++ + [ -f g++ ] && ln -sf g++ ${CCHOST}-c++ + [ -f g77 ] && ln -sf g77 ${CCHOST}-g77 + fi + + # This one comes with binutils + if [ -f ${D}${LOC}/lib/libiberty.a ] + then + rm -f ${D}${LOC}/lib/libiberty.a + fi + + cd ${S} + if [ -z "`use build`" ] + then + cd ${S} + docinto /${CCHOST} + dodoc COPYING COPYING.LIB ChangeLog FAQ GNATS MAINTAINERS README + docinto ${CCHOST}/html + dohtml *.html + cd ${S}/boehm-gc + docinto ${CCHOST}/boehm-gc + dodoc ChangeLog doc/{README*,barrett_diagram} + docinto ${CCHOST}/boehm-gc/html + dohtml doc/*.html + cd ${S}/gcc + docinto ${CCHOST}/gcc + dodoc ChangeLog* FSFChangeLog* LANGUAGES NEWS ONEWS README* SERVICE + cd ${S}/libf2c + docinto ${CCHOST}/libf2c + dodoc ChangeLog README TODO *.netlib + cd ${S}/libffi + docinto ${CCHOST}/libffi + dodoc ChangeLog* LICENSE README + cd ${S}/libiberty + docinto ${CCHOST}/libiberty + dodoc ChangeLog COPYING.LIB README + cd ${S}/libobjc + docinto ${CCHOST}/libobjc + dodoc ChangeLog README* THREADS* + cd ${S}/libstdc++-v3 + docinto ${CCHOST}/libstdc++-v3 + dodoc ChangeLog* README + docinto ${CCHOST}/libstdc++-v3/html + dohtml -r -a css,diff,html,txt,xml docs/html/* + cp -f docs/html/17_intro/[A-Z]* \ + ${D}/usr/share/doc/${PF}/${DOCDESTTREE}/17_intro/ + + if [ -n "`use java`" ] + then + cd ${S}/fastjar + docinto ${CCHOST}/fastjar + dodoc AUTHORS CHANGES COPYING ChangeLog NEWS README + cd ${S}/libjava + docinto ${CCHOST}/libjava + dodoc ChangeLog* COPYING HACKING LIBGCJ_LICENSE NEWS README THANKS + fi + else + rm -rf ${D}/usr/share/{man,info} + fi + + # Fix ncurses b0rking + find ${D}/ -name '*curses.h' -exec rm -f {} \; +} + +pkg_postinst() { + + if [ "${ROOT}" = "/" -a "${COMPILER}" = "gcc3" -a "${CHOST}" == "${CCHOST}" ] + then + gcc-config --use-portage-chost ${CCHOST}-${MY_PV_FULL} + fi + + # Update libtool linker scripts to reference new gcc version ... + if [ -f ${WORKDIR}/.oldgccversion -a "${ROOT}" = "/" ] + then + OLD_GCC_VERSION="`cat ${WORKDIR}/.oldgccversion`" + + cp -f ${FILESDIR}/fix_libtool_files.sh ${T} + chmod +x ${T}/fix_libtool_files.sh + ${T}/fix_libtool_files.sh ${OLD_GCC_VERSION} + fi + + # Fix ncurses b0rking (if r5 isn't unmerged) + find ${ROOT}/usr/lib/gcc-lib -name '*curses.h' -exec rm -f {} \; +} + -- cgit v1.2.3-65-gdbad