Re: [sr #110213] curl fails with autoconf master

2020-03-20 Thread Nick Bowler
On 20/03/2020, Ross Burton  wrote:
> URL:
>   
>
>  Summary: curl fails with autoconf master
>  Project: Autoconf
> Submitted by: rossburton
> Submitted on: Fri 20 Mar 2020 03:36:28 PM UTC
> Category: None
> Priority: 5 - Normal
> Severity: 3 - Normal
>   Status: None
>  Privacy: Public
>  Assigned to: None
> Originator Email:
>  Open/Closed: Open
>  Discussion Lock: Any
> Operating System: None
>
> ___
>
> Details:
>
> Curl cross-compiles fine with autoconf 2.69.  Swapping to autoconf master
> fails.
>
> It fails like this:
> checking if compiler is DEC/Compaq/HP C... no
> checking if compiler is HP-UX C... no
> checking if compiler is IBM C... no
> checking if compiler is Intel C... no
> checking if compiler is clang... no
> checking if compiler is GNU C... yes
> checking if compiler is LCC... no
> checking if compiler is SGI MIPSpro C... no
> checking if compiler is SGI MIPS C... no
> checking if compiler is SunPro C... no
> checking if compiler is Tiny C... no
> checking if compiler is Watcom C... no
> configure: error: in
> `/scratch/poky/work/corei7-64-poky-linux/curl/7.69.0-r0/build':
> configure: error: cannot run test program while cross compiling
>
> Yes, I'm cross-compiling, but the invocation of AC_RUN_IFELSE is guarded
> with
> a $cross_compiling check.

I suspect (without testing) the problem is the presense of
AC_REQUIRE([AC_RUN_IFELSE]) inside of CURL_RUN_IFELSE.

(Line 7292 of curl-functions.m4)

This use of AC_REQUIRE makes no sense at all.  With it there, if it
determines that there has been no prior expansion of AC_RUN_IFELSE in
the configure script, autoconf will output such an expansion at some
mostly-unspecified prior location with all arguments empty.

Such an expansion will cause the error you are seeing because the
action-if-cross-compiling argument is empty.

There are other weird uses if AC_REQUIRE in this file.  I suspect the
author(s) of this script have a serious misunderstanding about what
this macro does.

I imagine that it just happened to work by luck with old autoconf
because older versions of macros you are using happened to expand
AC_RUN_IFELSE themselves and this just happened to prevent any major
problems later in the configure script.

Hope that helps,
  Nick



[sr #110213] curl fails with autoconf master

2020-03-20 Thread Ross Burton
Follow-up Comment #1, sr #110213 (project autoconf):

Yes, thanks!

I'll forward that back to curl.  Many thanks for the quick response.  Feel
free to close this.

___

Reply to this item at:

  

___
  Message sent via Savannah
  https://savannah.gnu.org/




[sr #110214] autoreconf passes -Wcross to aclocal/automake but they don't support that

2020-03-20 Thread Ross Burton
URL:
  

 Summary: autoreconf passes -Wcross to aclocal/automake but
they don't support that
 Project: Autoconf
Submitted by: rossburton
Submitted on: Fri 20 Mar 2020 03:57:54 PM UTC
Category: None
Priority: 5 - Normal
Severity: 3 - Normal
  Status: None
 Privacy: Public
 Assigned to: None
Originator Email: 
 Open/Closed: Open
 Discussion Lock: Any
Operating System: GNU/Linux

___

Details:

If I call autoreconf -Wcross, the flag is passed to all the binaries that it
calls.  However, only autoconf supports -Wcross:

aclocal: warning: unknown warning category 'cross'
automake: warning: unknown warning category 'cross'






___

Reply to this item at:

  

___
  Message sent via Savannah
  https://savannah.gnu.org/




[sr #110213] curl fails with autoconf master

2020-03-20 Thread Ross Burton
URL:
  

 Summary: curl fails with autoconf master
 Project: Autoconf
Submitted by: rossburton
Submitted on: Fri 20 Mar 2020 03:36:28 PM UTC
Category: None
Priority: 5 - Normal
Severity: 3 - Normal
  Status: None
 Privacy: Public
 Assigned to: None
Originator Email: 
 Open/Closed: Open
 Discussion Lock: Any
Operating System: None

___

Details:

Curl cross-compiles fine with autoconf 2.69.  Swapping to autoconf master
fails.

It fails like this:
checking if compiler is DEC/Compaq/HP C... no
checking if compiler is HP-UX C... no
checking if compiler is IBM C... no
checking if compiler is Intel C... no
checking if compiler is clang... no
checking if compiler is GNU C... yes
checking if compiler is LCC... no
checking if compiler is SGI MIPSpro C... no
checking if compiler is SGI MIPS C... no
checking if compiler is SunPro C... no
checking if compiler is Tiny C... no
checking if compiler is Watcom C... no
configure: error: in
`/scratch/poky/work/corei7-64-poky-linux/curl/7.69.0-r0/build':
configure: error: cannot run test program while cross compiling

Yes, I'm cross-compiling, but the invocation of AC_RUN_IFELSE is guarded with
a $cross_compiling check.

Adding some echos, CURL_CHECK_COMPILER[1] succeeds but it never actually calls
into the body of CURL_SET_COMPILER_BASIC_OPTS[2].  The generated code looks
like this:

if test "$cross_compiling" = yes
then :
  { { printf "%s\n" "$as_me:${as_lineno-$LINENO}: error: in \`$ac_pwd':" >&5
printf "%s\n" "$as_me: error: in \`$ac_pwd':" >&2;}
as_fn_error $? "cannot run test program while cross compiling
See \`config.log' for more details" "$LINENO" 5; }
else
  if ac_fn_c_try_run "$LINENO"
then :

fi
rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \
  conftest.$ac_objext conftest.beam
fi


  #
  if test "$compiler_id" != "unknown"; then
...

Which is the beginning of CURL_SET_COMPILER_BASIC_OPTS [3].  That eventually
calls CURL_COMPILER_WORKS_IFELSE which has a AC_RUN_IFELSE wrapper without the
cross-compiling fallback, but it is guarded with a $cross_compiling test[4].

Does autoconf now detect calls to AC_RUN_IFELSE without an if-cross-compiling
option and abort ahead of time?  If so, this breaks people who guard
AC_RUN_IFELSE themselves, correct?

[1] https://github.com/curl/curl/blob/master/configure.ac#L258
[2] https://github.com/curl/curl/blob/master/m4/curl-compilers.m4#L571
[3] https://github.com/curl/curl/blob/master/m4/curl-compilers.m4#L575
[4] https://github.com/curl/curl/blob/master/m4/curl-compilers.m4#L536





___

Reply to this item at:

  

___
  Message sent via Savannah
  https://savannah.gnu.org/