Obsolete raptor 1.4 API
[oi-userland.git] / components / sysutils / snort / patches / 04-solaris-build.patch
blob5347907ae9d0680716128967f7f2339edd8fabb7
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
10 a future release.
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
14 @@ -746,27 +746,8 @@
15 AC_MSG_RESULT(no)
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])
23 - AC_RUN_IFELSE(
24 - [AC_LANG_PROGRAM(
25 - [[]],
26 - [[
27 - int val;
28 - __asm__ __volatile__("rd %%tick, %0" : "=r"(val));
29 - ]])],
30 - [sparcv9="yes"],
31 - [sparcv9="no"])
32 - AC_MSG_RESULT($sparcv9)
33 - if test "x$sparcv9" = "xyes"; then
34 - AC_DEFINE([SPARCV9],[1],[For sparc v9 with %time register])
35 - else
36 - CFLAGS="$OLD_CFLAGS"
37 - fi
38 -fi
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
46 @@ -84,26 +84,15 @@
47 val = ((uint64_t)tbl) | (((uint64_t)tbu0) << 32); \
49 #else
50 -/* SPARC */
51 -#ifdef SPARCV9
52 -#ifdef _LP64
53 +/* SOLARIS */
54 +#ifdef HAVE_GETHRTIME
55 #define get_clockticks(val) \
56 { \
57 - __asm__ __volatile__("rd %%tick, %0" : "=r"(val)); \
58 + val = gethrtime(); \
60 #else
61 -#define get_clockticks(val) \
62 -{ \
63 - uint32_t a, b; \
64 - __asm__ __volatile__("rd %%tick, %0\n" \
65 - "srlx %0, 32, %1" \
66 - : "=r"(a), "=r"(b)); \
67 - val = ((uint64_t)a) | (((uint64_t)b) << 32); \
69 -#endif /* _LP64 */
70 -#else
71 #define get_clockticks(val)
72 -#endif /* SPARC */
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
79 @@ -39,6 +39,7 @@
80 #endif
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.