Skip to contentSkip to conversation

package/gpm: fix build failure with gcc 10

PATCH New Heiko Thiery 2 participants 2 messages Jul 16, 2020

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 package/gpm: fix build failure with gcc 10

Add a patch from upstream [1] to fix -fno-common build failure

[1] https://github.com/telmich/gpm/commit/f04f24dd5ca5c1c13608b144ab66e2ccd47f106a

---
 ...on.h-avoid-redefinition-of-last_sele.patch | 42 +++++++++++++++++++
 1 file changed, 42 insertions(+)
 create mode 100644 package/gpm/0006-src-headers-daemon.h-avoid-redefinition-of-last_sele.patch
package/gpm/0006-src-headers-daemon.h-avoid-redefinition-of-last_sele.patch new file +42 -0
new file mode 100644
index 0000000000..d976834a0d
@@ -0,0 +1,42 @@
+From f04f24dd5ca5c1c13608b144ab66e2ccd47f106a Mon Sep 17 00:00:00 2001
+From: Sergei Trofimovich <[email protected]>
+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 <[email protected]>
+---
+ 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;
+ 
+ 
+ 
+-- 
+2.20.1
+
Signature · 1 line
2.20.1
#1 lore raw

PATCH 1/1 package/gpm: fix build failure with gcc 10

Quoted 9 lines · On Thu, 16 Jul 2020 20:45:27 +0200 Heiko Thiery <[email protected]> wrote:

Add a patch from upstream [1] to fix -fno-common build failure

[1] https://github.com/telmich/gpm/commit/f04f24dd5ca5c1c13608b144ab66e2ccd47f106a

---
 ...on.h-avoid-redefinition-of-last_sele.patch | 42 +++++++++++++++++++
 1 file changed, 42 insertions(+)
 create mode 100644 package/gpm/0006-src-headers-daemon.h-avoid-redefinition-of-last_sele.patch

Applied to master, thanks.

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com