From patchwork Sun Jun 28 19:42:40 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabio Porcedda X-Patchwork-Id: 489160 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by ozlabs.org (Postfix) with ESMTP id 4706D14077A for ; Mon, 29 Jun 2015 05:43:33 +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=nCnHT/AD; dkim-atps=neutral Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 796629DF27; Sun, 28 Jun 2015 19:43:32 +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 BABcymLg2AXH; Sun, 28 Jun 2015 19:43:31 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by fraxinus.osuosl.org (Postfix) with ESMTP id 20AE8A1636; Sun, 28 Jun 2015 19:43:12 +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 65B141C1EFA for ; Sun, 28 Jun 2015 19:43:03 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 62676320E4 for ; Sun, 28 Jun 2015 19:43:03 +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 Dw7GzOpYJBJA for ; Sun, 28 Jun 2015 19:43:03 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-wi0-f180.google.com (mail-wi0-f180.google.com [209.85.212.180]) by silver.osuosl.org (Postfix) with ESMTPS id AABAC303D9 for ; Sun, 28 Jun 2015 19:43:02 +0000 (UTC) Received: by wibdq8 with SMTP id dq8so55367138wib.1 for ; Sun, 28 Jun 2015 12:43:01 -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=T3SKeNnWognr6b3scvnIhp8+Fk9HEXhGdn8+mtoFe4w=; b=nCnHT/ADpZCvIwYR3tU1x2FV3ARJWvJeGZV3W4Svuzhjich67Sr40pTVv+Hk5kQZwU Boy0J5XxXsK78dltE4sK/zENNm0l9j1HQkPpRcRN9pZ+Py42Ya2SwYqLP79Y68m/gL0A ijU6uVo9nEFZB1Jeq6zLZNmh8TNBuAknpaRY38jW6cOqHdaH0RT2ZMyoIU7zqu7D30DU wAy9vbA+4+71vaJ3ZSGL4C04DSwahLASP1HHKV+kBO6Xx5Yy05qb3gfDs3nvYNzhuLHZ yVVSVahY1J+UsYQ3lkZYCXmu/fcMcdUk2d4rTQO4e8GC9KzzKAgm/sI461hHLyKbdYKh UPvQ== X-Received: by 10.180.74.210 with SMTP id w18mr15891250wiv.77.1435520581361; Sun, 28 Jun 2015 12:43:01 -0700 (PDT) Received: from beast.localdomain (dynamic-adsl-78-15-144-100.clienti.tiscali.it. [78.15.144.100]) by mx.google.com with ESMTPSA id ex8sm3789243wjc.34.2015.06.28.12.42.59 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 28 Jun 2015 12:43:00 -0700 (PDT) From: Fabio Porcedda To: buildroot@uclibc.org Date: Sun, 28 Jun 2015 21:42:40 +0200 Message-Id: <1435520570-20332-7-git-send-email-fabio.porcedda@gmail.com> X-Mailer: git-send-email 2.4.3 In-Reply-To: <1435520570-20332-1-git-send-email-fabio.porcedda@gmail.com> References: <1435520570-20332-1-git-send-email-fabio.porcedda@gmail.com> Subject: [Buildroot] [RFC v4 06/16] tooclahin-external: add support for GCC_SYSROOT 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" To support the per-package staging feature, when the GCC_SYSROOT environament variable is defined pass it to gcc in the "--sysroot" option. Signed-off-by: Fabio Porcedda --- toolchain/toolchain-external/ext-toolchain-wrapper.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/toolchain/toolchain-external/ext-toolchain-wrapper.c b/toolchain/toolchain-external/ext-toolchain-wrapper.c index e2d01dc..f262b3d 100644 --- a/toolchain/toolchain-external/ext-toolchain-wrapper.c +++ b/toolchain/toolchain-external/ext-toolchain-wrapper.c @@ -98,6 +98,7 @@ int main(int argc, char **argv) char *basename; char *env_debug; char *paranoid_wrapper; + char *gcc_sysroot; int paranoid; int ret, i, count = 0, debug; @@ -145,7 +146,13 @@ int main(int argc, char **argv) perror(__FILE__ ": overflow"); return 3; } - ret = snprintf(sysroot, sizeof(sysroot), "%s/" BR_SYSROOT, absbasedir); + gcc_sysroot = getenv("GCC_SYSROOT"); + if (gcc_sysroot) { + ret = snprintf(sysroot, sizeof(sysroot), "%s", gcc_sysroot); + } else { + ret = snprintf(sysroot, sizeof(sysroot), "%s/" BR_SYSROOT, \ + absbasedir); + } if (ret >= sizeof(sysroot)) { perror(__FILE__ ": overflow"); return 3;