Skip to contentSkip to conversation

package/x11vnc: Fix multiple symbol definition error

PATCH In review Ralf Dragon 2 participants 2 messages Oct 4, 2024 – Nov 8, 2024

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 package/x11vnc: Fix multiple symbol definition error

Error seems to happen if LIBVNCSERVER_HAVE_LIBPTHREAD is defined:
/bin/ld: x11vnc-xwrappers.o:(.bss+0x494): multiple definition of `clientMutex'; x11vnc-8to24.o:(.bss+0x59600): first defined here

Patch is from https://bugs.gentoo.org/706840 . It moves the implementation from header to a source file, thus avoiding multiple definitions.

---
Backport to: 2024.02.x

---
 .../x11vnc/0003-Fix-multi-definition.patch    | 45 +++++++++++++++++++
 1 file changed, 45 insertions(+)
 create mode 100644 package/x11vnc/0003-Fix-multi-definition.patch
package/x11vnc/0003-Fix-multi-definition.patch new file +45 -0
new file mode 100644
index 0000000000..504159efe9
@@ -0,0 +1,45 @@
+From a48b0b1cd887d7f3ae67f525d7d334bd2feffe60 Mon Sep 17 00:00:00 2001
+From: Alexander Tsoy <[email protected]>
+Date: Tue, 28 Jan 2020 22:21:01 +0300
+Subject: [PATCH] Fix build with -fno-common
+
+GCC 10 defaults to -fno-common
+---
+ src/util.c | 3 +++
+ src/util.h | 6 +++---
+ 2 files changed, 6 insertions(+), 3 deletions(-)
+
+diff --git a/src/util.c b/src/util.c
+index a82a1a4..6a52ebf 100644
+--- a/src/util.c
++++ b/src/util.c
+@@ -47,6 +47,9 @@ int hxl = 0;
+ #ifdef LIBVNCSERVER_HAVE_LIBPTHREAD
+ MUTEX(x11Mutex);
+ MUTEX(scrollMutex);
++MUTEX(clientMutex);
++MUTEX(inputMutex);
++MUTEX(pointerMutex);
+ #endif
+ 
+ int nfix(int i, int n);
+diff --git a/src/util.h b/src/util.h
+index 35c1afd..99b5dd1 100644
+--- a/src/util.h
++++ b/src/util.h
+@@ -102,9 +102,9 @@ extern struct timeval _mysleep;
+ #ifdef LIBVNCSERVER_HAVE_LIBPTHREAD
+ extern MUTEX(x11Mutex);
+ extern MUTEX(scrollMutex);
+-MUTEX(clientMutex);
+-MUTEX(inputMutex);
+-MUTEX(pointerMutex);
++extern MUTEX(clientMutex);
++extern MUTEX(inputMutex);
++extern MUTEX(pointerMutex);
+ #endif
+ 
+ #define X_INIT INIT_MUTEX(x11Mutex)
+-- 
+2.24.1
+
Signature · 6 lines
2.39.5

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#1 lore raw

Hi Ralf,

Thanks for the patch!

For info, I applied a similar patch:
https://gitlab.com/buildroot.org/buildroot/-/commit/e5bb457d5d703aa327354236729dff1f261348ac
It was adding the "Upstream:" tags.

Quoted 70 lines · Ralf Dragon

Error seems to happen if LIBVNCSERVER_HAVE_LIBPTHREAD is defined:
/bin/ld: x11vnc-xwrappers.o:(.bss+0x494): multiple definition of `clientMutex'; x11vnc-8to24.o:(.bss+0x59600): first defined here

Patch is from https://bugs.gentoo.org/706840 . It moves the implementation from header to a source file, thus avoiding multiple definitions.

---
Backport to: 2024.02.x

---
 .../x11vnc/0003-Fix-multi-definition.patch    | 45 +++++++++++++++++++
 1 file changed, 45 insertions(+)
 create mode 100644 package/x11vnc/0003-Fix-multi-definition.patch
package/x11vnc/0003-Fix-multi-definition.patch new file +45 -1
new file mode 100644
index 0000000000..504159efe9
@@ -0,0 +1,45 @@
+From a48b0b1cd887d7f3ae67f525d7d334bd2feffe60 Mon Sep 17 00:00:00 2001
+From: Alexander Tsoy <[email protected]>
+Date: Tue, 28 Jan 2020 22:21:01 +0300
+Subject: [PATCH] Fix build with -fno-common
+
+GCC 10 defaults to -fno-common
+---
+ src/util.c | 3 +++
+ src/util.h | 6 +++---
+ 2 files changed, 6 insertions(+), 3 deletions(-)
+
+diff --git a/src/util.c b/src/util.c
+index a82a1a4..6a52ebf 100644
+--- a/src/util.c
++++ b/src/util.c
+@@ -47,6 +47,9 @@ int hxl = 0;
+ #ifdef LIBVNCSERVER_HAVE_LIBPTHREAD
+ MUTEX(x11Mutex);
+ MUTEX(scrollMutex);
++MUTEX(clientMutex);
++MUTEX(inputMutex);
++MUTEX(pointerMutex);
+ #endif
+
+ int nfix(int i, int n);
+diff --git a/src/util.h b/src/util.h
+index 35c1afd..99b5dd1 100644
+--- a/src/util.h
++++ b/src/util.h
+@@ -102,9 +102,9 @@ extern struct timeval _mysleep;
+ #ifdef LIBVNCSERVER_HAVE_LIBPTHREAD
+ extern MUTEX(x11Mutex);
+ extern MUTEX(scrollMutex);
+-MUTEX(clientMutex);
+-MUTEX(inputMutex);
+-MUTEX(pointerMutex);
++extern MUTEX(clientMutex);
++extern MUTEX(inputMutex);
++extern MUTEX(pointerMutex);
+ #endif
+
+ #define X_INIT INIT_MUTEX(x11Mutex)
+--
+2.24.1
+
--

2.39.5

Quoted 4 lines

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

Best regards,

Julien.
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot