From: David Gibson <david@gibson.dropbear.id.au>
To: Stefano Brivio <sbrivio@redhat.com>
Cc: passt-dev@passt.top, Chris Kuhn <kuhnchris+passt@kuhnchris.eu>,
lemmi <lemmi@nerd2nerd.org>
Subject: Re: [PATCH 3/4] treewide: Fix header includes to build with musl
Date: Thu, 9 Mar 2023 09:11:08 +1100 [thread overview]
Message-ID: <ZAkH/N5PhUeoQXGD@yekko> (raw)
In-Reply-To: <20230308073516.2189680-4-sbrivio@redhat.com>
[-- Attachment #1: Type: text/plain, Size: 3811 bytes --]
On Wed, Mar 08, 2023 at 08:35:15AM +0100, Stefano Brivio wrote:
> From: Chris Kuhn <kuhnchris+github@kuhnchris.eu>
>
> Roughly inspired from a patch by Chris Kuhn: fix up includes so that
> we can build against musl: glibc is more lenient as headers generally
> include a larger amount of other headers.
>
> Compared to the original patch, I only included what was needed
> directly in C files, instead of adding blanket includes in local
> header files. It's a bit more involved, but more consistent with the
> current (not ideal) situation.
Best I can tell, there's no ideal way to manage C includes :/.
> Reported-by: Chris Kuhn <kuhnchris+github@kuhnchris.eu>
> Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
Reviewed-by: David Gibson <david@gibson.dropbear.id.au>
> ---
> conf.c | 2 ++
> isolation.c | 1 +
> netlink.c | 1 +
> passt.c | 2 ++
> tap.c | 1 +
> tcp.c | 1 +
> tcp_splice.c | 1 +
> udp.c | 1 +
> util.c | 1 +
> 9 files changed, 11 insertions(+)
>
> diff --git a/conf.c b/conf.c
> index 07b0b7b..582c391 100644
> --- a/conf.c
> +++ b/conf.c
> @@ -23,8 +23,10 @@
> #include <limits.h>
> #include <grp.h>
> #include <pwd.h>
> +#include <signal.h>
> #include <stdlib.h>
> #include <stdint.h>
> +#include <stdio.h>
> #include <stdbool.h>
> #include <unistd.h>
> #include <syslog.h>
> diff --git a/isolation.c b/isolation.c
> index 6bae4d4..20dc879 100644
> --- a/isolation.c
> +++ b/isolation.c
> @@ -65,6 +65,7 @@
> #include <stdbool.h>
> #include <stddef.h>
> #include <stdlib.h>
> +#include <stdio.h>
> #include <string.h>
> #include <time.h>
> #include <unistd.h>
> diff --git a/netlink.c b/netlink.c
> index 0e0be4f..c8d39a1 100644
> --- a/netlink.c
> +++ b/netlink.c
> @@ -18,6 +18,7 @@
> #include <errno.h>
> #include <sys/types.h>
> #include <limits.h>
> +#include <signal.h>
> #include <stdlib.h>
> #include <stdbool.h>
> #include <stdint.h>
> diff --git a/passt.c b/passt.c
> index f67213a..dfec9d4 100644
> --- a/passt.c
> +++ b/passt.c
> @@ -27,6 +27,8 @@
> #include <stdlib.h>
> #include <unistd.h>
> #include <netdb.h>
> +#include <signal.h>
> +#include <stdio.h>
> #include <string.h>
> #include <errno.h>
> #include <time.h>
> diff --git a/tap.c b/tap.c
> index 88eed88..15fb52e 100644
> --- a/tap.c
> +++ b/tap.c
> @@ -14,6 +14,7 @@
> */
>
> #include <sched.h>
> +#include <signal.h>
> #include <stdio.h>
> #include <errno.h>
> #include <limits.h>
> diff --git a/tcp.c b/tcp.c
> index 8e8d653..96ca5c7 100644
> --- a/tcp.c
> +++ b/tcp.c
> @@ -267,6 +267,7 @@
> #include <sched.h>
> #include <fcntl.h>
> #include <stdio.h>
> +#include <signal.h>
> #include <stdlib.h>
> #include <errno.h>
> #include <limits.h>
> diff --git a/tcp_splice.c b/tcp_splice.c
> index 67af46b..6559762 100644
> --- a/tcp_splice.c
> +++ b/tcp_splice.c
> @@ -32,6 +32,7 @@
> */
>
> #include <sched.h>
> +#include <signal.h>
> #include <errno.h>
> #include <fcntl.h>
> #include <limits.h>
> diff --git a/udp.c b/udp.c
> index 99cfc9f..1077cde 100644
> --- a/udp.c
> +++ b/udp.c
> @@ -91,6 +91,7 @@
> */
>
> #include <sched.h>
> +#include <signal.h>
> #include <stdio.h>
> #include <errno.h>
> #include <limits.h>
> diff --git a/util.c b/util.c
> index 799173f..484889b 100644
> --- a/util.c
> +++ b/util.c
> @@ -13,6 +13,7 @@
> */
>
> #include <sched.h>
> +#include <stdio.h>
> #include <stdlib.h>
> #include <unistd.h>
> #include <arpa/inet.h>
--
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 --]
next prev parent reply other threads:[~2023-03-08 22:45 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-08 7:35 [PATCH 0/4] Fix build against musl C library Stefano Brivio
2023-03-08 7:35 ` [PATCH 1/4] netlink: Use 8 KiB * netlink message header size as response buffer Stefano Brivio
2023-03-08 22:06 ` David Gibson
2023-03-08 7:35 ` [PATCH 2/4] conf, passt: Rename stderr to force_stderr Stefano Brivio
2023-03-08 22:10 ` David Gibson
2023-03-08 7:35 ` [PATCH 3/4] treewide: Fix header includes to build with musl Stefano Brivio
2023-03-08 22:11 ` David Gibson [this message]
2023-03-08 7:35 ` [PATCH 4/4] util: Carry own definition of __bswap_constant{16,32} Stefano Brivio
2023-03-08 22:11 ` David Gibson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ZAkH/N5PhUeoQXGD@yekko \
--to=david@gibson.dropbear.id.au \
--cc=kuhnchris+passt@kuhnchris.eu \
--cc=lemmi@nerd2nerd.org \
--cc=passt-dev@passt.top \
--cc=sbrivio@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).