From patchwork Wed Oct 17 12:49:12 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Giulio Benetti X-Patchwork-Id: 985375 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.133; helo=hemlock.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="agD+Pz27"; dkim-atps=neutral Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 42ZsTM5z0qz9s8J for ; Wed, 17 Oct 2018 23:49:59 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 0A59187372; Wed, 17 Oct 2018 12:49:56 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from hemlock.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id uumCmT055pEH; Wed, 17 Oct 2018 12:49:54 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by hemlock.osuosl.org (Postfix) with ESMTP id 777B18735B; Wed, 17 Oct 2018 12:49:54 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by ash.osuosl.org (Postfix) with ESMTP id 8CEE31BF4E7 for ; Wed, 17 Oct 2018 12:49:53 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 89F2285EA5 for ; Wed, 17 Oct 2018 12:49:53 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from fraxinus.osuosl.org ([127.0.0.1]) by localhost (.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id kzEXLMiP0RuT for ; Wed, 17 Oct 2018 12:49:53 +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 fraxinus.osuosl.org (Postfix) with ESMTP id BC38285D4C for ; Wed, 17 Oct 2018 12:49:52 +0000 (UTC) Received: from mail.micronovasrl.com (mail.micronovasrl.com [127.0.0.1]) by mail.micronovasrl.com (Postfix) with ESMTP id D3E97B0177E for ; Wed, 17 Oct 2018 14:49:51 +0200 (CEST) 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=1539780590; x=1540644591; bh=uT x1lEz3xzVvjJ2QSHABSLWIiFlIzEvObFldEc6II2s=; b=agD+Pz277zDrNUVLk0 Y3WfaUyjHh+ZZUu7rgl9l3pOyhP5HWl3mZeq14kBKVUzMl8xVTtpUfjRVdW0WbOK rwB9cRQLawTNgnrn51bwC9xUs3dhyzGpVlpWhRyfnKwBGKGU/yZigbUxdbuo6bhs 3QkmS5IhyLOloMTJFcu/zv6jc= 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 JHgWYbhTnshV for ; Wed, 17 Oct 2018 14:49:50 +0200 (CEST) Received: from localhost.localdomain (host128-8-dynamic.21-79-r.retail.telecomitalia.it [79.21.8.128]) by mail.micronovasrl.com (Postfix) with ESMTPSA id 1871EB01746; Wed, 17 Oct 2018 14:49:50 +0200 (CEST) From: Giulio Benetti To: buildroot@buildroot.org Date: Wed, 17 Oct 2018 14:49:12 +0200 Message-Id: <20181017124912.22913-1-giulio.benetti@micronovasrl.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <70678949-7644-e4e6-93cd-15227cb4bb90@micronovasrl.com> References: <70678949-7644-e4e6-93cd-15227cb4bb90@micronovasrl.com> Subject: [Buildroot] [PATCH v3] ffmpeg: fix static linking build failure when using libavutil 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 , Thomas Petazzoni MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" 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 --- Changes V1->V2: * Modified ffmpeg patch to move -ldrm from "Libs:" to "Libs.private:" in libavutil.pc * Rewritten commit log from scratch Changes V2->V3: * Added "Changes V1->V2" after commit log forgotten in v2 version ...configure-add-LIBDRM-to-Libs.private.patch | 68 +++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 package/ffmpeg/0002-configure-add-LIBDRM-to-Libs.private.patch 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 +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 +--- + 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 +