This is the mail archive of the
libffi-discuss@sourceware.org
mailing list for the libffi project.
Re: Closure test failures
On Tue, Oct 06, 2009 at 08:12:00PM +0200, Andreas Tobler wrote:
> Timothy Wall wrote:
> >One reason closure tests may be failing is that
> >FFI_MMAP_EXEC_WRIT, which enables mmap-ing of the closure
> >trampoline in closure.c, is only auto-enabled for gnu_linux and
> >win32.
> >
> >FFI_MMAP_EXEC_WRIT should probably be set based on HAVE_MMAP (or
> >whatever the tests used to use) instead of checking the system
> >type.
> >
> >
>
> This minimalistic approach brings the amd64-unknown-freebsd9
> testcases to a success.
>
> I do not know about openbsd.
>
> Anyway, this patchlet would need an autoconf _and_ an autoheader run
> (FFI_MMAP_EXEC_WRIT is not yet populated in fficonfig.h.in).
>
> Andreas
this currently results in a lot of:
/usr/obj/ports/libffi-3.0.9rc1/libffi-3.0.9rc1/testsuite/../.libs/libffi.so.0.0:
undefined reference to `pthread_mutex_unlock'
/usr/obj/ports/libffi-3.0.9rc1/libffi-3.0.9rc1/testsuite/../.libs/libffi.so.0.0:
undefined reference to `pthread_mutex_lock'
/usr/obj/ports/libffi-3.0.9rc1/libffi-3.0.9rc1/testsuite/../.libs/libffi.so.0.0:
undefined reference to `pthread_mutex_init'
and no test can compile.
manually compiling with added -pthread makes compilation work, but it
crashes at runtime:
$ ./closure_fn0.exe
./closure_fn0.exe:./closure_fn0.exe: undefined symbol 'ffi_closure_alloc'
lazy binding failed!
Segmentation fault (core dumped)
$
> --- configure.ac.orig 2009-10-06 20:01:19.000000000 +0200
> +++ configure.ac 2009-10-06 20:03:04.000000000 +0200
> @@ -274,7 +274,7 @@
> fi
>
> case "$target" in
> - i?86-apple-darwin10*)
> + i?86-apple-darwin10* | *-*-freebsd* | *-*-openbsd*)
> AC_DEFINE(FFI_MMAP_EXEC_WRIT, 1,
> [Cannot use malloc on this target, so, we revert to
> alternative means])
--
"Intelligence should guide our actions, but in harmony with the
texture of the situation at hand"
-- Francisco Varela