On Tue, Jun 2, 2026, at 3:04 PM, Jose E. Marchesi wrote:
> 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?

It isn't necessary. As you noted, I'm using the same default as
autoconf and there's no difference in the generated files wheter the
argument is present. But autoconf prints a warning message when
AC_RUN_IFELSE has no action-if-cross-compiling argument. And getting
rid of the warnings is the main goal here.

>> @@ -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 double m4 quote make the changequote's unnecessary :)

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

Thanks for the review!

pietro

Reply via email to