Hi,

On Wed, 22 Apr 2020 00:04:32 +0200, Aurelien Jarno <aure...@debian.org> wrote:
> On 2020-04-21 20:58, Stephen Kitt wrote:
> Thanks for trying to fix one of the oldest glibc bugs ;-)

You’re welcome!

> > The attached patch adds memusage and memusagestat to the libc-bin package.
> > This does mean that the latter becomes dependent on libgd3, so it might be
> > better to add a new memusage package; I can take care of that if the
> > maintainers think it’s better.  
> 
> I am not sure we want to add a new dependency for libc-bin, I am sure
> people running embedded systems won't appreciate. Any reason for not
> shipping it in libc-dev-bin instead? For me that looks more like a tool
> to be used for "development". At least the memusagestat is similar to
> the mtrace one that is in libc-dev-bin.

Indeed, especially since libgd3 is a rather heavy-weight dependency. I’m
attaching a patch which adds the tools to libc-dev-bin instead.

> We also have to make sure that this new build-dependency doesn't break
> bootstrapping. I have added Helmut in Cc so that he can have a look.

Isn’t non-cross bootstrapping handled by the stage1 build profile? If this
causes issues with cross bootstrapping then shipping a separate memusage
package (<!stage1> <!cross>) should take care of things.

Regards,

Stephen
From bd3f09edb6296b8a8e2987aefd3169d48903625f Mon Sep 17 00:00:00 2001
From: Stephen Kitt <sk...@debian.org>
Date: Tue, 21 Apr 2020 20:55:53 +0200
Subject: [PATCH] Build and package memusage*

This builds memusage and memusagestat in the libc pass, and ships them
in libc-dev-bin. This involves adding a build-dependency on
libgd-dev (outside stage1) and libc-dev-bin acquires a runtime
dependency on the corresponding library package.

Closes: #91815
Signed-off-by: Stephen Kitt <sk...@debian.org>
---
 debian/control.in/main                             | 3 ++-
 debian/debhelper.in/libc-dev-bin.install           | 2 ++
 debian/debhelper.in/libc-dev-bin.lintian-overrides | 2 ++
 debian/rules.d/build.mk                            | 6 +++++-
 4 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/debian/control.in/main b/debian/control.in/main
index 659267bd..3537b751 100644
--- a/debian/control.in/main
+++ b/debian/control.in/main
@@ -12,7 +12,8 @@ Build-Depends: gettext, dpkg (>= 1.18.7), dpkg-dev (>= 1.17.14), xz-utils, file,
  g++-9, g++-9-multilib [amd64 i386 kfreebsd-amd64 mips mipsel mipsn32 mipsn32el mips64 mips64el mipsr6 mipsr6el mipsn32r6 mipsn32r6el mips64r6 mips64r6el powerpc ppc64 s390x sparc sparc64 x32] <!nobiarch>,
  python3:native,
  libidn2-0 (>= 2.0.5~) <!nocheck>,
- libc-bin (>= @GLIBC_VERSION@) <cross>
+ libc-bin (>= @GLIBC_VERSION@) <cross>,
+ libgd-dev <!stage1>
 Build-Depends-Indep: perl, po-debconf (>= 1.0)
 Maintainer: GNU Libc Maintainers <debian-glibc@lists.debian.org>
 Uploaders: Clint Adams <cl...@debian.org>, Aurelien Jarno <aure...@debian.org>, Adam Conrad <adcon...@0c3.net>, Samuel Thibault <sthiba...@debian.org>
diff --git a/debian/debhelper.in/libc-dev-bin.install b/debian/debhelper.in/libc-dev-bin.install
index 0d760a7e..8ced4378 100644
--- a/debian/debhelper.in/libc-dev-bin.install
+++ b/debian/debhelper.in/libc-dev-bin.install
@@ -1,4 +1,6 @@
 debian/tmp-libc/usr/bin/gencat usr/bin
+debian/tmp-libc/usr/bin/memusage usr/bin
+debian/tmp-libc/usr/bin/memusagestat usr/bin
 debian/tmp-libc/usr/bin/mtrace usr/bin
 debian/tmp-libc/usr/bin/rpcgen usr/bin
 debian/tmp-libc/usr/bin/sotruss usr/bin
diff --git a/debian/debhelper.in/libc-dev-bin.lintian-overrides b/debian/debhelper.in/libc-dev-bin.lintian-overrides
index eedd7cbd..1031449a 100644
--- a/debian/debhelper.in/libc-dev-bin.lintian-overrides
+++ b/debian/debhelper.in/libc-dev-bin.lintian-overrides
@@ -1,3 +1,5 @@
 # these manpages are provided by the manpages package
+libc-dev-bin: binary-without-manpage usr/bin/memusage
+libc-dev-bin: binary-without-manpage usr/bin/memusagestat
 libc-dev-bin: binary-without-manpage usr/bin/mtrace
 libc-dev-bin: binary-without-manpage usr/bin/sprof
diff --git a/debian/rules.d/build.mk b/debian/rules.d/build.mk
index 0d03116a..3f664316 100644
--- a/debian/rules.d/build.mk
+++ b/debian/rules.d/build.mk
@@ -37,7 +37,11 @@ $(stamp)configure_%: $(stamp)config_sub_guess $(stamp)patch $(KERNEL_HEADER_DIR)
 	echo "BASH := /bin/bash"                  >> $(DEB_BUILDDIR)/configparms
 	echo "KSH := /bin/bash"                   >> $(DEB_BUILDDIR)/configparms
 	echo "SHELL := /bin/bash"                 >> $(DEB_BUILDDIR)/configparms
-	echo "LIBGD = no"                         >> $(DEB_BUILDDIR)/configparms
+	if [ "$(curpass)" = "libc" ]; then \
+	  echo "LIBGD = yes"                      >> $(DEB_BUILDDIR)/configparms; \
+	else \
+	  echo "LIBGD = no"                       >> $(DEB_BUILDDIR)/configparms; \
+	fi
 	echo "bindir = $(bindir)"                 >> $(DEB_BUILDDIR)/configparms
 	echo "datadir = $(datadir)"               >> $(DEB_BUILDDIR)/configparms
 	echo "complocaledir = $(complocaledir)"   >> $(DEB_BUILDDIR)/configparms
-- 
2.20.1

Attachment: pgpEALW2r4ByK.pgp
Description: OpenPGP digital signature

Reply via email to