mainAutoconf - Support: sr #110268, AC_RUN_IFELSE does not execute the...

 
 

sr #110268: AC_RUN_IFELSE does not execute the test program although it could

Submitter:  Bruno Haible <haible>
Submitted:  Wed 15 Jul 2020 07:58:09 AM UTC
   
 
Priority:  * 5 - Unprioritized Severity:  4 - Important
Status:  Done Privacy:  Public
Assigned to:  None Open/Closed:  Closed
Operating System:  None
* Mandatory Fields

Add a New Comment Rich Markup
   

Wed 15 Jul 2020 06:53:40 PM UTC, comment #2: 

Thanks for the bug report. I reverted the patch in question, and then updated the manual to mention cross-compiling for mingw as an example.

Paul Eggert <eggert>
Group administrator
Wed 15 Jul 2020 08:09:50 AM UTC, comment #1: 

I believe that the cause is this commit:
https://git.savannah.gnu.org/gitweb/?p=autoconf.git;a=commitdiff;h=fbec57294abd097fdc5894e0ec0d0133a0b5445b
and that reverting it would fix the regression.

The reasoning given in that commit was "modern GNU/Linux distributions set Wine to automatically handle Windows binaries." (and Wine is buggy). For these cases, the user can turn off the execution of the test programs either by not installing/activating Wine, or by passing the option --build=x86_64-unknown-linux-gnu in addition to --host=x86_64-w64-mingw32.

Bruno Haible <haible>
Wed 15 Jul 2020 07:58:09 AM UTC, original submission:  

This is a regression, compared to 2.69.

In situations where a platform is used as a development environment - with program execution capability - for a different platform, AC_RUN_IFELSE now does not execute the test program although it could; it falls back to the cross-compilation guess instead.

This affects in particular
1) native Windows (mingw or MSVC) compilation in a Cygwin environment,
2) cross-compilation to Linux with a different architecture, on Linux.

Details about the environments:
1) See https://git.savannah.gnu.org/gitweb/?p=gettext.git;a=blob;f=INSTALL.windows
2) For example, cross-compilation to Linux/m68k from Linux/x86_64 (Ubuntu 16.04). See https://git.savannah.gnu.org/gitweb/?p=libffcall.git;a=blob;f=porting-tools/emulation/qemu-m68k.txt . The configure command I use is:

configure --prefix=/inst-m68k --host=m68k-linux CPPFLAGS="-I/inst-m68k/include -Wall" LDFLAGS="-L/inst-m68k/lib"


The behaviour of AC_RUN_IFELSE is specified in the Autoconf documentation:
"If cross-compilation mode is enabled (this is the case if either the compiler being used does not produce executables that run on the system where @command{configure} is being run, or if the options @code{--build} and @code{--host} were both specified and their values are different), then the test program is not run."
This documentation has not changed since 2.69, and it makes perfect sense: it generally allows to determine actual program behaviour, and it has a way to disable it (in cases where that's needed).

In my case, the generated executables DO run in the environment, and I did NOT specify a --build option. Therefore AC_RUN_IFELSE should execute the test program.

Instead, what I see when configuring a gnulib testdir, generated with
+verbose+
  ./gnulib-tool --create-testdir --dir=../testdir-posixb --with-c++-tests --single-configure `./posix-modules`
-verbose-
through
+verbose+
  ./configure --prefix=/inst-m68k --host=m68k-linux CPPFLAGS="-I/inst-m68k/include -Wall" LDFLAGS="-L/inst-m68k/lib" -C 2>&1 | tee log1
-verbose-
for Linux/m68k is that all AC_RUN_IFELSE invocation used the cross-compilation branch, not the test program:

+verbose+
$ diff testdir-posix/build-m68k/config.cache testdir-posixb/build-m68k/config.cache |head
16a17

> ac_cv_c_decl_report=${ac_cv_c_decl_report=error}

65c66
< ac_cv_func_chown_works=${ac_cv_func_chown_works=yes}
---

> ac_cv_func_chown_works=${ac_cv_func_chown_works='guessing yes'}

107c108
< ac_cv_func_getgroups_works=${ac_cv_func_getgroups_works=yes}
---

> ac_cv_func_getgroups_works=${ac_cv_func_getgroups_works='guessing yes'}

...
-verbose-
See attached file config.cache.diff.

Bruno Haible <haible>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

Attached Files
file #49488:  config.cache.diff added by haible (31KiB - text/x-patch)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by eggert (Posted a comment)
  • -email is unavailable- added by haible (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2020-07-15 eggert StatusNone Done
        Open/ClosedOpen Closed
    2020-07-15 haible Attached File- Added config.cache.diff, #49488

    Back to the top

    Powered by Savane 3.13-02a9.
    Corresponding source code