Received: by 10.213.65.68 with SMTP id h4csp1144509imn; Wed, 14 Mar 2018 10:53:40 -0700 (PDT) X-Google-Smtp-Source: AG47ELuOM0ulRIEPnml+PiMpLS9JSZnt737WH5XVb2dMqBh9fYHQZj/xwTZBsmgdrDHbpT8ehRjW X-Received: by 2002:a17:902:122:: with SMTP id 31-v6mr4996262plb.280.1521050020622; Wed, 14 Mar 2018 10:53:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521050020; cv=none; d=google.com; s=arc-20160816; b=gTvhdEK3uo6XakDNbgLu6gwnRCR2HVY87zTY0gBTSlBIr3OJcv0hC8njyQV4gGe4rk ylC9fJN/jndEQjkXidmqukXfioYHZ4Yiidgc2FTh5lT+/fZMqRQluer5b39z+A5SCppR lPZBFMKUIPvIjcd+A7z7PkBxmKcDgD9NJTjJENKeKbt/0RYFhC+jIX/w+iMEwPgU+Dgj VUXTstT7GxgANor+MnVIDW3cFgtCYu/gqM3HnFuuLMJBromYa3QgK4xZmEPChew9vwLe tuWslOpyM3RNCDAgBh8Szcwslk6Z0rTa7Yq2zazNLT3eHB74YOPKtMUlzDvZ/WkkKRjY xuoQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:from:date:dkim-signature :arc-authentication-results; bh=0OD2sb7wtscUIxdBLOQ7Ap0DAWuy58gLgVfoW7VXT0o=; b=qQN8DJ8bzC8GTYx2fp7B121dzR4usobqMi+Yk+oLMULjz+8rxykiK8oiHpVd7+jwbQ mwePTQTd5uIB5+IZfhbIIw5vBkZSADDLG3km0PKjYEkiwBCbTnyKq2jhRCy/Y0dYsMUo ILAy1XnwSSE0B8SuZsiXIDeRsvyfreR0KxGVhrdVQ8xncNId9qp87KFvc9yXLd9Mpi1D fexntLdG0NnkUyzosziulIPYba9nexa6gXCp+lFkOpcopt20/nM6Nsi/GqS+mzWu2i3K WUwwZiRahnIRVSIXWzO9sTdiFnho4PUzkDl2Uuxg1bzDfQX614KxekdcRnw9uAGJN1Ri 89nw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=UW/Ntd7Y; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z1si1273595pgn.564.2018.03.14.10.53.25; Wed, 14 Mar 2018 10:53:40 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=UW/Ntd7Y; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752007AbeCNRwU (ORCPT + 99 others); Wed, 14 Mar 2018 13:52:20 -0400 Received: from mail-qk0-f194.google.com ([209.85.220.194]:43556 "EHLO mail-qk0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751413AbeCNRwS (ORCPT ); Wed, 14 Mar 2018 13:52:18 -0400 Received: by mail-qk0-f194.google.com with SMTP id g184so4394869qkd.10 for ; Wed, 14 Mar 2018 10:52:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:in-reply-to:message-id:references :user-agent:mime-version; bh=0OD2sb7wtscUIxdBLOQ7Ap0DAWuy58gLgVfoW7VXT0o=; b=UW/Ntd7Yv2YRJ4++Twl9AWqMZpXUh/c9r9j+MHf5DNbMD9jHDfb6rOdPhxOoH4Ifh7 RoXyq239QBek5dUBjEEhxxyoe39ebEw+8H69ykgy4/d19M9NUjoM6Z12O/d5NHY2i+G0 GefcqCy+x3yXXBptyjN2D/OX4q5RPvy/rLKlA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:in-reply-to:message-id :references:user-agent:mime-version; bh=0OD2sb7wtscUIxdBLOQ7Ap0DAWuy58gLgVfoW7VXT0o=; b=CYg1ddJjXdE1DHmQnZd3zzeXpR1R3QndX8DHqR9K2TuOLR7ACmINY9+25HwCrU7Dvp +ybqBp9TIYwmdMArFmTg3B+2ULsOi5p6uuCnWyASoTCKeK0Yz9fuGFeGYBb1VVASqUqF IxdwvAj7MCywulMGu6BXWYZefmiwp3R2B7evGgkBk0ETdElcB4ei4HCaBmO+pX3KAa/r MUWnR9ADJKlD5/aFB8yh3s18ZnwEC9HL3ZaUle2Swuh6n5AEE3pwa78RYenXGev63HX+ q4L4TqhjpCoJAYvgT8fD7D5hUOhL8rC8SfGXlRpTiXtE6jV4KTYw6azXcC+g1HMTynYR QtFQ== X-Gm-Message-State: AElRT7GWbZ/2o67gFhFzRcSWclqNpCyJQROgOVrmgtgM6Xk6gUVI6R/1 MM9qOV60Rs+4wyOPrgpE3476JA== X-Received: by 10.55.86.133 with SMTP id k127mr8287237qkb.167.1521049937660; Wed, 14 Mar 2018 10:52:17 -0700 (PDT) Received: from xanadu.home (modemcable228.104-82-70.mc.videotron.ca. [70.82.104.228]) by smtp.gmail.com with ESMTPSA id m6sm2373552qti.25.2018.03.14.10.52.16 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 14 Mar 2018 10:52:16 -0700 (PDT) Date: Wed, 14 Mar 2018 13:52:16 -0400 (EDT) From: Nicolas Pitre To: Masahiro Yamada cc: linux-kbuild@vger.kernel.org, Jarod Wilson , Prarit Bhargava , Michal Marek , linux-kernel@vger.kernel.org Subject: Re: [PATCH 4/7] kbuild: restore touching autoksyms.h to the top Makefile In-Reply-To: <1521045861-22418-5-git-send-email-yamada.masahiro@socionext.com> Message-ID: References: <1521045861-22418-1-git-send-email-yamada.masahiro@socionext.com> <1521045861-22418-5-git-send-email-yamada.masahiro@socionext.com> User-Agent: Alpine 2.21 (LFD 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 15 Mar 2018, Masahiro Yamada wrote: > Commit d3fc425e819b ("kbuild: make sure autoksyms.h exists early") > moved the code that touches autoksyms.h to scripts/kconfig/Makefile > with obscure reason. > > From Nicolas' comment [1], he did not seem to be sure about the root > cause. > > I guess I figured it out, so here is a fix-up I think is more correct. > According to the error log in the original post [2], the build failed > in scripts/mod/devicetable-offsets.c > > scripts/mod/Makefile is descended from scripts/Makefile, which is > invoked from the top-level Makefile by the 'scripts' target. > > To build vmlinux and/or modules, Kbuild descend into $(vmlinux-dirs). > This depends on 'prepare' and 'script' as follows: > > $(vmlinux-dirs): prepare scripts > > Because there is no dependency between 'prepare' and 'scripts', the > parallel building can run them simultaneously. > > 'prepare' depends on 'prepare1', which touched autoksyms.h, whereas > 'scripts' descends into script/, then scripts/mod/, which needed > if CONFIG_TRIM_UNUSED_KSYMS. This was the > reason of race. > > I am not happy to have unrelated code in the Kconfig Makefile, so > getting it back to the top Makefile. > > I remove the standalone test target because I want to use it to > create an empty autoksyms.h file. Here is a little improvement; > unnecessary autoksyms.h is not created when CONFIG_TRIM_UNUSED_KSYMS > is disabled. > > [1] https://lkml.org/lkml/2016/11/30/734 > [2] https://lkml.org/lkml/2016/11/30/531 > > Signed-off-by: Masahiro Yamada You're the make master! Acked-by: Nicolas Pitre > Commit: > > The discussion happened in Nov. 2016. > > I was not involved in it. > I was not the Kbuild maintainer at that time. > > END > > --- > > Makefile | 12 +++++++----- > scripts/kconfig/Makefile | 2 -- > 2 files changed, 7 insertions(+), 7 deletions(-) > > diff --git a/Makefile b/Makefile > index fab0e19..decc870 100644 > --- a/Makefile > +++ b/Makefile > @@ -1010,9 +1010,11 @@ ifdef CONFIG_TRIM_UNUSED_KSYMS > "$(MAKE) -f $(srctree)/Makefile vmlinux" > endif > > -# standalone target for easier testing > -include/generated/autoksyms.h: FORCE > - $(Q)$(CONFIG_SHELL) $(srctree)/scripts/adjust_autoksyms.sh true > +autoksyms_h := $(if $(CONFIG_TRIM_UNUSED_KSYMS), include/generated/autoksyms.h) > + > +$(autoksyms_h): > + $(Q)mkdir -p $(dir $@) > + $(Q)touch $@ > > ARCH_POSTLINK := $(wildcard $(srctree)/arch/$(SRCARCH)/Makefile.postlink) > > @@ -1056,7 +1058,7 @@ include/config/kernel.release: include/config/auto.conf FORCE > # in parallel > PHONY += scripts > scripts: scripts_basic include/config/auto.conf include/config/tristate.conf \ > - asm-generic gcc-plugins autoksyms > + asm-generic gcc-plugins $(autoksyms_h) > $(Q)$(MAKE) $(build)=$(@) > > # Things we need to do before we recursively start building the kernel > @@ -1086,7 +1088,7 @@ endif > # that need to depend on updated CONFIG_* values can be checked here. > prepare2: prepare3 prepare-compiler-check outputmakefile asm-generic > > -prepare1: prepare2 $(version_h) include/generated/utsrelease.h \ > +prepare1: prepare2 $(version_h) $(autoksyms_h) include/generated/utsrelease.h \ > include/config/auto.conf > $(cmd_crmodverdir) > > diff --git a/scripts/kconfig/Makefile b/scripts/kconfig/Makefile > index cb3ec53..eb139a1 100644 > --- a/scripts/kconfig/Makefile > +++ b/scripts/kconfig/Makefile > @@ -38,8 +38,6 @@ nconfig: $(obj)/nconf > # for external use. > silentoldconfig: $(obj)/conf > $(Q)mkdir -p include/config include/generated > - $(Q)test -e include/generated/autoksyms.h || \ > - touch include/generated/autoksyms.h > $< $(silent) --$@ $(Kconfig) > > localyesconfig localmodconfig: $(obj)/streamline_config.pl $(obj)/conf > -- > 2.7.4 > >