public inbox for passt-dev@passt.top
 help / color / mirror / code / Atom feed
* [PATCH] Makefile: Include seccomp.h in HEADERS and require it for static checkers
@ 2022-09-14 13:59 Stefano Brivio
  2022-09-14 15:07 ` David Gibson
  0 siblings, 1 reply; 2+ messages in thread
From: Stefano Brivio @ 2022-09-14 13:59 UTC (permalink / raw)
  To: passt-dev

[-- Attachment #1: Type: text/plain, Size: 1333 bytes --]

Targets running static checkers (cppcheck and clang-tidy) need
seccomp.h, but the latter is not included in HEADERS. Add it.

Signed-off-by: Stefano Brivio <sbrivio(a)redhat.com>
---
 Makefile | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/Makefile b/Makefile
index 6805c23..c47a5f6 100644
--- a/Makefile
+++ b/Makefile
@@ -42,7 +42,7 @@ MANPAGES = passt.1 pasta.1 qrap.1
 PASST_HEADERS = arch.h arp.h checksum.h conf.h dhcp.h dhcpv6.h icmp.h \
 	isolation.h lineread.h ndp.h netlink.h packet.h passt.h pasta.h \
 	pcap.h siphash.h tap.h tcp.h tcp_splice.h udp.h util.h
-HEADERS = $(PASST_HEADERS)
+HEADERS = $(PASST_HEADERS) seccomp.h
 
 # On gcc 11.2, with -O2 and -flto, tcp_hash() and siphash_20b(), if inlined,
 # seem to be hitting something similar to:
@@ -104,11 +104,11 @@ static: clean all
 seccomp.h: $(PASST_SRCS) $(PASST_HEADERS)
 	@ EXTRA_SYSCALLS=$(EXTRA_SYSCALLS) ./seccomp.sh $^
 
-passt: $(PASST_SRCS) $(PASST_HEADERS) seccomp.h
+passt: $(PASST_SRCS) $(HEADERS)
 	$(CC) $(FLAGS) $(CFLAGS) $(PASST_SRCS) -o passt $(LDFLAGS)
 
 passt.avx2: FLAGS += -Ofast -mavx2 -ftree-vectorize -funroll-loops
-passt.avx2: $(PASST_SRCS) $(PASST_HEADERS) seccomp.h
+passt.avx2: $(PASST_SRCS) $(HEADERS)
 	$(CC) $(filter-out -O2,$(FLAGS) $(CFLAGS)) \
 		$(PASST_SRCS) -o passt.avx2 $(LDFLAGS)
 
-- 
@@ -42,7 +42,7 @@ MANPAGES = passt.1 pasta.1 qrap.1
 PASST_HEADERS = arch.h arp.h checksum.h conf.h dhcp.h dhcpv6.h icmp.h \
 	isolation.h lineread.h ndp.h netlink.h packet.h passt.h pasta.h \
 	pcap.h siphash.h tap.h tcp.h tcp_splice.h udp.h util.h
-HEADERS = $(PASST_HEADERS)
+HEADERS = $(PASST_HEADERS) seccomp.h
 
 # On gcc 11.2, with -O2 and -flto, tcp_hash() and siphash_20b(), if inlined,
 # seem to be hitting something similar to:
@@ -104,11 +104,11 @@ static: clean all
 seccomp.h: $(PASST_SRCS) $(PASST_HEADERS)
 	@ EXTRA_SYSCALLS=$(EXTRA_SYSCALLS) ./seccomp.sh $^
 
-passt: $(PASST_SRCS) $(PASST_HEADERS) seccomp.h
+passt: $(PASST_SRCS) $(HEADERS)
 	$(CC) $(FLAGS) $(CFLAGS) $(PASST_SRCS) -o passt $(LDFLAGS)
 
 passt.avx2: FLAGS += -Ofast -mavx2 -ftree-vectorize -funroll-loops
-passt.avx2: $(PASST_SRCS) $(PASST_HEADERS) seccomp.h
+passt.avx2: $(PASST_SRCS) $(HEADERS)
 	$(CC) $(filter-out -O2,$(FLAGS) $(CFLAGS)) \
 		$(PASST_SRCS) -o passt.avx2 $(LDFLAGS)
 
-- 
2.35.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH] Makefile: Include seccomp.h in HEADERS and require it for static checkers
  2022-09-14 13:59 [PATCH] Makefile: Include seccomp.h in HEADERS and require it for static checkers Stefano Brivio
@ 2022-09-14 15:07 ` David Gibson
  0 siblings, 0 replies; 2+ messages in thread
From: David Gibson @ 2022-09-14 15:07 UTC (permalink / raw)
  To: passt-dev

[-- Attachment #1: Type: text/plain, Size: 1750 bytes --]

On Wed, Sep 14, 2022 at 03:59:11PM +0200, Stefano Brivio wrote:
> Targets running static checkers (cppcheck and clang-tidy) need
> seccomp.h, but the latter is not included in HEADERS. Add it.
> 
> Signed-off-by: Stefano Brivio <sbrivio(a)redhat.com>

Reviewed-by: David Gibson <david(a)gibson.dropbear.id.au>

> ---
>  Makefile | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/Makefile b/Makefile
> index 6805c23..c47a5f6 100644
> --- a/Makefile
> +++ b/Makefile
> @@ -42,7 +42,7 @@ MANPAGES = passt.1 pasta.1 qrap.1
>  PASST_HEADERS = arch.h arp.h checksum.h conf.h dhcp.h dhcpv6.h icmp.h \
>  	isolation.h lineread.h ndp.h netlink.h packet.h passt.h pasta.h \
>  	pcap.h siphash.h tap.h tcp.h tcp_splice.h udp.h util.h
> -HEADERS = $(PASST_HEADERS)
> +HEADERS = $(PASST_HEADERS) seccomp.h
>  
>  # On gcc 11.2, with -O2 and -flto, tcp_hash() and siphash_20b(), if inlined,
>  # seem to be hitting something similar to:
> @@ -104,11 +104,11 @@ static: clean all
>  seccomp.h: $(PASST_SRCS) $(PASST_HEADERS)
>  	@ EXTRA_SYSCALLS=$(EXTRA_SYSCALLS) ./seccomp.sh $^
>  
> -passt: $(PASST_SRCS) $(PASST_HEADERS) seccomp.h
> +passt: $(PASST_SRCS) $(HEADERS)
>  	$(CC) $(FLAGS) $(CFLAGS) $(PASST_SRCS) -o passt $(LDFLAGS)
>  
>  passt.avx2: FLAGS += -Ofast -mavx2 -ftree-vectorize -funroll-loops
> -passt.avx2: $(PASST_SRCS) $(PASST_HEADERS) seccomp.h
> +passt.avx2: $(PASST_SRCS) $(HEADERS)
>  	$(CC) $(filter-out -O2,$(FLAGS) $(CFLAGS)) \
>  		$(PASST_SRCS) -o passt.avx2 $(LDFLAGS)
>  

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-09-14 15:07 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-14 13:59 [PATCH] Makefile: Include seccomp.h in HEADERS and require it for static checkers Stefano Brivio
2022-09-14 15:07 ` David Gibson

Code repositories for project(s) associated with this public inbox

	https://passt.top/passt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for IMAP folder(s).