| 1 | # Copyright 1999-2011 Gentoo Foundation |
1 | # Copyright 1999-2011 Gentoo Foundation |
| 2 | # Distributed under the terms of the GNU General Public License v2 |
2 | # Distributed under the terms of the GNU General Public License v2 |
| 3 | # $Header: /var/cvsroot/gentoo-x86/sys-devel/gcc/gcc-3.4.6-r2.ebuild,v 1.25 2011/03/08 03:05:44 dirtyepic Exp $ |
3 | # $Header: /var/cvsroot/gentoo-x86/sys-devel/gcc/gcc-3.4.6-r2.ebuild,v 1.26 2011/07/20 08:58:35 dirtyepic Exp $ |
| 4 | |
4 | |
| 5 | MAN_VER="" |
5 | MAN_VER="" |
| 6 | PATCH_VER="1.6" |
6 | PATCH_VER="1.6" |
| 7 | UCLIBC_VER="1.1" |
7 | UCLIBC_VER="1.1" |
| 8 | UCLIBC_GCC_VER="3.4.5" |
8 | UCLIBC_GCC_VER="3.4.5" |
| … | |
… | |
| 37 | #GENTOO_PATCH_EXCLUDE="" |
37 | #GENTOO_PATCH_EXCLUDE="" |
| 38 | #PIEPATCH_EXCLUDE="" |
38 | #PIEPATCH_EXCLUDE="" |
| 39 | |
39 | |
| 40 | inherit toolchain eutils |
40 | inherit toolchain eutils |
| 41 | |
41 | |
| 42 | DESCRIPTION="The GNU Compiler Collection. Includes C/C++, java compilers, pie+ssp extensions, Haj Ten Brugge runtime bounds checking" |
42 | DESCRIPTION="The GNU Compiler Collection" |
| 43 | |
43 | |
| 44 | KEYWORDS="-* alpha amd64 arm ~ia64 ~mips ppc ppc64 ~s390 sh sparc x86 ~x86-fbsd" |
44 | KEYWORDS="-* alpha amd64 arm ~ia64 ~mips ppc ppc64 ~s390 sh sparc x86 ~x86-fbsd" |
| 45 | IUSE="ip28 ip32r10k" |
45 | IUSE="ip28 ip32r10k n32 n64" |
| 46 | |
46 | |
| 47 | # we need a proper glibc version for the Scrt1.o provided to the pie-ssp specs |
47 | # we need a proper glibc version for the Scrt1.o provided to the pie-ssp specs |
| 48 | # NOTE: we SHOULD be using at least binutils 2.15.90.0.1 everywhere for proper |
48 | # NOTE: we SHOULD be using at least binutils 2.15.90.0.1 everywhere for proper |
| 49 | # .eh_frame ld optimisation and symbol visibility support, but it hasnt been |
49 | # .eh_frame ld optimisation and symbol visibility support, but it hasnt been |
| 50 | # well tested in gentoo on any arch other than amd64!! |
50 | # well tested in gentoo on any arch other than amd64!! |
| … | |
… | |
| 110 | # Arch stuff |
110 | # Arch stuff |
| 111 | case $(tc-arch) in |
111 | case $(tc-arch) in |
| 112 | mips) |
112 | mips) |
| 113 | # If mips, and we DON'T want multilib, then rig gcc to only use n32 OR n64 |
113 | # If mips, and we DON'T want multilib, then rig gcc to only use n32 OR n64 |
| 114 | if ! is_multilib; then |
114 | if ! is_multilib; then |
| 115 | use n32 && epatch ${FILESDIR}/3.4.1/gcc-3.4.1-mips-n32only.patch |
115 | use n32 && epatch "${FILESDIR}"/3.4.1/gcc-3.4.1-mips-n32only.patch |
| 116 | use n64 && epatch ${FILESDIR}/3.4.1/gcc-3.4.1-mips-n64only.patch |
116 | use n64 && epatch "${FILESDIR}"/3.4.1/gcc-3.4.1-mips-n64only.patch |
| 117 | fi |
117 | fi |
| 118 | |
118 | |
| 119 | # Patch forward-ported from a gcc-3.0.x patch that adds -march=r10000 and |
119 | # Patch forward-ported from a gcc-3.0.x patch that adds -march=r10000 and |
| 120 | # -mtune=r10000 support to gcc (Allows the compiler to generate code to |
120 | # -mtune=r10000 support to gcc (Allows the compiler to generate code to |
| 121 | # take advantage of R10k's second ALU, perform shifts, etc.. |
121 | # take advantage of R10k's second ALU, perform shifts, etc.. |
| 122 | # |
122 | # |
| 123 | # Needs re-porting to DFA in gcc-4.0 - Any Volunteers? :) |
123 | # Needs re-porting to DFA in gcc-4.0 - Any Volunteers? :) |
| 124 | epatch ${FILESDIR}/3.4.2/gcc-3.4.x-mips-add-march-r10k.patch |
124 | epatch "${FILESDIR}"/3.4.2/gcc-3.4.x-mips-add-march-r10k.patch |
| 125 | |
125 | |
| 126 | # This is a very special patch -- it allows us to build semi-usable kernels |
126 | # This is a very special patch -- it allows us to build semi-usable kernels |
| 127 | # on SGI IP28 (Indigo2 Impact R10000) systems. The patch is henceforth |
127 | # on SGI IP28 (Indigo2 Impact R10000) systems. The patch is henceforth |
| 128 | # regarded as a kludge by upstream, and thus, it will never get accepted upstream, |
128 | # regarded as a kludge by upstream, and thus, it will never get accepted upstream, |
| 129 | # but for our purposes of building a kernel, it works. |
129 | # but for our purposes of building a kernel, it works. |
| … | |
… | |
| 132 | # it does. |
132 | # it does. |
| 133 | # All that said, the abilities of this patch are disabled by default and need |
133 | # All that said, the abilities of this patch are disabled by default and need |
| 134 | # to be enabled by passing -mip28-cache-barrier. Only used to build kernels, |
134 | # to be enabled by passing -mip28-cache-barrier. Only used to build kernels, |
| 135 | # There is the possibility it may be used for very specific userland apps too. |
135 | # There is the possibility it may be used for very specific userland apps too. |
| 136 | if use ip28 || use ip32r10k; then |
136 | if use ip28 || use ip32r10k; then |
| 137 | epatch ${FILESDIR}/3.4.2/gcc-3.4.2-mips-ip28_cache_barriers-v4.patch |
137 | epatch "${FILESDIR}"/3.4.2/gcc-3.4.2-mips-ip28_cache_barriers-v4.patch |
| 138 | fi |
138 | fi |
| 139 | ;; |
139 | ;; |
| 140 | amd64) |
140 | amd64) |
| 141 | if is_multilib ; then |
141 | if is_multilib ; then |
| 142 | sed -i -e '/GLIBCXX_IS_NATIVE=/s:false:true:' libstdc++-v3/configure || die |
142 | sed -i -e '/GLIBCXX_IS_NATIVE=/s:false:true:' libstdc++-v3/configure || die |