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 09:04:36PM +0200, Andreas Tobler wrote:
> Jasper Lievisse Adriaanse wrote:
> >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:
>
> ok, might add -lpthread then ?
>
> >
> >$ ./closure_fn0.exe
> >./closure_fn0.exe:./closure_fn0.exe: undefined symbol
> >'ffi_closure_alloc'
>
> This sounds strange, 'nm .libs/libffi.so |grep ffi_closure_alloc' ?
>
> >lazy binding failed!
> >Segmentation fault (core dumped)
>
> Sorry no more idea.
> Andreas
Ok, I just played a bit with it, and using -lpthread and the suggested
patch for configure.ac makes the regression suite work again on openbsd.
This is not a optimal solution (and I'll need to work on the pthread
issue), but at least the regress tests pass again.
cheers,
Jasper
--
"Intelligence should guide our actions, but in harmony with the
texture of the situation at hand"
-- Francisco Varela