Thread (8 messages) flat view 8 messages, 5 authors, 2021-09-23

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

From: Ævar Arnfjörð Bjarmason <hidden>
Date: 2021-09-23 02:09:49

On Wed, Sep 22 2021, Carlo Arenas wrote:
On Wed, Sep 22, 2021 at 6:41 PM brian m. carlson
[off-list ref] wrote:
quoted
quoted
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/ (local)
  
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help