[packages/gpm] fix build with gcc 10

atler atler at pld-linux.org
Fri Nov 20 10:43:50 CET 2020


commit 027fb8e910bdb5d2826dfd5627cdf70bca9f68f8
Author: Jan Palus <atler at pld-linux.org>
Date:   Fri Nov 20 10:42:57 2020 +0100

    fix build with gcc 10

 gcc10.patch | 39 +++++++++++++++++++++++++++++++++++++++
 gpm.spec    |  2 ++
 2 files changed, 41 insertions(+)
---
diff --git a/gpm.spec b/gpm.spec
index 5749d31..cdfdfe5 100644
--- a/gpm.spec
+++ b/gpm.spec
@@ -34,6 +34,7 @@ Patch5:		%{name}-ncursesw.patch
 Patch6:		close-fds.patch
 Patch7:		format-string.patch
 Patch8:		glibc.patch
+Patch9:		gcc10.patch
 URL:		http://www.nico.schottelius.org/software/gpm/
 BuildRequires:	autoconf >= 2.61
 BuildRequires:	automake
@@ -242,6 +243,7 @@ Pliki trybu GPM dla Emacsa.
 %patch6 -p1
 %patch7 -p1
 %patch8 -p1
+%patch9 -p1
 
 %{__sed} -i -e '1s#/usr/bin/awk#/bin/awk#' doc/manpager
 
diff --git a/gcc10.patch b/gcc10.patch
new file mode 100644
index 0000000..3db4b98
--- /dev/null
+++ b/gcc10.patch
@@ -0,0 +1,39 @@
+From f04f24dd5ca5c1c13608b144ab66e2ccd47f106a Mon Sep 17 00:00:00 2001
+From: Sergei Trofimovich <slyfox at gentoo.org>
+Date: Sun, 19 Jan 2020 19:53:41 +0000
+Subject: [PATCH] src/headers/daemon.h: avoid redefinition of
+ 'last_selection_time'
+
+Noticed build failure on gcc-10 as:
+
+```
+gcc  -L/home/slyfox/dev/git/gpm/src  -o gpm mice.o ... report.o tools.o   -lm
+ld: twiddler.o:gpm/src/headers/daemon.h:183:
+  multiple definition of `last_selection_time'; mice.o:gpm/src/headers/daemon.h:183: first defined here
+ld: synaptics.o:git/gpm/src/headers/daemon.h:183:
+  multiple definition of `last_selection_time'; mice.o:git/gpm/src/headers/daemon.h:183: first defined here
+```
+
+gcc-10 will change the default from -fcommon to fno-common:
+https://gcc.gnu.org/PR85678.
+
+The error also happens if CFLAGS=-fno-common passed explicitly.
+
+Signed-off-by: Sergei Trofimovich <slyfox at gentoo.org>
+---
+ src/headers/daemon.h | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/src/headers/daemon.h b/src/headers/daemon.h
+index a8936ad..24a1a97 100644
+--- a/src/headers/daemon.h
++++ b/src/headers/daemon.h
+@@ -180,7 +180,7 @@ extern struct mouse_features  mouse_table[3],
+ extern Gpm_Type         mice[];
+ extern Gpm_Type         *repeated_type;
+ 
+-time_t                  last_selection_time;
++extern time_t           last_selection_time;
+ 
+ 
+ 
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/gpm.git/commitdiff/027fb8e910bdb5d2826dfd5627cdf70bca9f68f8



More information about the pld-cvs-commit mailing list