From: Jacques Garrigue <garrigue@math.nagoya-u.ac.jp>
To: jonathan.roewen@gmail.com
Cc: caml-list@yquem.inria.fr
Subject: Re: [Caml-list] Creating nativecode apps
Date: Sat, 23 Jul 2005 21:36:44 +0900 (JST) [thread overview]
Message-ID: <20050723.213644.28464392.garrigue@math.nagoya-u.ac.jp> (raw)
In-Reply-To: <ad8cfe7e0507222238692e2a48@mail.gmail.com>
From: Jonathan Roewen <jonathan.roewen@gmail.com>
> Let me rephrase. What do the ocaml compilers need a C compiler for?
> And, if I use -output-obj, is the object file created solely by the
> ocaml compilers, or does this depend on a C compiler?
You must distinguish the bytecode and native code cases.
As far as I can follow the code in bytecomp/bytelink.ml and
asmcomp/asmlink.ml, in the first case a C compiler is needed, as
ocamlc generates some glue code written in C. This is not surprising,
as ocamlc knows nothing about native objects, so all interaction
requires some glue compiled with a C compiler, this is also true for
-custom. On the other hand, ocamlopt can generate assembler code, so
it doesn't really require a C compiler. However it requires working
assembler and linker. In some cases it may even choose to use gcc as
front end to either of them, while not feeding it C code.
The problem is of course that generally, if you've got a linker and
an assembler, you've also got a C compiler. The only exception that
comes to mind is commercial Unixes like Solaris, if you really don't
want to install gcc. So I'm afraid that the answer is rather that
ocamlopt depends on a working compiling environment, even if this
might not include a C compiler.
The only case nothing is required from the environment is when using
ocamlc with shared libraries (i.e. without -custom). This was an
important reason to support them.
Jacques Garrigue
prev parent reply other threads:[~2005-07-23 12:36 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-07-22 4:49 Jonathan Roewen
2005-07-22 11:22 ` Damien Bobillot
2005-07-23 5:38 ` Jonathan Roewen
[not found] ` <1122104179.42e1f37350e2a@www.crans.org>
2005-07-23 7:46 ` Stephane.Glondu
2005-07-23 12:36 ` Jacques Garrigue [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=20050723.213644.28464392.garrigue@math.nagoya-u.ac.jp \
--to=garrigue@math.nagoya-u.ac.jp \
--cc=caml-list@yquem.inria.fr \
--cc=jonathan.roewen@gmail.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