From patchwork Wed Nov 28 20:44:04 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Yann E. MORIN" X-Patchwork-Id: 1004830 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.136; helo=silver.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=free.fr Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="b7SMH5+K"; dkim-atps=neutral Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 434t1G637qz9s5c for ; Thu, 29 Nov 2018 07:44:17 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 950722E7EE; Wed, 28 Nov 2018 20:44:14 +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 7Z3EXJayheUc; Wed, 28 Nov 2018 20:44:13 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by silver.osuosl.org (Postfix) with ESMTP id DCBC72E7AB; Wed, 28 Nov 2018 20:44:13 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) by ash.osuosl.org (Postfix) with ESMTP id 4E8011BF32F for ; Wed, 28 Nov 2018 20:44:12 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 4B1328810C for ; Wed, 28 Nov 2018 20:44:12 +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 Xrb+dmUmE+BW for ; Wed, 28 Nov 2018 20:44:11 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-wr1-f67.google.com (mail-wr1-f67.google.com [209.85.221.67]) by hemlock.osuosl.org (Postfix) with ESMTPS id 96A5F88104 for ; Wed, 28 Nov 2018 20:44:11 +0000 (UTC) Received: by mail-wr1-f67.google.com with SMTP id 96so27729101wrb.2 for ; Wed, 28 Nov 2018 12:44:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id; bh=/p6ZsbVeqB0yraS9JC05LR+jpH+G86s65gWHAuZHxCI=; b=b7SMH5+KqUyryA59Zuehe0gs6qhLC4p/VpMYXpL7Dw50pvD1x6yZrstFuOXa49xx12 u4C4gb1Sr8e4CaOrvL7IiFypfDS2H4YtTzdeqeywarWV6g5ptWAbRqXte21GwnzGucxG xsw7gtG5bgxSvf6F2EddMRsdhPO/S1JqcORnIA+qNvboZaUrsFwJO0jIP2f5rgzPpTVa 47Qqa0xxK9g7WIWj1HinYe6E6caCMN4rcfzX3lNLtdkPSUmwW6F26Zf87LU0Lajyn6Dl GV7qa8MCw2FsSC2qWQHGiut1fPa4AXz5fn0bzXHDE/3nzNudaJxEs0+l6yaMXPViVQM1 MNxA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id; bh=/p6ZsbVeqB0yraS9JC05LR+jpH+G86s65gWHAuZHxCI=; b=oc62JRvA07QoiGZvRQhX/YU/3Qm+OctYk1vQVUoJ+T5TJHCzcvdXxMF6Zvq0cj57s/ M4tJjDksgyesWOTyO6nx5M1qt5Y53NTRFK6z4A6DF23imgJIuS1w0nthAWYP/KkkHCVc rJXisWHMhQX7d59u6Ap5/eP2AtWUOPS5T4HHdfAF71DkLmmeEDnpESuzxnJi35eXsIlv kTuG5IBA5zrSLP4naUEA9b/BACzRzomeIiaBRgnnKmdPUJ5y+heIc3fpb4TL43gvUg3+ 5Pew4waZx/DNaH/oCEEvC7cyjhCEfilBEKsuNUMEmWjtwdo65TSaVXDtzxsEl026X4H/ 0uUA== X-Gm-Message-State: AA+aEWaXR7LB9kACMAf8fFHLc99XzkZfVvHGHOZi/ZWylB6jaEiHUUyW XtZRerRFxSMFtE1ZdBDomPfGln21 X-Google-Smtp-Source: AFSGD/VllsjkdvnO5CMdELPXPP+il9p8aVbtpuMJPqZYy+easm+0MRXyC4WEMeJ3AtT8Z6w4oRZJRA== X-Received: by 2002:adf:a743:: with SMTP id e3mr31428887wrd.56.1543437849866; Wed, 28 Nov 2018 12:44:09 -0800 (PST) Received: from scaer.home ([2a01:cb19:829a:2800:68e8:7a61:9bb9:12a]) by smtp.gmail.com with ESMTPSA id a11sm17200wmh.26.2018.11.28.12.44.08 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 28 Nov 2018 12:44:08 -0800 (PST) From: "Yann E. MORIN" To: buildroot@buildroot.org Date: Wed, 28 Nov 2018 21:44:04 +0100 Message-Id: <20181128204404.12402-1-yann.morin.1998@free.fr> X-Mailer: git-send-email 2.14.1 Subject: [Buildroot] [PATCH] infra/pkg-generic: ensure absolute paths in config-script fixups 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: "Yann E. MORIN" , Thomas Petazzoni MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" In case a config script is called from a relative path, the $(dirnale $0) would return a relative path too. Those paths are usually parts of includes or libraries search directories, and the packagfes buildsystems may chdir() anywhere, and thus the relative path will no longer be valid. For example: $ ./host/powerpc-buildroot-linux-uclibc/sysroot/usr/bin/net-snmp-config --cflags [...] -I./host/powerpc-buildroot-linux-uclibc/sysroot/usr/bin/../../.././bin/../powerpc-buildroot-linux-uclibc/sysroot/usr/include/libnl3 [...] Canonicalise the path to be sure we use absolute paths. Signed-off-by: "Yann E. MORIN" Cc: Thomas Petazzoni --- package/pkg-generic.mk | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/package/pkg-generic.mk b/package/pkg-generic.mk index 887dc838a4..649a7ad187 100644 --- a/package/pkg-generic.mk +++ b/package/pkg-generic.mk @@ -280,8 +280,8 @@ $(BUILD_DIR)/%/.stamp_staging_installed: -e "s,^\(exec_\)\?prefix=.*,\1prefix=@STAGING_DIR@/usr,g" \ -e "s,-I/usr/,-I@STAGING_DIR@/usr/,g" \ -e "s,-L/usr/,-L@STAGING_DIR@/usr/,g" \ - -e 's,@STAGING_DIR@,$$(dirname $$0)/../..,g' \ - -e 's,@HOST_DIR@,$$(dirname $$0)/../../../..,g' \ + -e 's,@STAGING_DIR@,$$(dirname $$(realpath -e $$0))/../..,g' \ + -e 's,@HOST_DIR@,$$(dirname $$(realpath -e $$0))/../../../..,g' \ -e "s,@BASE_DIR@,$(BASE_DIR),g" \ $(addprefix $(STAGING_DIR)/usr/bin/,$($(PKG)_CONFIG_SCRIPTS)) ;\ fi