Hi Pietro.

>  if test x$may_have_cet = xyes; then
>    if test x$cross_compiling = xno; then
> -    AC_TRY_RUN([
> +    AC_RUN_IFELSE([AC_LANG_SOURCE([[
>  int
>  main ()
>  {
>    asm ("endbr32");
>    return 0;
>  }
> -    ],
> +    ]])],
>      [have_multi_byte_nop=yes],
> -    [have_multi_byte_nop=no])
> +    [have_multi_byte_nop=no],
> +    [AC_MSG_FAILURE(cannot run test program while cross compiling)])
>      have_cet=no
>      if test x$have_multi_byte_nop = xyes; then

According to the AU_DEFUN in autoconf 2.69:


  # AC_TRY_RUN(PROGRAM,
  #            [ACTION-IF-TRUE], [ACTION-IF-FALSE],
  #            [ACTION-IF-CROSS-COMPILING = RUNTIME-ERROR])
  # -------------------------------------------------------
  AU_DEFUN([AC_TRY_RUN],
  [AC_RUN_IFELSE([AC_LANG_SOURCE([[$1]])], [$2], [$3], [$4])])

And AC_RUN_IFELSE provides a default $4 argument with:

  [m4_default([$4],
           [AC_MSG_FAILURE([cannot run test program while cross
           compiling])])]

See autoconf/lib/autoconf/general.m4.  Is it necessary to provide an
explicit argument here?

> -      AC_TRY_RUN([
> +      AC_RUN_IFELSE([AC_LANG_SOURCE([[
>  static void
>  foo (void)
>  {
> @@ -167,9 +168,10 @@ main ()
>    bar ();
>    return 0;
>  }
> -      ],
> +      ]])],
>        [have_cet=no],
> -      [have_cet=yes])
> +      [have_cet=yes],
> +      [AC_MSG_FAILURE(cannot run test program while cross compiling)])
>      fi

Ditto.

> diff --git a/config/tls.m4 b/config/tls.m4
> index 7532305b908a..8d1b83d0f33e 100644
> --- a/config/tls.m4
> +++ b/config/tls.m4
> @@ -12,7 +12,8 @@ AC_DEFUN([GCC_CHECK_TLS], [
>        LDFLAGS="-static $LDFLAGS"
>        AC_LINK_IFELSE([AC_LANG_SOURCE([int main() { return 0; }])],
>       [AC_RUN_IFELSE([AC_LANG_SOURCE([__thread int a; int b; int main() { 
> return a = b; }])],
> -                    [gcc_cv_have_tls=yes], [gcc_cv_have_tls=no],[])],
> +                    [gcc_cv_have_tls=yes], [gcc_cv_have_tls=no],
> +                    [AC_MSG_FAILURE(cannot run test program while cross 
> compiling)])],

Ditto.

>       [gcc_cv_have_tls=yes])
>        LDFLAGS="$chktls_save_LDFLAGS"
>        if test $gcc_cv_have_tls = yes; then
> @@ -64,7 +65,8 @@ AC_DEFUN([GCC_CHECK_TLS], [
>               if (pthread_join (thread, &thread_retval))
>                 return 0;
>               return (a_in_other_thread == a_in_main_thread);])],
> -          [gcc_cv_have_tls=yes], [gcc_cv_have_tls=no], [])
> +          [gcc_cv_have_tls=yes], [gcc_cv_have_tls=no],
> +          [AC_MSG_FAILURE(cannot run test program while cross compiling)])

Ditto.

>         CFLAGS="$chktls_save_CFLAGS"
>       fi
>        fi],
>
> [...]
>
> @@ -648,11 +648,9 @@ AC_DEFUN([LIBGCC_CHECK_AS_LSE], [
>  case "${target}" in
>  aarch64*-*-*)
>    AC_CACHE_CHECK([if the assembler supports LSE], libgcc_cv_as_lse, [
> -    AC_TRY_COMPILE([],
> -changequote(,)dnl
> -                     asm(".arch armv8-a+lse\n\tcas w0, w1, [x2]");
> -changequote([,])dnl
> -                    ,
> +    AC_COMPILE_IFELSE(
> +      [AC_LANG_PROGRAM([[]],
> +                     [[asm(".arch armv8-a+lse\n\tcas w0, w1, [x2]");]])],
>                  [libgcc_cv_as_lse=yes], [libgcc_cv_as_lse=no])
>    ])
>    if test x$libgcc_cv_as_lse = xyes; then

Hehe :)

The other changes LGTM, based on the AU_DEFUNs I see in autoconf 2.69
and in latest libtool.

Reply via email to