aboutsummaryrefslogtreecommitdiffstats
path: root/recipes-extended/glusterfs/files/0001-cli-duplicate-defns-of-cli_default_conn_timeout-and-.patch
blob: 1cdccf990a7c4cc437a9d5f61eaae2c4bd785143 (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
From f66bd85af09397300ad434655fc68861f48c2e3c Mon Sep 17 00:00:00 2001
From: "Kaleb S. KEITHLEY" <kkeithle@redhat.com>
Date: Thu, 2 Jan 2020 07:46:23 -0500
Subject: [PATCH] cli: duplicate defns of cli_default_conn_timeout and
 cli_ten_minutes_timeout

Winter is coming. So is gcc-10.

Compiling with gcc-10-20191219 snapshot reveals dupe defns of
cli_default_conn_timeout and cli_ten_minutes_timeout in
.../cli/src/cli.[ch] due to missing extern decl.

There are many changes coming in gcc-10 described in
https://gcc.gnu.org/gcc-10/changes.html

compiling cli.c with gcc-9 we see:
   ...
        .quad   .LC88
        .comm   cli_ten_minutes_timeout,4,4
        .comm   cli_default_conn_timeout,4,4
        .text
   .Letext0:
   ...

and with gcc-10:
   ...
        .quad   .LC88
        .globl  cli_ten_minutes_timeout
        .bss
        .align 4
        .type   cli_ten_minutes_timeout, @object
        .size   cli_ten_minutes_timeout, 4
   cli_ten_minutes_timeout:
        .zero   4
        .globl  cli_default_conn_timeout
        .align 4
        .type   cli_default_conn_timeout, @object
        .size   cli_default_conn_timeout, 4
   cli_default_conn_timeout:
        .zero   4
        .text
   .Letext0:
   ...

which is reflected in the .o file as (gcc-9):
...
0000000000000004 C cli_ten_minutes_timeout
0000000000000004 C cli_default_conn_timeout
...

and (gcc-10):
...
0000000000000020 B cli_ten_minutes_timeout
0000000000000024 B cli_default_conn_timeout
...

See nm(1) and ld(1) for a description C (common) and B (BSS) and how
they are treated by the linker.

Note: there is still a small chance that gcc-10 will land in Fedora-32,
despite 31 Dec. 2019 having been the deadline for that to happen.

Change-Id: I54ea485736a4910254eeb21222ad263721cdef3c
Fixes: bz#1193929
Signed-off-by: Kaleb S. KEITHLEY <kkeithle@redhat.com>

Upstream-Status: Backport [https://review.gluster.org/#/c/glusterfs/+/23956/]

Signed-off-by: Chen Qi <Qi.Chen@windriver.com>
---
 cli/src/cli.c | 3 +++
 cli/src/cli.h | 4 ++--
 2 files changed, 5 insertions(+), 2 deletions(-)

Index: glusterfs-11.1/cli/src/cli.c
===================================================================
--- glusterfs-11.1.orig/cli/src/cli.c
+++ glusterfs-11.1/cli/src/cli.c
@@ -65,6 +65,9 @@
 
 extern struct rpc_clnt_program cli_prog;
 
+int cli_default_conn_timeout = 120;
+int cli_ten_minutes_timeout = 600;
+
 static int
 glusterfs_ctx_defaults_init(glusterfs_ctx_t *ctx)
 {