From patchwork Wed Jan 30 16:01:16 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Giulio Benetti X-Patchwork-Id: 1033639 Return-Path: X-Original-To: incoming-buildroot@patchwork.ozlabs.org Delivered-To: patchwork-incoming-buildroot@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=busybox.net (client-ip=140.211.166.138; helo=whitealder.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=micronovasrl.com Authentication-Results: ozlabs.org; dkim=fail reason="key not found in DNS" (0-bit key; unprotected) header.d=micronovasrl.com header.i=@micronovasrl.com header.b="ENpCXwys"; dkim-atps=neutral Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 43qSm028LMz9sBQ for ; Thu, 31 Jan 2019 03:01:35 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 260EB871C5; Wed, 30 Jan 2019 16:01:30 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from whitealder.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id pHsa5zx00i9D; Wed, 30 Jan 2019 16:01:27 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by whitealder.osuosl.org (Postfix) with ESMTP id 3872C871B0; Wed, 30 Jan 2019 16:01:27 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by ash.osuosl.org (Postfix) with ESMTP id 91E611BF345 for ; Wed, 30 Jan 2019 16:01:25 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 8DB3A30B18 for ; Wed, 30 Jan 2019 16:01:25 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from silver.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id EPiVv68mgI2f for ; Wed, 30 Jan 2019 16:01:25 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mail.micronovasrl.com (mail.micronovasrl.com [212.103.203.10]) by silver.osuosl.org (Postfix) with ESMTP id B21EF221CC for ; Wed, 30 Jan 2019 16:01:24 +0000 (UTC) Received: from mail.micronovasrl.com (mail.micronovasrl.com [127.0.0.1]) by mail.micronovasrl.com (Postfix) with ESMTP id 515FAB00733 for ; Wed, 30 Jan 2019 17:01:22 +0100 (CET) Authentication-Results: mail.micronovasrl.com (amavisd-new); dkim=pass reason="pass (just generated, assumed good)" header.d=micronovasrl.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=micronovasrl.com; h=references:in-reply-to:x-mailer:message-id:date:date:subject :subject:to:from:from; s=dkim; t=1548864076; x=1549728077; bh=hD ktwFd5edf+94bHYbA43jgo5wJihu1iZAy4RVY+IMg=; b=ENpCXwys91+Y9PLv/8 M9Uw6Syp9gcIZqTp7VqhcEZ76WYYWWG0neyhMwABGLHGyG7UHEWoLp+MOHHmQYXF 2FaZLMHF6ylg3yzUqRS4+rvwy/HDjdmYXlPPIKkAO/zL8rlil8w0SOqm+qsYINWx EJKusxq5ec8LQvLkWRwFEQmzc= X-Virus-Scanned: Debian amavisd-new at mail.micronovasrl.com Received: from mail.micronovasrl.com ([127.0.0.1]) by mail.micronovasrl.com (mail.micronovasrl.com [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id 9aP1wfCY6LTT for ; Wed, 30 Jan 2019 17:01:16 +0100 (CET) Received: from ubuntu.localdomain (benettig-pc.dominio.micronovasrl.com [192.168.123.215]) by mail.micronovasrl.com (Postfix) with ESMTPSA id D3BD0B00112; Wed, 30 Jan 2019 17:01:16 +0100 (CET) From: Giulio Benetti To: buildroot@buildroot.org Date: Wed, 30 Jan 2019 17:01:16 +0100 Message-Id: <20190130160116.3782-1-giulio.benetti@micronovasrl.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <0535ae91-47fa-5a31-5ff6-7977c5bbbe8b@mind.be> References: <0535ae91-47fa-5a31-5ff6-7977c5bbbe8b@mind.be> Subject: [Buildroot] [PATCH] ffmpeg: improve linking avoiding -ldrm to be appended when -lavutil is linked X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Bernd Kuhls , Mahyar Koshkouei , Giulio Benetti MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "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 --- ...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 +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 +--- + 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 +