public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Yixun Lan" <dlan@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-util/crash/, dev-util/crash/files/
Date: Wed,  9 Aug 2023 23:09:34 +0000 (UTC)	[thread overview]
Message-ID: <1691622541.82b92c8a4bdbe7a31407a436f19a16d3470f229f.dlan@gentoo> (raw)

commit:     82b92c8a4bdbe7a31407a436f19a16d3470f229f
Author:     Yixun Lan <dlan <AT> gentoo <DOT> org>
AuthorDate: Wed Aug  9 22:25:39 2023 +0000
Commit:     Yixun Lan <dlan <AT> gentoo <DOT> org>
CommitDate: Wed Aug  9 23:09:01 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=82b92c8a

dev-util/crash: fix strlcpy() issue for glibc-2.38

Closes: https://bugs.gentoo.org/911929
Signed-off-by: Yixun Lan <dlan <AT> gentoo.org>

 dev-util/crash/crash-8.0.3-r1.ebuild           | 67 ++++++++++++++++++++++++++
 dev-util/crash/files/crash-8.0.3-strlcpy.patch | 26 ++++++++++
 2 files changed, 93 insertions(+)

diff --git a/dev-util/crash/crash-8.0.3-r1.ebuild b/dev-util/crash/crash-8.0.3-r1.ebuild
new file mode 100644
index 000000000000..e2c69feeeb4e
--- /dev/null
+++ b/dev-util/crash/crash-8.0.3-r1.ebuild
@@ -0,0 +1,67 @@
+# Copyright 1999-2023 Gentoo Authors
+# Distributed under the terms of the GNU General Public License v2
+
+EAPI=8
+
+inherit toolchain-funcs
+
+GDB_VERSION=10.2
+UPSTREAM_VER=
+EXTRA_VER=0
+
+if [[ ${PV} == "9999" ]] ; then
+	EGIT_REPO_URI="https://github.com/crash-utility/crash.git"
+	SRC_URI="mirror://gnu/gdb/gdb-${GDB_VERSION}.tar.gz"
+	EGIT_BRANCH="master"
+	inherit git-r3
+else
+	[[ -n ${UPSTREAM_VER} ]] && \
+		UPSTREAM_PATCHSET_URI="https://dev.gentoo.org/~dlan/distfiles/${CATEGORY}/${PN}/${P}-patches-${UPSTREAM_VER}.tar.xz"
+
+	[[ -n ${EXTRA_VER} ]] && \
+		EXTRA_PATCHSET_URI="https://dev.gentoo.org/~dlan/distfiles/${CATEGORY}/${PN}/${P}-extra-${EXTRA_VER}.tar.xz"
+
+	SRC_URI="https://github.com/crash-utility/${PN}/archive/${PV}.tar.gz -> ${P}.tar.gz
+		${UPSTREAM_PATCHSET_URI} ${EXTRA_PATCHSET_URI}
+		mirror://gnu/gdb/gdb-${GDB_VERSION}.tar.gz"
+	KEYWORDS="-* ~alpha ~amd64 ~arm ~ia64 ~ppc64 ~riscv ~s390 ~x86"
+fi
+
+DESCRIPTION="Red Hat crash utility; used for analyzing kernel core dumps"
+HOMEPAGE="https://crash-utility.github.io/"
+
+LICENSE="GPL-3"
+SLOT="0"
+IUSE=""
+# there is no "make test" target, but there is a test.c so the automatic
+# make rules catch it and tests fail
+RESTRICT="test"
+
+PATCHES=(
+	# bug 911929, patch already in upstream, drop in next version bump
+	"${FILESDIR}/${P}-strlcpy.patch"
+)
+
+src_prepare() {
+	default
+
+	if [[ -n ${UPSTREAM_VER} ]]; then
+		einfo "Try to apply Crash's Upstream patch set"
+		eapply "${WORKDIR}"/patches-upstream
+	fi
+
+	if [[ -n ${EXTRA_VER} ]]; then
+		einfo "Try to apply Crash's Extra patch set"
+		eapply "${WORKDIR}"/patches-extra
+	fi
+
+	sed -i -e "s|ar -rs|\${AR} -rs|g" Makefile || die
+	ln -s "${DISTDIR}"/gdb-10.2.tar.gz . || die
+}
+
+src_compile() {
+	emake \
+		CC="$(tc-getCC)" \
+		AR="$(tc-getAR)" \
+		CFLAGS="${CFLAGS}" LDFLAGS="${LDFLAGS}"
+}

diff --git a/dev-util/crash/files/crash-8.0.3-strlcpy.patch b/dev-util/crash/files/crash-8.0.3-strlcpy.patch
new file mode 100644
index 000000000000..0701f99470a8
--- /dev/null
+++ b/dev-util/crash/files/crash-8.0.3-strlcpy.patch
@@ -0,0 +1,26 @@
+diff --git a/defs.h b/defs.h
+index 8f7d1fa..26afe23 100644
+--- a/defs.h
++++ b/defs.h
+@@ -5553,7 +5553,7 @@ uint32_t swap32(uint32_t, int);
+ uint64_t swap64(uint64_t, int);
+ ulong *get_cpumask_buf(void);
+ int make_cpumask(char *, ulong *, int, int *);
+-size_t strlcpy(char *, char *, size_t);
++size_t strlcpy(char *, const char *, size_t) __attribute__ ((__weak__));
+ struct rb_node *rb_first(struct rb_root *);
+ struct rb_node *rb_parent(struct rb_node *, struct rb_node *);
+ struct rb_node *rb_right(struct rb_node *, struct rb_node *);
+diff --git a/tools.c b/tools.c
+index 392a797..0f2db10 100644
+--- a/tools.c
++++ b/tools.c
+@@ -6795,7 +6795,7 @@ make_cpumask_error:
+  * always be NULL-terminated.
+  */
+ size_t 
+-strlcpy(char *dest, char *src, size_t size)
++strlcpy(char *dest, const char *src, size_t size)
+ {
+ 	size_t ret = strlen(src);
+ 


             reply	other threads:[~2023-08-09 23:09 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-09 23:09 Yixun Lan [this message]
  -- strict thread matches above, loose matches on Subject: below --
2024-05-09  3:05 [gentoo-commits] repo/gentoo:master commit in: dev-util/crash/, dev-util/crash/files/ Yixun Lan
2020-02-16 14:27 Yixun Lan
2016-04-21  4:51 Mike Frysinger

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1691622541.82b92c8a4bdbe7a31407a436f19a16d3470f229f.dlan@gentoo \
    --to=dlan@gentoo.org \
    --cc=gentoo-commits@lists.gentoo.org \
    --cc=gentoo-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox