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

Re: [PATCH v2 4/4] Makefile: precompile "git-compat-util.h"

From
Jeff King <peff@peff.net>
Date
Sep 24, 2026, 23:52 UTC
Message-ID
<20260924235216.GA837070@coredump.intra.peff.net>
In-Reply-To
<20260915060952.569535-5-szeder.dev@gmail.com>
On Tue, Sep 15, 2026 at 08:09:52AM +0200, SZEDER Gábor wrote:
Show 5 quoted lines
> This patch follows the idea of 671df48df8 (meson: precompile
> "git-compat-util.h", 2026-03-19) to make it faster to build Git using
> "make".  The notable differences are the boilerplate needed to wire up
> the precompiled header with "make", and the selection of object files
> that are built using the precompiled header:
I got an interesting error message from this today:
  $ make imap-send.o
      * new build flags
      CC tools/precompiled.h.gch
      CC imap-send.o
  cc1: warning: ./tools/precompiled.h.gch: not used because ‘NO_OPENSSL’ is defined [-Winvalid-pch]
You won't see it with:
  make NO_OPENSSL=1 imap-send.o
The culprit is that I have this in my config.mak:
  imap-send.o: EXTRA_CPPFLAGS += -DNO_OPENSSL

so the build options for the precompiled header and imap-send.c are not the same. So now of course you are asking why I would have such a weird line in my config.mak.

The answer is that I want to disable openssl for old builds, because I am often building historical versions which use openssl constructs that are deprecated or removed. So naturally you are now asking why it does not just say:

  NO_OPENSSL = BrokenOnOldVersions

or similar. But that breaks _some_ old versions which really do need openssl for various things.

The good-ish news is that it's mostly cosmetic for me. I also loosen -Werror for old builds, for obvious reasons. So it's not breaking any build.

I don't know if my use case is too crazy to care about, but I thought I'd mention it in case there are other less-crazy related cases we might run into.

And yes, obviously old versions will not have the precompiled header, either, but my logic for "loosen compilation" is mostly "we are not on a branch nor rebasing", so a sight-seeing trip to "git checkout origin/seen" puts me in the same mode. And eventually it _will_ be old, too. ;)

-Peff
Previous: SZEDER GáborNext: SZEDER Gábor
Message 13 of 15 in “make: precompile "git-compat-util.h"”
  1. 0/4 make: precompile "git-compat-util.h"SZEDER Gábor, Sep 9, 2026
  2. 1/4 Makefile: remove XDIFF_OBJS initializationSZEDER Gábor, Sep 9, 2026
  3. 2/4 cmake: remove any "$(*_OBJS)" variables when parsing Makefile for sourcesSZEDER Gábor, Sep 9, 2026
  4. 3/4 Makefile: reintroduce REFTABLE_OBJSSZEDER Gábor, Sep 9, 2026
  5. Junio C HamanoSep 9, 2026
  6. 4/4 Makefile: precompile "git-compat-util.h"SZEDER Gábor, Sep 9, 2026
  7. SZEDER GáborSep 9, 2026
  8. 0/4 make: precompile "git-compat-util.h"SZEDER Gábor, Sep 15, 2026
  9. 1/4 Makefile: remove XDIFF_OBJS initializationSZEDER Gábor, Sep 15, 2026
  10. 2/4 cmake: remove any "$(*_OBJS)" variables when parsing Makefile for sourcesSZEDER Gábor, Sep 15, 2026
  11. 3/4 Makefile: reintroduce REFTABLE_OBJSSZEDER Gábor, Sep 15, 2026
  12. 4/4 Makefile: precompile "git-compat-util.h"SZEDER Gábor, Sep 15, 2026
  13. Jeff KingSep 24, 2026
  14. SZEDER GáborSep 25, 2026
  15. SZEDER GáborOct 3, 2026

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.