Skip to contentSkip to conversation

libv4l: fix qv4l2 libatomic related compile failure

RFC In review Peter Seiderer 3 participants 5 messages Feb 3, 2018 – Feb 4, 2019

lore
Share & tools
lore
#0 lore raw

RFC 1/1 libv4l: fix qv4l2 libatomic related compile failure

Fixes [1]:

sparc-buildroot-linux-uclibc/bin/ld: qv4l2-qv4l2.o: undefined reference to symbol '__atomic_fetch_add_4@@LIBATOMIC_1.0'

[1] http://autobuild.buildroot.net/results/baa2595e1acdf4e795fbb940ca57fd136c827da3

---
Patch fixes the qv4l2 linking problem for sparc, but adds a libatomic dependency to all v4l libraries. Any better suggestions to add libatomic linking only to utils/qv4l2?

---
 .../0003-configure.ac-check-for-libatomic.patch    | 30 ++++++++++++++++++++++
 package/libv4l/libv4l.mk                           |  5 ++++
 2 files changed, 35 insertions(+)
 create mode 100644 package/libv4l/0003-configure.ac-check-for-libatomic.patch
package/libv4l/0003-configure.ac-check-for-libatomic.patch new file +30 -0
new file mode 100644
index 0000000000..78aaada653
@@ -0,0 +1,30 @@
+From 87978992fbcba13550e900fbe9abb2a60be98bf4 Mon Sep 17 00:00:00 2001
+From: Peter Seiderer <[email protected]>
+Date: Sun, 4 Feb 2018 00:08:45 +0100
+Subject: [PATCH] configure.ac: check for libatomic
+
+Fixes:
+
+  .../sparc-buildroot-linux-uclibc/bin/ld: qv4l2-qv4l2.o: undefined reference to symbol '__atomic_fetch_add_4@@LIBATOMIC_1.0'
+
+Signed-off-by: Peter Seiderer <[email protected]>
+---
+ configure.ac | 2 ++
+ 1 file changed, 2 insertions(+)
+
+diff --git a/configure.ac b/configure.ac
+index dc1e9cbf..65a3caaa 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -279,6 +279,8 @@ AS_IF([test x$enable_shared != xno],
+ 		   [have_pthread=no])],
+ 	[have_pthread=no])
+ 
++AC_SEARCH_LIBS([__atomic_load_4], [atomic])
++
+ # The dlopen() function is in the C library for *BSD and in
+ # libdl on GLIBC-based systems
+ 
+-- 
+2.16.1
+
package/libv4l/libv4l.mk +5 -0
index 11061306c7..bc9b5c9abd 100644
@@ -11,6 +11,11 @@ LIBV4L_INSTALL_STAGING = YES
 LIBV4L_DEPENDENCIES = host-pkgconf
 LIBV4L_CONF_OPTS = --disable-doxygen-doc
 
+# patch 0003-configure.ac-check-for-libatomic.patch touches configure.ac
+LIBV4L_AUTORECONF = YES
+# host-gettext needed for autoreconf to work
+LIBV4L_DEPENDENCIES += host-gettext
+
 # fix uclibc-ng configure/compile
 LIBV4L_CONF_ENV = ac_cv_prog_cc_c99='-std=gnu99'
 
Signature · 1 line
2.16.1
#1 lore raw

Hello,

Quoted 5 lines · Peter Seiderer

Fixes [1]:

sparc-buildroot-linux-uclibc/bin/ld: qv4l2-qv4l2.o: undefined reference to symbol '__atomic_fetch_add_4@@LIBATOMIC_1.0'

[1] http://autobuild.buildroot.net/results/baa2595e1acdf4e795fbb940ca57fd136c827da3

Did you analyze what part of the code is using atomic intrinsics? I don't see any use of atomic instrisics in qv4l2 itself (but perhaps I missed them), so they must be somewhere else.

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
http://bootlin.com
#2 lore raw

Hello Thomas,

Quoted 5 lines · Thomas Petazzoni

Hello,

Quoted 2 lines · Peter Seiderer

Fixes [1]:

Quoted 7 lines
Quoted 3 lines

sparc-buildroot-linux-uclibc/bin/ld: qv4l2-qv4l2.o: undefined reference to symbol '__atomic_fetch_add_4@@LIBATOMIC_1.0'

[1] http://autobuild.buildroot.net/results/baa2595e1acdf4e795fbb940ca57fd136c827da3

Did you analyze what part of the code is using atomic intrinsics? I don't see any use of atomic instrisics in qv4l2 itself (but perhaps I missed them), so they must be somewhere else.

The atomic usage comes from the Qt5 libraries (libQt5Core.so, libQt5Gui.so and libQt5Widgets.so)...

Regards,
Peter

Quoted 2 lines

Thomas

#3 lore raw

Hello,

Quoted 6 lines · Peter Seiderer
Quoted 6 lines · Peter Seiderer
Quoted 4 lines

Fixes [1]:

sparc-buildroot-linux-uclibc/bin/ld: qv4l2-qv4l2.o: undefined reference to symbol '__atomic_fetch_add_4@@LIBATOMIC_1.0'

Quoted 8 lines
Quoted 5 lines
Quoted 1 line

[1] http://autobuild.buildroot.net/results/baa2595e1acdf4e795fbb940ca57fd136c827da3

Did you analyze what part of the code is using atomic intrinsics? I don't see any use of atomic instrisics in qv4l2 itself (but perhaps I missed them), so they must be somewhere else.

The atomic usage comes from the Qt5 libraries (libQt5Core.so, libQt5Gui.so and libQt5Widgets.so)...

Isn't Qt installing some .pc files ? Are they being used by libv4l ? If so, are these .pc files referencing libatomic ?

Thomas

Signature · 3 lines
Thomas Petazzoni, CTO, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
http://bootlin.com
#4 lore raw

Peter, All,

On 2018-02-12 21:19 +0100, Thomas Petazzoni spake thusly:

Quoted 12 lines · Peter Seiderer
Quoted 11 lines
Quoted 10 lines · Peter Seiderer
Quoted 5 lines

Fixes [1]:

sparc-buildroot-linux-uclibc/bin/ld: qv4l2-qv4l2.o: undefined reference to symbol '__atomic_fetch_add_4@@LIBATOMIC_1.0'

[1] http://autobuild.buildroot.net/results/baa2595e1acdf4e795fbb940ca57fd136c827da3

Did you analyze what part of the code is using atomic intrinsics? I don't see any use of atomic instrisics in qv4l2 itself (but perhaps I missed them), so they must be somewhere else.

Quoted 5 lines
Quoted 2 lines

The atomic usage comes from the Qt5 libraries (libQt5Core.so, libQt5Gui.so and libQt5Widgets.so)...

Isn't Qt installing some .pc files ? Are they being used by libv4l ? If so, are these .pc files referencing libatomic ?

So, this 1 year old patch is still pending, and you did not reply to Thomas questiiiion about using the .pc files from Qt.

I've marked this patch as changes-requested in patchwork. If you believe something is still needed, can you please respin an updated patch that takes into account Thomas' comments.

Regards,
Yann E. MORIN.

Signature · 6 lines
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'