From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id 5EFD8138334 for ; Fri, 22 Jun 2018 11:23:05 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 75BCAE07DB; Fri, 22 Jun 2018 11:22:58 +0000 (UTC) Received: from atfriesa01.ssi-schaefer.com (atfriesa01.ssi-schaefer.com [193.186.16.100]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 73C3DE07D1 for ; Fri, 22 Jun 2018 11:22:56 +0000 (UTC) X-IronPort-AV: E=Sophos;i="5.51,256,1526335200"; d="scan'208";a="16190756" X-IPAS-Result: =?us-ascii?q?A2E2AgCu2ixb/+shHKxcGgEBAQEBAgEBAQEIAQEBAYQrhSC?= =?us-ascii?q?VCwEBAQEBAQaBCCqWPjsLIwuEPgKDIjgUAQIBAQEBAQECAgKBBQyCZARLLDABA?= =?us-ascii?q?QEBAQEBAQEBAQEBAQEaAg1kAQUjDwFGEAsYAgImAgJXEwgBAYMhAYFyHKpCEYE?= =?us-ascii?q?gghyEW4NpgQAFgQuIVYEHgTaCMzWDARcChGGCVQKZJgmFfYkNBogGhTuKHYdDg?= =?us-ascii?q?ViBdH0IO4JohXyKVJEZAQE?= Received: from samail03.wamas.com (HELO mailhost.salomon.at) ([172.28.33.235]) by atfriesa01.ssi-schaefer.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 22 Jun 2018 13:22:53 +0200 Received: from [172.28.42.244] by mailhost.salomon.at with esmtp (Exim 4.77) (envelope-from ) id 1fWK9V-0002At-3i; Fri, 22 Jun 2018 13:22:53 +0200 Subject: [gentoo-dev] Re: [PATCH 5/5] toolchain.eclass: support gcc patches from cygwinports To: gentoo-dev@lists.gentoo.org References: <20180620174905.7733-1-haubi@gentoo.org> <20180620174905.7733-6-haubi@gentoo.org> <1529524613.1791.1.camel@gentoo.org> From: Michael Haubenwallner Cc: =?UTF-8?B?TWljaGHFgiBHw7Nybnk=?= Message-ID: <6b837a26-6e7a-0a0a-e6e2-03a74a143f95@gentoo.org> Date: Fri, 22 Jun 2018 13:22:52 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-dev@lists.gentoo.org Reply-to: gentoo-dev@lists.gentoo.org MIME-Version: 1.0 In-Reply-To: <1529524613.1791.1.camel@gentoo.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit X-Archives-Salt: 07b0be84-0438-4eb5-a970-470557373371 X-Archives-Hash: 7eaf938a45ed29cd148d6069f6058023 On 06/20/2018 09:56 PM, Michał Górny wrote: > W dniu śro, 20.06.2018 o godzinie 19∶49 +0200, użytkownik Michael > Haubenwallner napisał: >> Download and apply patches found in Cygwin's gcc.cygport, maintained >> at >> github/cygwinports/gcc, for a compiler running on cygwin. The ebuild >> can define the cygwinports' git commit id as CYGWINPORTS_GITREV. >> --- >> eclass/toolchain.eclass | 28 ++++++++++++++++++++++++++++ >> 1 file changed, 28 insertions(+) >> >> diff --git a/eclass/toolchain.eclass b/eclass/toolchain.eclass >> index faf96d2a41f..a16bfadc301 100644 >> --- a/eclass/toolchain.eclass >> +++ b/eclass/toolchain.eclass >> @@ -309,6 +309,14 @@ gentoo_urls() { >> # ten Brugge's bounds-checking patches. If >> you want to use a patch >> # for an older gcc version with a new gcc, >> make sure you set >> # HTB_GCC_VER to that version of gcc. >> +# >> +# CYGWINPORTS_GITREV >> +# If set, this variable signals that we >> should apply additional patches >> +# maintained by upstream Cygwin developers at >> github/cygwinports/gcc, >> +# using the specified git commit id >> there. The list of patches to >> +# apply is extracted from gcc.cygport, >> maintained there as well. >> +# This is done for compilers running on >> Cygwin, not for cross compilers >> +# with a Cygwin target. >> get_gcc_src_uri() { >> export PATCH_GCC_VER=${PATCH_GCC_VER:-${GCC_RELEASE_VER}} >> export UCLIBC_GCC_VER=${UCLIBC_GCC_VER:-${PATCH_GCC_VER}} >> @@ -375,6 +383,10 @@ get_gcc_src_uri() { >> fi >> fi >> >> + # Cygwin patches from https://github.com/cygwinports/gcc >> + [[ -n ${CYGWINPORTS_GITREV} ]] && \ >> + GCC_SRC_URI+=" elibc_Cygwin? ( >> https://github.com/cygwinports/gcc/archive/${CYGWINPORTS_GITREV}.zip >> )" > > Why not .tar.gz? Didn't know .tar.gz works - the webpage provides [Download ZIP] only, thanks! > >> + >> echo "${GCC_SRC_URI}" >> } >> >> @@ -481,6 +493,8 @@ gcc_quick_unpack() { >> >> use_if_iuse boundschecking && unpack "bounds-checking-gcc- >> ${HTB_GCC_VER}-${HTB_VER}.patch.bz2" >> >> + [[ -n ${CYGWINPORTS_GITREV} ]] && use elibc_Cygwin && unpack >> "${CYGWINPORTS_GITREV}.zip" >> + >> popd > /dev/null >> } >> >> @@ -505,6 +519,7 @@ toolchain_src_prepare() { >> fi >> do_gcc_HTB_patches >> do_gcc_PIE_patches >> + do_gcc_CYGWINPORTS_patches >> epatch_user >> >> if ( tc_version_is_at_least 4.8.2 || use_if_iuse hardened ) >> && ! use vanilla ; then >> @@ -645,6 +660,19 @@ do_gcc_PIE_patches() { >> BRANDING_GCC_PKGVERSION="${BRANDING_GCC_PKGVERSION}, pie- >> ${PIE_VER}" >> } >> >> +do_gcc_CYGWINPORTS_patches() { >> + [[ -n ${CYGWINPORTS_GITREV} ]] || return 0 >> + use elibc_Cygwin || return 0 >> + >> + local p d="${WORKDIR}/gcc-${CYGWINPORTS_GITREV}" >> + for p in $( >> + eval "$(sed -ne '/PATCH_URI="/,/"/p' < >> "${d}"/gcc.cygport)" > > The eval here is completely unnecessary, and can easily wreak havoc. > Don't do that. Erm - multiline commands from $() seem to fail without eval: # sed -ne '/PATCH_URI="/,/"/p' < ./gcc.cygport PATCH_URI=" 0001-share-mingw-fset-stack-executable-with-cygwin.patch ... " # $(sed -ne '/PATCH_URI="/,/"/p' < ./gcc.cygport) -bash: PATCH_URI=": command not found # eval "$(sed -ne '/PATCH_URI="/,/"/p' < ./gcc.cygport)" # declare -p PATCH_URI declare -- PATCH_URI=" 0001-share-mingw-fset-stack-executable-with-cygwin.patch ... " /haubi/