summaryrefslogtreecommitdiff
path: root/dev-util/clippy
diff options
context:
space:
mode:
Diffstat (limited to 'dev-util/clippy')
-rw-r--r--dev-util/clippy/Manifest2
-rw-r--r--dev-util/clippy/clippy-8.1-r1.ebuild46
-rw-r--r--dev-util/clippy/files/clippy-8.1-big-endian.patch57
3 files changed, 105 insertions, 0 deletions
diff --git a/dev-util/clippy/Manifest b/dev-util/clippy/Manifest
index 1548ed0f8229..6f1303499c2c 100644
--- a/dev-util/clippy/Manifest
+++ b/dev-util/clippy/Manifest
@@ -1,3 +1,5 @@
+AUX clippy-8.1-big-endian.patch 1677 BLAKE2B b47262fe1d6edb94005982ba854980acc47f21fccbd5969965fa2604cbf866748598a842b71a786a24e07ec39d0fc70652206d3b6d0464c435a06da40fff207b SHA512 c7849814b6b979fee63a2c52d364798f0a8fd4069d14a561881ee7db1c1213d6b1ad726f67a0d68df103e28f18b80aad1071427773b47d9916b3ca0247393c05
DIST clippy-8.1.tar.gz 8514995 BLAKE2B 6b70756909b54af3317b1e97956345206612a471893dcfa4d4a7edaf27ae8d94624b0129eb511bf96ac100cc8c5c5234c2f7031d1692f4a81d5025fe797cfd11 SHA512 dcbee55b48e9d4aba005a455f8c89e63a86d63a230e6bf2e1f691adf99654e0e170efaf2c8759e0bfc33b977659a828bed248370722210e98a6e2abad8f502aa
+EBUILD clippy-8.1-r1.ebuild 858 BLAKE2B 645d0a6365a5fa85273ea900908b60532ac56584e296fdb3d41a5f23a4dd4987781d1d8c446cf25a3b8f7116a600275229a88582403313092f3b5bb96a33b491 SHA512 00704b7a6c16a91dfe04581e00375af6de696606ca09c81fb0871fe8e1b08a5f3db8c663837884b9da688a845eab7f1c1e34aadf81f6552132d4b8c283354820
EBUILD clippy-8.1.ebuild 806 BLAKE2B 3a12042685e907d89c81a1115036b37279915e728b73c48b171684fd07380730295b8606da97b0525fa9ce73215477dddfc531ba39061acf48dd7ab8cfc2ba66 SHA512 133b754ba54cc5b160fc8c53d989770cf23fe31b4e5e7c828305a69c8ce7207e5627df8a8b6865356ae2c3699da0137270a2a6a44fdecde826a44253c38d2f0e
MISC metadata.xml 326 BLAKE2B b909c2525951476b2905e143974e734364023b9ac622f01ddae1e16427359ea47af02af11a3bb6ac5c51ef519c9c66995c8cba31d9ca41f1e48f33106a0678b3 SHA512 ee570ffd0054e2c132d637b41921bb25f3172fdfb0bcbc5d2214eaa3bb95c109ca58a5e6cd7ebd386de497ef3e20cf3696243dcc5e82fc4cfae25bba51be4db9
diff --git a/dev-util/clippy/clippy-8.1-r1.ebuild b/dev-util/clippy/clippy-8.1-r1.ebuild
new file mode 100644
index 000000000000..bb8ff2d0c5d5
--- /dev/null
+++ b/dev-util/clippy/clippy-8.1-r1.ebuild
@@ -0,0 +1,46 @@
+# Copyright 2020-2022 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+MY_P="frr-${PV}"
+PYTHON_COMPAT=( python3_{8..10} )
+inherit autotools python-single-r1
+
+DESCRIPTION="Standalone clippy tool built from FRR sources"
+HOMEPAGE="https://frrouting.org/"
+SRC_URI="https://github.com/FRRouting/frr/archive/${MY_P}.tar.gz -> ${P}.tar.gz"
+S="${WORKDIR}/frr-${MY_P}"
+
+LICENSE="GPL-2"
+SLOT="0"
+KEYWORDS="~amd64 ~arm64 ~x86"
+REQUIRED_USE="${PYTHON_REQUIRED_USE}"
+
+# standalone clippy does not have any tests
+# restrict to prevent bug 811753
+RESTRICT="test"
+
+DEPEND="
+ ${PYTHON_DEPS}
+ virtual/libelf:=
+"
+RDEPEND="${DEPEND}"
+BDEPEND="sys-devel/flex"
+
+PATCHES=(
+ "${FILESDIR}"/${P}-big-endian.patch
+)
+
+src_prepare() {
+ default
+ eautoreconf
+}
+
+src_configure() {
+ econf --enable-clippy-only
+}
+
+src_install() {
+ dobin lib/clippy
+}
diff --git a/dev-util/clippy/files/clippy-8.1-big-endian.patch b/dev-util/clippy/files/clippy-8.1-big-endian.patch
new file mode 100644
index 000000000000..fa715cf23858
--- /dev/null
+++ b/dev-util/clippy/files/clippy-8.1-big-endian.patch
@@ -0,0 +1,57 @@
+https://github.com/FRRouting/frr/commit/cfc45e911e21820bc8b703b37e947a6a7e5d798a.patch
+https://github.com/FRRouting/frr/issues/10051
+
+From: David Lamparter <equinox@opensourcerouting.org>
+Date: Tue, 18 Jan 2022 09:50:25 +0100
+Subject: [PATCH] lib/clippy: don't endian-convert twice
+
+elf_getdata_rawchunk() already endian-converts; doing it again is, uh,
+counterproductive.
+
+Fixes: #10051
+Reported-by: Lucian Cristian <lucian.cristian@gmail.com>
+Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
+--- a/lib/elf_py.c
++++ b/lib/elf_py.c
+@@ -1071,26 +1071,25 @@ static void elffile_add_dynreloc(struct elffile *w, Elf_Data *reldata,
+ * always be a pointer...
+ */
+ if (elffile_virt2file(w, rel->r_offset, &offs)) {
+- Elf_Data *ptr, *conv;
+- GElf_Addr tmp;
+- Elf_Data mem = {
+- .d_buf = (void *)&tmp,
+- .d_type = ELF_T_ADDR,
+- .d_version = EV_CURRENT,
+- .d_size = sizeof(tmp),
+- .d_off = 0,
+- .d_align = 0,
+- };
++ Elf_Data *ptr;
+
++ /* NB: this endian-converts! */
+ ptr = elf_getdata_rawchunk(w->elf, offs,
+ w->elfclass / 8,
+ ELF_T_ADDR);
+
+- conv = gelf_xlatetom(w->elf, &mem, ptr,
+- w->mmap[EI_DATA]);
+- if (conv) {
+- memcpy(&rel_offs, conv->d_buf,
+- conv->d_size);
++ if (ptr) {
++ char *dst = (char *)&rel_offs;
++
++ /* sigh. it endian-converts. but
++ * doesn't size-convert.
++ */
++ if (BYTE_ORDER == BIG_ENDIAN &&
++ ptr->d_size < sizeof(rel_offs))
++ dst += sizeof(rel_offs) -
++ ptr->d_size;
++
++ memcpy(dst, ptr->d_buf, ptr->d_size);
+
+ relw->relative = false;
+ relw->rela->r_addend = rel_offs;
+