Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH] motion: fix build failure due to missing drmGetVersion() and drmFreeVersion()
@ 2018-09-09 19:33 Giulio Benetti
  2018-09-10  6:35 ` Giulio Benetti
  2018-09-10  7:21 ` Thomas Petazzoni
  0 siblings, 2 replies; 4+ messages in thread
From: Giulio Benetti @ 2018-09-09 19:33 UTC (permalink / raw)
  To: buildroot

During static linking -ldrm is listed too early respect -lavutil.
This cause build failure.

Append extra -ldrm at the tail of $(LIBS) list.

Fixes:
http://autobuild.buildroot.net/results/395/395be1a9cab824b82ef34c2ebd84d54243029b33//

Signed-off-by: Giulio Benetti <giulio.benetti@micronovasrl.com>
---
 ...-fix-static-linking-for-ldrm-library.patch | 30 +++++++++++++++++++
 1 file changed, 30 insertions(+)
 create mode 100644 package/motion/0002-Makefile.in-fix-static-linking-for-ldrm-library.patch

diff --git a/package/motion/0002-Makefile.in-fix-static-linking-for-ldrm-library.patch b/package/motion/0002-Makefile.in-fix-static-linking-for-ldrm-library.patch
new file mode 100644
index 0000000000..591cca66eb
--- /dev/null
+++ b/package/motion/0002-Makefile.in-fix-static-linking-for-ldrm-library.patch
@@ -0,0 +1,30 @@
+From 7098dafaf297d70bb73a5320bdc522b66c456a56 Mon Sep 17 00:00:00 2001
+From: Giulio Benetti <giulio.benetti@micronovasrl.com>
+Date: Sun, 9 Sep 2018 20:30:33 +0200
+Subject: [PATCH] Makefile.in: fix static linking for -ldrm library
+
+While linking statically -ldrm library is listed too early than -lavutil.
+
+Append additional -ldrm entry to linker $(LIBS) list.
+
+Signed-off-by: Giulio Benetti <giulio.benetti@micronovasrl.com>
+---
+ Makefile.in | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/Makefile.in b/Makefile.in
+index 94c7d40..5cfb490 100644
+--- a/Makefile.in
++++ b/Makefile.in
+@@ -39,7 +39,7 @@ CFLAGS       = @CFLAGS@ -Wall \
+ 	 -DMOTIONDOCDIR=\"$(DESTDIR)$(docdir)\"    \
+ 	 @FFMPEG_CFLAGS@ @MMAL_CFLAGS@
+ LDFLAGS      = @LDFLAGS@
+-LIBS         = @LIBS@  @MMAL_LIBS@ @FFMPEG_LIBS@
++LIBS         = @LIBS@ @FFMPEG_LIBS@ @MMAL_LIBS@ -ldrm
+ OBJ          = motion.o logger.o conf.o draw.o jpegutils.o \
+ 			   video_loopback.o video_v4l2.o video_common.o video_bktr.o \
+ 			   netcam.o netcam_http.o netcam_ftp.o netcam_jpeg.o netcam_wget.o \
+-- 
+2.17.1
+
-- 
2.17.1

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

* [Buildroot] [PATCH] motion: fix build failure due to missing drmGetVersion() and drmFreeVersion()
  2018-09-09 19:33 [Buildroot] [PATCH] motion: fix build failure due to missing drmGetVersion() and drmFreeVersion() Giulio Benetti
@ 2018-09-10  6:35 ` Giulio Benetti
  2018-09-10  7:21 ` Thomas Petazzoni
  1 sibling, 0 replies; 4+ messages in thread
From: Giulio Benetti @ 2018-09-10  6:35 UTC (permalink / raw)
  To: buildroot

Hello,09/09/2018 21:33, Giulio Benetti ha scritto:
> During static linking -ldrm is listed too early respect -lavutil.
> This cause build failure.
> 
> Append extra -ldrm at the tail of $(LIBS) list.
> 
> Fixes:
> http://autobuild.buildroot.net/results/395/395be1a9cab824b82ef34c2ebd84d54243029b33//
> 
> Signed-off-by: Giulio Benetti <giulio.benetti@micronovasrl.com>
> ---
>   ...-fix-static-linking-for-ldrm-library.patch | 30 +++++++++++++++++++
>   1 file changed, 30 insertions(+)
>   create mode 100644 package/motion/0002-Makefile.in-fix-static-linking-for-ldrm-library.patch
> 
> diff --git a/package/motion/0002-Makefile.in-fix-static-linking-for-ldrm-library.patch b/package/motion/0002-Makefile.in-fix-static-linking-for-ldrm-library.patch
> new file mode 100644
> index 0000000000..591cca66eb
> --- /dev/null
> +++ b/package/motion/0002-Makefile.in-fix-static-linking-for-ldrm-library.patch
> @@ -0,0 +1,30 @@
> +From 7098dafaf297d70bb73a5320bdc522b66c456a56 Mon Sep 17 00:00:00 2001
> +From: Giulio Benetti <giulio.benetti@micronovasrl.com>
> +Date: Sun, 9 Sep 2018 20:30:33 +0200
> +Subject: [PATCH] Makefile.in: fix static linking for -ldrm library
> +
> +While linking statically -ldrm library is listed too early than -lavutil.
> +
> +Append additional -ldrm entry to linker $(LIBS) list.
> +
> +Signed-off-by: Giulio Benetti <giulio.benetti@micronovasrl.com>
> +---
> + Makefile.in | 2 +-
> + 1 file changed, 1 insertion(+), 1 deletion(-)
> +
> +diff --git a/Makefile.in b/Makefile.in
> +index 94c7d40..5cfb490 100644
> +--- a/Makefile.in
> ++++ b/Makefile.in
> +@@ -39,7 +39,7 @@ CFLAGS       = @CFLAGS@ -Wall \
> + 	 -DMOTIONDOCDIR=\"$(DESTDIR)$(docdir)\"    \
> + 	 @FFMPEG_CFLAGS@ @MMAL_CFLAGS@
> + LDFLAGS      = @LDFLAGS@
> +-LIBS         = @LIBS@  @MMAL_LIBS@ @FFMPEG_LIBS@
> ++LIBS         = @LIBS@ @FFMPEG_LIBS@ @MMAL_LIBS@ -ldrm

As pointed here:
https://github.com/Motion-Project/motion/pull/800
It makes more sense to fix at FFmpeg level the variable FFMPEG_LIBS.
Otherwise this bug will keep coming out again and again.
So please discard this patch and I'm going to fix on ffmpeg package.

Thanks
Giulio Benetti

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

* [Buildroot] [PATCH] motion: fix build failure due to missing drmGetVersion() and drmFreeVersion()
  2018-09-09 19:33 [Buildroot] [PATCH] motion: fix build failure due to missing drmGetVersion() and drmFreeVersion() Giulio Benetti
  2018-09-10  6:35 ` Giulio Benetti
@ 2018-09-10  7:21 ` Thomas Petazzoni
  2018-09-11 13:27   ` Giulio Benetti
  1 sibling, 1 reply; 4+ messages in thread
From: Thomas Petazzoni @ 2018-09-10  7:21 UTC (permalink / raw)
  To: buildroot

Hello,

On Sun,  9 Sep 2018 21:33:43 +0200, Giulio Benetti wrote:
> During static linking -ldrm is listed too early respect -lavutil.
> This cause build failure.
> 
> Append extra -ldrm at the tail of $(LIBS) list.
> 
> Fixes:
> http://autobuild.buildroot.net/results/395/395be1a9cab824b82ef34c2ebd84d54243029b33//
> 
> Signed-off-by: Giulio Benetti <giulio.benetti@micronovasrl.com>

This fix should not be needed: the configure.ac script is using
pkg-config to detect ffmpeg libraries, and pkg-config should return the
right libraries.

In addition, your patch will badly break the build: ffmpeg is only an
optional dependency of motion, and DRM support in ffmpeg itself is
optional, so the patch is clearly wrong.

Best regards,

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

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

* [Buildroot] [PATCH] motion: fix build failure due to missing drmGetVersion() and drmFreeVersion()
  2018-09-10  7:21 ` Thomas Petazzoni
@ 2018-09-11 13:27   ` Giulio Benetti
  0 siblings, 0 replies; 4+ messages in thread
From: Giulio Benetti @ 2018-09-11 13:27 UTC (permalink / raw)
  To: buildroot

Hello,

Il 10/09/2018 09:21, Thomas Petazzoni ha scritto:
> Hello,
> 
> On Sun,  9 Sep 2018 21:33:43 +0200, Giulio Benetti wrote:
>> During static linking -ldrm is listed too early respect -lavutil.
>> This cause build failure.
>>
>> Append extra -ldrm at the tail of $(LIBS) list.
>>
>> Fixes:
>> http://autobuild.buildroot.net/results/395/395be1a9cab824b82ef34c2ebd84d54243029b33//
>>
>> Signed-off-by: Giulio Benetti <giulio.benetti@micronovasrl.com>
> 
> This fix should not be needed: the configure.ac script is using
> pkg-config to detect ffmpeg libraries, and pkg-config should return the
> right libraries.

Now I'm understanding pkg-config, the root cause is in ffmpeg where in 
libavutil.pc there is not -ldrm appended.
This way every package linking with -lavutil *statically* is going to fail.
I've fixed something like this with this patch:
https://github.com/buildroot/buildroot/commit/daf7dd87f4d93923df5e757fd43b3ad214a4a2ae

But it was only a workaround.
I'm going to send a patch to fix once for all this ffmpeg lack.
Before I check if there's an upstream patch.

> 
> In addition, your patch will badly break the build: ffmpeg is only an
> optional dependency of motion, and DRM support in ffmpeg itself is
> optional, so the patch is clearly wrong.

You're right.

Thanks and
Best regards
Giulio Benetti

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

end of thread, other threads:[~2018-09-11 13:27 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-09-09 19:33 [Buildroot] [PATCH] motion: fix build failure due to missing drmGetVersion() and drmFreeVersion() Giulio Benetti
2018-09-10  6:35 ` Giulio Benetti
2018-09-10  7:21 ` Thomas Petazzoni
2018-09-11 13:27   ` Giulio Benetti

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox