From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2009) id 1F1503858C5E; Wed, 27 Sep 2023 19:12:56 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 1F1503858C5E Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Aaron Merey To: bfd-cvs@sourceware.org, gdb-cvs@sourceware.org Subject: [binutils-gdb] config/debuginfod.m4: Add check for libdebuginfod 0.188 X-Act-Checkin: binutils-gdb X-Git-Author: Aaron Merey X-Git-Refname: refs/heads/master X-Git-Oldrev: 4befded43f524d0840bb88fff7b77415b73a3851 X-Git-Newrev: 28bc495137bcc824167c92dd5d049576f11a3ed3 Message-Id: <20230927191256.1F1503858C5E@sourceware.org> Date: Wed, 27 Sep 2023 19:12:56 +0000 (GMT) X-BeenThere: binutils-cvs@sourceware.org X-Mailman-Version: 2.1.30 Precedence: list List-Id: Binutils-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Sep 2023 19:12:56 -0000 https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3D28bc495137bc= c824167c92dd5d049576f11a3ed3 commit 28bc495137bcc824167c92dd5d049576f11a3ed3 Author: Aaron Merey Date: Wed Sep 27 15:11:13 2023 -0400 config/debuginfod.m4: Add check for libdebuginfod 0.188 =20 Add check for libdebuginfod 0.188 in AC_DEBUGINFOD and if found define macro HAVE_LIBDEBUGINFOD_FIND_SECTION. =20 This macro indicates support for downloading ELF sections from debuginfod servers. Diff: --- 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 =20 +/* 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 =20 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 =20 -# 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. =20 # Check whether --with-debuginfod was given. if test "${with_debuginfod+set}" =3D set; then : @@ -11825,6 +11831,106 @@ $as_echo "$with_debuginfod" >&6; } =20 if test "x$with_debuginfod" !=3D xno; then =20 +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 --pri= nt-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.1= 88" 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 --pri= nt-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 --print-error= s --cflags --libs "libdebuginfod >=3D 0.188" 2>&1` + else + DEBUGINFOD_PKG_ERRORS=3D`$PKG_CONFIG --print-errors --cflags --li= bs "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 is missin= g or some features may be unavailable." >&5 +$as_echo "$as_me: WARNING: libdebuginfod is missing or some features may b= e 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 is missin= g or some features may be unavailable." >&5 +$as_echo "$as_me: WARNING: libdebuginfod is missing or some features may b= e 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 progra= m. =20 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 debug= infod (auto/yes/no)]), [], [with_debuginfod=3Dauto]) @@ -15,6 +21,11 @@ AC_MSG_CHECKING([whether to use debuginfod]) AC_MSG_RESULT([$with_debuginfod]) =20 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 supported= .])], + [AC_MSG_WARN([libdebuginfod is missing or some features may be unavail= able.])]) + PKG_CHECK_MODULES([DEBUGINFOD], [libdebuginfod >=3D 0.179], [AC_DEFINE([HAVE_LIBDEBUGINFOD], [1], [Define to 1 if debuginfod is en= abled.])], [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 =20 +/* Define to 1 if debuginfod section downloading is supported. */ +#undef HAVE_LIBDEBUGINFOD_FIND_SECTION + /* Define if you have the expat library. */ #undef HAVE_LIBEXPAT =20 diff --git a/gdb/configure b/gdb/configure index ab1a299d860..2d07e0cb596 100755 --- a/gdb/configure +++ b/gdb/configure @@ -18405,7 +18405,13 @@ esac =20 # Handle optional debuginfod support =20 -# 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. =20 # Check whether --with-debuginfod was given. if test "${with_debuginfod+set}" =3D set; then : @@ -18421,6 +18427,106 @@ $as_echo "$with_debuginfod" >&6; } =20 if test "x$with_debuginfod" !=3D xno; then =20 +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 --pri= nt-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.1= 88" 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 --pri= nt-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 --print-error= s --cflags --libs "libdebuginfod >=3D 0.188" 2>&1` + else + DEBUGINFOD_PKG_ERRORS=3D`$PKG_CONFIG --print-errors --cflags --li= bs "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 is missin= g or some features may be unavailable." >&5 +$as_echo "$as_me: WARNING: libdebuginfod is missing or some features may b= e 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 is missin= g or some features may be unavailable." >&5 +$as_echo "$as_me: WARNING: libdebuginfod is missing or some features may b= e 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; }