[prev in list] [next in list] [prev in thread] [next in thread] 

List:       squeak-vm-dev
Subject:    Re: [Vm-dev] How to compile a debugging VM?
From:       Gavin Romig-Koch <gavin () redhat ! com>
Date:       2009-03-24 20:40:34
Message-ID: 49C94542.9000208 () redhat ! com
[Download RAW message or body]

[Attachment #3 (multipart/alternative)]


Michael van der Gulik wrote:
>  
> On Linux, how do you tell the build scripts to make GCC compile with
> the -g flag rather than -O2 (i.e. don't optimise and leave debugging
> symbols in the VM)?
>   

There is a (not always followed) convention for writing Makefiles where 
the Make variable CFLAGS is only used for debugging flags, optimization 
flags, and warning flags, and specifically _not_ used for include flags, 
define flags, or any flags that are required for correct compilation.   
If this convention is followed then one can do:

    $ make CFLAGS=-g whatever

That is, CFLAGS is set on the Make command line.  Setting CFLAGS on the 
command line causes that value to override the value set in the 
Makefile, if any, and Make passes this value on to the C compiler.   
Unfortunately, the SqueakVM makefiles don't follow this convention in at 
least a few cases.   For example, in npsqueak/Makefile, several -I's are 
included in  CFLAGS, and when one does:

    $ cd platforms/unix
    $ make CFLAGS=-g

the compile of npsqueak.c fails because it can't find several include 
files.  If instead the -I's and -fPIC were moved to the actual compile 
of npsqueak.c and npunix.c, then the convention works.

If you decide to do some Makefile editing, consider changing the 
Makefiles to follow this convention, and submit a patch. 

                                                                               
-gavin...

[Attachment #6 (text/html)]

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
<br>
Michael van der Gulik wrote:
<blockquote
 cite="mid:1b61adf40903240130k1620931cpc6b4ce5e41ccec25@mail.gmail.com"
 type="cite">
  <pre wrap=""> 
On Linux, how do you tell the build scripts to make GCC compile with
the -g flag rather than -O2 (i.e. don't optimise and leave debugging
symbols in the VM)?
  </pre>
</blockquote>
<br>
There is a (not always followed) convention for writing Makefiles where
the Make variable CFLAGS is only used for debugging flags, optimization
flags, and warning flags, and specifically _not_ used for include
flags, define flags, or any flags that are required for correct
compilation.&nbsp;&nbsp; If this convention is followed then one can do:<br>
<blockquote>$ make CFLAGS=-g whatever<br>
</blockquote>
That is, CFLAGS is set on the Make command line.&nbsp; Setting CFLAGS on the
command line causes that value to override the value set in the
Makefile, if any, and Make passes this value on to the C compiler. &nbsp;
Unfortunately, the SqueakVM makefiles don't follow this convention in
at least a few cases.&nbsp;&nbsp; For example, in npsqueak/Makefile, several -I's
are included in&nbsp; CFLAGS, and when one does:<br>
<blockquote>$ cd platforms/unix<br>
$ make CFLAGS=-g<br>
</blockquote>
the compile of npsqueak.c fails because it can't find several include
files.&nbsp; If instead the -I's and -fPIC were moved to the actual compile
of npsqueak.c and npunix.c, then the convention works.<br>
<br>
If you decide to do some Makefile editing, consider changing the
Makefiles to follow this convention, and submit a patch.&nbsp; <br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n \
bsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbs \
p;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; \
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&n \
bsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                
-gavin...<br>
</body>
</html>



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic