All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH] musl: workaround kernel if_ether.h header conflict
@ 2016-12-16  4:52 Baruch Siach
  2016-12-17 14:26 ` Thomas Petazzoni
  0 siblings, 1 reply; 2+ messages in thread
From: Baruch Siach @ 2016-12-16  4:52 UTC (permalink / raw)
  To: buildroot

Add a patch that defines _LINUX_IF_ETHER_H in netinet/if_ether.h to avoid the
conflicting kernel if_ether.h.

Other musl distros (Alpine, Sabotage, Gentoo) patch[1] the kernel headers
instead. This is not practical in Buildroot, since we allow the user to choose
the kernel version.

This only fixes the normal case of including linux/if_ether.h (directly or
indirectly) after netinet/if_ether.h.

Fixes (tcpreplay):
http://autobuild.buildroot.net/results/a65/a65b27f9e288f94f041ced64313dbf55af47bf36/

[1] https://cgit.gentoo.org/proj/musl.git/diff/sys-kernel/linux-headers/files/libc-compat.h-prevent-redefinition-of-struct-ethhdr.patch?id=8eddda8072add075ebf56cf6d288bc1450d6b5f8

Cc: Rich Felker <dalias@aerifal.cx>
Signed-off-by: Baruch Siach <baruch@tkos.co.il>
---
This patch will take effect in the autobuilder after a rebuild of musl
toolchains.
---
 package/musl/0002-avoid-kernel-if_ether.h.patch | 30 +++++++++++++++++++++++++
 1 file changed, 30 insertions(+)
 create mode 100644 package/musl/0002-avoid-kernel-if_ether.h.patch

diff --git a/package/musl/0002-avoid-kernel-if_ether.h.patch b/package/musl/0002-avoid-kernel-if_ether.h.patch
new file mode 100644
index 000000000000..8efbcc845083
--- /dev/null
+++ b/package/musl/0002-avoid-kernel-if_ether.h.patch
@@ -0,0 +1,30 @@
+From 3984adc4976de7553f51e0cf4de1e18c373b332b Mon Sep 17 00:00:00 2001
+From: Baruch Siach <baruch@tkos.co.il>
+Date: Thu, 15 Dec 2016 15:10:19 +0200
+Subject: [PATCH] Avoid redefinition of struct ethhdr
+
+This is a workaround to the if_ether.h conflict between musl and the kernel.
+Both define struct ethhdr.
+
+Signed-off-by: Baruch Siach <baruch@tkos.co.il>
+---
+ include/netinet/if_ether.h | 3 +++
+ 1 file changed, 3 insertions(+)
+
+diff --git a/include/netinet/if_ether.h b/include/netinet/if_ether.h
+index 11ee65823f93..cfe1949d3371 100644
+--- a/include/netinet/if_ether.h
++++ b/include/netinet/if_ether.h
+@@ -1,6 +1,9 @@
+ #ifndef _NETINET_IF_ETHER_H
+ #define _NETINET_IF_ETHER_H
+ 
++/* Suppress kernel if_ether.h header inclusion */
++#define _LINUX_IF_ETHER_H
++
+ #include <stdint.h>
+ #include <sys/types.h>
+ 
+-- 
+2.10.2
+
-- 
2.10.2

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

* [Buildroot] [PATCH] musl: workaround kernel if_ether.h header conflict
  2016-12-16  4:52 [Buildroot] [PATCH] musl: workaround kernel if_ether.h header conflict Baruch Siach
@ 2016-12-17 14:26 ` Thomas Petazzoni
  0 siblings, 0 replies; 2+ messages in thread
From: Thomas Petazzoni @ 2016-12-17 14:26 UTC (permalink / raw)
  To: buildroot

Hello,

On Fri, 16 Dec 2016 06:52:17 +0200, Baruch Siach wrote:
> Add a patch that defines _LINUX_IF_ETHER_H in netinet/if_ether.h to avoid the
> conflicting kernel if_ether.h.
> 
> Other musl distros (Alpine, Sabotage, Gentoo) patch[1] the kernel headers
> instead. This is not practical in Buildroot, since we allow the user to choose
> the kernel version.
> 
> This only fixes the normal case of including linux/if_ether.h (directly or
> indirectly) after netinet/if_ether.h.
> 
> Fixes (tcpreplay):
> http://autobuild.buildroot.net/results/a65/a65b27f9e288f94f041ced64313dbf55af47bf36/
> 
> [1] https://cgit.gentoo.org/proj/musl.git/diff/sys-kernel/linux-headers/files/libc-compat.h-prevent-redefinition-of-struct-ethhdr.patch?id=8eddda8072add075ebf56cf6d288bc1450d6b5f8
> 
> Cc: Rich Felker <dalias@aerifal.cx>
> Signed-off-by: Baruch Siach <baruch@tkos.co.il>
> ---
> This patch will take effect in the autobuilder after a rebuild of musl
> toolchains.
> ---
>  package/musl/0002-avoid-kernel-if_ether.h.patch | 30 +++++++++++++++++++++++++
>  1 file changed, 30 insertions(+)
>  create mode 100644 package/musl/0002-avoid-kernel-if_ether.h.patch

Applied to master, thanks.

Thomas
-- 
Thomas Petazzoni, CTO, Free Electrons
Embedded Linux, Kernel and Android engineering
http://free-electrons.com

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

end of thread, other threads:[~2016-12-17 14:26 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-12-16  4:52 [Buildroot] [PATCH] musl: workaround kernel if_ether.h header conflict Baruch Siach
2016-12-17 14:26 ` Thomas Petazzoni

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.