Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 1/1] package/ngrep: fix build with libnet
@ 2024-01-09 21:18 Fabrice Fontaine
  2024-02-05 17:48 ` Thomas Petazzoni via buildroot
  0 siblings, 1 reply; 3+ messages in thread
From: Fabrice Fontaine @ 2024-01-09 21:18 UTC (permalink / raw)
  To: buildroot; +Cc: Wade Berrier, Fabrice Fontaine

Use pkg-config to find libnet and avoid the following build failure
raised since commit 100ba8351c088fd764effdcaba848cfd92de79dd if
libnet-config is found on the host:

/home/autobuild/autobuild/instance-4/output-1/host/bin/mips64el-buildroot-linux-gnu-gcc -s -o ngrep ngrep.o  tcpkill.o   -lpcap -lnet   -lpcre -L/usr/lib -lnet
mips64el-buildroot-linux-gnu-gcc: ERROR: unsafe header/library path used in cross-compilation: '-L/usr/lib'

While at it, format Upstream tag of other patches

Fixes:
 - http://autobuild.buildroot.org/results/05c916162b9c1027cf53f1699a1f5653151098ed

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
---
 .checkpackageignore                           |  3 --
 ...nfigure-in-when-testing-for-use_pcre.patch |  3 +-
 ...heck-for-libnet_init-in-configure-in.patch |  3 +-
 package/ngrep/0003-fix-disable-tcpkill.patch  |  2 +-
 ...ure.in-use-pkg-config-to-find-libnet.patch | 38 +++++++++++++++++++
 package/ngrep/ngrep.mk                        |  2 +-
 6 files changed, 42 insertions(+), 9 deletions(-)
 create mode 100644 package/ngrep/0004-configure.in-use-pkg-config-to-find-libnet.patch

diff --git a/.checkpackageignore b/.checkpackageignore
index 5ea1787126..e2a1b536a1 100644
--- a/.checkpackageignore
+++ b/.checkpackageignore
@@ -905,9 +905,6 @@ package/nginx/0008-src-os-unix-ngx_linux_config.h-only-include-dlfcn.h-.patch Up
 package/nginx/0009-auto-os-linux-fix-build-with-libxcrypt.patch Upstream
 package/nginx/0010-Allow-forcing-of-endianness-for-cross-compilation.patch Upstream
 package/nginx/S50nginx Indent Variables
-package/ngrep/0001-Fix-typo-in-configure-in-when-testing-for-use_pcre.patch Upstream
-package/ngrep/0002-Check-for-libnet_init-in-configure-in.patch Upstream
-package/ngrep/0003-fix-disable-tcpkill.patch Upstream
 package/nilfs-utils/0001-nilfs_cleanerd-link-dynamically.patch Upstream
 package/nmap/0001-libdnet-wrapper-configure.patch Upstream
 package/nodejs/nodejs-src/0001-add-qemu-wrapper-support.patch Upstream
diff --git a/package/ngrep/0001-Fix-typo-in-configure-in-when-testing-for-use_pcre.patch b/package/ngrep/0001-Fix-typo-in-configure-in-when-testing-for-use_pcre.patch
index 69c5c887e8..c7f0dec360 100644
--- a/package/ngrep/0001-Fix-typo-in-configure-in-when-testing-for-use_pcre.patch
+++ b/package/ngrep/0001-Fix-typo-in-configure-in-when-testing-for-use_pcre.patch
@@ -4,8 +4,7 @@ Date: Mon, 1 Jan 2018 18:00:34 +0100
 Subject: [PATCH] Fix typo in configure.in when testing for use_pcre
 
 Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
-[Retrieved from:
-https://github.com/jpr5/ngrep/commit/b8b1e9751e1d074af0dd77c2554c1b25fd8f7abe]
+Upstream: https://github.com/jpr5/ngrep/commit/b8b1e9751e1d074af0dd77c2554c1b25fd8f7abe
 ---
  configure.in | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/package/ngrep/0002-Check-for-libnet_init-in-configure-in.patch b/package/ngrep/0002-Check-for-libnet_init-in-configure-in.patch
index 22b18ab7ee..7fa2e2f3bc 100644
--- a/package/ngrep/0002-Check-for-libnet_init-in-configure-in.patch
+++ b/package/ngrep/0002-Check-for-libnet_init-in-configure-in.patch
@@ -7,8 +7,7 @@ libnet_init_packet was the old libnet 1.0 function which is now long
 deprecated.
 
 Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
-[Retrieved from:
-https://github.com/jpr5/ngrep/commit/0a51c8bc62c7b49b8d67a360daa6b1957256f4f5]
+Upstream: https://github.com/jpr5/ngrep/commit/0a51c8bc62c7b49b8d67a360daa6b1957256f4f5
 ---
  configure.in | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/package/ngrep/0003-fix-disable-tcpkill.patch b/package/ngrep/0003-fix-disable-tcpkill.patch
index 1264fd7e3b..894cd95b0f 100644
--- a/package/ngrep/0003-fix-disable-tcpkill.patch
+++ b/package/ngrep/0003-fix-disable-tcpkill.patch
@@ -9,7 +9,7 @@ found on the system.
 To fix this, move AC_CHECK_LIB to found libnet outside AC_ARG_ENABLE
 
 Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
-[Upstream status: https://github.com/jpr5/ngrep/pull/15]
+Upstream: https://github.com/jpr5/ngrep/pull/15
 ---
  configure.in | 6 ++----
  1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/package/ngrep/0004-configure.in-use-pkg-config-to-find-libnet.patch b/package/ngrep/0004-configure.in-use-pkg-config-to-find-libnet.patch
new file mode 100644
index 0000000000..71550da943
--- /dev/null
+++ b/package/ngrep/0004-configure.in-use-pkg-config-to-find-libnet.patch
@@ -0,0 +1,38 @@
+From 4788988827bf4c0d996d3e1e3b6ac52a23b97941 Mon Sep 17 00:00:00 2001
+From: Fabrice Fontaine <fontaine.fabrice@gmail.com>
+Date: Tue, 9 Jan 2024 21:15:47 +0100
+Subject: [PATCH] configure.in: use pkg-config to find libnet
+
+libnet-config is deprecated:
+https://github.com/libnet/libnet/commit/1ec4a6e7d1d23811f0a14ecb51e46489a0175727
+
+Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
+Upstream: unsent (upstream seems dead, no commit since 5 years
+---
+ configure.in | 6 ++++--
+ 1 file changed, 4 insertions(+), 2 deletions(-)
+
+diff --git a/configure.in b/configure.in
+index 7c3dd43..882ff86 100644
+--- a/configure.in
++++ b/configure.in
+@@ -176,12 +176,14 @@ AC_ARG_ENABLE(tcpkill,
+ [ use_tcpkill="$enableval" ],
+ [ use_tcpkill="no" ])
+ 
++PKG_PROG_PKG_CONFIG
+ if test $use_tcpkill = yes; then
+   AC_CHECK_LIB(net, libnet_init,,echo !!! error: tcpkill feature enabled but no libnet found; exit)
+   USE_TCPKILL="1"
+   EXTRA_OBJS="$EXTRA_OBJS tcpkill.o"
+-  EXTRA_DEFINES="$EXTRA_DEFINES $(libnet-config --defines)"
+-  EXTRA_LIBS="$EXTRA_LIBS $(libnet-config --libs)"
++  PKG_CHECK_MODULES(LIBNET, libnet)
++  EXTRA_DEFINES="$EXTRA_DEFINES $LIBNET_CFLAGS"
++  EXTRA_LIBS="$EXTRA_LIBS $LIBNET_LIBS"
+ else
+   USE_TCPKILL="0"
+ fi
+-- 
+2.43.0
+
diff --git a/package/ngrep/ngrep.mk b/package/ngrep/ngrep.mk
index c4750f7504..dc69a34235 100644
--- a/package/ngrep/ngrep.mk
+++ b/package/ngrep/ngrep.mk
@@ -22,7 +22,7 @@ NGREP_CONF_OPTS = \
 	--disable-dropprivs \
 	--disable-pcap-restart
 
-NGREP_DEPENDENCIES = libpcap pcre
+NGREP_DEPENDENCIES = host-pkgconf libpcap pcre
 
 ifeq ($(BR2_PACKAGE_LIBNET),y)
 NGREP_DEPENDENCIES += libnet
-- 
2.43.0

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

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

* Re: [Buildroot] [PATCH 1/1] package/ngrep: fix build with libnet
  2024-01-09 21:18 [Buildroot] [PATCH 1/1] package/ngrep: fix build with libnet Fabrice Fontaine
@ 2024-02-05 17:48 ` Thomas Petazzoni via buildroot
  2024-02-29 15:29   ` Peter Korsgaard
  0 siblings, 1 reply; 3+ messages in thread
From: Thomas Petazzoni via buildroot @ 2024-02-05 17:48 UTC (permalink / raw)
  To: Fabrice Fontaine; +Cc: Wade Berrier, buildroot

On Tue,  9 Jan 2024 22:18:01 +0100
Fabrice Fontaine <fontaine.fabrice@gmail.com> wrote:

> Use pkg-config to find libnet and avoid the following build failure
> raised since commit 100ba8351c088fd764effdcaba848cfd92de79dd if
> libnet-config is found on the host:
> 
> /home/autobuild/autobuild/instance-4/output-1/host/bin/mips64el-buildroot-linux-gnu-gcc -s -o ngrep ngrep.o  tcpkill.o   -lpcap -lnet   -lpcre -L/usr/lib -lnet
> mips64el-buildroot-linux-gnu-gcc: ERROR: unsafe header/library path used in cross-compilation: '-L/usr/lib'
> 
> While at it, format Upstream tag of other patches
> 
> Fixes:
>  - http://autobuild.buildroot.org/results/05c916162b9c1027cf53f1699a1f5653151098ed
> 
> Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
> ---
>  .checkpackageignore                           |  3 --
>  ...nfigure-in-when-testing-for-use_pcre.patch |  3 +-
>  ...heck-for-libnet_init-in-configure-in.patch |  3 +-
>  package/ngrep/0003-fix-disable-tcpkill.patch  |  2 +-
>  ...ure.in-use-pkg-config-to-find-libnet.patch | 38 +++++++++++++++++++
>  package/ngrep/ngrep.mk                        |  2 +-
>  6 files changed, 42 insertions(+), 9 deletions(-)
>  create mode 100644 package/ngrep/0004-configure.in-use-pkg-config-to-find-libnet.patch

Applied to master, thanks.

Thomas
-- 
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

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

* Re: [Buildroot] [PATCH 1/1] package/ngrep: fix build with libnet
  2024-02-05 17:48 ` Thomas Petazzoni via buildroot
@ 2024-02-29 15:29   ` Peter Korsgaard
  0 siblings, 0 replies; 3+ messages in thread
From: Peter Korsgaard @ 2024-02-29 15:29 UTC (permalink / raw)
  To: Thomas Petazzoni via buildroot
  Cc: Wade Berrier, Fabrice Fontaine, Thomas Petazzoni

>>>>> "Thomas" == Thomas Petazzoni via buildroot <buildroot@buildroot.org> writes:

 > On Tue,  9 Jan 2024 22:18:01 +0100
 > Fabrice Fontaine <fontaine.fabrice@gmail.com> wrote:

 >> Use pkg-config to find libnet and avoid the following build failure
 >> raised since commit 100ba8351c088fd764effdcaba848cfd92de79dd if
 >> libnet-config is found on the host:
 >> 
 >> /home/autobuild/autobuild/instance-4/output-1/host/bin/mips64el-buildroot-linux-gnu-gcc
 >> -s -o ngrep ngrep.o tcpkill.o -lpcap -lnet -lpcre -L/usr/lib -lnet
 >> mips64el-buildroot-linux-gnu-gcc: ERROR: unsafe header/library path used in cross-compilation: '-L/usr/lib'
 >> 
 >> While at it, format Upstream tag of other patches
 >> 
 >> Fixes:
 >> - http://autobuild.buildroot.org/results/05c916162b9c1027cf53f1699a1f5653151098ed
 >> 
 >> Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
 >> ---
 >> .checkpackageignore                           |  3 --
 >> ...nfigure-in-when-testing-for-use_pcre.patch |  3 +-
 >> ...heck-for-libnet_init-in-configure-in.patch |  3 +-
 >> package/ngrep/0003-fix-disable-tcpkill.patch  |  2 +-
 >> ...ure.in-use-pkg-config-to-find-libnet.patch | 38 +++++++++++++++++++
 >> package/ngrep/ngrep.mk                        |  2 +-
 >> 6 files changed, 42 insertions(+), 9 deletions(-)
 >> create mode 100644 package/ngrep/0004-configure.in-use-pkg-config-to-find-libnet.patch

 > Applied to master, thanks.

Committed to 2023.02.x and 2023.11.x, thanks.

-- 
Bye, Peter Korsgaard
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

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

end of thread, other threads:[~2024-02-29 15:53 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-01-09 21:18 [Buildroot] [PATCH 1/1] package/ngrep: fix build with libnet Fabrice Fontaine
2024-02-05 17:48 ` Thomas Petazzoni via buildroot
2024-02-29 15:29   ` Peter Korsgaard

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox