All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 1/3] package/suricata: fix build on m68k
@ 2019-04-24 20:21 Fabrice Fontaine
  2019-04-24 20:21 ` [Buildroot] [PATCH 2/3] package/suricata: fix pcap static build Fabrice Fontaine
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Fabrice Fontaine @ 2019-04-24 20:21 UTC (permalink / raw)
  To: buildroot

Fixes:
 - http://autobuild.buildroot.org/results/ed923bcc1454ce90444b8dac7c064b5f4ea4a0a5

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
---
 .../0001-fix-build-on-m68k-with-uclibc.patch  | 48 +++++++++++++++++++
 package/suricata/suricata.mk                  |  2 +
 2 files changed, 50 insertions(+)
 create mode 100644 package/suricata/0001-fix-build-on-m68k-with-uclibc.patch

diff --git a/package/suricata/0001-fix-build-on-m68k-with-uclibc.patch b/package/suricata/0001-fix-build-on-m68k-with-uclibc.patch
new file mode 100644
index 0000000000..09b4b70588
--- /dev/null
+++ b/package/suricata/0001-fix-build-on-m68k-with-uclibc.patch
@@ -0,0 +1,48 @@
+From 58750008dd562c08642bed1bb3194cb87e301570 Mon Sep 17 00:00:00 2001
+From: Fabrice Fontaine <fontaine.fabrice@gmail.com>
+Date: Wed, 24 Apr 2019 19:14:29 +0200
+Subject: [PATCH] fix build on m68k with uclibc
+
+uclibc on m68k defines _POSIX_SPIN_LOCKS but does not define
+pthread_spin_unlock so check for this function before using
+pthread_spin_xxx functions
+
+Fixes:
+ - http://autobuild.buildroot.org/results/ed923bcc1454ce90444b8dac7c064b5f4ea4a0a5
+
+Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
+[Upstream status: https://github.com/OISF/suricata/pull/3816]
+---
+ configure.ac  | 2 ++
+ src/threads.h | 2 +-
+ 2 files changed, 3 insertions(+), 1 deletion(-)
+
+diff --git a/configure.ac b/configure.ac
+index a6669ec47..ee59c9d8e 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -889,6 +889,8 @@
+         exit 1
+     fi
+ 
++    AC_CHECK_FUNCS([pthread_spin_unlock])
++
+   # libjansson
+     AC_ARG_WITH(libjansson_includes,
+             [  --with-libjansson-includes=DIR  libjansson include directory],
+diff --git a/src/threads.h b/src/threads.h
+index 4e6f61134..4eb1a7360 100644
+--- a/src/threads.h
++++ b/src/threads.h
+@@ -155,7 +155,7 @@ enum {
+ #define SCCtrlCondDestroy pthread_cond_destroy
+ 
+ /* spinlocks */
+-#if ((_POSIX_SPIN_LOCKS - 200112L) < 0L) || defined HELGRIND
++#if ((_POSIX_SPIN_LOCKS - 200112L) < 0L) || defined HELGRIND || !defined(HAVE_PTHREAD_SPIN_UNLOCK)
+ #define SCSpinlock                              SCMutex
+ #define SCSpinLock(spin)                        SCMutexLock((spin))
+ #define SCSpinTrylock(spin)                     SCMutexTrylock((spin))
+-- 
+2.20.1
+
diff --git a/package/suricata/suricata.mk b/package/suricata/suricata.mk
index e5884cdfe4..0491fad6d5 100644
--- a/package/suricata/suricata.mk
+++ b/package/suricata/suricata.mk
@@ -8,6 +8,8 @@ SURICATA_VERSION = 4.1.3
 SURICATA_SITE = https://www.openinfosecfoundation.org/download
 SURICATA_LICENSE = GPL-2.0
 SURICATA_LICENSE_FILES = COPYING LICENSE
+# We're patching configure.ac
+SURICATA_AUTORECONF = YES
 
 SURICATA_DEPENDENCIES = \
 	host-pkgconf \
-- 
2.20.1

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

* [Buildroot] [PATCH 2/3] package/suricata: fix pcap static build
  2019-04-24 20:21 [Buildroot] [PATCH 1/3] package/suricata: fix build on m68k Fabrice Fontaine
@ 2019-04-24 20:21 ` Fabrice Fontaine
  2019-05-27 22:29   ` Arnout Vandecappelle
  2019-04-24 20:21 ` [Buildroot] [PATCH 3/3] package/libhtp: add -lz to htp.pc Fabrice Fontaine
  2019-05-27 22:27 ` [Buildroot] [PATCH 1/3] package/suricata: fix build on m68k Arnout Vandecappelle
  2 siblings, 1 reply; 6+ messages in thread
From: Fabrice Fontaine @ 2019-04-24 20:21 UTC (permalink / raw)
  To: buildroot

Fixes:
 - no autobuilder failures yet

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
---
 ...figure.ac-fix-static-build-with-pcap.patch | 29 +++++++++++++++++++
 1 file changed, 29 insertions(+)
 create mode 100644 package/suricata/0002-configure.ac-fix-static-build-with-pcap.patch

diff --git a/package/suricata/0002-configure.ac-fix-static-build-with-pcap.patch b/package/suricata/0002-configure.ac-fix-static-build-with-pcap.patch
new file mode 100644
index 0000000000..3312550620
--- /dev/null
+++ b/package/suricata/0002-configure.ac-fix-static-build-with-pcap.patch
@@ -0,0 +1,29 @@
+From 2660123b0c16d7f6a49747711be676c4119561c9 Mon Sep 17 00:00:00 2001
+From: Fabrice Fontaine <fontaine.fabrice@gmail.com>
+Date: Wed, 24 Apr 2019 20:35:20 +0200
+Subject: [PATCH] configure.ac: fix static build with pcap
+
+pcap can depends on nl-3 so use pkg-config to find these dependencies
+otherwise all AC_CHECK_LIB calls will fail when building statically
+
+Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
+[Upstream status: not sent yet]
+---
+ configure.ac | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/configure.ac b/configure.ac
+index ee59c9d8e..5ec341231 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -1331,6 +1331,7 @@
+     AC_CHECK_HEADERS([pcap.h pcap/pcap.h pcap/bpf.h])
+ 
+     LIBPCAP=""
++    PKG_CHECK_MODULES([PCAP],libpcap,[CPPFLAGS="${CPPFLAGS} ${PCAP_CFLAGS}" LIBS="${LIBS} ${PCAP_LIBS}"],[])
+     AC_CHECK_LIB(${PCAP_LIB_NAME}, pcap_open_live,, LIBPCAP="no")
+     if test "$LIBPCAP" = "no"; then
+         echo
+-- 
+2.20.1
+
-- 
2.20.1

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

* [Buildroot] [PATCH 3/3] package/libhtp: add -lz to htp.pc
  2019-04-24 20:21 [Buildroot] [PATCH 1/3] package/suricata: fix build on m68k Fabrice Fontaine
  2019-04-24 20:21 ` [Buildroot] [PATCH 2/3] package/suricata: fix pcap static build Fabrice Fontaine
@ 2019-04-24 20:21 ` Fabrice Fontaine
  2019-05-27 22:32   ` Arnout Vandecappelle
  2019-05-27 22:27 ` [Buildroot] [PATCH 1/3] package/suricata: fix build on m68k Arnout Vandecappelle
  2 siblings, 1 reply; 6+ messages in thread
From: Fabrice Fontaine @ 2019-04-24 20:21 UTC (permalink / raw)
  To: buildroot

This will fix static build of suricata

Fixes:
 - No autobuilder failures

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
---
 ...002-htp.pc.in-add-lz-to-Libs.private.patch | 29 +++++++++++++++++++
 1 file changed, 29 insertions(+)
 create mode 100644 package/libhtp/0002-htp.pc.in-add-lz-to-Libs.private.patch

diff --git a/package/libhtp/0002-htp.pc.in-add-lz-to-Libs.private.patch b/package/libhtp/0002-htp.pc.in-add-lz-to-Libs.private.patch
new file mode 100644
index 0000000000..b5b0c0e2b6
--- /dev/null
+++ b/package/libhtp/0002-htp.pc.in-add-lz-to-Libs.private.patch
@@ -0,0 +1,29 @@
+From 39e534ab696157b244ec226d649c789dcf423e42 Mon Sep 17 00:00:00 2001
+From: Fabrice Fontaine <fontaine.fabrice@gmail.com>
+Date: Wed, 24 Apr 2019 20:48:57 +0200
+Subject: [PATCH] htp.pc.in: add -lz to Libs.private
+
+zlib is a mandatory dependency so add it to Libs.private otherwise
+static linking iof suricata will fail
+
+Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
+[Upstream status: not sent yet]
+---
+ htp.pc.in | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/htp.pc.in b/htp.pc.in
+index 2fec995..9b1a6cc 100644
+--- a/htp.pc.in
++++ b/htp.pc.in
+@@ -7,6 +7,6 @@ Name: @PACKAGE_NAME@
+ Description: A security-aware HTTP parser, designed for use in IDS/IPS and WAF products.
+ Version: @PACKAGE_VERSION@
+ Libs: -L${libdir} -lhtp
+-Libs.private: @LIBICONV@
++Libs.private: -lz @LIBICONV@
+ Cflags: -I${includedir} -I${libdir}/htp/include
+ 
+-- 
+2.20.1
+
-- 
2.20.1

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

* [Buildroot] [PATCH 1/3] package/suricata: fix build on m68k
  2019-04-24 20:21 [Buildroot] [PATCH 1/3] package/suricata: fix build on m68k Fabrice Fontaine
  2019-04-24 20:21 ` [Buildroot] [PATCH 2/3] package/suricata: fix pcap static build Fabrice Fontaine
  2019-04-24 20:21 ` [Buildroot] [PATCH 3/3] package/libhtp: add -lz to htp.pc Fabrice Fontaine
@ 2019-05-27 22:27 ` Arnout Vandecappelle
  2 siblings, 0 replies; 6+ messages in thread
From: Arnout Vandecappelle @ 2019-05-27 22:27 UTC (permalink / raw)
  To: buildroot



On 24/04/2019 22:21, Fabrice Fontaine wrote:
> Fixes:
>  - http://autobuild.buildroot.org/results/ed923bcc1454ce90444b8dac7c064b5f4ea4a0a5
> 
> Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
> ---
>  .../0001-fix-build-on-m68k-with-uclibc.patch  | 48 +++++++++++++++++++
>  package/suricata/suricata.mk                  |  2 +
>  2 files changed, 50 insertions(+)
>  create mode 100644 package/suricata/0001-fix-build-on-m68k-with-uclibc.patch
> 
> diff --git a/package/suricata/0001-fix-build-on-m68k-with-uclibc.patch b/package/suricata/0001-fix-build-on-m68k-with-uclibc.patch
> new file mode 100644
> index 0000000000..09b4b70588
> --- /dev/null
> +++ b/package/suricata/0001-fix-build-on-m68k-with-uclibc.patch
> @@ -0,0 +1,48 @@
> +From 58750008dd562c08642bed1bb3194cb87e301570 Mon Sep 17 00:00:00 2001
> +From: Fabrice Fontaine <fontaine.fabrice@gmail.com>
> +Date: Wed, 24 Apr 2019 19:14:29 +0200
> +Subject: [PATCH] fix build on m68k with uclibc
> +
> +uclibc on m68k defines _POSIX_SPIN_LOCKS but does not define
> +pthread_spin_unlock so check for this function before using
> +pthread_spin_xxx functions

 This makes no sense... If pthread_spin_lock is defined but pthread_spin_unlock
is not, then there are no spinlocks. So this clearly is a uClibc bug.

 Since NPTL support for m68k seems to be pretty incomplete in uClibc, I think we
should just disable it.

 And for this specific package, I'd just disable it for m68k.

 Regards,
 Arnout

> +
> +Fixes:
> + - http://autobuild.buildroot.org/results/ed923bcc1454ce90444b8dac7c064b5f4ea4a0a5
> +
> +Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
> +[Upstream status: https://github.com/OISF/suricata/pull/3816]
> +---
> + configure.ac  | 2 ++
> + src/threads.h | 2 +-
> + 2 files changed, 3 insertions(+), 1 deletion(-)
> +
> +diff --git a/configure.ac b/configure.ac
> +index a6669ec47..ee59c9d8e 100644
> +--- a/configure.ac
> ++++ b/configure.ac
> +@@ -889,6 +889,8 @@
> +         exit 1
> +     fi
> + 
> ++    AC_CHECK_FUNCS([pthread_spin_unlock])
> ++
> +   # libjansson
> +     AC_ARG_WITH(libjansson_includes,
> +             [  --with-libjansson-includes=DIR  libjansson include directory],
> +diff --git a/src/threads.h b/src/threads.h
> +index 4e6f61134..4eb1a7360 100644
> +--- a/src/threads.h
> ++++ b/src/threads.h
> +@@ -155,7 +155,7 @@ enum {
> + #define SCCtrlCondDestroy pthread_cond_destroy
> + 
> + /* spinlocks */
> +-#if ((_POSIX_SPIN_LOCKS - 200112L) < 0L) || defined HELGRIND
> ++#if ((_POSIX_SPIN_LOCKS - 200112L) < 0L) || defined HELGRIND || !defined(HAVE_PTHREAD_SPIN_UNLOCK)
> + #define SCSpinlock                              SCMutex
> + #define SCSpinLock(spin)                        SCMutexLock((spin))
> + #define SCSpinTrylock(spin)                     SCMutexTrylock((spin))
> +-- 
> +2.20.1
> +
> diff --git a/package/suricata/suricata.mk b/package/suricata/suricata.mk
> index e5884cdfe4..0491fad6d5 100644
> --- a/package/suricata/suricata.mk
> +++ b/package/suricata/suricata.mk
> @@ -8,6 +8,8 @@ SURICATA_VERSION = 4.1.3
>  SURICATA_SITE = https://www.openinfosecfoundation.org/download
>  SURICATA_LICENSE = GPL-2.0
>  SURICATA_LICENSE_FILES = COPYING LICENSE
> +# We're patching configure.ac
> +SURICATA_AUTORECONF = YES
>  
>  SURICATA_DEPENDENCIES = \
>  	host-pkgconf \
> 

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

* [Buildroot] [PATCH 2/3] package/suricata: fix pcap static build
  2019-04-24 20:21 ` [Buildroot] [PATCH 2/3] package/suricata: fix pcap static build Fabrice Fontaine
@ 2019-05-27 22:29   ` Arnout Vandecappelle
  0 siblings, 0 replies; 6+ messages in thread
From: Arnout Vandecappelle @ 2019-05-27 22:29 UTC (permalink / raw)
  To: buildroot



On 24/04/2019 22:21, Fabrice Fontaine wrote:
> Fixes:
>  - no autobuilder failures yet
> 
> Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>

 Applied to master, thanks.

 Regards,
 Arnout

> ---
>  ...figure.ac-fix-static-build-with-pcap.patch | 29 +++++++++++++++++++
>  1 file changed, 29 insertions(+)
>  create mode 100644 package/suricata/0002-configure.ac-fix-static-build-with-pcap.patch
> 
> diff --git a/package/suricata/0002-configure.ac-fix-static-build-with-pcap.patch b/package/suricata/0002-configure.ac-fix-static-build-with-pcap.patch
> new file mode 100644
> index 0000000000..3312550620
> --- /dev/null
> +++ b/package/suricata/0002-configure.ac-fix-static-build-with-pcap.patch
> @@ -0,0 +1,29 @@
> +From 2660123b0c16d7f6a49747711be676c4119561c9 Mon Sep 17 00:00:00 2001
> +From: Fabrice Fontaine <fontaine.fabrice@gmail.com>
> +Date: Wed, 24 Apr 2019 20:35:20 +0200
> +Subject: [PATCH] configure.ac: fix static build with pcap
> +
> +pcap can depends on nl-3 so use pkg-config to find these dependencies
> +otherwise all AC_CHECK_LIB calls will fail when building statically
> +
> +Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
> +[Upstream status: not sent yet]
> +---
> + configure.ac | 1 +
> + 1 file changed, 1 insertion(+)
> +
> +diff --git a/configure.ac b/configure.ac
> +index ee59c9d8e..5ec341231 100644
> +--- a/configure.ac
> ++++ b/configure.ac
> +@@ -1331,6 +1331,7 @@
> +     AC_CHECK_HEADERS([pcap.h pcap/pcap.h pcap/bpf.h])
> + 
> +     LIBPCAP=""
> ++    PKG_CHECK_MODULES([PCAP],libpcap,[CPPFLAGS="${CPPFLAGS} ${PCAP_CFLAGS}" LIBS="${LIBS} ${PCAP_LIBS}"],[])
> +     AC_CHECK_LIB(${PCAP_LIB_NAME}, pcap_open_live,, LIBPCAP="no")
> +     if test "$LIBPCAP" = "no"; then
> +         echo
> +-- 
> +2.20.1
> +
> 

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

* [Buildroot] [PATCH 3/3] package/libhtp: add -lz to htp.pc
  2019-04-24 20:21 ` [Buildroot] [PATCH 3/3] package/libhtp: add -lz to htp.pc Fabrice Fontaine
@ 2019-05-27 22:32   ` Arnout Vandecappelle
  0 siblings, 0 replies; 6+ messages in thread
From: Arnout Vandecappelle @ 2019-05-27 22:32 UTC (permalink / raw)
  To: buildroot



On 24/04/2019 22:21, Fabrice Fontaine wrote:
> This will fix static build of suricata
> 
> Fixes:
>  - No autobuilder failures
> 
> Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>

 Applied to master, thanks.

> ---
>  ...002-htp.pc.in-add-lz-to-Libs.private.patch | 29 +++++++++++++++++++
>  1 file changed, 29 insertions(+)
>  create mode 100644 package/libhtp/0002-htp.pc.in-add-lz-to-Libs.private.patch
> 
> diff --git a/package/libhtp/0002-htp.pc.in-add-lz-to-Libs.private.patch b/package/libhtp/0002-htp.pc.in-add-lz-to-Libs.private.patch
> new file mode 100644
> index 0000000000..b5b0c0e2b6
> --- /dev/null
> +++ b/package/libhtp/0002-htp.pc.in-add-lz-to-Libs.private.patch
> @@ -0,0 +1,29 @@
> +From 39e534ab696157b244ec226d649c789dcf423e42 Mon Sep 17 00:00:00 2001
> +From: Fabrice Fontaine <fontaine.fabrice@gmail.com>
> +Date: Wed, 24 Apr 2019 20:48:57 +0200
> +Subject: [PATCH] htp.pc.in: add -lz to Libs.private
> +
> +zlib is a mandatory dependency so add it to Libs.private otherwise
> +static linking iof suricata will fail

 I've slightly reworded this (grammar errors mostly) so you may want to take the
version I committed to push upstream.

 Regards,
 Arnout

> +
> +Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
> +[Upstream status: not sent yet]
> +---
> + htp.pc.in | 2 +-
> + 1 file changed, 1 insertion(+), 1 deletion(-)
> +
> +diff --git a/htp.pc.in b/htp.pc.in
> +index 2fec995..9b1a6cc 100644
> +--- a/htp.pc.in
> ++++ b/htp.pc.in
> +@@ -7,6 +7,6 @@ Name: @PACKAGE_NAME@
> + Description: A security-aware HTTP parser, designed for use in IDS/IPS and WAF products.
> + Version: @PACKAGE_VERSION@
> + Libs: -L${libdir} -lhtp
> +-Libs.private: @LIBICONV@
> ++Libs.private: -lz @LIBICONV@
> + Cflags: -I${includedir} -I${libdir}/htp/include
> + 
> +-- 
> +2.20.1
> +
> 

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

end of thread, other threads:[~2019-05-27 22:32 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-04-24 20:21 [Buildroot] [PATCH 1/3] package/suricata: fix build on m68k Fabrice Fontaine
2019-04-24 20:21 ` [Buildroot] [PATCH 2/3] package/suricata: fix pcap static build Fabrice Fontaine
2019-05-27 22:29   ` Arnout Vandecappelle
2019-04-24 20:21 ` [Buildroot] [PATCH 3/3] package/libhtp: add -lz to htp.pc Fabrice Fontaine
2019-05-27 22:32   ` Arnout Vandecappelle
2019-05-27 22:27 ` [Buildroot] [PATCH 1/3] package/suricata: fix build on m68k Arnout Vandecappelle

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.