From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from mail4-relais-sop.national.inria.fr (mail4-relais-sop.national.inria.fr [192.134.164.105]) by yquem.inria.fr (Postfix) with ESMTP id 5ACA8BC57 for ; Fri, 19 Nov 2010 16:13:40 +0100 (CET) X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AvQEAJoi5kxZELGa/2dsb2JhbACUWo5zvUGFSwSKWw X-IronPort-AV: E=Sophos;i="4.59,223,1288566000"; d="scan'208";a="79666556" Received: from recoil.dh.bytemark.co.uk (HELO dark.recoil.org) ([89.16.177.154]) by mail4-smtp-sop.national.inria.fr with SMTP; 19 Nov 2010 16:13:40 +0100 Received: (qmail 23310 invoked by uid 634); 19 Nov 2010 15:13:39 -0000 X-Spam-Level: * X-Spam-Check-By: dark.recoil.org Received: from freak-0.srg.cl.cam.ac.uk (HELO [192.168.2.28]) (128.232.32.220) (smtp-auth username remote@recoil.org, mechanism cram-md5) by dark.recoil.org (qpsmtpd/0.83) with ESMTPA; Fri, 19 Nov 2010 15:13:39 +0000 Subject: Re: [Caml-list] help with ocaml makefiles Mime-Version: 1.0 (Apple Message framework v1082) Content-Type: text/plain; charset=us-ascii From: Anil Madhavapeddy In-Reply-To: <20101118074328.GA17295@yeeloong> Date: Fri, 19 Nov 2010 15:13:37 +0000 Cc: caml-list@inria.fr Content-Transfer-Encoding: quoted-printable Message-Id: <625B2C19-90BD-4DE6-9E39-19EC77E9ED46@recoil.org> References: <20101118074328.GA17295@yeeloong> To: rixed@happyleptic.org X-Mailer: Apple Mail (2.1082) X-Virus-Checked: Checked by ClamAV on dark.recoil.org X-Spam: no; 0.00; ocaml:01 makefiles:01 anil:01 anil:01 ocaml:01 runtime:01 recompile:01 makefiles:01 byterun:01 makefile:01 byterun:01 libasmrun:01 libasmrunp:01 ocamlopt:01 -output-obj:01 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. >=20 > 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. >=20 > 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=20 $ 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=