在 2018-09-25 20:48, Martin Storsjö 写道:
> These break cross compilation; removing them fixes cross compilation.
> 
> These not only check for the functions malloc/realloc (which are
> guaranteed to be available as long as the build environment is ANSI C
> compliant), but check for a "GNU libc compatible malloc".
> 
> The check for such a malloc is a runtime check, so when cross compiling,
> the check just fails.
> 
> When the check for malloc has failed, all malloc calls are redirected
> to rpl_malloc instead, which the project is supposed to provide as
> a replacement for malloc, with the right features, but no such
> fallback function exists.
> 
> Just remove these checks, and assume the ANSI C malloc/realloc exists.
> 
> Signed-off-by: Martin Storsjö <mar...@martin.st>
> ---
>   mingw-w64-tools/widl/configure.ac | 2 --
>   1 file changed, 2 deletions(-)
> 
> diff --git a/mingw-w64-tools/widl/configure.ac 
> b/mingw-w64-tools/widl/configure.ac
> index a7ac2a0..91fe3d9 100644
> --- a/mingw-w64-tools/widl/configure.ac
> +++ b/mingw-w64-tools/widl/configure.ac
> @@ -47,8 +47,6 @@ AC_CHECK_TYPES([long long])
>   
>   # Checks for library functions.
>   AC_FUNC_ERROR_AT_LINE
> -AC_FUNC_MALLOC
> -AC_FUNC_REALLOC
>   AC_FUNC_STRTOD
>   AC_CHECK_FUNCS([atexit gettimeofday getopt_long_only memmove memset 
> mkstemps strcasecmp strchr strdup strerror strncasecmp strrchr strtol strtoul 
> strtoull])
>   
> 

This patch looks good to me. Verified on Linux Mint 19.

BTW, why is `AC_FUNC_STRTOD` still there? Could it be removed as well?


-- 
Best regards,
LH_Mouse

_______________________________________________
Mingw-w64-public mailing list
Mingw-w64-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to