All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Yann E. MORIN" <yann.morin.1998@free.fr>
To: Baruch Siach <baruch@tkos.co.il>
Cc: buildroot@busybox.net, Matt Weber <matthew.weber@collins.com>,
	Fabrice Fontaine <fontaine.fabrice@gmail.com>
Subject: Re: [Buildroot] [PATCH] iperf: fix build with musl
Date: Thu, 11 Nov 2021 22:11:13 +0100	[thread overview]
Message-ID: <20211111211113.GE2609@scaer> (raw)
In-Reply-To: <67639c1e1d0f8d008160744cf8a056fe9eedfd06.1636612338.git.baruch@tkos.co.il>

Baruch, All,

On 2021-11-11 08:32 +0200, Baruch Siach via buildroot spake thusly:
> Add a patch changing headers include order to fix 'struct ethhdr'
> conflict between kernel headers and musl libc.
> 
> Fixes:
> http://autobuild.buildroot.net/results/23ada69f9b7dc4460315d9175d3064d8db182f8e/
> http://autobuild.buildroot.net/results/3d9c9850de8da5b10bec4f25be07d9ecbc8e0931/
> http://autobuild.buildroot.net/results/25116af770cf94227302cfc1cff4ded07e85fe49/
> 
> Cc: Matt Weber <matthew.weber@collins.com>
> Cc: Fabrice Fontaine <fontaine.fabrice@gmail.com>
> Signed-off-by: Baruch Siach <baruch@tkos.co.il>

Applied to master, thanks!

Regards,
Yann E. MORIN.

> ---
>  .../iperf/0001-Fix-build-with-musl-libc.patch | 67 +++++++++++++++++++
>  1 file changed, 67 insertions(+)
>  create mode 100644 package/iperf/0001-Fix-build-with-musl-libc.patch
> 
> diff --git a/package/iperf/0001-Fix-build-with-musl-libc.patch b/package/iperf/0001-Fix-build-with-musl-libc.patch
> new file mode 100644
> index 000000000000..269079ee1e77
> --- /dev/null
> +++ b/package/iperf/0001-Fix-build-with-musl-libc.patch
> @@ -0,0 +1,67 @@
> +From 6766ab322a9eb8c73f8276be9cdea356eb124de0 Mon Sep 17 00:00:00 2001
> +From: Baruch Siach <baruch@tkos.co.il>
> +Date: Thu, 11 Nov 2021 07:58:10 +0200
> +Subject: [PATCH] Fix build with musl libc
> +MIME-Version: 1.0
> +Content-Type: text/plain; charset=UTF-8
> +Content-Transfer-Encoding: 8bit
> +
> +musl libc defines its own struct ethhdr that conflicts with the kernel
> +define one. The kernel headers provide a way to suppress its struct
> +ethhdr. For that to work the libc headers must precede the kernel. Move
> +the kernel linux/if_tun.h include below libc net/ethernet.h. That fixes
> +the following build failure:
> +
> +In file included from .../arm-buildroot-linux-musleabihf/sysroot/usr/include/net/ethernet.h:10,
> +                 from ../include/headers.h:117,
> +                 from Thread.c:72:
> +.../arm-buildroot-linux-musleabihf/sysroot/usr/include/netinet/if_ether.h:116:8: error: redefinition of ‘struct ethhdr’
> +  116 | struct ethhdr {
> +      |        ^~~~~~
> +In file included from .../arm-buildroot-linux-musleabihf/sysroot/usr/include/linux/if_tun.h:20,
> +                 from ../include/headers.h:110,
> +                 from Thread.c:72:
> +.../arm-buildroot-linux-musleabihf/sysroot/usr/include/linux/if_ether.h:148:8: note: originally defined here
> +  148 | struct ethhdr {
> +      |        ^~~~~~
> +
> +Fixes bug #157.
> +
> +Signed-off-by: Baruch Siach <baruch@tkos.co.il>
> +---
> +Upstream status: sent to Robert McMahon <rjmcmahon@rjmcmahon.com>
> +
> + include/headers.h | 10 +++++-----
> + 1 file changed, 5 insertions(+), 5 deletions(-)
> +
> +diff --git a/include/headers.h b/include/headers.h
> +index 00e0ea0dba42..887490475381 100644
> +--- a/include/headers.h
> ++++ b/include/headers.h
> +@@ -106,11 +106,6 @@ typedef bool _Bool;
> + #include <net/if.h>
> + #endif
> + 
> +-#if ((HAVE_TUNTAP_TAP) || (HAVE_TUNTAP_TUN))
> +-#include <linux/if_tun.h>
> +-#include <sys/ioctl.h>
> +-#endif
> +-
> + 
> + // AF_PACKET HEADERS
> + #if defined(HAVE_LINUX_FILTER_H) && defined(HAVE_AF_PACKET)
> +@@ -146,6 +141,11 @@ typedef bool _Bool;
> + #define  IPV6HDRLEN 40
> + #endif // HAVE_AF_PACKET
> + 
> ++#if ((HAVE_TUNTAP_TAP) || (HAVE_TUNTAP_TUN))
> ++#include <linux/if_tun.h>
> ++#include <sys/ioctl.h>
> ++#endif
> ++
> + #ifdef WIN32
> + 
> + /* Windows config file */
> +-- 
> +2.33.0
> +
> -- 
> 2.33.0
> 
> _______________________________________________
> buildroot mailing list
> buildroot@buildroot.org
> https://lists.buildroot.org/mailman/listinfo/buildroot

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

      reply	other threads:[~2021-11-11 21:11 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-11  6:32 [Buildroot] [PATCH] iperf: fix build with musl Baruch Siach via buildroot
2021-11-11 21:11 ` Yann E. MORIN [this message]

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=20211111211113.GE2609@scaer \
    --to=yann.morin.1998@free.fr \
    --cc=baruch@tkos.co.il \
    --cc=buildroot@busybox.net \
    --cc=fontaine.fabrice@gmail.com \
    --cc=matthew.weber@collins.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.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.