* [Buildroot] [git commit] ffmpeg: fix static linking build failure when using libavutil
@ 2019-01-28 23:16 Arnout Vandecappelle
2019-01-29 9:03 ` Arnout Vandecappelle
0 siblings, 1 reply; 7+ messages in thread
From: Arnout Vandecappelle @ 2019-01-28 23:16 UTC (permalink / raw)
To: buildroot
commit: https://git.buildroot.net/buildroot/commit/?id=483db9908985d023b858c0b59d4016f9abb4b6f9
branch: https://git.buildroot.net/buildroot/commit/?id=refs/heads/master
If a package tries to static link with libavutil it fails due to the
lack of libavutil private dependencies in libavutil.pc (-ldrm in this
case).
Add patch to:
- Check if libdrm is present.
- Add it to Libs.private: in libavutil.pc if present.
Fixes:
http://autobuild.buildroot.net/results/766/766de487f394490df8c712652ac364ebb4a3ab14/
http://autobuild.buildroot.net/results/041/041e29dfddb2da3309ac7d34a576c60c5a75fe4d/
http://autobuild.buildroot.net/results/780/78061b61cfe3f42554a475c048d54dacacfe11d5/
http://autobuild.buildroot.net/results/275/275e4e0030d26c029085b408cfb272d5633969c6/
http://autobuild.buildroot.net/results/515/5152dcca58944cf732d09fba6e6c9af8a9243c75/
http://autobuild.buildroot.net/results/395/395be1a9cab824b82ef34c2ebd84d54243029b33/
Signed-off-by: Giulio Benetti <giulio.benetti@micronovasrl.com>
Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
---
...0002-configure-add-LIBDRM-to-Libs.private.patch | 68 ++++++++++++++++++++++
1 file changed, 68 insertions(+)
diff --git a/package/ffmpeg/0002-configure-add-LIBDRM-to-Libs.private.patch b/package/ffmpeg/0002-configure-add-LIBDRM-to-Libs.private.patch
new file mode 100644
index 0000000000..5493473d0f
--- /dev/null
+++ b/package/ffmpeg/0002-configure-add-LIBDRM-to-Libs.private.patch
@@ -0,0 +1,68 @@
+From e1e11d404eec24c158ae1241d6573c263e57a7b9 Mon Sep 17 00:00:00 2001
+From: Giulio Benetti <giulio.benetti@micronovasrl.com>
+Date: Wed, 17 Oct 2018 13:13:10 +0200
+Subject: [PATCH] configure: add LIBDRM to Libs.private
+
+When static linking programs using ffmpeg libraries, if linking against
+libavutil, -ldrm is listed before -lavutil. This leads to linking
+failure due to undefined reference of drmGetVersion() and
+drmFreeVersion().
+This is why when pkg-config create libavutil.pc doesn't append -ldrm
+to Libs.private:.
+
+- Create LIBDRM=-ldrm in case libdrm is enabled.
+- Add privatelibs_avutil variable for explicit private libraries to be
+ appended to Libs.private:
+- Add $LIBDRM to privatelibs_avutil.
+
+Signed-off-by: Giulio Benetti <giulio.benetti@micronovasrl.com>
+---
+ configure | 3 ++-
+ ffbuild/pkgconfig_generate.sh | 3 ++-
+ 2 files changed, 4 insertions(+), 2 deletions(-)
+
+diff --git a/configure b/configure
+index 7377046d0a..0996d8a85d 100755
+--- a/configure
++++ b/configure
+@@ -5919,7 +5919,7 @@ enabled libcelt && require libcelt celt/celt.h celt_decode -lcelt0 &&
+ die "ERROR: libcelt must be installed and version must be >= 0.11.0."; }
+ enabled libcaca && require_pkg_config libcaca caca caca.h caca_create_canvas
+ enabled libdc1394 && require_pkg_config libdc1394 libdc1394-2 dc1394/dc1394.h dc1394_new
+-enabled libdrm && require_pkg_config libdrm libdrm xf86drm.h drmGetVersion
++enabled libdrm && require_pkg_config libdrm libdrm xf86drm.h drmGetVersion && LIBDRM="-ldrm"
+ enabled libfdk_aac && { use_pkg_config libfdk_aac fdk-aac "fdk-aac/aacenc_lib.h" aacEncOpen ||
+ { require libfdk_aac fdk-aac/aacenc_lib.h aacEncOpen -lfdk-aac &&
+ warn "using libfdk without pkg-config"; } }
+@@ -7097,6 +7097,7 @@ LIBPREF=${LIBPREF}
+ LIBSUF=${LIBSUF}
+
+ extralibs_avutil="$LIBRT $LIBM"
++privatelibs_avutil="$LIBDRM"
+ extralibs_avcodec="$extralibs"
+ extralibs_avformat="$extralibs"
+ extralibs_avdevice="$extralibs"
+diff --git a/ffbuild/pkgconfig_generate.sh b/ffbuild/pkgconfig_generate.sh
+index e5de6716d2..b86486a107 100755
+--- a/ffbuild/pkgconfig_generate.sh
++++ b/ffbuild/pkgconfig_generate.sh
+@@ -13,6 +13,7 @@ name=lib${shortname}
+ fullname=${name}${build_suffix}
+ comment=$2
+ libs=$(eval echo \$extralibs_${shortname})
++privatelibs=$(eval echo \$privatelibs_${shortname})
+ deps=$(eval echo \$${shortname}_deps)
+
+ for dep in $deps; do
+@@ -39,7 +40,7 @@ Requires: $($shared || echo $requires)
+ Requires.private: $($shared && echo $requires)
+ Conflicts:
+ Libs: -L\${libdir} $rpath -l${fullname#lib} $($shared || echo $libs)
+-Libs.private: $($shared && echo $libs)
++Libs.private: $($shared && echo $libs) ${privatelibs}
+ Cflags: -I\${includedir}
+ EOF
+
+--
+2.17.1
+
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [Buildroot] [git commit] ffmpeg: fix static linking build failure when using libavutil
2019-01-28 23:16 [Buildroot] [git commit] ffmpeg: fix static linking build failure when using libavutil Arnout Vandecappelle
@ 2019-01-29 9:03 ` Arnout Vandecappelle
2019-01-29 12:30 ` Giulio Benetti
0 siblings, 1 reply; 7+ messages in thread
From: Arnout Vandecappelle @ 2019-01-29 9:03 UTC (permalink / raw)
To: buildroot
Oopsie...
On 29/01/2019 00:16, Arnout Vandecappelle (Essensium/Mind) wrote:
> commit: https://git.buildroot.net/buildroot/commit/?id=483db9908985d023b858c0b59d4016f9abb4b6f9
> branch: https://git.buildroot.net/buildroot/commit/?id=refs/heads/master
>
> If a package tries to static link with libavutil it fails due to the
> lack of libavutil private dependencies in libavutil.pc (-ldrm in this
> case).
>
> Add patch to:
> - Check if libdrm is present.
> - Add it to Libs.private: in libavutil.pc if present.
I didn't want to push this one, it was just a test. The patch no longer applies
to ffmpeg 3.4.5 so this is causing autobuilder breakage. Therefore, I pushed a
revert commit.
Giulio, FYI, upstream has added an explicit $LIBDRM but not to Libs.Private, so
the static linking case still breaks for the same reason. The patch just needs
to be rebased (and sent upstream).
Regards,
Arnout
>
> Fixes:
> http://autobuild.buildroot.net/results/766/766de487f394490df8c712652ac364ebb4a3ab14/
> http://autobuild.buildroot.net/results/041/041e29dfddb2da3309ac7d34a576c60c5a75fe4d/
> http://autobuild.buildroot.net/results/780/78061b61cfe3f42554a475c048d54dacacfe11d5/
> http://autobuild.buildroot.net/results/275/275e4e0030d26c029085b408cfb272d5633969c6/
> http://autobuild.buildroot.net/results/515/5152dcca58944cf732d09fba6e6c9af8a9243c75/
> http://autobuild.buildroot.net/results/395/395be1a9cab824b82ef34c2ebd84d54243029b33/
>
> Signed-off-by: Giulio Benetti <giulio.benetti@micronovasrl.com>
> Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
> ---
> ...0002-configure-add-LIBDRM-to-Libs.private.patch | 68 ++++++++++++++++++++++
> 1 file changed, 68 insertions(+)
>
> diff --git a/package/ffmpeg/0002-configure-add-LIBDRM-to-Libs.private.patch b/package/ffmpeg/0002-configure-add-LIBDRM-to-Libs.private.patch
> new file mode 100644
> index 0000000000..5493473d0f
> --- /dev/null
> +++ b/package/ffmpeg/0002-configure-add-LIBDRM-to-Libs.private.patch
> @@ -0,0 +1,68 @@
> +From e1e11d404eec24c158ae1241d6573c263e57a7b9 Mon Sep 17 00:00:00 2001
> +From: Giulio Benetti <giulio.benetti@micronovasrl.com>
> +Date: Wed, 17 Oct 2018 13:13:10 +0200
> +Subject: [PATCH] configure: add LIBDRM to Libs.private
> +
> +When static linking programs using ffmpeg libraries, if linking against
> +libavutil, -ldrm is listed before -lavutil. This leads to linking
> +failure due to undefined reference of drmGetVersion() and
> +drmFreeVersion().
> +This is why when pkg-config create libavutil.pc doesn't append -ldrm
> +to Libs.private:.
> +
> +- Create LIBDRM=-ldrm in case libdrm is enabled.
> +- Add privatelibs_avutil variable for explicit private libraries to be
> + appended to Libs.private:
> +- Add $LIBDRM to privatelibs_avutil.
> +
> +Signed-off-by: Giulio Benetti <giulio.benetti@micronovasrl.com>
> +---
> + configure | 3 ++-
> + ffbuild/pkgconfig_generate.sh | 3 ++-
> + 2 files changed, 4 insertions(+), 2 deletions(-)
> +
> +diff --git a/configure b/configure
> +index 7377046d0a..0996d8a85d 100755
> +--- a/configure
> ++++ b/configure
> +@@ -5919,7 +5919,7 @@ enabled libcelt && require libcelt celt/celt.h celt_decode -lcelt0 &&
> + die "ERROR: libcelt must be installed and version must be >= 0.11.0."; }
> + enabled libcaca && require_pkg_config libcaca caca caca.h caca_create_canvas
> + enabled libdc1394 && require_pkg_config libdc1394 libdc1394-2 dc1394/dc1394.h dc1394_new
> +-enabled libdrm && require_pkg_config libdrm libdrm xf86drm.h drmGetVersion
> ++enabled libdrm && require_pkg_config libdrm libdrm xf86drm.h drmGetVersion && LIBDRM="-ldrm"
> + enabled libfdk_aac && { use_pkg_config libfdk_aac fdk-aac "fdk-aac/aacenc_lib.h" aacEncOpen ||
> + { require libfdk_aac fdk-aac/aacenc_lib.h aacEncOpen -lfdk-aac &&
> + warn "using libfdk without pkg-config"; } }
> +@@ -7097,6 +7097,7 @@ LIBPREF=${LIBPREF}
> + LIBSUF=${LIBSUF}
> +
> + extralibs_avutil="$LIBRT $LIBM"
> ++privatelibs_avutil="$LIBDRM"
> + extralibs_avcodec="$extralibs"
> + extralibs_avformat="$extralibs"
> + extralibs_avdevice="$extralibs"
> +diff --git a/ffbuild/pkgconfig_generate.sh b/ffbuild/pkgconfig_generate.sh
> +index e5de6716d2..b86486a107 100755
> +--- a/ffbuild/pkgconfig_generate.sh
> ++++ b/ffbuild/pkgconfig_generate.sh
> +@@ -13,6 +13,7 @@ name=lib${shortname}
> + fullname=${name}${build_suffix}
> + comment=$2
> + libs=$(eval echo \$extralibs_${shortname})
> ++privatelibs=$(eval echo \$privatelibs_${shortname})
> + deps=$(eval echo \$${shortname}_deps)
> +
> + for dep in $deps; do
> +@@ -39,7 +40,7 @@ Requires: $($shared || echo $requires)
> + Requires.private: $($shared && echo $requires)
> + Conflicts:
> + Libs: -L\${libdir} $rpath -l${fullname#lib} $($shared || echo $libs)
> +-Libs.private: $($shared && echo $libs)
> ++Libs.private: $($shared && echo $libs) ${privatelibs}
> + Cflags: -I\${includedir}
> + EOF
> +
> +--
> +2.17.1
> +
> _______________________________________________
> buildroot mailing list
> buildroot at busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot
>
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Buildroot] [git commit] ffmpeg: fix static linking build failure when using libavutil
2019-01-29 9:03 ` Arnout Vandecappelle
@ 2019-01-29 12:30 ` Giulio Benetti
2019-01-29 13:39 ` Arnout Vandecappelle
0 siblings, 1 reply; 7+ messages in thread
From: Giulio Benetti @ 2019-01-29 12:30 UTC (permalink / raw)
To: buildroot
Hi Arnout,
Il 29/01/2019 10:03, Arnout Vandecappelle ha scritto:
> Oopsie...
>
> On 29/01/2019 00:16, Arnout Vandecappelle (Essensium/Mind) wrote:
>> commit: https://git.buildroot.net/buildroot/commit/?id=483db9908985d023b858c0b59d4016f9abb4b6f9
>> branch: https://git.buildroot.net/buildroot/commit/?id=refs/heads/master
>>
>> If a package tries to static link with libavutil it fails due to the
>> lack of libavutil private dependencies in libavutil.pc (-ldrm in this
>> case).
>>
>> Add patch to:
>> - Check if libdrm is present.
>> - Add it to Libs.private: in libavutil.pc if present.
>
> I didn't want to push this one, it was just a test. The patch no longer applies
> to ffmpeg 3.4.5 so this is causing autobuilder breakage. Therefore, I pushed a
> revert commit.
I've forgot it there pending on patchwork after ffmpeg bump.
> Giulio, FYI, upstream has added an explicit $LIBDRM but not to Libs.Private, so
> the static linking case still breaks for the same reason. The patch just needs
> to be rebased (and sent upstream).
I've tried several times to discuss this on ffmpeg-devel:
[1] http://ffmpeg.org/pipermail/ffmpeg-devel/2018-October/235269.html
but they ignored my last patch:
[2] http://ffmpeg.org/pipermail/ffmpeg-devel/2018-October/235417.html
to fix the previous I've sent:
[3] http://ffmpeg.org/pipermail/ffmpeg-devel/2018-October/235269.html
I can't understand why they don't want to upstream my last patch[2]...
Anyway I'm going to submit the last one for Buildroot asap.
I'm going to reproduce it right now.
Best regards
--
Giulio Benetti
CTO
MICRONOVA SRL
Sede: Via A. Niedda 3 - 35010 Vigonza (PD)
Tel. 049/8931563 - Fax 049/8931346
Cod.Fiscale - P.IVA 02663420285
Capitale Sociale ? 26.000 i.v.
Iscritta al Reg. Imprese di Padova N. 02663420285
Numero R.E.A. 258642
> Regards,
> Arnout
>
>>
>> Fixes:
>> http://autobuild.buildroot.net/results/766/766de487f394490df8c712652ac364ebb4a3ab14/
>> http://autobuild.buildroot.net/results/041/041e29dfddb2da3309ac7d34a576c60c5a75fe4d/
>> http://autobuild.buildroot.net/results/780/78061b61cfe3f42554a475c048d54dacacfe11d5/
>> http://autobuild.buildroot.net/results/275/275e4e0030d26c029085b408cfb272d5633969c6/
>> http://autobuild.buildroot.net/results/515/5152dcca58944cf732d09fba6e6c9af8a9243c75/
>> http://autobuild.buildroot.net/results/395/395be1a9cab824b82ef34c2ebd84d54243029b33/
>>
>> Signed-off-by: Giulio Benetti <giulio.benetti@micronovasrl.com>
>> Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
>> ---
>> ...0002-configure-add-LIBDRM-to-Libs.private.patch | 68 ++++++++++++++++++++++
>> 1 file changed, 68 insertions(+)
>>
>> diff --git a/package/ffmpeg/0002-configure-add-LIBDRM-to-Libs.private.patch b/package/ffmpeg/0002-configure-add-LIBDRM-to-Libs.private.patch
>> new file mode 100644
>> index 0000000000..5493473d0f
>> --- /dev/null
>> +++ b/package/ffmpeg/0002-configure-add-LIBDRM-to-Libs.private.patch
>> @@ -0,0 +1,68 @@
>> +From e1e11d404eec24c158ae1241d6573c263e57a7b9 Mon Sep 17 00:00:00 2001
>> +From: Giulio Benetti <giulio.benetti@micronovasrl.com>
>> +Date: Wed, 17 Oct 2018 13:13:10 +0200
>> +Subject: [PATCH] configure: add LIBDRM to Libs.private
>> +
>> +When static linking programs using ffmpeg libraries, if linking against
>> +libavutil, -ldrm is listed before -lavutil. This leads to linking
>> +failure due to undefined reference of drmGetVersion() and
>> +drmFreeVersion().
>> +This is why when pkg-config create libavutil.pc doesn't append -ldrm
>> +to Libs.private:.
>> +
>> +- Create LIBDRM=-ldrm in case libdrm is enabled.
>> +- Add privatelibs_avutil variable for explicit private libraries to be
>> + appended to Libs.private:
>> +- Add $LIBDRM to privatelibs_avutil.
>> +
>> +Signed-off-by: Giulio Benetti <giulio.benetti@micronovasrl.com>
>> +---
>> + configure | 3 ++-
>> + ffbuild/pkgconfig_generate.sh | 3 ++-
>> + 2 files changed, 4 insertions(+), 2 deletions(-)
>> +
>> +diff --git a/configure b/configure
>> +index 7377046d0a..0996d8a85d 100755
>> +--- a/configure
>> ++++ b/configure
>> +@@ -5919,7 +5919,7 @@ enabled libcelt && require libcelt celt/celt.h celt_decode -lcelt0 &&
>> + die "ERROR: libcelt must be installed and version must be >= 0.11.0."; }
>> + enabled libcaca && require_pkg_config libcaca caca caca.h caca_create_canvas
>> + enabled libdc1394 && require_pkg_config libdc1394 libdc1394-2 dc1394/dc1394.h dc1394_new
>> +-enabled libdrm && require_pkg_config libdrm libdrm xf86drm.h drmGetVersion
>> ++enabled libdrm && require_pkg_config libdrm libdrm xf86drm.h drmGetVersion && LIBDRM="-ldrm"
>> + enabled libfdk_aac && { use_pkg_config libfdk_aac fdk-aac "fdk-aac/aacenc_lib.h" aacEncOpen ||
>> + { require libfdk_aac fdk-aac/aacenc_lib.h aacEncOpen -lfdk-aac &&
>> + warn "using libfdk without pkg-config"; } }
>> +@@ -7097,6 +7097,7 @@ LIBPREF=${LIBPREF}
>> + LIBSUF=${LIBSUF}
>> +
>> + extralibs_avutil="$LIBRT $LIBM"
>> ++privatelibs_avutil="$LIBDRM"
>> + extralibs_avcodec="$extralibs"
>> + extralibs_avformat="$extralibs"
>> + extralibs_avdevice="$extralibs"
>> +diff --git a/ffbuild/pkgconfig_generate.sh b/ffbuild/pkgconfig_generate.sh
>> +index e5de6716d2..b86486a107 100755
>> +--- a/ffbuild/pkgconfig_generate.sh
>> ++++ b/ffbuild/pkgconfig_generate.sh
>> +@@ -13,6 +13,7 @@ name=lib${shortname}
>> + fullname=${name}${build_suffix}
>> + comment=$2
>> + libs=$(eval echo \$extralibs_${shortname})
>> ++privatelibs=$(eval echo \$privatelibs_${shortname})
>> + deps=$(eval echo \$${shortname}_deps)
>> +
>> + for dep in $deps; do
>> +@@ -39,7 +40,7 @@ Requires: $($shared || echo $requires)
>> + Requires.private: $($shared && echo $requires)
>> + Conflicts:
>> + Libs: -L\${libdir} $rpath -l${fullname#lib} $($shared || echo $libs)
>> +-Libs.private: $($shared && echo $libs)
>> ++Libs.private: $($shared && echo $libs) ${privatelibs}
>> + Cflags: -I\${includedir}
>> + EOF
>> +
>> +--
>> +2.17.1
>> +
>> _______________________________________________
>> buildroot mailing list
>> buildroot at busybox.net
>> http://lists.busybox.net/mailman/listinfo/buildroot
>>
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Buildroot] [git commit] ffmpeg: fix static linking build failure when using libavutil
2019-01-29 12:30 ` Giulio Benetti
@ 2019-01-29 13:39 ` Arnout Vandecappelle
2019-01-29 17:02 ` Giulio Benetti
2019-01-30 16:01 ` [Buildroot] [PATCH] ffmpeg: improve linking avoiding -ldrm to be appended when -lavutil is linked Giulio Benetti
0 siblings, 2 replies; 7+ messages in thread
From: Arnout Vandecappelle @ 2019-01-29 13:39 UTC (permalink / raw)
To: buildroot
On 29/01/2019 13:30, Giulio Benetti wrote:
> Hi Arnout,
>
> Il 29/01/2019 10:03, Arnout Vandecappelle ha scritto:
>> ? Oopsie...
>>
>> On 29/01/2019 00:16, Arnout Vandecappelle (Essensium/Mind) wrote:
>>> commit:
>>> https://git.buildroot.net/buildroot/commit/?id=483db9908985d023b858c0b59d4016f9abb4b6f9
>>>
>>> branch: https://git.buildroot.net/buildroot/commit/?id=refs/heads/master
>>>
>>> If a package tries to static link with libavutil it fails due to the
>>> lack of libavutil private dependencies in libavutil.pc (-ldrm in this
>>> case).
>>>
>>> Add patch to:
>>> - Check if libdrm is present.
>>> - Add it to Libs.private: in libavutil.pc if present.
>>
>> ? I didn't want to push this one, it was just a test. The patch no longer applies
>> to ffmpeg 3.4.5 so this is causing autobuilder breakage. Therefore, I pushed a
>> revert commit.
>
> I've forgot it there pending on patchwork after ffmpeg bump.
I've marked it as Changes Requested now.
>
>> ? Giulio, FYI, upstream has added an explicit $LIBDRM but not to Libs.Private, so
>> the static linking case still breaks for the same reason. The patch just needs
>> to be rebased (and sent upstream).
>
> I've tried several times to discuss this on ffmpeg-devel:
> [1] http://ffmpeg.org/pipermail/ffmpeg-devel/2018-October/235269.html
> but they ignored my last patch:
> [2] http://ffmpeg.org/pipermail/ffmpeg-devel/2018-October/235417.html
> to fix the previous I've sent:
> [3] http://ffmpeg.org/pipermail/ffmpeg-devel/2018-October/235269.html
>
> I can't understand why they don't want to upstream my last patch[2]...
Same as everywhere: too many patches, too few reviewers. The reactions to v1
seemed to be positive. So if v2 still applies to current ffmpeg master, just
ping it; if it needs to be rebased, rebase it and resubmit.
Regards,
Arnout
>
> Anyway I'm going to submit the last one for Buildroot asap.
> I'm going to reproduce it right now.
>
> Best regards
>
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Buildroot] [git commit] ffmpeg: fix static linking build failure when using libavutil
2019-01-29 13:39 ` Arnout Vandecappelle
@ 2019-01-29 17:02 ` Giulio Benetti
2019-01-30 16:01 ` [Buildroot] [PATCH] ffmpeg: improve linking avoiding -ldrm to be appended when -lavutil is linked Giulio Benetti
1 sibling, 0 replies; 7+ messages in thread
From: Giulio Benetti @ 2019-01-29 17:02 UTC (permalink / raw)
To: buildroot
Hi Arnout,
Il 29/01/2019 14:39, Arnout Vandecappelle ha scritto:
>
>
> On 29/01/2019 13:30, Giulio Benetti wrote:
>> Hi Arnout,
>>
>> Il 29/01/2019 10:03, Arnout Vandecappelle ha scritto:
>>> ? Oopsie...
>>>
>>> On 29/01/2019 00:16, Arnout Vandecappelle (Essensium/Mind) wrote:
>>>> commit:
>>>> https://git.buildroot.net/buildroot/commit/?id=483db9908985d023b858c0b59d4016f9abb4b6f9
>>>>
>>>> branch: https://git.buildroot.net/buildroot/commit/?id=refs/heads/master
>>>>
>>>> If a package tries to static link with libavutil it fails due to the
>>>> lack of libavutil private dependencies in libavutil.pc (-ldrm in this
>>>> case).
>>>>
>>>> Add patch to:
>>>> - Check if libdrm is present.
>>>> - Add it to Libs.private: in libavutil.pc if present.
>>>
>>> ? I didn't want to push this one, it was just a test. The patch no longer applies
>>> to ffmpeg 3.4.5 so this is causing autobuilder breakage. Therefore, I pushed a
>>> revert commit.
>>
>> I've forgot it there pending on patchwork after ffmpeg bump.
>
> I've marked it as Changes Requested now.
>
>>
>>> ? Giulio, FYI, upstream has added an explicit $LIBDRM but not to Libs.Private, so
>>> the static linking case still breaks for the same reason. The patch just needs
>>> to be rebased (and sent upstream).
>>
>> I've tried several times to discuss this on ffmpeg-devel:
>> [1] http://ffmpeg.org/pipermail/ffmpeg-devel/2018-October/235269.html
>> but they ignored my last patch:
>> [2] http://ffmpeg.org/pipermail/ffmpeg-devel/2018-October/235417.html
>> to fix the previous I've sent:
>> [3] http://ffmpeg.org/pipermail/ffmpeg-devel/2018-October/235269.html
>>
>> I can't understand why they don't want to upstream my last patch[2]...
>
> Same as everywhere: too many patches, too few reviewers. The reactions to v1
> seemed to be positive. So if v2 still applies to current ffmpeg master, just
> ping it; if it needs to be rebased, rebase it and resubmit.
>
> Regards,
> Arnout
>
>>
>> Anyway I'm going to submit the last one for Buildroot asap.
>> I'm going to reproduce it right now.
I've just pinged on ffmpeg-devel about patch[2], I've put you in Cc.
I have also created BR patch and tested against autobuild failure
substituting 0002- patch.
Do I wait for an answer from ffmpeg-devel before submitting it on BR ML?
Thanks
Best regards
--
Giulio Benetti
CTO
MICRONOVA SRL
Sede: Via A. Niedda 3 - 35010 Vigonza (PD)
Tel. 049/8931563 - Fax 049/8931346
Cod.Fiscale - P.IVA 02663420285
Capitale Sociale ? 26.000 i.v.
Iscritta al Reg. Imprese di Padova N. 02663420285
Numero R.E.A. 258642
^ permalink raw reply [flat|nested] 7+ messages in thread
* [Buildroot] [PATCH] ffmpeg: improve linking avoiding -ldrm to be appended when -lavutil is linked
2019-01-29 13:39 ` Arnout Vandecappelle
2019-01-29 17:02 ` Giulio Benetti
@ 2019-01-30 16:01 ` Giulio Benetti
2019-04-03 21:24 ` Giulio Benetti
1 sibling, 1 reply; 7+ messages in thread
From: Giulio Benetti @ 2019-01-30 16:01 UTC (permalink / raw)
To: buildroot
Upstream ffmpeg patch[1] has a drawback. Linking against libavutil
results in appending -ldrm to library list in linker command tail, but
in shared linking this is no needed at all since shared linking is
transparent about library dependecies, hence -ldrm in this case is not
needed.
Add patch to avoid this behaviour by:
- Introducing new variable "privatelibs" that is assigned to
"Libs.private:" when creating various .pc files.
- Move $LIBDRM from extralibs_avutil to privatelibs_avutil
[1]
https://git.ffmpeg.org/gitweb/ffmpeg.git/commit/c50dc77ac708e98d02da7c422a6b9cbf9f565aa5
Signed-off-by: Giulio Benetti <giulio.benetti@micronovasrl.com>
---
...BDRM-to-Libs.private-instead-of-Libs.patch | 59 +++++++++++++++++++
1 file changed, 59 insertions(+)
create mode 100644 package/ffmpeg/0002-configure-add-LIBDRM-to-Libs.private-instead-of-Libs.patch
diff --git a/package/ffmpeg/0002-configure-add-LIBDRM-to-Libs.private-instead-of-Libs.patch b/package/ffmpeg/0002-configure-add-LIBDRM-to-Libs.private-instead-of-Libs.patch
new file mode 100644
index 0000000000..f19c74f228
--- /dev/null
+++ b/package/ffmpeg/0002-configure-add-LIBDRM-to-Libs.private-instead-of-Libs.patch
@@ -0,0 +1,59 @@
+From e34be93d478ad510960d03549572805a0430144c Mon Sep 17 00:00:00 2001
+From: Giulio Benetti <giulio.benetti@micronovasrl.com>
+Date: Sun, 21 Oct 2018 22:43:39 +0200
+Subject: [PATCH] configure: add LIBDRM to Libs.private instead of Libs
+
+Currently LIBDRM is appended to Libs: in libavutil.pc. This causes
+every program linking with avutil to link with -ldrm in both shared and
+static linking cases. In shared linking case it makes no sense, since
+-ldrm is a dependency of libavutil and is transparent while linking with
+libavutil
+
+- Add privatelibs_avutil variable for explicit private libraries to be
+ appended to Libs.private:
+- Add $LIBDRM to privatelibs_avutil.
+
+Signed-off-by: Giulio Benetti <giulio.benetti@micronovasrl.com>
+---
+ configure | 3 ++-
+ ffbuild/pkgconfig_generate.sh | 3 ++-
+ 2 files changed, 4 insertions(+), 2 deletions(-)
+
+diff --git a/configure b/configure
+index 9fe7760822..0996d8a85d 100755
+--- a/configure
++++ b/configure
+@@ -7096,7 +7096,8 @@ source_path=${source_path}
+ LIBPREF=${LIBPREF}
+ LIBSUF=${LIBSUF}
+
+-extralibs_avutil="$LIBRT $LIBDRM $LIBM"
++extralibs_avutil="$LIBRT $LIBM"
++privatelibs_avutil="$LIBDRM"
+ extralibs_avcodec="$extralibs"
+ extralibs_avformat="$extralibs"
+ extralibs_avdevice="$extralibs"
+diff --git a/ffbuild/pkgconfig_generate.sh b/ffbuild/pkgconfig_generate.sh
+index e5de6716d2..b86486a107 100755
+--- a/ffbuild/pkgconfig_generate.sh
++++ b/ffbuild/pkgconfig_generate.sh
+@@ -13,6 +13,7 @@ name=lib${shortname}
+ fullname=${name}${build_suffix}
+ comment=$2
+ libs=$(eval echo \$extralibs_${shortname})
++privatelibs=$(eval echo \$privatelibs_${shortname})
+ deps=$(eval echo \$${shortname}_deps)
+
+ for dep in $deps; do
+@@ -39,7 +40,7 @@ Requires: $($shared || echo $requires)
+ Requires.private: $($shared && echo $requires)
+ Conflicts:
+ Libs: -L\${libdir} $rpath -l${fullname#lib} $($shared || echo $libs)
+-Libs.private: $($shared && echo $libs)
++Libs.private: $($shared && echo $libs) ${privatelibs}
+ Cflags: -I\${includedir}
+ EOF
+
+--
+2.17.1
+
--
2.17.1
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [Buildroot] [PATCH] ffmpeg: improve linking avoiding -ldrm to be appended when -lavutil is linked
2019-01-30 16:01 ` [Buildroot] [PATCH] ffmpeg: improve linking avoiding -ldrm to be appended when -lavutil is linked Giulio Benetti
@ 2019-04-03 21:24 ` Giulio Benetti
0 siblings, 0 replies; 7+ messages in thread
From: Giulio Benetti @ 2019-04-03 21:24 UTC (permalink / raw)
To: buildroot
Il 30/01/2019 17:01, Giulio Benetti ha scritto:
> Upstream ffmpeg patch[1] has a drawback. Linking against libavutil
> results in appending -ldrm to library list in linker command tail, but
> in shared linking this is no needed at all since shared linking is
> transparent about library dependecies, hence -ldrm in this case is not
> needed.
>
> Add patch to avoid this behaviour by:
> - Introducing new variable "privatelibs" that is assigned to
> "Libs.private:" when creating various .pc files.
> - Move $LIBDRM from extralibs_avutil to privatelibs_avutil
>
> [1]
> https://git.ffmpeg.org/gitweb/ffmpeg.git/commit/c50dc77ac708e98d02da7c422a6b9cbf9f565aa5
>
> Signed-off-by: Giulio Benetti <giulio.benetti@micronovasrl.com>
> ---
> ...BDRM-to-Libs.private-instead-of-Libs.patch | 59 +++++++++++++++++++
> 1 file changed, 59 insertions(+)
> create mode 100644 package/ffmpeg/0002-configure-add-LIBDRM-to-Libs.private-instead-of-Libs.patch
>
> diff --git a/package/ffmpeg/0002-configure-add-LIBDRM-to-Libs.private-instead-of-Libs.patch b/package/ffmpeg/0002-configure-add-LIBDRM-to-Libs.private-instead-of-Libs.patch
> new file mode 100644
> index 0000000000..f19c74f228
> --- /dev/null
> +++ b/package/ffmpeg/0002-configure-add-LIBDRM-to-Libs.private-instead-of-Libs.patch
> @@ -0,0 +1,59 @@
> +From e34be93d478ad510960d03549572805a0430144c Mon Sep 17 00:00:00 2001
> +From: Giulio Benetti <giulio.benetti@micronovasrl.com>
> +Date: Sun, 21 Oct 2018 22:43:39 +0200
> +Subject: [PATCH] configure: add LIBDRM to Libs.private instead of Libs
> +
> +Currently LIBDRM is appended to Libs: in libavutil.pc. This causes
> +every program linking with avutil to link with -ldrm in both shared and
> +static linking cases. In shared linking case it makes no sense, since
> +-ldrm is a dependency of libavutil and is transparent while linking with
> +libavutil
> +
> +- Add privatelibs_avutil variable for explicit private libraries to be
> + appended to Libs.private:
> +- Add $LIBDRM to privatelibs_avutil.
> +
> +Signed-off-by: Giulio Benetti <giulio.benetti@micronovasrl.com>
> +---
> + configure | 3 ++-
> + ffbuild/pkgconfig_generate.sh | 3 ++-
> + 2 files changed, 4 insertions(+), 2 deletions(-)
> +
> +diff --git a/configure b/configure
> +index 9fe7760822..0996d8a85d 100755
> +--- a/configure
> ++++ b/configure
> +@@ -7096,7 +7096,8 @@ source_path=${source_path}
> + LIBPREF=${LIBPREF}
> + LIBSUF=${LIBSUF}
> +
> +-extralibs_avutil="$LIBRT $LIBDRM $LIBM"
> ++extralibs_avutil="$LIBRT $LIBM"
> ++privatelibs_avutil="$LIBDRM"
> + extralibs_avcodec="$extralibs"
> + extralibs_avformat="$extralibs"
> + extralibs_avdevice="$extralibs"
> +diff --git a/ffbuild/pkgconfig_generate.sh b/ffbuild/pkgconfig_generate.sh
> +index e5de6716d2..b86486a107 100755
> +--- a/ffbuild/pkgconfig_generate.sh
> ++++ b/ffbuild/pkgconfig_generate.sh
> +@@ -13,6 +13,7 @@ name=lib${shortname}
> + fullname=${name}${build_suffix}
> + comment=$2
> + libs=$(eval echo \$extralibs_${shortname})
> ++privatelibs=$(eval echo \$privatelibs_${shortname})
> + deps=$(eval echo \$${shortname}_deps)
> +
> + for dep in $deps; do
> +@@ -39,7 +40,7 @@ Requires: $($shared || echo $requires)
> + Requires.private: $($shared && echo $requires)
> + Conflicts:
> + Libs: -L\${libdir} $rpath -l${fullname#lib} $($shared || echo $libs)
> +-Libs.private: $($shared && echo $libs)
> ++Libs.private: $($shared && echo $libs) ${privatelibs}
> + Cflags: -I\${includedir}
> + EOF
> +
> +--
> +2.17.1
> +
>
This patch applied to 3.4.x version and wasn't vital since it didn't
create build failure.
FFmpeg will upstream patches only for security bugs, so this patch
doesn't make sense.
I set it rejected on Patchwork.
Best regards
--
Giulio Benetti
CTO
MICRONOVA SRL
Sede: Via A. Niedda 3 - 35010 Vigonza (PD)
Tel. 049/8931563 - Fax 049/8931346
Cod.Fiscale - P.IVA 02663420285
Capitale Sociale ? 26.000 i.v.
Iscritta al Reg. Imprese di Padova N. 02663420285
Numero R.E.A. 258642
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2019-04-03 21:24 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-28 23:16 [Buildroot] [git commit] ffmpeg: fix static linking build failure when using libavutil Arnout Vandecappelle
2019-01-29 9:03 ` Arnout Vandecappelle
2019-01-29 12:30 ` Giulio Benetti
2019-01-29 13:39 ` Arnout Vandecappelle
2019-01-29 17:02 ` Giulio Benetti
2019-01-30 16:01 ` [Buildroot] [PATCH] ffmpeg: improve linking avoiding -ldrm to be appended when -lavutil is linked Giulio Benetti
2019-04-03 21:24 ` Giulio Benetti
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.