Gentoo Archives: gentoo-commits

From: "Michał Górny" <mgorny@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-util/debugedit/files/, dev-util/debugedit/
Date: Sun, 08 Sep 2019 06:43:47
Message-Id: 1567923266.9985eb2bfefb4c77f2f56d1c468cc3ea2f9e2969.mgorny@gentoo
1 commit: 9985eb2bfefb4c77f2f56d1c468cc3ea2f9e2969
2 Author: Michał Górny <mgorny <AT> gentoo <DOT> org>
3 AuthorDate: Sun Sep 8 06:14:26 2019 +0000
4 Commit: Michał Górny <mgorny <AT> gentoo <DOT> org>
5 CommitDate: Sun Sep 8 06:14:26 2019 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=9985eb2b
7
8 dev-util/debugedit: Drop old
9
10 Signed-off-by: Michał Górny <mgorny <AT> gentoo.org>
11
12 dev-util/debugedit/debugedit-4.14.2-r1.ebuild | 92 ----------------------
13 .../files/debugedit-4.14.2-no-reorder.patch | 57 --------------
14 2 files changed, 149 deletions(-)
15
16 diff --git a/dev-util/debugedit/debugedit-4.14.2-r1.ebuild b/dev-util/debugedit/debugedit-4.14.2-r1.ebuild
17 deleted file mode 100644
18 index ad6b532ec6c..00000000000
19 --- a/dev-util/debugedit/debugedit-4.14.2-r1.ebuild
20 +++ /dev/null
21 @@ -1,92 +0,0 @@
22 -# Copyright 1999-2019 Gentoo Authors
23 -# Distributed under the terms of the GNU General Public License v2
24 -
25 -EAPI=7
26 -
27 -inherit flag-o-matic
28 -
29 -MY_P=rpm-${PV}
30 -DESCRIPTION="Stand-alone debugedit from RPM"
31 -HOMEPAGE="http://www.rpm.org
32 - https://github.com/rpm-software-management/rpm"
33 -SRC_URI="http://ftp.rpm.org/releases/rpm-$(ver_cut 1-2).x/${MY_P}.tar.bz2"
34 -
35 -LICENSE="GPL-2+ LGPL-2+"
36 -SLOT="0"
37 -KEYWORDS="amd64 hppa ~ia64 ppc ppc64 x86 ~amd64-linux ~x86-linux"
38 -IUSE=""
39 -
40 -RDEPEND="
41 - sys-libs/zlib:=
42 - >=dev-libs/popt-1.7
43 - dev-libs/elfutils
44 - dev-libs/nss
45 -"
46 -DEPEND="${RDEPEND}
47 - virtual/pkgconfig
48 -"
49 -
50 -S=${WORKDIR}/${MY_P}
51 -
52 -src_prepare() {
53 - # do not reorder sections, ever; otherwise it breaks gcc
54 - # https://bugs.gentoo.org/666954
55 - eapply "${FILESDIR}"/debugedit-4.14.2-no-reorder.patch
56 - eapply_user
57 -
58 - # cheat it into believing we're bundling db
59 - mkdir -p db/dist || die
60 - touch db/dist/configure || die
61 - chmod +x db/dist/configure || die
62 - echo 'install:' > db3/Makefile || die
63 -
64 - # TODO: why do we need to do this?
65 - mkdir rpm || die
66 - find -name '*.h' -exec cp {} rpm/ ';' || die
67 -}
68 -
69 -src_configure() {
70 - append-cppflags -I"${EPREFIX}/usr/include/nss" -I"${EPREFIX}/usr/include/nspr"
71 - local myconf=(
72 - # force linking to static librpmio
73 - --disable-shared
74 -
75 - # disable linking compression libraries
76 - ac_cv_header_bzlib_h=no
77 - ac_cv_header_lzma_h=no
78 - --disable-zstd
79 -
80 - # fake some libraries we don't use
81 - ac_cv_header_magic_h=yes
82 - ac_cv_lib_magic_magic_open=yes
83 -
84 - # use nss as crypto provider
85 - --with-crypto=nss
86 -
87 - # disable other stuff irrelevant to debugedit
88 - --disable-nls
89 - --disable-python
90 - --without-acl
91 - --without-archive
92 - --without-cap
93 - --without-external-db
94 - --without-hackingdocs
95 - --without-lua
96 - --without-selinux
97 - )
98 - econf "${myconf[@]}"
99 -}
100 -
101 -src_compile() {
102 - emake -C misc
103 - emake -C rpmio
104 - emake debugedit
105 -}
106 -
107 -src_test() {
108 - :
109 -}
110 -
111 -src_install() {
112 - dobin debugedit
113 -}
114
115 diff --git a/dev-util/debugedit/files/debugedit-4.14.2-no-reorder.patch b/dev-util/debugedit/files/debugedit-4.14.2-no-reorder.patch
116 deleted file mode 100644
117 index 0c196a842b4..00000000000
118 --- a/dev-util/debugedit/files/debugedit-4.14.2-no-reorder.patch
119 +++ /dev/null
120 @@ -1,57 +0,0 @@
121 -From 0779d60cb5941610dd1f31632aa1655bf2cc447a Mon Sep 17 00:00:00 2001
122 -From: Sergei Trofimovich <slyfox@g.o>
123 -Date: Sat, 6 Oct 2018 17:56:00 +0100
124 -Subject: [PATCH] debugedit: don't reorder sections
125 -
126 -In https://bugs.gentoo.org/666954 debugedit processed
127 -crtbeginS.o from gcc-8.2.0 and turned into invalid ELF:
128 -
129 -```
130 -$ cp crtbeginS-ok-7.3.0.o.back crtbeginS-ok-7.3.0.o
131 -$ debugedit -i -b $(pwd) -d /usr/src/debug -l ./foo crtbeginS-ok-7.3.0.o
132 -$ export LANG=C
133 -$ readelf -a crtbeginS-ok-7.3.0.o.back >/dev/null && echo ok
134 -readelf: Warning: [ 9]: Info field (8) should index a relocatable section.
135 -ok
136 -
137 -$ readelf -a crtbeginS-ok-7.3.0.o >/dev/null && echo ok
138 -readelf: Warning: [ 9]: Info field (8) should index a relocatable section.
139 -readelf: Error: bad symbol index: 54495f00 in reloc
140 -readelf: Error: bad symbol index: 656c6261 in reloc
141 -readelf: Error: bad symbol index: 62615465 in reloc
142 -readelf: Error: bad symbol index: 69665f61 in reloc
143 -readelf: Warning: local symbol 11 found at index >= symtab's sh_info value of 11
144 -readelf: Warning: local symbol 14 found at index >= symtab's sh_info value of 11
145 -readelf: Warning: local symbol 15 found at index >= symtab's sh_info value of 11
146 -```
147 -
148 -Ths fix is not to reorder sections as debugedit does not
149 -account for offset change.
150 -
151 -debugedit already does it for final executables and shared libraries.
152 -
153 -Bug: https://bugs.gentoo.org/666954
154 -Closes: https://github.com/rpm-software-management/rpm/issues/423
155 -Signed-off-by: Sergei Trofimovich <slyfox@g.o>
156 ----
157 - tools/debugedit.c | 7 +++----
158 - 1 file changed, 3 insertions(+), 4 deletions(-)
159 -
160 -diff --git a/tools/debugedit.c b/tools/debugedit.c
161 -index 84568dd29..a723283c0 100644
162 ---- a/tools/debugedit.c
163 -+++ b/tools/debugedit.c
164 -@@ -2347,10 +2347,9 @@ fdopen_dso (int fd, const char *name)
165 - goto error_out;
166 - }
167 -
168 -- /* If there are phdrs we want to maintain the layout of the
169 -- allocated sections in the file. */
170 -- if (phnum != 0)
171 -- elf_flagelf (elf, ELF_C_SET, ELF_F_LAYOUT);
172 -+ /* We maintain the layout of the allocated sections in the file:
173 -+ https://github.com/rpm-software-management/rpm/issues/423 */
174 -+ elf_flagelf (elf, ELF_C_SET, ELF_F_LAYOUT);
175 -
176 - memset (dso, 0, sizeof(DSO));
177 - dso->elf = elf;