Gentoo Archives: gentoo-commits

From: Thomas Deutschmann <whissi@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: sys-apps/kexec-tools/, sys-apps/kexec-tools/files/
Date: Tue, 28 Aug 2018 22:45:29
Message-Id: 1535496305.07e7a6078533daa2ef86769c29c28966acd62470.whissi@gentoo
1 commit: 07e7a6078533daa2ef86769c29c28966acd62470
2 Author: Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
3 AuthorDate: Tue Aug 28 22:44:38 2018 +0000
4 Commit: Thomas Deutschmann <whissi <AT> gentoo <DOT> org>
5 CommitDate: Tue Aug 28 22:45:05 2018 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=07e7a607
7
8 sys-apps/kexec-tools: fix "Unhandled rela relocation: R_X86_64_PLT32" error
9
10 Package-Manager: Portage-2.3.48, Repoman-2.3.10
11
12 ...dled-rela-relocation-R_X86_64_PLT32-error.patch | 38 ++++++++++
13 sys-apps/kexec-tools/kexec-tools-2.0.17-r1.ebuild | 86 ++++++++++++++++++++++
14 2 files changed, 124 insertions(+)
15
16 diff --git a/sys-apps/kexec-tools/files/kexec-tools-2.0.17-fix-unhandled-rela-relocation-R_X86_64_PLT32-error.patch b/sys-apps/kexec-tools/files/kexec-tools-2.0.17-fix-unhandled-rela-relocation-R_X86_64_PLT32-error.patch
17 new file mode 100644
18 index 00000000000..5d691b34bec
19 --- /dev/null
20 +++ b/sys-apps/kexec-tools/files/kexec-tools-2.0.17-fix-unhandled-rela-relocation-R_X86_64_PLT32-error.patch
21 @@ -0,0 +1,38 @@
22 +From b9de21ef51a7ceab7122a707c188602eae22c4ee Mon Sep 17 00:00:00 2001
23 +From: Chris Clayton <chris2553@××××××××××.com>
24 +Date: Mon, 20 Aug 2018 12:00:31 +0100
25 +Subject: kexec: fix for "Unhandled rela relocation: R_X86_64_PLT32" error
26 +
27 +In response to a change in binutils, commit b21ebf2fb4c
28 +(x86: Treat R_X86_64_PLT32 as R_X86_64_PC32) was applied to
29 +the linux kernel during the 4.16 development cycle and has
30 +since been backported to earlier stable kernel series. The
31 +change results in the failure message in $SUBJECT when
32 +rebooting via kexec.
33 +
34 +Fix this by replicating the change in kexec.
35 +
36 +Signed-off-by: Chris Clayton <chris2553@××××××××××.com>
37 +Acked-by: Baoquan He <bhe@××××××.com>
38 +Tested-by: Bhupesh Sharma <bhsharma@××××××.com>
39 +Acked-by: Bhupesh Sharma <bhsharma@××××××.com>
40 +Signed-off-by: Simon Horman <horms@×××××××××.au>
41 +---
42 + kexec/arch/x86_64/kexec-elf-rel-x86_64.c | 1 +
43 + 1 file changed, 1 insertion(+)
44 +
45 +diff --git a/kexec/arch/x86_64/kexec-elf-rel-x86_64.c b/kexec/arch/x86_64/kexec-elf-rel-x86_64.c
46 +index 7fdde73..db85b44 100644
47 +--- a/kexec/arch/x86_64/kexec-elf-rel-x86_64.c
48 ++++ b/kexec/arch/x86_64/kexec-elf-rel-x86_64.c
49 +@@ -79,6 +79,7 @@ void machine_apply_elf_rel(struct mem_ehdr *UNUSED(ehdr),
50 + goto overflow;
51 + break;
52 + case R_X86_64_PC32:
53 ++ case R_X86_64_PLT32:
54 + *(uint32_t *)location = value - address;
55 + break;
56 + default:
57 +--
58 +cgit 1.2-0.3.lf.el7
59 +
60
61 diff --git a/sys-apps/kexec-tools/kexec-tools-2.0.17-r1.ebuild b/sys-apps/kexec-tools/kexec-tools-2.0.17-r1.ebuild
62 new file mode 100644
63 index 00000000000..fdf79664871
64 --- /dev/null
65 +++ b/sys-apps/kexec-tools/kexec-tools-2.0.17-r1.ebuild
66 @@ -0,0 +1,86 @@
67 +# Copyright 1999-2018 Gentoo Foundation
68 +# Distributed under the terms of the GNU General Public License v2
69 +
70 +EAPI=6
71 +
72 +if [[ ${PV} == "9999" ]] ; then
73 + inherit git-r3 autotools
74 + EGIT_REPO_URI="https://git.kernel.org/pub/scm/utils/kernel/kexec/kexec-tools.git"
75 +else
76 + SRC_URI="mirror://kernel/linux/utils/kernel/kexec/${P}.tar.xz"
77 + KEYWORDS="~amd64 ~arm64 ~x86"
78 +fi
79 +
80 +inherit flag-o-matic libtool linux-info systemd
81 +
82 +DESCRIPTION="Load another kernel from the currently executing Linux kernel"
83 +HOMEPAGE="https://kernel.org/pub/linux/utils/kernel/kexec/"
84 +
85 +LICENSE="GPL-2"
86 +SLOT="0"
87 +IUSE="booke lzma xen zlib"
88 +
89 +REQUIRED_USE="lzma? ( zlib )"
90 +
91 +DEPEND="
92 + lzma? ( app-arch/xz-utils )
93 + zlib? ( sys-libs/zlib )"
94 +RDEPEND="${DEPEND}"
95 +
96 +CONFIG_CHECK="~KEXEC"
97 +
98 +PATCHES=(
99 + "${FILESDIR}"/${PN}-2.0.4-disable-kexec-test.patch
100 + "${FILESDIR}"/${PN}-2.0.4-out-of-source.patch
101 + "${FILESDIR}"/${P}-fix-unhandled-rela-relocation-R_X86_64_PLT32-error.patch
102 +)
103 +
104 +pkg_setup() {
105 + # GNU Make's $(COMPILE.S) passes ASFLAGS to $(CCAS), CCAS=$(CC)
106 + export ASFLAGS="${CCASFLAGS}"
107 +}
108 +
109 +src_prepare() {
110 + default
111 + if [[ ${PV} == "9999" ]] ; then
112 + eautoreconf
113 + else
114 + elibtoolize
115 + fi
116 + filter-flags '-mindirect-branch=thunk*'
117 +}
118 +
119 +src_configure() {
120 + local myeconfargs=(
121 + $(use_with booke)
122 + $(use_with lzma)
123 + $(use_with xen)
124 + $(use_with zlib)
125 + )
126 + econf "${myeconfargs[@]}"
127 +}
128 +
129 +src_install() {
130 + default
131 +
132 + dodoc "${FILESDIR}"/README.Gentoo
133 +
134 + newinitd "${FILESDIR}"/kexec.init-2.0.13-r1 kexec
135 + newconfd "${FILESDIR}"/kexec.conf-2.0.4 kexec
136 +
137 + insinto /etc
138 + doins "${FILESDIR}"/kexec.conf
139 +
140 + insinto /etc/kernel/postinst.d
141 + doins "${FILESDIR}"/90_kexec
142 +
143 + systemd_dounit "${FILESDIR}"/kexec.service
144 +}
145 +
146 +pkg_postinst() {
147 + if systemd_is_booted || has_version sys-apps/systemd; then
148 + elog "For systemd support the new config file is"
149 + elog " /etc/kexec.conf"
150 + elog "Please adopt it to your needs as there is no autoconfig anymore"
151 + fi
152 +}