All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 0/2] musl support for libnet and netsniff-ng
@ 2016-11-14 11:29 Tobias Klauser
  2016-11-14 11:29 ` [Buildroot] [PATCH 1/2] package/libnet: fix compilation with musl Tobias Klauser
  2016-11-14 11:29 ` [Buildroot] [PATCH 2/2] package/netsniff-ng: allow to build " Tobias Klauser
  0 siblings, 2 replies; 7+ messages in thread
From: Tobias Klauser @ 2016-11-14 11:29 UTC (permalink / raw)
  To: buildroot

netsniff-ng can be build with musl since version 0.5.8, however it depends
on libnet which currently fails to build with musl. This series fixes libnet
build with musl by adding the corresponding upstream patch and then enabling
the netsniff-ng with musl as well.

Tobias Klauser (2):
  package/libnet: fix compilation with musl
  package/netsniff-ng: allow to build with musl

 package/libnet/0001-support-musl-libc.patch | 50 +++++++++++++++++++++++++++++
 package/netsniff-ng/Config.in               |  3 +-
 2 files changed, 51 insertions(+), 2 deletions(-)
 create mode 100644 package/libnet/0001-support-musl-libc.patch

-- 
2.11.0.rc0.7.gbe5a750

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

* [Buildroot] [PATCH 1/2] package/libnet: fix compilation with musl
  2016-11-14 11:29 [Buildroot] [PATCH 0/2] musl support for libnet and netsniff-ng Tobias Klauser
@ 2016-11-14 11:29 ` Tobias Klauser
  2016-11-15 10:38   ` Thomas Petazzoni
  2016-11-14 11:29 ` [Buildroot] [PATCH 2/2] package/netsniff-ng: allow to build " Tobias Klauser
  1 sibling, 1 reply; 7+ messages in thread
From: Tobias Klauser @ 2016-11-14 11:29 UTC (permalink / raw)
  To: buildroot

Patch taken from from upstream:
https://github.com/sam-github/libnet/commit/ffd7fab744a9ad2893169a8fb6244074604d5d0d

Adjusted the file paths manually so the patch applies to the packaged
libnet sources.

Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
---
 package/libnet/0001-support-musl-libc.patch | 50 +++++++++++++++++++++++++++++
 1 file changed, 50 insertions(+)
 create mode 100644 package/libnet/0001-support-musl-libc.patch

diff --git a/package/libnet/0001-support-musl-libc.patch b/package/libnet/0001-support-musl-libc.patch
new file mode 100644
index 000000000000..0704157bb57e
--- /dev/null
+++ b/package/libnet/0001-support-musl-libc.patch
@@ -0,0 +1,50 @@
+From ffd7fab744a9ad2893169a8fb6244074604d5d0d Mon Sep 17 00:00:00 2001
+From: rofl0r <retnyg@gmx.net>
+Date: Tue, 12 Aug 2014 21:51:39 +0200
+Subject: [PATCH] Support musl libc, remove support for glibc < 2.1
+
+The workarounds for glibc < 2.1 (was released february 1999) break the
+build with musl libc.
+
+It is very unlikely that 2.0 or earlier is still in use, and if so,
+1) that's a big security hole
+2) code wouldnt compile anyway since noone tested build in the last decade
+3) user of it wouldn't expect anyway to get bleeding edge sw built on it,
+   so he would just use the latest version that works for him.
+
+Closes #52
+---
+ libnet/src/libnet_link_linux.c | 11 -----------
+ 1 file changed, 11 deletions(-)
+
+diff --git a/libnet/src/libnet_link_linux.c b/libnet/src/libnet_link_linux.c
+index 054458d..3c6df3c 100644
+--- a/src/libnet_link_linux.c
++++ b/src/libnet_link_linux.c
+@@ -30,26 +30,15 @@
+ #include <sys/time.h>
+ 
+ #include <net/if.h>
+-#if (__GLIBC__)
+ #include <netinet/if_ether.h>
+ #include <net/if_arp.h>
+-#else
+-#include <linux/if_arp.h>
+-#include <linux/if_ether.h>
+-#endif
+ 
+ #if (HAVE_PACKET_SOCKET)
+ #ifndef SOL_PACKET
+ #define SOL_PACKET 263
+ #endif  /* SOL_PACKET */
+-#if __GLIBC__ >= 2 && __GLIBC_MINOR >= 1
+ #include <netpacket/packet.h>
+ #include <net/ethernet.h>     /* the L2 protocols */
+-#else
+-#include <asm/types.h>
+-#include <linux/if_packet.h>
+-#include <linux/if_ether.h>   /* The L2 protocols */
+-#endif
+ #endif  /* HAVE_PACKET_SOCKET */
+ 
+ #include "../include/libnet.h"
-- 
2.11.0.rc0.7.gbe5a750

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

* [Buildroot] [PATCH 2/2] package/netsniff-ng: allow to build with musl
  2016-11-14 11:29 [Buildroot] [PATCH 0/2] musl support for libnet and netsniff-ng Tobias Klauser
  2016-11-14 11:29 ` [Buildroot] [PATCH 1/2] package/libnet: fix compilation with musl Tobias Klauser
@ 2016-11-14 11:29 ` Tobias Klauser
  2016-11-15 10:39   ` Thomas Petazzoni
  1 sibling, 1 reply; 7+ messages in thread
From: Tobias Klauser @ 2016-11-14 11:29 UTC (permalink / raw)
  To: buildroot

netsniff-ng allows build with musl since version 0.5.8. With libnet now
being able to build with musl, let's enable musl for netsniff-ng as
well.

Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
---
 package/netsniff-ng/Config.in | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/package/netsniff-ng/Config.in b/package/netsniff-ng/Config.in
index e52bb25f0acd..dca016469736 100644
--- a/package/netsniff-ng/Config.in
+++ b/package/netsniff-ng/Config.in
@@ -7,8 +7,7 @@ config BR2_PACKAGE_NETSNIFF_NG
 	select BR2_PACKAGE_LIBURCU
 	select BR2_PACKAGE_LIBNET
 	# Build with uClibc fails due to missing ceill()
-	# Build with musl fails due to various header issues
-	depends on BR2_TOOLCHAIN_USES_GLIBC
+	depends on !BR2_TOOLCHAIN_USES_UCLIBC
 	depends on BR2_TOOLCHAIN_HEADERS_AT_LEAST_3_0
 	depends on BR2_TOOLCHAIN_HAS_THREADS
 	depends on BR2_PACKAGE_LIBURCU_ARCH_SUPPORTS
-- 
2.11.0.rc0.7.gbe5a750

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

* [Buildroot] [PATCH 1/2] package/libnet: fix compilation with musl
  2016-11-14 11:29 ` [Buildroot] [PATCH 1/2] package/libnet: fix compilation with musl Tobias Klauser
@ 2016-11-15 10:38   ` Thomas Petazzoni
  2016-11-15 11:32     ` Tobias Klauser
  0 siblings, 1 reply; 7+ messages in thread
From: Thomas Petazzoni @ 2016-11-15 10:38 UTC (permalink / raw)
  To: buildroot

Hello,

On Mon, 14 Nov 2016 12:29:47 +0100, Tobias Klauser wrote:
> Patch taken from from upstream:
> https://github.com/sam-github/libnet/commit/ffd7fab744a9ad2893169a8fb6244074604d5d0d
> 
> Adjusted the file paths manually so the patch applies to the packaged
> libnet sources.
> 
> Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
> ---
>  package/libnet/0001-support-musl-libc.patch | 50 +++++++++++++++++++++++++++++
>  1 file changed, 50 insertions(+)
>  create mode 100644 package/libnet/0001-support-musl-libc.patch

Adding the patch fixing the musl build issue is good... but if you
don't adjust the Config.in file of this package to re-enable it for
musl configurations, it's a bit useless, no?

So I've fixed that, and applied your patch to next. Thanks!

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

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

* [Buildroot] [PATCH 2/2] package/netsniff-ng: allow to build with musl
  2016-11-14 11:29 ` [Buildroot] [PATCH 2/2] package/netsniff-ng: allow to build " Tobias Klauser
@ 2016-11-15 10:39   ` Thomas Petazzoni
  2016-11-15 11:35     ` Tobias Klauser
  0 siblings, 1 reply; 7+ messages in thread
From: Thomas Petazzoni @ 2016-11-15 10:39 UTC (permalink / raw)
  To: buildroot

Hello,

On Mon, 14 Nov 2016 12:29:48 +0100, Tobias Klauser wrote:
> netsniff-ng allows build with musl since version 0.5.8. With libnet now
> being able to build with musl, let's enable musl for netsniff-ng as
> well.
> 
> Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
> ---
>  package/netsniff-ng/Config.in | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/package/netsniff-ng/Config.in b/package/netsniff-ng/Config.in
> index e52bb25f0acd..dca016469736 100644
> --- a/package/netsniff-ng/Config.in
> +++ b/package/netsniff-ng/Config.in
> @@ -7,8 +7,7 @@ config BR2_PACKAGE_NETSNIFF_NG
>  	select BR2_PACKAGE_LIBURCU
>  	select BR2_PACKAGE_LIBNET
>  	# Build with uClibc fails due to missing ceill()
> -	# Build with musl fails due to various header issues
> -	depends on BR2_TOOLCHAIN_USES_GLIBC
> +	depends on !BR2_TOOLCHAIN_USES_UCLIBC

This is good, but you forgot to update the Config.in comment that shows
the dependencies needed for this package. So I've fixed that and
applied to next. Thanks!

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

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

* [Buildroot] [PATCH 1/2] package/libnet: fix compilation with musl
  2016-11-15 10:38   ` Thomas Petazzoni
@ 2016-11-15 11:32     ` Tobias Klauser
  0 siblings, 0 replies; 7+ messages in thread
From: Tobias Klauser @ 2016-11-15 11:32 UTC (permalink / raw)
  To: buildroot

On 2016-11-15 at 11:38:58 +0100, Thomas Petazzoni <thomas.petazzoni@free-electrons.com> wrote:
> Hello,
> 
> On Mon, 14 Nov 2016 12:29:47 +0100, Tobias Klauser wrote:
> > Patch taken from from upstream:
> > https://github.com/sam-github/libnet/commit/ffd7fab744a9ad2893169a8fb6244074604d5d0d
> > 
> > Adjusted the file paths manually so the patch applies to the packaged
> > libnet sources.
> > 
> > Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
> > ---
> >  package/libnet/0001-support-musl-libc.patch | 50 +++++++++++++++++++++++++++++
> >  1 file changed, 50 insertions(+)
> >  create mode 100644 package/libnet/0001-support-musl-libc.patch
> 
> Adding the patch fixing the musl build issue is good... but if you
> don't adjust the Config.in file of this package to re-enable it for
> musl configurations, it's a bit useless, no?
> 
> So I've fixed that, and applied your patch to next. Thanks!

Indeed, I forgot to stage that change in my local commit. Sorry about
that and thanks for fixing it up!

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

* [Buildroot] [PATCH 2/2] package/netsniff-ng: allow to build with musl
  2016-11-15 10:39   ` Thomas Petazzoni
@ 2016-11-15 11:35     ` Tobias Klauser
  0 siblings, 0 replies; 7+ messages in thread
From: Tobias Klauser @ 2016-11-15 11:35 UTC (permalink / raw)
  To: buildroot

On 2016-11-15 at 11:39:46 +0100, Thomas Petazzoni <thomas.petazzoni@free-electrons.com> wrote:
> Hello,
> 
> On Mon, 14 Nov 2016 12:29:48 +0100, Tobias Klauser wrote:
> > netsniff-ng allows build with musl since version 0.5.8. With libnet now
> > being able to build with musl, let's enable musl for netsniff-ng as
> > well.
> > 
> > Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
> > ---
> >  package/netsniff-ng/Config.in | 3 +--
> >  1 file changed, 1 insertion(+), 2 deletions(-)
> > 
> > diff --git a/package/netsniff-ng/Config.in b/package/netsniff-ng/Config.in
> > index e52bb25f0acd..dca016469736 100644
> > --- a/package/netsniff-ng/Config.in
> > +++ b/package/netsniff-ng/Config.in
> > @@ -7,8 +7,7 @@ config BR2_PACKAGE_NETSNIFF_NG
> >  	select BR2_PACKAGE_LIBURCU
> >  	select BR2_PACKAGE_LIBNET
> >  	# Build with uClibc fails due to missing ceill()
> > -	# Build with musl fails due to various header issues
> > -	depends on BR2_TOOLCHAIN_USES_GLIBC
> > +	depends on !BR2_TOOLCHAIN_USES_UCLIBC
> 
> This is good, but you forgot to update the Config.in comment that shows
> the dependencies needed for this package. So I've fixed that and
> applied to next. Thanks!

Thanks for fixing it up!

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

end of thread, other threads:[~2016-11-15 11:35 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-11-14 11:29 [Buildroot] [PATCH 0/2] musl support for libnet and netsniff-ng Tobias Klauser
2016-11-14 11:29 ` [Buildroot] [PATCH 1/2] package/libnet: fix compilation with musl Tobias Klauser
2016-11-15 10:38   ` Thomas Petazzoni
2016-11-15 11:32     ` Tobias Klauser
2016-11-14 11:29 ` [Buildroot] [PATCH 2/2] package/netsniff-ng: allow to build " Tobias Klauser
2016-11-15 10:39   ` Thomas Petazzoni
2016-11-15 11:35     ` Tobias Klauser

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.