Gentoo Archives: gentoo-commits

From: Joonas Niilola <juippis@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: app-admin/syslog-ng/files/patches/, app-admin/syslog-ng/
Date: Thu, 20 Feb 2020 13:27:35
Message-Id: 1582204641.21d50f7a6514f069f6de2204f5ecdf302c27ce6b.juippis@gentoo
1 commit: 21d50f7a6514f069f6de2204f5ecdf302c27ce6b
2 Author: Tomáš Mózes <hydrapolic <AT> gmail <DOT> com>
3 AuthorDate: Tue Feb 4 11:14:31 2020 +0000
4 Commit: Joonas Niilola <juippis <AT> gentoo <DOT> org>
5 CommitDate: Thu Feb 20 13:17:21 2020 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=21d50f7a
7
8 app-admin/syslog-ng: fix building with CFLAGS=-fno-common
9
10 Closes: https://bugs.gentoo.org/707124
11 Package-Manager: Portage-2.3.85, Repoman-2.3.20
12 Signed-off-by: Tomáš Mózes <hydrapolic <AT> gmail.com>
13 Closes: https://github.com/gentoo/gentoo/pull/14516
14 Signed-off-by: Joonas Niilola <juippis <AT> gentoo.org>
15
16 .../files/patches/syslog-ng-fno-common.patch | 320 +++++++++++++++++++++
17 app-admin/syslog-ng/syslog-ng-3.25.1.ebuild | 4 +-
18 2 files changed, 323 insertions(+), 1 deletion(-)
19
20 diff --git a/app-admin/syslog-ng/files/patches/syslog-ng-fno-common.patch b/app-admin/syslog-ng/files/patches/syslog-ng-fno-common.patch
21 new file mode 100644
22 index 00000000000..abec9213cd1
23 --- /dev/null
24 +++ b/app-admin/syslog-ng/files/patches/syslog-ng-fno-common.patch
25 @@ -0,0 +1,320 @@
26 +diff --git a/CMakeLists.txt b/CMakeLists.txt
27 +index e9b4183fc..1f8f16c13 100644
28 +--- a/CMakeLists.txt
29 ++++ b/CMakeLists.txt
30 +@@ -331,8 +331,7 @@ endif()
31 + add_custom_target(check COMMAND ${CMAKE_CTEST_COMMAND} -j $$(nproc) --output-on-failure)
32 +
33 + set(IMPORTANT_WARNINGS
34 +- -Wshadow
35 +- -fcommon)
36 ++ -Wshadow)
37 +
38 + set(ACCEPTABLE_WARNINGS
39 + -Wno-stack-protector
40 +diff --git a/Makefile.am b/Makefile.am
41 +index 8b24eeaed..86c090638 100644
42 +--- a/Makefile.am
43 ++++ b/Makefile.am
44 +@@ -54,8 +54,7 @@ AM_CPPFLAGS = -I$(top_srcdir)/lib -I$(top_srcdir)/modules -I$(top_builddir)/lib
45 +
46 + # Important warnings
47 + AM_CFLAGS = \
48 +- -Wshadow \
49 +- -fcommon
50 ++ -Wshadow
51 +
52 + # Acceptable warnings
53 + AM_CFLAGS += \
54 +diff --git a/lib/logmsg/tests/test_log_message.c b/lib/logmsg/tests/test_log_message.c
55 +index 245568ce5..e51d78b94 100644
56 +--- a/lib/logmsg/tests/test_log_message.c
57 ++++ b/lib/logmsg/tests/test_log_message.c
58 +@@ -32,6 +32,8 @@
59 + #include <stdlib.h>
60 + #include <glib/gprintf.h>
61 +
62 ++MsgFormatOptions parse_options;
63 ++
64 + typedef struct _LogMessageTestParams
65 + {
66 + LogMessage *message;
67 +@@ -151,7 +153,7 @@ void
68 + setup(void)
69 + {
70 + app_startup();
71 +- init_and_load_syslogformat_module();
72 ++ init_parse_options_and_load_syslogformat(&parse_options);
73 + }
74 +
75 + void
76 +diff --git a/libtest/cr_template.c b/libtest/cr_template.c
77 +index 35e47aa3f..4f0913368 100644
78 +--- a/libtest/cr_template.c
79 ++++ b/libtest/cr_template.c
80 +@@ -34,10 +34,12 @@
81 +
82 + #include "msg_parse_lib.h"
83 +
84 ++static MsgFormatOptions parse_options;
85 ++
86 + void
87 + init_template_tests(void)
88 + {
89 +- init_and_load_syslogformat_module();
90 ++ init_parse_options_and_load_syslogformat(&parse_options);
91 + }
92 +
93 + void
94 +diff --git a/libtest/msg_parse_lib.c b/libtest/msg_parse_lib.c
95 +index ae0d1654b..b3c7cb652 100644
96 +--- a/libtest/msg_parse_lib.c
97 ++++ b/libtest/msg_parse_lib.c
98 +@@ -27,15 +27,13 @@
99 +
100 + #include <criterion/criterion.h>
101 +
102 +-MsgFormatOptions parse_options;
103 +-
104 + void
105 +-init_and_load_syslogformat_module(void)
106 ++init_parse_options_and_load_syslogformat(MsgFormatOptions *parse_options)
107 + {
108 + configuration = cfg_new_snippet();
109 + cfg_load_module(configuration, "syslogformat");
110 +- msg_format_options_defaults(&parse_options);
111 +- msg_format_options_init(&parse_options, configuration);
112 ++ msg_format_options_defaults(parse_options);
113 ++ msg_format_options_init(parse_options, configuration);
114 + }
115 +
116 + void
117 +diff --git a/libtest/msg_parse_lib.h b/libtest/msg_parse_lib.h
118 +index d86f178c2..5a9b4277b 100644
119 +--- a/libtest/msg_parse_lib.h
120 ++++ b/libtest/msg_parse_lib.h
121 +@@ -30,9 +30,7 @@
122 + #include "cfg.h"
123 + #include "logmsg/logmsg.h"
124 +
125 +-extern MsgFormatOptions parse_options;
126 +-
127 +-void init_and_load_syslogformat_module(void);
128 ++void init_parse_options_and_load_syslogformat(MsgFormatOptions *parse_options);
129 + void deinit_syslogformat_module(void);
130 +
131 + void assert_log_messages_equal(LogMessage *log_message_a, LogMessage *log_message_b);
132 +diff --git a/libtest/proto_lib.c b/libtest/proto_lib.c
133 +index b69195865..105e390b9 100644
134 +--- a/libtest/proto_lib.c
135 ++++ b/libtest/proto_lib.c
136 +@@ -23,7 +23,7 @@
137 + */
138 +
139 + #include "proto_lib.h"
140 +-#include "msg_parse_lib.h"
141 ++#include "cfg.h"
142 +
143 + #include <string.h>
144 + #include <criterion/criterion.h>
145 +@@ -164,7 +164,8 @@ assert_proto_server_fetch_ignored_eof(LogProtoServer *proto)
146 + void
147 + init_proto_tests(void)
148 + {
149 +- init_and_load_syslogformat_module();
150 ++ configuration = cfg_new_snippet();
151 ++ cfg_load_module(configuration, "syslogformat");
152 + log_proto_server_options_defaults(&proto_server_options);
153 + }
154 +
155 +@@ -172,5 +173,7 @@ void
156 + deinit_proto_tests(void)
157 + {
158 + log_proto_server_options_destroy(&proto_server_options);
159 +- deinit_syslogformat_module();
160 ++
161 ++ if (configuration)
162 ++ cfg_free(configuration);
163 + }
164 +diff --git a/modules/linux-kmsg-format/tests/test_linux_format_kmsg.c b/modules/linux-kmsg-format/tests/test_linux_format_kmsg.c
165 +index 79a4b97ad..d4d0d45a9 100644
166 +--- a/modules/linux-kmsg-format/tests/test_linux_format_kmsg.c
167 ++++ b/modules/linux-kmsg-format/tests/test_linux_format_kmsg.c
168 +@@ -31,6 +31,8 @@
169 +
170 + #include <criterion/criterion.h>
171 +
172 ++MsgFormatOptions parse_options;
173 ++
174 + static LogMessage *
175 + kmsg_parse_message(const gchar *raw_message_str)
176 + {
177 +diff --git a/modules/python/tests/test_python_logmsg.c b/modules/python/tests/test_python_logmsg.c
178 +index 9a0343b07..51651ee9d 100644
179 +--- a/modules/python/tests/test_python_logmsg.c
180 ++++ b/modules/python/tests/test_python_logmsg.c
181 +@@ -30,6 +30,8 @@
182 + static PyObject *_python_main;
183 + static PyObject *_python_main_dict;
184 +
185 ++MsgFormatOptions parse_options;
186 ++
187 + static void
188 + _py_init_interpreter(void)
189 + {
190 +@@ -95,7 +97,7 @@ void setup(void)
191 + {
192 + app_startup();
193 +
194 +- init_and_load_syslogformat_module();
195 ++ init_parse_options_and_load_syslogformat(&parse_options);
196 +
197 + _py_init_interpreter();
198 + _init_python_main();
199 +diff --git a/modules/stardate/tests/test_stardate.c b/modules/stardate/tests/test_stardate.c
200 +index e48cfb6cd..7d55fc1d0 100644
201 +--- a/modules/stardate/tests/test_stardate.c
202 ++++ b/modules/stardate/tests/test_stardate.c
203 +@@ -33,6 +33,8 @@
204 +
205 + #include "msg_parse_lib.h"
206 +
207 ++MsgFormatOptions parse_options;
208 ++
209 + void
210 + stardate_assert(const gchar *msg_str, const int precision, const gchar *expected)
211 + {
212 +@@ -58,6 +60,7 @@ void
213 + setup(void)
214 + {
215 + app_startup();
216 ++ init_parse_options_and_load_syslogformat(&parse_options);
217 + init_template_tests();
218 + cfg_load_module(configuration, "stardate");
219 + }
220 +@@ -66,6 +69,7 @@ void
221 + teardown(void)
222 + {
223 + deinit_template_tests();
224 ++ deinit_syslogformat_module();
225 + app_shutdown();
226 + }
227 +
228 +diff --git a/persist-tool/add.h b/persist-tool/add.h
229 +index 981e0cc61..2d3524cb0 100644
230 +--- a/persist-tool/add.h
231 ++++ b/persist-tool/add.h
232 +@@ -32,8 +32,8 @@
233 + #include "cfg.h"
234 + #include "persist-tool.h"
235 +
236 +-gchar *persist_state_dir;
237 +-gchar *persist_state_name;
238 ++extern gchar *persist_state_dir;
239 ++extern gchar *persist_state_name;
240 +
241 + gint add_main(int argc, char *argv[]);
242 +
243 +diff --git a/persist-tool/generate.h b/persist-tool/generate.h
244 +index 237a8ae24..34f7dfec9 100644
245 +--- a/persist-tool/generate.h
246 ++++ b/persist-tool/generate.h
247 +@@ -32,8 +32,8 @@
248 + #include "persist-state.h"
249 + #include "cfg.h"
250 +
251 +-gboolean force_generate;
252 +-gchar *generate_output_dir;
253 ++extern gboolean force_generate;
254 ++extern gchar *generate_output_dir;
255 +
256 + gint generate_main(int argc, char *argv[]);
257 +
258 +diff --git a/persist-tool/persist-tool.c b/persist-tool/persist-tool.c
259 +index fd96c856d..4e4adc88f 100644
260 +--- a/persist-tool/persist-tool.c
261 ++++ b/persist-tool/persist-tool.c
262 +@@ -135,11 +135,17 @@ void persist_tool_free(PersistTool *self)
263 + g_free(self);
264 + }
265 +
266 ++gchar *persist_state_dir;
267 ++gchar *persist_state_name;
268 ++gboolean force_generate;
269 ++gchar *generate_output_dir;
270 ++
271 + static GOptionEntry dump_options[] =
272 + {
273 + { NULL, 0, 0, G_OPTION_ARG_NONE, NULL, NULL }
274 + };
275 +
276 ++
277 + static GOptionEntry add_options[] =
278 + {
279 + { "output-dir", 'o', 0, G_OPTION_ARG_STRING, &persist_state_dir, "The directory where persist file is located.", "<directory>" },
280 +diff --git a/tests/unit/test_clone_logmsg.c b/tests/unit/test_clone_logmsg.c
281 +index 57c0b181f..7b738b1e5 100644
282 +--- a/tests/unit/test_clone_logmsg.c
283 ++++ b/tests/unit/test_clone_logmsg.c
284 +@@ -38,6 +38,8 @@
285 + #include <stdlib.h>
286 + #include <stdio.h>
287 +
288 ++MsgFormatOptions parse_options;
289 ++
290 + void
291 + assert_new_log_message_attributes(LogMessage *log_message)
292 + {
293 +@@ -69,7 +71,7 @@ void
294 + setup(void)
295 + {
296 + app_startup();
297 +- init_and_load_syslogformat_module();
298 ++ init_parse_options_and_load_syslogformat(&parse_options);
299 + }
300 +
301 + void
302 +diff --git a/tests/unit/test_matcher.c b/tests/unit/test_matcher.c
303 +index a92c8e458..d43755bea 100644
304 +--- a/tests/unit/test_matcher.c
305 ++++ b/tests/unit/test_matcher.c
306 +@@ -31,6 +31,8 @@
307 + #include <stdlib.h>
308 + #include <string.h>
309 +
310 ++MsgFormatOptions parse_options;
311 ++
312 + static LogMessage *
313 + _create_log_message(const gchar *log)
314 + {
315 +@@ -128,7 +130,7 @@ void
316 + setup(void)
317 + {
318 + app_startup();
319 +- init_and_load_syslogformat_module();
320 ++ init_parse_options_and_load_syslogformat(&parse_options);
321 + }
322 +
323 + void
324 +diff --git a/tests/unit/test_msgparse.c b/tests/unit/test_msgparse.c
325 +index 6b9e1045f..0ed91f638 100644
326 +--- a/tests/unit/test_msgparse.c
327 ++++ b/tests/unit/test_msgparse.c
328 +@@ -49,6 +49,8 @@ struct sdata_pair
329 + struct sdata_pair ignore_sdata_pairs[] = { { NULL, NULL } };
330 + struct sdata_pair empty_sdata_pairs[] = { { NULL, NULL } };
331 +
332 ++MsgFormatOptions parse_options;
333 ++
334 + static unsigned long
335 + _absolute_value(signed long diff)
336 + {
337 +@@ -130,7 +132,7 @@ setup(void)
338 + app_startup();
339 + setenv("TZ", "MET-1METDST", TRUE);
340 + tzset();
341 +- init_and_load_syslogformat_module();
342 ++ init_parse_options_and_load_syslogformat(&parse_options);
343 + /* Fri Feb 8 09:37:49 CET 2019 */
344 + fake_time(1549615069);
345 + }
346
347 diff --git a/app-admin/syslog-ng/syslog-ng-3.25.1.ebuild b/app-admin/syslog-ng/syslog-ng-3.25.1.ebuild
348 index 5566d7e43e4..6a918ed857d 100644
349 --- a/app-admin/syslog-ng/syslog-ng-3.25.1.ebuild
350 +++ b/app-admin/syslog-ng/syslog-ng-3.25.1.ebuild
351 @@ -1,4 +1,4 @@
352 -# Copyright 1999-2019 Gentoo Authors
353 +# Copyright 1999-2020 Gentoo Authors
354 # Distributed under the terms of the GNU General Public License v2
355
356 EAPI=7
357 @@ -50,6 +50,8 @@ DOCS=( AUTHORS NEWS.md CONTRIBUTING.md contrib/syslog-ng.conf.{HP-UX,RedHat,SunO
358 contrib/syslog2ng "${T}/syslog-ng.conf.gentoo.hardened"
359 "${T}/syslog-ng.logrotate.hardened" "${FILESDIR}/README.hardened" )
360
361 +PATCHES=( "${FILESDIR}/patches/${PN}-fno-common.patch" )
362 +
363 pkg_setup() {
364 use python && python-single-r1_pkg_setup
365 }