1 This patch does three things:
3 1/ Uses gethrtime() rather than trying to read the %tick register (the
4 latter has issues in MP environments)
5 2/ Allows Studio to compile in 64-bit and normal optimization.
6 3/ Removed the need to define lines like "CFLAGS += -Du_int8_t=uint8_t"
7 in the snort component Makefile.
9 It has been sent upstream for consideration by the snort maintainers for
12 --- snort-2.9.9.0/configure.in.orig 2014-09-25 08:05:35.171512464 -0700
13 +++ snort-2.9.9.0/configure.in 2014-09-25 08:06:12.896272259 -0700
18 -# check for sparc %time register
19 -if eval "echo $host_cpu|grep -i sparc >/dev/null"; then
20 - OLD_CFLAGS="$CFLAGS"
21 - CFLAGS="$CFLAGS -mcpu=v9 "
22 - AC_MSG_CHECKING([for sparc %time register])
28 - __asm__ __volatile__("rd %%tick, %0" : "=r"(val));
32 - AC_MSG_RESULT($sparcv9)
33 - if test "x$sparcv9" = "xyes"; then
34 - AC_DEFINE([SPARCV9],[1],[For sparc v9 with %time register])
36 - CFLAGS="$OLD_CFLAGS"
39 +# Check for the presence of the Solaris gethrtime routine.
40 +AC_CHECK_FUNCS(gethrtime)
42 # modified from gnulib/m4/visibility.m4
43 AC_DEFUN([CC_VISIBILITY],
44 --- snort-2.9.9.0/src/cpuclock.h.orig 2014-09-25 08:07:00.139948870 -0700
45 +++ snort-2.9.9.0/src/cpuclock.h 2014-09-25 08:08:38.401237764 -0700
47 val = ((uint64_t)tbl) | (((uint64_t)tbu0) << 32); \
54 +#ifdef HAVE_GETHRTIME
55 #define get_clockticks(val) \
57 - __asm__ __volatile__("rd %%tick, %0" : "=r"(val)); \
58 + val = gethrtime(); \
61 -#define get_clockticks(val) \
64 - __asm__ __volatile__("rd %%tick, %0\n" \
66 - : "=r"(a), "=r"(b)); \
67 - val = ((uint64_t)a) | (((uint64_t)b) << 32); \
71 #define get_clockticks(val)
73 +#endif /* HAVE_GETTHRTIME */
74 #endif /* POWERPC || PPC */
75 #endif /* IA64 && HPUX */
76 #endif /* IA64 && GNUC */
77 --- snort-2.9.9.0/src/sfutil/sf_ip.h.orig 2014-09-25 08:09:20.181312683 -0700
78 +++ snort-2.9.9.0/src/sfutil/sf_ip.h 2014-09-25 08:09:41.442009279 -0700
82 #include "snort_debug.h" /* for inline definition */
83 +#include "sf_types.h"
85 /* define SFIP_ROBUST to check pointers passed into the sfip libs.
86 * Robustification should not be enabled if the client code is trustworthy.