From patchwork Thu Oct 29 20:06:49 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gary Bisson X-Patchwork-Id: 537993 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by ozlabs.org (Postfix) with ESMTP id 13C3C140D92 for ; Fri, 30 Oct 2015 07:07:26 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=boundarydevices_com.20150623.gappssmtp.com header.i=@boundarydevices_com.20150623.gappssmtp.com header.b=ZWKIkqJn; dkim-atps=neutral Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 41F4D911CB; Thu, 29 Oct 2015 20:07:25 +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 2WmFdgL1waSy; Thu, 29 Oct 2015 20:07:22 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by whitealder.osuosl.org (Postfix) with ESMTP id 585CA911D3; Thu, 29 Oct 2015 20:07:21 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) by ash.osuosl.org (Postfix) with ESMTP id CDDCD1C0110 for ; Thu, 29 Oct 2015 20:07:16 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id C9B2F911AB for ; Thu, 29 Oct 2015 20:07:16 +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 zmZBow2G7Mxf for ; Thu, 29 Oct 2015 20:07:14 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mail-wi0-f170.google.com (mail-wi0-f170.google.com [209.85.212.170]) by whitealder.osuosl.org (Postfix) with ESMTPS id 945D4911BE for ; Thu, 29 Oct 2015 20:07:14 +0000 (UTC) Received: by wijp11 with SMTP id p11so297357316wij.0 for ; Thu, 29 Oct 2015 13:07:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=boundarydevices_com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=SCpOXktSNMkOKYMCfaDi9Arn4y9YZqeCpm+ozkjuduo=; b=ZWKIkqJnm8eJpDEHrslfkm2YkFBr5DumL9uTcxvMeBsrdEeU4OhpVEhsMhybRhvos0 K8GqG/6T5LqUS5uzzN/f6QSoG2Fnx/7eetA158dvFPLoLXE6ZZOqk6jwV25Qb1zkxrNg JhpimZoHZo+p+Ivg08Ssr6p2ub3etdkbIba1RvG3Z2K24Nn2+QziyiLwf7/xbcO45ulE 8uFUunrsk8KGYf5nyWFlmUye1ySRG77Dhxw5iP0YzCxFtUq7/D9hX8+K5H1gB9c1xiA+ pEpZjPwPtiEnL0Zz//HjO5nAjoFkYRrMdaTQa9o1NX6e0oB9f1iZEEcxyOMraXcYtLj9 /lJA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=SCpOXktSNMkOKYMCfaDi9Arn4y9YZqeCpm+ozkjuduo=; b=DHoHcYyu0e1CaS8Pdwy8Wg1U25GCb51nKMgiRPboBOP+RXaCa6B+qaEbjI3c8juceP reukoeh3I61yAIN73ZjFyavaRsW1kRVZa1crgN8y+eG9j64b1BbMWK6F2/nSmzka2vNr YfPwXn9BJy7SARWqcCAxy6NmPADZ+X6U2Mo8PPX7K1fqiJzqPkPbrdHxnphkrCx36TJV xiRTgaiK9K+SxUIQVNWarrjmBxf9eYCNiwpe8IzL8P0Bh53fObJAHASDwcO9YQfMUGCs /Q3LfULlDaGyPXWpZ6OkvDoCxioW1JaOee5x0RHOeCQKWAwXn2h6FfKD06Hjes2eS6vV WPvA== X-Gm-Message-State: ALoCoQkYGVd4C/wZdFy15qdrX2lhd88dRMRGrf5WVNCgIHxNyysiC/+4HX1XupT7YWSv0mI0sNFR X-Received: by 10.194.91.164 with SMTP id cf4mr4323869wjb.139.1446149233293; Thu, 29 Oct 2015 13:07:13 -0700 (PDT) Received: from t450s.lan (89-92-157-132.hfc.dyn.abo.bbox.fr. [89.92.157.132]) by smtp.googlemail.com with ESMTPSA id vr10sm3407259wjc.38.2015.10.29.13.07.12 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 29 Oct 2015 13:07:12 -0700 (PDT) From: Gary Bisson To: buildroot@busybox.net Date: Thu, 29 Oct 2015 21:06:49 +0100 Message-Id: <1446149212-12048-2-git-send-email-gary.bisson@boundarydevices.com> X-Mailer: git-send-email 2.6.1 In-Reply-To: <1446149212-12048-1-git-send-email-gary.bisson@boundarydevices.com> References: <1446149212-12048-1-git-send-email-gary.bisson@boundarydevices.com> Cc: thomas.petazzoni@free-electrons.com, jezz@sysmic.org Subject: [Buildroot] [PATCH 1/4] libfslcodec: add install hooks to fix libraries path X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" By default, all the libraries are installed under /usr/lib/imx-mm which causes problems at runtime. The hooks are inspired from the mechanism used in the Yocto recipe: https://github.com/Freescale/meta-fsl-arm/blob/fido/recipes- multimedia/libfslcodec/libfslcodec.inc This has been tested implicitely by running Gstreamer without any special setup (no ld.so.conf nor LD_LIBRARY_PATH modification): # gst-launch-0.10 playbin uri=file:///root/tears_of_steel_1080p.webm # gst-launch-0.10 audiotestsrc ! mfw_mp3encoder ! fakesink # gst-launch-1.0 playbin uri=file:///root/tears_of_steel_1080p.webm Signed-off-by: Gary Bisson --- Here are the dependencies the pipelines above are testing: $ for i in `find target/usr/lib/gstreamer*/*`; do readelf -d $i | grep NEEDED | grep lib_ && echo "($i)"; done 0x00000001 (NEEDED) Shared library: [lib_nb_amr_dec_arm9_elinux.so.2] 0x00000001 (NEEDED) Shared library: [lib_wb_amr_dec_arm9_elinux.so.2] (target/usr/lib/gstreamer-0.10/libmfw_gst_amrdec.so) 0x00000001 (NEEDED) Shared library: [lib_peq_arm11_elinux.so.1.fhw] (target/usr/lib/gstreamer-0.10/libmfw_gst_audio_pp.so) 0x00000001 (NEEDED) Shared library: [lib_mp3_enc_arm12_elinux.so.2] (target/usr/lib/gstreamer-0.10/libmfw_gst_mp3enc.so) 0x00000001 (NEEDED) Shared library: [lib_mp3_enc_arm12_elinux.so.2] (target/usr/lib/gstreamer-1.0/libgstimxaudio.so) Note that I added a staging install hook as well because otherwise the gst1-imx plugin doesn't find lib_mp3_enc_arm12_elinux.so at build time. Not to copy the same library twice I decided to go with a symlink. Let me know if that's acceptable. Regards, Gary --- package/libfslcodec/libfslcodec.mk | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/package/libfslcodec/libfslcodec.mk b/package/libfslcodec/libfslcodec.mk index 473d662..4d8fd18 100644 --- a/package/libfslcodec/libfslcodec.mk +++ b/package/libfslcodec/libfslcodec.mk @@ -20,4 +20,20 @@ endef # FIXME The Makefile installs both the arm9 and arm11 versions of the # libraries, but we only need one of them. +# do the symlink in staging area as some packages like gst-fsl-plugins is +# looking for libraries in imx-mm whereas gst1-imx doesn't +define LIBFSLCODEC_FIXUP_STAGING_PATH + find $(STAGING_DIR)/usr/lib/imx-mm -mindepth 2 -maxdepth 2 -not -type d \ + -exec ln -fs {} $(STAGING_DIR)/usr/lib \; +endef +LIBFSLCODEC_POST_INSTALL_STAGING_HOOKS += LIBFSLCODEC_FIXUP_STAGING_PATH + +# no need to symlink in target image, just move libraries around +define LIBFSLCODEC_FIXUP_TARGET_PATH + find $(TARGET_DIR)/usr/lib/imx-mm -mindepth 2 -maxdepth 2 -not -type d \ + -exec mv {} $(TARGET_DIR)/usr/lib \; + rm -fr $(TARGET_DIR)/usr/lib/imx-mm +endef +LIBFSLCODEC_POST_INSTALL_TARGET_HOOKS += LIBFSLCODEC_FIXUP_TARGET_PATH + $(eval $(autotools-package))