summaryrefslogtreecommitdiff
path: root/community/libmemcached/gcc-4.8.patch
blob: 5f42d3f3cabdadb3fa8df267641ff7225d36a8aa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
Description: Fix compilation with gcc-4.8
 This patch fixes the error flags made incompatible with gcc-4.8:
 g++: error: -fsanitize=address is incompatible with -fsanitize=thread
Author: Brian Aker
Last-Update: 2013-06-14
Bug: https://bugs.launchpad.net/libmemcached/+bug/1164442

--- a/libtest/run.gdb	2012-03-26 01:08:09 +0000
+++ b/libtest/run.gdb	2013-04-10 05:25:24 +0000
@@ -1,5 +1,6 @@
 set logging on
 set logging overwrite on
 set environment LIBTEST_IN_GDB=1
+set ASAN_OPTIONS=abort_on_error=1
 run
 thread apply all bt

--- a/m4/ax_harden_compiler_flags.m4	2013-02-12 05:44:21 +0000
+++ b/m4/ax_harden_compiler_flags.m4	2013-04-10 05:25:24 +0000
@@ -53,7 +53,7 @@
 # ?  _APPEND_COMPILE_FLAGS_ERROR([-Wlong-long]) -- Don't turn on for
 # compatibility issues memcached_stat_st
 
-#serial 8
+#serial 9
 
 AC_DEFUN([_WARNINGS_AS_ERRORS],
     [AC_CACHE_CHECK([if all warnings into errors],[ac_cv_warnings_as_errors],
@@ -92,9 +92,12 @@
            _APPEND_COMPILE_FLAGS_ERROR([-H])
            _APPEND_COMPILE_FLAGS_ERROR([-ggdb])
            _APPEND_COMPILE_FLAGS_ERROR([-g])
-           _APPEND_COMPILE_FLAGS_ERROR([-O0])],
-           [_APPEND_COMPILE_FLAGS_ERROR([-g])
-           _APPEND_COMPILE_FLAGS_ERROR([-O2])])
+           _APPEND_COMPILE_FLAGS_ERROR([-O0]),
+           _APPEND_COMPILE_FLAGS_ERROR([-fno-omit-frame-pointer])
+           ],[
+           _APPEND_COMPILE_FLAGS_ERROR([-g])
+           _APPEND_COMPILE_FLAGS_ERROR([-O2])
+           ])
 
          AS_IF([test "x$ac_cv_vcs_checkout" = xyes],
            [_APPEND_COMPILE_FLAGS_ERROR([-fstack-check])
@@ -155,26 +158,31 @@
           _APPEND_COMPILE_FLAGS_ERROR([-Wundef])
           _APPEND_COMPILE_FLAGS_ERROR([-Wunsafe-loop-optimizations])
           _APPEND_COMPILE_FLAGS_ERROR([-funsafe-loop-optimizations])
-          _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=address])
-          _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=integer])
-          _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=thread])
-          _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=memory])
-          _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=alignment])
-          _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=bool])
-          _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=bounds])
-          _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=enum])
-          _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=float-cast-overflow])
-          _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=float-divide-by-zero])
-          _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=integer-divide-by-zero])
-          _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=null])
-          _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=object-size])
-          _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=return])
-          _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=shift])
-          _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=signed-integer-overflow])
-          _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=unreachable])
-          _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=unsigned-integer-overflow])
-          _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=vla-bound])
-          _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=vptr])
+          AS_IF([test "x$ac_cv_vcs_checkout" = xyes],[
+            _APPEND_COMPILE_FLAGS_ERROR([-fno-omit-frame-pointer])
+            _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=address])
+            _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=integer])
+            AS_IF([test "x$enable_shared" = "xyes"],[
+                _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=thread])
+                ])
+            _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=memory])
+            _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=alignment])
+            _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=bool])
+            _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=bounds])
+            _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=enum])
+            _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=float-cast-overflow])
+            _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=float-divide-by-zero])
+            _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=integer-divide-by-zero])
+            _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=null])
+            _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=object-size])
+            _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=return])
+            _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=shift])
+            _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=signed-integer-overflow])
+            _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=unreachable])
+            _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=unsigned-integer-overflow])
+            _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=vla-bound])
+            _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=vptr])
+          ])
           _APPEND_COMPILE_FLAGS_ERROR([-Wclobbered])
           _APPEND_COMPILE_FLAGS_ERROR([-Wunused])
           _APPEND_COMPILE_FLAGS_ERROR([-Wunused-result])
@@ -186,6 +194,7 @@
           _APPEND_COMPILE_FLAGS_ERROR([-fwrapv])
           _APPEND_COMPILE_FLAGS_ERROR([-fmudflapt])
           _APPEND_COMPILE_FLAGS_ERROR([-pipe])
+          _APPEND_COMPILE_FLAGS_ERROR([-Wsizeof-pointer-memaccess])
 
           AS_IF([test "x$ax_enable_debug" = xno],
             [AS_IF([test "x$ac_cv_vcs_checkout" = xyes],
@@ -213,9 +222,12 @@
            _APPEND_COMPILE_FLAGS_ERROR([-H])
            _APPEND_COMPILE_FLAGS_ERROR([-ggdb])
            _APPEND_COMPILE_FLAGS_ERROR([-g])
-           _APPEND_COMPILE_FLAGS_ERROR([-O0])],
-           [_APPEND_COMPILE_FLAGS_ERROR([-g])
-           _APPEND_COMPILE_FLAGS_ERROR([-O2])])
+           _APPEND_COMPILE_FLAGS_ERROR([-O0]),
+           _APPEND_COMPILE_FLAGS_ERROR([-fno-omit-frame-pointer])
+           ],[
+           _APPEND_COMPILE_FLAGS_ERROR([-g])
+           _APPEND_COMPILE_FLAGS_ERROR([-O2])
+           ])
 
          AS_IF([test "x$ac_cv_vcs_checkout" = xyes],
            [_APPEND_COMPILE_FLAGS_ERROR([-fstack-check])
@@ -268,27 +280,32 @@
           _APPEND_COMPILE_FLAGS_ERROR([-funsafe-loop-optimizations])
           _APPEND_COMPILE_FLAGS_ERROR([-Wc++11-compat])
 #         _APPEND_COMPILE_FLAGS_ERROR([-Weffc++])
-          _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=address])
-          _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=integer])
-          _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=thread])
-          _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=memory])
-          _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=alignment])
-          _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=bool])
-          _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=bounds])
-          _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=enum])
-          _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=float-cast-overflow])
-          _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=float-divide-by-zero])
-          _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=integer-divide-by-zero])
-          _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=null])
-          _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=object-size])
-          _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=return])
-          _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=shift])
-          _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=signed-integer-overflow])
-          _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=unreachable])
-          _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=unsigned-integer-overflow])
-          _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=vla-bound])
-          _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=vptr])
-#          _APPEND_COMPILE_FLAGS_ERROR([-Wold-style-cast])
+          AS_IF([test "x$ac_cv_vcs_checkout" = xyes],[
+            _APPEND_COMPILE_FLAGS_ERROR([-fno-omit-frame-pointer])
+            _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=address])
+            _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=integer])
+            AS_IF([test "x$enable_shared" = "xyes"],[
+                _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=thread])
+                ])
+            _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=memory])
+            _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=alignment])
+            _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=bool])
+            _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=bounds])
+            _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=enum])
+            _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=float-cast-overflow])
+            _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=float-divide-by-zero])
+            _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=integer-divide-by-zero])
+            _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=null])
+            _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=object-size])
+            _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=return])
+            _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=shift])
+            _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=signed-integer-overflow])
+            _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=unreachable])
+            _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=unsigned-integer-overflow])
+            _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=vla-bound])
+            _APPEND_COMPILE_FLAGS_ERROR([-fsanitize=vptr])
+          ])
+#         _APPEND_COMPILE_FLAGS_ERROR([-Wold-style-cast])
           _APPEND_COMPILE_FLAGS_ERROR([-Wclobbered])
           _APPEND_COMPILE_FLAGS_ERROR([-Wunused])
           _APPEND_COMPILE_FLAGS_ERROR([-Wunused-result])
@@ -301,6 +318,7 @@
           _APPEND_COMPILE_FLAGS_ERROR([-fwrapv])
           _APPEND_COMPILE_FLAGS_ERROR([-fmudflapt])
           _APPEND_COMPILE_FLAGS_ERROR([-pipe])
+          _APPEND_COMPILE_FLAGS_ERROR([-Wsizeof-pointer-memaccess])
 
           AS_IF([test "x$ax_enable_debug" = xno],
           [AS_IF([test "x$ac_cv_vcs_checkout" = xyes],