Gentoo Archives: gentoo-commits

From: Michael Haubenwallner <haubi@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: eclass/
Date: Mon, 09 Jul 2018 16:20:37
Message-Id: 1531153211.26092613741877e544345a9e3ce4f95bd5aa5d5f.haubi@gentoo
1 commit: 26092613741877e544345a9e3ce4f95bd5aa5d5f
2 Author: Michael Haubenwallner <haubi <AT> gentoo <DOT> org>
3 AuthorDate: Wed Jun 20 16:55:17 2018 +0000
4 Commit: Michael Haubenwallner <haubi <AT> gentoo <DOT> org>
5 CommitDate: Mon Jul 9 16:20:11 2018 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=26092613
7
8 toolchain.eclass: support gcc patches from cygwinports
9
10 Download and apply patches found in Cygwin's gcc.cygport, maintained at
11 github/cygwinports/gcc, for a compiler running on cygwin. The ebuild
12 can define the cygwinports' git commit id as CYGWINPORTS_GITREV.
13
14 eclass/toolchain.eclass | 28 ++++++++++++++++++++++++++++
15 1 file changed, 28 insertions(+)
16
17 diff --git a/eclass/toolchain.eclass b/eclass/toolchain.eclass
18 index 241a3ea89f4..0fb518a0c2e 100644
19 --- a/eclass/toolchain.eclass
20 +++ b/eclass/toolchain.eclass
21 @@ -309,6 +309,14 @@ gentoo_urls() {
22 # ten Brugge's bounds-checking patches. If you want to use a patch
23 # for an older gcc version with a new gcc, make sure you set
24 # HTB_GCC_VER to that version of gcc.
25 +#
26 +# CYGWINPORTS_GITREV
27 +# If set, this variable signals that we should apply additional patches
28 +# maintained by upstream Cygwin developers at github/cygwinports/gcc,
29 +# using the specified git commit id there. The list of patches to
30 +# apply is extracted from gcc.cygport, maintained there as well.
31 +# This is done for compilers running on Cygwin, not for cross compilers
32 +# with a Cygwin target.
33 get_gcc_src_uri() {
34 export PATCH_GCC_VER=${PATCH_GCC_VER:-${GCC_RELEASE_VER}}
35 export UCLIBC_GCC_VER=${UCLIBC_GCC_VER:-${PATCH_GCC_VER}}
36 @@ -375,6 +383,11 @@ get_gcc_src_uri() {
37 fi
38 fi
39
40 + # Cygwin patches from https://github.com/cygwinports/gcc
41 + [[ -n ${CYGWINPORTS_GITREV} ]] && \
42 + GCC_SRC_URI+=" elibc_Cygwin? ( https://github.com/cygwinports/gcc/archive/${CYGWINPORTS_GITREV}.tar.gz
43 + -> gcc-cygwinports-${CYGWINPORTS_GITREV}.tar.gz )"
44 +
45 echo "${GCC_SRC_URI}"
46 }
47
48 @@ -481,6 +494,8 @@ gcc_quick_unpack() {
49
50 use_if_iuse boundschecking && unpack "bounds-checking-gcc-${HTB_GCC_VER}-${HTB_VER}.patch.bz2"
51
52 + [[ -n ${CYGWINPORTS_GITREV} ]] && use elibc_Cygwin && unpack "gcc-cygwinports-${CYGWINPORTS_GITREV}.tar.gz"
53 +
54 popd > /dev/null
55 }
56
57 @@ -505,6 +520,7 @@ toolchain_src_prepare() {
58 fi
59 do_gcc_HTB_patches
60 do_gcc_PIE_patches
61 + do_gcc_CYGWINPORTS_patches
62 epatch_user
63
64 if ( tc_version_is_at_least 4.8.2 || use_if_iuse hardened ) && ! use vanilla ; then
65 @@ -645,6 +661,18 @@ do_gcc_PIE_patches() {
66 BRANDING_GCC_PKGVERSION="${BRANDING_GCC_PKGVERSION}, pie-${PIE_VER}"
67 }
68
69 +do_gcc_CYGWINPORTS_patches() {
70 + [[ -n ${CYGWINPORTS_GITREV} ]] || return 0
71 + use elibc_Cygwin || return 0
72 +
73 + local -a patches
74 + local p d="${WORKDIR}/gcc-${CYGWINPORTS_GITREV}"
75 + readarray -t patches < <(sed -e '1,/PATCH_URI="/d;/"/,$d' < "${d}"/gcc.cygport)
76 + for p in ${patches[*]}; do
77 + epatch "${d}/${p}"
78 + done
79 +}
80 +
81 # configure to build with the hardened GCC specs as the default
82 make_gcc_hard() {