From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH] package/socat: fix build issue
Date: Tue, 6 Sep 2016 23:37:14 +0200 [thread overview]
Message-ID: <20160906233714.0e9fa04a@free-electrons.com> (raw)
In-Reply-To: <1472415533-19764-1-git-send-email-romain.naour@gmail.com>
Hello,
On Sun, 28 Aug 2016 22:18:53 +0200, Romain Naour wrote:
> diff --git a/package/socat/0003-compat-set-NETDB_INTERNAL.patch b/package/socat/0003-compat-set-NETDB_INTERNAL.patch
> new file mode 100644
> index 0000000..da31073
> --- /dev/null
> +++ b/package/socat/0003-compat-set-NETDB_INTERNAL.patch
> @@ -0,0 +1,35 @@
> +From e7804d1750652e39c7a5803d360b29b2637a695f Mon Sep 17 00:00:00 2001
> +From: Romain Naour <romain.naour@gmail.com>
> +Date: Sun, 28 Aug 2016 21:04:01 +0200
> +Subject: [PATCH] compat: set NETDB_INTERNAL
> +
> +Musl doesn't provide NETDB_INTERNAL which is defined in resolv/netdb.h
> +in Glibc [1].
> +
> +Set NETDB_INTERNAL to -1 locally if not already defined.
> +Based on [2].
> +
> +[1] https://sourceware.org/git/?p=glibc.git;a=blob;f=resolv/netdb.h;h=3aba530932c7a62a4f23e3193e9186da677f552b;hb=fdfc9260b61d3d72541f18104d24c7bcb0ce5ca2#l74
> +[2] http://git.alpinelinux.org/cgit/aports/tree/main/socat/netdb-internal.patch?id=5a45173b50892cb634197c30b3506ebff98d3b7d
> +
> +Signed-off-by: Romain Naour <romain.naour@gmail.com>
> +---
> + compat.h | 2 ++
> + 1 file changed, 2 insertions(+)
> +
> +diff --git a/compat.h b/compat.h
> +index 19a929f..4f5ee6d 100644
> +--- a/compat.h
> ++++ b/compat.h
> +@@ -666,6 +666,8 @@ typedef int sig_atomic_t;
> +
> + #if !defined(NETDB_INTERNAL) && defined(h_NETDB_INTERNAL)
> + # define NETDB_INTERNAL h_NETDB_INTERNAL
> ++#elif !defined(NETDB_INTERNAL)
> ++# define NETDB_INTERNAL (-1)
> + #endif
I am not a big fan of this solution, as it's really a hack: musl will
never set h_errno to NETDB_INTERNAL, so it's a bit weird to define it
to -1.
But maybe that's the easiest solution. Have you tried talking with
upstream about this?
> ++/* TUNSETIFF flags from if_tun.h kernel header */
> ++#define IFF_TUN 0x0001
> ++#define IFF_TAP 0x0002
> ++#define IFF_NO_PI 0x1000
> ++
> ++#define TUNSETIFF _IOW('T', 202, int)
I know doing this is what the musl developers recommend, but it is
_really_ silly that we have to duplicate stuff from the kernel headers,
while the kernel headers (and specifically their uapi part) are part of
the toolchain headers... precisely for the purpose of allowing
userspace to use the types/definitions of the kernel to userspace
interface.
Thanks,
Thomas
--
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com
next prev parent reply other threads:[~2016-09-06 21:37 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-08-28 20:18 [Buildroot] [PATCH] package/socat: fix build issue Romain Naour
2016-09-06 21:37 ` Thomas Petazzoni [this message]
2016-09-20 19:05 ` Thomas Petazzoni
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=20160906233714.0e9fa04a@free-electrons.com \
--to=thomas.petazzoni@free-electrons.com \
--cc=buildroot@busybox.net \
/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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox