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 92450138351 for ; Sun, 3 May 2020 19:01:59 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id BAEBEE092D; Sun, 3 May 2020 19:01:57 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (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 8F564E0924 for ; Sun, 3 May 2020 19:01:57 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id CF77A34F4CB for ; Sun, 3 May 2020 19:01:55 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 6A670210 for ; Sun, 3 May 2020 19:01:53 +0000 (UTC) From: "Thomas Deutschmann" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Thomas Deutschmann" Message-ID: <1588532471.b4aa565ce155f21bad4f3365268c7e7f3e370f23.whissi@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: sys-apps/kexec-tools/ X-VCS-Repository: repo/gentoo X-VCS-Files: sys-apps/kexec-tools/kexec-tools-2.0.20-r1.ebuild sys-apps/kexec-tools/kexec-tools-9999.ebuild X-VCS-Directories: sys-apps/kexec-tools/ X-VCS-Committer: whissi X-VCS-Committer-Name: Thomas Deutschmann X-VCS-Revision: b4aa565ce155f21bad4f3365268c7e7f3e370f23 X-VCS-Branch: master Date: Sun, 3 May 2020 19:01:53 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: f50682db-98a6-4f7e-a1ed-4f7a7cc65404 X-Archives-Hash: 10ba8f5cbea7a0acfb75e8076d923cfb commit: b4aa565ce155f21bad4f3365268c7e7f3e370f23 Author: Arfrever Frehtes Taifersar Arahesis Apache Org> AuthorDate: Sun May 3 19:00:08 2020 +0000 Commit: Thomas Deutschmann gentoo org> CommitDate: Sun May 3 19:01:11 2020 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b4aa565c sys-apps/kexec-tools: respect CFLAGS for purgatory Only when building purgatory, replace -mfunction-return=thunk and -mindirect-branch=thunk flags with similar -mfunction-return=thunk-inline and -mindirect-branch=thunk-inline flags, which are not incompatible with flags added by build system. Closes: https://bugs.gentoo.org/646536 Closes: https://bugs.gentoo.org/692930 Signed-off-by: Arfrever Frehtes Taifersar Arahesis Apache.Org> Package-Manager: Portage-2.3.99, Repoman-2.3.22 Signed-off-by: Thomas Deutschmann gentoo.org> sys-apps/kexec-tools/kexec-tools-2.0.20-r1.ebuild | 24 +++++++++++++++++-- sys-apps/kexec-tools/kexec-tools-9999.ebuild | 28 +++++++++++++++++++---- 2 files changed, 46 insertions(+), 6 deletions(-) diff --git a/sys-apps/kexec-tools/kexec-tools-2.0.20-r1.ebuild b/sys-apps/kexec-tools/kexec-tools-2.0.20-r1.ebuild index 85f71ffaf47..3cfa2914c93 100644 --- a/sys-apps/kexec-tools/kexec-tools-2.0.20-r1.ebuild +++ b/sys-apps/kexec-tools/kexec-tools-2.0.20-r1.ebuild @@ -3,7 +3,7 @@ EAPI=7 -inherit flag-o-matic libtool linux-info systemd +inherit libtool linux-info systemd if [[ ${PV} == "9999" ]] ; then inherit git-r3 autotools @@ -46,12 +46,15 @@ pkg_setup() { src_prepare() { default + + # Append PURGATORY_EXTRA_CFLAGS flags set by configure, instead of overriding them completely. + sed -e "/^PURGATORY_EXTRA_CFLAGS =/s/=/+=/" -i Makefile.in || die + if [[ "${PV}" == 9999 ]] ; then eautoreconf else elibtoolize fi - filter-flags '-mindirect-branch=thunk*' } src_configure() { @@ -64,6 +67,23 @@ src_configure() { econf "${myeconfargs[@]}" } +src_compile() { + # Respect CFLAGS for purgatory. + # purgatory/Makefile uses PURGATORY_EXTRA_CFLAGS variable. + # -mfunction-return=thunk and -mindirect-branch=thunk conflict with + # -mcmodel=large which is added by build system. + # Replace them with -mfunction-return=thunk-inline and -mindirect-branch=thunk-inline. + local flag flags=() + for flag in ${CFLAGS}; do + [[ ${flag} == -mfunction-return=thunk ]] && flag="-mfunction-return=thunk-inline" + [[ ${flag} == -mindirect-branch=thunk ]] && flag="-mindirect-branch=thunk-inline" + flags+=("${flag}") + done + local -x PURGATORY_EXTRA_CFLAGS="${flags[*]}" + + default +} + src_install() { default diff --git a/sys-apps/kexec-tools/kexec-tools-9999.ebuild b/sys-apps/kexec-tools/kexec-tools-9999.ebuild index 99c3438156f..77c5d7c6e59 100644 --- a/sys-apps/kexec-tools/kexec-tools-9999.ebuild +++ b/sys-apps/kexec-tools/kexec-tools-9999.ebuild @@ -1,9 +1,9 @@ -# Copyright 1999-2019 Gentoo Authors +# Copyright 1999-2020 Gentoo Authors # Distributed under the terms of the GNU General Public License v2 EAPI=7 -inherit flag-o-matic libtool linux-info systemd +inherit libtool linux-info systemd if [[ ${PV} == "9999" ]] ; then inherit git-r3 autotools @@ -11,7 +11,7 @@ if [[ ${PV} == "9999" ]] ; then else SRC_URI="https://www.kernel.org/pub/linux/utils/kernel/kexec/${P/_/-}.tar.xz" [[ "${PV}" == *_rc* ]] || \ - KEYWORDS="~amd64 ~arm64 ~hppa ~ppc64 ~x86" + KEYWORDS="~amd64 ~arm64 ~ppc64 ~x86" fi DESCRIPTION="Load another kernel from the currently executing Linux kernel" @@ -44,12 +44,15 @@ pkg_setup() { src_prepare() { default + + # Append PURGATORY_EXTRA_CFLAGS flags set by configure, instead of overriding them completely. + sed -e "/^PURGATORY_EXTRA_CFLAGS =/s/=/+=/" -i Makefile.in || die + if [[ "${PV}" == 9999 ]] ; then eautoreconf else elibtoolize fi - filter-flags '-mindirect-branch=thunk*' } src_configure() { @@ -62,6 +65,23 @@ src_configure() { econf "${myeconfargs[@]}" } +src_compile() { + # Respect CFLAGS for purgatory. + # purgatory/Makefile uses PURGATORY_EXTRA_CFLAGS variable. + # -mfunction-return=thunk and -mindirect-branch=thunk conflict with + # -mcmodel=large which is added by build system. + # Replace them with -mfunction-return=thunk-inline and -mindirect-branch=thunk-inline. + local flag flags=() + for flag in ${CFLAGS}; do + [[ ${flag} == -mfunction-return=thunk ]] && flag="-mfunction-return=thunk-inline" + [[ ${flag} == -mindirect-branch=thunk ]] && flag="-mindirect-branch=thunk-inline" + flags+=("${flag}") + done + local -x PURGATORY_EXTRA_CFLAGS="${flags[*]}" + + default +} + src_install() { default