From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 58907 invoked by alias); 12 Nov 2019 11:12:35 -0000 Mailing-List: contact elfutils-devel-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Post: List-Help: List-Subscribe: Sender: elfutils-devel-owner@sourceware.org Received: (qmail 58894 invoked by uid 89); 12 Nov 2019 11:12:35 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Checked: by ClamAV 0.100.3 on sourceware.org X-Virus-Found: No X-Spam-SWARE-Status: No, score=-19.0 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,KAM_SHORT,SPF_PASS autolearn=ham version=3.3.1 spammy=frank, variety, 5427 X-Spam-Status: No, score=-19.0 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,KAM_SHORT,SPF_PASS autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on sourceware.org X-Spam-Level: X-HELO: gnu.wildebeest.org Received: from wildebeest.demon.nl (HELO gnu.wildebeest.org) (212.238.236.112) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 12 Nov 2019 11:12:33 +0000 Received: from tarox.wildebeest.org (tarox.wildebeest.org [172.31.17.39]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by gnu.wildebeest.org (Postfix) with ESMTPSA id 3559730005A9; Tue, 12 Nov 2019 12:12:27 +0100 (CET) Received: by tarox.wildebeest.org (Postfix, from userid 1000) id DF9CE4970349; Tue, 12 Nov 2019 12:12:26 +0100 (CET) Message-ID: <0bdee1935e9cce5e7ae6804d6d6335cf8ab97b7b.camel@klomp.org> Subject: Re: patch 1/2 debuginfod client From: Mark Wielaard To: "Frank Ch. Eigler" , elfutils-devel@sourceware.org Cc: amerey@redhat.com Date: Tue, 12 Nov 2019 11:12:00 -0000 In-Reply-To: <20191028190602.GD14349@redhat.com> References: <20191028190438.GC14349@redhat.com> <20191028190602.GD14349@redhat.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Mailer: Evolution 3.28.5 (3.28.5-5.el7) Mime-Version: 1.0 X-Spam-Flag: NO X-IsSubscribed: yes X-SW-Source: 2019-q4/txt/msg00121.txt.bz2 Hi, On Mon, 2019-10-28 at 15:06 -0400, Frank Ch. Eigler wrote: > From 3e1f8d93569004d06902459d84baceb636e139d5 Mon Sep 17 00:00:00 2001 > From: Aaron Merey > Date: Mon, 28 Oct 2019 13:29:26 -0400 > Subject: [PATCH 1/2] debuginfod 1/2: client side >=20 > Introduce the debuginfod/ subdirectory, containing the client for a > new debuginfo-over-http service, in shared-library and command-line > forms. Two functions in libdwfl make calls into the client library to > fetch elf/dwarf files by buildid, as a fallback. Instead of normal > dynamic linking (thus pulling in a variety of curl dependencies), > the libdwfl hooks use dlopen/dlsym. Server & tests coming in patch 2. >=20 > Signed-off-by: Aaron Merey > Signed-off-by: Frank Ch. Eigler A few comments on the first (top-level) part, just to make progress. > diff --git a/ChangeLog b/ChangeLog > index 911cf35432c9..4f33657df976 100644 > --- a/ChangeLog > +++ b/ChangeLog > @@ -1,3 +1,9 @@ > +2019-10-28 Aaron Merey > + > + * debuginfod/: New directory for debuginfod code. > + * Makefile.am (SUBDIRS): Recurse there. > + * configure.ac (--enable-debuginfod): New flag & checks. > + > 2019-07-05 Omar Sandoval >=20=20 > * configure.ac: Get rid of --enable-libebl-subdir. > diff --git a/Makefile.am b/Makefile.am > index 52f64fc904f4..bd8926b52344 100644 > --- a/Makefile.am > +++ b/Makefile.am > @@ -29,6 +29,10 @@ pkginclude_HEADERS =3D version.h > SUBDIRS =3D config m4 lib libelf libcpu backends libebl libdwelf libdwfl= libdw \ > libasm src po doc tests >=20=20 > +if DEBUGINFOD > +SUBDIRS +=3D debuginfod > +endif > + > EXTRA_DIST =3D elfutils.spec GPG-KEY NOTES CONTRIBUTING \ > COPYING COPYING-GPLV2 COPYING-LGPLV3 I was afraid this wouldn't play nice with make dist, but ... "If SUBDIRS is defined conditionally using Automake conditionals, Automake will define DIST_SUBDIRS automatically from the possible values of SUBDIRS in all conditions." https://www.gnu.org/software/automake/manual/html_node/SUBDIRS-vs-DIST_005f= SUBDIRS.html So this is fine. > diff --git a/config/Makefile.am b/config/Makefile.am > index 9d292cee66c8..6425718efc54 100644 > --- a/config/Makefile.am > +++ b/config/Makefile.am > @@ -32,7 +32,7 @@ EXTRA_DIST =3D elfutils.spec.in known-dwarf.awk 10-defa= ult-yama-scope.conf > libelf.pc.in libdw.pc.in >=20=20 > pkgconfigdir =3D $(libdir)/pkgconfig > -pkgconfig_DATA =3D libelf.pc libdw.pc > +pkgconfig_DATA =3D libelf.pc libdw.pc libdebuginfod.pc >=20=20 > if MAINTAINER_MODE > $(srcdir)/elfutils.spec.in: $(top_srcdir)/NEWS Nice to have a separate libdebuginfod.pc > diff --git a/config/libdebuginfod.pc.in b/config/libdebuginfod.pc.in > new file mode 100644 > index 000000000000..46722a76b593 > --- /dev/null > +++ b/config/libdebuginfod.pc.in > @@ -0,0 +1,12 @@ > +prefix=3D@prefix@ > +exec_prefix=3D@exec_prefix@ > +libdir=3D@libdir@ > +includedir=3D@includedir@ > + > +Name: debuginfod > +Description: elfutils library to query debuginfo files from debuginfod s= ervers > +Version: @VERSION@ > +URL: http://elfutils.org/ > + > +Libs: -L${libdir} -ldebuginfod > +Cflags: -I${includedir} No Requires on libelf or libdw? > diff --git a/configure.ac b/configure.ac > index 9be34d124387..738a96f18bf5 100644 > --- a/configure.ac > +++ b/configure.ac > @@ -60,6 +60,8 @@ AC_CONFIG_FILES([m4/Makefile]) > dnl The RPM spec file. We substitute a few values in the file. > AC_CONFIG_FILES([elfutils.spec:config/elfutils.spec.in]) >=20=20 > +dnl debuginfo-server client & server parts. > +AC_CONFIG_FILES([debuginfod/Makefile]) >=20=20 > AC_CANONICAL_HOST >=20=20 > @@ -86,6 +88,8 @@ AS_IF([test "$use_locks" =3D yes], > AH_TEMPLATE([USE_LOCKS], [Defined if libraries should be thread-safe.]) >=20=20 > AC_PROG_CC > +AC_PROG_CXX > +AX_CXX_COMPILE_STDCXX(11, noext, optional) > AC_PROG_RANLIB > AC_PROG_YACC > AM_PROG_LEX > @@ -538,7 +542,7 @@ AM_CONDITIONAL(STANDALONE, false)dnl Used in tests/Ma= kefile.am, which see. > AC_CONFIG_FILES([tests/Makefile]) >=20=20 > dnl pkgconfig files > -AC_CONFIG_FILES([config/libelf.pc config/libdw.pc]) > +AC_CONFIG_FILES([config/libelf.pc config/libdw.pc config/libdebuginfod.p= c]) My only concern is that these might slow down configure when debuginfod isn't enabled? Can/Should they be moved later after the enable test? > # Get the definitions necessary to create the Makefiles in the po > # subdirectories. This is a small subset of the gettext rules. > @@ -641,6 +645,22 @@ if test "$HAVE_BUNZIP2" =3D "no"; then > AC_MSG_WARN([No bunzip2, needed to run make check]) > fi >=20=20 > +# Look for libmicrohttpd, libcurl, libarchive, sqlite for debuginfo serv= er > +# minimum versions as per rhel7. Single --enable-* option arranges to b= uild > +# both client libs and server process. > + > +PKG_PROG_PKG_CONFIG > +AC_ARG_ENABLE([debuginfod], AC_HELP_STRING([--enable-debuginfod], [Build= debuginfo server and client solib])) > +AS_IF([test "x$enable_debuginfod" =3D "xyes"], [ > + AC_DEFINE([ENABLE_DEBUGINFOD],[1],[Build debuginfo-server]) > + PKG_CHECK_MODULES([libmicrohttpd],[libmicrohttpd >=3D 0.9.33]) > + PKG_CHECK_MODULES([libcurl],[libcurl >=3D 7.29.0]) > + PKG_CHECK_MODULES([sqlite3],[sqlite3 >=3D 3.7.17]) > + PKG_CHECK_MODULES([libarchive],[libarchive >=3D 3.1.2]) > +], [enable_debuginfod=3D"no"]) > +AM_CONDITIONAL([DEBUGINFOD],[test "x$enable_debuginfod" =3D "xyes"]) Would it be better to enable by default with an error to disable if any dependencies (and CXX compiler?) aren't found? If not, then I think you should add it explicitly to the AM_DISTCHECK_CONFIGURE_FLAGS in Makefile.am. > AC_OUTPUT >=20=20 > AC_MSG_NOTICE([ > @@ -669,6 +689,7 @@ AC_MSG_NOTICE([ > OTHER FEATURES > Deterministic archives by default : ${default_ar_deterministic} > Native language support : ${USE_NLS} > + Debuginfo server support : ${enable_debuginfod} client and server support? Cheers, Mark