From patchwork Sun Jul 12 16:26:31 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Samuel Martin X-Patchwork-Id: 494137 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) by ozlabs.org (Postfix) with ESMTP id 2B3A01402B6 for ; Mon, 13 Jul 2015 02:26:56 +1000 (AEST) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b=o9AviN3Q; dkim-atps=neutral Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 5E5C6332F3; Sun, 12 Jul 2015 16:26:55 +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 Kf7JLv+DxT7v; Sun, 12 Jul 2015 16:26:48 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by silver.osuosl.org (Postfix) with ESMTP id 25AD5332E3; Sun, 12 Jul 2015 16:26:48 +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 19E6E1C226F for ; Sun, 12 Jul 2015 16:26:47 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 152CF91209 for ; Sun, 12 Jul 2015 16:26:47 +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 cMrrb-CbclMW for ; Sun, 12 Jul 2015 16:26:46 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-wi0-f173.google.com (mail-wi0-f173.google.com [209.85.212.173]) by whitealder.osuosl.org (Postfix) with ESMTPS id 39CD19116C for ; Sun, 12 Jul 2015 16:26:46 +0000 (UTC) Received: by wicmz13 with SMTP id mz13so44130056wic.0 for ; Sun, 12 Jul 2015 09:26:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=TUVQ3FjWtX98pt24XB7mAn9f4LjztCwbITp0+Oyi5ds=; b=o9AviN3QavZjUHLm6sQHL1VLfi0VLaqQ23WXr/4WPkl0FsDR3NaXGIb0cS1071Pt/F nOcVJ3pWccN5/EzFBnahOusoZu3tYSvtcyOevqwMs0oee9pgqG3N6bQSKEaAdIUCcTbX sQllbqcmvIrPEfiL4nD/YoaWRAcvupbGmXKetW8BPQyD+CeBQOpRbrAwuyvBD1tdxMPW Cahtnpx+cQYuFZllEau50rrMb97XpEKTbfNAMoukVScWLybuenxXd5ZUC3cA8H1KQO94 PtwX/pfqYWoxd0LflAhEC+4r/qXVrrAbV6nBKLJfcYp8ve+pAK5ARB19ioVVbRAmQktN 1e5Q== X-Received: by 10.194.109.167 with SMTP id ht7mr57191327wjb.60.1436718404785; Sun, 12 Jul 2015 09:26:44 -0700 (PDT) Received: from bobook.localdomain (AToulouse-657-1-1031-128.w92-134.abo.wanadoo.fr. [92.134.9.128]) by smtp.gmail.com with ESMTPSA id q4sm24126215wja.24.2015.07.12.09.26.43 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 12 Jul 2015 09:26:43 -0700 (PDT) From: Samuel Martin To: buildroot@buildroot.org Date: Sun, 12 Jul 2015 18:26:31 +0200 Message-Id: <1436718395-10536-3-git-send-email-s.martin49@gmail.com> X-Mailer: git-send-email 2.4.5 In-Reply-To: <1436718395-10536-1-git-send-email-s.martin49@gmail.com> References: <1436718395-10536-1-git-send-email-s.martin49@gmail.com> Subject: [Buildroot] [PATCH 2/6] package/pkg-utils.mk: add get_rpaths helpers 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" This helper computes the value of the RPATH for the given binary. Signed-off-by: Samuel Martin --- package/pkg-utils.mk | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/package/pkg-utils.mk b/package/pkg-utils.mk index 442c528..b556525 100644 --- a/package/pkg-utils.mk +++ b/package/pkg-utils.mk @@ -54,6 +54,18 @@ relative-path = $(strip \ $(__r)$(subst /%,%,$(2)))) +# Return the RPATH value starting with XORIGIN instead of $ORIGIN. +# This helper supports multi-libdirs in RPATH. +# $1: base directory, e.g. $(HOST_DIR) +# $2: binary path (should start with base directory) +# $3: libdirs, a space-separated list of paths (each libdir should +# start with base directory) +get_rpaths = $(eval __rp :=) \ + $(foreach libdir,$(3),\ + $(eval __rp := $(__rp):XORIGIN/$(call \ + relative-path,$(dir $(patsubst $(1)%,%,$(2))),$(patsubst $(1)%,%,$(libdir))))) \ + $(patsubst :%,%,$(__rp)) + # # Manipulation of .config files based on the Kconfig # infrastructure. Used by the BusyBox package, the Linux kernel