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

Re: [PATCH v2] Makefile: avoid breaking compilation database generation with DEVELOPER

From
Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Date
Sep 23, 2021, 02:08 UTC
Message-ID
<87czp059g7.fsf@evledraar.gmail.com>
In-Reply-To
<CAPUEspjJdkPgpWvLJKNks+Uu-tZmahw6U3pa+XBkMB6_m_dtRQ@mail.gmail.com>
On Wed, Sep 22 2021, Carlo Arenas wrote:
Show 28 quoted lines
> On Wed, Sep 22, 2021 at 6:41 PM brian m. carlson
> <sandals@crustytoothpaste.net> wrote:
>
>> > diff --git a/Makefile b/Makefile
>> > index 9df565f27b..d5c6d0ea3b 100644
>> > --- a/Makefile
>> > +++ b/Makefile
>> > @@ -1302,7 +1302,7 @@ GENERATE_COMPILATION_DATABASE = no
>> >  endif
>> >
>> >  ifeq ($(GENERATE_COMPILATION_DATABASE),yes)
>> > -compdb_check = $(shell $(CC) $(ALL_CFLAGS) \
>> > +compdb_check = $(shell $(CC) \
>> >       -c -MJ /dev/null \
>> >       -x c /dev/null -o /dev/null 2>&1; \
>> >       echo $$?)
>>
>> Are you sure this results in a functional set of files?
>
> no; it does not
>
> This call is only meant to be used to check if your compiler supports
> the feature (which as Ævar points out[1], might not be the best thing
> to do in this case), though
>
> After this fix the files are being generated (in a different place
> with their expected flags) and look healthy, but would be helpful to
> know you see no regressions.

I had the same thought as brian, but you're right, since we never use the result of this it's OK.

IOW this check is really functionally equivalent to something like:
    cc --help | grep -q -F -- -MJ

Or whatever, i.e. we're just checking if it's clang & supports the -MJ option.

> [1] https://lore.kernel.org/git/87tuic5cdo.fsf@evledraar.gmail.com/
Previous: Carlo ArenasNext: Ævar Arnfjörð Bjarmason
Message 7 of 8 in “Makefile: avoid breaking compilation database generation with DEPELOPER”
  1. Makefile: avoid breaking compilation database generation with DEPELOPERCarlo Marcelo Arenas Belón, Sep 22, 2021
  2. Eric SunshineSep 22, 2021
  3. Makefile: avoid breaking compilation database generation with DEVELOPERCarlo Marcelo Arenas Belón, Sep 22, 2021
  4. Philippe BlainSep 22, 2021
  5. brian m. carlsonSep 23, 2021
  6. Carlo ArenasSep 23, 2021
  7. Ævar Arnfjörð BjarmasonSep 23, 2021
  8. Ævar Arnfjörð BjarmasonSep 23, 2021

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.