diff mbox series

[3/3] tools/libs: Fix headers.chk logic

Message ID 20210305124949.6719-4-andrew.cooper3@citrix.com (mailing list archive)
State New
Headers show
Series tools/libs: Multiple fixes to header handling | expand

Commit Message

Andrew Cooper March 5, 2021, 12:49 p.m. UTC
c/s 4664034cd dropped the $(LIBHEADERSGLOB) dependency for the headers.chk
rule, without replacing it.

As headers.chk uses $^, a typical build looks like:

  andrewcoop@andrewcoop:/local/xen.git$ make -C tools/libs/devicemodel/
  make: Entering directory '/local/xen.git/tools/libs/devicemodel'
  for i in ; do \
      gcc -x c -ansi -Wall -Werror
      -I/local/xen.git/tools/libs/devicemodel/../../../tools/include \
            -S -o /dev/null $i || exit 1; \
      echo $i; \
  done >headers.chk.new
  mv headers.chk.new headers.chk

i.e. with an empty for loop, and checking only the $(AUTOINCS).

Reinsert a $(LIBHEADERS) dependency.

Fixes: 4664034cd ("tools/libs: move official headers to common directory")
Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
CC: Juergen Gross <jgross@suse.com>
CC: Roger Pau Monné <roger.pau@citrix.com>
CC: Wei Liu <wl@xen.org>
---
 tools/libs/libs.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Andrew Cooper March 5, 2021, 1:38 p.m. UTC | #1
On 05/03/2021 12:49, Andrew Cooper wrote:
> c/s 4664034cd dropped the $(LIBHEADERSGLOB) dependency for the headers.chk
> rule, without replacing it.
>
> As headers.chk uses $^, a typical build looks like:
>
>   andrewcoop@andrewcoop:/local/xen.git$ make -C tools/libs/devicemodel/
>   make: Entering directory '/local/xen.git/tools/libs/devicemodel'
>   for i in ; do \
>       gcc -x c -ansi -Wall -Werror
>       -I/local/xen.git/tools/libs/devicemodel/../../../tools/include \
>             -S -o /dev/null $i || exit 1; \
>       echo $i; \
>   done >headers.chk.new
>   mv headers.chk.new headers.chk
>
> i.e. with an empty for loop, and checking only the $(AUTOINCS).
>
> Reinsert a $(LIBHEADERS) dependency.
>
> Fixes: 4664034cd ("tools/libs: move official headers to common directory")
> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
> ---
> CC: Juergen Gross <jgross@suse.com>
> CC: Roger Pau Monné <roger.pau@citrix.com>
> CC: Wei Liu <wl@xen.org>

Apologies - I totally messed up the CC list here.

For 4.15.  Regression from 4.14, in some build-time checking logic.

~Andrew

> ---
>  tools/libs/libs.mk | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/tools/libs/libs.mk b/tools/libs/libs.mk
> index a68cec244c..2d973ccb95 100644
> --- a/tools/libs/libs.mk
> +++ b/tools/libs/libs.mk
> @@ -76,7 +76,7 @@ else
>  .PHONY: headers.chk
>  endif
>  
> -headers.chk: $(AUTOINCS)
> +headers.chk: $(LIBHEADERS) $(AUTOINCS)
>  
>  headers.lst: FORCE
>  	@{ set -e; $(foreach h,$(LIBHEADERS),echo $(h);) } > $@.tmp
Ian Jackson March 5, 2021, 1:43 p.m. UTC | #2
Andrew Cooper writes ("Re: [PATCH 3/3] tools/libs: Fix headers.chk logic"):
> On 05/03/2021 12:49, Andrew Cooper wrote:
> > c/s 4664034cd dropped the $(LIBHEADERSGLOB) dependency for the headers.chk
> > rule, without replacing it.
> >
> > As headers.chk uses $^, a typical build looks like:
> >
> >   andrewcoop@andrewcoop:/local/xen.git$ make -C tools/libs/devicemodel/
> >   make: Entering directory '/local/xen.git/tools/libs/devicemodel'
> >   for i in ; do \
> >       gcc -x c -ansi -Wall -Werror
> >       -I/local/xen.git/tools/libs/devicemodel/../../../tools/include \
> >             -S -o /dev/null $i || exit 1; \
> >       echo $i; \
> >   done >headers.chk.new
> >   mv headers.chk.new headers.chk
> >
> > i.e. with an empty for loop, and checking only the $(AUTOINCS).
> >
> > Reinsert a $(LIBHEADERS) dependency.

Release-Acked-by: Ian Jackson <iwj@xenproject.org>
Juergen Gross March 11, 2021, 1:38 p.m. UTC | #3
On 05.03.21 13:49, Andrew Cooper wrote:
> c/s 4664034cd dropped the $(LIBHEADERSGLOB) dependency for the headers.chk
> rule, without replacing it.
> 
> As headers.chk uses $^, a typical build looks like:
> 
>    andrewcoop@andrewcoop:/local/xen.git$ make -C tools/libs/devicemodel/
>    make: Entering directory '/local/xen.git/tools/libs/devicemodel'
>    for i in ; do \
>        gcc -x c -ansi -Wall -Werror
>        -I/local/xen.git/tools/libs/devicemodel/../../../tools/include \
>              -S -o /dev/null $i || exit 1; \
>        echo $i; \
>    done >headers.chk.new
>    mv headers.chk.new headers.chk
> 
> i.e. with an empty for loop, and checking only the $(AUTOINCS).
> 
> Reinsert a $(LIBHEADERS) dependency.
> 
> Fixes: 4664034cd ("tools/libs: move official headers to common directory")
> Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>

Reviewed-by: Juergen Gross <jgross@suse.com>


Juergen
diff mbox series

Patch

diff --git a/tools/libs/libs.mk b/tools/libs/libs.mk
index a68cec244c..2d973ccb95 100644
--- a/tools/libs/libs.mk
+++ b/tools/libs/libs.mk
@@ -76,7 +76,7 @@  else
 .PHONY: headers.chk
 endif
 
-headers.chk: $(AUTOINCS)
+headers.chk: $(LIBHEADERS) $(AUTOINCS)
 
 headers.lst: FORCE
 	@{ set -e; $(foreach h,$(LIBHEADERS),echo $(h);) } > $@.tmp