All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH 1/2] package/libv4l: fix musl build
@ 2019-10-30  6:53 Bernd Kuhls
  2019-10-30  6:53 ` [Buildroot] [PATCH 2/2] package/libv4l: link with libatomic when needed Bernd Kuhls
  2019-12-08 13:35 ` [Buildroot] [PATCH 1/2] package/libv4l: fix musl build Thomas Petazzoni
  0 siblings, 2 replies; 10+ messages in thread
From: Bernd Kuhls @ 2019-10-30  6:53 UTC (permalink / raw)
  To: buildroot

Fixes:
http://autobuild.buildroot.net/results/bf8/bf88f89bdb966ef54938e4274114d4afe5668b1f/

Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>
---
 ...d-missing-includes-to-fix-musl-build.patch | 68 +++++++++++++++++++
 1 file changed, 68 insertions(+)
 create mode 100644 package/libv4l/0001-keymap.h-add-missing-includes-to-fix-musl-build.patch

diff --git a/package/libv4l/0001-keymap.h-add-missing-includes-to-fix-musl-build.patch b/package/libv4l/0001-keymap.h-add-missing-includes-to-fix-musl-build.patch
new file mode 100644
index 0000000000..238f8fc377
--- /dev/null
+++ b/package/libv4l/0001-keymap.h-add-missing-includes-to-fix-musl-build.patch
@@ -0,0 +1,68 @@
+From baba68cdcb44fc11d0ba8ce2c13eb5b06bbd9b33 Mon Sep 17 00:00:00 2001
+From: Bernd Kuhls <bernd.kuhls@t-online.de>
+Date: Wed, 30 Oct 2019 07:15:23 +0100
+Subject: [PATCH] keymap.h: add missing includes to fix musl build
+
+Needed to fix these build errors:
+
+In file included from keymap.c:13:0:
+keymap.h:23:2: error: unknown type name 'u_int32_t'
+  u_int32_t scancode;
+
+keymap.h:36:1: error: unknown type name 'error_t'
+ error_t parse_keymap(char *fname, struct keymap **keymap, bool verbose);
+
+Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>
+---
+Patch was not sent upstream due to broken mailing list setup:
+
+<majordomo@vger.kernel.org>: host vger.kernel.org[209.132.180.67] said: 553
+    5.7.1 Hello [xx.xx.xx.xx], for your MAIL FROM address
+    <bernd.kuhls@t-online.de> policy analysis reported: Your address is not
+    liked source for email (in reply to MAIL FROM command)
+
+Hello [xx.xx.xx.xx], for your MAIL FROM address <berndkuhls@hotmail.com>
+ policy analysis reported: Your address is not liked source for email 
+
+ utils/common/keymap.h | 4 ++++
+ 1 file changed, 4 insertions(+)
+
+diff --git a/utils/common/keymap.h b/utils/common/keymap.h
+index f2b29632..bb1edce9 100644
+--- a/utils/common/keymap.h
++++ b/utils/common/keymap.h
+@@ -1,4 +1,8 @@
+ /* SPDX-License-Identifier: GPL-2.0 */
++
++#include <argp.h>
++#include <sys/types.h>
++
+ #ifndef __KEYMAP_H
+ #define __KEYMAP_H
+ 
+diff -uNr v4l-utils-1.18.0.orig/utils/ir-ctl/keymap.h v4l-utils-1.18.0/utils/ir-ctl/keymap.h
+--- v4l-utils-1.18.0.orig/utils/ir-ctl/keymap.h	2019-09-22 11:22:54.000000000 +0200
++++ v4l-utils-1.18.0/utils/ir-ctl/keymap.h	2019-10-30 07:06:18.250548011 +0100
+@@ -1,4 +1,8 @@
+ /* SPDX-License-Identifier: GPL-2.0 */
++
++#include <argp.h>
++#include <sys/types.h>
++
+ #ifndef __KEYMAP_H
+ #define __KEYMAP_H
+ 
+diff -uNr v4l-utils-1.18.0.orig/utils/keytable/keymap.h v4l-utils-1.18.0/utils/keytable/keymap.h
+--- v4l-utils-1.18.0.orig/utils/keytable/keymap.h	2019-09-22 11:22:54.000000000 +0200
++++ v4l-utils-1.18.0/utils/keytable/keymap.h	2019-10-30 07:06:56.218816126 +0100
+@@ -1,4 +1,8 @@
+ /* SPDX-License-Identifier: GPL-2.0 */
++
++#include <argp.h>
++#include <sys/types.h>
++
+ #ifndef __KEYMAP_H
+ #define __KEYMAP_H
+ 
+-- 
+2.20.1
-- 
2.20.1

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [Buildroot] [PATCH 2/2] package/libv4l: link with libatomic when needed
  2019-10-30  6:53 [Buildroot] [PATCH 1/2] package/libv4l: fix musl build Bernd Kuhls
@ 2019-10-30  6:53 ` Bernd Kuhls
  2019-10-30 10:30   ` Thomas Petazzoni
  2019-12-08 13:35 ` [Buildroot] [PATCH 1/2] package/libv4l: fix musl build Thomas Petazzoni
  1 sibling, 1 reply; 10+ messages in thread
From: Bernd Kuhls @ 2019-10-30  6:53 UTC (permalink / raw)
  To: buildroot

On some architectures, atomic operations are provided by the libatomic
library from gcc. Linking with libatomic is therefore necessary,
otherwise the build fails with:

/home/buildroot/autobuild/run/instance-1/output-1/host/opt/ext-toolchain/bin/../lib/gcc/sparc-buildroot-linux-uclibc/7.4.0/../../../../sparc-buildroot-linux-uclibc/bin/ld:
 qv4l2-qv4l2.o: undefined reference to symbol '__atomic_fetch_add_4@@LIBATOMIC_1.0'

This is often for example the case on sparcv8 32 bit.

Fixes:
http://autobuild.buildroot.net/results/089/08952dbf89bf3c49da7697943441cee411940420/

Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>
---
 package/libv4l/libv4l.mk | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/package/libv4l/libv4l.mk b/package/libv4l/libv4l.mk
index a3bf099221..3c58f98391 100644
--- a/package/libv4l/libv4l.mk
+++ b/package/libv4l/libv4l.mk
@@ -84,6 +84,11 @@ ifeq ($(BR2_PACKAGE_SDL2_IMAGE),y)
 LIBV4L_DEPENDENCIES += sdl2_image
 endif
 
+# Uses __atomic_fetch_add_4
+ifeq ($(BR2_TOOLCHAIN_HAS_LIBATOMIC),y)
+LIBV4L_LIBS += -latomic
+endif
+
 LIBV4L_CONF_ENV += LIBS="$(LIBV4L_LIBS)"
 
 $(eval $(autotools-package))
-- 
2.20.1

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [Buildroot] [PATCH 2/2] package/libv4l: link with libatomic when needed
  2019-10-30  6:53 ` [Buildroot] [PATCH 2/2] package/libv4l: link with libatomic when needed Bernd Kuhls
@ 2019-10-30 10:30   ` Thomas Petazzoni
  2019-10-30 22:26     ` Peter Seiderer
  0 siblings, 1 reply; 10+ messages in thread
From: Thomas Petazzoni @ 2019-10-30 10:30 UTC (permalink / raw)
  To: buildroot

On Wed, 30 Oct 2019 07:53:03 +0100
Bernd Kuhls <bernd.kuhls@t-online.de> wrote:

> On some architectures, atomic operations are provided by the libatomic
> library from gcc. Linking with libatomic is therefore necessary,
> otherwise the build fails with:
> 
> /home/buildroot/autobuild/run/instance-1/output-1/host/opt/ext-toolchain/bin/../lib/gcc/sparc-buildroot-linux-uclibc/7.4.0/../../../../sparc-buildroot-linux-uclibc/bin/ld:
>  qv4l2-qv4l2.o: undefined reference to symbol '__atomic_fetch_add_4@@LIBATOMIC_1.0'
> 
> This is often for example the case on sparcv8 32 bit.
> 
> Fixes:
> http://autobuild.buildroot.net/results/089/08952dbf89bf3c49da7697943441cee411940420/

The LIBV4L_AUTORECONF = YES that was kept in
d0f3c9de49bfe3f8ac6e75a706540eefcc1afc07 was intended to fix this
libatomic linking issue, so I'm a bit confused.

Could you discuss this with Peter Seiderer (in Cc) ?

Thanks,

Thomas
-- 
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Buildroot] [PATCH 2/2] package/libv4l: link with libatomic when needed
  2019-10-30 10:30   ` Thomas Petazzoni
@ 2019-10-30 22:26     ` Peter Seiderer
  2019-11-20 14:46       ` Thomas Preston
  0 siblings, 1 reply; 10+ messages in thread
From: Peter Seiderer @ 2019-10-30 22:26 UTC (permalink / raw)
  To: buildroot

Hello *,

On Wed, 30 Oct 2019 11:30:40 +0100, Thomas Petazzoni <thomas.petazzoni@bootlin.com> wrote:

> On Wed, 30 Oct 2019 07:53:03 +0100
> Bernd Kuhls <bernd.kuhls@t-online.de> wrote:
>
> > On some architectures, atomic operations are provided by the libatomic
> > library from gcc. Linking with libatomic is therefore necessary,
> > otherwise the build fails with:
> >
> > /home/buildroot/autobuild/run/instance-1/output-1/host/opt/ext-toolchain/bin/../lib/gcc/sparc-buildroot-linux-uclibc/7.4.0/../../../../sparc-buildroot-linux-uclibc/bin/ld:
> >  qv4l2-qv4l2.o: undefined reference to symbol '__atomic_fetch_add_4@@LIBATOMIC_1.0'
> >
> > This is often for example the case on sparcv8 32 bit.
> >
> > Fixes:
> > http://autobuild.buildroot.net/results/089/08952dbf89bf3c49da7697943441cee411940420/
>
> The LIBV4L_AUTORECONF = YES that was kept in
> d0f3c9de49bfe3f8ac6e75a706540eefcc1afc07 was intended to fix this
> libatomic linking issue, so I'm a bit confused.

Strange, this worked (when tested 3./4. October)..., now with buildroot master
I can reproduce the libatomic link failure even with the 'LIBV4L_AUTORECONF = YES'...

The working version link command (and output) was (and clearly using the *.la files):

/bin/sh ../../libtool  --tag=CXX   --mode=link /home/seiderer/Work/Buildroot/build_sparc_qt5multimedia_001/host/bin/sparc-linux-g++  -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64  -Os   -std=c++11 -L/home/seiderer/Work/Buildroot/build_sparc_qt5multimedia_001/host/bin/../sparc-buildroot-linux-uclibc/sysroot/usr/lib -lQt5Widgets -lQt5Gui -lQt5Core  -L/home/seiderer/Work/Buildroot/build_sparc_qt5multimedia_001/host/bin/../sparc-buildroot-linux-uclibc/sysroot/usr/lib -lasound  -pthread  -o qv4l2 qv4l2-qv4l2.o qv4l2-general-tab.o qv4l2-ctrl-tab.o qv4l2-vbi-tab.o qv4l2-capture-win.o qv4l2-tpg-tab.o qv4l2-capture-win-qt.o qv4l2-capture-win-gl.o qv4l2-alsa_stream.o qv4l2-raw2sliced.o qv4l2-v4l2-tpg-core.o qv4l2-v4l2-tpg-colors.o qv4l2-moc_qv4l2.o qv4l2-moc_general-tab.o qv4l2-moc_capture-win.o qv4l2-moc_vbi-tab.o qv4l2-qrc_qv4l2.o ../../lib/libv4l2/libv4l2.la ../../lib/libv4lconvert/libv4lconvert.la ../libv4l2util/libv4l2util.la ../libmedia_dev/libmedia_dev.la -largp
libtool: warning: library '/home/seiderer/Work/Buildroot/build_sparc_qt5multimedia_001/host/bin/../sparc-buildroot-linux-uclibc/sysroot/usr/lib/libQt5Widgets.la' was moved.
libtool: warning: library '/home/seiderer/Work/Buildroot/build_sparc_qt5multimedia_001/host/bin/../sparc-buildroot-linux-uclibc/sysroot/usr/lib/libQt5Gui.la' was moved.
libtool: warning: library '/home/seiderer/Work/Buildroot/build_sparc_qt5multimedia_001/host/bin/../sparc-buildroot-linux-uclibc/sysroot/usr/lib/libQt5Gui.la' was moved.
libtool: warning: library '/home/seiderer/Work/Buildroot/build_sparc_qt5multimedia_001/host/bin/../sparc-buildroot-linux-uclibc/sysroot/usr/lib/libQt5Core.la' was moved.
libtool: warning: library '/home/seiderer/Work/Buildroot/build_sparc_qt5multimedia_001/host/bin/../sparc-buildroot-linux-uclibc/sysroot/usr/lib/libQt5Core.la' was moved.
libtool: warning: library '/home/seiderer/Work/Buildroot/build_sparc_qt5multimedia_001/host/bin/../sparc-buildroot-linux-uclibc/sysroot/usr/lib/libQt5Widgets.la' was moved.
libtool: warning: library '/home/seiderer/Work/Buildroot/build_sparc_qt5multimedia_001/host/bin/../sparc-buildroot-linux-uclibc/sysroot/usr/lib/libQt5Gui.la' was moved.
libtool: warning: library '/home/seiderer/Work/Buildroot/build_sparc_qt5multimedia_001/host/bin/../sparc-buildroot-linux-uclibc/sysroot/usr/lib/libQt5Gui.la' was moved.
libtool: warning: library '/home/seiderer/Work/Buildroot/build_sparc_qt5multimedia_001/host/bin/../sparc-buildroot-linux-uclibc/sysroot/usr/lib/libQt5Core.la' was moved.
libtool: warning: library '/home/seiderer/Work/Buildroot/build_sparc_qt5multimedia_001/host/bin/../sparc-buildroot-linux-uclibc/sysroot/usr/lib/libQt5Core.la' was moved.
libtool: link: /home/seiderer/Work/Buildroot/build_sparc_qt5multimedia_001/host/bin/sparc-linux-g++ -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -Os -std=c++11 -pthread -o qv4l2 qv4l2-qv4l2.o qv4l2-general-tab.o qv4l2-ctrl-tab.o qv4l2-vbi-tab.o qv4l2-capture-win.o qv4l2-tpg-tab.o qv4l2-capture-win-qt.o qv4l2-capture-win-gl.o qv4l2-alsa_stream.o qv4l2-raw2sliced.o qv4l2-v4l2-tpg-core.o qv4l2-v4l2-tpg-colors.o qv4l2-moc_qv4l2.o qv4l2-moc_general-tab.o qv4l2-moc_capture-win.o qv4l2-moc_vbi-tab.o qv4l2-qrc_qv4l2.o  -L/home/seiderer/Work/Buildroot/build_sparc_qt5multimedia_001/host/bin/../sparc-buildroot-linux-uclibc/sysroot/usr/lib /home/seiderer/Work/Buildroot/build_sparc_qt5multimedia_001/host/bin/../sparc-buildroot-linux-uclibc/sysroot/usr/lib/libQt5Widgets.so /home/seiderer/Work/Buildroot/build_sparc_qt5multimedia_001/host/bin/../sparc-buildroot-linux-uclibc/sysroot/usr/lib/libQt5Gui.so /home/seiderer/Work/Buildroot/build_sparc_qt5multimedia_001/host/bin/../sparc-buildroot-linux-uclibc/sysroot/usr/lib/libQt5Core.so -latomic /home/seiderer/Work/Buildroot/build_sparc_qt5multimedia_001/host/sparc-buildroot-linux-uclibc/sysroot/usr/lib/libasound.so -ldl ../../lib/libv4l2/.libs/libv4l2.so -lpthread /home/seiderer/Work/Buildroot/build_sparc_qt5multimedia_001/build/libv4l-1.18.0/lib/libv4lconvert/.libs/libv4lconvert.so ../../lib/libv4lconvert/.libs/libv4lconvert.so -lrt -lm /home/seiderer/Work/Buildroot/build_sparc_qt5multimedia_001/host/sparc-buildroot-linux-uclibc/sysroot/usr/lib/libjpeg.so ../libv4l2util/.libs/libv4l2util.a ../libmedia_dev/.libs/libmedia_dev.a -largp -pthread -Wl,-rpath -Wl,/home/seiderer/Work/Buildroot/build_sparc_qt5multimedia_001/host/bin/../sparc-buildroot-linux-uclibc/sysroot/usr/lib -Wl,-rpath -Wl,/home/seiderer/Work/Buildroot/build_sparc_qt5multimedia_001/host/sparc-buildroot-linux-uclibc/sysroot/usr/lib -Wl,-rpath -Wl,/home/seiderer/Work/Buildroot/build_sparc_qt5multimedia_001/build/libv4l-1.18.0/lib/libv4l2/.libs -Wl,-rpath -Wl,/home/seiderer/Work/Buildroot/build_sparc_qt5multimedia_001/build/libv4l-1.18.0/lib/libv4lconvert/.libs -Wl,-rpath -Wl,/home/seiderer/Work/Buildroot/build_sparc_qt5multimedia_001/host/bin/../sparc-buildroot-linux-uclibc/sysroot/usr/lib -Wl,-rpath -Wl,/home/seiderer/Work/Buildroot/build_sparc_qt5multimedia_001/host/sparc-buildroot-linux-uclibc/sysroot/usr/lib

The actual/failing link command looks like the following:

/bin/sh ../../libtool  --tag=CXX   --mode=link /home/seiderer/Work/Buildroot/build_sparc_qt5multimedia_001/host/bin/sparc-linux-g++  -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64  -Os   -std=c++11 -lQt5Widgets -lQt5Gui -lQt5Core  -lasound  -pthread  -o qv4l2 qv4l2-qv4l2.o qv4l2-general-tab.o qv4l2-ctrl-tab.o qv4l2-vbi-tab.o qv4l2-capture-win.o qv4l2-tpg-tab.o qv4l2-capture-win-qt.o qv4l2-capture-win-gl.o qv4l2-alsa_stream.o qv4l2-raw2sliced.o qv4l2-v4l2-tpg-core.o qv4l2-v4l2-tpg-colors.o qv4l2-moc_qv4l2.o qv4l2-moc_general-tab.o qv4l2-moc_capture-win.o qv4l2-moc_vbi-tab.o qv4l2-qrc_qv4l2.o ../../lib/libv4l2/libv4l2.la ../../lib/libv4lconvert/libv4lconvert.la ../libv4l2util/libv4l2util.la ../libmedia_dev/libmedia_dev.la -largp
libtool: link: /home/seiderer/Work/Buildroot/build_sparc_qt5multimedia_001/host/bin/sparc-linux-g++ -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64 -Os -std=c++11 -pthread -o qv4l2 qv4l2-qv4l2.o qv4l2-general-tab.o qv4l2-ctrl-tab.o qv4l2-vbi-tab.o qv4l2-capture-win.o qv4l2-tpg-tab.o qv4l2-capture-win-qt.o qv4l2-capture-win-gl.o qv4l2-alsa_stream.o qv4l2-raw2sliced.o qv4l2-v4l2-tpg-core.o qv4l2-v4l2-tpg-colors.o qv4l2-moc_qv4l2.o qv4l2-moc_general-tab.o qv4l2-moc_capture-win.o qv4l2-moc_vbi-tab.o qv4l2-qrc_qv4l2.o  -lQt5Widgets -lQt5Gui -lQt5Core -lasound ../../lib/libv4l2/.libs/libv4l2.so -lpthread /home/seiderer/Work/Buildroot/build_sparc_qt5multimedia_001/build/libv4l-1.18.0/lib/libv4lconvert/.libs/libv4lconvert.so ../../lib/libv4lconvert/.libs/libv4lconvert.so -lrt -lm -ljpeg ../libv4l2util/.libs/libv4l2util.a ../libmedia_dev/.libs/libmedia_dev.a -largp -pthread -Wl,-rpath -Wl,/home/seiderer/Work/Buildroot/build_sparc_qt5multimedia_001/build/libv4l-1.18.0/lib/libv4l2/.libs -Wl,-rpath -Wl,/home/seiderer/Work/Buildroot/build_sparc_qt5multimedia_001/build/libv4l-1.18.0/lib/libv4lconvert/.libs
/home/seiderer/Work/Buildroot/build_sparc_qt5multimedia_001/host/opt/ext-toolchain/bin/../lib/gcc/sparc-buildroot-linux-uclibc/7.4.0/../../../../sparc-buildroot-linux-uclibc/bin/ld: qv4l2-qv4l2.o: undefined reference to symbol '__atomic_fetch_add_4@@LIBATOMIC_1.0'
/home/seiderer/Work/Buildroot/build_sparc_qt5multimedia_001/host/opt/ext-toolchain/bin/../lib/gcc/sparc-buildroot-linux-uclibc/7.4.0/../../../../sparc-buildroot-linux-uclibc/bin/ld: /home/seiderer/Work/Buildroot/build_sparc_qt5multimedia_001/host/sparc-buildroot-linux-uclibc/sysroot/lib/libatomic.so.1: error adding symbols: DSO missing from command line

And is not using the Qt5 *.la files (checked using strace)...

Adding the (missing?) '-L/home/seiderer/Work/Buildroot/build_sparc_qt5multimedia_001/host/bin/../sparc-buildroot-linux-uclibc/sysroot/usr/lib'
libtool command line parameter fixes the linking for the actual build...

Any hint which (buildroot?) change triggered the remove of the link/library path removal?

Regards,
Peter

>
> Could you discuss this with Peter Seiderer (in Cc) ?
>
> Thanks,
>
> Thomas

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Buildroot] [PATCH 2/2] package/libv4l: link with libatomic when needed
  2019-10-30 22:26     ` Peter Seiderer
@ 2019-11-20 14:46       ` Thomas Preston
  2019-11-20 19:44         ` Peter Seiderer
  0 siblings, 1 reply; 10+ messages in thread
From: Thomas Preston @ 2019-11-20 14:46 UTC (permalink / raw)
  To: buildroot

Hey,

On 30/10/2019 22:26, Peter Seiderer wrote:
> Adding the (missing?) '-L/home/seiderer/Work/Buildroot/build_sparc_qt5multimedia_001/host/bin/../sparc-buildroot-linux-uclibc/sysroot/usr/lib'
> libtool command line parameter fixes the linking for the actual build...
> 
> Any hint which (buildroot?) change triggered the remove of the link/library path removal?
> 

As previously discussed [0], the missing `-L..` is because pkgconf no longer
returns "system" include or library directories with -I and -L  (see [1]).
These are already in the compiler's default search path and were causing
include-order related bugs when using -isystem.

However, it looks like that change has caused a problem here, where the output
from pkgconf is being passed to libtool to point it at the "system" library
directory in the sysroot.

I don't know enough about libtool yet, but I think there are a few ways around
this:
1. Tell libtool where the sysroot is by some other mechanism
2. Tell pkgconf that we want to keep the system lib directories, when it is
   used to create arguments to libtool. The following argument will always 
   return -L, as expected above:

        pkg-config --keep-system-libs

I'm looking into this, but someone with a more intimate knowledge of libtool +
pkg-autotools.mk, might be able to help here.

Thanks,
Thomas Preston

[0] http://lists.busybox.net/pipermail/buildroot/2019-November/266369.html
[1] http://lists.busybox.net/pipermail/buildroot/2019-October/263178.html

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Buildroot] [PATCH 2/2] package/libv4l: link with libatomic when needed
  2019-11-20 14:46       ` Thomas Preston
@ 2019-11-20 19:44         ` Peter Seiderer
  2019-11-21 11:33           ` Thomas Preston
  2019-11-21 16:46           ` Thomas Preston
  0 siblings, 2 replies; 10+ messages in thread
From: Peter Seiderer @ 2019-11-20 19:44 UTC (permalink / raw)
  To: buildroot

Hello *,

On Wed, 20 Nov 2019 14:46:03 +0000, Thomas Preston <thomas.preston@codethink.co.uk> wrote:

> Hey,
>
> On 30/10/2019 22:26, Peter Seiderer wrote:
> > Adding the (missing?) '-L/home/seiderer/Work/Buildroot/build_sparc_qt5multimedia_001/host/bin/../sparc-buildroot-linux-uclibc/sysroot/usr/lib'
> > libtool command line parameter fixes the linking for the actual build...
> >
> > Any hint which (buildroot?) change triggered the remove of the link/library path removal?
> >
>
> As previously discussed [0], the missing `-L..` is because pkgconf no longer
> returns "system" include or library directories with -I and -L  (see [1]).
> These are already in the compiler's default search path and were causing
> include-order related bugs when using -isystem.
>
> However, it looks like that change has caused a problem here, where the output
> from pkgconf is being passed to libtool to point it at the "system" library
> directory in the sysroot.
>
> I don't know enough about libtool yet, but I think there are a few ways around
> this:
> 1. Tell libtool where the sysroot is by some other mechanism
> 2. Tell pkgconf that we want to keep the system lib directories, when it is
>    used to create arguments to libtool. The following argument will always
>    return -L, as expected above:
>
>         pkg-config --keep-system-libs

The libv4l/libatomic case can be fixed by the following (hack):

diff --git a/package/libv4l/libv4l.mk b/package/libv4l/libv4l.mk
index a3bf099221..46c1ab9a48 100644
--- a/package/libv4l/libv4l.mk
+++ b/package/libv4l/libv4l.mk
@@ -16,7 +16,7 @@ LIBV4L_AUTORECONF = YES
 LIBV4L_DEPENDENCIES += host-gettext

 # fix uclibc-ng configure/compile
-LIBV4L_CONF_ENV = ac_cv_prog_cc_c99='-std=gnu99'
+LIBV4L_CONF_ENV = ac_cv_prog_cc_c99='-std=gnu99' PKG_CONFIG_SYSROOT_DIR=$(STAGING_DIR)

 # v4l-utils components have different licences, see v4l-utils.spec for details
 LIBV4L_LICENSE = GPL-2.0+ (utilities), LGPL-2.1+ (libraries)

Regards,
Peter

>
> I'm looking into this, but someone with a more intimate knowledge of libtool +
> pkg-autotools.mk, might be able to help here.
>
> Thanks,
> Thomas Preston
>
> [0] http://lists.busybox.net/pipermail/buildroot/2019-November/266369.html
> [1] http://lists.busybox.net/pipermail/buildroot/2019-October/263178.html
>

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [Buildroot] [PATCH 2/2] package/libv4l: link with libatomic when needed
  2019-11-20 19:44         ` Peter Seiderer
@ 2019-11-21 11:33           ` Thomas Preston
  2019-11-21 16:46           ` Thomas Preston
  1 sibling, 0 replies; 10+ messages in thread
From: Thomas Preston @ 2019-11-21 11:33 UTC (permalink / raw)
  To: buildroot

On 20/11/2019 19:44, Peter Seiderer wrote:
> The libv4l/libatomic case can be fixed by the following (hack):
> 
> diff --git a/package/libv4l/libv4l.mk b/package/libv4l/libv4l.mk
> index a3bf099221..46c1ab9a48 100644
> --- a/package/libv4l/libv4l.mk
> +++ b/package/libv4l/libv4l.mk
> @@ -16,7 +16,7 @@ LIBV4L_AUTORECONF = YES
>  LIBV4L_DEPENDENCIES += host-gettext
> 
>  # fix uclibc-ng configure/compile
> -LIBV4L_CONF_ENV = ac_cv_prog_cc_c99='-std=gnu99'
> +LIBV4L_CONF_ENV = ac_cv_prog_cc_c99='-std=gnu99' PKG_CONFIG_SYSROOT_DIR=$(STAGING_DIR)
> 
>  # v4l-utils components have different licences, see v4l-utils.spec for details
>  LIBV4L_LICENSE = GPL-2.0+ (utilities), LGPL-2.1+ (libraries)
> 

`PKG_CONFIG_SYSROOT_DIR=$(STAGING_DIR)` should already be set when we
use the PKG_CONFIG="$(PKG_CONFIG_HOST_BINARY)". Which is set in
TARGET_CONFIGURE_ENV.

Presumably setting PKG_CONFIG_SYSROOT_DIR here causes the system-libs
`-L` flag to return, but I'm not sure why.

I'm building with the failing defconfig [0] to try and reproduce and
investigate this.

Thanks

[0] http://autobuild.buildroot.net/results/089/08952dbf89bf3c49da7697943441cee411940420/defconfig

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Buildroot] [PATCH 2/2] package/libv4l: link with libatomic when needed
  2019-11-20 19:44         ` Peter Seiderer
  2019-11-21 11:33           ` Thomas Preston
@ 2019-11-21 16:46           ` Thomas Preston
  1 sibling, 0 replies; 10+ messages in thread
From: Thomas Preston @ 2019-11-21 16:46 UTC (permalink / raw)
  To: buildroot

On 20/11/2019 19:44, Peter Seiderer wrote:
> On Wed, 20 Nov 2019 14:46:03 +0000, Thomas Preston <thomas.preston@codethink.co.uk> wrote:
>> On 30/10/2019 22:26, Peter Seiderer wrote:
>>> Adding the (missing?) '-L/home/seiderer/Work/Buildroot/build_sparc_qt5multimedia_001/host/bin/../sparc-buildroot-linux-uclibc/sysroot/usr/lib'
>>> libtool command line parameter fixes the linking for the actual build...
>>>
>>> Any hint which (buildroot?) change triggered the remove of the link/library path removal?
>>>
>>
>> As previously discussed [0], the missing `-L..` is because pkgconf no longer
>> returns "system" include or library directories with -I and -L  (see [1]).
>> These are already in the compiler's default search path and were causing
>> include-order related bugs when using -isystem.
>>
>> However, it looks like that change has caused a problem here, where the output
>> from pkgconf is being passed to libtool to point it at the "system" library
>> directory in the sysroot.
>>
>> I don't know enough about libtool yet, but I think there are a few ways around
>> this:
>> 1. Tell libtool where the sysroot is by some other mechanism
>> 2. Tell pkgconf that we want to keep the system lib directories, when it is
>>    used to create arguments to libtool. The following argument will always
>>    return -L, as expected above:
>>
>>         pkg-config --keep-system-libs
> 
> The libv4l/libatomic case can be fixed by the following (hack):
> 
> diff --git a/package/libv4l/libv4l.mk b/package/libv4l/libv4l.mk
> index a3bf099221..46c1ab9a48 100644
> --- a/package/libv4l/libv4l.mk
> +++ b/package/libv4l/libv4l.mk
> @@ -16,7 +16,7 @@ LIBV4L_AUTORECONF = YES
>  LIBV4L_DEPENDENCIES += host-gettext
> 
>  # fix uclibc-ng configure/compile
> -LIBV4L_CONF_ENV = ac_cv_prog_cc_c99='-std=gnu99'
> +LIBV4L_CONF_ENV = ac_cv_prog_cc_c99='-std=gnu99' PKG_CONFIG_SYSROOT_DIR=$(STAGING_DIR)
> 
>  # v4l-utils components have different licences, see v4l-utils.spec for details
>  LIBV4L_LICENSE = GPL-2.0+ (utilities), LGPL-2.1+ (libraries)
> 

This change works because the Buildroot's pkg-config wrapper script [0]
configures the following variables as relative to $(HOST_DIR)/bin:

	PKG_CONFIG_SYSROOT_DIR
	PKG_CONFIG_SYSTEM_INCLUDE_PATH
	PKG_CONFIG_SYSTEM_LIBRARY_PATH

So when you set PKG_CONFIG_SYSROOT_DIR=$(STAGING_DIR) (an absolute path),
pkgconf detects the difference and prints the sysroot system lib dirs.
These `-L` flags end up in the QT5_LIBS variable via autoconf.

	--- output/build/libv4l-1.18.0-broken/Makefile  2019-11-21 14:04:00.373262772 +0000
	+++ output/build/libv4l-1.18.0/Makefile 2019-11-21 15:53:40.388627694 +0000
	[snip]
	@@ -385,15 +385,15 @@
	[snip]
	-QT5_LIBS = -lQt5Widgets -lQt5Gui -lQt5Core
	+QT5_LIBS = -L/home/br-user/output/host/bin/../sparc-buildroot-linux-uclibc/sysroot/usr/lib -lQt5Widgets -lQt5Gui -lQt5Core
	[snip]

Which in turn, tell libtool to search `.../sysroot/usr/lib` for the .la
files, which contain the appropriate `-latomic` flag:

	$ grep latomic output/host/sparc-buildroot-linux-uclibc/sysroot/usr/lib/libQt5Widgets.la
	dependency_libs='-latomic  -lQt5Gui -lQt5Core -lpthread -lrt -lpthread -ldl'

The same effect can be achieved by telling pkgconf to keep the system 
libs:

	diff --git a/package/libv4l/libv4l.mk b/package/libv4l/libv4l.mk
	index a3bf099221..93edbfedd5 100644
	--- a/package/libv4l/libv4l.mk
	+++ b/package/libv4l/libv4l.mk
	@@ -16,7 +16,9 @@ LIBV4L_AUTORECONF = YES
	 LIBV4L_DEPENDENCIES += host-gettext

	 # fix uclibc-ng configure/compile
	-LIBV4L_CONF_ENV = ac_cv_prog_cc_c99='-std=gnu99'
	+LIBV4L_CONF_ENV = ac_cv_prog_cc_c99='-std=gnu99' PKG_CONFIG_ALLOW_SYSTEM_LIBS=1

	 # v4l-utils components have different licences, see v4l-utils.spec for details
	 LIBV4L_LICENSE = GPL-2.0+ (utilities), LGPL-2.1+ (libraries)

Which I think is the right solution when we use pkgconf to generate
flags for libtool.

Thoughts?
Thomas Preston

[0] https://git.buildroot.net/buildroot/tree/package/pkgconf/pkg-config.in

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Buildroot] [PATCH 1/2] package/libv4l: fix musl build
  2019-10-30  6:53 [Buildroot] [PATCH 1/2] package/libv4l: fix musl build Bernd Kuhls
  2019-10-30  6:53 ` [Buildroot] [PATCH 2/2] package/libv4l: link with libatomic when needed Bernd Kuhls
@ 2019-12-08 13:35 ` Thomas Petazzoni
  2019-12-22 19:35   ` Peter Korsgaard
  1 sibling, 1 reply; 10+ messages in thread
From: Thomas Petazzoni @ 2019-12-08 13:35 UTC (permalink / raw)
  To: buildroot

On Wed, 30 Oct 2019 07:53:02 +0100
Bernd Kuhls <bernd.kuhls@t-online.de> wrote:

> Fixes:
> http://autobuild.buildroot.net/results/bf8/bf88f89bdb966ef54938e4274114d4afe5668b1f/
> 
> Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>
> ---
>  ...d-missing-includes-to-fix-musl-build.patch | 68 +++++++++++++++++++
>  1 file changed, 68 insertions(+)
>  create mode 100644 package/libv4l/0001-keymap.h-add-missing-includes-to-fix-musl-build.patch

Thanks, applied. However, I have one comment, see below.

> diff --git a/package/libv4l/0001-keymap.h-add-missing-includes-to-fix-musl-build.patch b/package/libv4l/0001-keymap.h-add-missing-includes-to-fix-musl-build.patch
> new file mode 100644
> index 0000000000..238f8fc377
> --- /dev/null
> +++ b/package/libv4l/0001-keymap.h-add-missing-includes-to-fix-musl-build.patch
> @@ -0,0 +1,68 @@
> +From baba68cdcb44fc11d0ba8ce2c13eb5b06bbd9b33 Mon Sep 17 00:00:00 2001
> +From: Bernd Kuhls <bernd.kuhls@t-online.de>
> +Date: Wed, 30 Oct 2019 07:15:23 +0100
> +Subject: [PATCH] keymap.h: add missing includes to fix musl build
> +
> +Needed to fix these build errors:
> +
> +In file included from keymap.c:13:0:
> +keymap.h:23:2: error: unknown type name 'u_int32_t'
> +  u_int32_t scancode;
> +
> +keymap.h:36:1: error: unknown type name 'error_t'
> + error_t parse_keymap(char *fname, struct keymap **keymap, bool verbose);
> +
> +Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>
> +---
> +Patch was not sent upstream due to broken mailing list setup:
> +
> +<majordomo@vger.kernel.org>: host vger.kernel.org[209.132.180.67] said: 553
> +    5.7.1 Hello [xx.xx.xx.xx], for your MAIL FROM address
> +    <bernd.kuhls@t-online.de> policy analysis reported: Your address is not
> +    liked source for email (in reply to MAIL FROM command)
> +
> +Hello [xx.xx.xx.xx], for your MAIL FROM address <berndkuhls@hotmail.com>
> + policy analysis reported: Your address is not liked source for email 

We really want to upstream these patches. vger.kernel.org is a very
widely used mailing list service, as it's used for virtually all kernel
mailing lists.

Thomas
-- 
Thomas Petazzoni, CTO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [Buildroot] [PATCH 1/2] package/libv4l: fix musl build
  2019-12-08 13:35 ` [Buildroot] [PATCH 1/2] package/libv4l: fix musl build Thomas Petazzoni
@ 2019-12-22 19:35   ` Peter Korsgaard
  0 siblings, 0 replies; 10+ messages in thread
From: Peter Korsgaard @ 2019-12-22 19:35 UTC (permalink / raw)
  To: buildroot

>>>>> "Thomas" == Thomas Petazzoni <thomas.petazzoni@bootlin.com> writes:

 > On Wed, 30 Oct 2019 07:53:02 +0100
 > Bernd Kuhls <bernd.kuhls@t-online.de> wrote:

 >> Fixes:
 >> http://autobuild.buildroot.net/results/bf8/bf88f89bdb966ef54938e4274114d4afe5668b1f/
 >> 
 >> Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>
 >> ---
 >> ...d-missing-includes-to-fix-musl-build.patch | 68 +++++++++++++++++++
 >> 1 file changed, 68 insertions(+)
 >> create mode 100644 package/libv4l/0001-keymap.h-add-missing-includes-to-fix-musl-build.patch

Committed to 2019.11.x, thanks.

-- 
Bye, Peter Korsgaard

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2019-12-22 19:35 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-30  6:53 [Buildroot] [PATCH 1/2] package/libv4l: fix musl build Bernd Kuhls
2019-10-30  6:53 ` [Buildroot] [PATCH 2/2] package/libv4l: link with libatomic when needed Bernd Kuhls
2019-10-30 10:30   ` Thomas Petazzoni
2019-10-30 22:26     ` Peter Seiderer
2019-11-20 14:46       ` Thomas Preston
2019-11-20 19:44         ` Peter Seiderer
2019-11-21 11:33           ` Thomas Preston
2019-11-21 16:46           ` Thomas Preston
2019-12-08 13:35 ` [Buildroot] [PATCH 1/2] package/libv4l: fix musl build Thomas Petazzoni
2019-12-22 19:35   ` Peter Korsgaard

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.