delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/1999/11/04/13:59:28

Sender: nate AT delorie DOT com
Message-ID: <3821C6EF.E6BACF9B@hmc.edu>
Date: Thu, 04 Nov 1999 09:48:31 -0800
From: Nate Eldredge <neldredge AT hmc DOT edu>
Organization: Harvey Mudd College
X-Mailer: Mozilla 4.61 [en] (X11; U; Linux 2.2.14pre3 i586)
X-Accept-Language: en
MIME-Version: 1.0
To: djgpp-workers AT delorie DOT com
Subject: Re: -g vs -s
References: <Pine DOT SUN DOT 3 DOT 91 DOT 991103094545 DOT 29562A-100000 AT is>
Reply-To: djgpp-workers AT delorie DOT com

Eli Zaretskii wrote:
> 
> On Wed, 1 Jan 1997, Nate Eldredge wrote:
> 
> > > Most Makefile's I saw put -g into CFLAGS, so linking is done with -g as
> > > well.
> >
> > Except that in my experience, Makefiles don't use CFLAGS when
> > linking, they use LDFLAGS instead.
> 
> Examples, please.
> 
> Most GNU packages (at least their latest releases) use CFLAGS in
> linking.  Automake generates these Makefiles automatically, so any
> package that uses Automake will have that.  Including Cdecl, for
> example ;-).
> 
> I understand that one reason for this is that people are used to say
> "make CFLAGS=-pg" and expect it to DTRT.

Okay, perhaps you are right.  This seems to be a somewhat recent
addition.  I suspect most home-grown Makefiles don't, however, and FWIW
make's implicit rules don't either.

But in any case, I don't think this is worth it.  I've never been a fan
of changing legitimate behavior for the sake of people who won't RTFM,
and this is a fairly well ingrained behavior of GCC-- unless you specify
otherwise, the link stage just puts all the object files together.  For
instance, -g is documented as a compilation option and not a link
option, so our behavior would then not match the GCC manual, leading to
further confusion.  Besides, for anyone who has preconceptions of
executable size (most likely from Borland or similar), 30K for Hello
World will seem just as excessive as 60K, so I don't think it will
forestall that many questions.

Just IMHO. 
-- 

Nate Eldredge
neldredge AT hmc DOT edu

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019