* [Buildroot] [PATCH 1/1] package/suricata: fix static build
@ 2024-05-06 20:23 Fabrice Fontaine
2024-05-07 7:12 ` Thomas Petazzoni via buildroot
2024-05-27 14:43 ` Peter Korsgaard
0 siblings, 2 replies; 3+ messages in thread
From: Fabrice Fontaine @ 2024-05-06 20:23 UTC (permalink / raw)
To: buildroot; +Cc: Fabrice Fontaine
Fix the following static build failure raised since bump to version
version 6.0.14 in commit ce17f93e828a07292e03653be04a49480250f23f and
https://github.com/OISF/suricata/commit/31ba4fd1522dd0d7f933767b9205c67a4e726fe5:
configure:22378: checking for pcap_open_dead in -lpcap
configure:22407: /home/buildroot/autobuild/run/instance-3/output-1/host/bin/x86_64-linux-gcc -o conftest -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -O2 -g0 -static -std=c11 -march=native -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -static -rdynamic conftest.c -lpcap -ljansson -lpthread -lyaml -lpcre -latomic -lz >&5
/home/buildroot/autobuild/run/instance-3/output-1/host/opt/ext-toolchain/bin/../lib/gcc/x86_64-buildroot-linux-musl/12.3.0/../../../../x86_64-buildroot-linux-musl/bin/ld: /home/buildroot/autobuild/run/instance-3/output-1/host/x86_64-buildroot-linux-musl/sysroot/usr/lib/../lib64/libpcap.a(pcap-linux.o): in function `nl80211_init':
pcap-linux.c:(.text+0xc34): undefined reference to `nl_socket_alloc'
[...]
checking for pcap_open_dead in -lpcap... no
Fixes: ce17f93e828a07292e03653be04a49480250f23f
- http://autobuild.buildroot.org/results/9e25c2508bd4100d2d1d3180e79060d762361213
Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
---
.../0002-configure.ac-fix-static-build.patch | 52 +++++++++++++++++++
package/suricata/suricata.mk | 1 +
2 files changed, 53 insertions(+)
create mode 100644 package/suricata/0002-configure.ac-fix-static-build.patch
diff --git a/package/suricata/0002-configure.ac-fix-static-build.patch b/package/suricata/0002-configure.ac-fix-static-build.patch
new file mode 100644
index 0000000000..fc5384a114
--- /dev/null
+++ b/package/suricata/0002-configure.ac-fix-static-build.patch
@@ -0,0 +1,52 @@
+From 6e1d8aceea8c4e49f00d8e630b681641a36c688f Mon Sep 17 00:00:00 2001
+From: Fabrice Fontaine <fontaine.fabrice@gmail.com>
+Date: Mon, 6 May 2024 09:31:05 +0200
+Subject: [PATCH] configure.ac: fix static build
+
+static build is broken since
+https://github.com/OISF/suricata/commit/31ba4fd1522dd0d7f933767b9205c67a4e726fe5
+because AC_CHECK_LIB is called before PKG_CHECK_MODULES:
+
+configure:22378: checking for pcap_open_dead in -lpcap
+configure:22407: /home/buildroot/autobuild/run/instance-3/output-1/host/bin/x86_64-linux-gcc -o conftest -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -O2 -g0 -static -std=c11 -march=native -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -static -rdynamic conftest.c -lpcap -ljansson -lpthread -lyaml -lpcre -latomic -lz >&5
+/home/buildroot/autobuild/run/instance-3/output-1/host/opt/ext-toolchain/bin/../lib/gcc/x86_64-buildroot-linux-musl/12.3.0/../../../../x86_64-buildroot-linux-musl/bin/ld: /home/buildroot/autobuild/run/instance-3/output-1/host/x86_64-buildroot-linux-musl/sysroot/usr/lib/../lib64/libpcap.a(pcap-linux.o): in function `nl80211_init':
+pcap-linux.c:(.text+0xc34): undefined reference to `nl_socket_alloc'
+
+[...]
+
+checking for pcap_open_dead in -lpcap... no
+
+Fixes:
+ - http://autobuild.buildroot.org/results/9e25c2508bd4100d2d1d3180e79060d762361213
+
+Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
+Upstream: https://redmine.openinfosecfoundation.org/issues/7008
+---
+ configure.ac | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index 232ee9bed..6277cb9b6 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -1219,6 +1219,8 @@
+ fi
+ fi
+
++ PKG_CHECK_MODULES([PCAP],libpcap,[CPPFLAGS="${CPPFLAGS} ${PCAP_CFLAGS}" LIBS="${LIBS} ${PCAP_LIBS}"],[:])
++
+ if test "$have_wpcap" != "yes"; then
+ AC_CHECK_LIB(pcap, pcap_open_dead, [], [
+ echo
+@@ -1234,8 +1236,6 @@
+ PCAP_LIB_NAME="pcap"
+ fi
+
+- PKG_CHECK_MODULES([PCAP],libpcap,[CPPFLAGS="${CPPFLAGS} ${PCAP_CFLAGS}" LIBS="${LIBS} ${PCAP_LIBS}"],[:])
+-
+ AC_PATH_PROG(HAVE_PCAP_CONFIG, pcap-config, "no")
+ if test "$HAVE_PCAP_CONFIG" = "no" -o "$cross_compiling" = "yes"; then
+ AC_MSG_RESULT(no pcap-config is use)
+--
+2.43.0
+
diff --git a/package/suricata/suricata.mk b/package/suricata/suricata.mk
index 2083e0caba..e60ed2fce8 100644
--- a/package/suricata/suricata.mk
+++ b/package/suricata/suricata.mk
@@ -10,6 +10,7 @@ SURICATA_LICENSE = GPL-2.0
SURICATA_LICENSE_FILES = COPYING LICENSE
SURICATA_CPE_ID_VENDOR = oisf
# 0001-configure.ac-allow-the-user-to-override-RUST_TARGET.patch
+# 0002-configure.ac-fix-static-build.patch
SURICATA_AUTORECONF = YES
SURICATA_DEPENDENCIES = \
--
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/suricata: fix static build
2024-05-06 20:23 [Buildroot] [PATCH 1/1] package/suricata: fix static build Fabrice Fontaine
@ 2024-05-07 7:12 ` Thomas Petazzoni via buildroot
2024-05-27 14:43 ` Peter Korsgaard
1 sibling, 0 replies; 3+ messages in thread
From: Thomas Petazzoni via buildroot @ 2024-05-07 7:12 UTC (permalink / raw)
To: Fabrice Fontaine; +Cc: buildroot
On Mon, 6 May 2024 22:23:04 +0200
Fabrice Fontaine <fontaine.fabrice@gmail.com> wrote:
> Fix the following static build failure raised since bump to version
> version 6.0.14 in commit ce17f93e828a07292e03653be04a49480250f23f and
> https://github.com/OISF/suricata/commit/31ba4fd1522dd0d7f933767b9205c67a4e726fe5:
>
> configure:22378: checking for pcap_open_dead in -lpcap
> configure:22407: /home/buildroot/autobuild/run/instance-3/output-1/host/bin/x86_64-linux-gcc -o conftest -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -O2 -g0 -static -std=c11 -march=native -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -static -rdynamic conftest.c -lpcap -ljansson -lpthread -lyaml -lpcre -latomic -lz >&5
> /home/buildroot/autobuild/run/instance-3/output-1/host/opt/ext-toolchain/bin/../lib/gcc/x86_64-buildroot-linux-musl/12.3.0/../../../../x86_64-buildroot-linux-musl/bin/ld: /home/buildroot/autobuild/run/instance-3/output-1/host/x86_64-buildroot-linux-musl/sysroot/usr/lib/../lib64/libpcap.a(pcap-linux.o): in function `nl80211_init':
> pcap-linux.c:(.text+0xc34): undefined reference to `nl_socket_alloc'
>
> [...]
>
> checking for pcap_open_dead in -lpcap... no
>
> Fixes: ce17f93e828a07292e03653be04a49480250f23f
> - http://autobuild.buildroot.org/results/9e25c2508bd4100d2d1d3180e79060d762361213
>
> Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
> ---
> .../0002-configure.ac-fix-static-build.patch | 52 +++++++++++++++++++
> package/suricata/suricata.mk | 1 +
> 2 files changed, 53 insertions(+)
> create mode 100644 package/suricata/0002-configure.ac-fix-static-build.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/suricata: fix static build
2024-05-06 20:23 [Buildroot] [PATCH 1/1] package/suricata: fix static build Fabrice Fontaine
2024-05-07 7:12 ` Thomas Petazzoni via buildroot
@ 2024-05-27 14:43 ` Peter Korsgaard
1 sibling, 0 replies; 3+ messages in thread
From: Peter Korsgaard @ 2024-05-27 14:43 UTC (permalink / raw)
To: Fabrice Fontaine; +Cc: buildroot
>>>>> "Fabrice" == Fabrice Fontaine <fontaine.fabrice@gmail.com> writes:
> Fix the following static build failure raised since bump to version
> version 6.0.14 in commit ce17f93e828a07292e03653be04a49480250f23f and
> https://github.com/OISF/suricata/commit/31ba4fd1522dd0d7f933767b9205c67a4e726fe5:
> configure:22378: checking for pcap_open_dead in -lpcap
> configure:22407:
> /home/buildroot/autobuild/run/instance-3/output-1/host/bin/x86_64-linux-gcc
> -o conftest -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE
> -D_FILE_OFFSET_BITS=64 -O2 -g0 -static -std=c11 -march=native
> -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64
> -static -rdynamic conftest.c -lpcap -ljansson -lpthread -lyaml -lpcre
> -latomic -lz >&5
> /home/buildroot/autobuild/run/instance-3/output-1/host/opt/ext-toolchain/bin/../lib/gcc/x86_64-buildroot-linux-musl/12.3.0/../../../../x86_64-buildroot-linux-musl/bin/ld:
> /home/buildroot/autobuild/run/instance-3/output-1/host/x86_64-buildroot-linux-musl/sysroot/usr/lib/../lib64/libpcap.a(pcap-linux.o):
> in function `nl80211_init':
> pcap-linux.c:(.text+0xc34): undefined reference to `nl_socket_alloc'
> [...]
> checking for pcap_open_dead in -lpcap... no
> Fixes: ce17f93e828a07292e03653be04a49480250f23f
> - http://autobuild.buildroot.org/results/9e25c2508bd4100d2d1d3180e79060d762361213
> Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
Committed to 2024.02.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-05-27 14:44 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-05-06 20:23 [Buildroot] [PATCH 1/1] package/suricata: fix static build Fabrice Fontaine
2024-05-07 7:12 ` Thomas Petazzoni via buildroot
2024-05-27 14:43 ` Peter Korsgaard
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox