blob: 86c07c11f8eb9778c48a3af34a5202967a97ff5d [file] [log] [blame]
Andrew Geissler635e0e42020-08-21 15:58:33 -05001From 98530865795300008fe06bb647a6fc2dddfc7967 Mon Sep 17 00:00:00 2001
2From: Romain Geissler <romain.geissler@amadeus.com>
3Date: Mon, 27 Jan 2020 09:28:43 +0000
4Subject: [PATCH] Fix build with gcc 10 which defaults to -fno-common (cf
5 https://gcc.gnu.org/gcc-10/porting_to.html)
6
7This fixes the following link error I see when I use the latest gcc 10
8git branch:
9/opt/1A/toolchain/x86_64-v20.0.7/lib/gcc/x86_64-1a-linux-gnu/10.0.1/../../../../x86_64-1a-linux-gnu/bin/ld: src/serve.o:(.bss+0x0): multiple definition of `stats_text'; src/prefork.o:(.bss+0x0): first defined here
10/opt/1A/toolchain/x86_64-v20.0.7/lib/gcc/x86_64-1a-linux-gnu/10.0.1/../../../../x86_64-1a-linux-gnu/bin/ld: src/stats.o:(.data+0x20): multiple definition of `stats_text'; src/prefork.o:(.bss+0x0): first defined here
11collect2: error: ld returned 1 exit status
12
13Upstream-Status: Backport [https://github.com/distcc/distcc/pull/373]
14Signed-off-by: Khem Raj <raj.khem@gmail.com>
15---
16 src/stats.h | 2 +-
17 1 file changed, 1 insertion(+), 1 deletion(-)
18
19diff --git a/src/stats.h b/src/stats.h
20index 9bde285..74d4690 100644
21--- a/src/stats.h
22+++ b/src/stats.h
23@@ -33,7 +33,7 @@ enum stats_e { STATS_TCP_ACCEPT, STATS_REJ_BAD_REQ, STATS_REJ_OVERLOAD,
24 STATS_COMPILE_OK, STATS_COMPILE_ERROR, STATS_COMPILE_TIMEOUT,
25 STATS_CLI_DISCONN, STATS_OTHER, STATS_ENUM_MAX };
26
27-const char *stats_text[20];
28+extern const char *stats_text[20];
29
30 int dcc_stats_init(void);
31 void dcc_stats_init_kid(void);
32--
332.28.0
34