Gentoo Archives: gentoo-commits

From: Sergei Trofimovich <slyfox@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: sys-libs/libstdc++-v3/
Date: Sun, 17 Feb 2019 10:01:36
Message-Id: 1550397683.c493332f845a954ff0174577678a2dbff19f7bea.slyfox@gentoo
1 commit: c493332f845a954ff0174577678a2dbff19f7bea
2 Author: Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
3 AuthorDate: Sun Feb 17 09:55:28 2019 +0000
4 Commit: Sergei Trofimovich <slyfox <AT> gentoo <DOT> org>
5 CommitDate: Sun Feb 17 10:01:23 2019 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c493332f
7
8 sys-libs/libstdc++-v3: bump up to EAPI=6
9
10 Package-Manager: Portage-2.3.60, Repoman-2.3.12
11 Signed-off-by: Sergei Trofimovich <slyfox <AT> gentoo.org>
12
13 sys-libs/libstdc++-v3/libstdc++-v3-3.3.6-r2.ebuild | 189 +++++++++++++++++++++
14 1 file changed, 189 insertions(+)
15
16 diff --git a/sys-libs/libstdc++-v3/libstdc++-v3-3.3.6-r2.ebuild b/sys-libs/libstdc++-v3/libstdc++-v3-3.3.6-r2.ebuild
17 new file mode 100644
18 index 00000000000..463c97dfdc0
19 --- /dev/null
20 +++ b/sys-libs/libstdc++-v3/libstdc++-v3-3.3.6-r2.ebuild
21 @@ -0,0 +1,189 @@
22 +# Copyright 1999-2019 Gentoo Authors
23 +# Distributed under the terms of the GNU General Public License v2
24 +
25 +EAPI=6
26 +
27 +inherit eutils flag-o-matic libtool multilib
28 +
29 +PATCH_VER="1.10"
30 +
31 +DESCRIPTION="Compatibility package for binaries linked against a pre gcc 3.4 libstdc++"
32 +HOMEPAGE="https://gcc.gnu.org/libstdc++/"
33 +SRC_URI="ftp://gcc.gnu.org/pub/gcc/releases/gcc-${PV}/gcc-${PV}.tar.bz2
34 + mirror://gentoo/gcc-${PV}-patches-${PATCH_VER}.tar.bz2"
35 +
36 +LICENSE="GPL-2 LGPL-2.1"
37 +SLOT="5"
38 +KEYWORDS="~amd64 ~mips ~ppc -ppc64 ~sparc ~x86 ~x86-fbsd"
39 +IUSE="multilib nls"
40 +
41 +DEPEND="sys-devel/bison"
42 +RDEPEND=""
43 +
44 +transform_known_flags() {
45 + declare setting
46 +
47 + # and on x86, we just need to filter the 3.4 specific amd64 -marchs
48 + replace-cpu-flags k8 athlon64 opteron x86-64
49 +
50 + # gcc 3.3 doesn't support -march=pentium-m
51 + replace-cpu-flags pentium-m pentium3m pentium3
52 +
53 + #GCC 3.3 does not understand G3, G4, G5 on ppc
54 + replace-cpu-flags G3 750
55 + replace-cpu-flags G4 7400
56 + replace-cpu-flags G5 7400
57 +
58 + filter-flags -fdiagnostics-show-option
59 +}
60 +
61 +is_arch_allowed() {
62 + i386_processor_table="i386 i486 i586 pentium pentium-mmx winchip-c6 \
63 + winchip2 c3 i686 pentiumpro pentium2 pentium3 pentium4 prescott \
64 + nocona k6 k6-2 k6-3 athlon athlon-tbird x86-64 athlon-4 athlon-xp \
65 + athlon-mp"
66 +
67 + for proc in ${i386_processor_table} ; do
68 + [ "${proc}" == "${1}" ] && return 0
69 + done
70 +
71 + mips_processor_table="mips1 mips2 mips3 mips4 mips32 mips64 r3000 r2000 \
72 + r3900 r6000 r4000 vr4100 vr4111 vr4120 vr4300 r4400 r4600 orion \
73 + r4650 r8000 vr5000 vr5400 vr5500 4kc 4kp 5kc 20kc sr71000 sb1"
74 +
75 + for proc in ${mips_processor_table} ; do
76 + [ "${proc}" == "${1}" ] && return 0
77 + done
78 +
79 + rs6000_processor_table="common power power2 power3 power4 powerpc \
80 + powerpc64 rios rios1 rsc rsc1 rios2 rs64a 401 403 405 505 601 602 \
81 + 603 603e ec603e 604 604e 620 630 740 750 7400 7450 8540 801 821 823 \
82 + 860"
83 +
84 + for proc in ${rs6000_processor_table} ; do
85 + [ "${proc}" == "${1}" ] && return 0
86 + done
87 +
88 + return 1
89 +}
90 +
91 +do_filter_flags() {
92 + declare setting
93 +
94 + # In general gcc does not like optimization, and add -O2 where
95 + # it is safe. This is especially true for gcc 3.3 + 3.4
96 + replace-flags -O? -O2
97 +
98 + # gcc 3.3 doesn't support -mtune on numerous archs, so xgcc will fail
99 + setting="`get-flag mtune`"
100 + [ ! -z "${setting}" ] && filter-flags -mtune="${setting}"
101 +
102 + # in gcc 3.3 there is a bug on ppc64 where if -mcpu is used
103 + # the compiler incorrectly assumes the code you are about to build
104 + # is 32 bit
105 + use ppc64 && setting="`get-flag mcpu`"
106 + [ ! -z "${setting}" ] && filter-flags -mcpu="${setting}"
107 +
108 + # only allow the flags that we -know- are supported
109 + transform_known_flags
110 + setting="`get-flag march`"
111 + if [ ! -z "${setting}" ] ; then
112 + is_arch_allowed "${setting}" || filter-flags -march="${setting}"
113 + fi
114 + setting="`get-flag mcpu`"
115 + if [ ! -z "${setting}" ] ; then
116 + is_arch_allowed "${setting}" || filter-flags -mcpu="${setting}"
117 + fi
118 +
119 + # xgcc wont understand gcc 3.4 flags...
120 + filter-flags -fno-unit-at-a-time
121 + filter-flags -funit-at-a-time
122 + filter-flags -fweb
123 + filter-flags -fno-web
124 + filter-flags -mno-tls-direct-seg-refs
125 +
126 + # xgcc isnt patched with propolice
127 + filter-flags -fstack-protector-all
128 + filter-flags -fno-stack-protector-all
129 + filter-flags -fstack-protector
130 + filter-flags -fno-stack-protector
131 +
132 + # xgcc isnt patched with the gcc symbol visibility patch
133 + filter-flags -fvisibility-inlines-hidden
134 + filter-flags -fvisibility=hidden
135 +
136 + # Bug #269433 & #290202
137 + filter-flags -fno-strict-overflow
138 + filter-flags -fstrict-overflow
139 +
140 + # Bug #442784
141 + filter-flags '-W*'
142 +
143 + filter-flags -frecord-gcc-switches
144 + filter-flags '-fdiagnostics-color*'
145 +
146 + # ...sure, why not?
147 + strip-unsupported-flags
148 +
149 + strip-flags
150 +}
151 +
152 +S=${WORKDIR}/gcc-${PV}
153 +
154 +src_prepare() {
155 + EPATCH_SUFFIX="patch" epatch "${WORKDIR}"/patch
156 +
157 + default
158 +
159 + elibtoolize --portage --shallow
160 + ./contrib/gcc_update --touch
161 +
162 + if use multilib && [[ ${SYMLINK_LIB} == "yes" ]] ; then
163 + # ugh, this shit has to match the way we've hacked gcc else
164 + # the build falls apart #259215
165 + sed -i \
166 + -e 's:\(MULTILIB_OSDIRNAMES = \).*:\1../lib64 ../lib32:' \
167 + "${S}"/gcc/config/i386/t-linux64 \
168 + || die "sed failed!"
169 + fi
170 +}
171 +
172 +src_configure() {
173 + mkdir -p "${WORKDIR}"/build
174 + cd "${WORKDIR}"/build
175 + do_filter_flags
176 + ECONF_SOURCE=${S} \
177 + econf \
178 + --enable-shared \
179 + --with-system-zlib \
180 + --enable-languages=c++ \
181 + --enable-threads=posix \
182 + --enable-long-long \
183 + --disable-checking \
184 + --enable-cstdio=stdio \
185 + --enable-__cxa_atexit \
186 + $(use_enable multilib) \
187 + $(use_enable nls) \
188 + $(use_with !nls included-gettext)
189 +
190 + touch "${S}"/gcc/c-gperf.h
191 +}
192 +
193 +src_compile() {
194 + emake -C "${WORKDIR}"/build all-target-libstdc++-v3
195 +}
196 +
197 +src_install() {
198 + emake -j1 \
199 + -C "${WORKDIR}"/build \
200 + DESTDIR="${D}" \
201 + install-target-libstdc++-v3
202 +
203 + # scrub everything but the library we care about
204 + pushd "${D}" >/dev/null
205 + mv usr/lib* . || die
206 + rm -rf usr
207 + rm -f lib*/*.{a,la,so} || die
208 + dodir /usr
209 + mv lib* usr/ || die
210 +}