Subject: Re: bug#69770: [PATCH] build: strengthen 16 bit float support checks

From: Pádraig Brady <[email-masked]>
Date: Thu, 14 Mar 2024 14:48:49 +0000

On 14/03/2024 13:35, Collin Funk wrote:
> On 3/14/24 6:03 AM, Pádraig Brady wrote:
>> It would disable this feature for cross-compilation yes,
>> but this isn't the first instance of AC_RUN_IFELSE we use.

For completeness I should add that the above check can be
overridden if cross-compiling or whatever like:

   ./configure utils_cv_ieee_16_bit_supported=yes utils_cv_brain_16_bit_supported=yes

> Sorry if this is not the proper place to ask, but would it be possible
> to make Autoconf use an emulator when cross-compiling? This issue
> would be *less* of a problem in that case.
> 
> I am more familiar with CMake where check_c_source_runs is used
> performs a similar task [1]. It is essentially a wrapper function
> around try_run [2]. CMake allows you to set
> CMAKE_CROSSCOMPILING_EMULATOR which will make try_run use an emulator
> to run programs instead [3].
> 
> I've used this with Wine and QEMU User a few times and it makes
> CMake's configure tests work fine (though much slower). If this
> functionality seems beneficial then I can look into adding it to
> Autoconf.
> 
> [1] https://cmake.org/cmake/help/latest/module/CheckCSourceRuns.html
> [2] https://github.com/Kitware/CMake/blob/4285dec5f012260337193f29f18899d6cf2536a4/Modules/Internal/CheckSourceRuns.cmake#L93
> [3] https://cmake.org/cmake/help/latest/variable/CMAKE_CROSSCOMPILING_EMULATOR.html

Interesting.
Perhaps this is something that could be configured separately
on the build system, through something like binfmt_misc ?

cheers,
Pádraig