[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: AC_FUNC_MALLOC, AC_FUNC_REALLOC and crossbuilding with mingw
From: |
Keith Marshall |
Subject: |
Re: AC_FUNC_MALLOC, AC_FUNC_REALLOC and crossbuilding with mingw |
Date: |
Sat, 29 Dec 2007 21:46:48 +0000 |
Hi David,
On Sat, 2007-12-29 at 15:38 -0500, David Bruce wrote:
> I cross-build my native linux program for Windows using mingw. I recently
> ran
> autoscan to see if my configure.ac was lacking anything that ought to be in
> there, and the recommendations included adding AC_FUNC_MALLOC and
> AC_FUNC_REALLOC. These macros cause the cross-build to fail with errors
> about "undefined reference to _rpl_malloc", etc.
Yes, I've noticed this too.
> The autoconf manual says
> that the macros are supposed to enforce compatibility with GNU's malloc in
> that 'malloc(0)' should return a valid pointer, and suggests a sort of
> wrapper to accomplish this.
>
> My question is whether I can safely comment out AC_FUNC_MALLOC and
> AC_FUNC_REALLOC, because the program seems to build and run fine on both
> platforms without these checks.
Well, MinGW just uses Microsnot's malloc() and realloc(), from
MSVCRT.dll. AFAIK, these functions are compliant with the expectations
of AC_FUNC_MALLOC and AC_FUNC_REALLOC; certainly, when building natively
on Woe32, using MSYS, both these macros report that their associated
functions are acceptable. The problem is, when cross-compiling, the
test code cannot be executed, to verify compliance.
I think you can safely disdense with these two tests, when
cross-compiling for a Woe32 host.
Regards,
Keith.