This is the mail archive of the
libffi-discuss@sourceware.org
mailing list for the libffi project.
Re: [PATCH,Take 3] Fix make closures.c use dlmmap,dlmunmap on cygwin.
- From: Dave Korn <dave dot korn dot cygwin at googlemail dot com>
- To: Dave Korn <dave dot korn dot cygwin at googlemail dot com>
- Cc: GCC Patches <gcc-patches at gcc dot gnu dot org>, Rainer Emrich <rainer at emrich-ebersheim dot de>, Java Patches <java-patches at gcc dot gnu dot org>, libffi-discuss at sourceware dot org
- Date: Wed, 08 Jul 2009 20:46:03 +0100
- Subject: Re: [PATCH,Take 3] Fix make closures.c use dlmmap,dlmunmap on cygwin.
- References: <4A54EA2A.4030304@gmail.com>
Dave Korn wrote:
> [ refs: http://gcc.gnu.org/ml/gcc-patches/2009-06/threads.html#02228
> http://gcc.gnu.org/ml/gcc-patches/2009-07/threads.html#00352 ]
Interestingly, the problem doesn't reproduce directly on upstream libffi.
There must be something different in the #ifdeffery, because what happens
instead is that dlmalloc doesn't select its own win32 mmap/munmap
replacements, but instead calls dlmmap and dlmunmap directly. These are
apparently defined in a cygwin header file somewhere, but not actually
implemented or exported, so all the tests fail to link with undefined symbol
errors referring to dlmmap/dlmunmap.
With the patch applied, libffi uses its reimplementations of those functions
and relies on the underlying c library support for mmap/munmap, which works.
The test results are quite different, though:
> === libffi Summary ===
>
> # of expected passes 1563
> # of unexpected failures 66
> # of expected failures 10
And I know everything is not quite right because these warnings appear
during the build, which made me look back and notice that they appeared in my
gcc build as well:
/gnu/libffi/libffi/src/closures.c: In function 'dlmmap_locked':
/gnu/libffi/libffi/src/closures.c:405:3: warning: implicit declaration of
function 'mmap'
/gnu/libffi/libffi/src/closures.c:405:7: warning: assignment makes pointer
from integer without a cast
/gnu/libffi/libffi/src/closures.c:421:9: warning: assignment makes pointer
from integer without a cast
/gnu/libffi/libffi/src/closures.c:425:7: warning: implicit declaration of
function 'munmap'
/gnu/libffi/libffi/src/closures.c: In function 'dlmmap':
/gnu/libffi/libffi/src/closures.c:456:11: warning: assignment makes pointer
from integer without a cast
Bah. I think I should withdraw the patch while I try and figure out why
it's not picking up the declarations of those functions, and why the two
behave so differently.
cheers,
DaveK