Gentoo Archives: gentoo-commits

From: David Seifert <soap@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: eclass/
Date: Tue, 01 Feb 2022 18:23:30
Message-Id: 1643739784.16d2c542378e9d783d877f2519b25a15d0c3a2e2.soap@gentoo
1 commit: 16d2c542378e9d783d877f2519b25a15d0c3a2e2
2 Author: David Seifert <soap <AT> gentoo <DOT> org>
3 AuthorDate: Tue Feb 1 18:23:04 2022 +0000
4 Commit: David Seifert <soap <AT> gentoo <DOT> org>
5 CommitDate: Tue Feb 1 18:23:04 2022 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=16d2c542
7
8 toolchain.eclass: remove EAPI 5 and 6
9
10 Signed-off-by: David Seifert <soap <AT> gentoo.org>
11
12 eclass/toolchain.eclass | 110 ++++++++++++++++++------------------------------
13 1 file changed, 40 insertions(+), 70 deletions(-)
14
15 diff --git a/eclass/toolchain.eclass b/eclass/toolchain.eclass
16 index 61718f0d9a01..741b6dfbbcc7 100644
17 --- a/eclass/toolchain.eclass
18 +++ b/eclass/toolchain.eclass
19 @@ -4,7 +4,7 @@
20 # @ECLASS: toolchain.eclass
21 # @MAINTAINER:
22 # Toolchain Ninjas <toolchain@g.o>
23 -# @SUPPORTED_EAPIS: 5 6 7 8
24 +# @SUPPORTED_EAPIS: 7 8
25 # @BLURB: Common code for sys-devel/gcc ebuilds
26
27 DESCRIPTION="The GNU Compiler Collection"
28 @@ -31,7 +31,6 @@ fi
29 FEATURES=${FEATURES/multilib-strict/}
30
31 case ${EAPI} in
32 - 5|6) inherit eapi7-ver eutils ;;
33 7) inherit eutils ;;
34 8) ;;
35 *) die "${ECLASS}: EAPI ${EAPI:-0} not supported" ;;
36 @@ -129,16 +128,6 @@ LICENSE="GPL-3+ LGPL-3+ || ( GPL-3+ libgcc libstdc++ gcc-runtime-library-excepti
37 IUSE="test vanilla +nls"
38 RESTRICT="!test? ( test )"
39
40 -tc_supports_dostrip() {
41 - case ${EAPI} in
42 - 5|6) return 1 ;;
43 - 7|8) return 0 ;;
44 - *) die "Update apply_patches() for ${EAPI}." ;;
45 - esac
46 -}
47 -
48 -tc_supports_dostrip || RESTRICT+=" strip" # cross-compilers need controlled stripping
49 -
50 TC_FEATURES=()
51
52 tc_has_feature() {
53 @@ -146,21 +135,21 @@ tc_has_feature() {
54 }
55
56 if [[ ${PN} != "kgcc64" && ${PN} != gcc-* ]] ; then
57 - IUSE+=" debug +cxx +nptl" TC_FEATURES+=(nptl)
58 + IUSE+=" debug +cxx +nptl" TC_FEATURES+=( nptl )
59 [[ -n ${PIE_VER} ]] && IUSE+=" nopie"
60 [[ -n ${SPECS_VER} ]] && IUSE+=" nossp"
61 - IUSE+=" +fortran" TC_FEATURES+=(fortran)
62 + IUSE+=" +fortran" TC_FEATURES+=( fortran )
63 IUSE+=" doc hardened multilib objc"
64 - tc_version_is_between 3 7 && IUSE+=" awt gcj" TC_FEATURES+=(gcj)
65 + tc_version_is_between 3 7 && IUSE+=" awt gcj" TC_FEATURES+=( gcj )
66 IUSE+=" pgo"
67 - IUSE+=" objc-gc" TC_FEATURES+=(objc-gc)
68 + IUSE+=" objc-gc" TC_FEATURES+=( objc-gc )
69 IUSE+=" libssp objc++"
70 IUSE+=" +openmp"
71 tc_version_is_at_least 4.3 && IUSE+=" fixed-point"
72 tc_version_is_at_least 4.7 && IUSE+=" go"
73 # sanitizer support appeared in gcc-4.8, but <gcc-5 does not
74 # support modern glibc.
75 - tc_version_is_at_least 5 && IUSE+=" +sanitize" TC_FEATURES+=(sanitize)
76 + tc_version_is_at_least 5 && IUSE+=" +sanitize" TC_FEATURES+=( sanitize )
77 # Note:
78 # <gcc-4.8 supported graphite, it required forked ppl
79 # versions which we dropped. Since graphite was also experimental in
80 @@ -168,7 +157,7 @@ if [[ ${PN} != "kgcc64" && ${PN} != gcc-* ]] ; then
81 # <gcc-5 supported graphite, it required cloog
82 # <gcc-6.5 supported graphite, it required old incompatible isl
83 tc_version_is_at_least 6.5 &&
84 - IUSE+=" graphite" TC_FEATURES+=(graphite)
85 + IUSE+=" graphite" TC_FEATURES+=( graphite )
86 tc_version_is_between 4.9 8 && IUSE+=" cilk"
87 tc_version_is_at_least 4.9 && IUSE+=" ada"
88 tc_version_is_at_least 4.9 && IUSE+=" vtv"
89 @@ -177,12 +166,12 @@ if [[ ${PN} != "kgcc64" && ${PN} != gcc-* ]] ; then
90 tc_version_is_at_least 6.0 && IUSE+=" +pie +ssp +pch"
91 # systemtap is a gentoo-specific switch: bug #654748
92 tc_version_is_at_least 8.0 &&
93 - IUSE+=" systemtap" TC_FEATURES+=(systemtap)
94 + IUSE+=" systemtap" TC_FEATURES+=( systemtap )
95 tc_version_is_at_least 9.0 && IUSE+=" d"
96 tc_version_is_at_least 9.1 && IUSE+=" lto"
97 tc_version_is_at_least 10 && IUSE+=" cet"
98 - tc_version_is_at_least 10 && IUSE+=" zstd" TC_FEATURES+=(zstd)
99 - tc_version_is_at_least 11 && IUSE+=" valgrind" TC_FEATURES+=(valgrind)
100 + tc_version_is_at_least 10 && IUSE+=" zstd" TC_FEATURES+=( zstd )
101 + tc_version_is_at_least 11 && IUSE+=" valgrind" TC_FEATURES+=( valgrind )
102 tc_version_is_at_least 11 && IUSE+=" custom-cflags"
103 fi
104
105 @@ -269,10 +258,6 @@ if tc_has_feature valgrind; then
106 BDEPEND+=" valgrind? ( dev-util/valgrind )"
107 fi
108
109 -case ${EAPI} in
110 - 5|6) DEPEND+=" ${BDEPEND}" ;;
111 -esac
112 -
113 PDEPEND=">=sys-devel/gcc-config-2.3"
114
115 #---->> S + SRC_URI essentials <<----
116 @@ -447,25 +432,9 @@ toolchain_src_unpack() {
117
118 #---->> src_prepare <<----
119
120 -# 'epatch' is not available in EAPI=7. Abstract away patchset application
121 -# until we eventually get all gcc ebuilds on EAPI=7 or later.
122 -tc_apply_patches() {
123 - [[ ${#@} -lt 2 ]] && die "usage: tc_apply_patches <message> <patches...>"
124 -
125 - einfo "$1"; shift
126 -
127 - case ${EAPI} in
128 - # Note: even for EAPI=6 we used 'epatch' semantics. To avoid
129 - # breaking existing ebuilds use 'eapply' only in EAPI=7 or later.
130 - 5|6) epatch "$@" ;;
131 - 7|8) eapply "$@" ;;
132 - *) die "Update apply_patches() for ${EAPI}." ;;
133 - esac
134 -}
135 -
136 toolchain_src_prepare() {
137 export BRANDING_GCC_PKGVERSION="Gentoo ${GCC_PVR}"
138 - cd "${S}"
139 + cd "${S}" || die
140
141 do_gcc_gentoo_patches
142 do_gcc_PIE_patches
143 @@ -475,11 +444,7 @@ toolchain_src_prepare() {
144 BRANDING_GCC_PKGVERSION="${BRANDING_GCC_PKGVERSION}, commit ${EGIT_VERSION}"
145 fi
146
147 - case ${EAPI} in
148 - 5) epatch_user;;
149 - 6|7|8) eapply_user ;;
150 - *) die "Update toolchain_src_prepare() for ${EAPI}." ;;
151 - esac
152 + eapply_user
153
154 if ( tc_version_is_at_least 4.8.2 || _tc_use_if_iuse hardened ) \
155 && ! use vanilla ; then
156 @@ -490,7 +455,7 @@ toolchain_src_prepare() {
157 # since we configure with just one --libdir, we can't use that
158 # (as gcc itself takes care of building multilibs). #435728
159 find "${S}" -name Makefile.in \
160 - -exec sed -i '/^pkgconfigdir/s:=.*:=$(toolexeclibdir)/pkgconfig:' {} +
161 + -exec sed -i '/^pkgconfigdir/s:=.*:=$(toolexeclibdir)/pkgconfig:' {} + || die
162
163 setup_multilib_osdirnames
164 gcc_version_patch
165 @@ -532,10 +497,11 @@ toolchain_src_prepare() {
166 || eerror "Please file a bug about this"
167 eend $?
168 done
169 - sed -i 's|A-Za-z0-9|[:alnum:]|g' "${S}"/gcc/*.awk #215828
170 + sed -i 's|A-Za-z0-9|[:alnum:]|g' "${S}"/gcc/*.awk || die #215828
171
172 # Prevent new texinfo from breaking old versions (see #198182, #464008)
173 - tc_apply_patches "Remove texinfo (bug #198182, bug #464008)" "${FILESDIR}"/gcc-configure-texinfo.patch
174 + einfo "Remove texinfo (bug #198182, bug #464008)"
175 + eapply "${FILESDIR}"/gcc-configure-texinfo.patch
176
177 # >=gcc-4
178 if [[ -x contrib/gcc_update ]] ; then
179 @@ -550,7 +516,8 @@ toolchain_src_prepare() {
180 do_gcc_gentoo_patches() {
181 if ! use vanilla ; then
182 if [[ -n ${PATCH_VER} ]] ; then
183 - tc_apply_patches "Applying Gentoo patches ..." "${WORKDIR}"/patch/*.patch
184 + einfo "Applying Gentoo patches ..."
185 + eapply "${WORKDIR}"/patch/*.patch
186 BRANDING_GCC_PKGVERSION="${BRANDING_GCC_PKGVERSION} p${PATCH_VER}"
187 fi
188
189 @@ -567,7 +534,8 @@ do_gcc_gentoo_patches() {
190
191 local shopt_save=$(shopt -p nullglob)
192 shopt -s nullglob
193 - tc_apply_patches "Applying musl patches ..." "${WORKDIR}"/musl/{,nocross/}*.patch
194 + einfo "Applying musl patches ..."
195 + eapply "${WORKDIR}"/musl/{,nocross/}*.patch
196 ${shopt_save}
197 fi
198 fi
199 @@ -577,7 +545,8 @@ do_gcc_PIE_patches() {
200 want_pie || return 0
201 use vanilla && return 0
202
203 - tc_apply_patches "Applying pie patches ..." "${WORKDIR}"/piepatch/*.patch
204 + einfo "Applying pie patches ..."
205 + eapply "${WORKDIR}"/piepatch/*.patch
206
207 BRANDING_GCC_PKGVERSION="${BRANDING_GCC_PKGVERSION}, pie-${PIE_VER}"
208 }
209 @@ -595,7 +564,8 @@ do_gcc_CYGWINPORTS_patches() {
210 echo "${d}/${p}"
211 done
212 ) )
213 - tc_apply_patches "Applying cygwin port patches ..." ${patches[*]}
214 + einfo "Applying cygwin port patches ..."
215 + eapply -- "${patches[@]}"
216 }
217
218 # configure to build with the hardened GCC specs as the default
219 @@ -663,12 +633,12 @@ make_gcc_hard() {
220 # than ALL_CFLAGS...
221 sed -e '/^ALL_CFLAGS/iHARD_CFLAGS = ' \
222 -e 's|^ALL_CFLAGS = |ALL_CFLAGS = $(HARD_CFLAGS) |' \
223 - -i "${S}"/gcc/Makefile.in
224 + -i "${S}"/gcc/Makefile.in || die
225 # Need to add HARD_CFLAGS to ALL_CXXFLAGS on >= 4.7
226 if tc_version_is_at_least 4.7 ; then
227 sed -e '/^ALL_CXXFLAGS/iHARD_CFLAGS = ' \
228 -e 's|^ALL_CXXFLAGS = |ALL_CXXFLAGS = $(HARD_CFLAGS) |' \
229 - -i "${S}"/gcc/Makefile.in
230 + -i "${S}"/gcc/Makefile.in || die
231 fi
232
233 sed -i \
234 @@ -1744,9 +1714,9 @@ toolchain_src_install() {
235 # - "${D}${LIBPATH}"
236 # As dostrip does not specify host to override ${CHOST} tools just skip
237 # non-native binary stripping.
238 - is_crosscompile && tc_supports_dostrip && dostrip -x "${LIBPATH}"
239 + is_crosscompile && dostrip -x "${LIBPATH}"
240
241 - cd "${S}"
242 + cd "${S}" || die
243 if is_crosscompile; then
244 rm -rf "${ED}"/usr/share/{man,info}
245 rm -rf "${D}"${DATAPATH}/{man,info}
246 @@ -2061,40 +2031,40 @@ gcc_slot_java() {
247
248 toolchain_pkg_postinst() {
249 do_gcc_config
250 - if [[ ! ${ROOT%/} && -f ${EPREFIX}/usr/share/eselect/modules/compiler-shadow.eselect ]] ; then
251 + if [[ ! ${ROOT} && -f ${EPREFIX}/usr/share/eselect/modules/compiler-shadow.eselect ]] ; then
252 eselect compiler-shadow update all
253 fi
254
255 if ! is_crosscompile && [[ ${PN} != "kgcc64" ]] ; then
256 # gcc stopped installing .la files fixer in June 2020.
257 # Cleaning can be removed in June 2022.
258 - rm -f "${EROOT%/}"/sbin/fix_libtool_files.sh
259 - rm -f "${EROOT%/}"/usr/sbin/fix_libtool_files.sh
260 - rm -f "${EROOT%/}"/usr/share/gcc-data/fixlafiles.awk
261 + rm -f "${EROOT}"/sbin/fix_libtool_files.sh
262 + rm -f "${EROOT}"/usr/sbin/fix_libtool_files.sh
263 + rm -f "${EROOT}"/usr/share/gcc-data/fixlafiles.awk
264 fi
265 }
266
267 toolchain_pkg_postrm() {
268 do_gcc_config
269 - if [[ ! ${ROOT%/} && -f ${EPREFIX}/usr/share/eselect/modules/compiler-shadow.eselect ]] ; then
270 + if [[ ! ${ROOT} && -f ${EPREFIX}/usr/share/eselect/modules/compiler-shadow.eselect ]] ; then
271 eselect compiler-shadow clean all
272 fi
273
274 # clean up the cruft left behind by cross-compilers
275 if is_crosscompile ; then
276 - if [[ -z $(ls "${EROOT%/}"/etc/env.d/gcc/${CTARGET}* 2>/dev/null) ]] ; then
277 + if [[ -z $(ls "${EROOT}"/etc/env.d/gcc/${CTARGET}* 2>/dev/null) ]] ; then
278 einfo "Removing last cross-compiler instance. Deleting dangling symlinks."
279 - rm -f "${EROOT%/}"/etc/env.d/gcc/config-${CTARGET}
280 - rm -f "${EROOT%/}"/etc/env.d/??gcc-${CTARGET}
281 - rm -f "${EROOT%/}"/usr/bin/${CTARGET}-{gcc,{g,c}++}{,32,64}
282 + rm -f "${EROOT}"/etc/env.d/gcc/config-${CTARGET}
283 + rm -f "${EROOT}"/etc/env.d/??gcc-${CTARGET}
284 + rm -f "${EROOT}"/usr/bin/${CTARGET}-{gcc,{g,c}++}{,32,64}
285 fi
286 return 0
287 fi
288
289 # gcc stopped installing .la files fixer in June 2020.
290 # Cleaning can be removed in June 2022.
291 - rm -f "${EROOT%/}"/sbin/fix_libtool_files.sh
292 - rm -f "${EROOT%/}"/usr/share/gcc-data/fixlafiles.awk
293 + rm -f "${EROOT}"/sbin/fix_libtool_files.sh
294 + rm -f "${EROOT}"/usr/share/gcc-data/fixlafiles.awk
295 }
296
297 do_gcc_config() {
298 @@ -2113,7 +2083,7 @@ do_gcc_config() {
299 [[ -n ${current_specs} ]] && use_specs=-${current_specs}
300
301 if [[ -n ${use_specs} ]] && \
302 - [[ ! -e ${EROOT%/}/etc/env.d/gcc/${CTARGET}-${GCC_CONFIG_VER}${use_specs} ]]
303 + [[ ! -e ${EROOT}/etc/env.d/gcc/${CTARGET}-${GCC_CONFIG_VER}${use_specs} ]]
304 then
305 ewarn "The currently selected specs-specific gcc config,"
306 ewarn "${current_specs}, doesn't exist anymore. This is usually"