caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Anil Madhavapeddy <anil@recoil.org>
To: rixed@happyleptic.org
Cc: caml-list@inria.fr
Subject: Re: [Caml-list] help with ocaml makefiles
Date: Fri, 19 Nov 2010 15:13:37 +0000	[thread overview]
Message-ID: <625B2C19-90BD-4DE6-9E39-19EC77E9ED46@recoil.org> (raw)
In-Reply-To: <20101118074328.GA17295@yeeloong>

On 18 Nov 2010, at 07:43, rixed@happyleptic.org wrote:

> Each time I need more debug information for the ocaml runtime itself
> (which hopefully is not often) I recompile Ocaml adding various "-g"
> and "-O0" here and there in some makefiles.
> 
> But I've noticed there are some special targets and rules, specifically in
> byterun/Makefile, that seams to be there for that very purpose (the suffix
> rules for .d.c extention). So I suppose there is a standard way to
> compile ocaml in debugging mode.
> 
> Do someone have some knowledge to share about this ?

The C files in byterun/ are compiled with and without debug/profiling, and the following files are created:
- libasmrun.a  (normal)
- libasmrunp.a (profiling)
- libasmrund.a (debug)

Only the normal and profiling ones are installed by default. You can grab the debug version from your ocaml build tree and link against it manually, with something like:

$ ocamlopt -output-obj -i foo.o foo.ml 
$ cc -lasmrund -lm -o foo foo.o

It'd be convenient to have a compiler option to select libasmrund without having to go via -output-obj (as "-p" does for profiling); the code for this is in asmcomp/asmlink.ml:runtime_lib().

Anil

      parent reply	other threads:[~2010-11-19 15:13 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-18  7:43 rixed
2010-11-19 12:14 ` [Caml-list] " Eric Cooper
2010-11-19 15:13 ` Anil Madhavapeddy [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=625B2C19-90BD-4DE6-9E39-19EC77E9ED46@recoil.org \
    --to=anil@recoil.org \
    --cc=caml-list@inria.fr \
    --cc=rixed@happyleptic.org \
    /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;
as well as URLs for NNTP newsgroup(s).