git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] Makefile: do not compile git with debugging symbols by default

From
David Aguilar <davvid@gmail.com>
Date
Jan 27, 2015, 08:43 UTC
Message-ID
<20150127084338.GA37443@gmail.com>
In-Reply-To
<20150122225517.GB31912@glandium.org>
On Fri, Jan 23, 2015 at 07:55:17AM +0900, Mike Hommey wrote:
Show 15 quoted lines
> On Thu, Jan 22, 2015 at 01:35:38PM -0500, Jeff King wrote:
> > On Thu, Jan 22, 2015 at 06:36:41PM +0100, Matthieu Moy wrote:
> > 
> > > > Yes, main point is size of executable.
> > > 
> > > The Git executable is a few megabytes, i.e. 0.001% the size of a really
> > > small hard disk. The benefit seems really negligible to me.
> > 
> > I don't know the layout of the symbols with respect to the code, or
> > whether the stripped version might reduce memory pressure. So in theory
> > it could have a performance impact.
> 
> It doesn't. Debugging info is in a part of the file that is not mapped
> in memory, and in a part that can be removed without affecting the rest
> of the file, so it's more or less at the end.

It goes even further. These days Fedora systems strip debug info out into separate files and packages while creating rpms debuginfo packages are created automatically and provide debuginfo files under /usr/lib/debug, where gdb knows to look by default.

Alexander, one nice thing about the Makefile is that it supports you creating a file in your Git worktree called "config.mak" with the following content:

CFLAGS = -O2 -Wall

If you do that then git will build without debug info and you won't have to specify CFLAGS when invoking "make". Hopefully that's easy and convenient enough.

cheers,
-- 
David
Previous: Mike Hommey
Message 9 of 9 in “Makefile: do not compile git with debugging symbols by default”
  1. Makefile: do not compile git with debugging symbols by defaultAlexander Kuleshov, Jan 22, 2015
  2. Jeff KingJan 22, 2015
  3. Mike HommeyJan 22, 2015
  4. Alexander KuleshovJan 22, 2015
  5. Alexander KuleshovJan 22, 2015
  6. Matthieu MoyJan 22, 2015
  7. Jeff KingJan 22, 2015
  8. Mike HommeyJan 22, 2015
  9. David AguilarJan 27, 2015

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.