FFI testers wanted

Alistair Cloete acloete@dlemma.org
Tue, 9 Jul 2002 23:12:08 +0200


Hello,

I tried the seond test release (hugs98-ffi-09072002b-src.tar.gz)
on Mac OS X 10.1.5 with the April 2002 Developer Tools.
I found a typo in machdep.c (a wrong parameter name) and
a typo in the aclocal.m4 script (SYMBOL1 was used twice in the Mac test).
Also the test for a leading underscore in aclocal.m4 does not work
(the return value $? gets clobbered by 'test'). I've attached a patch
for these bugs, and after applying this patch I could successfully
build and test Hugs.

Regards,
Alistair Cloete.

> uname -a

Darwin lambda 5.5 Darwin Kernel Version 5.5: Thu May 30 14:51:26 PDT 
2002; root:
xnu/xnu-201.42.3.obj~1/RELEASE_PPC  Power Macintosh powerpc

> cc -v

Reading specs from /usr/libexec/gcc/darwin/ppc/2.95.2/specs
Apple Computer, Inc. version gcc-937.2, based on gcc version 2.95.2 
19991024 (re
lease)

> ./configure --prefix=/tmp/test

...
checking if '-bundle' builds loadable libraries... -bundle
...

> grep DLL ../config.h

#define MKDLL_CMD "gcc -bundle"

> grep UNDERSCORE ../config.h

#define LEADING_UNDERSCORE 1

> cd ..
> make install_ffi

OK

> cd ../tests
> sh testScript ffi

OK


---------------------8<---------------------------------
--- src/machdep.c.orig  Fri Jul  5 07:21:26 2002
+++ src/machdep.c       Tue Jul  9 22:35:30 2002
@@ -1952,7 +1952,7 @@
    return instance;
  }

-static void* local getDLLSymbol(dll,symbol)  /* lookup dll symbol */
+static void* local getDLLSymbol(instance,symbol)  /* lookup dll 
symbol */
  void* instance;
  String symbol; {
    void *sym;
--- src/unix/aclocal.m4.orig    Tue Jul  9 13:08:31 2002
+++ src/unix/aclocal.m4 Tue Jul  9 22:35:19 2002
@@ -543,7 +543,7 @@
      sym = NSLookupSymbolInModule(handle, SYMBOL1);
      if (sym != 0) exit(SYM1_OK);

-    sym = NSLookupSymbolInModule(handle, SYMBOL1);
+    sym = NSLookupSymbolInModule(handle, SYMBOL2);
      if (sym != 0) exit(SYM2_OK);

      exit(CANTFIND);
@@ -585,11 +585,12 @@
  then dnl compiling and linking loader succeeded

    ./conftest 2>/dev/null
-  if test $? = 3; then
+  ac_result=$?
+  if test $ac_result = 3; then
      ac_cv_dll_flags=$1
      ac_cv_leading_underscore=no
    fi
-  if test $? = 4; then
+  if test $ac_result = 4; then
      ac_cv_dll_flags=$1
      ac_cv_leading_underscore=yes
    fi