From patchwork Fri Dec 1 20:53:38 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Petazzoni X-Patchwork-Id: 843728 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@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=) Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3ypRMw144lz9sNd for ; Sat, 2 Dec 2017 07:54:19 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 363D930BDD; Fri, 1 Dec 2017 20:54:16 +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 wCoOgEPncFr9; Fri, 1 Dec 2017 20:54:15 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by silver.osuosl.org (Postfix) with ESMTP id 0442A2FF19; Fri, 1 Dec 2017 20:54:15 +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 855501C436D for ; Fri, 1 Dec 2017 20:54:13 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 7F81289BB6 for ; Fri, 1 Dec 2017 20:54:13 +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 8pm6CFIBshcu for ; Fri, 1 Dec 2017 20:54:12 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail.free-electrons.com (mail.free-electrons.com [62.4.15.54]) by whitealder.osuosl.org (Postfix) with ESMTP id 2F9818978A for ; Fri, 1 Dec 2017 20:54:12 +0000 (UTC) Received: by mail.free-electrons.com (Postfix, from userid 110) id 22B1A206EF; Fri, 1 Dec 2017 21:54:10 +0100 (CET) Received: from localhost (LFbn-TOU-1-149-75.w86-201.abo.wanadoo.fr [86.201.231.75]) by mail.free-electrons.com (Postfix) with ESMTPSA id EA5B520396; Fri, 1 Dec 2017 21:53:59 +0100 (CET) From: Thomas Petazzoni To: Buildroot List , "Arnout Vandecappelle (Essensium/Mind)" , "Yann E. MORIN" , Peter Korsgaard Date: Fri, 1 Dec 2017 21:53:38 +0100 Message-Id: <20171201205352.24287-2-thomas.petazzoni@free-electrons.com> X-Mailer: git-send-email 2.13.6 In-Reply-To: <20171201205352.24287-1-thomas.petazzoni@free-electrons.com> References: <20171201205352.24287-1-thomas.petazzoni@free-electrons.com> Subject: [Buildroot] [RFCv3 01/15] pkgconf: use relative path to STAGING_DIR instead of absolute path X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.24 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Thomas Petazzoni MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" The pkg-config wrapper script is currently generated with absolute paths to $(STAGING_DIR). However, this will not work properly with per-package SDK, and each package will be built with a different STAGING_DIR value. In order to fix this, we adjust how the pkg-config wrapper script is generated, so that it uses a relative path to itself: the sysroot (i.e STAGING_DIR) is always located in $(path of pkg-config)/../$(STAGING_SUBDIR). This change is independent from the per-package SDK work, and could be applied independently from it. Signed-off-by: Thomas Petazzoni Reviewed-by: "Yann E. MORIN" --- Changes since v2: - None Changes since v1: - As suggested by Arnout, simplify the generation of the pkg-config script by doing only a replacement on @STAGING_SUBDIR@, the rest being encoded inside the pkg-config script. --- package/pkgconf/pkg-config.in | 5 ++++- package/pkgconf/pkgconf.mk | 3 +-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/package/pkgconf/pkg-config.in b/package/pkgconf/pkg-config.in index 4dec48789a..b9ce0935cc 100644 --- a/package/pkgconf/pkg-config.in +++ b/package/pkgconf/pkg-config.in @@ -1,2 +1,5 @@ #!/bin/sh -PKG_CONFIG_LIBDIR=${PKG_CONFIG_LIBDIR:-@PKG_CONFIG_LIBDIR@} PKG_CONFIG_SYSROOT_DIR=${PKG_CONFIG_SYSROOT_DIR:-@STAGING_DIR@} $(dirname $0)/pkgconf @STATIC@ $@ +PKGCONFDIR=$(dirname $0) +DEFAULT_PKG_CONFIG_LIBDIR=${PKGCONFDIR}/../@STAGING_SUBDIR@/usr/lib/pkgconfig:${PKGCONFDIR}/../@STAGING_SUBDIR@/usr/share/pkgconfig +DEFAULT_PKG_CONFIG_SYSROOT_DIR=${PKGCONFDIR}/../@STAGING_SUBDIR@ +PKG_CONFIG_LIBDIR=${PKG_CONFIG_LIBDIR:-${DEFAULT_PKG_CONFIG_LIBDIR}} PKG_CONFIG_SYSROOT_DIR=${PKG_CONFIG_SYSROOT_DIR:-${DEFAULT_PKG_CONFIG_SYSROOT_DIR}} ${PKGCONFDIR}/pkgconf @STATIC@ $@ diff --git a/package/pkgconf/pkgconf.mk b/package/pkgconf/pkgconf.mk index cc190d26da..00b2d017ee 100644 --- a/package/pkgconf/pkgconf.mk +++ b/package/pkgconf/pkgconf.mk @@ -19,8 +19,7 @@ endef define HOST_PKGCONF_INSTALL_WRAPPER $(INSTALL) -m 0755 -D package/pkgconf/pkg-config.in \ $(HOST_DIR)/bin/pkg-config - $(SED) 's,@PKG_CONFIG_LIBDIR@,$(STAGING_DIR)/usr/lib/pkgconfig:$(STAGING_DIR)/usr/share/pkgconfig,' \ - -e 's,@STAGING_DIR@,$(STAGING_DIR),' \ + $(SED) 's,@STAGING_SUBDIR@,$(STAGING_SUBDIR),g' \ $(HOST_DIR)/bin/pkg-config endef From patchwork Fri Dec 1 20:53:39 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Petazzoni X-Patchwork-Id: 843732 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=busybox.net (client-ip=140.211.166.138; helo=whitealder.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Received: from whitealder.osuosl.org (smtp1.osuosl.org [140.211.166.138]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3ypRN359HWz9sNd for ; Sat, 2 Dec 2017 07:54:27 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id ADF3781414; Fri, 1 Dec 2017 20:54:20 +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 rG8S9PilS-Cy; Fri, 1 Dec 2017 20:54:18 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by whitealder.osuosl.org (Postfix) with ESMTP id 6F7FF89BB5; Fri, 1 Dec 2017 20:54:18 +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 E8BCE1C436D for ; Fri, 1 Dec 2017 20:54:13 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id E5C918A54D for ; Fri, 1 Dec 2017 20:54:13 +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 mti04tD236Y2 for ; Fri, 1 Dec 2017 20:54:12 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail.free-electrons.com (mail.free-electrons.com [62.4.15.54]) by hemlock.osuosl.org (Postfix) with ESMTP id 2A6098A556 for ; Fri, 1 Dec 2017 20:54:12 +0000 (UTC) Received: by mail.free-electrons.com (Postfix, from userid 110) id 62AEA20396; Fri, 1 Dec 2017 21:54:10 +0100 (CET) Received: from localhost (LFbn-TOU-1-149-75.w86-201.abo.wanadoo.fr [86.201.231.75]) by mail.free-electrons.com (Postfix) with ESMTPSA id 3ABD220411; Fri, 1 Dec 2017 21:54:00 +0100 (CET) From: Thomas Petazzoni To: Buildroot List , "Arnout Vandecappelle (Essensium/Mind)" , "Yann E. MORIN" , Peter Korsgaard Date: Fri, 1 Dec 2017 21:53:39 +0100 Message-Id: <20171201205352.24287-3-thomas.petazzoni@free-electrons.com> X-Mailer: git-send-email 2.13.6 In-Reply-To: <20171201205352.24287-1-thomas.petazzoni@free-electrons.com> References: <20171201205352.24287-1-thomas.petazzoni@free-electrons.com> Subject: [Buildroot] [RFCv3 02/15] toolchain: post-pone evaluation of TOOLCHAIN_EXTERNAL_BIN X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.24 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Thomas Petazzoni MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" The upcoming per-package SDK functionality is heavily based on the fact that HOST_DIR, STAGING_DIR and TARGET_DIR are evaluated during the configure/build/install steps of the packages. Therefore, any evaluation-during-assignment using := is going to cause problems, and need to be turned into evaluation-during-use using =. This patch fix up one such instance in the external toolchain code. This change is independent from the per-package SDK functionality, and could be applied separately. Signed-off-by: Thomas Petazzoni Reviewed-by: Arnout Vandecappelle (Essensium/Mind) Reviewed-by: "Yann E. MORIN" --- Changes since v2: - None Changes since v1: - Added Arnout Reviewed-by. --- toolchain/toolchain-external/pkg-toolchain-external.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/toolchain/toolchain-external/pkg-toolchain-external.mk b/toolchain/toolchain-external/pkg-toolchain-external.mk index dc0588c536..b9ad1720a1 100644 --- a/toolchain/toolchain-external/pkg-toolchain-external.mk +++ b/toolchain/toolchain-external/pkg-toolchain-external.mk @@ -77,7 +77,7 @@ ifneq ($(TOOLCHAIN_EXTERNAL_PREFIX),) TOOLCHAIN_EXTERNAL_BIN := $(dir $(shell which $(TOOLCHAIN_EXTERNAL_PREFIX)-gcc)) endif else -TOOLCHAIN_EXTERNAL_BIN := $(TOOLCHAIN_EXTERNAL_INSTALL_DIR)/bin +TOOLCHAIN_EXTERNAL_BIN = $(TOOLCHAIN_EXTERNAL_INSTALL_DIR)/bin endif # If this is a buildroot toolchain, it already has a wrapper which we want to From patchwork Fri Dec 1 20:53:40 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Petazzoni X-Patchwork-Id: 843730 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@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=) Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3ypRN117GHz9sNc for ; Sat, 2 Dec 2017 07:54:25 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 46C4030BE2; Fri, 1 Dec 2017 20:54:19 +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 L-VmY+x1KCoo; Fri, 1 Dec 2017 20:54:17 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by silver.osuosl.org (Postfix) with ESMTP id 069EB30BE6; Fri, 1 Dec 2017 20:54:17 +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 C12991C436D for ; Fri, 1 Dec 2017 20:54:13 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id BD9CB8A55C for ; Fri, 1 Dec 2017 20:54:13 +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 fW1xhy7DA+ou for ; Fri, 1 Dec 2017 20:54:12 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail.free-electrons.com (mail.free-electrons.com [62.4.15.54]) by hemlock.osuosl.org (Postfix) with ESMTP id 2A5B88A54D for ; Fri, 1 Dec 2017 20:54:12 +0000 (UTC) Received: by mail.free-electrons.com (Postfix, from userid 110) id AC5C720411; Fri, 1 Dec 2017 21:54:10 +0100 (CET) Received: from localhost (LFbn-TOU-1-149-75.w86-201.abo.wanadoo.fr [86.201.231.75]) by mail.free-electrons.com (Postfix) with ESMTPSA id 7E61020503; Fri, 1 Dec 2017 21:54:00 +0100 (CET) From: Thomas Petazzoni To: Buildroot List , "Arnout Vandecappelle (Essensium/Mind)" , "Yann E. MORIN" , Peter Korsgaard Date: Fri, 1 Dec 2017 21:53:40 +0100 Message-Id: <20171201205352.24287-4-thomas.petazzoni@free-electrons.com> X-Mailer: git-send-email 2.13.6 In-Reply-To: <20171201205352.24287-1-thomas.petazzoni@free-electrons.com> References: <20171201205352.24287-1-thomas.petazzoni@free-electrons.com> Subject: [Buildroot] [RFCv3 03/15] Makefile, skeleton: move the host skeleton logic to host-skeleton package X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.24 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Thomas Petazzoni MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" As part of the per-package SDK work, we want to avoid having logic that installs files to the global HOST_DIR, and instead do it inside packages. One thing that gets installed to the global HOST_DIR is the minimal "skeleton" that we create in host: - the "usr" symbolic link for backward compatibility - the "lib" directory, and its lib64 or lib32 symbolic links This commit moves this logic to a new host-skeleton package, and makes all packages (except itself) depend on it. We also make sure that this host-skeleton package doesn't depend on host-patchelf, because host-patchelf depends on host-skeleton. Signed-off-by: Thomas Petazzoni Reviewed-by: "Yann E. MORIN" --- Changes since v2: - None Changes since v1: - New patch --- Makefile | 13 +------------ package/pkg-generic.mk | 4 ++++ package/skeleton/skeleton.mk | 12 ++++++++++++ 3 files changed, 17 insertions(+), 12 deletions(-) diff --git a/Makefile b/Makefile index d52852153f..56bf083098 100644 --- a/Makefile +++ b/Makefile @@ -544,7 +544,7 @@ endif .PHONY: dirs dirs: $(BUILD_DIR) $(STAGING_DIR) $(TARGET_DIR) \ - $(HOST_DIR) $(HOST_DIR)/usr $(HOST_DIR)/lib $(BINARIES_DIR) + $(HOST_DIR) $(BINARIES_DIR) $(BUILD_DIR)/buildroot-config/auto.conf: $(BR2_CONFIG) $(MAKE1) $(EXTRAMAKEARGS) HOSTCC="$(HOSTCC_NOCCACHE)" HOSTCXX="$(HOSTCXX_NOCCACHE)" silentoldconfig @@ -563,17 +563,6 @@ sdk: world $(INSTALL) -m 755 $(TOPDIR)/support/misc/relocate-sdk.sh $(HOST_DIR)/relocate-sdk.sh echo $(HOST_DIR) > $(HOST_DIR)/share/buildroot/sdk-location -# Compatibility symlink in case a post-build script still uses $(HOST_DIR)/usr -$(HOST_DIR)/usr: $(HOST_DIR) - @ln -snf . $@ - -$(HOST_DIR)/lib: $(HOST_DIR) - @mkdir -p $@ - @case $(HOSTARCH) in \ - (*64) ln -snf lib $(@D)/lib64;; \ - (*) ln -snf lib $(@D)/lib32;; \ - esac - # Populating the staging with the base directories is handled by the skeleton package $(STAGING_DIR): @mkdir -p $(STAGING_DIR) diff --git a/package/pkg-generic.mk b/package/pkg-generic.mk index fb5a1ca725..0019814276 100644 --- a/package/pkg-generic.mk +++ b/package/pkg-generic.mk @@ -577,6 +577,10 @@ $(2)_DEPENDENCIES += toolchain endif endif +ifneq ($(1),host-skeleton) +$(2)_DEPENDENCIES += host-skeleton +endif + # Eliminate duplicates in dependencies $(2)_FINAL_DEPENDENCIES = $$(sort $$($(2)_DEPENDENCIES)) $(2)_FINAL_PATCH_DEPENDENCIES = $$(sort $$($(2)_PATCH_DEPENDENCIES)) diff --git a/package/skeleton/skeleton.mk b/package/skeleton/skeleton.mk index d380f41649..a32bacd0b3 100644 --- a/package/skeleton/skeleton.mk +++ b/package/skeleton/skeleton.mk @@ -11,4 +11,16 @@ SKELETON_ADD_TOOLCHAIN_DEPENDENCY = NO SKELETON_ADD_SKELETON_DEPENDENCY = NO +# We create a compatibility symlink in case a post-build script still +# uses $(HOST_DIR)/usr +define HOST_SKELETON_INSTALL_CMDS + @ln -snf . $(HOST_DIR)/usr + @mkdir -p $(HOST_DIR)/lib + @case $(HOSTARCH) in \ + (*64) ln -snf lib $(HOST_DIR)/lib64;; \ + (*) ln -snf lib $(HOST_DIR)/lib32;; \ + esac +endef + $(eval $(virtual-package)) +$(eval $(host-generic-package)) From patchwork Fri Dec 1 20:53:41 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Petazzoni X-Patchwork-Id: 843727 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=busybox.net (client-ip=140.211.166.137; helo=fraxinus.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3ypRMv1fpwz9sNc for ; Sat, 2 Dec 2017 07:54:18 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 67EF7887AA; Fri, 1 Dec 2017 20:54:16 +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 mNxO22xzI66L; Fri, 1 Dec 2017 20:54:15 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by fraxinus.osuosl.org (Postfix) with ESMTP id CB763887AC; Fri, 1 Dec 2017 20:54:15 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by ash.osuosl.org (Postfix) with ESMTP id 89E6E1CEFA4 for ; Fri, 1 Dec 2017 20:54:13 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 86F4688C91 for ; Fri, 1 Dec 2017 20:54:13 +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 165aPq-i9iSZ for ; Fri, 1 Dec 2017 20:54:12 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail.free-electrons.com (mail.free-electrons.com [62.4.15.54]) by fraxinus.osuosl.org (Postfix) with ESMTP id 2D696887AC for ; Fri, 1 Dec 2017 20:54:12 +0000 (UTC) Received: by mail.free-electrons.com (Postfix, from userid 110) id EEA1720503; Fri, 1 Dec 2017 21:54:10 +0100 (CET) Received: from localhost (LFbn-TOU-1-149-75.w86-201.abo.wanadoo.fr [86.201.231.75]) by mail.free-electrons.com (Postfix) with ESMTPSA id C37E72055E; Fri, 1 Dec 2017 21:54:00 +0100 (CET) From: Thomas Petazzoni To: Buildroot List , "Arnout Vandecappelle (Essensium/Mind)" , "Yann E. MORIN" , Peter Korsgaard Date: Fri, 1 Dec 2017 21:53:41 +0100 Message-Id: <20171201205352.24287-5-thomas.petazzoni@free-electrons.com> X-Mailer: git-send-email 2.13.6 In-Reply-To: <20171201205352.24287-1-thomas.petazzoni@free-electrons.com> References: <20171201205352.24287-1-thomas.petazzoni@free-electrons.com> Subject: [Buildroot] [RFCv3 04/15] pkg-cmake: install CMake files as part of a package X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.24 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Thomas Petazzoni MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" Currently, the toolchainfile.cmake and Buildroot.cmake files are installed outside of any package, just triggered by the toolchain target. As part of the per-package SDK effort, we are trying to avoid anything that installs to the global $(HOST_DIR), and this is one of the remaining files installed in $(HOST_DIR) outside of any package. We fix this by installing such files as part of the toolchain package post-install staging hooks. Yes, a post-install staging hook to install things to $(HOST_DIR) is a bit weird, but the toolchain infrastructure is made of target packages only, and they all install a lot of stuff to $(HOST_DIR) already. Signed-off-by: Thomas Petazzoni Reviewed-by: "Yann E. MORIN" --- Changes since v2: - None Changes since v1: - New patch --- package/pkg-cmake.mk | 12 +++++++----- toolchain/toolchain/toolchain.mk | 3 --- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/package/pkg-cmake.mk b/package/pkg-cmake.mk index 6739704e3c..6d4f948d07 100644 --- a/package/pkg-cmake.mk +++ b/package/pkg-cmake.mk @@ -244,8 +244,8 @@ endif # based on the toolchainfile.cmake file's location: $(HOST_DIR)/share/buildroot # In all the other variables, HOST_DIR will be replaced by RELOCATED_HOST_DIR, # so we have to strip "$(HOST_DIR)/" from the paths that contain it. -$(HOST_DIR)/share/buildroot/toolchainfile.cmake: - @mkdir -p $(@D) +define TOOLCHAIN_CMAKE_INSTALL_FILES + @mkdir -p $(HOST_DIR)/share/buildroot sed \ -e 's#@@STAGING_SUBDIR@@#$(call qstrip,$(STAGING_SUBDIR))#' \ -e 's#@@TARGET_CFLAGS@@#$(call qstrip,$(TARGET_CFLAGS))#' \ @@ -259,7 +259,9 @@ $(HOST_DIR)/share/buildroot/toolchainfile.cmake: -e 's#@@TOOLCHAIN_HAS_FORTRAN@@#$(if $(BR2_TOOLCHAIN_HAS_FORTRAN),1,0)#' \ -e 's#@@CMAKE_BUILD_TYPE@@#$(if $(BR2_ENABLE_DEBUG),Debug,Release)#' \ $(TOPDIR)/support/misc/toolchainfile.cmake.in \ - > $@ + > $(HOST_DIR)/share/buildroot/toolchainfile.cmake + $(Q)$(INSTALL) -D -m 0644 support/misc/Buildroot.cmake \ + $(HOST_DIR)/share/buildroot/Platform/Buildroot.cmake +endef -$(HOST_DIR)/share/buildroot/Platform/Buildroot.cmake: - $(Q)$(INSTALL) -D -m 0644 support/misc/Buildroot.cmake $(@) +TOOLCHAIN_POST_INSTALL_STAGING_HOOKS += TOOLCHAIN_CMAKE_INSTALL_FILES diff --git a/toolchain/toolchain/toolchain.mk b/toolchain/toolchain/toolchain.mk index b55b0c712c..283e0a74ee 100644 --- a/toolchain/toolchain/toolchain.mk +++ b/toolchain/toolchain/toolchain.mk @@ -38,6 +38,3 @@ TOOLCHAIN_INSTALL_STAGING = YES endif $(eval $(virtual-package)) - -toolchain: $(HOST_DIR)/share/buildroot/toolchainfile.cmake -toolchain: $(HOST_DIR)/share/buildroot/Platform/Buildroot.cmake From patchwork Fri Dec 1 20:53:42 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Petazzoni X-Patchwork-Id: 843733 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@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=) Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3ypRN40BNBz9t20 for ; Sat, 2 Dec 2017 07:54:28 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 4EEBE30BF3; Fri, 1 Dec 2017 20:54:25 +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 kXrhJ5XZ3hfo; Fri, 1 Dec 2017 20:54:19 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by silver.osuosl.org (Postfix) with ESMTP id 5A30F30BE9; Fri, 1 Dec 2017 20:54:19 +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 0DB8E1C436D for ; Fri, 1 Dec 2017 20:54:14 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 0A4AF8978A for ; Fri, 1 Dec 2017 20:54:14 +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 G2yyZgRho+Ib for ; Fri, 1 Dec 2017 20:54:13 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail.free-electrons.com (mail.free-electrons.com [62.4.15.54]) by whitealder.osuosl.org (Postfix) with ESMTP id 296CB89BB5 for ; Fri, 1 Dec 2017 20:54:13 +0000 (UTC) Received: by mail.free-electrons.com (Postfix, from userid 110) id 451422055E; Fri, 1 Dec 2017 21:54:11 +0100 (CET) Received: from localhost (LFbn-TOU-1-149-75.w86-201.abo.wanadoo.fr [86.201.231.75]) by mail.free-electrons.com (Postfix) with ESMTPSA id 1338E20750; Fri, 1 Dec 2017 21:54:01 +0100 (CET) From: Thomas Petazzoni To: Buildroot List , "Arnout Vandecappelle (Essensium/Mind)" , "Yann E. MORIN" , Peter Korsgaard Date: Fri, 1 Dec 2017 21:53:42 +0100 Message-Id: <20171201205352.24287-6-thomas.petazzoni@free-electrons.com> X-Mailer: git-send-email 2.13.6 In-Reply-To: <20171201205352.24287-1-thomas.petazzoni@free-electrons.com> References: <20171201205352.24287-1-thomas.petazzoni@free-electrons.com> Subject: [Buildroot] [RFCv3 05/15] pkg-generic: add .stamp_installed step X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.24 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Thomas Petazzoni MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" The installation to target, staging and images as well as the host installation are all done in 4 different make targets. We don't have any place currently to run something at the end of a package installation, i.e once all of target/staging/images (for target) or host (for host) installation have completed. We will need such a step to fix the RPATH of binaries in the host directory. Indeed, while normally only host packages should install things in $(HOST_DIR), in practice a number of target packages (ex: qt4, qt5base) do install things in $(HOST_DIR). Therefore, we want to run our RPATH fixing logic at the end of all installation steps. To achieve this, this commit introduces a new make target, .stamp_installed, which depends on .stamp_{target,staging,images}_installed for target packages and .stamp_host_installed for host packages. This new step currently doesn't do anything, but the actual logic is added in a follow-up commit. This change in fact makes the overall step sequencing more logical: for all steps the dependencies were done on the stamp file targets, except for the install step where we were using phony targets to make $(1)-install depends on $(1)-install-{target,staging,images,host}. So now, the phony targets $(1)-install-{target,staging,images,host} are only human-readable targets that are shortcuts to the corresponding stamp file targets, and not usded anymore for the step sequencing. This makes them more consistent with the other phony $(1)-{build,configure,patch,...} phony targets. It also makes $(1)-install-host more consistent with other phony targets: $(1)-install-target only existed if the package had _INSTALL_TARGET = YES, but $(1)-install-host existed unconditionally. Now it only exists if it's a host package. Signed-off-by: Thomas Petazzoni Reviewed-by: "Yann E. MORIN" --- Changes since v2: - None Changes since v1: - New patch. --- package/pkg-generic.mk | 44 +++++++++++++++++++++++++++----------------- 1 file changed, 27 insertions(+), 17 deletions(-) diff --git a/package/pkg-generic.mk b/package/pkg-generic.mk index 0019814276..2b821e9bdf 100644 --- a/package/pkg-generic.mk +++ b/package/pkg-generic.mk @@ -340,6 +340,12 @@ $(BUILD_DIR)/%/.stamp_target_installed: @$(call step_end,install-target) $(Q)touch $@ +# Finalize installation +$(BUILD_DIR)/%/.stamp_installed: + @$(call step_start,install) + @$(call step_end,install) + $(Q)touch $@ + # Remove package sources $(BUILD_DIR)/%/.stamp_dircleaned: rm -Rf $(@D) @@ -595,6 +601,7 @@ $(2)_TARGET_INSTALL_TARGET = $$($(2)_DIR)/.stamp_target_installed $(2)_TARGET_INSTALL_STAGING = $$($(2)_DIR)/.stamp_staging_installed $(2)_TARGET_INSTALL_IMAGES = $$($(2)_DIR)/.stamp_images_installed $(2)_TARGET_INSTALL_HOST = $$($(2)_DIR)/.stamp_host_installed +$(2)_TARGET_INSTALL = $$($(2)_DIR)/.stamp_installed $(2)_TARGET_BUILD = $$($(2)_DIR)/.stamp_built $(2)_TARGET_CONFIGURE = $$($(2)_DIR)/.stamp_configured $(2)_TARGET_RSYNC = $$($(2)_DIR)/.stamp_rsynced @@ -642,38 +649,40 @@ $(2)_ROOTFS_POST_CMD_HOOKS ?= # human-friendly targets and target sequencing $(1): $(1)-install +$(1)-install: $$($(2)_TARGET_INSTALL) + ifeq ($$($(2)_TYPE),host) -$(1)-install: $(1)-install-host -else -$(1)-install: $(1)-install-staging $(1)-install-target $(1)-install-images -endif + +$(1)-install-host: $$($(2)_TARGET_INSTALL_HOST) +$$($(2)_TARGET_INSTALL): $$($(2)_TARGET_INSTALL_HOST) + +else # host vs. target ifeq ($$($(2)_INSTALL_TARGET),YES) $(1)-install-target: $$($(2)_TARGET_INSTALL_TARGET) -$$($(2)_TARGET_INSTALL_TARGET): $$($(2)_TARGET_BUILD) -else -$(1)-install-target: +$$($(2)_TARGET_INSTALL): $$($(2)_TARGET_INSTALL_TARGET) endif ifeq ($$($(2)_INSTALL_STAGING),YES) -$(1)-install-staging: $$($(2)_TARGET_INSTALL_STAGING) -$$($(2)_TARGET_INSTALL_STAGING): $$($(2)_TARGET_BUILD) -# Some packages use install-staging stuff for install-target -$$($(2)_TARGET_INSTALL_TARGET): $$($(2)_TARGET_INSTALL_STAGING) -else -$(1)-install-staging: +$(1)-install-staging: $$($(2)_TARGET_INSTALL_STAGING) +$$($(2)_TARGET_INSTALL): $$($(2)_TARGET_INSTALL_STAGING) endif ifeq ($$($(2)_INSTALL_IMAGES),YES) $(1)-install-images: $$($(2)_TARGET_INSTALL_IMAGES) -$$($(2)_TARGET_INSTALL_IMAGES): $$($(2)_TARGET_BUILD) -else -$(1)-install-images: +$$($(2)_TARGET_INSTALL): $$($(2)_TARGET_INSTALL_IMAGES) endif -$(1)-install-host: $$($(2)_TARGET_INSTALL_HOST) +endif # host vs.target + +$$($(2)_TARGET_INSTALL_TARGET): $$($(2)_TARGET_BUILD) +$$($(2)_TARGET_INSTALL_STAGING):$$($(2)_TARGET_BUILD) +$$($(2)_TARGET_INSTALL_IMAGES): $$($(2)_TARGET_BUILD) $$($(2)_TARGET_INSTALL_HOST): $$($(2)_TARGET_BUILD) +# Some packages use install-staging stuff for install-target +$$($(2)_TARGET_INSTALL_TARGET): $$($(2)_TARGET_INSTALL_STAGING) + $(1)-build: $$($(2)_TARGET_BUILD) $$($(2)_TARGET_BUILD): $$($(2)_TARGET_CONFIGURE) @@ -813,6 +822,7 @@ $(1)-reconfigure: $(1)-clean-for-reconfigure $(1) # define the PKG variable for all targets, containing the # uppercase package variable prefix +$$($(2)_TARGET_INSTALL): PKG=$(2) $$($(2)_TARGET_INSTALL_TARGET): PKG=$(2) $$($(2)_TARGET_INSTALL_STAGING): PKG=$(2) $$($(2)_TARGET_INSTALL_IMAGES): PKG=$(2) From patchwork Fri Dec 1 20:53:43 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Petazzoni X-Patchwork-Id: 843729 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=busybox.net (client-ip=140.211.166.137; helo=fraxinus.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3ypRMz3cs2z9sNc for ; Sat, 2 Dec 2017 07:54:23 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id B8CB9887AC; Fri, 1 Dec 2017 20:54:21 +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 nqM1Bep63d1b; Fri, 1 Dec 2017 20:54:21 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by fraxinus.osuosl.org (Postfix) with ESMTP id 0FB8188CEB; Fri, 1 Dec 2017 20:54:21 +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 3E2CC1C436D for ; Fri, 1 Dec 2017 20:54:14 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 39BB08A54D for ; Fri, 1 Dec 2017 20:54:14 +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 x3zSRLh79VzG for ; Fri, 1 Dec 2017 20:54:13 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail.free-electrons.com (mail.free-electrons.com [62.4.15.54]) by hemlock.osuosl.org (Postfix) with ESMTP id 2EED48A559 for ; Fri, 1 Dec 2017 20:54:13 +0000 (UTC) Received: by mail.free-electrons.com (Postfix, from userid 110) id 8C6F120750; Fri, 1 Dec 2017 21:54:11 +0100 (CET) Received: from localhost (LFbn-TOU-1-149-75.w86-201.abo.wanadoo.fr [86.201.231.75]) by mail.free-electrons.com (Postfix) with ESMTPSA id 57C89207CA; Fri, 1 Dec 2017 21:54:01 +0100 (CET) From: Thomas Petazzoni To: Buildroot List , "Arnout Vandecappelle (Essensium/Mind)" , "Yann E. MORIN" , Peter Korsgaard Date: Fri, 1 Dec 2017 21:53:43 +0100 Message-Id: <20171201205352.24287-7-thomas.petazzoni@free-electrons.com> X-Mailer: git-send-email 2.13.6 In-Reply-To: <20171201205352.24287-1-thomas.petazzoni@free-electrons.com> References: <20171201205352.24287-1-thomas.petazzoni@free-electrons.com> Subject: [Buildroot] [RFCv3 06/15] package/pkg-generic: add the concept of extract dependency X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.24 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Thomas Petazzoni MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" Extract dependencies are dependencies that must be ready before the extract step of a package, i.e for tools that are needed to extract packages themselves. Current examples of such tools are host-tar, host-lzip and host-xz. They are currently handled through DEPENDENCIES_HOST_PREREQ. However, this mechanism has a number of drawbacks: - First and foremost, because host-tar/host-lzip/host-xz are not listed in the dependencies of packages, the package infrastructure does not know it should rsync them in the context of per-package SDK. - Second, there is no dependency handling *between* them. I.e, we have no mechanism that says host-tar should be built before host-lzip, while it is in fact the case: if you need to build host-lzip, you need to extract a tarball, so you may need host-tar if your system tarball is not capable enough. For those reasons, it makes sense to add explicit support for "extract dependencies" in the package infrastructure, through the _EXTRACT_DEPENDENCIES variable. It is unlikely this variable will ever be used by a package .mk file, but it will be used internally by the package infrastructure. Signed-off-by: Thomas Petazzoni Reviewed-by: "Yann E. MORIN" --- Changes since v2: - New patch --- docs/manual/adding-packages-generic.txt | 7 +++++++ package/pkg-generic.mk | 8 +++++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/docs/manual/adding-packages-generic.txt b/docs/manual/adding-packages-generic.txt index 63ea51bf89..7f42cb09e9 100644 --- a/docs/manual/adding-packages-generic.txt +++ b/docs/manual/adding-packages-generic.txt @@ -347,6 +347,13 @@ information is (assuming the package name is +libfoo+) : a similar way, +HOST_LIBFOO_DEPENDENCIES+ lists the dependencies for the current host package. +* +LIBFOO_EXTRACT_DEPENDENCIES+ lists the dependencies (in terms of + package name) that are required for the current target package to be + extracted. These depnedencies are guaranteed to be compiled and + installed before the extract step of the current package + starts. This is only use internally by the package infrastructure, + and should typically not be used directly by packages. + * +LIBFOO_PATCH_DEPENDENCIES+ lists the dependencies (in terms of package name) that are required for the current package to be patched. These dependencies are guaranteed to be extracted and diff --git a/package/pkg-generic.mk b/package/pkg-generic.mk index 2b821e9bdf..824c34bec9 100644 --- a/package/pkg-generic.mk +++ b/package/pkg-generic.mk @@ -589,8 +589,13 @@ endif # Eliminate duplicates in dependencies $(2)_FINAL_DEPENDENCIES = $$(sort $$($(2)_DEPENDENCIES)) +$(2)_FINAL_EXTRACT_DEPENDENCIES = $$(sort $$($(2)_EXTRACT_DEPENDENCIES)) $(2)_FINAL_PATCH_DEPENDENCIES = $$(sort $$($(2)_PATCH_DEPENDENCIES)) -$(2)_FINAL_ALL_DEPENDENCIES = $$(sort $$($(2)_FINAL_DEPENDENCIES) $$($(2)_FINAL_PATCH_DEPENDENCIES)) +$(2)_FINAL_ALL_DEPENDENCIES = \ + $$(sort \ + $$($(2)_FINAL_DEPENDENCIES) \ + $$($(2)_FINAL_EXTRACT_DEPENDENCIES) \ + $$($(2)_FINAL_PATCH_DEPENDENCIES)) $(2)_INSTALL_STAGING ?= NO $(2)_INSTALL_IMAGES ?= NO @@ -716,6 +721,7 @@ $$($(2)_TARGET_PATCH): | $$(patsubst %,%-patch,$$($(2)_FINAL_PATCH_DEPENDENCIES $(1)-extract: $$($(2)_TARGET_EXTRACT) $$($(2)_TARGET_EXTRACT): $$($(2)_TARGET_SOURCE) +$$($(2)_TARGET_EXTRACT): | $$($(2)_FINAL_EXTRACT_DEPENDENCIES) $(1)-depends: $$($(2)_FINAL_DEPENDENCIES) From patchwork Fri Dec 1 20:53:44 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Petazzoni X-Patchwork-Id: 843735 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@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=) Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3ypRN76xmlz9sNd for ; Sat, 2 Dec 2017 07:54:31 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id DC8DB30BD6; Fri, 1 Dec 2017 20:54:29 +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 45vtlWIkvzP7; Fri, 1 Dec 2017 20:54:25 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by silver.osuosl.org (Postfix) with ESMTP id 2867030BEF; Fri, 1 Dec 2017 20:54:25 +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 A22D61C436D for ; Fri, 1 Dec 2017 20:54:14 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 9DFDB2FF19 for ; Fri, 1 Dec 2017 20:54: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 X4v07Cb-xdDx for ; Fri, 1 Dec 2017 20:54:13 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail.free-electrons.com (mail.free-electrons.com [62.4.15.54]) by silver.osuosl.org (Postfix) with ESMTP id 70CC72FCF5 for ; Fri, 1 Dec 2017 20:54:13 +0000 (UTC) Received: by mail.free-electrons.com (Postfix, from userid 110) id CA037207CA; Fri, 1 Dec 2017 21:54:11 +0100 (CET) Received: from localhost (LFbn-TOU-1-149-75.w86-201.abo.wanadoo.fr [86.201.231.75]) by mail.free-electrons.com (Postfix) with ESMTPSA id 98F8520856; Fri, 1 Dec 2017 21:54:01 +0100 (CET) From: Thomas Petazzoni To: Buildroot List , "Arnout Vandecappelle (Essensium/Mind)" , "Yann E. MORIN" , Peter Korsgaard Date: Fri, 1 Dec 2017 21:53:44 +0100 Message-Id: <20171201205352.24287-8-thomas.petazzoni@free-electrons.com> X-Mailer: git-send-email 2.13.6 In-Reply-To: <20171201205352.24287-1-thomas.petazzoni@free-electrons.com> References: <20171201205352.24287-1-thomas.petazzoni@free-electrons.com> Subject: [Buildroot] [RFCv3 07/15] package/pkg-generic: handle host-tar as an extract dependency X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.24 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Thomas Petazzoni MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" This moves the host-tar dependency handling from DEPENDENCY_HOST_PREREQ to an extract dependency. To achieve that, check-host-tar.mk fills in the BR2_TAR_HOST_DEPENDENCY with host-tar if building a host-tar is needed. The name BR2_TAR_HOST_DEPENDENCY has been chosen because it matches the name BR2_CMAKE_HOST_DEPENDENCY already used in check-host-cmake.mk. The BR2_TAR_HOST_DEPENDENCY is added to all packages, except host-tar itself (obviously) and host-skeleton, because we depend on host-skeleton to install host-tar properly in HOST_DIR. In addition, we modify tar.mk to explicitly build host-tar without ccache: since ccache source code is available as a tarball, ccache will obviously depend on host-tar if the system tar is insufficient. Signed-off-by: Thomas Petazzoni Reviewed-by: "Yann E. MORIN" --- Changes since v2: - New patch --- package/pkg-generic.mk | 4 ++++ package/tar/tar.mk | 6 ++++++ support/dependencies/check-host-tar.mk | 2 +- 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/package/pkg-generic.mk b/package/pkg-generic.mk index 824c34bec9..86dd2561d4 100644 --- a/package/pkg-generic.mk +++ b/package/pkg-generic.mk @@ -587,6 +587,10 @@ ifneq ($(1),host-skeleton) $(2)_DEPENDENCIES += host-skeleton endif +ifeq ($(filter host-tar host-skeleton,$(1)),) +$(2)_EXTRACT_DEPENDENCIES += $(BR2_TAR_HOST_DEPENDENCY) +endif + # Eliminate duplicates in dependencies $(2)_FINAL_DEPENDENCIES = $$(sort $$($(2)_DEPENDENCIES)) $(2)_FINAL_EXTRACT_DEPENDENCIES = $$(sort $$($(2)_EXTRACT_DEPENDENCIES)) diff --git a/package/tar/tar.mk b/package/tar/tar.mk index cb2ddc0eca..813eabed14 100644 --- a/package/tar/tar.mk +++ b/package/tar/tar.mk @@ -44,4 +44,10 @@ define HOST_TAR_EXTRACT_CMDS mv $(@D)/tar-$(TAR_VERSION)/* $(@D) rmdir $(@D)/tar-$(TAR_VERSION) endef + +# we are built before ccache +HOST_TAR_CONF_ENV = \ + CC="$(HOSTCC_NOCCACHE)" \ + CXX="$(HOSTCXX_NOCCACHE)" + $(eval $(host-autotools-package)) diff --git a/support/dependencies/check-host-tar.mk b/support/dependencies/check-host-tar.mk index ad0b32e277..d07f727c4c 100644 --- a/support/dependencies/check-host-tar.mk +++ b/support/dependencies/check-host-tar.mk @@ -1,6 +1,6 @@ TAR ?= tar ifeq (,$(call suitable-host-package,tar,$(TAR))) -DEPENDENCIES_HOST_PREREQ += host-tar TAR = $(HOST_DIR)/bin/tar +BR2_TAR_HOST_DEPENDENCY += host-tar endif From patchwork Fri Dec 1 20:53:45 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Petazzoni X-Patchwork-Id: 843737 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@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=) Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3ypRND0gpBz9sNd for ; Sat, 2 Dec 2017 07:54:36 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 2E10330C00; Fri, 1 Dec 2017 20:54:33 +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 xYn8akCs9aYq; Fri, 1 Dec 2017 20:54:28 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by silver.osuosl.org (Postfix) with ESMTP id 753C530BF5; Fri, 1 Dec 2017 20:54:26 +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 CC8A31CEFA4 for ; Fri, 1 Dec 2017 20:54:14 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id C9F338A54D for ; Fri, 1 Dec 2017 20:54:14 +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 gX5O2g5iv8TY for ; Fri, 1 Dec 2017 20:54:13 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail.free-electrons.com (mail.free-electrons.com [62.4.15.54]) by hemlock.osuosl.org (Postfix) with ESMTP id 497788A55A for ; Fri, 1 Dec 2017 20:54:13 +0000 (UTC) Received: by mail.free-electrons.com (Postfix, from userid 110) id 1C7EA20749; Fri, 1 Dec 2017 21:54:12 +0100 (CET) Received: from localhost (LFbn-TOU-1-149-75.w86-201.abo.wanadoo.fr [86.201.231.75]) by mail.free-electrons.com (Postfix) with ESMTPSA id E111320869; Fri, 1 Dec 2017 21:54:01 +0100 (CET) From: Thomas Petazzoni To: Buildroot List , "Arnout Vandecappelle (Essensium/Mind)" , "Yann E. MORIN" , Peter Korsgaard Date: Fri, 1 Dec 2017 21:53:45 +0100 Message-Id: <20171201205352.24287-9-thomas.petazzoni@free-electrons.com> X-Mailer: git-send-email 2.13.6 In-Reply-To: <20171201205352.24287-1-thomas.petazzoni@free-electrons.com> References: <20171201205352.24287-1-thomas.petazzoni@free-electrons.com> Subject: [Buildroot] [RFCv3 08/15] package/pkg-generic: handle host-xz as an extract dependency X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.24 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Thomas Petazzoni MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" This moves the host-xz dependency handling from DEPENDENCY_HOST_PREREQ to an extract dependency. To achieve that, check-host-xz.mk fills in the BR2_XZ_HOST_DEPENDENCY with host-tar if building a host-tar is needed. The name BR2_XZ_HOST_DEPENDENCY has been chosen because it matches the name BR2_CMAKE_HOST_DEPENDENCY already used in check-host-cmake.mk. The BR2_XZ_HOST_DEPENDENCY is added to all packages, except: - host-xz, because we would otherwise depend on ourself. - host-tar, because xz itself is delivered as a tarball, so we need to have host-xz depend on host-tar, and not host-tar depend on host-xz - host-skeleton, because we need to have host-xz depend on host-skeleton, and not the opposite. In addition, we modify xz.mk to explicitly build host-xz without ccache. We generally took the approach of building host-ccache *after* all the extractors have been built. Signed-off-by: Thomas Petazzoni Reviewed-by: "Yann E. MORIN" --- Changes since v2: - New patch --- package/pkg-generic.mk | 4 ++++ package/xz/xz.mk | 5 +++++ support/dependencies/check-host-xzcat.mk | 2 +- 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/package/pkg-generic.mk b/package/pkg-generic.mk index 86dd2561d4..dfd4719d29 100644 --- a/package/pkg-generic.mk +++ b/package/pkg-generic.mk @@ -591,6 +591,10 @@ ifeq ($(filter host-tar host-skeleton,$(1)),) $(2)_EXTRACT_DEPENDENCIES += $(BR2_TAR_HOST_DEPENDENCY) endif +ifeq ($(filter host-tar host-skeleton host-xz,$(1)),) +$(2)_EXTRACT_DEPENDENCIES += $(BR2_XZCAT_HOST_DEPENDENCY) +endif + # Eliminate duplicates in dependencies $(2)_FINAL_DEPENDENCIES = $$(sort $$($(2)_DEPENDENCIES)) $(2)_FINAL_EXTRACT_DEPENDENCIES = $$(sort $$($(2)_EXTRACT_DEPENDENCIES)) diff --git a/package/xz/xz.mk b/package/xz/xz.mk index e8116f24ae..bcdac13ee3 100644 --- a/package/xz/xz.mk +++ b/package/xz/xz.mk @@ -18,5 +18,10 @@ else XZ_CONF_OPTS = --disable-threads endif +# we are built before ccache +HOST_XZ_CONF_ENV = \ + CC="$(HOSTCC_NOCCACHE)" \ + CXX="$(HOSTCXX_NOCCACHE)" + $(eval $(autotools-package)) $(eval $(host-autotools-package)) diff --git a/support/dependencies/check-host-xzcat.mk b/support/dependencies/check-host-xzcat.mk index 9be75c7311..e5d72f95dd 100644 --- a/support/dependencies/check-host-xzcat.mk +++ b/support/dependencies/check-host-xzcat.mk @@ -2,7 +2,7 @@ # If it is not present, build our own host-xzcat ifeq (,$(call suitable-host-package,xzcat,$(XZCAT))) -DEPENDENCIES_HOST_PREREQ += host-xz +BR2_XZCAT_HOST_DEPENDENCY = host-xz EXTRACTOR_DEPENDENCY_PRECHECKED_EXTENSIONS += .xz .lzma XZCAT = $(HOST_DIR)/bin/xzcat endif From patchwork Fri Dec 1 20:53:46 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Petazzoni X-Patchwork-Id: 843736 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=busybox.net (client-ip=140.211.166.137; helo=fraxinus.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3ypRNB2wfxz9sNc for ; Sat, 2 Dec 2017 07:54:34 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 4C55A88F71; Fri, 1 Dec 2017 20:54: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 RDgM1AiuDSU4; Fri, 1 Dec 2017 20:54:30 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by fraxinus.osuosl.org (Postfix) with ESMTP id 53B5E88F52; Fri, 1 Dec 2017 20:54:29 +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 061C41C436D for ; Fri, 1 Dec 2017 20:54:17 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id F259889BB5 for ; Fri, 1 Dec 2017 20:54: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 4QtRzbEzragg for ; Fri, 1 Dec 2017 20:54:16 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail.free-electrons.com (mail.free-electrons.com [62.4.15.54]) by whitealder.osuosl.org (Postfix) with ESMTP id 24C878978A for ; Fri, 1 Dec 2017 20:54:16 +0000 (UTC) Received: by mail.free-electrons.com (Postfix, from userid 110) id AE11120503; Fri, 1 Dec 2017 21:54:14 +0100 (CET) Received: from localhost (LFbn-TOU-1-149-75.w86-201.abo.wanadoo.fr [86.201.231.75]) by mail.free-electrons.com (Postfix) with ESMTPSA id 30C9D2094D; Fri, 1 Dec 2017 21:54:02 +0100 (CET) From: Thomas Petazzoni To: Buildroot List , "Arnout Vandecappelle (Essensium/Mind)" , "Yann E. MORIN" , Peter Korsgaard Date: Fri, 1 Dec 2017 21:53:46 +0100 Message-Id: <20171201205352.24287-10-thomas.petazzoni@free-electrons.com> X-Mailer: git-send-email 2.13.6 In-Reply-To: <20171201205352.24287-1-thomas.petazzoni@free-electrons.com> References: <20171201205352.24287-1-thomas.petazzoni@free-electrons.com> Subject: [Buildroot] [RFCv3 09/15] package/pkg-generic: handle host-lzip as an extract dependency X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.24 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Thomas Petazzoni MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" This moves the host-xz dependency handling from DEPENDENCY_HOST_PREREQ to an extract dependency. To achieve that, check-host-xz.mk fills in the BR2_LZIP_HOST_DEPENDENCY with host-tar if building a host-tar is needed. The name BR2_LZIP_HOST_DEPENDENCY has been chosen because it matches the name BR2_CMAKE_HOST_DEPENDENCY already used in check-host-cmake.mk. The BR2_LZIP_HOST_DEPENDENCY is added to all packages, except: - host-lzip, because we would otherwise depend on ourself. - host-tar, because lzip itself is delivered as a tarball, so we need to have host-lzip depend on host-tar, and not host-tar depend on host-lzip - host-skeleton, because we need to have host-lzip depend on host-skeleton, and not the opposite. We also mutually exclude host-lzip and host-xz from dependending on each other, to avoid a circular dependency. In addition, we modify lzip.mk to explicitly build host-lzip without ccache. We generally took the approach of building host-ccache *after* all the extractors have been built. Signed-off-by: Thomas Petazzoni Reviewed-by: "Yann E. MORIN" --- Changes since v2: - New patch --- package/lzip/lzip.mk | 2 +- package/pkg-generic.mk | 6 +++++- support/dependencies/check-host-lzip.mk | 2 +- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/package/lzip/lzip.mk b/package/lzip/lzip.mk index b7ba5dd21d..a16a22214c 100644 --- a/package/lzip/lzip.mk +++ b/package/lzip/lzip.mk @@ -16,7 +16,7 @@ endef define HOST_LZIP_CONFIGURE_CMDS (cd $(@D); $(HOST_MAKE_ENV) ./configure --prefix=$(HOST_DIR) \ - $(HOST_CONFIGURE_OPTS) ) + $(HOST_CONFIGURE_OPTS) CC="$(HOSTCC_NOCCACHE)" CXX="$(HOSTCXX_NOCCACHE)") endef define LZIP_BUILD_CMDS diff --git a/package/pkg-generic.mk b/package/pkg-generic.mk index dfd4719d29..e623afe7bc 100644 --- a/package/pkg-generic.mk +++ b/package/pkg-generic.mk @@ -591,10 +591,14 @@ ifeq ($(filter host-tar host-skeleton,$(1)),) $(2)_EXTRACT_DEPENDENCIES += $(BR2_TAR_HOST_DEPENDENCY) endif -ifeq ($(filter host-tar host-skeleton host-xz,$(1)),) +ifeq ($(filter host-tar host-skeleton host-xz host-lzip,$(1)),) $(2)_EXTRACT_DEPENDENCIES += $(BR2_XZCAT_HOST_DEPENDENCY) endif +ifeq ($(filter host-tar host-skeleton host-xz host-lzip,$(1)),) +$(2)_EXTRACT_DEPENDENCIES += $(BR2_LZIP_HOST_DEPENDENCY) +endif + # Eliminate duplicates in dependencies $(2)_FINAL_DEPENDENCIES = $$(sort $$($(2)_DEPENDENCIES)) $(2)_FINAL_EXTRACT_DEPENDENCIES = $$(sort $$($(2)_EXTRACT_DEPENDENCIES)) diff --git a/support/dependencies/check-host-lzip.mk b/support/dependencies/check-host-lzip.mk index 00cdd0a236..cdd784058c 100644 --- a/support/dependencies/check-host-lzip.mk +++ b/support/dependencies/check-host-lzip.mk @@ -1,5 +1,5 @@ ifeq (,$(call suitable-host-package,lzip,$(LZCAT))) -DEPENDENCIES_HOST_PREREQ += host-lzip +BR2_LZIP_HOST_DEPENDENCY = host-lzip EXTRACTOR_DEPENDENCY_PRECHECKED_EXTENSIONS += .lz LZCAT = $(HOST_DIR)/bin/lzip -d -c endif From patchwork Fri Dec 1 20:53:47 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Petazzoni X-Patchwork-Id: 843734 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=busybox.net (client-ip=140.211.166.137; helo=fraxinus.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3ypRN75jLVz9sNc for ; Sat, 2 Dec 2017 07:54:31 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id E13B988CEB; Fri, 1 Dec 2017 20:54:28 +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 eNbMCZ4yk3T8; Fri, 1 Dec 2017 20:54:28 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by fraxinus.osuosl.org (Postfix) with ESMTP id 3890388E0D; Fri, 1 Dec 2017 20:54:28 +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 A18FE1CEFA4 for ; Fri, 1 Dec 2017 20:54:16 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 9B1B18A55A for ; Fri, 1 Dec 2017 20:54:16 +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 5jIq6wSfyguW for ; Fri, 1 Dec 2017 20:54:16 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail.free-electrons.com (mail.free-electrons.com [62.4.15.54]) by hemlock.osuosl.org (Postfix) with ESMTP id 1095B8A556 for ; Fri, 1 Dec 2017 20:54:16 +0000 (UTC) Received: by mail.free-electrons.com (Postfix, from userid 110) id AF64F206EF; Fri, 1 Dec 2017 21:54:14 +0100 (CET) Received: from localhost (LFbn-TOU-1-149-75.w86-201.abo.wanadoo.fr [86.201.231.75]) by mail.free-electrons.com (Postfix) with ESMTPSA id 749E720976; Fri, 1 Dec 2017 21:54:02 +0100 (CET) From: Thomas Petazzoni To: Buildroot List , "Arnout Vandecappelle (Essensium/Mind)" , "Yann E. MORIN" , Peter Korsgaard Date: Fri, 1 Dec 2017 21:53:47 +0100 Message-Id: <20171201205352.24287-11-thomas.petazzoni@free-electrons.com> X-Mailer: git-send-email 2.13.6 In-Reply-To: <20171201205352.24287-1-thomas.petazzoni@free-electrons.com> References: <20171201205352.24287-1-thomas.petazzoni@free-electrons.com> Subject: [Buildroot] [RFCv3 10/15] package/pkg-generic: handle host-ccache as a regular dependency X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.24 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Thomas Petazzoni MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" This moves the host-ccache dependency handling from DEPENDENCIES_HOST_PREREQ to a proper package dependency. When BR2_CCACHE=y, we add host-ccache as a regular dependency of all packages except: - The extractor packages host-tar, host-xz and host-lzip - host-ccache itself - host-skeleton, because all packages depend on it Signed-off-by: Thomas Petazzoni --- Changes since v2: - New patch --- package/ccache/ccache.mk | 5 +++++ package/pkg-generic.mk | 6 ++++++ support/dependencies/dependencies.mk | 4 ---- 3 files changed, 11 insertions(+), 4 deletions(-) diff --git a/package/ccache/ccache.mk b/package/ccache/ccache.mk index afbec44fac..d6ef455e8b 100644 --- a/package/ccache/ccache.mk +++ b/package/ccache/ccache.mk @@ -21,6 +21,11 @@ CCACHE_LICENSE_FILES = LICENSE.txt GPL-3.0.txt # has zero dependency besides the C library. HOST_CCACHE_CONF_OPTS += --with-bundled-zlib +# We are ccache, so we can't use ccache +HOST_CCACHE_CONF_ENV = \ + CC="$(HOSTCC_NOCCACHE)" \ + CXX="$(HOSTCXX_NOCCACHE)" + # Patch host-ccache as follows: # - Use BR_CACHE_DIR instead of CCACHE_DIR, because CCACHE_DIR # is already used by autotargets for the ccache package. diff --git a/package/pkg-generic.mk b/package/pkg-generic.mk index e623afe7bc..cb5889c9ef 100644 --- a/package/pkg-generic.mk +++ b/package/pkg-generic.mk @@ -599,6 +599,12 @@ ifeq ($(filter host-tar host-skeleton host-xz host-lzip,$(1)),) $(2)_EXTRACT_DEPENDENCIES += $(BR2_LZIP_HOST_DEPENDENCY) endif +ifeq ($(BR2_CCACHE),y) +ifeq ($(filter host-tar host-skeleton host-xz host-lzip,$(1)),) +$(2)_DEPENDENCIES += host-ccache +endif +endif + # Eliminate duplicates in dependencies $(2)_FINAL_DEPENDENCIES = $$(sort $$($(2)_DEPENDENCIES)) $(2)_FINAL_EXTRACT_DEPENDENCIES = $$(sort $$($(2)_EXTRACT_DEPENDENCIES)) diff --git a/support/dependencies/dependencies.mk b/support/dependencies/dependencies.mk index ef2ae9b7e1..1a4b5df9f2 100644 --- a/support/dependencies/dependencies.mk +++ b/support/dependencies/dependencies.mk @@ -14,10 +14,6 @@ $(shell support/dependencies/check-host-$(1).sh $(2)) endef -include $(sort $(wildcard support/dependencies/check-host-*.mk)) -ifeq ($(BR2_CCACHE),y) -DEPENDENCIES_HOST_PREREQ += host-ccache -endif - core-dependencies: @HOSTCC="$(firstword $(HOSTCC))" MAKE="$(MAKE)" \ DL_TOOLS="$(sort $(DL_TOOLS_DEPENDENCIES))" \ From patchwork Fri Dec 1 20:53:48 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Petazzoni X-Patchwork-Id: 843742 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=busybox.net (client-ip=140.211.166.137; helo=fraxinus.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3ypRNN64sTz9sNc for ; Sat, 2 Dec 2017 07:54:44 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 6BF6E88C91; Fri, 1 Dec 2017 20:54:35 +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 eEjyKy36Rf3b; Fri, 1 Dec 2017 20:54:33 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by fraxinus.osuosl.org (Postfix) with ESMTP id B96E388F6D; Fri, 1 Dec 2017 20:54:31 +0000 (UTC) X-Original-To: buildroot@lists.busybox.net Delivered-To: buildroot@osuosl.org Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) by ash.osuosl.org (Postfix) with ESMTP id 2FB7A1C436D for ; Fri, 1 Dec 2017 20:54:22 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 245C588CEB for ; Fri, 1 Dec 2017 20:54:22 +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 b3qbgjK96KWX for ; Fri, 1 Dec 2017 20:54:21 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail.free-electrons.com (mail.free-electrons.com [62.4.15.54]) by fraxinus.osuosl.org (Postfix) with ESMTP id 412FE88DF7 for ; Fri, 1 Dec 2017 20:54:21 +0000 (UTC) Received: by mail.free-electrons.com (Postfix, from userid 110) id 1304820411; Fri, 1 Dec 2017 21:54:20 +0100 (CET) Received: from localhost (LFbn-TOU-1-149-75.w86-201.abo.wanadoo.fr [86.201.231.75]) by mail.free-electrons.com (Postfix) with ESMTPSA id B92FB2097F; Fri, 1 Dec 2017 21:54:02 +0100 (CET) From: Thomas Petazzoni To: Buildroot List , "Arnout Vandecappelle (Essensium/Mind)" , "Yann E. MORIN" , Peter Korsgaard Date: Fri, 1 Dec 2017 21:53:48 +0100 Message-Id: <20171201205352.24287-12-thomas.petazzoni@free-electrons.com> X-Mailer: git-send-email 2.13.6 In-Reply-To: <20171201205352.24287-1-thomas.petazzoni@free-electrons.com> References: <20171201205352.24287-1-thomas.petazzoni@free-electrons.com> Subject: [Buildroot] [RFCv3 11/15] package/pkg-generic: handle host-fakedate as a regular dependency X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.24 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Thomas Petazzoni MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" This commit moves the host-fakedate dependency handling from DEPENDENCIES_HOST_PREREQ to a proper regular dependency handled by the package infrastructure. host-fakedate is added as dependency to all packages, except host-skeleton, because we depend on it. In addition, we make sure that host-fakedate does not grow a dependency on host-{tar,xz,lzip,ccache} to avoid circular dependencies. host-fakedate does not need any extraction tool and does not need to build C/C++ code (the source code is just a shell script available in Buildroot). Signed-off-by: Thomas Petazzoni Reviewed-by: "Yann E. MORIN" --- Changes since v2: - New patch --- Makefile | 1 - package/pkg-generic.mk | 14 ++++++++++---- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index 56bf083098..f31834682c 100644 --- a/Makefile +++ b/Makefile @@ -255,7 +255,6 @@ export LC_ALL = C export GZIP = -n BR2_VERSION_GIT_EPOCH = $(shell GIT_DIR=$(TOPDIR)/.git $(GIT) log -1 --format=%at) export SOURCE_DATE_EPOCH ?= $(if $(wildcard $(TOPDIR)/.git),$(BR2_VERSION_GIT_EPOCH),$(BR2_VERSION_EPOCH)) -DEPENDENCIES_HOST_PREREQ += host-fakedate endif # To put more focus on warnings, be less verbose as default diff --git a/package/pkg-generic.mk b/package/pkg-generic.mk index cb5889c9ef..7c5d951af9 100644 --- a/package/pkg-generic.mk +++ b/package/pkg-generic.mk @@ -587,24 +587,30 @@ ifneq ($(1),host-skeleton) $(2)_DEPENDENCIES += host-skeleton endif -ifeq ($(filter host-tar host-skeleton,$(1)),) +ifeq ($(filter host-tar host-skeleton host-fakedate,$(1)),) $(2)_EXTRACT_DEPENDENCIES += $(BR2_TAR_HOST_DEPENDENCY) endif -ifeq ($(filter host-tar host-skeleton host-xz host-lzip,$(1)),) +ifeq ($(filter host-tar host-skeleton host-xz host-lzip host-fakedate,$(1)),) $(2)_EXTRACT_DEPENDENCIES += $(BR2_XZCAT_HOST_DEPENDENCY) endif -ifeq ($(filter host-tar host-skeleton host-xz host-lzip,$(1)),) +ifeq ($(filter host-tar host-skeleton host-xz host-lzip host-fakedate,$(1)),) $(2)_EXTRACT_DEPENDENCIES += $(BR2_LZIP_HOST_DEPENDENCY) endif ifeq ($(BR2_CCACHE),y) -ifeq ($(filter host-tar host-skeleton host-xz host-lzip,$(1)),) +ifeq ($(filter host-tar host-skeleton host-xz host-lzip host-fakedate,$(1)),) $(2)_DEPENDENCIES += host-ccache endif endif +ifeq ($(BR2_REPRODUCIBLE),y) +ifeq ($(filter host-skeleton,$(1)),) +$(2)_DEPENDENCIES += host-fakedate +endif +endif + # Eliminate duplicates in dependencies $(2)_FINAL_DEPENDENCIES = $$(sort $$($(2)_DEPENDENCIES)) $(2)_FINAL_EXTRACT_DEPENDENCIES = $$(sort $$($(2)_EXTRACT_DEPENDENCIES)) From patchwork Fri Dec 1 20:53:49 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Petazzoni X-Patchwork-Id: 843739 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=busybox.net (client-ip=140.211.166.137; helo=fraxinus.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Received: from fraxinus.osuosl.org (smtp4.osuosl.org [140.211.166.137]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3ypRNG36HXz9sNd for ; Sat, 2 Dec 2017 07:54:38 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by fraxinus.osuosl.org (Postfix) with ESMTP id 8432888E0D; Fri, 1 Dec 2017 20:54:33 +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 gx3nNk1YBq8W; Fri, 1 Dec 2017 20:54:32 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by fraxinus.osuosl.org (Postfix) with ESMTP id 71E1A88F65; Fri, 1 Dec 2017 20:54:30 +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 0A64D1C436D for ; Fri, 1 Dec 2017 20:54:22 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 070278A554 for ; Fri, 1 Dec 2017 20:54:22 +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 swNovihqEgge for ; Fri, 1 Dec 2017 20:54:21 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail.free-electrons.com (mail.free-electrons.com [62.4.15.54]) by hemlock.osuosl.org (Postfix) with ESMTP id 407AA8A54D for ; Fri, 1 Dec 2017 20:54:21 +0000 (UTC) Received: by mail.free-electrons.com (Postfix, from userid 110) id 125572055E; Fri, 1 Dec 2017 21:54:20 +0100 (CET) Received: from localhost (LFbn-TOU-1-149-75.w86-201.abo.wanadoo.fr [86.201.231.75]) by mail.free-electrons.com (Postfix) with ESMTPSA id 0928F20986; Fri, 1 Dec 2017 21:54:03 +0100 (CET) From: Thomas Petazzoni To: Buildroot List , "Arnout Vandecappelle (Essensium/Mind)" , "Yann E. MORIN" , Peter Korsgaard Date: Fri, 1 Dec 2017 21:53:49 +0100 Message-Id: <20171201205352.24287-13-thomas.petazzoni@free-electrons.com> X-Mailer: git-send-email 2.13.6 In-Reply-To: <20171201205352.24287-1-thomas.petazzoni@free-electrons.com> References: <20171201205352.24287-1-thomas.petazzoni@free-electrons.com> Subject: [Buildroot] [RFCv3 12/15] core: kill DEPENDENCIES_HOST_PREREQ X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.24 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Thomas Petazzoni MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" Now that DEPENDENCIES_HOST_PREREQ is no longer used anywhere, we can kill it. Signed-off-by: Thomas Petazzoni Acked-by: "Yann E. MORIN" --- Changes since v2: - New patch --- Makefile | 2 -- package/pkg-generic.mk | 2 -- support/dependencies/dependencies.mk | 10 +++------- 3 files changed, 3 insertions(+), 11 deletions(-) diff --git a/Makefile b/Makefile index f31834682c..090b3ba191 100644 --- a/Makefile +++ b/Makefile @@ -485,8 +485,6 @@ include package/Makefile.in -include $(wildcard arch/arch.mk.*) include support/dependencies/dependencies.mk -PACKAGES += $(DEPENDENCIES_HOST_PREREQ) - include toolchain/*.mk include toolchain/*/*.mk diff --git a/package/pkg-generic.mk b/package/pkg-generic.mk index 7c5d951af9..8c6e34cc9f 100644 --- a/package/pkg-generic.mk +++ b/package/pkg-generic.mk @@ -725,9 +725,7 @@ $(1)-configure: $$($(2)_TARGET_CONFIGURE) $$($(2)_TARGET_CONFIGURE): | $$($(2)_FINAL_DEPENDENCIES) $$($(2)_TARGET_SOURCE) $$($(2)_TARGET_RSYNC): | dirs prepare -ifeq ($$(filter $(1),$$(DEPENDENCIES_HOST_PREREQ)),) $$($(2)_TARGET_SOURCE) $$($(2)_TARGET_RSYNC): | dependencies -endif ifeq ($$($(2)_OVERRIDE_SRCDIR),) # In the normal case (no package override), the sequence of steps is diff --git a/support/dependencies/dependencies.mk b/support/dependencies/dependencies.mk index 1a4b5df9f2..d8ec137b12 100644 --- a/support/dependencies/dependencies.mk +++ b/support/dependencies/dependencies.mk @@ -14,18 +14,14 @@ $(shell support/dependencies/check-host-$(1).sh $(2)) endef -include $(sort $(wildcard support/dependencies/check-host-*.mk)) -core-dependencies: - @HOSTCC="$(firstword $(HOSTCC))" MAKE="$(MAKE)" \ +dependencies: + @HOSTCC="$(firstword $(HOSTCC_NOCCACHE))" MAKE="$(MAKE)" \ DL_TOOLS="$(sort $(DL_TOOLS_DEPENDENCIES))" \ $(TOPDIR)/support/dependencies/dependencies.sh -core-dependencies $(DEPENDENCIES_HOST_PREREQ): HOSTCC=$(HOSTCC_NOCCACHE) -core-dependencies $(DEPENDENCIES_HOST_PREREQ): HOSTCXX=$(HOSTCXX_NOCCACHE) -dependencies: core-dependencies $(DEPENDENCIES_HOST_PREREQ) - ################################################################################ # # Toplevel Makefile options # ################################################################################ -.PHONY: dependencies core-dependencies +.PHONY: dependencies From patchwork Fri Dec 1 20:53:50 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Petazzoni X-Patchwork-Id: 843741 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=busybox.net (client-ip=140.211.166.133; helo=hemlock.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3ypRNL0lDZz9sNd for ; Sat, 2 Dec 2017 07:54:42 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 6A9958A56A; Fri, 1 Dec 2017 20:54:38 +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 uJuRiS5Tzr60; Fri, 1 Dec 2017 20:54:34 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by hemlock.osuosl.org (Postfix) with ESMTP id 6B83C8A55D; Fri, 1 Dec 2017 20:54:34 +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 3637B1C436D for ; Fri, 1 Dec 2017 20:54:23 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 2D61882C13 for ; Fri, 1 Dec 2017 20:54:23 +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 QCkXtwpahIJ0 for ; Fri, 1 Dec 2017 20:54:21 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail.free-electrons.com (mail.free-electrons.com [62.4.15.54]) by whitealder.osuosl.org (Postfix) with ESMTP id 977228172B for ; Fri, 1 Dec 2017 20:54:21 +0000 (UTC) Received: by mail.free-electrons.com (Postfix, from userid 110) id 454EE20749; Fri, 1 Dec 2017 21:54:20 +0100 (CET) Received: from localhost (LFbn-TOU-1-149-75.w86-201.abo.wanadoo.fr [86.201.231.75]) by mail.free-electrons.com (Postfix) with ESMTPSA id 4E01020989; Fri, 1 Dec 2017 21:54:03 +0100 (CET) From: Thomas Petazzoni To: Buildroot List , "Arnout Vandecappelle (Essensium/Mind)" , "Yann E. MORIN" , Peter Korsgaard Date: Fri, 1 Dec 2017 21:53:50 +0100 Message-Id: <20171201205352.24287-14-thomas.petazzoni@free-electrons.com> X-Mailer: git-send-email 2.13.6 In-Reply-To: <20171201205352.24287-1-thomas.petazzoni@free-electrons.com> References: <20171201205352.24287-1-thomas.petazzoni@free-electrons.com> Subject: [Buildroot] [RFCv3 13/15] core: change host RPATH handling X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.24 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Thomas Petazzoni MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" Currently, our strategy for the RPATH of host binaries is as follows: - During the build, we force an absolute RPATH to be encoded into binaries, by passing -Wl,-rpath,$(HOST_DIR)/lib. This ensures that host binaries will find their libraries. - In the "make sdk" target, when preparing the SDK to be relocatable, we use patchelf to replace those absolute RPATHs by relative RPATHs that use $ORIGIN. Unfortunately, the use of absolute RPATH during the build is not compatible with the move to per-package SDK, where a different host directory is used for the build of each package. Therefore, we need to move to a different strategy for RPATH handling. The new strategy is as follows: - We no longer pass -Wl,-rpath,$(HOST_DIR)/lib when building packages, so the host binaries no longer have any rpath encoded. - At the end of the installation of every package, we just the fix-rpath logic on the host binaries, so that all host binaries that don't already have $ORIGIN/../lib as their RPATH are updated to have such a RPATH. In order to achieve this, the following changes are made: - HOST_LDFLAGS no longer contains -Wl,-rpath,$(HOST_DIR) - The hook that ran at the end of every package installation (check_host_rpath) to verify that our hardcoded RPATH is indeed present in all binaries is removed, as it is no longer needed: we will force $ORIGIN/../LIB as an RPATH in all binaries. - host-patchelf is added as a dependency of all packages, except itself. This is necessary as all packages now need to run patchelf at the end of their installation process. TODO: things like host-tar, host-lzip and host-ccache will have to be handled properly. - "fix-rpath host" is called at the end of the package installation, in the recently introduced .stamp_installed, which guarantees to be executed after all of target, staging, images and host installations have completed. Indeed, while in theory only host packages install files into $(HOST_DIR), in practice a number of target packages also install host binaries. So to be reliable, we do the "fix-rpath host" logic at the end of the installation of every package. - The fix-rpath script is modified: * The "host" target now simply hardcodes setting $ORIGIN/../lib as an RPATH, instead of using --relative-to-file * We simply exclude the patchelf program instead of making a copy of it: since patchelf depends only on the C/C++ libraries, it doesn't need to have a RPATH set to $ORIGIN/../lib * Also, in order to avoid re-writing host binaries over and over again, we only set the RPATH if it is not already set. This change is independent from the per-package SDK functionality, and could be applied separately. Signed-off-by: Thomas Petazzoni --- NOTE: an alternative to running "fix-rpath host" at the end of every package installation would be to run it only for host packages (unconditionally) and have a special flag that target packages can use to indicate that they have installed things to $(HOST_DIR). Not sure if this is worth the complexity, though. NOTE2: is it OK to force $ORIGIN/../lib as the RPATH of all host binaries? This is OK for binaries in host/{bin,sbin} of course, but do we have host binaries in other places, for which this $ORIGIN/../lib RPATH wouldn't be appropriate? Changes since v2: - No changes Changes since v1: - Following the feedback from Yann and Arnout, the approach in v2 was completely changed: instead of using LD_LIBRARY_PATH, we now run patchelf at the end of each package installation to fix the RPATH. --- Makefile | 1 - package/Makefile.in | 2 +- package/pkg-generic.mk | 14 ++++++-------- support/scripts/fix-rpath | 31 +++++++++++++++++++------------ 4 files changed, 26 insertions(+), 22 deletions(-) diff --git a/Makefile b/Makefile index 090b3ba191..d8fa91120b 100644 --- a/Makefile +++ b/Makefile @@ -555,7 +555,6 @@ world: target-post-image .PHONY: sdk sdk: world @$(call MESSAGE,"Rendering the SDK relocatable") - $(TOPDIR)/support/scripts/fix-rpath host $(TOPDIR)/support/scripts/fix-rpath staging $(INSTALL) -m 755 $(TOPDIR)/support/misc/relocate-sdk.sh $(HOST_DIR)/relocate-sdk.sh echo $(HOST_DIR) > $(HOST_DIR)/share/buildroot/sdk-location diff --git a/package/Makefile.in b/package/Makefile.in index a1a5316051..e94a75c230 100644 --- a/package/Makefile.in +++ b/package/Makefile.in @@ -220,7 +220,7 @@ HOST_CPPFLAGS = -I$(HOST_DIR)/include HOST_CFLAGS ?= -O2 HOST_CFLAGS += $(HOST_CPPFLAGS) HOST_CXXFLAGS += $(HOST_CFLAGS) -HOST_LDFLAGS += -L$(HOST_DIR)/lib -Wl,-rpath,$(HOST_DIR)/lib +HOST_LDFLAGS += -L$(HOST_DIR)/lib # The macros below are taken from linux 4.11 and adapted slightly. # Copy more when needed. diff --git a/package/pkg-generic.mk b/package/pkg-generic.mk index 8c6e34cc9f..f4a943e3ce 100644 --- a/package/pkg-generic.mk +++ b/package/pkg-generic.mk @@ -118,14 +118,6 @@ endef GLOBAL_INSTRUMENTATION_HOOKS += check_bin_arch -# This hook checks that host packages that need libraries that we build -# have a proper DT_RPATH or DT_RUNPATH tag -define check_host_rpath - $(if $(filter install-host,$(2)),\ - $(if $(filter end,$(1)),support/scripts/check-host-rpath $(3) $(HOST_DIR))) -endef -GLOBAL_INSTRUMENTATION_HOOKS += check_host_rpath - define step_check_build_dir_one if [ -d $(2) ]; then \ printf "%s: installs files in %s\n" $(1) $(2) >&2; \ @@ -343,6 +335,8 @@ $(BUILD_DIR)/%/.stamp_target_installed: # Finalize installation $(BUILD_DIR)/%/.stamp_installed: @$(call step_start,install) + $(if $(filter host-patchelf,$($(PKG)_FINAL_DEPENDENCIES)), \ + $(TOPDIR)/support/scripts/fix-rpath host) @$(call step_end,install) $(Q)touch $@ @@ -587,6 +581,10 @@ ifneq ($(1),host-skeleton) $(2)_DEPENDENCIES += host-skeleton endif +ifeq ($(filter host-patchelf host-skeleton host-tar host-xz host-lzip host-ccache host-fakedate,$(1)),) +$(2)_DEPENDENCIES += host-patchelf +endif + ifeq ($(filter host-tar host-skeleton host-fakedate,$(1)),) $(2)_EXTRACT_DEPENDENCIES += $(BR2_TAR_HOST_DEPENDENCY) endif diff --git a/support/scripts/fix-rpath b/support/scripts/fix-rpath index 15705a3b0d..5b2f24ed32 100755 --- a/support/scripts/fix-rpath +++ b/support/scripts/fix-rpath @@ -61,7 +61,7 @@ main() { local rootdir local tree="${1}" local find_args=( ) - local sanitize_extra_args=( ) + local sanitize_args=( ) if ! "${PATCHELF}" --version > /dev/null 2>&1; then echo "Error: can't execute patchelf utility '${PATCHELF}'" @@ -84,12 +84,14 @@ main() { find_args+=( "-path" "${HOST_DIR}""${excludepath}" "-prune" "-o" ) done - # do not process the patchelf binary but a copy to work-around "file in use" + # do not process the patchelf binary, as it is ourselves + # (and it doesn't need a rpath as it doesn't use libraries + # from HOST_DIR) find_args+=( "-path" "${PATCHELF}" "-prune" "-o" ) - cp "${PATCHELF}" "${PATCHELF}.__to_be_patched" # we always want $ORIGIN-based rpaths to make it relocatable. - sanitize_extra_args+=( "--relative-to-file" ) + sanitize_args+=( "--set-rpath" ) + sanitize_args+=( "\$ORIGIN/../lib" ) ;; staging) @@ -101,14 +103,18 @@ main() { done # should be like for the target tree below - sanitize_extra_args+=( "--no-standard-lib-dirs" ) + sanitize_args+=( "--no-standard-lib-dirs" ) + sanitize_args+=( "--make-rpath-relative" ) + sanitize_args+=( "${rootdir}" ) ;; target) rootdir="${TARGET_DIR}" # we don't want $ORIGIN-based rpaths but absolute paths without rootdir. # we also want to remove rpaths pointing to /lib or /usr/lib. - sanitize_extra_args+=( "--no-standard-lib-dirs" ) + sanitize_args+=( "--no-standard-lib-dirs" ) + sanitize_args+=( "--make-rpath-relative" ) + sanitize_args+=( "${rootdir}" ) ;; *) @@ -120,20 +126,21 @@ main() { find_args+=( "-type" "f" "-print" ) while read file ; do - # check if it's an ELF file - if ${PATCHELF} --print-rpath "${file}" > /dev/null 2>&1; then + rpath=$(${PATCHELF} --print-rpath "${file}" 2>/dev/null) + if test $? -eq 0; then + # For host binaries, if the rpath is already correct, skip + if test "${tree}" = "host" -a "${rpath}" = "\$ORIGIN/../lib" ; then + continue + fi # make files writable if necessary changed=$(chmod -c u+w "${file}") # call patchelf to sanitize the rpath - ${PATCHELF} --make-rpath-relative "${rootdir}" ${sanitize_extra_args[@]} "${file}" + ${PATCHELF} ${sanitize_args[@]} "${file}" # restore the original permission test "${changed}" != "" && chmod u-w "${file}" fi done < <(find "${rootdir}" ${find_args[@]}) - # Restore patched patchelf utility - test "${tree}" = "host" && mv "${PATCHELF}.__to_be_patched" "${PATCHELF}" - # ignore errors return 0 } From patchwork Fri Dec 1 20:53:51 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Petazzoni X-Patchwork-Id: 843738 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=busybox.net (client-ip=140.211.166.133; helo=hemlock.osuosl.org; envelope-from=buildroot-bounces@busybox.net; receiver=) Received: from hemlock.osuosl.org (smtp2.osuosl.org [140.211.166.133]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3ypRNG0RFPz9sNc for ; Sat, 2 Dec 2017 07:54:37 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id 5EF7D8A54D; Fri, 1 Dec 2017 20:54:34 +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 LRcpEODaW+ON; Fri, 1 Dec 2017 20:54:33 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by hemlock.osuosl.org (Postfix) with ESMTP id 987EB8A556; Fri, 1 Dec 2017 20:54:33 +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 65FF11C436D for ; Fri, 1 Dec 2017 20:54:22 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 11AEC81E75 for ; Fri, 1 Dec 2017 20:54:22 +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 59VKtFB3an7r for ; Fri, 1 Dec 2017 20:54:21 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail.free-electrons.com (mail.free-electrons.com [62.4.15.54]) by whitealder.osuosl.org (Postfix) with ESMTP id 7E90F81489 for ; Fri, 1 Dec 2017 20:54:21 +0000 (UTC) Received: by mail.free-electrons.com (Postfix, from userid 110) id 37865206EF; Fri, 1 Dec 2017 21:54:20 +0100 (CET) Received: from localhost (LFbn-TOU-1-149-75.w86-201.abo.wanadoo.fr [86.201.231.75]) by mail.free-electrons.com (Postfix) with ESMTPSA id 9613120999; Fri, 1 Dec 2017 21:54:03 +0100 (CET) From: Thomas Petazzoni To: Buildroot List , "Arnout Vandecappelle (Essensium/Mind)" , "Yann E. MORIN" , Peter Korsgaard Date: Fri, 1 Dec 2017 21:53:51 +0100 Message-Id: <20171201205352.24287-15-thomas.petazzoni@free-electrons.com> X-Mailer: git-send-email 2.13.6 In-Reply-To: <20171201205352.24287-1-thomas.petazzoni@free-electrons.com> References: <20171201205352.24287-1-thomas.petazzoni@free-electrons.com> Subject: [Buildroot] [RFCv3 14/15] Makefile: evaluate CCACHE and HOST{CC, CXX} at time of use X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.24 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Thomas Petazzoni MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" As we are going to move to per-package SDK, the location of CCACHE and therefore the definitions of HOSTCC and HOSTCXX need to be evaluated at the time of use and not at the time of assignment. Indeed, the value of HOST_DIR changes from one package to the other. Therefore, we need to change from := to =. In addition, while doing A := $(something) $(A) is possible, doing A = $(something) $(A) is not legal. So, instead of defining HOSTCC in terms of the current HOSTCC variable, we re-use HOSTCC_NOCCACHE instead. Signed-off-by: Thomas Petazzoni Reviewed-by: "Yann E. MORIN" --- Changes since v2: - New patch --- Makefile | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index d8fa91120b..e05a1ec09a 100644 --- a/Makefile +++ b/Makefile @@ -446,11 +446,11 @@ BR_PATH = "$(HOST_DIR)/bin:$(HOST_DIR)/sbin:$(PATH)" TARGET_DIR_WARNING_FILE = $(TARGET_DIR)/THIS_IS_NOT_YOUR_ROOT_FILESYSTEM ifeq ($(BR2_CCACHE),y) -CCACHE := $(HOST_DIR)/bin/ccache +CCACHE = $(HOST_DIR)/bin/ccache BR_CACHE_DIR ?= $(call qstrip,$(BR2_CCACHE_DIR)) export BR_CACHE_DIR -HOSTCC := $(CCACHE) $(HOSTCC) -HOSTCXX := $(CCACHE) $(HOSTCXX) +HOSTCC = $(CCACHE) $(HOSTCC_NOCCACHE) +HOSTCXX = $(CCACHE) $(HOSTCXX_NOCCACHE) else export BR_NO_CCACHE endif From patchwork Fri Dec 1 20:53:52 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Petazzoni X-Patchwork-Id: 843740 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@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=) Received: from silver.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3ypRNK199Bz9sNc for ; Sat, 2 Dec 2017 07:54:41 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 4FCC230BFF; Fri, 1 Dec 2017 20:54:39 +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 zZgZEKuh6fuZ; Fri, 1 Dec 2017 20:54:37 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by silver.osuosl.org (Postfix) with ESMTP id E996C30BF4; Fri, 1 Dec 2017 20:54:36 +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 A7E2A1C436D for ; Fri, 1 Dec 2017 20:54:29 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by silver.osuosl.org (Postfix) with ESMTP id 9CAAB30BD6 for ; Fri, 1 Dec 2017 20:54:29 +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 PN-uOKNEbOse for ; Fri, 1 Dec 2017 20:54:23 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail.free-electrons.com (mail.free-electrons.com [62.4.15.54]) by silver.osuosl.org (Postfix) with ESMTP id D5F0830BDE for ; Fri, 1 Dec 2017 20:54:21 +0000 (UTC) Received: by mail.free-electrons.com (Postfix, from userid 110) id 7EAE820750; Fri, 1 Dec 2017 21:54:20 +0100 (CET) Received: from localhost (LFbn-TOU-1-149-75.w86-201.abo.wanadoo.fr [86.201.231.75]) by mail.free-electrons.com (Postfix) with ESMTPSA id DA6452099A; Fri, 1 Dec 2017 21:54:03 +0100 (CET) From: Thomas Petazzoni To: Buildroot List , "Arnout Vandecappelle (Essensium/Mind)" , "Yann E. MORIN" , Peter Korsgaard Date: Fri, 1 Dec 2017 21:53:52 +0100 Message-Id: <20171201205352.24287-16-thomas.petazzoni@free-electrons.com> X-Mailer: git-send-email 2.13.6 In-Reply-To: <20171201205352.24287-1-thomas.petazzoni@free-electrons.com> References: <20171201205352.24287-1-thomas.petazzoni@free-electrons.com> Subject: [Buildroot] [RFCv3 15/15] core: implement per-package SDK and target X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.24 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Thomas Petazzoni MIME-Version: 1.0 Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" This commit implemnts the core of the move to per-package SDK and target directories. The main idea is that instead of having a global output/host and output/target in which all packages install files, we switch to per-package host and target folders, that only contain their explicit dependencies. There are two main benefits: - Packages will no longer discover dependencies that they do not explicitly indicate in their _DEPENDENCIES variable. - We can support top-level parallel build properly, because a package only "sees" its own host directory and target directory, isolated from the build of other packages that can happen in parallel. It works as follows: - A new output/per-package/ folder is created, which will contain one sub-folder per package, and inside it, a "host" folder and a "target" folder: output/per-package/busybox/target output/per-package/busybox/host output/per-package/host-fakeroot/target output/per-package/host-fakeroot/host This output/per-package/ folder is PER_PACKAGE_DIR. - The global TARGET_DIR and HOST_DIR variable now automatically point to the per-package directory when PKG is defined. So whenever a package references $(HOST_DIR) or $(TARGET_DIR) in its build process, it effectively references the per-package host/target directories. Note that STAGING_DIR is a sub-dir of HOST_DIR, so it is handled as well. - Of course, packages have dependencies, so those dependencies must be installed in the per-package host and target folders. To do so, we simply rsync (using hard links to save space and time) the host and target folders of the direct dependencies of the package to the current package host and target folders. We only need to take care of direct dependencies (and not recursively all dependencies), because we accumulate into those per-package host and target folders the files installed by the dependencies. Note that this only works because we make the assumption that one package does *not* overwrite files installed by another package. This is done for "extract dependencies" at the beginning of the extract step, and for "normal dependencies" at the beginning of the configure step. This is basically enough to make per-package SDK and target work. The only gotcha is that at the end of the build, output/target and output/host are empty, which means that: - The filesystem image creation code cannot work. - We don't have a SDK to build code outside of Buildroot. In order to fix this, this commit extends the target-finalize step so that it starts by populating output/target and output/host by rsync-ing into them the target and host directories of all packages listed in the $(PACKAGES) variable. It is necessary to do this sequentially in the target-finalize step and not in each package. Doing it in package installation means that it can be done in parallel. In that case, there is a chance that two rsyncs are creating the same hardlink or directory at the same time, which makes one of them fail. Signed-off-by: Thomas Petazzoni --- Changes since v2: - Account for _EXTRACT_DEPENDENCIES in the extract step of the package, by rsync'ing their host and target directories to the current package host/target directory. Changes since v1: - Remove the LD_LIBRARY_PATH change since we're now longer relying on LD_LIBRARY_PATH to allow host programs to find their libraries. - Improve commit log according to Arnout suggestions - Remove -u option from rsync calls in the main Makefile, suggested by Arnout - Drop entirely the definitions of _TARGET_DIR, _STAGING_DIR and _HOST_DIR, and instead make the global TARGET_DIR, HOST_DIR variables point to the per-package directories when PKG is defined. Suggested by Arnout. --- Makefile | 20 ++++++++++++++++---- package/pkg-generic.mk | 17 +++++++++++++++++ 2 files changed, 33 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index e05a1ec09a..978177fc83 100644 --- a/Makefile +++ b/Makefile @@ -215,7 +215,9 @@ BR_GRAPH_OUT := $(or $(BR2_GRAPH_OUT),pdf) BUILD_DIR := $(BASE_DIR)/build BINARIES_DIR := $(BASE_DIR)/images -TARGET_DIR := $(BASE_DIR)/target +PER_PACKAGE_DIR := $(BASE_DIR)/per-package +TARGET_DIR = $(if $(PKG),$(PER_PACKAGE_DIR)/$($(PKG)_NAME)/target,$(BASE_DIR)/target) + # initial definition so that 'make clean' works for most users, even without # .config. HOST_DIR will be overwritten later when .config is included. HOST_DIR := $(BASE_DIR)/host @@ -237,7 +239,7 @@ LEGAL_REPORT = $(LEGAL_INFO_DIR)/README # dependencies anywhere else # ################################################################################ -$(BUILD_DIR) $(TARGET_DIR) $(HOST_DIR) $(BINARIES_DIR) $(LEGAL_INFO_DIR) $(REDIST_SOURCES_DIR_TARGET) $(REDIST_SOURCES_DIR_HOST): +$(BUILD_DIR) $(TARGET_DIR) $(HOST_DIR) $(BINARIES_DIR) $(LEGAL_INFO_DIR) $(REDIST_SOURCES_DIR_TARGET) $(REDIST_SOURCES_DIR_HOST) $(PER_PACKAGE_DIR): @mkdir -p $@ BR2_CONFIG = $(CONFIG_DIR)/.config @@ -436,7 +438,7 @@ LZCAT := $(call qstrip,$(BR2_LZCAT)) TAR_OPTIONS = $(call qstrip,$(BR2_TAR_OPTIONS)) -xf # packages compiled for the host go here -HOST_DIR := $(call qstrip,$(BR2_HOST_DIR)) +HOST_DIR = $(if $(PKG),$(PER_PACKAGE_DIR)/$($(PKG)_NAME)/host,$(call qstrip,$(BR2_HOST_DIR))) # Quotes are needed for spaces and all in the original PATH content. BR_PATH = "$(HOST_DIR)/bin:$(HOST_DIR)/sbin:$(PATH)" @@ -663,6 +665,16 @@ $(TARGETS_ROOTFS): target-finalize .PHONY: target-finalize target-finalize: $(PACKAGES) + @$(call MESSAGE,"Creating global target directory") + $(foreach pkg,$(PACKAGES),\ + rsync -a --link-dest=$(PER_PACKAGE_DIR)/$(pkg)/target/ \ + $(PER_PACKAGE_DIR)/$(pkg)/target/ \ + $(TARGET_DIR)$(sep)) + @$(call MESSAGE,"Creating global host directory") + $(foreach pkg,$(PACKAGES),\ + rsync -a --link-dest=$(PER_PACKAGE_DIR)/$(pkg)/host/ \ + $(PER_PACKAGE_DIR)/$(pkg)/host/ \ + $(HOST_DIR)$(sep)) @$(call MESSAGE,"Finalizing target directory") # Check files that are touched by more than one package ./support/scripts/check-uniq-files -t target $(BUILD_DIR)/packages-file-list.txt @@ -959,7 +971,7 @@ printvars: clean: rm -rf $(TARGET_DIR) $(BINARIES_DIR) $(HOST_DIR) \ $(BUILD_DIR) $(BASE_DIR)/staging \ - $(LEGAL_INFO_DIR) $(GRAPHS_DIR) + $(LEGAL_INFO_DIR) $(GRAPHS_DIR) $(PER_PACKAGE_DIR) .PHONY: distclean distclean: clean diff --git a/package/pkg-generic.mk b/package/pkg-generic.mk index f4a943e3ce..f659248416 100644 --- a/package/pkg-generic.mk +++ b/package/pkg-generic.mk @@ -171,6 +171,15 @@ $(BUILD_DIR)/%/.stamp_actual_downloaded: $(BUILD_DIR)/%/.stamp_extracted: @$(call step_start,extract) @$(call MESSAGE,"Extracting") + @mkdir -p $(HOST_DIR) $(TARGET_DIR) $(STAGING_DIR) + $(foreach pkg,$($(PKG)_FINAL_EXTRACT_DEPENDENCIES),\ + rsync -a --link-dest=$(PER_PACKAGE_DIR)/$(pkg)/host/ \ + $(PER_PACKAGE_DIR)/$(pkg)/host/ \ + $(HOST_DIR)$(sep)) + $(foreach pkg,$($(PKG)_FINAL_EXTRACT_DEPENDENCIES),\ + rsync -a --link-dest=$(PER_PACKAGE_DIR)/$(pkg)/target/ \ + $(PER_PACKAGE_DIR)/$(pkg)/target/ \ + $(TARGET_DIR)$(sep)) $(foreach hook,$($(PKG)_PRE_EXTRACT_HOOKS),$(call $(hook))$(sep)) $(Q)mkdir -p $(@D) $($(PKG)_EXTRACT_CMDS) @@ -228,6 +237,14 @@ $(foreach dir,$(call qstrip,$(BR2_GLOBAL_PATCH_DIR)),\ $(BUILD_DIR)/%/.stamp_configured: @$(call step_start,configure) @$(call MESSAGE,"Configuring") + $(foreach pkg,$($(PKG)_FINAL_DEPENDENCIES),\ + rsync -a --link-dest=$(PER_PACKAGE_DIR)/$(pkg)/host/ \ + $(PER_PACKAGE_DIR)/$(pkg)/host/ \ + $(HOST_DIR)$(sep)) + $(foreach pkg,$($(PKG)_FINAL_DEPENDENCIES),\ + rsync -a --link-dest=$(PER_PACKAGE_DIR)/$(pkg)/target/ \ + $(PER_PACKAGE_DIR)/$(pkg)/target/ \ + $(TARGET_DIR)$(sep)) $(foreach hook,$($(PKG)_PRE_CONFIGURE_HOOKS),$(call $(hook))$(sep)) $($(PKG)_CONFIGURE_CMDS) $(foreach hook,$($(PKG)_POST_CONFIGURE_HOOKS),$(call $(hook))$(sep))