From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id 36D263858D20 for ; Tue, 19 Sep 2023 14:33:29 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org 36D263858D20 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1695134008; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=qux2pOSNGgBZm6HRp1/ddTFopyKmne7yjF1TEVl9hBQ=; b=JnjwAry3K/rPsb7i4FwPBATDMP3MuIGRmfwWvc3mu+ciqK8QEROaio8anslPfV8KezRyIN y7qgD4js5UHBHKOu8lcbmcOtfG2xvx1geyTNmPbmUnp68/2b+Hja4sFL9oD0A3sTnElcfp LP3GSxyoIuV4jCUtw9smy6Z+iMxjaww= Received: from mail-pj1-f70.google.com (mail-pj1-f70.google.com [209.85.216.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-595--k6kD1wcPH2EiekVdi86fg-1; Tue, 19 Sep 2023 10:33:27 -0400 X-MC-Unique: -k6kD1wcPH2EiekVdi86fg-1 Received: by mail-pj1-f70.google.com with SMTP id 98e67ed59e1d1-27484fabc22so3486455a91.3 for ; Tue, 19 Sep 2023 07:33:27 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1695134006; x=1695738806; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=qux2pOSNGgBZm6HRp1/ddTFopyKmne7yjF1TEVl9hBQ=; b=FPpWfOe6VQDmNkGOheQ8XfMu0uqeTWVSsk+7Xa+1+zCM5R7jfIpttO9qLjuKJWwuA1 XGGc41FTpVqQ55qUxjqptqaXjspxDtIw74zBUctZ4HmfskP3Ma29Vo3XQuGcAFzsafBD wHFQYPOA0vydIkbLXcBLgNkCR4pXOq1uqqwmfIStQjh5xnkMOL+GuGClkyNIoj8uny7P AWyN1Jortg0CfBztpP4KABm+AnUn3bViHag4u9heZ3ptUfmC+RoN6IaDnx4z0ie5CiAa KM2QFDh+r6OEfOU88xUZD7OA+7bYKtGbsNF/wAmSRvwGkQYH6suLYtrzOFZmWyu7UrUC fKBA== X-Gm-Message-State: AOJu0YzDRH3hBUzK9f/Wbv6LzyRtzhy8luEmxYjmkuT1igdeNZJPhF2r XExNI0EZ8NtOpxGnAgNdmWTqzs3jZaDSGeXg1Xj68lwLpb/j97pW5s/5Q/JnAJJTVfF2f8xmw7t 4jzTxH+gFqRSZ9a4zB8kNG8/79zz7NYFYi6r3DiuNK3CH X-Received: by 2002:a17:90b:3748:b0:26d:ae3:f6a6 with SMTP id ne8-20020a17090b374800b0026d0ae3f6a6mr9030811pjb.18.1695134006218; Tue, 19 Sep 2023 07:33:26 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHfUjN6t2DS29IeCRc5nx99STzcrNlmilPCMy6J1sATR6XrCVtemOvgrTW5gUYwPP1VA7DUSO552psoy67m+4E= X-Received: by 2002:a17:90b:3748:b0:26d:ae3:f6a6 with SMTP id ne8-20020a17090b374800b0026d0ae3f6a6mr9030792pjb.18.1695134005815; Tue, 19 Sep 2023 07:33:25 -0700 (PDT) MIME-Version: 1.0 References: <20230816044259.2675531-1-amerey@redhat.com> <20230816044259.2675531-2-amerey@redhat.com> In-Reply-To: <20230816044259.2675531-2-amerey@redhat.com> From: Aaron Merey Date: Tue, 19 Sep 2023 10:33:13 -0400 Message-ID: Subject: Re: [PATCH 1/7] config/debuginfod.m4: Add check for libdebuginfod 0.188 To: gdb-patches@sourceware.org, binutils@sourceware.org Cc: aburgess@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-10.8 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,GIT_PATCH_0,KAM_NUMSUBJECT,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE,TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: Ping Thanks, Aaron On Wed, Aug 16, 2023 at 12:43=E2=80=AFAM Aaron Merey wr= ote: > > Add check for libdebuginfod 0.188 in AC_DEBUGINFOD and if found > define macro HAVE_LIBDEBUGINFOD_FIND_SECTION. > > This macro indicates support for downloading ELF sections from > debuginfod servers. > --- > binutils/config.in | 3 ++ > binutils/configure | 108 ++++++++++++++++++++++++++++++++++++++++++- > config/debuginfod.m4 | 13 +++++- > gdb/config.in | 3 ++ > gdb/configure | 108 ++++++++++++++++++++++++++++++++++++++++++- > 5 files changed, 232 insertions(+), 3 deletions(-) > > diff --git a/binutils/config.in b/binutils/config.in > index 91fe00af777..8907a56fc15 100644 > --- a/binutils/config.in > +++ b/binutils/config.in > @@ -94,6 +94,9 @@ > /* Define to 1 if debuginfod is enabled. */ > #undef HAVE_LIBDEBUGINFOD > > +/* Define to 1 if debuginfod section downloading is supported. */ > +#undef HAVE_LIBDEBUGINFOD_FIND_SECTION > + > /* Define if mbstate_t exists in wchar.h. */ > #undef HAVE_MBSTATE_T > > diff --git a/binutils/configure b/binutils/configure > index 101671411a5..7806ff2a0b3 100755 > --- a/binutils/configure > +++ b/binutils/configure > @@ -11809,7 +11809,13 @@ $as_echo "no" >&6; } > fi > fi > > -# Handle optional debuginfod support > +# Handle optional debuginfod support as well as optional section > +# downloading support. > +# > +# Define HAVE_LIBDEBUGINFOD if libdebuginfod is found with version >=3D = 0.179. > +# > +# Define HAVE_LIBDEBUGINFOD_FIND_SECTION if libdebuginfod is found with > +# version >=3D 0.188. > > # Check whether --with-debuginfod was given. > if test "${with_debuginfod+set}" =3D set; then : > @@ -11825,6 +11831,106 @@ $as_echo "$with_debuginfod" >&6; } > > if test "x$with_debuginfod" !=3D xno; then > > +pkg_failed=3Dno > +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for libdebuginfod >=3D= 0.188" >&5 > +$as_echo_n "checking for libdebuginfod >=3D 0.188... " >&6; } > + > +if test -n "$DEBUGINFOD_CFLAGS"; then > + pkg_cv_DEBUGINFOD_CFLAGS=3D"$DEBUGINFOD_CFLAGS" > + elif test -n "$PKG_CONFIG"; then > + if test -n "$PKG_CONFIG" && \ > + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --p= rint-errors \"libdebuginfod >=3D 0.188\""; } >&5 > + ($PKG_CONFIG --exists --print-errors "libdebuginfod >=3D 0.188") 2>&5 > + ac_status=3D$? > + $as_echo "$as_me:${as_lineno-$LINENO}: \$? =3D $ac_status" >&5 > + test $ac_status =3D 0; }; then > + pkg_cv_DEBUGINFOD_CFLAGS=3D`$PKG_CONFIG --cflags "libdebuginfod >=3D 0= .188" 2>/dev/null` > + test "x$?" !=3D "x0" && pkg_failed=3Dyes > +else > + pkg_failed=3Dyes > +fi > + else > + pkg_failed=3Duntried > +fi > +if test -n "$DEBUGINFOD_LIBS"; then > + pkg_cv_DEBUGINFOD_LIBS=3D"$DEBUGINFOD_LIBS" > + elif test -n "$PKG_CONFIG"; then > + if test -n "$PKG_CONFIG" && \ > + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --p= rint-errors \"libdebuginfod >=3D 0.188\""; } >&5 > + ($PKG_CONFIG --exists --print-errors "libdebuginfod >=3D 0.188") 2>&5 > + ac_status=3D$? > + $as_echo "$as_me:${as_lineno-$LINENO}: \$? =3D $ac_status" >&5 > + test $ac_status =3D 0; }; then > + pkg_cv_DEBUGINFOD_LIBS=3D`$PKG_CONFIG --libs "libdebuginfod >=3D 0.188= " 2>/dev/null` > + test "x$?" !=3D "x0" && pkg_failed=3Dyes > +else > + pkg_failed=3Dyes > +fi > + else > + pkg_failed=3Duntried > +fi > + > +if test $pkg_failed =3D no; then > + pkg_save_LDFLAGS=3D"$LDFLAGS" > + LDFLAGS=3D"$LDFLAGS $pkg_cv_DEBUGINFOD_LIBS" > + cat confdefs.h - <<_ACEOF >conftest.$ac_ext > +/* end confdefs.h. */ > + > +int > +main () > +{ > + > + ; > + return 0; > +} > +_ACEOF > +if ac_fn_c_try_link "$LINENO"; then : > + > +else > + pkg_failed=3Dyes > +fi > +rm -f core conftest.err conftest.$ac_objext \ > + conftest$ac_exeext conftest.$ac_ext > + LDFLAGS=3D$pkg_save_LDFLAGS > +fi > + > + > + > +if test $pkg_failed =3D yes; then > + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 > +$as_echo "no" >&6; } > + > +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then > + _pkg_short_errors_supported=3Dyes > +else > + _pkg_short_errors_supported=3Dno > +fi > + if test $_pkg_short_errors_supported =3D yes; then > + DEBUGINFOD_PKG_ERRORS=3D`$PKG_CONFIG --short-errors --pri= nt-errors --cflags --libs "libdebuginfod >=3D 0.188" 2>&1` > + else > + DEBUGINFOD_PKG_ERRORS=3D`$PKG_CONFIG --print-errors --cfl= ags --libs "libdebuginfod >=3D 0.188" 2>&1` > + fi > + # Put the nasty error message in config.log where it belongs > + echo "$DEBUGINFOD_PKG_ERRORS" >&5 > + > + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: libdebuginfod i= s missing or some features may be unavailable." >&5 > +$as_echo "$as_me: WARNING: libdebuginfod is missing or some features may= be unavailable." >&2;} > +elif test $pkg_failed =3D untried; then > + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 > +$as_echo "no" >&6; } > + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: libdebuginfod i= s missing or some features may be unavailable." >&5 > +$as_echo "$as_me: WARNING: libdebuginfod is missing or some features may= be unavailable." >&2;} > +else > + DEBUGINFOD_CFLAGS=3D$pkg_cv_DEBUGINFOD_CFLAGS > + DEBUGINFOD_LIBS=3D$pkg_cv_DEBUGINFOD_LIBS > + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 > +$as_echo "yes" >&6; } > + > +$as_echo "#define HAVE_LIBDEBUGINFOD_FIND_SECTION 1" >>confdefs.h > + > +fi > + > + > pkg_failed=3Dno > { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libdebuginfod >=3D= 0.179" >&5 > $as_echo_n "checking for libdebuginfod >=3D 0.179... " >&6; } > diff --git a/config/debuginfod.m4 b/config/debuginfod.m4 > index 2c1bfbdb544..c5077acb4c3 100644 > --- a/config/debuginfod.m4 > +++ b/config/debuginfod.m4 > @@ -7,7 +7,13 @@ dnl the same distribution terms as the rest of that prog= ram. > > AC_DEFUN([AC_DEBUGINFOD], > [ > -# Handle optional debuginfod support > +# Handle optional debuginfod support as well as optional section > +# downloading support. > +# > +# Define HAVE_LIBDEBUGINFOD if libdebuginfod is found with version >=3D = 0.179. > +# > +# Define HAVE_LIBDEBUGINFOD_FIND_SECTION if libdebuginfod is found with > +# version >=3D 0.188. > AC_ARG_WITH([debuginfod], > AC_HELP_STRING([--with-debuginfod], [Enable debuginfo lookups with deb= uginfod (auto/yes/no)]), > [], [with_debuginfod=3Dauto]) > @@ -15,6 +21,11 @@ AC_MSG_CHECKING([whether to use debuginfod]) > AC_MSG_RESULT([$with_debuginfod]) > > if test "x$with_debuginfod" !=3D xno; then > + PKG_CHECK_MODULES([DEBUGINFOD], [libdebuginfod >=3D 0.188], > + [AC_DEFINE([HAVE_LIBDEBUGINFOD_FIND_SECTION], [1], > + [Define to 1 if debuginfod section downloading is support= ed.])], > + [AC_MSG_WARN([libdebuginfod is missing or some features may be unava= ilable.])]) > + > PKG_CHECK_MODULES([DEBUGINFOD], [libdebuginfod >=3D 0.179], > [AC_DEFINE([HAVE_LIBDEBUGINFOD], [1], [Define to 1 if debuginfod is = enabled.])], > [if test "x$with_debuginfod" =3D xyes; then > diff --git a/gdb/config.in b/gdb/config.in > index bc562669d2c..f67d3029d82 100644 > --- a/gdb/config.in > +++ b/gdb/config.in > @@ -244,6 +244,9 @@ > /* Define to 1 if debuginfod is enabled. */ > #undef HAVE_LIBDEBUGINFOD > > +/* Define to 1 if debuginfod section downloading is supported. */ > +#undef HAVE_LIBDEBUGINFOD_FIND_SECTION > + > /* Define if you have the expat library. */ > #undef HAVE_LIBEXPAT > > diff --git a/gdb/configure b/gdb/configure > index ab1a299d860..2d07e0cb596 100755 > --- a/gdb/configure > +++ b/gdb/configure > @@ -18405,7 +18405,13 @@ esac > > # Handle optional debuginfod support > > -# Handle optional debuginfod support > +# Handle optional debuginfod support as well as optional section > +# downloading support. > +# > +# Define HAVE_LIBDEBUGINFOD if libdebuginfod is found with version >=3D = 0.179. > +# > +# Define HAVE_LIBDEBUGINFOD_FIND_SECTION if libdebuginfod is found with > +# version >=3D 0.188. > > # Check whether --with-debuginfod was given. > if test "${with_debuginfod+set}" =3D set; then : > @@ -18421,6 +18427,106 @@ $as_echo "$with_debuginfod" >&6; } > > if test "x$with_debuginfod" !=3D xno; then > > +pkg_failed=3Dno > +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for libdebuginfod >=3D= 0.188" >&5 > +$as_echo_n "checking for libdebuginfod >=3D 0.188... " >&6; } > + > +if test -n "$DEBUGINFOD_CFLAGS"; then > + pkg_cv_DEBUGINFOD_CFLAGS=3D"$DEBUGINFOD_CFLAGS" > + elif test -n "$PKG_CONFIG"; then > + if test -n "$PKG_CONFIG" && \ > + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --p= rint-errors \"libdebuginfod >=3D 0.188\""; } >&5 > + ($PKG_CONFIG --exists --print-errors "libdebuginfod >=3D 0.188") 2>&5 > + ac_status=3D$? > + $as_echo "$as_me:${as_lineno-$LINENO}: \$? =3D $ac_status" >&5 > + test $ac_status =3D 0; }; then > + pkg_cv_DEBUGINFOD_CFLAGS=3D`$PKG_CONFIG --cflags "libdebuginfod >=3D 0= .188" 2>/dev/null` > + test "x$?" !=3D "x0" && pkg_failed=3Dyes > +else > + pkg_failed=3Dyes > +fi > + else > + pkg_failed=3Duntried > +fi > +if test -n "$DEBUGINFOD_LIBS"; then > + pkg_cv_DEBUGINFOD_LIBS=3D"$DEBUGINFOD_LIBS" > + elif test -n "$PKG_CONFIG"; then > + if test -n "$PKG_CONFIG" && \ > + { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --p= rint-errors \"libdebuginfod >=3D 0.188\""; } >&5 > + ($PKG_CONFIG --exists --print-errors "libdebuginfod >=3D 0.188") 2>&5 > + ac_status=3D$? > + $as_echo "$as_me:${as_lineno-$LINENO}: \$? =3D $ac_status" >&5 > + test $ac_status =3D 0; }; then > + pkg_cv_DEBUGINFOD_LIBS=3D`$PKG_CONFIG --libs "libdebuginfod >=3D 0.188= " 2>/dev/null` > + test "x$?" !=3D "x0" && pkg_failed=3Dyes > +else > + pkg_failed=3Dyes > +fi > + else > + pkg_failed=3Duntried > +fi > + > +if test $pkg_failed =3D no; then > + pkg_save_LDFLAGS=3D"$LDFLAGS" > + LDFLAGS=3D"$LDFLAGS $pkg_cv_DEBUGINFOD_LIBS" > + cat confdefs.h - <<_ACEOF >conftest.$ac_ext > +/* end confdefs.h. */ > + > +int > +main () > +{ > + > + ; > + return 0; > +} > +_ACEOF > +if ac_fn_c_try_link "$LINENO"; then : > + > +else > + pkg_failed=3Dyes > +fi > +rm -f core conftest.err conftest.$ac_objext \ > + conftest$ac_exeext conftest.$ac_ext > + LDFLAGS=3D$pkg_save_LDFLAGS > +fi > + > + > + > +if test $pkg_failed =3D yes; then > + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 > +$as_echo "no" >&6; } > + > +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then > + _pkg_short_errors_supported=3Dyes > +else > + _pkg_short_errors_supported=3Dno > +fi > + if test $_pkg_short_errors_supported =3D yes; then > + DEBUGINFOD_PKG_ERRORS=3D`$PKG_CONFIG --short-errors --pri= nt-errors --cflags --libs "libdebuginfod >=3D 0.188" 2>&1` > + else > + DEBUGINFOD_PKG_ERRORS=3D`$PKG_CONFIG --print-errors --cfl= ags --libs "libdebuginfod >=3D 0.188" 2>&1` > + fi > + # Put the nasty error message in config.log where it belongs > + echo "$DEBUGINFOD_PKG_ERRORS" >&5 > + > + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: libdebuginfod i= s missing or some features may be unavailable." >&5 > +$as_echo "$as_me: WARNING: libdebuginfod is missing or some features may= be unavailable." >&2;} > +elif test $pkg_failed =3D untried; then > + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 > +$as_echo "no" >&6; } > + { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: libdebuginfod i= s missing or some features may be unavailable." >&5 > +$as_echo "$as_me: WARNING: libdebuginfod is missing or some features may= be unavailable." >&2;} > +else > + DEBUGINFOD_CFLAGS=3D$pkg_cv_DEBUGINFOD_CFLAGS > + DEBUGINFOD_LIBS=3D$pkg_cv_DEBUGINFOD_LIBS > + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 > +$as_echo "yes" >&6; } > + > +$as_echo "#define HAVE_LIBDEBUGINFOD_FIND_SECTION 1" >>confdefs.h > + > +fi > + > + > pkg_failed=3Dno > { $as_echo "$as_me:${as_lineno-$LINENO}: checking for libdebuginfod >=3D= 0.179" >&5 > $as_echo_n "checking for libdebuginfod >=3D 0.179... " >&6; } > -- > 2.41.0 >