From patchwork Fri Mar 16 07:37:09 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 131913 Delivered-To: patch@linaro.org Received: by 10.46.84.17 with SMTP id i17csp411657ljb; Fri, 16 Mar 2018 00:39:19 -0700 (PDT) X-Google-Smtp-Source: AG47ELvmACjn1fOWtjkrzK6QUnWFF2IT8d0cikzAIZIqOK86NtHq/QFU07Krs95XsZHSq31SN7u8 X-Received: by 2002:a17:902:a612:: with SMTP id u18-v6mr1038547plq.92.1521185959102; Fri, 16 Mar 2018 00:39:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521185959; cv=none; d=google.com; s=arc-20160816; b=wZCZCvsAKuHvoooOTOL3r7xGDOsVbN1+wej03qiPbu9mEn0IiMnhu27fg9zJc4KLHA QvMNmjNCVMGxTDlgEx5i3G1QS1I//7dgid4fGKBFcdeBX4gGWVR6DlKY5w5WCY3R01S7 A4XTcvVVGf0Vh67eTdgtE4Zk9ozqqFIXPN8eFlbrvFC5uQWk6JFx962J+rct9y8QIrQB 278ZeIbP5OPSMcLUjqOHdAf6BXsctd2yqWBDvwNu9lixnmc7VzowXsl/dRlyDSwnUWxY B55rcFre5b/vU7WTXsG6fGciEPstHs2MpGiEioJ/4GM+xQZ2tgAZmRmP6b7VBaSZUNyj hVrQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:dkim-filter :arc-authentication-results; bh=i3k286/oEU6Y6wspvx0LQAGTckY2xv3E2keBIxNEWcI=; b=RB2dkBOiNk792s9xYTSEwZcEj7gwImhvM41a3sSkwfRt8T0iUHaKvT08qJe1Sa2IP0 e7nAmz54Uj8tmy4Mumcwutuebp8nmtgtTPOqHWam+HBWO1EccfY4mMh8GRy6qr3oaBVK gCMTHpshVkVuzjCSs63peVbEmsCbwuxsZuwVucwmWT0S7Gy06hemlrmdXvFjAHG0L6JE BPUCACPTUy8PiitnM/mJXKDy21h5tbKopT9Yv4oo76p9QhUnQxGcLGHf4kHlXTSKWvb8 E7SMTPQkLS0FFu7NTcbuVTm6tNjsC48cqJz0ecSZ6YPf6qoP8X8ua/dFWbujK4NZi8dD rD3g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=1gYBTZwI; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d16-v6si5596864pll.504.2018.03.16.00.39.18; Fri, 16 Mar 2018 00:39:19 -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=@nifty.com header.s=dec2015msa header.b=1gYBTZwI; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753257AbeCPHhp (ORCPT + 28 others); Fri, 16 Mar 2018 03:37:45 -0400 Received: from conuserg-08.nifty.com ([210.131.2.75]:20643 "EHLO conuserg-08.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750847AbeCPHhn (ORCPT ); Fri, 16 Mar 2018 03:37:43 -0400 Received: from pug.e01.socionext.com (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-08.nifty.com with ESMTP id w2G7bOa4029139; Fri, 16 Mar 2018 16:37:25 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-08.nifty.com w2G7bOa4029139 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1521185846; bh=i3k286/oEU6Y6wspvx0LQAGTckY2xv3E2keBIxNEWcI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=1gYBTZwICLsUQ7cfiOf72OzDpMkFP18xqWkOVqh7xpbdA42vKpXzJNgxLV6yRMLEE l2WD/TMvQTfD8t7cIhQKKn6pnrTfghEAK9NKUSJrDDJpH45pbIjpNQ6C1/V8Sfg8d/ Egamz0afZRbRsn3aBZegf1OuH9AFdUxVjrXuQ1nwsdyk45iAPxViX6kcbxk1SNzHH4 akHJIg2baeWTz7k7QTsKxlrHfVDbSZIJ7DiZHSsmR3AIp0VcYXZKga6UgYPPEsE1H8 75L6YjOM3nnHw/qxdgkw/s3ltPigDhQUt2xooJo6wmxxeH8MfGqYEBFWh1/QlXtpMB 5wJq+DDskiN7Q== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: Michal Marek , Nicolas Pitre , linux-kernel@vger.kernel.org, Masahiro Yamada Subject: [PATCH v4 1/7] kbuild: clear LDFLAGS in the top Makefile Date: Fri, 16 Mar 2018 16:37:09 +0900 Message-Id: <1521185836-19120-2-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1521185836-19120-1-git-send-email-yamada.masahiro@socionext.com> References: <1521185836-19120-1-git-send-email-yamada.masahiro@socionext.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Currently LDFLAGS is not cleared, so same flags are accumulated in LDFLAGS when the top Makefile is recursively invoked. I found unneeded rebuild for ARCH=arm64 when CONFIG_TRIM_UNUSED_KSYMS is enabled. If include/generated/autoksyms.h is updated, the top Makefile is recursively invoked, then arch/arm64/Makefile adds one more '-maarch64linux'. Due to the command line change, modules are rebuilt needlessly. Signed-off-by: Masahiro Yamada Acked-by: Nicolas Pitre --- Changes in v4: None Changes in v3: None Changes in v2: None Makefile | 1 + 1 file changed, 1 insertion(+) -- 2.7.4 diff --git a/Makefile b/Makefile index d9bb6dd6..ac8755d 100644 --- a/Makefile +++ b/Makefile @@ -437,6 +437,7 @@ KBUILD_CFLAGS_KERNEL := KBUILD_AFLAGS_MODULE := -DMODULE KBUILD_CFLAGS_MODULE := -DMODULE KBUILD_LDFLAGS_MODULE := -T $(srctree)/scripts/module-common.lds +LDFLAGS := GCC_PLUGINS_CFLAGS := export ARCH SRCARCH CONFIG_SHELL HOSTCC HOSTCFLAGS CROSS_COMPILE AS LD CC From patchwork Fri Mar 16 07:37:10 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 131907 Delivered-To: patch@linaro.org Received: by 10.46.84.17 with SMTP id i17csp410673ljb; Fri, 16 Mar 2018 00:38:05 -0700 (PDT) X-Google-Smtp-Source: AG47ELugJZ2/jvgrp1CRYORZIRdkTOa7rX1buloMGoHEtdqQeI8Ex8E7icKxE55boctX9oJ0JUYb X-Received: by 10.101.86.138 with SMTP id v10mr677085pgs.353.1521185885275; Fri, 16 Mar 2018 00:38:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521185885; cv=none; d=google.com; s=arc-20160816; b=pFiz72YqqDyTYVcsTGhJBMWVu71kv2qW+0FTdnMfv2WqM2wI273uAVV5qRm3Ahv8+E fyzkdSvstSFPSidxMHqBZOZ9TqpeMILIaDsHFV3V9CqEQJh5jXkEP6peER8spPOsPcFV 5cEhIIIH1imi+GLWZxZlt+5/A2heVD+cUnLlBl45CkTYkEoDz3LYfD6co9eQCLp12r40 a+r1W5grPLRZxJS/ohzIVQkJhXpkbAYDQ947/zUVzioWiebtS2FfbFIj9w1w8bTe6rGF o9yMWRNiBHtekTxMbQ6gAXdWx+iF/a6GUSwUCUBWxRtOznjBJ10cEcSz/2yOOCo2Zpx6 1GNw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:dkim-filter :arc-authentication-results; bh=hhhDa6mfh8jXfnRUfhSOjXjk5xwYiE0cRBQ5+bl0C38=; b=e8jLNL/h6dSJ2qw6nIa+7O69l4y90rENSP6AGtb3nhGlxwcVaIuNscEjzu49KMO0up IU+roKgscoj6KsOE4Locc7TRg/iG1E+QhylGFn5STW5jHQ9xrIvxXxXScJ7f/SNezYSk jpM2ty9HH2TAuR8lyZEp2MI1rRR/BYazlebWoM7sgkb5kdBAs4+1aDVdogWLgjbPYTId NexC7Zpm5o3ZaGD0XLUGtH0nYdT24M/oAqpTQuwN1gEnuXWO2RKxraFUKJeUdAwxnRNH b+RO+UkWhLu+LVCZzSn66wmuTnOLjEA/tc9gOol5XbnYoPUtl1svzbS/wHw+AQ98TYsZ CHwQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=GLdp3mTN; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h70si572305pgc.656.2018.03.16.00.38.05; Fri, 16 Mar 2018 00:38:05 -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=@nifty.com header.s=dec2015msa header.b=GLdp3mTN; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753363AbeCPHhu (ORCPT + 28 others); Fri, 16 Mar 2018 03:37:50 -0400 Received: from conuserg-08.nifty.com ([210.131.2.75]:20645 "EHLO conuserg-08.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753119AbeCPHhn (ORCPT ); Fri, 16 Mar 2018 03:37:43 -0400 Received: from pug.e01.socionext.com (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-08.nifty.com with ESMTP id w2G7bOa5029139; Fri, 16 Mar 2018 16:37:26 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-08.nifty.com w2G7bOa5029139 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1521185847; bh=hhhDa6mfh8jXfnRUfhSOjXjk5xwYiE0cRBQ5+bl0C38=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=GLdp3mTNLbYCirJhnE2uFiz/RUWVNnlgkgTJwl+qbEjWyqOaKs17JV05Dx5pnG7zv uBj+eoNgBtyBxwdrS5wgUznGnUd8BQ8cv5Oo7NLQTfsPnVqxZlawksnpo51A9W/67n rN0/ivo4YZDR6idkjuSnRIKvEPe3BaNnCZloMsyoX5MXGbgiT/IIhX4zpfML0gJgnM qGtvcHsj0eMmds/3+rP1+IpSyXNAeYsNyOkXTyXarcxmIBew2/LZt36W8ybgdpEXWg sFosmanVwrTsSQpf1hfd/CayeScMzFzPSdoE3nE/oihCT89E+hnxzn8xNCngTLaBNL JlUe/N02tZnOw== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: Michal Marek , Nicolas Pitre , linux-kernel@vger.kernel.org, Masahiro Yamada Subject: [PATCH v4 2/7] kbuild: remove wrong 'touch' in adjust_autoksyms.sh Date: Fri, 16 Mar 2018 16:37:10 +0900 Message-Id: <1521185836-19120-3-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1521185836-19120-1-git-send-email-yamada.masahiro@socionext.com> References: <1521185836-19120-1-git-send-email-yamada.masahiro@socionext.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The comment mentions it creates autoksyms.h in case it is missing, but the actual code touches it when it does exists. The build system creates it anyway because and need it. The code would not have worked as intended, and people have not noticed it. This is a proof that we can simply remove it. Signed-off-by: Masahiro Yamada Acked-by: Nicolas Pitre --- Changes in v4: None Changes in v3: None Changes in v2: - Remove the code instead of fixing it scripts/adjust_autoksyms.sh | 3 --- 1 file changed, 3 deletions(-) -- 2.7.4 diff --git a/scripts/adjust_autoksyms.sh b/scripts/adjust_autoksyms.sh index a162258..e0dd0d5 100755 --- a/scripts/adjust_autoksyms.sh +++ b/scripts/adjust_autoksyms.sh @@ -48,9 +48,6 @@ case "${KCONFIG_CONFIG}" in . "./${KCONFIG_CONFIG}" esac -# In case it doesn't exist yet... -if [ -e "$cur_ksyms_file" ]; then touch "$cur_ksyms_file"; fi - # Generate a new ksym list file with symbols needed by the current # set of modules. cat > "$new_ksyms_file" << EOT From patchwork Fri Mar 16 07:37:11 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 131906 Delivered-To: patch@linaro.org Received: by 10.46.84.17 with SMTP id i17csp410564ljb; Fri, 16 Mar 2018 00:37:56 -0700 (PDT) X-Google-Smtp-Source: AG47ELtF83b4fYrj02VHrzwH51aOOp8PTz0wQzFOfFQ6XUe7q0EaIFz+FB5Xenx2CDQWeIcPQGRN X-Received: by 2002:a17:902:aa03:: with SMTP id be3-v6mr971524plb.211.1521185876126; Fri, 16 Mar 2018 00:37:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521185876; cv=none; d=google.com; s=arc-20160816; b=dn3d/5VuT8ijrxESfWNFM75+OfaGYc1FujsFCqjREGWnvFImsN399EmuGqzcBlCU1u qUS/UTFgpdORQdHWtWslSubTkj/upEznsq8xiccbtkCKaQS61XcOLyUmI8HwiG/wl2LY vwgX399YlOYXYlJIhC9ocq+1Lfjxj6Nhu7Brk9Y/0wBpXykOlXaIz71ZQ9uicm5JRzKs JbATIaEH3K9Znktk8k+PUv2bUaoBSS1yN0qrgdhdRVOW1UyTbkamG6nxfxllFEptQ0Tp q68oGPc9PaONUJwVbrz6D2EIj3k3AzySojU3umn6wsT3xJIo4uCLLLk1Uw65VvRJ1Hkh pR9g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:dkim-filter :arc-authentication-results; bh=YrSPtY8mHzbec8+vJ1TvknBrmBtwBgIFIAbLoJj/kJ4=; b=YDC3RN09N91H4b/FTsZT3gOZX1nEQCuKOqfAThb9Zoedf2owYv97nxQ2dIn1tOL0w5 qRz3Zi7O6vvUgnT9ptmMOwFe2sc+YtD+UC7b9UpTlfAmpNncpfunCaV62gkwiCCXWKQO Gz1Yi0RL4PTJ2CBzaHqAp655RI7x4rFXcceUwHmu8DhLZamoBNIepNB/X86yCc843vR+ 7JbqOIWClMw/jJ/SJotn1z2JRHayI5wQLooW7L/STkxPAbx/4Z4U/Rsgo2AxX+Rv3abm ulW8qrWRITdJLZgqGyqmGe4aXyoIJ1/qhiRMdGzz6A3jiQpcTnwZLHeaLLcMAWpsXDRY pdbA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=abCDIVkq; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h70si572305pgc.656.2018.03.16.00.37.55; Fri, 16 Mar 2018 00:37:56 -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=@nifty.com header.s=dec2015msa header.b=abCDIVkq; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753389AbeCPHhv (ORCPT + 28 others); Fri, 16 Mar 2018 03:37:51 -0400 Received: from conuserg-08.nifty.com ([210.131.2.75]:20642 "EHLO conuserg-08.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753127AbeCPHhn (ORCPT ); Fri, 16 Mar 2018 03:37:43 -0400 Received: from pug.e01.socionext.com (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-08.nifty.com with ESMTP id w2G7bOa6029139; Fri, 16 Mar 2018 16:37:27 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-08.nifty.com w2G7bOa6029139 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1521185848; bh=YrSPtY8mHzbec8+vJ1TvknBrmBtwBgIFIAbLoJj/kJ4=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=abCDIVkqLGkI7oe+/Gp004IiOKWFxUjAZ5YzQlgiywpAxluiwknwoYsVFVXPjgs3P zvCCrMAyvkZ9Ya9+msmIcCooQ6oMq7GzdiEfudNObJ2Tc7tgu7vdWzowRvdCzjJKDA YrUmNHZ52yVM0qxwOb2g7rGb98dc9fQa0Er4gpyyvpg4aCiZyNuViDLFj6TzJuQ1ct 4LRqhutcHIm/tBPCsMQx5CWff4PaJdDpjTUixKleDbyjpfwp6o7vrQuDumJDW2cQ/j Oa1zXgiilYzxFOzpi0jBWHuhjk6nd/sRY7LCoYkvN6V7YY4H0mG2mBve98iwu5PIz1 r5ZgerDq6RIdw== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: Michal Marek , Nicolas Pitre , linux-kernel@vger.kernel.org, Masahiro Yamada Subject: [PATCH v4 3/7] kbuild: move 'scripts' target below Date: Fri, 16 Mar 2018 16:37:11 +0900 Message-Id: <1521185836-19120-4-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1521185836-19120-1-git-send-email-yamada.masahiro@socionext.com> References: <1521185836-19120-1-git-send-email-yamada.masahiro@socionext.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Just a trivial change to prepare for the next commit. This target is still invisible from external module building. Signed-off-by: Masahiro Yamada --- Changes in v4: - Remove a garbage code to fix build error Changes in v3: None Changes in v2: None Makefile | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) -- 2.7.4 diff --git a/Makefile b/Makefile index ac8755d..9bf6697 100644 --- a/Makefile +++ b/Makefile @@ -567,14 +567,6 @@ endif export KBUILD_MODULES KBUILD_BUILTIN ifeq ($(KBUILD_EXTMOD),) -# Additional helpers built in scripts/ -# Carefully list dependencies so we do not try to build scripts twice -# in parallel -PHONY += scripts -scripts: scripts_basic include/config/auto.conf include/config/tristate.conf \ - asm-generic gcc-plugins - $(Q)$(MAKE) $(build)=$(@) - # Objects we will link into vmlinux / subdirs we need to visit init-y := init/ drivers-y := drivers/ sound/ firmware/ @@ -1070,6 +1062,13 @@ endef include/config/kernel.release: include/config/auto.conf FORCE $(call filechk,kernel.release) +# Additional helpers built in scripts/ +# Carefully list dependencies so we do not try to build scripts twice +# in parallel +PHONY += scripts +scripts: scripts_basic include/config/auto.conf include/config/tristate.conf \ + asm-generic gcc-plugins + $(Q)$(MAKE) $(build)=$(@) # Things we need to do before we recursively start building the kernel # or the modules are listed in "prepare". From patchwork Fri Mar 16 07:37:12 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 131912 Delivered-To: patch@linaro.org Received: by 10.46.84.17 with SMTP id i17csp411495ljb; Fri, 16 Mar 2018 00:39:06 -0700 (PDT) X-Google-Smtp-Source: AG47ELv1hm0QKxHM8rTp71JY6xzzNOEdoWgm3tH2KVy9yPfILrp90ZoE07vOyyWcYn+YLkGC9v6Z X-Received: by 10.98.21.200 with SMTP id 191mr752273pfv.166.1521185946657; Fri, 16 Mar 2018 00:39:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521185946; cv=none; d=google.com; s=arc-20160816; b=nG9pf7LgGmY34zdZdFo+7uMJVSh1+1y+WUr8FUbY3/3VaQs8/P4FeTdXYVZN0PxKny 3Kh2Ff4kD78FGY5jttHQgGUkh0O/AiSrtbpFDod4eVxPcKypdYRJ4686/WftgPiQ7CEZ uQRCiSyw2vEn41+0vk5uX1+OK2PJGXxnpjRSzJqYwMMn0tIqRpaQyU35ibCtlnZ5uRBh abs1438gypGQwhkkOHBfLOnDdQCQJKpxWGUHxf45oj2fWPQbCBR+kiWrdfupev+wYH2Y YvQXq2AL+EKQYa0MpKVGx5zkPQw6NtDAORaO+3G51jiL/MyMkV0Vpxl8aA12lRwxBgDc OwdA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:dkim-filter :arc-authentication-results; bh=MuisgIpmlDMDI+IC/CFiiC+PiXrOXm9lnHNf6pfMiSo=; b=BN2i2/0jSb8DFCrztwCdnK1m7lSN1+oiQFTPs/ssVCfbyZU+fnUgYRt5k5HduVkx+k qLGbLI8tD2VxfsRXqs6ADiMb8E1UJdJkRTdTQCCVDObbOgUDuRif7scOK8ncMWpq3RNh Qriarr0tQID0Tle+Ue4WVFBK3x6UQ7vIhY8A0MXbqmxS1JDVrMeSWz0wgKTSlVMxijwf iyS4mYaivQySqLG1/IVoir7Ym6riTReinlihV+tlB3ZkB8KJQd5fTn1fPTA9/glu1FOO u+XO+/NybPAbpNAGVOZeaeHgikvv0I40FhWs0kofzGg35Z+LtkiFkiRROvxHTanezisQ RX0g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=tZfqWVih; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m63-v6si5780016pld.602.2018.03.16.00.39.06; Fri, 16 Mar 2018 00:39:06 -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=@nifty.com header.s=dec2015msa header.b=tZfqWVih; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753299AbeCPHhr (ORCPT + 28 others); Fri, 16 Mar 2018 03:37:47 -0400 Received: from conuserg-08.nifty.com ([210.131.2.75]:20641 "EHLO conuserg-08.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751624AbeCPHhn (ORCPT ); Fri, 16 Mar 2018 03:37:43 -0400 Received: from pug.e01.socionext.com (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-08.nifty.com with ESMTP id w2G7bOa7029139; Fri, 16 Mar 2018 16:37:28 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-08.nifty.com w2G7bOa7029139 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1521185849; bh=MuisgIpmlDMDI+IC/CFiiC+PiXrOXm9lnHNf6pfMiSo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=tZfqWVihiFJl0lTZPSoyRA2NOVmIe/zkCczLs/IAlKmZUWu6Vde72FoOhEJDyN2Al PGUx2nPwamlG28ciCCMJlmMLEHcCnW9PUwxImZxyOqBLA1qk9G6kwKCrO1i1vosPUO +T4vIq5qHz69hgocCDrs1uPQ0s9my7b0sM5FXWGMqS2CkunQIX6d5JxA3MkU7AXJWl CKw2nyNc47KT4rRhXpl/AjPOjthoIK7YTZtJCfA2YQvJSX48CBeHEAVqceLQLRc+mV M//8Q/tJwHqIn5kzHGTeJgqGjw3iLk+RQTidx5afc82zD5WxXrhdfBtmNcuirf0eda F4Itl2QWIuz+A== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: Michal Marek , Nicolas Pitre , linux-kernel@vger.kernel.org, Masahiro Yamada Subject: [PATCH v4 4/7] kbuild: restore touching autoksyms.h to the top Makefile Date: Fri, 16 Mar 2018 16:37:12 +0900 Message-Id: <1521185836-19120-5-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1521185836-19120-1-git-send-email-yamada.masahiro@socionext.com> References: <1521185836-19120-1-git-send-email-yamada.masahiro@socionext.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 'scripts' 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 needs if CONFIG_TRIM_UNUSED_KSYMS. It was the reason of the race. I am not happy to have unrelated code in the Kconfig Makefile, so getting it back to the top Makefile. I removed 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 Acked-by: Nicolas Pitre --- Changes in v4: None Changes in v3: None Changes in v2: None Makefile | 12 +++++++----- scripts/kconfig/Makefile | 2 -- 2 files changed, 7 insertions(+), 7 deletions(-) -- 2.7.4 diff --git a/Makefile b/Makefile index 9bf6697..0a3895c 100644 --- a/Makefile +++ b/Makefile @@ -1021,9 +1021,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) @@ -1067,7 +1069,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 + asm-generic gcc-plugins $(autoksyms_h) $(Q)$(MAKE) $(build)=$(@) # Things we need to do before we recursively start building the kernel @@ -1097,7 +1099,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 78c96aa..f9bdd02 100644 --- a/scripts/kconfig/Makefile +++ b/scripts/kconfig/Makefile @@ -38,8 +38,6 @@ nconfig: $(obj)/nconf # for external use. syncconfig: $(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)/conf From patchwork Fri Mar 16 07:37:13 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 131909 Delivered-To: patch@linaro.org Received: by 10.46.84.17 with SMTP id i17csp410927ljb; Fri, 16 Mar 2018 00:38:24 -0700 (PDT) X-Google-Smtp-Source: AG47ELseNB6Q4/oxADmAl6SHyS7/L7eMb+4IpaCi82tKBc9EmfMJB0zdHdBqHNtDrR4TApDV6/6I X-Received: by 2002:a17:902:9883:: with SMTP id s3-v6mr1008516plp.96.1521185904321; Fri, 16 Mar 2018 00:38:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521185904; cv=none; d=google.com; s=arc-20160816; b=DXresgh2ljVAB7kW5SwJvlqJJp59+/eGyh1dNWMJqLS5PSyGiU5aJiCY9gKbR2g83Y rQtdBgavTK19QNKAa73dsfP0KmEpsfJd0jiIYfWDCfP6pg42z7urQI21iy7P+QibkgX8 w9Uhs/aJ8kazVTLdhy3IkzYeAxlcpkRX/NdG8L7Opjh1UbzZJDvN7kwuej4f9sHAWLyU nYySY9lYzkjZt0O/7PvqlAePbIPK39s2T5SFsK0YJxmw5z8tDlkThsac5oBGCtBepF/n QEeeM8ovI2MXrTZMjoUhNOIXqJdK8Hm0B+nSDyw5bRKwcs5Gz0sF1M0zXZDQaHTYmXlj OxHQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:dkim-filter :arc-authentication-results; bh=LTTmDVWw9/LAG4oNtj9HKP8SIxORv/BrT22sC5t44AI=; b=KXN+cJN4/xKLg/yIDpv6hwmRtUj4nfB2VeWWbgCGzW6CR8IFb9ah8mNJ+LDEX3xGiX vZWEIi/B8dXTe5HaHCSlimGayj97wtPHeHzJ301LAe/w088Bj3Qe+uXSuHOyImKzkVAu IlfldfJyCZHfIoXhyda8lmLD+xSZGApWHureALcztMu/t/DfLZC43som47C8Fkn2E7R5 1i/fFf7nkn9PCwiQG/5D0rx4I1LY9xnTy1+Tx4FCYKRCohgvaRPYP+Bn2U5kdtggeNsm ZchkVPA6axMc/Sk7BpDgbp/EVWdHAzgmT4LztGeNymC06sLlO56hRlxJw3zlz/wHtdk+ uzIg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=w68Fdzqh; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n27si5163422pfg.102.2018.03.16.00.38.24; Fri, 16 Mar 2018 00:38:24 -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=@nifty.com header.s=dec2015msa header.b=w68Fdzqh; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753423AbeCPHiU (ORCPT + 28 others); Fri, 16 Mar 2018 03:38:20 -0400 Received: from conuserg-08.nifty.com ([210.131.2.75]:20830 "EHLO conuserg-08.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753209AbeCPHhs (ORCPT ); Fri, 16 Mar 2018 03:37:48 -0400 Received: from pug.e01.socionext.com (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-08.nifty.com with ESMTP id w2G7bOa8029139; Fri, 16 Mar 2018 16:37:29 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-08.nifty.com w2G7bOa8029139 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1521185850; bh=LTTmDVWw9/LAG4oNtj9HKP8SIxORv/BrT22sC5t44AI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=w68FdzqhF2AUX3l9P6Pp4Znh2DvQu4jpzfu7SuX4LTButiHlJw83fyr5DkcF5xcsC ZWrsvur0ZVmwQrhZINrL+P0ZtLUVo2rXUFU31GrjBUDWg30Slxgy5gQCQT5lRHnAHf XeEDsdoOO5M+L1r5SxPVv4L6r9ShRrKlFqYb/r+h9jQkq+QwmcWPf3qXvJ27OTRrBF qWKHyHXvox2qROokPPdptfQc15t9zhYEQXhCpwo28oVDxZz1BG+tErp8+akA1wkPGV X6aJPxbNCnHyvGSpZDk5NDEEYnQRjpzFPMLFmr7mjfvciyzQysw1apjvAum+VIt+n+ JxZAMv9Bmirzw== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: Michal Marek , Nicolas Pitre , linux-kernel@vger.kernel.org, Masahiro Yamada Subject: [PATCH v4 5/7] kbuild: move CONFIG_TRIM_UNUSED_KSYMS code unneeded for external module Date: Fri, 16 Mar 2018 16:37:13 +0900 Message-Id: <1521185836-19120-6-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1521185836-19120-1-git-send-email-yamada.masahiro@socionext.com> References: <1521185836-19120-1-git-send-email-yamada.masahiro@socionext.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The external module building does not need to parse this code because KBUILD_MODULES is always set anyway. Move this code inside the "ifeq ($(KBUILD_EXTMOD),) ... endif" block. Signed-off-by: Masahiro Yamada Acked-by: Nicolas Pitre --- Changes in v4: None Changes in v3: None Changes in v2: None Makefile | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) -- 2.7.4 diff --git a/Makefile b/Makefile index 0a3895c..ef42adb 100644 --- a/Makefile +++ b/Makefile @@ -614,13 +614,6 @@ else include/config/auto.conf: ; endif # $(dot-config) -# For the kernel to actually contain only the needed exported symbols, -# we have to build modules as well to determine what those symbols are. -# (this can be evaluated only once include/config/auto.conf has been included) -ifdef CONFIG_TRIM_UNUSED_KSYMS - KBUILD_MODULES := 1 -endif - # The all: target is the default when no target is given on the # command line. # This allow a user to issue only 'make' to build a kernel including modules @@ -1021,6 +1014,13 @@ ifdef CONFIG_TRIM_UNUSED_KSYMS "$(MAKE) -f $(srctree)/Makefile vmlinux" endif +# For the kernel to actually contain only the needed exported symbols, +# we have to build modules as well to determine what those symbols are. +# (this can be evaluated only once include/config/auto.conf has been included) +ifdef CONFIG_TRIM_UNUSED_KSYMS + KBUILD_MODULES := 1 +endif + autoksyms_h := $(if $(CONFIG_TRIM_UNUSED_KSYMS), include/generated/autoksyms.h) $(autoksyms_h): From patchwork Fri Mar 16 07:37:14 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 131911 Delivered-To: patch@linaro.org Received: by 10.46.84.17 with SMTP id i17csp411243ljb; Fri, 16 Mar 2018 00:38:47 -0700 (PDT) X-Google-Smtp-Source: AG47ELvv5G2NELZ0ubeJkjed4ab2+FpFrTjL8u/d2pP+0pHHZ1MR+9WDleVkZWbYUPsB4VefrHUB X-Received: by 2002:a17:902:8a94:: with SMTP id p20-v6mr1043183plo.74.1521185927390; Fri, 16 Mar 2018 00:38:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521185927; cv=none; d=google.com; s=arc-20160816; b=fO0G+8HMv4niw6EYl+MQ6WH5gDuLVUoHwf48n/72nYb2pS7GpnCFpL7Ct08BHGYDDY WS6xY7V3M4cMNhCxkNcSbLZZsQkFjOMiXcfmL8LEx3O64pqkIDn/arU4rdWCq2JcdNNa Wyos5ewlGcWe+WlQJSCo1mKv5pv8bQScWMdisooprpypTSe77ImXrnRb9p3EIkNkBlQE exMH5F0Dfc1BYzPGOedJMRr+x8WMlPrgHnNGPserFj+4n9Ao30SdEt+RQA7oX54/eF1Y XKR33UDrJEWhkB/3uBZAxBnE7YX12dgc+N/yaF6ekbwlJztOyTy48Y7gwGooYyRAlmWj lk9w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:dkim-filter :arc-authentication-results; bh=1kdTdAPniEP8Dj72NHrci14YJHfR4wLG8tKbFCHXd3o=; b=zsZUlAqtST7PnLsrrhnhfLxpnLIF6cMTcLJLZNm651vg41UpwHV0ltv0ZHXyDm6+4p O+w1c1KRXXZapjvWOrSI4rkkf2daxZ5/Q0fQJ++ubL4B0Ktfwzn3KKuwnRbHfO3eldQY IxdNd/8TcQYMA/WNfvhv1YJV6PbJTwd60QnvG0jud3ofmLaJ0Gc5apYV2cbgsNfVNMTf 086V30ulC/lCobKVmboC7H11wwbsa9o832jWUpd6BR9ZNgE5eEACkOjjAWm+9IIolil3 //OMVAj6w+xuWSdZYa1jKUTC0gbVZgkjeTYvGxNKpPRdWwvvUOMB4kM1FpWKHn19qD/R xxLg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=WzDh8IYN; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e71si5119621pfc.276.2018.03.16.00.38.47; Fri, 16 Mar 2018 00:38:47 -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=@nifty.com header.s=dec2015msa header.b=WzDh8IYN; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753438AbeCPHio (ORCPT + 28 others); Fri, 16 Mar 2018 03:38:44 -0400 Received: from conuserg-08.nifty.com ([210.131.2.75]:20832 "EHLO conuserg-08.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751624AbeCPHhs (ORCPT ); Fri, 16 Mar 2018 03:37:48 -0400 Received: from pug.e01.socionext.com (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-08.nifty.com with ESMTP id w2G7bOa9029139; Fri, 16 Mar 2018 16:37:30 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-08.nifty.com w2G7bOa9029139 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1521185850; bh=1kdTdAPniEP8Dj72NHrci14YJHfR4wLG8tKbFCHXd3o=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=WzDh8IYN7QQJ5vxIWDk7JHnXzIoLvKH9rxTTXj6JUpWieCQgH6rlXyBEEPQrWHugc c48nyRLASrGYzLsRMu/Vea6R8LvIjxzjxdCr5HbGGeLsdJKgIBMg6Oge5I5EaXontV hOqRO8yfsmzaOMSiLuPqPxL3pRaec5Z5tSVG98Fjj8SV41jpkOZr1svS26AMY5y791 O31xwLG6hyqJelgIoykEySTDa5sbiZlcrVM0TtyQjKp6S8ApXovfeizu0gdJfVxOmR 8lHyeas0pQieMtBDy+fY0Ckmdgxvt0jo5zfmpFTuR7jG7vrmY1GVF+LMVqQhddenOQ /A8/O33Yt9W+w== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: Michal Marek , Nicolas Pitre , linux-kernel@vger.kernel.org, Masahiro Yamada Subject: [PATCH v4 6/7] kbuild: move include/config/ksym/* to include/ksym/* Date: Fri, 16 Mar 2018 16:37:14 +0900 Message-Id: <1521185836-19120-7-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1521185836-19120-1-git-send-email-yamada.masahiro@socionext.com> References: <1521185836-19120-1-git-send-email-yamada.masahiro@socionext.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The idea of using fixdep was inspired by Kconfig, but autoksyms belongs to a different group. So, I want to move those touched files under include/config/ksym/ to include/ksym/. The directory include/ksym/ can be removed by 'make clean' because it is meaningless for the external module building. Signed-off-by: Masahiro Yamada Acked-by: Nicolas Pitre --- Changes in v4: None Changes in v3: None Changes in v2: - Rebase on linux-next (resolve a conflict to https://patchwork.kernel.org/patch/10204653/) .gitignore | 1 + Makefile | 2 +- scripts/Kbuild.include | 2 +- scripts/adjust_autoksyms.sh | 2 +- scripts/basic/fixdep.c | 8 ++++---- 5 files changed, 8 insertions(+), 7 deletions(-) -- 2.7.4 diff --git a/.gitignore b/.gitignore index 1be78fd..85bcc26 100644 --- a/.gitignore +++ b/.gitignore @@ -87,6 +87,7 @@ modules.builtin # include/config include/generated +include/ksym arch/*/include/generated # stgit generated dirs diff --git a/Makefile b/Makefile index ef42adb..5fee703 100644 --- a/Makefile +++ b/Makefile @@ -1338,7 +1338,7 @@ endif # CONFIG_MODULES # make distclean Remove editor backup files, patch leftover files and the like # Directories & files removed with 'make clean' -CLEAN_DIRS += $(MODVERDIR) +CLEAN_DIRS += $(MODVERDIR) include/ksym # Directories & files removed with 'make mrproper' MRPROPER_DIRS += include/config usr/include include/generated \ diff --git a/scripts/Kbuild.include b/scripts/Kbuild.include index f9c2f07..cce31ee 100644 --- a/scripts/Kbuild.include +++ b/scripts/Kbuild.include @@ -366,7 +366,7 @@ ksym_dep_filter = \ $(CPP) $(call flags_nodeps,a_flags) -D__KSYM_DEPS__ $< ;; \ boot*|build*|cpp_its_S|*cpp_lds_S|dtc|host*|vdso*) : ;; \ *) echo "Don't know how to preprocess $(1)" >&2; false ;; \ - esac | tr ";" "\n" | sed -n 's/^.*=== __KSYM_\(.*\) ===.*$$/KSYM_\1/p' + esac | tr ";" "\n" | sed -n 's/^.*=== __KSYM_\(.*\) ===.*$$/_\1/p' cmd_and_fixdep = \ $(echo-cmd) $(cmd_$(1)); \ diff --git a/scripts/adjust_autoksyms.sh b/scripts/adjust_autoksyms.sh index e0dd0d5..f11cae6 100755 --- a/scripts/adjust_autoksyms.sh +++ b/scripts/adjust_autoksyms.sh @@ -80,7 +80,7 @@ sort "$cur_ksyms_file" "$new_ksyms_file" | uniq -u | sed -n 's/^#define __KSYM_\(.*\) 1/\1/p' | tr "A-Z_" "a-z/" | while read sympath; do if [ -z "$sympath" ]; then continue; fi - depfile="include/config/ksym/${sympath}.h" + depfile="include/ksym/${sympath}.h" mkdir -p "$(dirname "$depfile")" touch "$depfile" echo $((count += 1)) diff --git a/scripts/basic/fixdep.c b/scripts/basic/fixdep.c index 449b68c..f387538 100644 --- a/scripts/basic/fixdep.c +++ b/scripts/basic/fixdep.c @@ -113,11 +113,11 @@ static void usage(void) /* * Print out a dependency path from a symbol name */ -static void print_config(const char *m, int slen) +static void print_dep(const char *m, int slen, const char *dir) { int c, i; - printf(" $(wildcard include/config/"); + printf(" $(wildcard %s/", dir); for (i = 0; i < slen; i++) { c = m[i]; if (c == '_') @@ -140,7 +140,7 @@ static void do_extra_deps(void) fprintf(stderr, "fixdep: bad data on stdin\n"); exit(1); } - print_config(buf, len - 1); + print_dep(buf, len - 1, "include/ksym"); } } @@ -208,7 +208,7 @@ static void use_config(const char *m, int slen) return; define_config(m, slen, hash); - print_config(m, slen); + print_dep(m, slen, "include/config"); } /* test if s ends in sub */ From patchwork Fri Mar 16 07:37:15 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 131910 Delivered-To: patch@linaro.org Received: by 10.46.84.17 with SMTP id i17csp411076ljb; Fri, 16 Mar 2018 00:38:34 -0700 (PDT) X-Google-Smtp-Source: AG47ELtl/dJr4Sko7AbnI8VXPqc0hgrMdwZYwp+C9F8nJAd6oyUsHCVuA58M7kytxI8iLoFCe6Q7 X-Received: by 10.99.0.2 with SMTP id 2mr728760pga.106.1521185914665; Fri, 16 Mar 2018 00:38:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521185914; cv=none; d=google.com; s=arc-20160816; b=diAuM7jtqZ9xnCWBJrmLVwjKWN48HIuuCMfO6GTNJi4XIe4TKQRk87+J7jzurl/Clc sq3k87JTlxRHIKbNXwpPuiBttMXd4g2TPDuuKoJGWVD8I9uiguVQW7XNfujNWQ7lwfDY LeReO1J45aqFnr1DXaWwLuJh3jRt3IVZYcBfKf0DUwJjriaiz1m8Mf4Sl1yBidTX5VYT WZKIVbK+FIWEsiFi6fRAFB+LojrSGFupswKvpVAvdWJtlEmcUvqFCxEgr0pZFw7bXBq9 OK42BTP/IFyR3imL+fdLxDhAXH1XRKzS646t/2jheLRx5zqCcYWKPSLDklYhY7Syzhvl Ymgw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:dkim-filter :arc-authentication-results; bh=6rDL/XwfRynASy0/rXFA1CXXpq42YfBbSco4GMviIok=; b=jh/SGJLvaKkLNQj5SeK9OH8JR47zS5ymBzXieG3xiDJM9xOF75hXU2mcEvj5wGjpe7 i6umxXnEA5OU1ktDCYNKiKfdU2tG0h3SqNnBZ+24BVCXnJCjIa7K3VUl4U0OpuwYrQdS GZ72Ia5sil/RQCa33p6+1NpE6A15RIGiRGCpZBEPuDR7BVvILYJ9E9JIE1051fjYgJfP 8qUpC1MyQBIkJDgZUCfmRcXkhBo0fobI/hNnVcw0Nj5eAWZ6slrmrKtewimG4YEbflDM ThsUUmtBNQXeFkJ8rnKylS0cdAUoaU+/RpcPyXZCYog2qt3w2W0vkK4nwzJwP4wsvwwX XMgA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=h06Er6be; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s18si4647364pgd.65.2018.03.16.00.38.34; Fri, 16 Mar 2018 00:38:34 -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=@nifty.com header.s=dec2015msa header.b=h06Er6be; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753404AbeCPHiR (ORCPT + 28 others); Fri, 16 Mar 2018 03:38:17 -0400 Received: from conuserg-08.nifty.com ([210.131.2.75]:20835 "EHLO conuserg-08.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753316AbeCPHhs (ORCPT ); Fri, 16 Mar 2018 03:37:48 -0400 Received: from pug.e01.socionext.com (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-08.nifty.com with ESMTP id w2G7bOaA029139; Fri, 16 Mar 2018 16:37:31 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-08.nifty.com w2G7bOaA029139 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1521185851; bh=6rDL/XwfRynASy0/rXFA1CXXpq42YfBbSco4GMviIok=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=h06Er6bellSrG6nLQsWF/HntijHl8B42uS5PSWsjq9OFUUjW2yng/c8sfZDp7AATH cdbMKVlCS4dM0wPPWmJmdXRRACRBuI8ZEd2GMSpVMedqpNP9su/Dwjot3DE34FKK18 5HjJmFVstBc/JEbgxaUlHctBllz4drN3+rTmFNHaOhKOFh18/pSgAWMvi30IO74ERn nOItalMXax3cUbt0blnXPDs46lhL9+22T7qCfLe6l/Pt2dQ3f9AMzUcecLo990iCQb FoHKN+xINjJL05Fx+LZmf8fIk4zrIxaCpFgb/eHaZjE2Y7iojTuG0vROS+pcCzK1Zi QrCQNio/Bl/8A== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: Michal Marek , Nicolas Pitre , linux-kernel@vger.kernel.org, Masahiro Yamada Subject: [PATCH v4 7/7] kbuild: link vmlinux only once for CONFIG_TRIM_UNUSED_KSYMS Date: Fri, 16 Mar 2018 16:37:15 +0900 Message-Id: <1521185836-19120-8-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1521185836-19120-1-git-send-email-yamada.masahiro@socionext.com> References: <1521185836-19120-1-git-send-email-yamada.masahiro@socionext.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org If CONFIG_TRIM_UNUSED_KSYMS is enabled and the kernel is built from a pristine state, the vmlinux is linked twice. [1] A user runs 'make' [2] First build with empty autoksyms.h [3] adjust_autoksyms.sh updates autoksyms.h and recurses 'make vmlinux' --------(begin sub-make)-------- [4] Second build with new autoksyms.h [5] link-vmlinux.sh is invoked because vmlinux is missing ---------(end sub-make)--------- [6] link-vmlinux.sh is invoked again despite vmlinux is up-to-date. The reason of [6] is probably because Make already decided to update vmlinux at the time of [2] because vmlinux was missing when Make built up the dependency graph. Because if_changed is implemented based on $?, this issue can be narrowed down to how Make handles $?. You can test it with the following simple code: [Test Makefile] A: B @echo newer prerequisite: $? cp B A B: C cp C B touch A [Result] $ rm -f A B $ touch C $ make cp C B touch A newer prerequisite: B cp B A Here, 'A' has been touched in the recipe of 'B'. So, the dependency 'A: B' has already been met before the recipe of 'A' is executed. However, Make does not notice the fact that the recipe of 'B' also updates 'A' as a side-effect. The situation is similar in this case; the vmlinux has actually been updated in the vmlinux_prereq target. Make cannot predict this, so judges the vmlinux is old. link-vmlinux.sh is costly, so it is better to not run it when unneeded. Split CONFIG_TRIM_UNUSED_KSYMS recursion to a dedicated target. The reason of commit 2441e78b1919 ("kbuild: better abstract vmlinux sequential prerequisites") was to cater to CONFIG_BUILD_DOCSRC, but it was later removed by commit 184892925118 ("samples: move blackfin gptimers-example from Documentation"). Signed-off-by: Masahiro Yamada Acked-by: Nicolas Pitre --- Changes in v4: - typo fix link-vmlinus.sh -> link-vmlinux.sh Changes in v3: - autoksyms_recursive should be surrounded by ifdef CONFIG_TRIM_UNUSED_KSYMS Changes in v2: - Discard my wrong change to adjust_autoksyms.sh - Add more commit log to explain how Make is working Makefile | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) -- 2.7.4 diff --git a/Makefile b/Makefile index 5fee703..ff62b8e 100644 --- a/Makefile +++ b/Makefile @@ -998,17 +998,9 @@ export KBUILD_ALLDIRS := $(sort $(filter-out arch/%,$(vmlinux-alldirs)) arch Doc vmlinux-deps := $(KBUILD_LDS) $(KBUILD_VMLINUX_INIT) $(KBUILD_VMLINUX_MAIN) $(KBUILD_VMLINUX_LIBS) -# Include targets which we want to execute sequentially if the rest of the -# kernel build went well. If CONFIG_TRIM_UNUSED_KSYMS is set, this might be -# evaluated more than once. -PHONY += vmlinux_prereq -vmlinux_prereq: $(vmlinux-deps) FORCE -ifdef CONFIG_HEADERS_CHECK - $(Q)$(MAKE) -f $(srctree)/Makefile headers_check -endif -ifdef CONFIG_GDB_SCRIPTS - $(Q)ln -fsn $(abspath $(srctree)/scripts/gdb/vmlinux-gdb.py) -endif +# Recurse until adjust_autoksyms.sh is satisfied +PHONY += autoksyms_recursive +autoksyms_recursive: $(vmlinux-deps) ifdef CONFIG_TRIM_UNUSED_KSYMS $(Q)$(CONFIG_SHELL) $(srctree)/scripts/adjust_autoksyms.sh \ "$(MAKE) -f $(srctree)/Makefile vmlinux" @@ -1034,7 +1026,13 @@ cmd_link-vmlinux = \ $(CONFIG_SHELL) $< $(LD) $(LDFLAGS) $(LDFLAGS_vmlinux) ; \ $(if $(ARCH_POSTLINK), $(MAKE) -f $(ARCH_POSTLINK) $@, true) -vmlinux: scripts/link-vmlinux.sh vmlinux_prereq $(vmlinux-deps) FORCE +vmlinux: scripts/link-vmlinux.sh autoksyms_recursive $(vmlinux-deps) FORCE +ifdef CONFIG_HEADERS_CHECK + $(Q)$(MAKE) -f $(srctree)/Makefile headers_check +endif +ifdef CONFIG_GDB_SCRIPTS + $(Q)ln -fsn $(abspath $(srctree)/scripts/gdb/vmlinux-gdb.py) +endif +$(call if_changed,link-vmlinux) # Build samples along the rest of the kernel