[plt-scheme] Embedding mzscheme on cygwin - linking problems

From: Ittai Balaban (balaban at cs.nyu.edu)
Date: Thu Nov 10 13:52:22 EST 2005

On Thu, 2005-11-10 at 10:00 -0700, Matthew Flatt wrote:
> I always have trouble remembering how Cygwin tools work...

Thanks for investigating :)

> After investigating, the answer seems to be: specify the ".dll" files
> in the command line above, not the ".lib"s. That worked for me with
> v299 and MSVC-built DLLs, at least.

OK, the unix-style build puts *.dll.a files in plt/lib (and 2 dlls in
plt/bin). So ld seems to treat dll.a files like Unix *.so files, and all
links fine. So.. making sure plt/bin is in my PATH, I run my app (which
contains the single statement 
  Scheme_Env *env = scheme_basic_env(); )
and it crashes with a "Floating point exception (core dumped)".
The only core-like object generated is a stackdump file (not recognized
by gdb), showing an integer divide by 0 error.

> The story was different for v209, where using gcc produced a
> Windows-style build --- but there were lots of problems with that
> arrangement.

OK, I won't even try to go there. It seemed worth a try, being the
stable version and all. I get the same floating point exception with
209, BTW.

To get away from shared library hell, I've managed to do without them --
simply configure the mzscheme build with --disable-static, and you get,
as expected, two *.a libraries in plt/lib. Is having libmzscheme/libmzgc
as shared -- rather than static -- libraries especially crucial here (as
Inside MzScheme suggests)?

Thanks for all your help.
Next on the todo list -- FFI with cygwin..
-------------- next part --------------
Exception: STATUS_INTEGER_DIVIDE_BY_ZERO at eip=1009519B
eax=2EAA7821 ebx=00000006 ecx=272856CB edx=00000000 esi=00000006 edi=100DD440
ebp=0022ED08 esp=0022ECD0 program=e:\ittai\verification\nusmv-tests\embed-test.exe, pid 3060, thread main
cs=001B ds=0023 es=0023 fs=003B gs=0000 ss=0023
Stack trace:
Frame     Function  Args
0022ED08  1009519B  (00000006, 00000000, 00000000, 00000000)
0022ED28  10095753  (10342E88, 00000000, 100DD440, 00000006)
0022ED48  100957B7  (100DD440, 00000006, 00000000, 00000000)
0022EE78  100958CE  (100DD440, 00000004, 10357930, 10357B10)
0022EEB8  10035291  (10350F60, 00000004, 10350F60, 00000001)
0022EEE8  10009B6F  (00402000, 00000770, 00000000, 00401075)
0022EF18  0040108B  (00000001, 61157F38, 10280090, 7C919AF0)
0022EFD8  61004DD2  (0022EFF0, 00000000, 00000000, 00000000)
0022FF88  6100594F  (00000000, 00000000, 00000000, 00000000)
End of stack trace
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
URL: <http://lists.racket-lang.org/users/archive/attachments/20051110/4a471b19/attachment.sig>

Posted on the users mailing list.