components/snort/patches/solaris-build.patch
author James Chang <james.c.chang@Oracle.COM>
Fri, 02 Oct 2015 10:50:45 -0700
changeset 4915 48f204cc245c
parent 2198 168b8acace5f
child 7650 2e39c59b83f8
permissions -rw-r--r--
PSARC/2015/333 EOL of grails 21494758 Removal of GRAILS from Solaris 21494777 Removal of GRAILS man page from Solaris
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1345
ee87318d9935 PSARC 2013/113 snort 2.9.2
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
     1
This patch does three things:
ee87318d9935 PSARC 2013/113 snort 2.9.2
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
     2
ee87318d9935 PSARC 2013/113 snort 2.9.2
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
     3
1/ Uses gethrtime() rather than trying to read the %tick register (the
ee87318d9935 PSARC 2013/113 snort 2.9.2
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
     4
   latter has issues in MP environments)
ee87318d9935 PSARC 2013/113 snort 2.9.2
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
     5
2/ Allows Studio to compile in 64-bit and normal optimization.
ee87318d9935 PSARC 2013/113 snort 2.9.2
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
     6
3/ Removed the need to define lines like "CFLAGS += -Du_int8_t=uint8_t"
ee87318d9935 PSARC 2013/113 snort 2.9.2
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
     7
   in the snort component Makefile.
ee87318d9935 PSARC 2013/113 snort 2.9.2
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
     8
2198
168b8acace5f PSARC 2014/346 Data Acquisition library (DAQ) 2.0.2
Rich Burridge <rich.burridge@oracle.com>
parents: 1345
diff changeset
     9
It has been sent upstream for consideration by the snort maintainers for
1345
ee87318d9935 PSARC 2013/113 snort 2.9.2
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    10
a future release.
ee87318d9935 PSARC 2013/113 snort 2.9.2
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    11
2198
168b8acace5f PSARC 2014/346 Data Acquisition library (DAQ) 2.0.2
Rich Burridge <rich.burridge@oracle.com>
parents: 1345
diff changeset
    12
--- configure.in.orig	2014-09-25 08:05:35.171512464 -0700
168b8acace5f PSARC 2014/346 Data Acquisition library (DAQ) 2.0.2
Rich Burridge <rich.burridge@oracle.com>
parents: 1345
diff changeset
    13
+++ configure.in	2014-09-25 08:06:12.896272259 -0700
168b8acace5f PSARC 2014/346 Data Acquisition library (DAQ) 2.0.2
Rich Burridge <rich.burridge@oracle.com>
parents: 1345
diff changeset
    14
@@ -746,27 +746,8 @@
1345
ee87318d9935 PSARC 2013/113 snort 2.9.2
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    15
     AC_MSG_RESULT(no)
ee87318d9935 PSARC 2013/113 snort 2.9.2
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    16
 fi
ee87318d9935 PSARC 2013/113 snort 2.9.2
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    17
 
ee87318d9935 PSARC 2013/113 snort 2.9.2
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    18
-# check for sparc %time register
ee87318d9935 PSARC 2013/113 snort 2.9.2
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    19
-if eval "echo $host_cpu|grep -i sparc >/dev/null"; then
ee87318d9935 PSARC 2013/113 snort 2.9.2
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    20
-    OLD_CFLAGS="$CFLAGS"
ee87318d9935 PSARC 2013/113 snort 2.9.2
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    21
-    CFLAGS="$CFLAGS -mcpu=v9 "
ee87318d9935 PSARC 2013/113 snort 2.9.2
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    22
-    AC_MSG_CHECKING([for sparc %time register])
ee87318d9935 PSARC 2013/113 snort 2.9.2
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    23
-    AC_RUN_IFELSE(
ee87318d9935 PSARC 2013/113 snort 2.9.2
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    24
-    [AC_LANG_PROGRAM(
ee87318d9935 PSARC 2013/113 snort 2.9.2
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    25
-    [[]],
ee87318d9935 PSARC 2013/113 snort 2.9.2
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    26
-    [[
ee87318d9935 PSARC 2013/113 snort 2.9.2
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    27
-        int val;
ee87318d9935 PSARC 2013/113 snort 2.9.2
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    28
-        __asm__ __volatile__("rd %%tick, %0" : "=r"(val));
ee87318d9935 PSARC 2013/113 snort 2.9.2
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    29
-    ]])],
ee87318d9935 PSARC 2013/113 snort 2.9.2
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    30
-    [sparcv9="yes"],
ee87318d9935 PSARC 2013/113 snort 2.9.2
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    31
-    [sparcv9="no"])
ee87318d9935 PSARC 2013/113 snort 2.9.2
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    32
-    AC_MSG_RESULT($sparcv9)
ee87318d9935 PSARC 2013/113 snort 2.9.2
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    33
-    if test "x$sparcv9" = "xyes"; then
ee87318d9935 PSARC 2013/113 snort 2.9.2
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    34
-        AC_DEFINE([SPARCV9],[1],[For sparc v9 with %time register])
ee87318d9935 PSARC 2013/113 snort 2.9.2
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    35
-    else
ee87318d9935 PSARC 2013/113 snort 2.9.2
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    36
-        CFLAGS="$OLD_CFLAGS"
ee87318d9935 PSARC 2013/113 snort 2.9.2
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    37
-    fi
ee87318d9935 PSARC 2013/113 snort 2.9.2
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    38
-fi
ee87318d9935 PSARC 2013/113 snort 2.9.2
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    39
+# Check for the presence of the Solaris gethrtime routine.
ee87318d9935 PSARC 2013/113 snort 2.9.2
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    40
+AC_CHECK_FUNCS(gethrtime)
ee87318d9935 PSARC 2013/113 snort 2.9.2
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    41
 
ee87318d9935 PSARC 2013/113 snort 2.9.2
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    42
 # modified from gnulib/m4/visibility.m4
ee87318d9935 PSARC 2013/113 snort 2.9.2
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    43
 AC_DEFUN([CC_VISIBILITY],
2198
168b8acace5f PSARC 2014/346 Data Acquisition library (DAQ) 2.0.2
Rich Burridge <rich.burridge@oracle.com>
parents: 1345
diff changeset
    44
--- src/cpuclock.h.orig	2014-09-25 08:07:00.139948870 -0700
168b8acace5f PSARC 2014/346 Data Acquisition library (DAQ) 2.0.2
Rich Burridge <rich.burridge@oracle.com>
parents: 1345
diff changeset
    45
+++ src/cpuclock.h	2014-09-25 08:08:38.401237764 -0700
168b8acace5f PSARC 2014/346 Data Acquisition library (DAQ) 2.0.2
Rich Burridge <rich.burridge@oracle.com>
parents: 1345
diff changeset
    46
@@ -84,26 +84,15 @@
1345
ee87318d9935 PSARC 2013/113 snort 2.9.2
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    47
     val = ((uint64_t)tbl) | (((uint64_t)tbu0) << 32);  \
ee87318d9935 PSARC 2013/113 snort 2.9.2
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    48
 }
ee87318d9935 PSARC 2013/113 snort 2.9.2
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    49
 #else
ee87318d9935 PSARC 2013/113 snort 2.9.2
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    50
-/* SPARC */
ee87318d9935 PSARC 2013/113 snort 2.9.2
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    51
-#ifdef SPARCV9
ee87318d9935 PSARC 2013/113 snort 2.9.2
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    52
-#ifdef _LP64
ee87318d9935 PSARC 2013/113 snort 2.9.2
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    53
+/* SOLARIS */
ee87318d9935 PSARC 2013/113 snort 2.9.2
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    54
+#ifdef HAVE_GETHRTIME
ee87318d9935 PSARC 2013/113 snort 2.9.2
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    55
 #define get_clockticks(val) \
ee87318d9935 PSARC 2013/113 snort 2.9.2
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    56
 { \
ee87318d9935 PSARC 2013/113 snort 2.9.2
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    57
-    __asm__ __volatile__("rd %%tick, %0" : "=r"(val)); \
ee87318d9935 PSARC 2013/113 snort 2.9.2
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    58
+    val = gethrtime(); \
ee87318d9935 PSARC 2013/113 snort 2.9.2
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    59
 }
ee87318d9935 PSARC 2013/113 snort 2.9.2
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    60
 #else
ee87318d9935 PSARC 2013/113 snort 2.9.2
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    61
-#define get_clockticks(val) \
ee87318d9935 PSARC 2013/113 snort 2.9.2
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    62
-{ \
ee87318d9935 PSARC 2013/113 snort 2.9.2
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    63
-    uint32_t a, b; \
ee87318d9935 PSARC 2013/113 snort 2.9.2
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    64
-    __asm__ __volatile__("rd %%tick, %0\n" \
ee87318d9935 PSARC 2013/113 snort 2.9.2
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    65
-                         "srlx %0, 32, %1" \
ee87318d9935 PSARC 2013/113 snort 2.9.2
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    66
-                         : "=r"(a), "=r"(b)); \
ee87318d9935 PSARC 2013/113 snort 2.9.2
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    67
-    val = ((uint64_t)a) | (((uint64_t)b) << 32); \
ee87318d9935 PSARC 2013/113 snort 2.9.2
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    68
-}
ee87318d9935 PSARC 2013/113 snort 2.9.2
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    69
-#endif /* _LP64 */
ee87318d9935 PSARC 2013/113 snort 2.9.2
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    70
-#else
ee87318d9935 PSARC 2013/113 snort 2.9.2
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    71
 #define get_clockticks(val)
ee87318d9935 PSARC 2013/113 snort 2.9.2
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    72
-#endif /* SPARC */
ee87318d9935 PSARC 2013/113 snort 2.9.2
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    73
+#endif /* HAVE_GETTHRTIME */
ee87318d9935 PSARC 2013/113 snort 2.9.2
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    74
 #endif /* POWERPC || PPC */
ee87318d9935 PSARC 2013/113 snort 2.9.2
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    75
 #endif /* IA64 && HPUX */
ee87318d9935 PSARC 2013/113 snort 2.9.2
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    76
 #endif /* IA64 && GNUC */
2198
168b8acace5f PSARC 2014/346 Data Acquisition library (DAQ) 2.0.2
Rich Burridge <rich.burridge@oracle.com>
parents: 1345
diff changeset
    77
--- src/sfutil/sf_ip.h.orig	2014-09-25 08:09:20.181312683 -0700
168b8acace5f PSARC 2014/346 Data Acquisition library (DAQ) 2.0.2
Rich Burridge <rich.burridge@oracle.com>
parents: 1345
diff changeset
    78
+++ src/sfutil/sf_ip.h	2014-09-25 08:09:41.442009279 -0700
168b8acace5f PSARC 2014/346 Data Acquisition library (DAQ) 2.0.2
Rich Burridge <rich.burridge@oracle.com>
parents: 1345
diff changeset
    79
@@ -39,6 +39,7 @@
1345
ee87318d9935 PSARC 2013/113 snort 2.9.2
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    80
 #endif
ee87318d9935 PSARC 2013/113 snort 2.9.2
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    81
 
ee87318d9935 PSARC 2013/113 snort 2.9.2
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    82
 #include "snort_debug.h" /* for inline definition */
ee87318d9935 PSARC 2013/113 snort 2.9.2
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    83
+#include "sf_types.h"
ee87318d9935 PSARC 2013/113 snort 2.9.2
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    84
 
ee87318d9935 PSARC 2013/113 snort 2.9.2
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    85
 /* define SFIP_ROBUST to check pointers passed into the sfip libs.
ee87318d9935 PSARC 2013/113 snort 2.9.2
Rich Burridge <rich.burridge@oracle.com>
parents:
diff changeset
    86
  * Robustification should not be enabled if the client code is trustworthy.