From patchwork Fri Mar 16 02:18:38 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 131893 Delivered-To: patch@linaro.org Received: by 10.46.84.17 with SMTP id i17csp179372ljb; Thu, 15 Mar 2018 19:20:27 -0700 (PDT) X-Google-Smtp-Source: AG47ELt04FUD0h+Fh8JMV/13KMsAGugsco82QC+PaFKH19ECSbEJTTrsT0ffnw6OGkRCfopaA/nq X-Received: by 10.99.107.131 with SMTP id g125mr107978pgc.16.1521166827107; Thu, 15 Mar 2018 19:20:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521166827; cv=none; d=google.com; s=arc-20160816; b=dOzwHd9svu3GlZ4PRC5I9i5oI9r0cumHqcnk2+KBDKYhEuOtIBTCHwpnoZHUutkkF6 xfVDQxB38THzFxN77F9xR9nzbORK+VxxVZ/RHY+JxoDctEhshg4lGi01qgLxATtrRftA JIIW4r9XKUXXePGMnDN0hf87qYfCgY6AnaSNLegTUaR2KR9ojBE3c3PQwECxHa9YEtXi 4jOZu0tWa+hPyI3z+9OKN9JC7PMwleFLK+pedz0NZdhy0hBTS3a5vVfw4r1+ur+DuYws iE/UAgDzJpy+TfMaAwshIvAtTn80FYyQ92tEVoWFDm7+gR+rOjIOuWWlLvFvOSwc6DGO U9eg== 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=xjgzDrirNqKMEvo8Quh+R4Q91ERH9cAx5FqZL73rRak=; b=msRZkrjJxIJoZfdSryoj7bxvbYg/fVyOjp+xKSI32kKf7sCzQgv/jdAZIk6QmZvILx 2JSUOqpIbFQ5VlAiMycNmkVmyExcOLHg43Yq7XKwqXiZoVR6ejbAfVC+zCKg1opeWCbg UEXzLlYbsOgLYrsTrY+hbAZo9pTVGJdEdmf1h2+dKyyCyeSdG7GZKyExUM94/et9xaAr u6CjFmTU/7YIzUtUIHkKJwI+F75bz1oUYyLUlh0sqWmX/jXcPzdfwALtV0Gg5SvfIn2S P/7mPhZXgQLRSWBh5CI0C/cdK+gg3geSuyc94DhJmdLKlwzMrV4Apeg6/fUtj5PdYSOx NuQg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=U4SYqay4; 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 c12-v6si5226852plo.278.2018.03.15.19.20.26; Thu, 15 Mar 2018 19:20:27 -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=U4SYqay4; 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 S1752977AbeCPCT6 (ORCPT + 28 others); Thu, 15 Mar 2018 22:19:58 -0400 Received: from conuserg-11.nifty.com ([210.131.2.78]:44532 "EHLO conuserg-11.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752819AbeCPCTM (ORCPT ); Thu, 15 Mar 2018 22:19:12 -0400 Received: from pug.e01.socionext.com (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-11.nifty.com with ESMTP id w2G2IoBM003525; Fri, 16 Mar 2018 11:18:51 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-11.nifty.com w2G2IoBM003525 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1521166732; bh=xjgzDrirNqKMEvo8Quh+R4Q91ERH9cAx5FqZL73rRak=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=U4SYqay4T7mRgxK2Dl8ZXFCgLdLSLe/SH5wpOHxLoP8SzwyErMCvwTFPjZFJelfWX 8UeVBuoxzN6dm5CkZpYWBliqKG5PGQIIPT/3to0kBwjrGVDN3vF+g7YNkcBXEetr6Y me15/4rvPWn1gtESZi/cXNp4AWoNC76jPpkjkhTnfDZqaXq06FrZTua/npR8Kzm63F ipTvbCXJuVUFh1K+PkHZS3yY7WWmAPRxlLoY49wSkFSMiTybOEpQkjT6bM9ZI9TYSp iXyBEf382Bsr1mBysQrsUPAUeHZgDI15bugTGvByAtBKvSkh+VCTasow5is+oVgQmJ ZI/X/xC67krmA== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: Nicolas Pitre , Masahiro Yamada , Michal Marek , linux-kernel@vger.kernel.org Subject: [PATCH v2 1/7] kbuild: clear LDFLAGS in the top Makefile Date: Fri, 16 Mar 2018 11:18:38 +0900 Message-Id: <1521166725-24157-2-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1521166725-24157-1-git-send-email-yamada.masahiro@socionext.com> References: <1521166725-24157-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 --- Changes in v2: None Makefile | 1 + 1 file changed, 1 insertion(+) -- 2.7.4 Acked-by: Nicolas Pitre 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 02:18:39 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 131890 Delivered-To: patch@linaro.org Received: by 10.46.84.17 with SMTP id i17csp179043ljb; Thu, 15 Mar 2018 19:19:59 -0700 (PDT) X-Google-Smtp-Source: AG47ELuDTJrRA1nt9H7mc7upVJnQQeFTegBQ0hIYrcLlFPMof6iBDTgkVNH7xOejQdYIu0F8wmX2 X-Received: by 2002:a17:902:96a:: with SMTP id 97-v6mr126225plm.183.1521166799299; Thu, 15 Mar 2018 19:19:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521166799; cv=none; d=google.com; s=arc-20160816; b=vw9L5sYgLEbmnz425W8lm1/okeHxYYazl4zkNZW83mTa4VJ0gKZoVkfnu4tHk+I7Y0 K0+v0tVLbVFND2i7yGQITzqGzAoPHqlLsIIYcnbslZ2DT3+iVw77F7s9t4dDmlSd97oY nSvLfQUiKKKIpvLQu0SNMLM4MqmYq16PTLpcp6NurCdW2McZK+eW4xRX/4080unIq3au SLuxp5ymI1/TCrHCkLwXUg+nFY7sEYCKULpSQAsbCi9Z052mjdHbvqLgGu0hZzHDWDKT fFQX1V6zCBmiDeFDhvQTRQL/orxrI9EuixWtwLuX/3A64sWuLgEC+UHGcHkxgN3M+Dbn UjOA== 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=sJgJqRYxOaGQMoN1BJInx/LhYkj88bvy6//8VGGiKBA=; b=BmhF5/eOM2qfzxhgEzabemw50SWHuOoGUYlIHayxjbwN1DNvBySEWJsDSSi/eG3QUP I3+UR9+VRBahBsuiOo7KckKd/lP3jqjyV2TKhg7MPp9QvB8my+NeeRvbIdtfpDVyo5QI pH9Y8CU8LAvNe9/r78fxQ8deL8+cPQU0nL51+bRnzXGUtD6d+sWoR2r4PHR5na1Xtvsy uo9/vWc3TJAFCgeoHBGaCaQsm2NeZYLmnAToQLzh0VpS/wKFs87UXaicjj/IPuE6X4/i fLNPBNb/Gj8ffxPisC1OMXU0ZagHA4gva+/rXotMifi6+z+xkQPwdHjpn8Tp/DsTLmhz ljrg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=JmiJRYMm; 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 j15si4267059pgv.676.2018.03.15.19.19.59; Thu, 15 Mar 2018 19:19:59 -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=JmiJRYMm; 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 S932903AbeCPCT4 (ORCPT + 28 others); Thu, 15 Mar 2018 22:19:56 -0400 Received: from conuserg-11.nifty.com ([210.131.2.78]:44540 "EHLO conuserg-11.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752857AbeCPCTM (ORCPT ); Thu, 15 Mar 2018 22:19:12 -0400 Received: from pug.e01.socionext.com (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-11.nifty.com with ESMTP id w2G2IoBN003525; Fri, 16 Mar 2018 11:18:52 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-11.nifty.com w2G2IoBN003525 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1521166732; bh=sJgJqRYxOaGQMoN1BJInx/LhYkj88bvy6//8VGGiKBA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=JmiJRYMmHeXz3rdQjaqddSN7445qPG5hlbk8Sv8wwt/s66n4/9kcif46tn/3rxZbt VkK27Fte+csyfRu7A8suh96cmBlB5nP33fHIIUdqMWC7HNtPSIS1rDLYXvANoavLUD RVrK+TXMj+k9ehqMN/y87AIcWLSAsK+xFhR8zF8oYTiFUEdYOZnuegUy9gsxhNk59s pSQZ56gghdrNznPnasT1nJSgz6+lNjbP6jI/hG5sKe36oBu0dYfgUfPr8WGyDHIQvr KT5kbSdyurFOxDRhAD7Yr3kcQDLYGLVIFncF5eUUXsB6Y7JkjP+EC3C4DuIDwS+OAC WdF+acqLWdilQ== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: Nicolas Pitre , Masahiro Yamada , linux-kernel@vger.kernel.org Subject: [PATCH v2 2/7] kbuild: remove wrong 'touch' in adjust_autoksyms.sh Date: Fri, 16 Mar 2018 11:18:39 +0900 Message-Id: <1521166725-24157-3-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1521166725-24157-1-git-send-email-yamada.masahiro@socionext.com> References: <1521166725-24157-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 --- Changes in v2: - Remove the code instead of fixing it scripts/adjust_autoksyms.sh | 3 --- 1 file changed, 3 deletions(-) -- 2.7.4 Acked-by: Nicolas Pitre 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 02:18:40 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 131894 Delivered-To: patch@linaro.org Received: by 10.46.84.17 with SMTP id i17csp179633ljb; Thu, 15 Mar 2018 19:20:50 -0700 (PDT) X-Google-Smtp-Source: AG47ELvoKuYSDdKhrWj+wTIqro0xiid59hU9i7RX8ALELUPf4kf+wc6nyp1Hnr7S85x/CATGZ8bt X-Received: by 10.101.98.149 with SMTP id f21mr90302pgv.7.1521166850161; Thu, 15 Mar 2018 19:20:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521166850; cv=none; d=google.com; s=arc-20160816; b=jfTJ3qmY/tDWLeWkGig8+uzqgD5THvup2elr5vGd3jDlryvXP5wtoUMnbcrLr/HDGM 2w+FwQimQl94FTfTMol8xoXzUi1MSDEf61hiY1wZ4YrlSTAYt+o3Ill5xIAWYvRawfJw 9TAqZIchOqmaS7cXNjKGLJI93hDy1tl4PL39jU67/PBoBI08P5BOF5Yr5GcTx500ULGZ ZIpUa7l7F2gw5uInWOB+yBhg2VID3pzCWWBkPhYz2Id6gsqUmLJN4SYzUaVi9HVy/cjy xTJ8YAMXf0CkA2MQ5FtYNvRwFVW7EiWloMqcUbHOS2j8UJwB1VHRyP9O4GeMP9ePCEco Z9Mg== 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=lgH5QhC5on65HjmtZmNbBrMaTENkq1FAb2PekY2PGCQ=; b=Pty1dM9QD/vJTc5laQv2Zj/mimtKde7oSu8wuQCUlj6ewEioIYjPzMgYA3OM7NZnEA e48BFA5pNGz7RWoLx73XAm3CnWwm4GN8Or/Xn758PuY+kP8dysdpb6HzhBRaqYti+HWu GCCeMpdXBXf0c/+I2rXXS1xCsQmv5XnKsc05ntflbuFWgtLKiKFlsD0QCPyEduLVBYdl nS1HW8IAcHND9NGs4HF2nRMJ4dPGS8/XyNU9WF+CGKgZVeyaPlEZinGHd3cnN2oN46K1 Arc26LI2iCyUDK+BTHzyJul6TIiudjJwZHeSWaaShLMvtWTAj5upwGldmTbQ/Qk0uqbI jVzQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=Bl0OyZP/; 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 f5-v6si5166440plr.243.2018.03.15.19.20.49; Thu, 15 Mar 2018 19:20:50 -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=Bl0OyZP/; 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 S932825AbeCPCTy (ORCPT + 28 others); Thu, 15 Mar 2018 22:19:54 -0400 Received: from conuserg-11.nifty.com ([210.131.2.78]:44539 "EHLO conuserg-11.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752884AbeCPCTM (ORCPT ); Thu, 15 Mar 2018 22:19:12 -0400 Received: from pug.e01.socionext.com (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-11.nifty.com with ESMTP id w2G2IoBO003525; Fri, 16 Mar 2018 11:18:53 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-11.nifty.com w2G2IoBO003525 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1521166733; bh=lgH5QhC5on65HjmtZmNbBrMaTENkq1FAb2PekY2PGCQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Bl0OyZP/qUZ4NNO3lG57EVJkG4NOaD7YGcVeK1AOPzUeC108LvRy71Ys6gZuvYUOz w0DhdwJB5FS0g53Ka+y6EZz7oDi+zlnMfUxZFd2LjUzP9/oE6JsLg9Ygi4AbJKq5VE zcwNMrs3JXBohiDYvbCuFs4+69mUaC0lO762CswgnmTpxVgcFrVjTjahgNJ5P7DvJg uof+evv/WvEH+NO0KVMWihZHjKHu7akuwwe+lFFrwwQAac0+U7tDEITx7bHXx7bigb UmNSzZ83tzepCEoc0yayD54R5CgHjmXeXXoak8mOYPR0EBWcNZkR3/o5+6DzpooYgc PoaHyTtSNoMPw== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: Nicolas Pitre , Masahiro Yamada , Michal Marek , linux-kernel@vger.kernel.org Subject: [PATCH v2 3/7] kbuild: move 'scripts' target below Date: Fri, 16 Mar 2018 11:18:40 +0900 Message-Id: <1521166725-24157-4-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1521166725-24157-1-git-send-email-yamada.masahiro@socionext.com> References: <1521166725-24157-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 v2: None Makefile | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) -- 2.7.4 diff --git a/Makefile b/Makefile index ac8755d..f8e9e12 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 autoksyms + $(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 02:18:41 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 131891 Delivered-To: patch@linaro.org Received: by 10.46.84.17 with SMTP id i17csp179131ljb; Thu, 15 Mar 2018 19:20:06 -0700 (PDT) X-Google-Smtp-Source: AG47ELuNq5BsMLdJrxa6oEMAMra+LnGgWEXoYKh/KdZupmkG/dpSSkip+NwBMOhEimPMlVp+MT6+ X-Received: by 2002:a17:902:bc04:: with SMTP id n4-v6mr131902pls.97.1521166806570; Thu, 15 Mar 2018 19:20:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521166806; cv=none; d=google.com; s=arc-20160816; b=MouLkmHmvL3vwWhxvS6JImXfq1M66eHGZsS/XYG7de5MADL8W9HunpTN+o/O/P1qlW y7+i92U7kyNnBjsqrUWeEBGbHvhVsYftHj6TYGLTz6gTKastbuNjRRnQr41Hw3PwAIKz uRx271PjZHtguSeQe1R7ua6xCu8GyuSOE5OtXe8JK1vPCJsZkcnGYAmj21RpMXO507sg +0pWndwuyj/I5F7qss7lBQcsICscUNpJJRzA9RSsXGyAU3UD1qTEoxxJrQqLUO/P1M6E L8c6WqS2Qp/aa2fKVP7UMYmEUu4viOYKZ0jIm6LDcMju8pfHWSDmCHnkY6dcTgv2bkJ4 3Xqg== 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=VUYZS69VGB2nPrN8Foh6xMoy29EhI+wdMka0ZLIUg1Q=; b=VQLm+xFzQKbOckOdAhy/a0cD5XnZhjhD9Hhi0PMXDOHZwp82ovn8wPPt/PeJPx6Z/j pwpD/nD3czROP1oGuhvMZInSAOAvGP2/eorh+OI3lfkhhxJX8JdgOlJmhunwULsyJOHx AOIelXVoCrBGX24aDjOtgkL0Gzs3SlB3dG3BUEUb1jeBG27HOto8/yguaUU+LkyA06nS oA497p0+JsTsAi6uDqHYG5rT8qxhJXE7WnjV4uZQhKcHE6E60ajf4d85bjGFUVYKWB4n JbivCPkmPmuBBx5PkruV4u/ARpaRLmOnuFzkrYZFqTO/Ga69u8p/CFcBjbXjMzh5DBzY Up3A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=0KkM2maG; 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 j15si4267059pgv.676.2018.03.15.19.20.06; Thu, 15 Mar 2018 19:20: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=0KkM2maG; 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 S932938AbeCPCUB (ORCPT + 28 others); Thu, 15 Mar 2018 22:20:01 -0400 Received: from conuserg-11.nifty.com ([210.131.2.78]:44535 "EHLO conuserg-11.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751877AbeCPCTM (ORCPT ); Thu, 15 Mar 2018 22:19:12 -0400 Received: from pug.e01.socionext.com (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-11.nifty.com with ESMTP id w2G2IoBP003525; Fri, 16 Mar 2018 11:18:53 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-11.nifty.com w2G2IoBP003525 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1521166734; bh=VUYZS69VGB2nPrN8Foh6xMoy29EhI+wdMka0ZLIUg1Q=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=0KkM2maGhm7O4PB+dbdo/IPtt5v0Xk04HlRwr8wKxCxl6sT0aqrEjeP3D6Fg94y4F OHK8QihvBtGfNI8bK2hJ/BlkbblJZ/Z5lJsfxY09J5UJB1nbheGqMoTNakWfJNMMdd cLHNjgbEfq/3AN3PQh94dCEHTOhuYbpGBwPdptmOp8vI+zlFLWFZshgmfJRxB4zHhj 0Kk0+/ahW//PokLsHAzId+glItA4VF3KyBfsZOoO3ReGlnCvHVstrHnGl/hdOgb6DO /Di+7Grxm/byAxI4TR/0ZKjqnjE2o/gkm0m4BJv6ycLKcvRPFFltxOfjbXnkvoaaF7 Eyhx/UaJIoeIA== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: Nicolas Pitre , Masahiro Yamada , Michal Marek , linux-kernel@vger.kernel.org Subject: [PATCH v2 4/7] kbuild: restore touching autoksyms.h to the top Makefile Date: Fri, 16 Mar 2018 11:18:41 +0900 Message-Id: <1521166725-24157-5-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1521166725-24157-1-git-send-email-yamada.masahiro@socionext.com> References: <1521166725-24157-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 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 f8e9e12..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 autoksyms + 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 02:18:42 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 131892 Delivered-To: patch@linaro.org Received: by 10.46.84.17 with SMTP id i17csp179272ljb; Thu, 15 Mar 2018 19:20:17 -0700 (PDT) X-Google-Smtp-Source: AG47ELsYx3wYIVr7SVyEYy5Q9LciktVG79id3pQYt2NfL1Y+VNu63QITlDsQOARdcHt1tg2qW0gw X-Received: by 2002:a17:902:467:: with SMTP id 94-v6mr135313ple.57.1521166817695; Thu, 15 Mar 2018 19:20:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521166817; cv=none; d=google.com; s=arc-20160816; b=BBOtUPrk0RZQIZF5Yo2USrrJs7qlp/DhDQAaR3gPxo+V1qU+mM0d05HqubhFbTslm8 /QVkoc+OnZywMMIBctTfPfEruKi1snsaj2ZNDqGJCzDIltjfFc7BLD+tx5PU9a2mLbH8 e4gvHygy9xgf6WCkwmrNCDHrLJ/v1NhWZkZ1NJCAGfP5nAa6QtIWnOD1HPX65Y6gcQPA K9sKM6LSxlqq4c8xVR6nVMNgAe9dic7PjYd5JaThvkA8yfbgWuZ9zaNCq5wd2xqo9EYH fzGkNgNgJUfmIUjtxBK4DNJu9jsDlCGxGf/zaPuKb1/WGouDGw5N72CG77VbXggkNtEw ijgw== 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=FMc5ISQq3Wqcof85BwCOVAnKD4mcS8lkRVtAQZaTko8=; b=uJnb6DnlNdsq+VNSUh8tWf7jSYUwkH8fsZ9Uu3MMbaXqjuYJ6zfGpOJ+hwIqgT23oW 1y97bzVXbjl9+sw9RTBcfVyAYgbHcbVp/f0Z4cQwb0T6UEGbegiKSW0SrDNtMsEzB1OL lNT56Cpca9j+8LH34FiT1cXVAXUDoitRtQqDAueCVfs57yD3qrmQgy4cVi1ypmnPukzA GwaU6/lgsH84CNo3uWTdJ90IBunbU/lkx/ZE4nbzK33Jif94Cnd/STJ+qDhrEvTuUMmJ 9a+FvJK82MYHs9P05zIAl/HeWGxUdRJP4dNfazsZ3mTUKaRicgTe7Jiwst2sy8dTwaTJ 2SPQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=KaLOrag7; 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 c12-v6si5226852plo.278.2018.03.15.19.20.17; Thu, 15 Mar 2018 19:20:17 -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=KaLOrag7; 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 S1753002AbeCPCUA (ORCPT + 28 others); Thu, 15 Mar 2018 22:20:00 -0400 Received: from conuserg-11.nifty.com ([210.131.2.78]:44537 "EHLO conuserg-11.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752816AbeCPCTM (ORCPT ); Thu, 15 Mar 2018 22:19:12 -0400 Received: from pug.e01.socionext.com (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-11.nifty.com with ESMTP id w2G2IoBQ003525; Fri, 16 Mar 2018 11:18:54 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-11.nifty.com w2G2IoBQ003525 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1521166734; bh=FMc5ISQq3Wqcof85BwCOVAnKD4mcS8lkRVtAQZaTko8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=KaLOrag77Rr5asTNF7iSMB7njEu3VDi1I7khGTgoSZ8vGQjop0Qr3LS+7DySQiirH TjCLqnl56RtncRjA7llW0rCAay7YluLqhNkEUGmU76Q4oqxdMvtgnjMj4Ebo16/WFu neMIkPHvt77GhlO/5D9VmpLi1ejT4BxZSdKJWLzR/ZKWzbF817b5dgRxKI0oA0PweI XcLoGhGOYrvVdf9i2i3AL/JRY/Rr4ybas5hAYIkskwx6bfliwSPFXjTjBvN5M2vzZr ZD2+oo3T5nRAwK0JRpSKpghjrMECntsvtXi3DLfA5lGI+wMTVubLfdFY1XBM+P87Ck tBLdGHVnFuSBQ== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: Nicolas Pitre , Masahiro Yamada , Michal Marek , linux-kernel@vger.kernel.org Subject: [PATCH v2 5/7] kbuild: move CONFIG_TRIM_UNUSED_KSYMS code unneeded for external module Date: Fri, 16 Mar 2018 11:18:42 +0900 Message-Id: <1521166725-24157-6-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1521166725-24157-1-git-send-email-yamada.masahiro@socionext.com> References: <1521166725-24157-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 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 02:18:43 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 131888 Delivered-To: patch@linaro.org Received: by 10.46.84.17 with SMTP id i17csp178750ljb; Thu, 15 Mar 2018 19:19:36 -0700 (PDT) X-Google-Smtp-Source: AG47ELuwAnbbfDFZfVXZz73R56pgUr5LwSPfKDEcIy/zqpxVDFLtUTmmGTHcn8zPw8gMG9j3L+W4 X-Received: by 10.101.98.149 with SMTP id f21mr88120pgv.7.1521166776541; Thu, 15 Mar 2018 19:19:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521166776; cv=none; d=google.com; s=arc-20160816; b=i3LyTIdAcoi2SK7pTHMDcwMhlyobqanRgkpoHDx9IvHdjlQZBzDAv9bscO30iQrUA9 AlZyAD9Oc20zXc4i3RS+L6L4P0TqMAYQAezln5i8/yYvmjBNPQwcaraHmZ/Q8u/AbvZ3 nNLWJvPC3Oj4tkopVfS6myxbIx79Eo3+vdQIyWGyn+9Gl+dzE/y+Ju948Nf5WJaJ7VzX 0KLid46LuaZE0+HGMt/hG2cXipkEv22tIvf6E/9Ij5dk8Wv50lxG2HUeKna/RSO+sWEg 13sHi7yWuz9BExEKc/qnJX4u+D/RCAfquzcLm2HJAVTahUTcDf8/K9kMRthRhV7s3hD+ gEyQ== 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=Z3HD3eyodL+oyYh5GGJVBXfJrga7Mnr65BjAVGBPG4o=; b=y/epXn02Kac9E9fyMTzNZvYOct9j5M9YSRlXBznexEuypm+QG5hgD/gBq5Vg2lOtOx lk+09/ROXw3oa6+Z+CNV71zyD9Mc/oMEYsk63cOPvjMm2stWZlHAcv5P/1bokXJvyFpp +NU/vFrrytbFgopSB+pY4c2er8SGAcLA0s9Q2CXSTPF0Sp+QxrxFToACCeVEAP1LtssF GhY6z95mAItoMG0a79yG5y2d3PhUY5Dwd6cXoQRcIT9pB/9cgnnKw2P2JJlePjx8k/mp knEo04sWmbW8iWHEsG/4UFEpLMVGvQPLH7zEkeUTW7KM+KG/5CRkiH8NP3XGCyEmAM/K GkOA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=rqu9RiQ9; 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 f127si4225651pgc.49.2018.03.15.19.19.36; Thu, 15 Mar 2018 19:19:36 -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=rqu9RiQ9; 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 S932755AbeCPCTQ (ORCPT + 28 others); Thu, 15 Mar 2018 22:19:16 -0400 Received: from conuserg-11.nifty.com ([210.131.2.78]:44534 "EHLO conuserg-11.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751466AbeCPCTM (ORCPT ); Thu, 15 Mar 2018 22:19:12 -0400 Received: from pug.e01.socionext.com (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-11.nifty.com with ESMTP id w2G2IoBR003525; Fri, 16 Mar 2018 11:18:54 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-11.nifty.com w2G2IoBR003525 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1521166735; bh=Z3HD3eyodL+oyYh5GGJVBXfJrga7Mnr65BjAVGBPG4o=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=rqu9RiQ9SvQCupy4oPqyb89yuOFJTXijKe55tpUm+G9ZuBvbA2c/uxs6d8BvKhukM mxfvVQllYEQl7jxRcXdl66NoJApnMvwecl9W4tvLnnuEBnTFedD13Z30XAIEKtt3Su C9ZKPgn+VhAPMBajCdVnKeYeaKid/nmFQRmHTmJk7++QSfDYncGed9XC59aH+2bkNl mUCxA+RbVqog8sETds7E5yuVOhOdBp9YTClSMS79GY5J8RJTQMHflFj7Eqwio9SyfF otJHgr50MdvESmKQ6N2OVjz6DYOYYgBBk5/HI9Nb/mII41JoCoJFVJKsPX4ww2Ga2h PC4krMJFEkm4w== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: Nicolas Pitre , Masahiro Yamada , Michal Marek , linux-kernel@vger.kernel.org Subject: [PATCH v2 6/7] kbuild: move include/config/ksym/* to include/ksym/* Date: Fri, 16 Mar 2018 11:18:43 +0900 Message-Id: <1521166725-24157-7-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1521166725-24157-1-git-send-email-yamada.masahiro@socionext.com> References: <1521166725-24157-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 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 --- 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 Acked-by: Nicolas Pitre 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 02:18:44 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 131889 Delivered-To: patch@linaro.org Received: by 10.46.84.17 with SMTP id i17csp178877ljb; Thu, 15 Mar 2018 19:19:47 -0700 (PDT) X-Google-Smtp-Source: AG47ELv/Tzq7bAuGx1/ykF6ZaLYpHaz9l48sLMmpF3Q99Jehi5GyQgwScfgQ9yvLPPSHxbgSMF8d X-Received: by 10.99.124.79 with SMTP id l15mr88011pgn.19.1521166787033; Thu, 15 Mar 2018 19:19:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521166787; cv=none; d=google.com; s=arc-20160816; b=tJCQ8/CBpSxzPVJo7dXFroUs1uuz/6gKzvEri7dUIxry5OsJYWzSLnIIvV1ps62k1I g9rquURQnPH6ebCEslhNQtZ1bqiYcvv5lc2tUhUnETOGkqHNsVizYbkw2CWZmo8Ibk7C XCgh1hrGC6vfjBXkKS4j89ZUfcKtkEHxhHnecS9+TqyVMQhytzVg09LV4tNnXJClth30 uad8WGO9MIzOopVTNDwKAJoO7pxIJJetOUWYiW7VpA8FNwdVPJxdW3U4ZazDzgsLK7S6 f/vyW4P3o4wQsTLhiyAZr0MTHAJ4k8WEwQjqT33uD7CCFD2aG1krRlrBpWE/oO9Suqde 3C6Q== 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=pKL4xNzW3+P38Gp7A3/RpIx3HLB3Ws8GbF2lt3zGUZk=; b=TZBjxQVkgCvKQh1AnOLxVaW3OCZkiW8ByrPtKGC+/6UvGyu+nWTrK+QdSTWLWC9ci1 wl2/5/H62Q+PhGpjXyroRHa9Pce+iHR9UbwD2Lspy+yn9q21m2Zvx6hmeC5fjIRwAxZe lPAe6PfKN/FjB1nKjha1w12wbLkjYaRNGsciYiCz/jFaPL8V+ORkAEaw4q0uTxunpHA1 48tI1VSQgkObXsYOgXXlsX4jb0FTCaHL/UkTchO6wJROtG8OPrdoa8kRqYwyUy87mvmg u6TVQe6XKnlA6u5O9WXtXOOHjOd0dlyLyH10SXx84ZAvyTdzWopbhuC3ajJi1wH8GgrY sOdw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=CXG7F1vJ; 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 x5-v6si5379023plm.443.2018.03.15.19.19.46; Thu, 15 Mar 2018 19:19: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=CXG7F1vJ; 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 S932638AbeCPCTO (ORCPT + 28 others); Thu, 15 Mar 2018 22:19:14 -0400 Received: from conuserg-11.nifty.com ([210.131.2.78]:44533 "EHLO conuserg-11.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751714AbeCPCTM (ORCPT ); Thu, 15 Mar 2018 22:19:12 -0400 Received: from pug.e01.socionext.com (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-11.nifty.com with ESMTP id w2G2IoBS003525; Fri, 16 Mar 2018 11:18:55 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-11.nifty.com w2G2IoBS003525 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1521166735; bh=pKL4xNzW3+P38Gp7A3/RpIx3HLB3Ws8GbF2lt3zGUZk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=CXG7F1vJXILOADe4IACwOnRrmzSiyyvb2JOGIbK5A/ThUqmVipMV9qLBrqs7VOl/s FuMQj0cKf7orV1pkKUtb6L6avCmLkAHJWFJQMgjn73Lx+afZ5fgkQsoO7JFCVB2bbe +8+MoGXXs91nWXGcDhv1XHTj4ffcEbrqxb2McnAn06nYOhxprcU/v8eay7hXFeC2m0 nRDejtBXmlnivmITdSz0F04oeiKIqPX2qUmbbykJtuteOlmdJZTvcFHAaP7koyQUtv pQN1FTKKZqs1YMiPbVSgkQhQbOaIn3W2YZTZODA33pHWptstF8Zj9hzu98RRK73LyA HLqApPJlR3heA== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: Nicolas Pitre , Masahiro Yamada , Michal Marek , linux-kernel@vger.kernel.org Subject: [PATCH v2 7/7] kbuild: link vmlinux only once for CONFIG_TRIM_UNUSED_KSYMS Date: Fri, 16 Mar 2018 11:18:44 +0900 Message-Id: <1521166725-24157-8-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1521166725-24157-1-git-send-email-yamada.masahiro@socionext.com> References: <1521166725-24157-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 cp B A @echo newer prerequisite: $? B: C cp C B touch A [Result] $ rm -f A B $ touch C $ make cp C B touch A cp B A newer prerequisite: B 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; 'vmlinux' has actually been updated in the 'vmlinux_prereq' target. Make cannot predict this, so judges 'vmlinux' is old. link-vmlinus.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 --- Changes in v2: - Discard my wrong change to adjust_autoksyms.sh - Add more commit log to explain how Make is working Makefile | 26 +++++++++++--------------- 1 file changed, 11 insertions(+), 15 deletions(-) -- 2.7.4 diff --git a/Makefile b/Makefile index 5fee703..3e871d2 100644 --- a/Makefile +++ b/Makefile @@ -998,21 +998,11 @@ 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 -ifdef CONFIG_TRIM_UNUSED_KSYMS - $(Q)$(CONFIG_SHELL) $(srctree)/scripts/adjust_autoksyms.sh \ +# Recurse until adjust_autoksyms.sh is satisfied +PHONY += autoksyms_recursive +autoksyms_recursive: $(vmlinux-deps) + $(Q)$(CONFIG_SHELL) $(srctree)/scripts/adjust_autoksyms.sh \ "$(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. @@ -1034,7 +1024,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