From: Xavier Leroy <Xavier.Leroy@inria.fr>
To: caml-list@yquem.inria.fr
Subject: Re: [Caml-list] cywgin stack overflow
Date: Wed, 13 Jun 2007 18:20:08 +0200	[thread overview]
Message-ID: <46701938.4040804@inria.fr> (raw)
In-Reply-To: <Pine.GSO.4.63.0706131032290.23164@access1.cims.nyu.edu>
> Ouch.  Is there a place I can find information on how stacks are
> implemented in Ocaml without having to wade through source?
> Particularly, I imagine the options to increase stack size of the
> executable compiled with ocamlopt would not be the same as for gcc...
Actually, they are the same.  Let me try to clarify:
For bytecode executables produced by ocamlc or ocamlc.opt
(this includes ocamlc, ocamlopt, etc):
the executables do not not contain any limit on the stack size.  The
bytecode interpreter will resize its stack (allocated with malloc())
as needed, up to a limit that can be set using the 'l' parameter in
the OCAMLRUNPARAM environment variable.
For native-code executables produced by ocamlopt or ocamlopt.opt
(this includes ocamlc.opt, ocamlopt.opt, etc):
these are produced by calling the C compiler with a bunch of .o and .a
files, some generated from Caml via the assembler, others (the
run-time system) being compiled from C.  So, if your C compiler has
flags to set a stack limit in the generated executable, just give
these flags to ocamlopt in a -ccopt option.  (See Matthieu Wipliez's
reply on this list.)
Actually, it might be sufficient to build the Cygwin OCaml package
by configuring with
   ./configure -cc "gcc -Wl,--stack -Wl,10485760"
so that these options will be added automatically, both when building
ocamlrun and when ocamlopt calls gcc to produce native executables.
Hope this helps,
- Xavier Leroy
next prev parent reply	other threads:[~2007-06-13 16:20 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-06-13  7:34 skaller
2007-06-13 11:29 ` [Caml-list] " Igor Peshansky
2007-06-13 12:05   ` skaller
2007-06-13 12:39 ` skaller
2007-06-13 13:44   ` Igor Peshansky
2007-06-13 14:00     ` skaller
2007-06-13 14:16       ` skaller
2007-06-13 14:45         ` Igor Peshansky
2007-06-13 16:20           ` Xavier Leroy [this message]
2007-06-13 16:27         ` Alain Frisch
2007-06-13 17:08           ` Igor Peshansky
2007-06-13 17:12             ` Alain Frisch
2007-06-14  7:03               ` Olivier Andrieu
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=46701938.4040804@inria.fr \
    --to=xavier.leroy@inria.fr \
    --cc=caml-list@yquem.inria.fr \
    /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