config: Sync pkg.m4 from GCC

Message ID 20261028220341.84076-2-pietro@sociotechnical.xyz
State New
Headers
Series config: Sync pkg.m4 from GCC |

Checks

Context Check Description
linaro-tcwg-bot/tcwg_gdb_build--master-aarch64 fail Patch failed to apply
linaro-tcwg-bot/tcwg_gdb_build--master-arm fail Patch failed to apply

Commit Message

Pietro Monteiro Oct. 28, 2026, 10:03 p.m. UTC
  Sorry I missed this patch had been reviwed:
https://inbox.sourceware.org/gcc-patches/20250530213858.59471-1-pietro@sociotechnical.xyz/t/

I regenerated all autoconf files after applying the patch and there's no
changes.

pietro
-- >8 --
Sync the following commit from GCC:

commit 6382527abc778ecbfedb8a85ddcc502cd97ddee9
Author: Pietro Monteiro <pietro@sociotechnical.xyz>
Date:   Thu Oct 22 18:48:54 2026 -0400

    config: Update obsolete macro in pkg.m4

    The autoconf macro PKG_CHECK_MODULES defined in config/pkg.m4 uses the
    obsolete AC_TRY_LINK[1]. Update the code to use AC_LINK_IFELSE as
    documented by autoconf

    There's no difference to the generated files.

    [1] https://www.gnu.org/software/autoconf/manual/autoconf-2.69/html_node/Obsolete-Macros.html#index-AC_005fTRY_005fLINK-2207

    config/ChangeLog:

            * pkg.m4 (PKG_CHECK_MODULES): Replace AC_TRY_LINK with AC_LINK_IFELSE.
Signed-off-by: Pietro Monteiro <pietro@sociotechnical.xyz>
---
 config/pkg.m4 | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Comments

Pietro Monteiro Oct. 28, 2026, 10:07 p.m. UTC | #1
Sorry, meant to tag this patch as committed.

On Wed, Oct 28, 2026, at 6:03 PM, Pietro Monteiro wrote:
> Sorry I missed this patch had been reviwed:
> https://inbox.sourceware.org/gcc-patches/20250530213858.59471-1-pietro@sociotechnical.xyz/t/
>
> I regenerated all autoconf files after applying the patch and there's no
> changes.
>
> pietro
> -- >8 --
> Sync the following commit from GCC:
>
> commit 6382527abc778ecbfedb8a85ddcc502cd97ddee9
> Author: Pietro Monteiro <pietro@sociotechnical.xyz>
> Date:   Thu Oct 22 18:48:54 2026 -0400
>
>     config: Update obsolete macro in pkg.m4
>
>     The autoconf macro PKG_CHECK_MODULES defined in config/pkg.m4 uses the
>     obsolete AC_TRY_LINK[1]. Update the code to use AC_LINK_IFELSE as
>     documented by autoconf
>
>     There's no difference to the generated files.
>
>     [1] 
> https://www.gnu.org/software/autoconf/manual/autoconf-2.69/html_node/Obsolete-Macros.html#index-AC_005fTRY_005fLINK-2207
>
>     config/ChangeLog:
>
>             * pkg.m4 (PKG_CHECK_MODULES): Replace AC_TRY_LINK with 
> AC_LINK_IFELSE.
> Signed-off-by: Pietro Monteiro <pietro@sociotechnical.xyz>
> ---
>  config/pkg.m4 | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/config/pkg.m4 b/config/pkg.m4
> index 7ebf517cd6a..cc15588a05c 100644
> --- a/config/pkg.m4
> +++ b/config/pkg.m4
> @@ -151,7 +151,7 @@ dnl Check whether $pkg_cv_[]$1[]_LIBS works.
>  if test $pkg_failed = no; then
>    pkg_save_LDFLAGS="$LDFLAGS"
>    LDFLAGS="$LDFLAGS $pkg_cv_[]$1[]_LIBS"
> -  AC_TRY_LINK([],[], [], [pkg_failed=yes])
> +  AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[]])],[],[pkg_failed=yes])
>    LDFLAGS=$pkg_save_LDFLAGS
>  fi
> 
> -- 
> 2.54.0
  

Patch

diff --git a/config/pkg.m4 b/config/pkg.m4
index 7ebf517cd6a..cc15588a05c 100644
--- a/config/pkg.m4
+++ b/config/pkg.m4
@@ -151,7 +151,7 @@  dnl Check whether $pkg_cv_[]$1[]_LIBS works.
 if test $pkg_failed = no; then
   pkg_save_LDFLAGS="$LDFLAGS"
   LDFLAGS="$LDFLAGS $pkg_cv_[]$1[]_LIBS"
-  AC_TRY_LINK([],[], [], [pkg_failed=yes])
+  AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [[]])],[],[pkg_failed=yes])
   LDFLAGS=$pkg_save_LDFLAGS
 fi