|
1 This patch does three things: |
|
2 |
|
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. |
|
8 |
|
9 It has been sent upstream for consideration by the snort maintainers for |
|
10 a future release. |
|
11 |
|
12 --- snort-2.9.2/configure.in.orig 2013-06-04 14:05:22.814684109 -0700 |
|
13 +++ snort-2.9.2/configure.in 2013-06-04 14:41:42.703306013 -0700 |
|
14 @@ -686,27 +686,8 @@ |
|
15 AC_MSG_RESULT(no) |
|
16 fi |
|
17 |
|
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) |
|
41 |
|
42 # modified from gnulib/m4/visibility.m4 |
|
43 AC_DEFUN([CC_VISIBILITY], |
|
44 --- snort-2.9.2/src/cpuclock.h.orig 2013-06-04 12:30:59.362777817 -0700 |
|
45 +++ snort-2.9.2/src/cpuclock.h 2013-06-04 14:19:42.869930833 -0700 |
|
46 @@ -83,26 +83,15 @@ |
|
47 val = ((uint64_t)tbl) | (((uint64_t)tbu0) << 32); \ |
|
48 } |
|
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(); \ |
|
59 } |
|
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); \ |
|
68 -} |
|
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.2/src/sfutil/sf_ip.h.orig 2013-06-04 12:33:38.923475148 -0700 |
|
78 +++ snort-2.9.2/src/sfutil/sf_ip.h 2013-06-04 12:33:52.951704625 -0700 |
|
79 @@ -38,6 +38,7 @@ |
|
80 #endif |
|
81 |
|
82 #include "snort_debug.h" /* for inline definition */ |
|
83 +#include "sf_types.h" |
|
84 |
|
85 /* define SFIP_ROBUST to check pointers passed into the sfip libs. |
|
86 * Robustification should not be enabled if the client code is trustworthy. |