From patchwork Thu Nov 3 01:55:16 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnout Vandecappelle X-Patchwork-Id: 690649 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org 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 3t8Sjk5PlSz9t3N for ; Thu, 3 Nov 2016 12:55:54 +1100 (AEDT) Received: from localhost (localhost [127.0.0.1]) by whitealder.osuosl.org (Postfix) with ESMTP id 46C47924BC; Thu, 3 Nov 2016 01:55:50 +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 sJluGT+dbpQV; Thu, 3 Nov 2016 01:55:46 +0000 (UTC) Received: from ash.osuosl.org (ash.osuosl.org [140.211.166.34]) by whitealder.osuosl.org (Postfix) with ESMTP id B7EFE924C3; Thu, 3 Nov 2016 01:55:45 +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 EA97F1C2C27 for ; Thu, 3 Nov 2016 01:55:42 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by hemlock.osuosl.org (Postfix) with ESMTP id E3E67956E2 for ; Thu, 3 Nov 2016 01:55:42 +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 xYneLSVVWeNP for ; Thu, 3 Nov 2016 01:55:41 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from exchange.essensium.com (220.77.144.195.ipv4.evonet.be [195.144.77.220]) by hemlock.osuosl.org (Postfix) with ESMTPS id 5FAEF956DD for ; Thu, 3 Nov 2016 01:55:41 +0000 (UTC) Received: from localhost.localdomain (10.3.7.11) by beleexch01.local.ess-mail.com (10.3.7.8) with Microsoft SMTP Server (TLS) id 15.0.847.32; Thu, 3 Nov 2016 02:55:27 +0100 From: "Arnout Vandecappelle (Essensium/Mind)" To: Date: Thu, 3 Nov 2016 02:55:16 +0100 Message-ID: <20161103015517.15943-1-arnout@mind.be> X-Mailer: git-send-email 2.9.3 MIME-Version: 1.0 X-Originating-IP: [10.3.7.11] X-ClientProxiedBy: beleexch01.local.ess-mail.com (10.3.7.8) To beleexch01.local.ess-mail.com (10.3.7.8) Cc: "Yann E . MORIN" Subject: [Buildroot] [PATCH 1/2] core: don't reset MAKEOVERRIDES when re-entering make X-BeenThere: buildroot@busybox.net X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Discussion and development of buildroot List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: buildroot-bounces@busybox.net Sender: "buildroot" We reset MAKEOVERRIDES to avoid passing down variables that are overridden on the command line to the package build systems. Indeed, the variables overridden on the command line will be Buildroot variables and not relevant to the package build system. In particular the O option is used by some packages and the value passed in on the command line is plain wrong for the individual package. However, in commit 916e614b, MAKEOVERRIDES was moved earlier and it was reset _before_ re-entering make in the cases when something has to be fixed up (incorrect umask, non-absolute paths in O or CURDIR). Therefore, if make is re-entered, any command line overrides are lost. This particularly bites the autobuilders, because they use O= to specify the output directory, and they add BR2_JLEVEL=... to avoid starting too many jobs in parallel. The BR2_JLEVEL override is lost. Signed-off-by: Arnout Vandecappelle (Essensium/Mind) Cc: Samuel Martin Cc: Yann E. MORIN Reviewed-by: Samuel Martin Tested-by: Maxime Hadjinlian --- I have a little worry, because there are two other places where we re- enter top-level make and those are not handled: silentoldconfig and external-deps. BR2_JLEVEL is not relevant for those, but other command- line overridden options may be. However, this hasn't changed from before commit 916e614b so I guess it's OK. --- Makefile | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index c00e200..4b494a3 100644 --- a/Makefile +++ b/Makefile @@ -35,11 +35,6 @@ SHELL := $(shell if [ -x "$$BASH" ]; then echo $$BASH; \ ifneq ("$(origin O)", "command line") O := $(CURDIR)/output else -# Other packages might also support Linux-style out of tree builds -# with the O= syntax (E.G. BusyBox does). As make automatically -# forwards command line variable definitions those packages get very -# confused. Fix this by telling make to not do so. -MAKEOVERRIDES := # Strangely enough O is still passed to submakes with MAKEOVERRIDES # (with make 3.81 atleast), the only thing that changes is the output # of the origin function (command line -> environment). @@ -155,6 +150,13 @@ else ifneq ($(filter-out $(nobuild_targets),$(MAKECMDGOALS)),) BR_BUILDING = y endif +# We call make recursively to build packages. The command-line overrides that +# are passed to Buildroot don't apply to those package build systems. In +# particular, we don't want to pass down the O= option for out-of-tree +# builds, because the value specified on the command line will not be correct +# for packages. +MAKEOVERRIDES := + # Include some helper macros and variables include support/misc/utils.mk