From patchwork Thu Jun 19 19:42:29 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas De Schampheleire X-Patchwork-Id: 361973 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from hemlock.osuosl.org (hemlock.osuosl.org [140.211.166.133]) by ozlabs.org (Postfix) with ESMTP id B1A90140092 for ; Fri, 20 Jun 2014 05:46:32 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id AD6EE93545; Thu, 19 Jun 2014 19:46:27 +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 2gmiPFViieRH; Thu, 19 Jun 2014 19:46:27 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by hemlock.osuosl.org (Postfix) with ESMTP id F1FAD93532; Thu, 19 Jun 2014 19:46:26 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from hemlock.osuosl.org (hemlock.osuosl.org [140.211.166.133]) by ash.osuosl.org (Postfix) with ESMTP id 5E2241BFA6C for ; Thu, 19 Jun 2014 19:46:23 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 5825E93513 for ; Thu, 19 Jun 2014 19:46:23 +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 Djz-XJzlmkfh for ; Thu, 19 Jun 2014 19:46:22 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-wi0-f170.google.com (mail-wi0-f170.google.com [209.85.212.170]) by hemlock.osuosl.org (Postfix) with ESMTPS id C1FA293472 for ; Thu, 19 Jun 2014 19:46:21 +0000 (UTC) Received: by mail-wi0-f170.google.com with SMTP id cc10so16711wib.3 for ; Thu, 19 Jun 2014 12:46:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=content-type:mime-version:content-transfer-encoding:subject :message-id:in-reply-to:references:user-agent:date:from:to:cc; bh=ED2g31O9eDKQ7dpdNusamxHLRs4hlb9zKgJycVA5mjU=; b=h84DA5IvcNKMpjBo0ycp9PxmZUTNkd9y7wyR+jYlfpmJs50aPKWESZh4zaoAN9r1T2 bjYjAlLJ/aJqLrdQ1hYIdofYlhu5rARzc0NF132xXbXpRxc6gynw4J7qndYm43IhXP25 VWGY27r22QibCeCE08OJVOFRz8HgOsAPupjHopMcC0roZnw/bUr5b59v2FMYKrhJaK2T +enhsRwjHR+qFCmlBgJ8T96Jqq/XIWKTqN13TKoncF4WoPIBV5Px7b5gmKWxY7Zi2pzA qIRf7CIRrVzFxBJQtEBWz/sejN03hmUg7BNfEzpVga72Gyowf3QWYF1MSx0QCgVFYGI1 iAMw== X-Received: by 10.180.81.72 with SMTP id y8mr9117785wix.7.1403207180305; Thu, 19 Jun 2014 12:46:20 -0700 (PDT) Received: from [127.0.0.1] (d54C62EEB.access.telenet.be. [84.198.46.235]) by mx.google.com with ESMTPSA id do5sm36058238wib.16.2014.06.19.12.46.18 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 19 Jun 2014 12:46:19 -0700 (PDT) MIME-Version: 1.0 X-Mercurial-Node: 5790ded0a7870de50d29bba23544e805c8e438bb Message-Id: <5790ded0a7870de50d29.1403206949@localhost> In-Reply-To: References: User-Agent: Mercurial-patchbomb/2.7.2 Date: Thu, 19 Jun 2014 21:42:29 +0200 From: Thomas De Schampheleire To: buildroot@buildroot.org Cc: rdghx@163.com, antoine.pierlot-garcin@scle.fr, benstoltz@gmail.com Subject: [Buildroot] [PATCH 3 of 3] pkgconf: don't double prefix lib/include paths with sysroot X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.14 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: buildroot-bounces@busybox.net Sender: buildroot-bounces@busybox.net A .pc file could contain statements of the form: -L/usr/lib but also: -L/path/to/sysroot/usr/lib The latter form typically occurs when the dependency was configured with a statement like --with-xxx=$(STAGING_DIR)/usr. pkgconf only expects the first form, and prefixes it with the specified sysroot. However, this strategy would result in a double sysroot in the second case: -L/path/to/sysroot/path/to/sysroot/usr/lib This patch checks for the presence of the sysroot in the specified -L or -I directives, and only adds the sysroot when not already present. Partially fixes bug #5750 (https://bugs.busybox.net/show_bug.cgi?id=5750) Signed-off-by: Thomas De Schampheleire --- package/pkgconf/pkgconf-02-fix-double-sysroot.patch | 40 +++++++++++++++ 1 files changed, 40 insertions(+), 0 deletions(-) diff -r 9bbc6f00bb24 -r 5790ded0a787 package/pkgconf/pkgconf-02-fix-double-sysroot.patch --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/package/pkgconf/pkgconf-02-fix-double-sysroot.patch Thu Jun 19 21:16:17 2014 +0200 @@ -0,0 +1,40 @@ +pkgconf: don't double prefix lib/include paths with sysroot + +A .pc file could contain statements of the form: + -L/usr/lib +but also: + -L/path/to/sysroot/usr/lib + +The latter form typically occurs when the dependency was configured with a +statement like --with-xxx=$(STAGING_DIR)/usr. + +pkgconf only expects the first form, and prefixes it with the specified +sysroot. However, this strategy would result in a double sysroot in the +second case: + -L/path/to/sysroot/path/to/sysroot/usr/lib + +This patch checks for the presence of the sysroot in the specified -L or -I +directives, and only adds the sysroot when not already present. + +Upstream-status: will be submitted + +Signed-off-by: Thomas De Schampheleire + +--- + main.c | 3 ++- + 1 files changed, 2 insertions(+), 1 deletions(-) + + +diff -r 16865d81819f -r 9d8e1737687f main.c +--- a/main.c Mon Jun 16 19:47:52 2014 +0200 ++++ b/main.c Mon Jun 16 19:48:15 2014 +0200 +@@ -82,7 +82,8 @@ + { + case 'L': + case 'I': +- return sysroot_dir; ++ if (strncmp(sysroot_dir, frag->data, strlen(sysroot_dir)) != 0) ++ return sysroot_dir; + default: + break; + }