json-glib: update to 1.10.6
[oi-userland.git] / components / cluster / pacemaker / patches / 11-no-common-execd.patch
blob65c2ab64218395c1813c454896e4d42ed4b67af7
1 From 898d369f3bc770c0db2ad3973c204e6d11ec0e0f Mon Sep 17 00:00:00 2001
2 From: =?UTF-8?q?Jan=20Pokorn=C3=BD?= <jpokorny@redhat.com>
3 Date: Tue, 21 Jan 2020 18:24:44 +0100
4 Subject: [PATCH] Build: get ready for implicit -fno-common with upcoming GCC
5 10
7 Currently, -fno-common yields (and only yields, slightly restructured):
9 > /usr/bin/ld:
10 > pacemaker_execd-execd_commands.o:
11 > pcmk/daemons/execd/pacemaker-execd.h:23:
12 > multiple definition of `rsc_list';
13 > + pacemaker_execd-pacemaker-execd.o:
14 > pcmk/daemons/execd/pacemaker-execd.h:23:
15 > first defined here
17 > pacemaker_execd-execd_alerts.o:
18 > pcmk/daemons/execd/pacemaker-execd.h:23:
19 > multiple definition of `rsc_list';
20 > + pacemaker_execd-pacemaker-execd.o:
21 > pcmk/daemons/execd/pacemaker-execd.h:23:
22 > first defined here
24 > collect2: error: ld returned 1 exit status
26 The problem is that a global (with external linkage) variable without
27 explicit "extern" stands for "tentative definition" (as opposed to mere
28 reference to existing object with external linkage otherwise),
29 and these won't get automagically merged in -fno-common case (which
30 is going to be a default in upcoming GCC 10).
32 Solution is to explicitly add "extern" storage-class specifiers
33 at what's indeed meant as non-tentative reference in the header
34 files that are going to be included from various translation
35 units that will end up in the same link.
37 No more attempts at finding these was performed, just the only instance
38 that got hit in practice (see above) receives this treatment, since
39 manual work simply doesn't scale. Either a static analysis can be
40 employed to mark other potential show-stoppers, or we'll just deal
41 with the issues on case-by-case basis (with the gargantuan assistence
42 of CI systems).
44 References:
45 https://gcc.gnu.org/gcc-10/porting_to.html#common
46 ---
47 daemons/execd/pacemaker-execd.h | 2 +-
48 1 file changed, 1 insertion(+), 1 deletion(-)
50 diff --git a/daemons/execd/pacemaker-execd.h b/daemons/execd/pacemaker-execd.h
51 index 4a52d91834..dab3ccdbee 100644
52 --- a/daemons/execd/pacemaker-execd.h
53 +++ b/daemons/execd/pacemaker-execd.h
54 @@ -20,7 +20,7 @@
55 # include <gnutls/gnutls.h>
56 # endif
58 -GHashTable *rsc_list;
59 +extern GHashTable *rsc_list;
61 typedef struct lrmd_rsc_s {
62 char *rsc_id;