1 |
commit: 17a74b14df557a6431e1b57dd4afdeb58717b030 |
2 |
Author: Sergei Trofimovich <slyfox <AT> gentoo <DOT> org> |
3 |
AuthorDate: Sun Jan 26 11:24:35 2020 +0000 |
4 |
Commit: Sergei Trofimovich <slyfox <AT> gentoo <DOT> org> |
5 |
CommitDate: Sun Jan 26 11:24:58 2020 +0000 |
6 |
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=17a74b14 |
7 |
|
8 |
games-util/qstat: tweak for gcc-10, bug #706390 |
9 |
|
10 |
Reported-by: Toralf Förster |
11 |
Closes: https://bugs.gentoo.org/706390 |
12 |
Package-Manager: Portage-2.3.85, Repoman-2.3.20 |
13 |
Signed-off-by: Sergei Trofimovich <slyfox <AT> gentoo.org> |
14 |
|
15 |
games-util/qstat/files/qstat-2.14-gcc-10.patch | 51 ++++++++++++++++++++++++++ |
16 |
games-util/qstat/qstat-2.14.ebuild | 6 ++- |
17 |
2 files changed, 56 insertions(+), 1 deletion(-) |
18 |
|
19 |
diff --git a/games-util/qstat/files/qstat-2.14-gcc-10.patch b/games-util/qstat/files/qstat-2.14-gcc-10.patch |
20 |
new file mode 100644 |
21 |
index 00000000000..e16e701330a |
22 |
--- /dev/null |
23 |
+++ b/games-util/qstat/files/qstat-2.14-gcc-10.patch |
24 |
@@ -0,0 +1,51 @@ |
25 |
+From 878fa5fd6475685c3465a6e71a10c2fc61c1a09c Mon Sep 17 00:00:00 2001 |
26 |
+From: Sergei Trofimovich <slyfox@g.o> |
27 |
+Date: Sun, 26 Jan 2020 11:15:10 +0000 |
28 |
+Subject: [PATCH] qstat: fix build failure against gcc-10 |
29 |
+MIME-Version: 1.0 |
30 |
+Content-Type: text/plain; charset=UTF-8 |
31 |
+Content-Transfer-Encoding: 8bit |
32 |
+ |
33 |
+On gcc-10 (and gcc-9 -fno-common) build fails as: |
34 |
+ |
35 |
+``` |
36 |
+gcc ... -o qstat ... |
37 |
+ld: config.o:qstat/display_json.h:24: |
38 |
+ multiple definition of `json_printed'; xform.o:qstat/display_json.h:24: first defined here |
39 |
+ld: config.o:qstat/display_json.h:23: |
40 |
+ multiple definition of `json_encoding'; xform.o:qstat/display_json.h:23: first defined here |
41 |
+``` |
42 |
+ |
43 |
+gcc-10 will change the default from -fcommon to fno-common: |
44 |
+https://gcc.gnu.org/PR85678. |
45 |
+ |
46 |
+The error also happens if CFLAGS=-fno-common passed explicitly. |
47 |
+ |
48 |
+Reported-by: Toralf Förster |
49 |
+Bug: https://bugs.gentoo.org/706390 |
50 |
+Signed-off-by: Sergei Trofimovich <slyfox@g.o> |
51 |
+--- |
52 |
+ debug.c | 2 +- |
53 |
+ debug.h | 2 +- |
54 |
+ |
55 |
+--- a/debug.c |
56 |
++++ b/debug.c |
57 |
+@@ -114,6 +114,7 @@ static void _dump_packet(const char* tag, const char* buf, int buflen) |
58 |
+ close(fd); |
59 |
+ } |
60 |
+ |
61 |
++int do_dump = 0; |
62 |
+ ssize_t send_dump(int s, const void *buf, size_t len, int flags) |
63 |
+ { |
64 |
+ if(do_dump) |
65 |
+--- a/debug.h |
66 |
++++ b/debug.h |
67 |
+@@ -47,7 +47,7 @@ void dump_packet(const char* buf, int buflen); |
68 |
+ #endif |
69 |
+ #include <sys/types.h> |
70 |
+ #include <sys/stat.h> |
71 |
+-int do_dump; |
72 |
++extern int do_dump; |
73 |
+ ssize_t send_dump(int s, const void *buf, size_t len, int flags); |
74 |
+ #ifndef QSTAT_DEBUG_C |
75 |
+ #define send(s, buf, len, flags) send_dump(s, buf, len, flags) |
76 |
|
77 |
diff --git a/games-util/qstat/qstat-2.14.ebuild b/games-util/qstat/qstat-2.14.ebuild |
78 |
index 3dbdb38a119..ee781cb8495 100644 |
79 |
--- a/games-util/qstat/qstat-2.14.ebuild |
80 |
+++ b/games-util/qstat/qstat-2.14.ebuild |
81 |
@@ -1,4 +1,4 @@ |
82 |
-# Copyright 1999-2017 Gentoo Foundation |
83 |
+# Copyright 1999-2020 Gentoo Authors |
84 |
# Distributed under the terms of the GNU General Public License v2 |
85 |
|
86 |
EAPI=6 |
87 |
@@ -18,6 +18,10 @@ DEPEND="!sys-cluster/torque" |
88 |
|
89 |
DOCS=( CHANGES.txt COMPILE.txt template/README.txt ) |
90 |
|
91 |
+PATCHES=( |
92 |
+ "${FILESDIR}"/${P}-gcc-10.patch |
93 |
+) |
94 |
+ |
95 |
src_prepare() { |
96 |
default |
97 |
eautoreconf |