diff options
author | Martin Schlemmer <azarah@gentoo.org> | 2003-04-28 02:41:22 +0000 |
---|---|---|
committer | Martin Schlemmer <azarah@gentoo.org> | 2003-04-28 02:41:22 +0000 |
commit | bde5caaa41cbeb14eaa695efcdf20f0b70755abf (patch) | |
tree | fa5f25547cc8e143b2fec077899c3be6c2eecdc3 /sys-devel/gcc | |
parent | new version; lot of fixes and updates (diff) | |
download | gentoo-2-bde5caaa41cbeb14eaa695efcdf20f0b70755abf.tar.gz gentoo-2-bde5caaa41cbeb14eaa695efcdf20f0b70755abf.tar.bz2 gentoo-2-bde5caaa41cbeb14eaa695efcdf20f0b70755abf.zip |
new version; lot of fixes and updates
Diffstat (limited to 'sys-devel/gcc')
-rw-r--r-- | sys-devel/gcc/ChangeLog | 25 | ||||
-rw-r--r-- | sys-devel/gcc/Manifest | 8 | ||||
-rw-r--r-- | sys-devel/gcc/files/3.2.3/gcc-323-propolice-version.patch | 17 | ||||
-rw-r--r-- | sys-devel/gcc/files/3.2.3/gcc32-c++-classfn-member-template.patch | 108 | ||||
-rw-r--r-- | sys-devel/gcc/files/3.2.3/gcc32-mklibgcc-serialize-crtfiles.patch | 27 | ||||
-rw-r--r-- | sys-devel/gcc/files/3.2.3/gcc323-gentoo-branding.patch | 42 | ||||
-rw-r--r-- | sys-devel/gcc/files/3.2.3/protector-3.2.2-6-PPC.patch | 13 | ||||
-rw-r--r-- | sys-devel/gcc/files/awk/fixlafiles.awk | 11 | ||||
-rw-r--r-- | sys-devel/gcc/files/digest-gcc-3.2.3 | 3 | ||||
-rw-r--r-- | sys-devel/gcc/gcc-3.2-r5.ebuild | 10 | ||||
-rw-r--r-- | sys-devel/gcc/gcc-3.2.3.ebuild | 556 |
11 files changed, 802 insertions, 18 deletions
diff --git a/sys-devel/gcc/ChangeLog b/sys-devel/gcc/ChangeLog index 450cb6422613..37a2f25815d7 100644 --- a/sys-devel/gcc/ChangeLog +++ b/sys-devel/gcc/ChangeLog @@ -1,6 +1,29 @@ # ChangeLog for sys-devel/gcc # Copyright 2002-2003 Gentoo Technologies, Inc.; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/sys-devel/gcc/ChangeLog,v 1.92 2003/04/25 05:25:00 frogger Exp $ +# $Header: /var/cvsroot/gentoo-x86/sys-devel/gcc/ChangeLog,v 1.93 2003/04/28 02:40:34 azarah Exp $ + +*gcc-3.2.3 (28 Apr 2003) + + 28 Apr 2003; Martin Schlemmer <azarah@gentoo.org> gcc-3.2.3.ebuild, + gcc-323-propolice-version.patch, gcc32-c++-classfn-member-template.patch, + gcc32-mklibgcc-serialize-crtfiles.patch, gcc323-gentoo-branding.patch, + protector-3.2.2-6-PPC.patch : + Update version + - Add gcc323-gentoo-branding.patch and gcc-3.2.3-tls-update.patch.bz2 thanks + to Nicholas Wourms <dragon@gentoo.org>. He did a great job at porting + gcc-3.2.3-tls-update.patch.bz2 from 3.2.2! + - Add two patches from Mandrake; gcc32-c++-classfn-member-template.patch and + gcc32-mklibgcc-serialize-crtfiles.patch. + - Cleanup the ProPolice stuff. Also rather use the patch tarball from its + homepage then adding the files to cvs. + - Get the version patches (gcc323-gentoo-branding.patch and + gcc-323-propolice-version.patch) to be more generic to ebuild revisions; + added version_patch() for this. + - Fix awk/fixlafiles.awk to not change files in /usr/lib/gcc-lib. This got + broken with my previous recursion fix. + + 28 Apr 2003; Martin Schlemmer <azarah@gentoo.org> gcc-3.2-r5.ebuild : + Remove message and 'die' in pkg_setup(). 24 Mar 2003; Martin Schlemmer <azarah@gentoo.org> : - Fix latest ebuild to only build static if we are just building the C diff --git a/sys-devel/gcc/Manifest b/sys-devel/gcc/Manifest index c01d5673a79c..26ea1a3d4993 100644 --- a/sys-devel/gcc/Manifest +++ b/sys-devel/gcc/Manifest @@ -1,4 +1,4 @@ -MD5 1eeea8973fcfabd53d30c3c37376f3f5 ChangeLog 20104 +MD5 f0aad1dee7427f74bb8fdf92cfb7be21 ChangeLog 20103 MD5 63530786ea42df2b5ca6e52999f586f2 gcc-2.95.3-r7.ebuild 5464 MD5 5a4475fa7fe0b65b070ad173457878d5 gcc-2.95.3-r8.ebuild 9170 MD5 feb010a6cb97e65c1d201a5796e92942 gcc-3.0.4-r6.ebuild 8766 @@ -7,7 +7,7 @@ MD5 396808683bbe6fe294fe6f803ec4e7a2 gcc-3.1-r8.ebuild 9803 MD5 b8162a884971199cc4a538d2e484cdfe gcc-3.1.1-r1.ebuild 9636 MD5 0f6c0dba6ea8d5c3ee9dcc6af366a499 gcc-3.2-r1.ebuild 11630 MD5 099fb0860ec5d485f3026cbcac20e5e2 gcc-3.2-r4.ebuild 12179 -MD5 73b831c979961b1c88d8569b9fd47425 gcc-3.2-r5.ebuild 12940 +MD5 65cc6ebe6db4b0f4059322bf1f7c034c gcc-3.2-r5.ebuild 12940 MD5 31eaf707d3524543fefb3ff3d1f8af30 gcc-3.2.1-r1.ebuild 13025 MD5 a3aa85a5c9fc11d7f9038bb69e4bbffa gcc-3.2.1.ebuild 11615 MD5 b4bab75d7a8ceb7b8b9ce9e245733a2c gcc-3.2.2.ebuild 15271 @@ -17,7 +17,7 @@ MD5 4ca314ddb4dc31959140fa45137e4ec0 gcc-3.2.1-r6.ebuild 14406 MD5 19347b20e7b3386b4c8bc0770529176a gcc-3.2.1-r7.ebuild 14845 MD5 269f0287a7097c85f9b42654ec9283da gcc-3.2.2-r1.ebuild 14724 MD5 dc49f58d348d3a2645b1cf4cf6a67b14 gcc-3.2.2-r2.ebuild 15119 -MD5 0ce2120632ee813a1a8194fada787006 gcc-3.2.3.ebuild 15976 +MD5 e6a9df73bf415d0e012005429d65ef80 gcc-3.2.3.ebuild 15971 MD5 ccc0139879ec6c7529d22e97fa977df6 gcc-3.2.2-r3.ebuild 16043 MD5 3213bd50acdbbd71ce7dd3e40710e30e files/digest-gcc-2.95.3-r7 64 MD5 3213bd50acdbbd71ce7dd3e40710e30e files/digest-gcc-2.95.3-r8 64 @@ -88,7 +88,7 @@ MD5 62e1cc1d310d74e97080b10802263791 files/3.2.1/gcc32-pr8988.patch 2070 MD5 51719a174883702ef1851fac4cc79398 files/3.2.1/gcc32-strip-dotdot.patch 2071 MD5 5e8f2122ef7f9ce187b0a0d50ac9d24a files/3.2.1/gcc32-arm-disable-mathf.patch 2229 MD5 044a164462d9392aa67cde6f9fd5c1bc files/3.2.1/gcc32-arm-reload1-fix.patch 932 -MD5 8f87750c890ade9652bc9ac7f4eac8cd files/awk/fixlafiles.awk 2634 +MD5 024be708f930f58eea99c548009b9a86 files/awk/fixlafiles.awk 2634 MD5 17f15202b98a8dd84d0f4b67eff2d868 files/3.2.2/gcc32-pr7768.patch 1789 MD5 f055e4ef28077477e8d64c6a985b1ad4 files/3.2.2/gcc322-pr9888.patch 9771 MD5 9f5b59d7567b90894d8d32cf99f910cc files/3.2.2/gcc32-pr8213.patch 2036 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 000000000000..61b5eed9054d --- /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 000000000000..7e2e328dee7e --- /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 000000000000..42db8fd5eaff --- /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 000000000000..65fc1b5d7f15 --- /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/protector-3.2.2-6-PPC.patch b/sys-devel/gcc/files/3.2.3/protector-3.2.2-6-PPC.patch new file mode 100644 index 000000000000..6706c8c01904 --- /dev/null +++ b/sys-devel/gcc/files/3.2.3/protector-3.2.2-6-PPC.patch @@ -0,0 +1,13 @@ +--- protector.c 2003-03-11 10:16:52.000000000 +0200 ++++ protector.c 2003-04-26 02:43:53.000000000 +0200 +@@ -2004,7 +2004,9 @@ + insn_pushed = FALSE; debuginsn = insn; + push_frame_in_operand (insn, PATTERN (insn), push_size, boundary); + +- if (insn_pushed) ++ if (insn_pushed ++ /* skip if it is called from purge_address_of */ ++ && cse_not_expected) + { + rtx after = insn; + rtx seq = split_insns (PATTERN (insn), insn); diff --git a/sys-devel/gcc/files/awk/fixlafiles.awk b/sys-devel/gcc/files/awk/fixlafiles.awk index c65e235ee2e9..c191bddf5589 100644 --- a/sys-devel/gcc/files/awk/fixlafiles.awk +++ b/sys-devel/gcc/files/awk/fixlafiles.awk @@ -1,7 +1,7 @@ # Copyright 1999-2002 Gentoo Technologies, Inc. # Distributed under the terms of the GNU General Public License v2 # Author: Martin Schlemmer <azarah@gentoo.org> -# $Header: /var/cvsroot/gentoo-x86/sys-devel/gcc/files/awk/fixlafiles.awk,v 1.6 2003/03/09 03:23:08 azarah Exp $ +# $Header: /var/cvsroot/gentoo-x86/sys-devel/gcc/files/awk/fixlafiles.awk,v 1.7 2003/04/28 02:40:34 azarah Exp $ function einfo(string) { @@ -67,7 +67,8 @@ BEGIN { assert(((pipe) | getline CHOST), "(" pipe ") | getline CHOST") close(pipe) - GCCLIB = "/usr/lib/gcc-lib/" CHOST + GCCLIBPREFIX = "/usr/lib/gcc-lib/" + GCCLIB = GCCLIBPREFIX CHOST sub(/\/$/, "", GCCLIB) @@ -76,14 +77,16 @@ BEGIN { close(pipe) for (x in DIRLIST) { - - if (DIRLIST[x] ~ GCCLIB) continue + + if (DIRLIST[x] ~ GCCLIBPREFIX) continue einfo(" Scanning " DIRLIST[x] "...") pipe = "find " DIRLIST[x] "/ -name '*.la' 2>/dev/null" while (((pipe) | getline la_files) > 0) { + if (la_files ~ GCCLIBPREFIX) continue + CHANGED = 0 while ((getline la_data < (la_files)) > 0) { diff --git a/sys-devel/gcc/files/digest-gcc-3.2.3 b/sys-devel/gcc/files/digest-gcc-3.2.3 new file mode 100644 index 000000000000..c74bee64e8b5 --- /dev/null +++ b/sys-devel/gcc/files/digest-gcc-3.2.3 @@ -0,0 +1,3 @@ +MD5 23d1146d5efa0e0bfad9968dbb418e1e gcc-3.2.3.tar.bz2 20662887 +MD5 e3178370ff732a564e320f64fdd70861 protector-3.2.2-6.tar.gz 23963 +MD5 5d8493dd3e551344c9d5ac11afdc76e3 gcc-3.2.3-tls-update.patch.bz2 396362 diff --git a/sys-devel/gcc/gcc-3.2-r5.ebuild b/sys-devel/gcc/gcc-3.2-r5.ebuild index cbbff2a8279f..5718edd27e47 100644 --- a/sys-devel/gcc/gcc-3.2-r5.ebuild +++ b/sys-devel/gcc/gcc-3.2-r5.ebuild @@ -1,6 +1,6 @@ # Copyright 1999-2003 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-r5.ebuild,v 1.7 2003/02/13 16:31:03 vapier Exp $ +# $Header: /var/cvsroot/gentoo-x86/sys-devel/gcc/gcc-3.2-r5.ebuild,v 1.8 2003/04/28 02:40:34 azarah Exp $ IUSE="static nls bootstrap java build" @@ -93,14 +93,6 @@ RDEPEND="virtual/glibc # 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 diff --git a/sys-devel/gcc/gcc-3.2.3.ebuild b/sys-devel/gcc/gcc-3.2.3.ebuild new file mode 100644 index 000000000000..23086f32a946 --- /dev/null +++ b/sys-devel/gcc/gcc-3.2.3.ebuild @@ -0,0 +1,556 @@ +# Copyright 1999-2003 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.3.ebuild,v 1.1 2003/04/28 02:40:34 azarah Exp $ + +IUSE="static nls bootstrap java build" + +inherit eutils flag-o-matic libtool + +# Compile problems with these (bug #6641 among others)... +# We don't need these since we strip-flags below -- Joshua +#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 <carpaski@gentoo.org>, 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. +# +# <azarah@gentoo.org> (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/\.*/}" + +# ProPolice version +PP_VER1="3_2_2" +PP_VER2="3.2.2-6" + +# Patch tarball support ... +#PATCH_VER="1.0" +PATCH_VER="" + +# Snapshot support ... +#SNAPSHOT="2002-08-12" +SNAPSHOT="" + +# Branch update support ... +MAIN_BRANCH="${PV}" # Tarball, etc used ... + +#BRANCH_UPDATE="20021208" +BRANCH_UPDATE="" + +if [ -z "${SNAPSHOT}" ] +then + S="${WORKDIR}/${PN}-${MAIN_BRANCH}" + SRC_URI="ftp://gcc.gnu.org/pub/gcc/releases/${P}/${PN}-${MAIN_BRANCH}.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/${PN}-${MAIN_BRANCH}-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 +#SRC_URI="${SRC_URI} mirror://gentoo/${P}-manpages.tar.bz2" +SRC_URI="${SRC_URI} + http://www.trl.ibm.com/projects/security/ssp/gcc${PP_VER1}/protector-${PP_VER2}.tar.gz + mirror://gentoo/${P}-tls-update.patch.bz2" + +DESCRIPTION="The GNU Compiler Collection. Includes C/C++ and java compilers" +HOMEPAGE="http://www.gnu.org/software/gcc/gcc.html" + +LICENSE="GPL-2 LGPL-2.1" +KEYWORDS="~x86 ~ppc ~sparc ~alpha ~hppa ~arm ~mips" + +# 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 + mips? >=sys-devel/binutils-2.13.90.0.16 : >=sys-devel/binutils-2.13.90.0.18 + >=sys-devel/gcc-config-1.3.1 + !build? ( >=sys-libs/ncurses-5.2-r2 + nls? ( sys-devel/gettext ) )" + +RDEPEND="virtual/glibc + >=sys-devel/gcc-config-1.3.1 + >=sys-libs/zlib-1.1.4 + >=sys-apps/texinfo-4.2-r4 + !build? ( >=sys-libs/ncurses-5.2-r2 )" + +PDEPEND="sys-devel/gcc-config" + + +# Hack used to patch Makefiles to install into the build dir +FAKE_ROOT="" + +chk_gcc_version() { + # 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 + + # Did we check the version ? + touch ${WORKDIR}/.chkgccversion +} + +version_patch() { + [ ! -f "$1" ] && return 1 + + sed -e "s:@PV@:${PVR}:g" ${1} > ${T}/${1##*/} + epatch ${T}/${1##*/} +} + +src_unpack() { + if [ -z "${SNAPSHOT}" ] + then + unpack ${PN}-${MAIN_BRANCH}.tar.bz2 + + if [ -n "${PATCH_VER}" ] + then + unpack ${P}-patches-${PATCH_VER}.tar.bz2 + fi + else + unpack gcc-${SNAPSHOT//-}.tar.bz2 + fi + + unpack protector-${PP_VER2}.tar.gz + + cd ${S} + # Fixup libtool to correctly generate .la files with portage + elibtoolize --portage --shallow + + echo + + # Branch update ... + if [ -n "${BRANCH_UPDATE}" ] + then + epatch ${DISTDIR}/${PN}-${MAIN_BRANCH}-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 + + # Update to support TLS and __thread + epatch ${DISTDIR}/${P}-tls-update.patch.bz2 + + # Make gcc's version info specific to Gentoo + version_patch ${FILESDIR}/3.2.3/gcc323-gentoo-branding.patch + + # ProPolice Stack Smashing protection - protector-3.2.2-6 + cd ${WORKDIR}; epatch ${FILESDIR}/3.2.3/protector-3.2.2-6-PPC.patch; cd ${S} + epatch ${WORKDIR}/protector.dif + epatch ${FILESDIR}/3.2.2/protector_parallel_make.patch + cp ${WORKDIR}/protector.c ${WORKDIR}/${P}/gcc/ || die "protector.c not found" + cp ${WORKDIR}/protector.h ${WORKDIR}/${P}/gcc/ || die "protector.h not found" + version_patch ${FILESDIR}/3.2.3/gcc-323-propolice-version.patch + + # Patches from Mandrake/Suse ... + epatch ${FILESDIR}/3.2.1/gcc31-loop-load-final-value.patch + epatch ${FILESDIR}/3.2.1/gcc32-strip-dotdot.patch + epatch ${FILESDIR}/3.2.1/gcc32-athlon-alignment.patch + epatch ${FILESDIR}/3.2.3/gcc32-c++-classfn-member-template.patch + epatch ${FILESDIR}/3.2.3/gcc32-mklibgcc-serialize-crtfiles.patch + + # GCC bugfixes ... + epatch ${FILESDIR}/3.2.2/gcc32-pr7768.patch + epatch ${FILESDIR}/3.2.2/gcc32-pr8213.patch + + # Get gcc to decreases the number of times the collector has to be run + # by increasing its memory workspace, bug #16548. + epatch ${FILESDIR}/3.2.2/gcc322-ggc_page-speedup.patch + + # sparc patches from Redhat ... + use sparc && epatch ${FILESDIR}/3.2.1/gcc32-sparc32-hack.patch + + # Patches from debian-arm + if use arm + then + epatch ${FILESDIR}/3.2.1/gcc32-arm-disable-mathf.patch + epatch ${FILESDIR}/3.2.1/gcc32-arm-reload1-fix.patch + fi + + # Install our pre generated manpages if we do not have perl ... +# if [ ! -x /usr/bin/perl ] +# then +# cd ${S}; unpack ${P}-manpages.tar.bz2 +# fi + + # 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. + einfo "Fixing Makefiles..." + 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 --includedir= + cp ${x} ${x}.orig + sed -e 's:includedir = @includedir@:includedir = $(FAKE_ROOT)@includedir@:' \ + ${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 +} + +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. + # These aren't needed since we strip-flags above -- Joshua + #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} \ + --includedir=${LIBPATH}/include \ + --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 + + # Do not make manpages if we do not have perl ... + if [ ! -x /usr/bin/perl ] + then + find ${S} -name '*.[17]' -exec touch {} \; || : + fi + + # Setup -j in MAKEOPTS + get_number_of_jobs + + einfo "Building GCC..." + # Only build it static if we are just building the C frontend, else + # a lot of things break because there are not libstdc++.so .... + if [ -n "`use static`" -a "${gcc_lang}" = "c" ] + then + # Fix for our libtool-portage.patch + S="${WORKDIR}/build" \ + emake LDFLAGS="-static" bootstrap \ + LIBPATH="${LIBPATH}" \ + BOOT_CFLAGS="${CFLAGS}" STAGE1_CFLAGS="-O" || die + # Above FLAGS optimize and speedup build, thanks + # to Jeff Garzik <jgarzik@mandrakesoft.com> + else + # Fix for our libtool-portage.patch + S="${WORKDIR}/build" \ + emake bootstrap-lean \ + 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} \ + includedir=${D}${LIBPATH}/include \ + 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/gcc/${CCHOST}-${MY_PV_FULL} + echo "CXX=\"g++\"" >> ${D}/etc/env.d/gcc/${CCHOST}-${MY_PV_FULL} + + # Install wrappers +# Handled by gcc-config now ... +# 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 + 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 -<version> extension) + cd ${D}${LOC}/${CCHOST}/gcc-bin/${MY_PV} + [ -f jar ] && mv -f jar gcj-jar + + # Move <cxxabi.h> 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 + + # Rather install the script, else portage with changing $FILESDIR + # between binary and source package borks things .... + insinto /lib/rcscripts/awk + doins ${FILESDIR}/awk/fixlafiles.awk + exeinto /sbin + doexe ${FILESDIR}/fix_libtool_files.sh + + # Fix ncurses b0rking + find ${D}/ -name '*curses.h' -exec rm -f {} \; +} + +pkg_preinst() { + + if [ ! -f "${WORKDIR}/.chkgccversion" ] + then + chk_gcc_version + fi + + # Make again sure that the linker "should" be able to locate + # libstdc++.so ... + export LD_LIBRARY_PATH="${LIBPATH}:${LD_LIBRARY_PATH}" + ${ROOT}/sbin/ldconfig +} + +pkg_postinst() { + + export LD_LIBRARY_PATH="${LIBPATH}:${LD_LIBRARY_PATH}" + + 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`" + + /sbin/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 {} \; +} + |