From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail3-relais-sop.national.inria.fr (mail3-relais-sop.national.inria.fr [192.134.164.104]) by yquem.inria.fr (Postfix) with ESMTP id A3B3BBBAF for ; Wed, 25 Aug 2010 04:57:59 +0200 (CEST) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AooCAFojdExKfVIuimdsb2JhbACTI40OCBUBAQEKCQwHDwUfowabBoU3BIl3 X-IronPort-AV: E=Sophos;i="4.56,266,1280700000"; d="scan'208";a="55987256" Received: from mail-ww0-f46.google.com ([74.125.82.46]) by mail3-smtp-sop.national.inria.fr with ESMTP; 25 Aug 2010 04:57:59 +0200 Received: by wwe15 with SMTP id 15so245211wwe.3 for ; Tue, 24 Aug 2010 19:57:58 -0700 (PDT) MIME-Version: 1.0 Received: by 10.216.13.17 with SMTP id a17mr260135wea.46.1282705078724; Tue, 24 Aug 2010 19:57:58 -0700 (PDT) Received: by 10.216.154.17 with HTTP; Tue, 24 Aug 2010 19:57:58 -0700 (PDT) X-Originating-IP: [203.143.161.115] Date: Wed, 25 Aug 2010 12:57:58 +1000 Message-ID: Subject: Dynlink native library for ocaml-mingw32 From: Paul Steckler To: caml-list@yquem.inria.fr Content-Type: text/plain; charset=ISO-8859-1 X-Spam: no; 0.00; dynlink:01 steckler:01 steck:01 mingw:01 native-code:01 threading:01 dynlink:01 segfaults:01 cmxa:01 -wl:01 mingw:01 makefile:01 -wl:01 cmxa:01 hacked:01 I have a Fedora 11 instance where I've installed mingw32-ocaml-3.11.0-0.16.beta1.fc11.noarch to create Windows executables. I've mentioned issues with the native-code threading libraries in that distribution before on this list. Recently, I added calls into the dynlink library in my code (see my recent posts about dynlink-induced/revealed segfaults -- I'll discuss progress in resolving these in a future post). When compiling with ocaml-mingw32, I first had to change the dynlink/META file to look for dynlink.cmxa to link against native code. The link failed, though, because options -Wl and -E were being passed to FlexDLL. I have mingw32-flexdll-0.11-9.fc11.i386 installed. The file Makefile.config, found in the ocaml-mingw32 library directory, contains the line: NATDYNLINKOPTS=-Wl,-E which options seem to get baked into dynlink.cmxa. I hacked the library file to change those options to spaces, and the link proceeds normally. That works, but my sleep patterns have become disturbed. :-) Is this issue particular to my installation, or should dynlink.cmxa have been built not to invoke these flags? Why does FlexDLL get invoked as the linker, rather than i686-pc-mingw32-ld (which would have accepted those flags)? -- Paul