Bug#890432: suricata: FTBFS on ia64

2018-02-16 Thread Adrian Bunk
On Wed, Feb 14, 2018 at 12:32:38PM -0500, Jason Duerstock wrote:
>...
> Patch attached.
>...

A more thorough fix would be the attached patches.

cu
Adrian

-- 

   "Is there not promise of rain?" Ling Tan asked suddenly out
of the darkness. There had been need of rain for many days.
   "Only a promise," Lao Er said.
   Pearl S. Buck - Dragon Seed

Description: Don't use __USE_GNU
 __USE_GNU is a glibc-internal symbol.
 AC_USE_SYSTEM_EXTENSIONS is the proper autoconf
 way to enable extensions.
Author: Adrian Bunk 

--- suricata-4.0.4.orig/configure.ac
+++ suricata-4.0.4/configure.ac
@@ -8,6 +8,7 @@
 
 AC_LANG_C
 AC_PROG_CC_C99
+AC_USE_SYSTEM_EXTENSIONS
 AC_PROG_LIBTOOL
 PKG_PROG_PKG_CONFIG
 
--- suricata-4.0.4.orig/src/suricata-common.h
+++ suricata-4.0.4/src/suricata-common.h
@@ -33,9 +33,6 @@
 #define TRUE   1
 #define FALSE  0
 
-#define _GNU_SOURCE
-#define __USE_GNU
-
 #if HAVE_CONFIG_H
 #include 
 #endif
Description: suricata-common.h must be the first file included
 It brings the _GNU_SOURCE definition, that must be defined
 before any other headers get included.
Author: Adrian Bunk 

--- suricata-4.0.4.orig/src/app-layer-htp-body.c
+++ suricata-4.0.4/src/app-layer-htp-body.c
@@ -26,8 +26,8 @@
  * This file provides a HTTP protocol support for the engine using HTP library.
  */
 
-#include "suricata.h"
 #include "suricata-common.h"
+#include "suricata.h"
 #include "debug.h"
 #include "decode.h"
 #include "threads.h"
--- suricata-4.0.4.orig/src/app-layer-htp-file.c
+++ suricata-4.0.4/src/app-layer-htp-file.c
@@ -24,8 +24,8 @@
  * using HTP library.
  */
 
-#include "suricata.h"
 #include "suricata-common.h"
+#include "suricata.h"
 #include "debug.h"
 #include "decode.h"
 #include "threads.h"
--- suricata-4.0.4.orig/src/app-layer-htp-libhtp.c
+++ suricata-4.0.4/src/app-layer-htp-libhtp.c
@@ -39,8 +39,8 @@
  * Anoop Saldanha 
  */
 
-#include "suricata.h"
 #include "suricata-common.h"
+#include "suricata.h"
 #include "app-layer-htp-libhtp.h"
 
 /**
--- suricata-4.0.4.orig/src/app-layer-htp-libhtp.h
+++ suricata-4.0.4/src/app-layer-htp-libhtp.h
@@ -42,8 +42,8 @@
 #ifndef __APP_LAYER_HTP_LIBHTP__H__
 #define __APP_LAYER_HTP_LIBHTP__H__
 
-#include "suricata.h"
 #include "suricata-common.h"
+#include "suricata.h"
 
 bstr *SCHTPGenerateNormalizedUri(htp_tx_t *tx, htp_uri_t *uri, int uri_include_all);
 
--- suricata-4.0.4.orig/src/app-layer-htp.c
+++ suricata-4.0.4/src/app-layer-htp.c
@@ -33,8 +33,8 @@
  * This file provides a HTTP protocol support for the engine using HTP library.
  */
 
-#include "suricata.h"
 #include "suricata-common.h"
+#include "suricata.h"
 #include "conf.h"
 #include "debug.h"
 #include "decode.h"
--- suricata-4.0.4.orig/src/app-layer-smtp.c
+++ suricata-4.0.4/src/app-layer-smtp.c
@@ -21,8 +21,8 @@
  * \author Anoop Saldanha 
  */
 
-#include "suricata.h"
 #include "suricata-common.h"
+#include "suricata.h"
 #include "debug.h"
 #include "decode.h"
 #include "threads.h"
--- suricata-4.0.4.orig/src/conf-yaml-loader.c
+++ suricata-4.0.4/src/conf-yaml-loader.c
@@ -23,8 +23,9 @@
  * YAML configuration loader.
  */
 
-#include 
 #include "suricata-common.h"
+
+#include 
 #include "conf.h"
 #include "conf-yaml-loader.h"
 #include "util-path.h"
--- suricata-4.0.4.orig/src/detect-engine-mpm.c
+++ suricata-4.0.4/src/detect-engine-mpm.c
@@ -24,8 +24,8 @@
  * Multi pattern matcher
  */
 
-#include "suricata.h"
 #include "suricata-common.h"
+#include "suricata.h"
 
 #include "app-layer-protos.h"
 
--- suricata-4.0.4.orig/src/source-pfring.c
+++ suricata-4.0.4/src/source-pfring.c
@@ -28,11 +28,12 @@
  * \todo Allow ring options such as snaplen etc, to be user configurable.
  */
 
+#include "suricata-common.h"
+
 #ifdef HAVE_PFRING
 #include 
 #endif /* HAVE_PFRING */
 
-#include "suricata-common.h"
 #include "suricata.h"
 #include "conf.h"
 #include "decode.h"
--- suricata-4.0.4.orig/src/util-daemon.c
+++ suricata-4.0.4/src/util-daemon.c
@@ -23,8 +23,8 @@
  * Daemonization process
  */
 
-#include "suricata.h"
 #include "suricata-common.h"
+#include "suricata.h"
 #include "runmodes.h"
 #include "util-daemon.h"
 #include "util-debug.h"
--- suricata-4.0.4.orig/src/util-decode-asn1.c
+++ suricata-4.0.4/src/util-decode-asn1.c
@@ -23,8 +23,8 @@
  * Implements ASN1 decoding (needed for the asn1 keyword, BER, CER & DER)
  */
 
-#include "suricata.h"
 #include "suricata-common.h"
+#include "suricata.h"
 #include "decode.h"
 #include "util-debug.h"
 #include "util-unittest.h"
--- suricata-4.0.4.orig/src/util-logopenfile-tile.c
+++ suricata-4.0.4/src/util-logopenfile-tile.c
@@ -26,9 +26,11 @@
  * files on the host system.
  *
  */
-#include 
 
 #include "suricata-common.h" /* errno.h, string.h, etc. */
+
+#include 
+
 #include "tm-modules.h"  /* LogFileCtx */
 #include "conf.h"/* ConfNode, etc. */
 #include "util-atomic.h"
--- 

Bug#890432: suricata: FTBFS on ia64

2018-02-14 Thread Jason Duerstock
Source: suricata
Severity: normal
Tags: patch
User: debian-i...@lists.debian.org
Usertags: ia64

Dear Maintainer,

>From 
>https://buildd.debian.org/status/fetch.php?pkg=suricata=ia64=1%3A4.0.4-1=1518609275=0

gcc -DHAVE_CONFIG_H -I. -I..   -Wdate-time -D_FORTIFY_SOURCE=2  
-I/usr/lib/ia64-linux-gnu/htp/include -I/usr/include/nspr -I/usr/include/nspr 
-I/usr/include/nss -I/usr/include/nspr -I/usr/include/nss -I/usr/include  
-Wextra -Werror-implicit-function-declaration  -fstack-protector 
-D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -I/usr/include 
-DLOCAL_STATE_DIR=\"/var\" -std=gnu99 -Wall -Wno-unused-parameter 
-Wmissing-prototypes -Wmissing-declarations -Wstrict-prototypes -Wwrite-strings 
-Wbad-function-cast -Wformat-security -Wno-format-nonliteral 
-Wmissing-format-attribute -funsigned-char  -g -O2 
-fdebug-prefix-map=/<>=. -specs=/usr/share/dpkg/pie-compile.specs 
-Wformat -Werror=format-security -c -o conf-yaml-loader.o conf-yaml-loader.c
cc1: warning: -fstack-protector not supported for this target
In file included from /usr/include/ia64-linux-gnu/bits/siginfo-consts.h:184:0,
 from /usr/include/signal.h:58,
 from suricata-common.h:152,
 from conf-yaml-loader.c:27:
/usr/include/ia64-linux-gnu/bits/siginfo-consts-arch.h:39:17: error: 
'TRAP_TRACE' undeclared here (not in a function); did you mean '_SC_TRACE'?
   TRAP_BRANCH = TRAP_TRACE + 1,
 ^~
 _SC_TRACE
Makefile:1687: recipe for target 'conf-yaml-loader.o' failed
make[4]: *** [conf-yaml-loader.o] Error 1
make[4]: *** Waiting for unfinished jobs
make[4]: Leaving directory '/<>/src'
Makefile:1131: recipe for target 'all' failed
make[3]: *** [all] Error 2
make[3]: Leaving directory '/<>/src'
Makefile:494: recipe for target 'all-recursive' failed
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory '/<>'
Makefile:422: recipe for target 'all' failed
make[1]: *** [all] Error 2
make[1]: Leaving directory '/<>'
dh_auto_build: make -j2 returned exit code 2
debian/rules:57: recipe for target 'build-arch' failed
make: *** [build-arch] Error 2
dpkg-buildpackage: error: debian/rules build-arch subprocess returned exit 
status 2

Patch attached.

-- System Information:
Debian Release: buster/sid
  APT prefers unreleased
  APT policy: (500, 'unreleased'), (500, 'unstable')
Architecture: ia64

Kernel: Linux 3.14-0.bpo.2-mckinley (SMP w/2 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), 
LANGUAGE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: sysvinit (via /sbin/init)
--- src/suricata-common.h.orig  2018-02-14 12:27:29.727546789 -0500
+++ src/suricata-common.h   2018-02-14 12:27:43.135478812 -0500
@@ -34,7 +34,6 @@
 #define FALSE  0
 
 #define _GNU_SOURCE
-#define __USE_GNU
 
 #if HAVE_CONFIG_H
 #include