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
Alexander Kuleshov <kuleshovmail@gmail.com>
Date
Jan 22, 2015, 16:53 UTC
Message-ID
<CANCZXo6qnfjaYLh8WN8xSocGQcoaX4UTjzFm1FhF6sg8vhng5A@mail.gmail.com>
In-Reply-To
<CANCZXo7ocgG27Y48NjYxurVMWOvHkvGqDrLuntkSTxHUK6hcNw@mail.gmail.com>

Or even still -g as it now, because anyway debugging info will be removed with stripping

2015-01-22 22:51 GMT+06:00 Alexander Kuleshov <kuleshovmail@gmail.com>:
Show 58 quoted lines
> Hello Jeff,
>
> Yes, main point is size of executable. I'm sorry, didn't see 'strip' target.
>
> What if we will strip git and other executable files by default and
> add -g option and don't strip it if DEBUG=1 passed to make. Something
> like this:
>
> git$X: git.o GIT-LDFLAGS $(BUILTIN_OBJS) $(GITLIBS)
>
>     $(QUIET_LINK)$(CC) $(ALL_CFLAGS) -o $@ $(ALL_LDFLAGS) git.o \
>
>         $(BUILTIN_OBJS) $(LIBS)
>
> ifneq ($(DEBUG),1)
>
>     $(MAKE) strip
>
> endif
>
>
> Thank you.
>
> 2015-01-22 19:00 GMT+06:00 Jeff King <peff@peff.net>:
>> On Thu, Jan 22, 2015 at 06:50:37PM +0600, Alexander Kuleshov wrote:
>>
>>> Standard user has no need in debugging information. This patch adds
>>> DEBUG=1 option to compile git with debugging symbols and compile without
>>> it by default.
>>
>> This explanation is missing why it is beneficial _not_ to have the
>> debugging information.
>>
>> I expect the answer is "it makes the executable smaller". And that is
>> true, but it gets smaller still if you run "strip" on the result:
>>
>>   $ make CFLAGS= >/dev/null 2>&1 && wc -c <git
>>   2424248
>>
>>   $ make CFLAGS=-g >/dev/null 2>&1 && wc -c <git
>>   4500816
>>
>>   $ strip git && wc -c <git
>>   2109200
>>
>> So I am not sure who this is helping. If you are size-conscious, you
>> should use strip, in which case the "-g" flag does not matter (and we
>> even have "make strip" to help you).
>>
>> Is there some other reason to avoid the debugging information?
>>
>> -Peff
>
>
>
> --
> _________________________
> 0xAX
-- 
_________________________
0xAX
Previous: Alexander KuleshovNext: Matthieu Moy
Message 5 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.