Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
From: David Allsopp <dra-news@metastack.com>
To: Paul Steckler <steck@stecksoft.com>,
	"caml-list@yquem.inria.fr" <caml-list@yquem.inria.fr>
Subject: RE: [Caml-list] Dynlink native library for ocaml-mingw32
Date: Wed, 25 Aug 2010 06:50:52 +0000	[thread overview]
Message-ID: <E51C5B015DBD1348A1D85763337FB6D927D526@Remus.metastack.local> (raw)
In-Reply-To: <AANLkTik4imTGq4Wd1aD6G0fNPb3N2-z49A3BhCRchUn9@mail.gmail.com>

Paul Steckler wrote:
> 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

Makefile.config on an actual 3.11 MinGW installation does not contain NATDYNLINKOPTS, so this is incorrect. That's technically also a linker option wrapped in a gcc option...

> 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)?

All linking is done using flexlink for Windows distributions of ocaml - in a highly simplified nutshell, flexlink builds some wrapper files which implement dynamic linking (not to be confused with dynlink - flexlink does this for all Windows executables) and then calls the correct compiler and linker to produce the final program/library. You can either use ocamlopt -verbose to see the flexlink call and then run it manually or use ocamlopt -verbose -ccopt -v to have flexlink display the programs it's invoking. Alain's website (http://alain.frisch.fr/flexdll.html) has more info on how it works...


David

      reply	other threads:[~2010-08-25  6:51 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-25  2:57 Paul Steckler
2010-08-25  6:50 ` David Allsopp [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=E51C5B015DBD1348A1D85763337FB6D927D526@Remus.metastack.local \
    --to=dra-news@metastack.com \
    --cc=caml-list@yquem.inria.fr \
    --cc=steck@stecksoft.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox