From patchwork Tue Jun 4 10:13:55 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 165736 Delivered-To: patch@linaro.org Received: by 2002:a92:9e1a:0:0:0:0:0 with SMTP id q26csp5638529ili; Tue, 4 Jun 2019 03:15:53 -0700 (PDT) X-Google-Smtp-Source: APXvYqxz3Wdid0bTyJDSzUaOXGK4i8eFFKPqWqzXTueO40BlBK92PvggrsrezPC9VFU93oLcvUVa X-Received: by 2002:a65:6551:: with SMTP id a17mr31444264pgw.1.1559643353331; Tue, 04 Jun 2019 03:15:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559643353; cv=none; d=google.com; s=arc-20160816; b=l7gMSAEEZ/VAzxYXEXvPHHIIknCeWG+ktGnjo9miVrVob+1ePdS/o0EAxL/0qYJX+H iW9rfowred3Xn6Ixp5iQPwfC5qkXq1ja6VDG0ue+VRIhTcBEx1scra/QakghZLz4gaRH yEfxtrEy3ZakMcsNGVuVmC9mMqUCFiZNlHEtmXEfbVYN7nKIAJlN5EwNnHqzjSNRCQ+E NZfIB44TQKXtvBY3wKcVWyYO8EHtYq3KgrbcfgpNllcfujvHXXpJp/p/jtt5KWwjmEF0 ae6wyiYNv0/IumCXv53sKETazvBmHVDWtkgzQlrVei3OKGwlEGBmQrwtXCtjlravQpQa xzKw== 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; bh=pUquGiN6xNeDHSibS2E6fCO5H4gfpfVcs2A9RbnL/14=; b=YURfT8Vl6Jx+48rfvduinB24LEF1NQhFNm3PtFiA0fSJPbYh/JEz8z2qCPZKG/k3kZ 3xTglhpdtIgec7e7P6vLZ5ihgs2cV5PJQiWKmG460CohrUWiRoez+9sMr4+6L7MvW4tF RpuTcM8kNFsLPjjAxCh7mGj8OoL4sJglmH5gjaxOze44V3Q6FR4JBeTpNj0RfKpEtb5c rlLmTNwQpFU0PW0ogDovGIovVJRv6t0g2KslTl0WyEUeQZigEUhzcRSJmHvDtKLlS4Y9 vkjHJHqgQWnSN+6Wq5nzQctWBYg2zg5SqjmOlwqbEDzwK9fHirI/efIAgR59cyKhPeyi 9x8w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=AblFESWR; 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 f9si20553848pgv.5.2019.06.04.03.15.53; Tue, 04 Jun 2019 03:15:53 -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=AblFESWR; 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 S1727433AbfFDKPw (ORCPT + 30 others); Tue, 4 Jun 2019 06:15:52 -0400 Received: from conuserg-08.nifty.com ([210.131.2.75]:39514 "EHLO conuserg-08.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727139AbfFDKPu (ORCPT ); Tue, 4 Jun 2019 06:15:50 -0400 Received: from localhost.localdomain (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-08.nifty.com with ESMTP id x54AEC77032511; Tue, 4 Jun 2019 19:14:14 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-08.nifty.com x54AEC77032511 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1559643255; bh=pUquGiN6xNeDHSibS2E6fCO5H4gfpfVcs2A9RbnL/14=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=AblFESWR5OlGEncv08R8Lc2lsYWxIVUQcbeaUgKG0cPSzPHOn0qLs/Ti1OaBxUsqu VdmsFA5lxplHPlDHqHnCSWqMPGmItXfMZfK17mHav7GDD0pUwOt0sTRC/I4gAmFYdP dDtT+DbuklcVZff3lNDn8os+44DqasROkKb/XGxtdy0LLiGqJLGPEgmBzOoGnq9tkF Md4Aqfd92wCJ+zvQzTPiEY3Yk0Au9tRE5z/aqLw8/NkbZ0RtTYbzdvc5Ks95hvl08q zTXIYtrtS+6+M5A/pB97Zgnpxd6uO1wEGOyUWut5M5kCjIIdiUKvUBMhiD4ItfkUP9 K50zQWy9tn69A== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: Randy Dunlap , Arnd Bergmann , David Howells , Sam Ravnborg , Jani Nikula , Masahiro Yamada , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, Jonathan Corbet , Michal Marek Subject: [PATCH 01/15] kbuild: remove headers_{install,check}_all Date: Tue, 4 Jun 2019 19:13:55 +0900 Message-Id: <20190604101409.2078-2-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190604101409.2078-1-yamada.masahiro@socionext.com> References: <20190604101409.2078-1-yamada.masahiro@socionext.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org headers_install_all does not make much sense any more because different architectures export different set of uapi/linux/ headers. As you see in include/uapi/linux/Kbuild, the installation of a.out.h, kvm.h, and kvm_para.h is arch-dependent. So, headers_install_all repeats the installation/removal of them. If somebody really thinks it is useful to do headers_install for all architectures, it would be possible by small shell-scripting, but the top Makefile do not have to provide entry targets just for that purpose. Signed-off-by: Masahiro Yamada --- Documentation/kbuild/headers_install.txt | 7 ------ Documentation/kbuild/makefiles.txt | 6 +---- Makefile | 15 ++---------- scripts/headers.sh | 29 ------------------------ 4 files changed, 3 insertions(+), 54 deletions(-) delete mode 100755 scripts/headers.sh -- 2.17.1 Acked-by: Sam Ravnborg diff --git a/Documentation/kbuild/headers_install.txt b/Documentation/kbuild/headers_install.txt index f0153adb95e2..f07e34eab70b 100644 --- a/Documentation/kbuild/headers_install.txt +++ b/Documentation/kbuild/headers_install.txt @@ -39,12 +39,5 @@ INSTALL_HDR_PATH indicates where to install the headers. It defaults to An 'include' directory is automatically created inside INSTALL_HDR_PATH and headers are installed in 'INSTALL_HDR_PATH/include'. -The command "make headers_install_all" exports headers for all architectures -simultaneously. (This is mostly of interest to distribution maintainers, -who create an architecture-independent tarball from the resulting include -directory.) You also can use HDR_ARCH_LIST to specify list of architectures. -Remember to provide the appropriate linux/asm directory via "mv" or "ln -s" -before building a C library with headers exported this way. - The kernel header export infrastructure is maintained by David Woodhouse . diff --git a/Documentation/kbuild/makefiles.txt b/Documentation/kbuild/makefiles.txt index d65ad5746f94..bac301a73a86 100644 --- a/Documentation/kbuild/makefiles.txt +++ b/Documentation/kbuild/makefiles.txt @@ -897,11 +897,7 @@ When kbuild executes, the following steps are followed (roughly): --- 6.2 Add prerequisites to archheaders: The archheaders: rule is used to generate header files that - may be installed into user space by "make header_install" or - "make headers_install_all". In order to support - "make headers_install_all", this target has to be able to run - on an unconfigured tree, or a tree configured for another - architecture. + may be installed into user space by "make header_install". It is run before "make archprepare" when run on the architecture itself. diff --git a/Makefile b/Makefile index 004d67a4405f..7745bdd84861 100644 --- a/Makefile +++ b/Makefile @@ -1181,34 +1181,23 @@ headerdep: #Default location for installed headers export INSTALL_HDR_PATH = $(objtree)/usr -# If we do an all arch process set dst to include/arch-$(SRCARCH) -hdr-dst = $(if $(KBUILD_HEADERS), dst=include/arch-$(SRCARCH), dst=include) - PHONY += archheaders archscripts PHONY += __headers __headers: $(version_h) scripts_basic uapi-asm-generic archheaders archscripts $(Q)$(MAKE) $(build)=scripts build_unifdef -PHONY += headers_install_all -headers_install_all: - $(Q)$(CONFIG_SHELL) $(srctree)/scripts/headers.sh install - PHONY += headers_install headers_install: __headers $(if $(wildcard $(srctree)/arch/$(SRCARCH)/include/uapi/asm/Kbuild),, \ $(error Headers not exportable for the $(SRCARCH) architecture)) $(Q)$(MAKE) $(hdr-inst)=include/uapi dst=include - $(Q)$(MAKE) $(hdr-inst)=arch/$(SRCARCH)/include/uapi $(hdr-dst) - -PHONY += headers_check_all -headers_check_all: headers_install_all - $(Q)$(CONFIG_SHELL) $(srctree)/scripts/headers.sh check + $(Q)$(MAKE) $(hdr-inst)=arch/$(SRCARCH)/include/uapi dst=include PHONY += headers_check headers_check: headers_install $(Q)$(MAKE) $(hdr-inst)=include/uapi dst=include HDRCHECK=1 - $(Q)$(MAKE) $(hdr-inst)=arch/$(SRCARCH)/include/uapi $(hdr-dst) HDRCHECK=1 + $(Q)$(MAKE) $(hdr-inst)=arch/$(SRCARCH)/include/uapi dst=include HDRCHECK=1 ifdef CONFIG_HEADERS_CHECK all: headers_check diff --git a/scripts/headers.sh b/scripts/headers.sh deleted file mode 100755 index e0f883eb39a2..000000000000 --- a/scripts/headers.sh +++ /dev/null @@ -1,29 +0,0 @@ -#!/bin/sh -# SPDX-License-Identifier: GPL-2.0 -# Run headers_$1 command for all suitable architectures - -# Stop on error -set -e - -do_command() -{ - if [ -f ${srctree}/arch/$2/include/asm/Kbuild ]; then - make ARCH=$2 KBUILD_HEADERS=$1 headers_$1 - else - printf "Ignoring arch: %s\n" ${arch} - fi -} - -archs=${HDR_ARCH_LIST:-$(ls ${srctree}/arch)} - -for arch in ${archs}; do - case ${arch} in - um) # no userspace export - ;; - *) - if [ -d ${srctree}/arch/${arch} ]; then - do_command $1 ${arch} - fi - ;; - esac -done From patchwork Tue Jun 4 10:13:56 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 165743 Delivered-To: patch@linaro.org Received: by 2002:a92:9e1a:0:0:0:0:0 with SMTP id q26csp5639098ili; Tue, 4 Jun 2019 03:16:25 -0700 (PDT) X-Google-Smtp-Source: APXvYqx3F8HG4bYMwOVQJj/dV0y10+iVknnv+qnVCMMC1YGlq/LhvgK5IyMWeBLYxsDKdHAI74nt X-Received: by 2002:a17:90a:9dc5:: with SMTP id x5mr21521743pjv.110.1559643385848; Tue, 04 Jun 2019 03:16:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559643385; cv=none; d=google.com; s=arc-20160816; b=fW4X2FRjII2lTOyfLUaUq7rREsvof3Y5shkgFUMrkWt1M02epXlUJE0ycnubf3y3ot GCzTeosTB0NvBvfnEW7eelrxKJYP/HZPdkqRRH+3Vn48lPHNPkTW/aoslnpgAy7kzZfn EpMyJA/p+AQUFYDNx/pJCNvkGHD37kgQEngiviiGGE9B0BinCb4/DFx4bPnJnCVnyBAK OpXoOSZtELJc4POsAfaPCm7z41FRJo5k0iAnPKQYujmrHoxbdabJy9DT1+AYTnoA+knI q4i0l1nWlRTqBbgsWU8DnspaIto0/YxgVaPeOh2D2kwu6xkjrkQEI6kQPFOypEK0Pgmw agJA== 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; bh=e9SJiB4wnNAkhH818NbOR4wiR7iq+acLPPc6r/sEHqM=; b=0goO7Z9SIbex9yPd5IR0P3GvFmL/3HFT/OXGR5WGDzkAASYL+aAhBuGiVJd/uxGjec 8WIUzdOG7ys7ccQFLDKnDAPQ6k445ZG8fSsZPYZqTzPgfoPwGXuZn7vsNcZ4OEGKbVO+ NCIOtjknQ0dcFsZVEyqPzoc3pmNIgWDImwmabdYNo29H+fnx+6Ee1jTcTm+7a9k3stTP uhZnqQATllIChFPgE6PotwO0LKMaT3zrPhI+gAP2usK68zXpBK3nqi8H8dXqU7QCCs6V bimIM9NbSMR1cdiE27tb0xM7mg+P7IM7hiWE7ex7GBsjwrROKbI1jLNOSV7Scv4ch2uT t7UQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=wHBFMpvi; 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 140si23233988pfx.198.2019.06.04.03.16.25; Tue, 04 Jun 2019 03:16:25 -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=wHBFMpvi; 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 S1727217AbfFDKPi (ORCPT + 30 others); Tue, 4 Jun 2019 06:15:38 -0400 Received: from conuserg-08.nifty.com ([210.131.2.75]:39169 "EHLO conuserg-08.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727027AbfFDKPi (ORCPT ); Tue, 4 Jun 2019 06:15:38 -0400 Received: from localhost.localdomain (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-08.nifty.com with ESMTP id x54AEC78032511; Tue, 4 Jun 2019 19:14:15 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-08.nifty.com x54AEC78032511 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1559643256; bh=e9SJiB4wnNAkhH818NbOR4wiR7iq+acLPPc6r/sEHqM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=wHBFMpviCKXyTlZK9yx9rTb6w54/CFiGPJKXwz3QNn4NZbc6VjSt4uDy4FBFy4I5d Ofpl6bCf61/AQZAtZjS5QtZvoIB2HxrHCZvJ58O6MpiexlY8Bkw62/v6GZN6W1oA3f 02a9bI9qWYRoL3jrINrk6i3GmRU994yZl4W2co2a9U0aYYVlK9MNNk1xlsPdgvPDK2 bKeuoBcMHpbm+RJ5ns27JAJHEQknqCQETn64BVurzli3sl6ogWLPTKMCu+sKNrjz37 yg7aqlh9VDlehbbmy/6qUwbJoroYTlc0JIsU91O9gOXSv8gNVu0hNTv9SNw2KLTWGg ehBAHQJCJFt1Q== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: Randy Dunlap , Arnd Bergmann , David Howells , Sam Ravnborg , Jani Nikula , Masahiro Yamada , Michal Marek , linux-kernel@vger.kernel.org Subject: [PATCH 02/15] kbuild: remove stale dependency between Documentation/ and headers_install Date: Tue, 4 Jun 2019 19:13:56 +0900 Message-Id: <20190604101409.2078-3-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190604101409.2078-1-yamada.masahiro@socionext.com> References: <20190604101409.2078-1-yamada.masahiro@socionext.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit 8e2faea877eb ("Make Documenation depend on headers_install") dates back to 2014, which is before Sphinx was introduced for the kernel documentation. Since none of DOC_TARGET requires headers_install, it is strange to run it only for the single target "Documentation/". Signed-off-by: Masahiro Yamada --- Makefile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) -- 2.17.1 diff --git a/Makefile b/Makefile index 7745bdd84861..67b866d19269 100644 --- a/Makefile +++ b/Makefile @@ -1745,8 +1745,7 @@ build-dir = $(patsubst %/,%,$(dir $(build-target))) PHONY += / /: ./ -# Make sure the latest headers are built for Documentation -Documentation/ samples/: headers_install +samples/: headers_install %/: prepare FORCE $(Q)$(MAKE) KBUILD_MODULES=1 $(build)=$(build-dir) From patchwork Tue Jun 4 10:13:57 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 165740 Delivered-To: patch@linaro.org Received: by 2002:a92:9e1a:0:0:0:0:0 with SMTP id q26csp5638921ili; Tue, 4 Jun 2019 03:16:16 -0700 (PDT) X-Google-Smtp-Source: APXvYqwCYcaM8AAic3NgmvhWrz/e8dkyG8MHXQeqJBowtlkMs/UQUt/uALFNoUux/nQfvzMBD9+z X-Received: by 2002:a63:6b07:: with SMTP id g7mr10411064pgc.325.1559643376605; Tue, 04 Jun 2019 03:16:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559643376; cv=none; d=google.com; s=arc-20160816; b=U/OTzAUWf9hHI9hlS8CPZN2NNfh5iV4sj+oyaT1apdaXtrB86j70iPD77rtx++uGvr Dg2I41pozZFMmPv2VEQPP+naqoPH7zpxrmaX0xfFV4uehnQcuvlLL1jX2O0nSLHKwz6v Y97iSe/u7DWYxZnUP4FS3LAmTAsnjxEyEdlGcn20HEUN8BlwCwY1EXfPJIyzhJjNc05H d6z32jQPsUuofT2yQcK1YnK2TJLx9gIYVF35Ehl/oOXpX1iBG4Q9zfzyyrTgIALpVBJm pv9FGQwTGakGhkyBHJUDrdJiyXcteEr3YohkHjG48ErvDnRLUk3T/YvS/0dOoRoaUw+V JAKA== 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; bh=A3Q6+8g2ASpEJmIcz4ywD24MTjUJJltUdc3L3A7Y6dA=; b=aCWggGIF1RlWdJiZwFz8W3SH/8nc5MnZNQJxRqlVy5885lhETQTD4SvnfxTUza8fOc fG2L1yzN/oV1+zquoUCvZtyf0rMJdtdaF7qCdSufiJkX5CL+/CuvLXRccyboCdFXD90a cbBt+Ygv0gYjxqg8EUeds1JYRr+sBEQyEcR+6PfnaGNyPs5rW/FIliN28PELLya0YJd3 GOH1/L0VBfUxiE6lPNGM/OIVSv1wO6LWOit+M0e7o1433oc+oc8c5B5o4ZEJTWUmQ8V0 wmoiNK+tNnzBw2kIpfK9JHPDTm8WcfZ+ucg4GlW93Lym3qUuRVacdWS4ZVvwCKrvc8ZE ciRg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=YUydSxrF; 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 l27si19859934pgm.172.2019.06.04.03.16.15; Tue, 04 Jun 2019 03:16:16 -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=YUydSxrF; 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 S1727518AbfFDKQP (ORCPT + 30 others); Tue, 4 Jun 2019 06:16:15 -0400 Received: from conuserg-08.nifty.com ([210.131.2.75]:39199 "EHLO conuserg-08.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727114AbfFDKPj (ORCPT ); Tue, 4 Jun 2019 06:15:39 -0400 Received: from localhost.localdomain (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-08.nifty.com with ESMTP id x54AEC79032511; Tue, 4 Jun 2019 19:14:16 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-08.nifty.com x54AEC79032511 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1559643257; bh=A3Q6+8g2ASpEJmIcz4ywD24MTjUJJltUdc3L3A7Y6dA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=YUydSxrFjQndOsqXHTND+J0Wq/0fcQkiEtcCGiDQZBQAEZ78jmsAtuLMM+vLdHiZW Az+6zv3dJIVqAa+BDWEVhcQEzPmL7eiiBlsIE3fpf8G9otHKTkTOVF8NvOn/ea/yb9 GD2b9itMxFosT1xsTQkSlnYqfS/R6eNoTXaiwUIlbt8c6kpWuJgYLtLMBKXgzl2VB+ b/bSrboqS6rBydMLU9M6f/oQLfDVOjKkG2O7qIfkZLydJYU/8fOEf6rdFbpasL4HaE yIOkP8P9xwlCvGZKKxIe9qlKf4dIu3413DgflF2m5U+ciPLWeRLrlFWkoW+YFBDnhU aTv+zZiWpK2qA== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: Randy Dunlap , Arnd Bergmann , David Howells , Sam Ravnborg , Jani Nikula , Masahiro Yamada , Michal Marek , linux-kernel@vger.kernel.org Subject: [PATCH 03/15] kbuild: make gdb_script depend on prepare0 instead of prepare Date: Tue, 4 Jun 2019 19:13:57 +0900 Message-Id: <20190604101409.2078-4-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190604101409.2078-1-yamada.masahiro@socionext.com> References: <20190604101409.2078-1-yamada.masahiro@socionext.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 'gdb_script' needs headers generated by ./Kbuild, which is visited by 'prepare0'. None of 'gdb_script' depends on 'prepare'. Loosen the dependency. Signed-off-by: Masahiro Yamada --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.17.1 diff --git a/Makefile b/Makefile index 67b866d19269..8348939765d3 100644 --- a/Makefile +++ b/Makefile @@ -1541,7 +1541,7 @@ $(DOC_TARGETS): scripts_basic FORCE # --------------------------------------------------------------------------- PHONY += scripts_gdb -scripts_gdb: prepare +scripts_gdb: prepare0 $(Q)$(MAKE) $(build)=scripts/gdb $(Q)ln -fsn $(abspath $(srctree)/scripts/gdb/vmlinux-gdb.py) From patchwork Tue Jun 4 10:13:58 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 165733 Delivered-To: patch@linaro.org Received: by 2002:a92:9e1a:0:0:0:0:0 with SMTP id q26csp5638390ili; Tue, 4 Jun 2019 03:15:46 -0700 (PDT) X-Google-Smtp-Source: APXvYqwM4PnSh8NHqvkzoFUKjDWVvy+zUesMJmHtZCmcOgtwd0hEXCE0rB6DIBMUGcZlcvR/H++T X-Received: by 2002:a63:ff0c:: with SMTP id k12mr34354891pgi.32.1559643346046; Tue, 04 Jun 2019 03:15:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559643346; cv=none; d=google.com; s=arc-20160816; b=W1lVotS+GIqsn+jiub0iuf6DlAWFLPPhq9zuyhaKk3HwUz+7xXV3dQsyFYnIlN4ypk ZI8SrGoL78p6l+Ce60rof8fihIHIkozyubRgUaQ1FsZoW2rL/rrRHbmeCnFpxTHEgeYi ts49HJWgpfH+5Ny0cgTg8G8ioVZO5VntI+nbh6WQNTeUh7rH5GeqBrHi1l78bDv9US8N Q+a/yM2sRi/gwKM1SIfh+BR/EnQ8IjaJfGbO6D35n09pCgWvGsNQ4CJx4Cua/fjI3Duk ujd3SOhCvxN0/Fnhs4SObheGIcTNc4351t7v5SsBNTFywI0afPro2se9j/8bkLSYSJ58 s8gg== 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; bh=UUUjFRogbBACivTlFc6RgzhbVkPaCnIYQJXNtS0Cn2s=; b=eR0+1f8FppbiVd+adNZ5/HZC6KUJQrQKk7Ss8qMMDnDuSHkXF2ZUYCGqQbjoZ+W1j1 /CGFV1aY/kpx9JaieBDgn7qaFy+DqavygUer1kc15DocMRERV0RiW2LNRAQ/NfkHj6qr E4kbmoNPr/Ae5U0WV7015qEcLBnhthP44TzLz/jW0XHiAe9K5sbOtPlRZA5WfihnGGdb xrT1nUTLsHZpaX1Ntgny9+zNGFMkYugZWF4pveClYL0spqCt6ssORJfx4qFqQH2PsJXR fJMdyY0bodPX695wDu0W6uNdNnVCAdE1yIaxNqeeo+ppj30jet6xakD5U9WKskogQa86 2nFQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=pHvc2lxa; 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 d137si21941851pga.23.2019.06.04.03.15.45; Tue, 04 Jun 2019 03:15:46 -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=pHvc2lxa; 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 S1727356AbfFDKPo (ORCPT + 30 others); Tue, 4 Jun 2019 06:15:44 -0400 Received: from conuserg-08.nifty.com ([210.131.2.75]:39318 "EHLO conuserg-08.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727107AbfFDKPn (ORCPT ); Tue, 4 Jun 2019 06:15:43 -0400 Received: from localhost.localdomain (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-08.nifty.com with ESMTP id x54AEC7A032511; Tue, 4 Jun 2019 19:14:17 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-08.nifty.com x54AEC7A032511 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1559643258; bh=UUUjFRogbBACivTlFc6RgzhbVkPaCnIYQJXNtS0Cn2s=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=pHvc2lxavg4I4Q3qoMUzW+SXQ01lTpJbEksIGn94RMsh+7NKYUWzu/3ELUBMZdrWx 4u0ldaTSyoez+pXhB7SzlMB5Hig069bPACKP76bGaeiVEyVIdsdt3o4KXykw7R+sMK KhtNOE1cED0YSHV/Xc+YMKFHPpJXe0un5tB9tC8xaHA+qCuzqqtbMhrlJhAvugkBoG vMM+sYS6IuYgadmgW1lKC8HBXgUGlaDEufXu8Urh4mb3OGmSr/eu4hrNOeyKrD4VaS MmA2sW32rC+eKVvBg5mQiYSN1cFEuSiXgA9Av/r5mKniEfMn7flHVowjSuZsNd1sr0 Ew8hewIOFKrUw== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: Randy Dunlap , Arnd Bergmann , David Howells , Sam Ravnborg , Jani Nikula , Masahiro Yamada , linux-kernel@vger.kernel.org Subject: [PATCH 04/15] kbuild: fix Kconfig prompt of CONFIG_HEADERS_CHECK Date: Tue, 4 Jun 2019 19:13:58 +0900 Message-Id: <20190604101409.2078-5-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190604101409.2078-1-yamada.masahiro@socionext.com> References: <20190604101409.2078-1-yamada.masahiro@socionext.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Prior to commit 257edce66d31 ("kbuild: exploit parallel building for CONFIG_HEADERS_CHECK"), the sanity check of exported headers was done as a side-effect of build rule of vmlinux. That commit is good, but I missed to update the prompt of the Kconfig entry. For the sake of preciseness, lets' say "when building 'all'". Signed-off-by: Masahiro Yamada --- lib/Kconfig.debug | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) -- 2.17.1 diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug index cbdfae379896..7cdcb962358c 100644 --- a/lib/Kconfig.debug +++ b/lib/Kconfig.debug @@ -306,11 +306,11 @@ config DEBUG_FS If unsure, say N. config HEADERS_CHECK - bool "Run 'make headers_check' when building vmlinux" + bool "Run sanity checks on uapi headers when building 'all'" depends on !UML help - This option will extract the user-visible kernel headers whenever - building the kernel, and will run basic sanity checks on them to + This option will extract the user-visible kernel headers when + building the 'all' target, and will run basic sanity checks on them to ensure that exported files do not attempt to include files which were not exported, etc. From patchwork Tue Jun 4 10:13:59 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 165745 Delivered-To: patch@linaro.org Received: by 2002:a92:9e1a:0:0:0:0:0 with SMTP id q26csp5640076ili; Tue, 4 Jun 2019 03:17:20 -0700 (PDT) X-Google-Smtp-Source: APXvYqw6IBjMX2ywRm5mCgavodsbWu9xOCxdgBJhu6EGkF0Jc/PhMSp9UQw5XNMmeK31pki/CE1W X-Received: by 2002:a62:a509:: with SMTP id v9mr35640582pfm.82.1559643440471; Tue, 04 Jun 2019 03:17:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559643440; cv=none; d=google.com; s=arc-20160816; b=tmWipIqd6/h0Spn+3pzpkK4a7+kN7Twbo/CIeyXSoTiqobHgfXLEmJX2BCl8XADMMZ W7aN8i3XxEBbwx0L4ODzL57s8rIZBSwSzc7cvIOOUhgcLg6OD5V0W5UlJwUMsQXWRYWi XqLuTPN2O9YiheB3Fc1Qc79SpCOy5rZgCsIE7e0TKniFMkwjtdNnyL4vQNsvCWavnLT3 URjrs6ImzmJ4jnSzawQNbADlbfYI07tSGK3/U39uMjuGEku/t7BiIqH+wpMsJh4pkZFa NtME8FRzm9doT28QRdFMRsOC9FlfdOTwevUVXSjMebW3yXw0qXBlTHOH/eJBECR+MYve p0dg== 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; bh=Oka5YpAg+k5l88SL/bB7/ELT3B4mHTq93jBuR0XeVDU=; b=oJPZeK4axydAWPoCDG02zJJmH2wmR1C18SDjvli/pTQx0Qs6fgjm7+D9KF77gDKsQj mNuLEGnRdTu21nrR23ccHKkLGB9NYjlOgiDL4DxRDM582QxQmYzhV+lxhvVqMXLzqUZj kYRvy1ZaQfMNYlmNIXZN2VJTUh1e2pJpOr8w+O54EK3PXKP0flkonDKkwAgqPFINTbf5 +zy0mmW70R/xbK9KLuE3ggdrCH4PbS3PeDujxH2VTJzLOj2GeqcAoVzVODpVbdLzgLZE 63+nfm0dww7fEVUkD0rZeCvhsqZyBp/v8ZZv7NF7nvguLL6vdomvnHa2o1b3LeQ4qaaf S6Dw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=J+lYbqkD; 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 v1si10032780plp.264.2019.06.04.03.17.20; Tue, 04 Jun 2019 03:17:20 -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=J+lYbqkD; 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 S1727501AbfFDKRT (ORCPT + 30 others); Tue, 4 Jun 2019 06:17:19 -0400 Received: from conuserg-08.nifty.com ([210.131.2.75]:41888 "EHLO conuserg-08.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727061AbfFDKRS (ORCPT ); Tue, 4 Jun 2019 06:17:18 -0400 Received: from localhost.localdomain (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-08.nifty.com with ESMTP id x54AEC7B032511; Tue, 4 Jun 2019 19:14:18 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-08.nifty.com x54AEC7B032511 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1559643259; bh=Oka5YpAg+k5l88SL/bB7/ELT3B4mHTq93jBuR0XeVDU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=J+lYbqkDyx5TCbBD+Dn9u83I3HtBZWpgzIStSV9W5m8Vm7NsIAtCgZTTnviNOz2/k OIa3qQLjn3LJ7SFdO7cx4WcnlaqSOAOAOumyzJ/LJRtUiJsfCSRsZYwrzkeOJHFloh 5StGJrqnxtUoL1ZJgKMKnW+FVSO1PQZGYbOztFRAmSmiiFVQv6vKdRLA4xCR4r48yn wXht5Fpzui7RHx47kKqdrv4g+1N3wRkcfOsMq3aPvHHshb53vEmzlWyFS9ffiyfLYg ENAWvph9pzP8vXv0G83Xee/xAieRnQjeb2MJfRFGjniA0vGhfY5j4gVUCvNpi8ZGY8 i977mhymYRHng== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: Randy Dunlap , Arnd Bergmann , David Howells , Sam Ravnborg , Jani Nikula , Masahiro Yamada , linux-s390@vger.kernel.org, Vasily Gorbik , Greentime Hu , linux-parisc@vger.kernel.org, "James E.J. Bottomley" , Helge Deller , Vineet Gupta , linux-kernel@vger.kernel.org, Vincent Chen , Michal Marek , Paul Mackerras , Christian Borntraeger , Benjamin Herrenschmidt , Michael Ellerman , linux-snps-arc@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, Heiko Carstens Subject: [PATCH 05/15] kbuild: add CONFIG_HEADERS_INSTALL and loosen the dependency of samples Date: Tue, 4 Jun 2019 19:13:59 +0900 Message-Id: <20190604101409.2078-6-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190604101409.2078-1-yamada.masahiro@socionext.com> References: <20190604101409.2078-1-yamada.masahiro@socionext.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit 5318321d367c ("samples: disable CONFIG_SAMPLES for UML") used a big hammer to fix the build errors under the samples/ directory, while only some samples actually include uapi headers from usr/include. Introduce CONFIG_HEADERS_INSTALL since 'depends on HEADERS_INSTALL' is clearer than 'depends on !UML'. If this option is enabled, uapi headers are installed before starting directory descending. I added 'depends on HEADERS_INSTALL' to per-sample CONFIG options. This allows UML to compile some samples. $ make ARCH=um allmodconfig samples/ [ snip ] CC [M] samples/configfs/configfs_sample.o CC [M] samples/kfifo/bytestream-example.o CC [M] samples/kfifo/dma-example.o CC [M] samples/kfifo/inttype-example.o CC [M] samples/kfifo/record-example.o CC [M] samples/kobject/kobject-example.o CC [M] samples/kobject/kset-example.o CC [M] samples/trace_events/trace-events-sample.o CC [M] samples/trace_printk/trace-printk.o AR samples/vfio-mdev/built-in.a AR samples/built-in.a Signed-off-by: Masahiro Yamada --- Makefile | 8 ++++---- arch/arc/configs/tb10x_defconfig | 1 + arch/nds32/configs/defconfig | 1 + arch/parisc/configs/a500_defconfig | 1 + arch/parisc/configs/b180_defconfig | 1 + arch/parisc/configs/c3000_defconfig | 1 + arch/parisc/configs/default_defconfig | 1 + arch/powerpc/configs/ppc6xx_defconfig | 1 + arch/s390/configs/debug_defconfig | 1 + lib/Kconfig.debug | 19 ++++++++++++++----- samples/Kconfig | 14 +++++++++++--- samples/Makefile | 4 ++-- 12 files changed, 39 insertions(+), 14 deletions(-) -- 2.17.1 diff --git a/Makefile b/Makefile index 8348939765d3..ce5a9551860d 100644 --- a/Makefile +++ b/Makefile @@ -1053,9 +1053,6 @@ vmlinux: scripts/link-vmlinux.sh autoksyms_recursive $(vmlinux-deps) FORCE targets := vmlinux -# Some samples need headers_install. -samples: headers_install - # The actual objects are generated when descending, # make sure no implicit rule kicks in $(sort $(vmlinux-deps)): $(vmlinux-dirs) ; @@ -1199,6 +1196,10 @@ headers_check: headers_install $(Q)$(MAKE) $(hdr-inst)=include/uapi dst=include HDRCHECK=1 $(Q)$(MAKE) $(hdr-inst)=arch/$(SRCARCH)/include/uapi dst=include HDRCHECK=1 +ifdef CONFIG_HEADERS_INSTALL +prepare: headers_install +endif + ifdef CONFIG_HEADERS_CHECK all: headers_check endif @@ -1745,7 +1746,6 @@ build-dir = $(patsubst %/,%,$(dir $(build-target))) PHONY += / /: ./ -samples/: headers_install %/: prepare FORCE $(Q)$(MAKE) KBUILD_MODULES=1 $(build)=$(build-dir) diff --git a/arch/arc/configs/tb10x_defconfig b/arch/arc/configs/tb10x_defconfig index 5b5119d2b5d5..dc739bd093e3 100644 --- a/arch/arc/configs/tb10x_defconfig +++ b/arch/arc/configs/tb10x_defconfig @@ -94,6 +94,7 @@ CONFIG_CONFIGFS_FS=y CONFIG_DEBUG_INFO=y CONFIG_STRIP_ASM_SYMS=y CONFIG_DEBUG_FS=y +CONFIG_HEADERS_INSTALL=y CONFIG_HEADERS_CHECK=y CONFIG_DEBUG_SECTION_MISMATCH=y CONFIG_MAGIC_SYSRQ=y diff --git a/arch/nds32/configs/defconfig b/arch/nds32/configs/defconfig index 65ce9259081b..40313a635075 100644 --- a/arch/nds32/configs/defconfig +++ b/arch/nds32/configs/defconfig @@ -92,6 +92,7 @@ CONFIG_DEBUG_INFO=y CONFIG_DEBUG_INFO_DWARF4=y CONFIG_GDB_SCRIPTS=y CONFIG_READABLE_ASM=y +CONFIG_HEADERS_INSTALL=y CONFIG_HEADERS_CHECK=y CONFIG_DEBUG_SECTION_MISMATCH=y CONFIG_MAGIC_SYSRQ=y diff --git a/arch/parisc/configs/a500_defconfig b/arch/parisc/configs/a500_defconfig index 5acb93dcaabf..390c0bc09179 100644 --- a/arch/parisc/configs/a500_defconfig +++ b/arch/parisc/configs/a500_defconfig @@ -167,6 +167,7 @@ CONFIG_NLS_ISO8859_1=m CONFIG_NLS_ISO8859_15=m CONFIG_NLS_UTF8=m CONFIG_DEBUG_FS=y +CONFIG_HEADERS_INSTALL=y CONFIG_HEADERS_CHECK=y CONFIG_MAGIC_SYSRQ=y # CONFIG_DEBUG_BUGVERBOSE is not set diff --git a/arch/parisc/configs/b180_defconfig b/arch/parisc/configs/b180_defconfig index 83ffd161aec5..bdf1fe2b217f 100644 --- a/arch/parisc/configs/b180_defconfig +++ b/arch/parisc/configs/b180_defconfig @@ -91,6 +91,7 @@ CONFIG_NLS_ASCII=m CONFIG_NLS_ISO8859_1=m CONFIG_NLS_ISO8859_15=m CONFIG_NLS_UTF8=m +CONFIG_HEADERS_INSTALL=y CONFIG_HEADERS_CHECK=y CONFIG_MAGIC_SYSRQ=y CONFIG_DEBUG_KERNEL=y diff --git a/arch/parisc/configs/c3000_defconfig b/arch/parisc/configs/c3000_defconfig index 8d41a73bd71b..ed4d49575b38 100644 --- a/arch/parisc/configs/c3000_defconfig +++ b/arch/parisc/configs/c3000_defconfig @@ -140,6 +140,7 @@ CONFIG_NLS_ISO8859_1=m CONFIG_NLS_ISO8859_15=m CONFIG_NLS_UTF8=m CONFIG_DEBUG_FS=y +CONFIG_HEADERS_INSTALL=y CONFIG_HEADERS_CHECK=y CONFIG_MAGIC_SYSRQ=y CONFIG_DEBUG_MUTEXES=y diff --git a/arch/parisc/configs/default_defconfig b/arch/parisc/configs/default_defconfig index 52c9050a7c5c..fcfd9eaadf9b 100644 --- a/arch/parisc/configs/default_defconfig +++ b/arch/parisc/configs/default_defconfig @@ -184,6 +184,7 @@ CONFIG_NLS_KOI8_R=m CONFIG_NLS_KOI8_U=m CONFIG_NLS_UTF8=y CONFIG_DEBUG_FS=y +CONFIG_HEADERS_INSTALL=y CONFIG_HEADERS_CHECK=y CONFIG_MAGIC_SYSRQ=y CONFIG_DEBUG_KERNEL=y diff --git a/arch/powerpc/configs/ppc6xx_defconfig b/arch/powerpc/configs/ppc6xx_defconfig index 7c6baf6df139..463aa3e53084 100644 --- a/arch/powerpc/configs/ppc6xx_defconfig +++ b/arch/powerpc/configs/ppc6xx_defconfig @@ -1124,6 +1124,7 @@ CONFIG_NLS_KOI8_R=m CONFIG_NLS_KOI8_U=m CONFIG_DEBUG_INFO=y CONFIG_UNUSED_SYMBOLS=y +CONFIG_HEADERS_INSTALL=y CONFIG_HEADERS_CHECK=y CONFIG_MAGIC_SYSRQ=y CONFIG_DEBUG_KERNEL=y diff --git a/arch/s390/configs/debug_defconfig b/arch/s390/configs/debug_defconfig index b0920b35f87b..994e03fad424 100644 --- a/arch/s390/configs/debug_defconfig +++ b/arch/s390/configs/debug_defconfig @@ -586,6 +586,7 @@ CONFIG_GDB_SCRIPTS=y CONFIG_FRAME_WARN=1024 CONFIG_READABLE_ASM=y CONFIG_UNUSED_SYMBOLS=y +CONFIG_HEADERS_INSTALL=y CONFIG_HEADERS_CHECK=y CONFIG_DEBUG_SECTION_MISMATCH=y CONFIG_MAGIC_SYSRQ=y diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug index 7cdcb962358c..6a6ea4219d1e 100644 --- a/lib/Kconfig.debug +++ b/lib/Kconfig.debug @@ -305,14 +305,23 @@ config DEBUG_FS If unsure, say N. +config HEADERS_INSTALL + bool "Install uapi headers to usr/include" + depends on !UML + help + This option will install uapi headers (headers exported to user-space) + into the usr/include directory for use during the kernel build. + This is unneeded for building the kernel itself, but needed for some + user-space program samples. It is also needed by some features such + as uapi header sanity checks. + config HEADERS_CHECK bool "Run sanity checks on uapi headers when building 'all'" - depends on !UML + depends on HEADERS_INSTALL help - This option will extract the user-visible kernel headers when - building the 'all' target, and will run basic sanity checks on them to - ensure that exported files do not attempt to include files which - were not exported, etc. + This option will run basic sanity checks on uapi headers when + building the 'all' target, for example, ensure that they do not + attempt to include files which were not exported, etc. If you're making modifications to header files which are relevant for userspace, say 'Y', and check the headers diff --git a/samples/Kconfig b/samples/Kconfig index d63cc8a3e0df..71b5e833dd9e 100644 --- a/samples/Kconfig +++ b/samples/Kconfig @@ -1,7 +1,6 @@ # SPDX-License-Identifier: GPL-2.0-only menuconfig SAMPLES bool "Sample kernel code" - depends on !UML help You can build and test sample kernel code here. @@ -95,16 +94,24 @@ config SAMPLE_CONFIGFS config SAMPLE_CONNECTOR tristate "Build connector sample -- loadable modules only" - depends on CONNECTOR && m + depends on CONNECTOR && HEADERS_INSTALL && m help When enabled, this builds both a sample kernel module for the connector interface and a user space tool to communicate with it. See also Documentation/connector/connector.txt +config SAMPLE_HIDRAW + bool "hidraw sample" + depends on HEADERS_INSTALL + +config SAMPLE_PIDFD + bool "pidfd sample" + depends on HEADERS_INSTALL + config SAMPLE_SECCOMP bool "Build seccomp sample code" - depends on SECCOMP_FILTER + depends on SECCOMP_FILTER && HEADERS_INSTALL help Build samples of seccomp filters using various methods of BPF filter construction. @@ -156,6 +163,7 @@ config SAMPLE_ANDROID_BINDERFS config SAMPLE_VFS bool "Build example programs that use new VFS system calls" + depends on HEADERS_INSTALL help Build example userspace programs that use new VFS system calls such as mount API and statx(). Note that this is restricted to the x86 diff --git a/samples/Makefile b/samples/Makefile index debf8925f06f..7d6e4ca28d69 100644 --- a/samples/Makefile +++ b/samples/Makefile @@ -4,14 +4,14 @@ obj-$(CONFIG_SAMPLE_ANDROID_BINDERFS) += binderfs/ obj-$(CONFIG_SAMPLE_CONFIGFS) += configfs/ obj-$(CONFIG_SAMPLE_CONNECTOR) += connector/ -subdir-y += hidraw +subdir-$(CONFIG_SAMPLE_HIDRAW) += hidraw obj-$(CONFIG_SAMPLE_HW_BREAKPOINT) += hw_breakpoint/ obj-$(CONFIG_SAMPLE_KDB) += kdb/ obj-$(CONFIG_SAMPLE_KFIFO) += kfifo/ obj-$(CONFIG_SAMPLE_KOBJECT) += kobject/ obj-$(CONFIG_SAMPLE_KPROBES) += kprobes/ obj-$(CONFIG_SAMPLE_LIVEPATCH) += livepatch/ -subdir-y += pidfd +subdir-$(CONFIG_SAMPLE_PIDFD) += pidfd obj-$(CONFIG_SAMPLE_QMI_CLIENT) += qmi/ obj-$(CONFIG_SAMPLE_RPMSG_CLIENT) += rpmsg/ subdir-$(CONFIG_SAMPLE_SECCOMP) += seccomp From patchwork Tue Jun 4 10:14:00 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 165737 Delivered-To: patch@linaro.org Received: by 2002:a92:9e1a:0:0:0:0:0 with SMTP id q26csp5638594ili; Tue, 4 Jun 2019 03:15:57 -0700 (PDT) X-Google-Smtp-Source: APXvYqxlZ9LncGZy5kIvnZYBeCt4L1BRKU1SLgK+fXnUDCu2faZBfQzOT3FiX2OxAwc76CWF9j0a X-Received: by 2002:a62:770e:: with SMTP id s14mr7418359pfc.150.1559643357060; Tue, 04 Jun 2019 03:15:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559643357; cv=none; d=google.com; s=arc-20160816; b=YfwRePIB67WqVsZzxiy9T22YBlYGByP6CdE0AZROdeqkkod3Bcgm61y9P1QCwn00Om NjWxYBoz7JUmPBdNy3pGOPUzWlclCVF6TeRVothcikz7rxagL43aObcgulsA8wcVnadt u+Zwpz+DoSAFMIVjAZBgLLYRLwQizoV5IrYWEGbh4XVDnXjlKF9ZYPb5/QyHDljO2XXP 2U/LgdvMzptgkFvJGQnmUFIJmDgDdwFZhZHbFQ9AF0go2ZWgkgFXJff+SuUUAHlY9rBp 1nA55Y08acw7BlnWgfG9UyiQtts4+0tWZBgFhqb7vIoj988ll6r35wSrr/Z4kDXKz0pp LsDg== 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; bh=SRMHg0IpoERvkCvtt+MdEA3HXdaBY06TLuJd2kcOM8E=; b=dZytcEtvg6iBlcQe9SCrddKmsUKt++HeaapM9x8s2/gy9WSfRRhON48ttZu4KsMHwT An92ZuK0BXNKTl4Qg8e2bKOcw0tHqIYjMtyjM1X1f9QR9e5HWkC49s0Jahy3O9uM9py2 o3uVlU6lUmKahgS4Ob73NxGX42apqdnTyIIeaBYFWwn9so7DpH0PXdbRWzi0fnIuhnSI gFdPk0pvwfs/+QjBFPKBmVuJ/5OpO0QjA1WegRMhlEqAorfTcbQ4GEhrD8nSlBchiWVj JSFk/il4EEnvqLqlt789yvUPlr2xEYSaTZvEpuRRobpt/jtaM6QzPi0sT3xsWozFJh99 OPuA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=Wyo7UKxF; 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 s17si1072144pjp.26.2019.06.04.03.15.56; Tue, 04 Jun 2019 03:15:57 -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=Wyo7UKxF; 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 S1727463AbfFDKPz (ORCPT + 30 others); Tue, 4 Jun 2019 06:15:55 -0400 Received: from conuserg-08.nifty.com ([210.131.2.75]:39611 "EHLO conuserg-08.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727110AbfFDKPx (ORCPT ); Tue, 4 Jun 2019 06:15:53 -0400 Received: from localhost.localdomain (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-08.nifty.com with ESMTP id x54AEC7C032511; Tue, 4 Jun 2019 19:14:19 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-08.nifty.com x54AEC7C032511 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1559643260; bh=SRMHg0IpoERvkCvtt+MdEA3HXdaBY06TLuJd2kcOM8E=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Wyo7UKxFMBHIhbSEfEStq4ZJX/1enP0S4yg0HdvkfmfVToQqkqnScLLeq53gQE5za UzQ5PMfKvCiSG09nGjslEwlWkSMIEFXXLSJ2XVkaA/KCeKlXdcaUQb0LX9sINk9K9d nTNG/1tzmggZl/DLljcTWuwokwCiMNjuRD5Ow1PmQ+8l6g9bBNJqwMCV7MbNN5Huvu igtNKOEs1W8tLtM4nwv0rkmmTU35RV9/5OAreKgH9JdSYbIvSrAEFr/dyc8gprIuj5 0z2z1QXGHwKoD06HrTVnjzB1Qt46PdB3HOnk5hIOyCh/cF/MM6PDeKY98tSRB79LBe KyEO295SLSW5Q== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: Randy Dunlap , Arnd Bergmann , David Howells , Sam Ravnborg , Jani Nikula , Masahiro Yamada , Michal Marek , linux-kernel@vger.kernel.org Subject: [PATCH 06/15] kbuild: remove build_unifdef target in scripts/Makefile Date: Tue, 4 Jun 2019 19:14:00 +0900 Message-Id: <20190604101409.2078-7-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190604101409.2078-1-yamada.masahiro@socionext.com> References: <20190604101409.2078-1-yamada.masahiro@socionext.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Since commit 2aedcd098a94 ("kbuild: suppress annoying "... is up to date." message"), if_changed and friends nicely suppress "... is up to date" We do not need per-Makefile tricks. Signed-off-by: Masahiro Yamada --- Makefile | 2 +- scripts/Makefile | 5 ----- 2 files changed, 1 insertion(+), 6 deletions(-) -- 2.17.1 diff --git a/Makefile b/Makefile index ce5a9551860d..e998c40c94b4 100644 --- a/Makefile +++ b/Makefile @@ -1182,7 +1182,7 @@ PHONY += archheaders archscripts PHONY += __headers __headers: $(version_h) scripts_basic uapi-asm-generic archheaders archscripts - $(Q)$(MAKE) $(build)=scripts build_unifdef + $(Q)$(MAKE) $(build)=scripts scripts/unifdef PHONY += headers_install headers_install: __headers diff --git a/scripts/Makefile b/scripts/Makefile index 9d442ee050bd..16bcb8087899 100644 --- a/scripts/Makefile +++ b/scripts/Makefile @@ -31,11 +31,6 @@ always := $(hostprogs-y) $(hostprogs-m) # The following hostprogs-y programs are only build on demand hostprogs-y += unifdef -# These targets are used internally to avoid "is up to date" messages -PHONY += build_unifdef -build_unifdef: $(obj)/unifdef - @: - subdir-$(CONFIG_GCC_PLUGINS) += gcc-plugins subdir-$(CONFIG_MODVERSIONS) += genksyms subdir-$(CONFIG_SECURITY_SELINUX) += selinux From patchwork Tue Jun 4 10:14:01 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 165735 Delivered-To: patch@linaro.org Received: by 2002:a92:9e1a:0:0:0:0:0 with SMTP id q26csp5638487ili; Tue, 4 Jun 2019 03:15:51 -0700 (PDT) X-Google-Smtp-Source: APXvYqyuQIO6kHIkVOYQY4siGkyjXnVjO0j24H7zQjV2Jj2o7Y4aZqik21RQJaoYq1tWnhek9fv1 X-Received: by 2002:a17:902:6a4:: with SMTP id 33mr34858882plh.338.1559643351501; Tue, 04 Jun 2019 03:15:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559643351; cv=none; d=google.com; s=arc-20160816; b=fIis+P+qOl3pCjfYthw3zuGYm/b+JhbIoom17JUhg3NUD7sre092Rgj6CC4lar7wLi SOrobBvHexoCqFDCjGzWnZ9z0L24RTaXeJiBujLt6a685sY6iPWhZ+8B7WM24+SZ7tPS 2fF4EIMfdrR1lLgeBNXxvTHU/K6r+/SWEbceh7Hfe56fLJEgk6pNGwOjR3EEj0cFXRfT w5kXIljxywhKBDaSBn50h1pYnoemTfjDt13NoHdzLcV6RVby319AAImWPHWwVYCAzVTL RikJaa/YeNZFGd3XyOEgemcSGaNwD40jS5372NxJX6g0dxkpjaj+AO9dH7ziwSKEheTb WyEw== 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; bh=H2hb1rFxVd8vHXaptRM3sOd643GclddrQKolqKpXINY=; b=l9h1zWvaC49PFgtr4U2mz73AAaFRrOy6Cl0eG+F+/sjJCou6vm2eORc7cW3AIwJSIT UPvspmDiti+MqEF2rzXdqo+Zrggh3y5VLXWpfBUD28bfWgCEuD9XiqJYjWe9jYBToWvf GqwTjqvGn/KnpYvV3TdrGS8U1SHC3ZVZwyUfXnD0V69lGnhUtFMrSKP1a6PWzQnyiiwr XbIGGzwnh4DnpyDaY8YAn5jX4kZWUScVlWkM1vsNqFQ99CzX4V9y5u3knMEcP8d/v0ok 0twXQxjvbaeg+SWT93Pq4EkDuRvVBMQ35h/81qhNWQa/5qwihhidxyHr8UY1YE3Udsn8 9ORg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=u4rG5ouS; 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 f9si20553848pgv.5.2019.06.04.03.15.51; Tue, 04 Jun 2019 03:15:51 -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=u4rG5ouS; 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 S1727412AbfFDKPu (ORCPT + 30 others); Tue, 4 Jun 2019 06:15:50 -0400 Received: from conuserg-08.nifty.com ([210.131.2.75]:39349 "EHLO conuserg-08.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727110AbfFDKPo (ORCPT ); Tue, 4 Jun 2019 06:15:44 -0400 Received: from localhost.localdomain (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-08.nifty.com with ESMTP id x54AEC7D032511; Tue, 4 Jun 2019 19:14:20 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-08.nifty.com x54AEC7D032511 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1559643261; bh=H2hb1rFxVd8vHXaptRM3sOd643GclddrQKolqKpXINY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=u4rG5ouSgpTeBTdm1t8he1y5hpf62Q1dbSEmqMuyECjosHT0jnx102AWpORD7ktc9 urK7tk8gFJFGuQRa1lWxU4znmjdssG3HWp+B66VehHKcBZa/TahSvw5lJjuJRDNkgQ 0t2pZqguJaCBVXQts45mQ91bR94+TjUM76Wrhnv18O4wY1pWuRImUZg+VorPG0NSY3 wOMAFxmuakQ1z8+7ycZ/0VysAedtHWvqePToWSJC4GXsRy3lo5HKAEfjt9ppze29Xq V+p9ElP1a1KzhFKRlPe5SunFHy/HaV++RPHHz8ihxgMltj5cD5q8TIwacSKGEVRjZf cARg5XJjpS8dQ== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: Randy Dunlap , Arnd Bergmann , David Howells , Sam Ravnborg , Jani Nikula , Masahiro Yamada , Michal Marek , linux-kernel@vger.kernel.org Subject: [PATCH 07/15] kbuild: build all prerequisite of headers_install simultaneously Date: Tue, 4 Jun 2019 19:14:01 +0900 Message-Id: <20190604101409.2078-8-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190604101409.2078-1-yamada.masahiro@socionext.com> References: <20190604101409.2078-1-yamada.masahiro@socionext.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Currently, scripts/unifdef is compiled after scripts_basic, uapi-asm-generic, archheaders, and archscripts. The proper dependency is just scripts_basic. There is no problem to compile scripts/unifdef and other headers at the same time. Split scripts_unifdef out in order to allow more parallel building. Signed-off-by: Masahiro Yamada --- Makefile | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) -- 2.17.1 diff --git a/Makefile b/Makefile index e998c40c94b4..f9c206eb3583 100644 --- a/Makefile +++ b/Makefile @@ -1181,8 +1181,7 @@ export INSTALL_HDR_PATH = $(objtree)/usr PHONY += archheaders archscripts PHONY += __headers -__headers: $(version_h) scripts_basic uapi-asm-generic archheaders archscripts - $(Q)$(MAKE) $(build)=scripts scripts/unifdef +__headers: $(version_h) scripts_unifdef uapi-asm-generic archheaders archscripts PHONY += headers_install headers_install: __headers @@ -1204,6 +1203,10 @@ ifdef CONFIG_HEADERS_CHECK all: headers_check endif +PHONY += scripts_unifdef +scripts_unifdef: scripts_basic + $(Q)$(MAKE) $(build)=scripts scripts/unifdef + # --------------------------------------------------------------------------- # Kernel selftest From patchwork Tue Jun 4 10:14:02 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 165734 Delivered-To: patch@linaro.org Received: by 2002:a92:9e1a:0:0:0:0:0 with SMTP id q26csp5638402ili; Tue, 4 Jun 2019 03:15:46 -0700 (PDT) X-Google-Smtp-Source: APXvYqzhkVPFvriKcvm9gQLcCumsDV1dU67E7NV3QCVcbJKcGnIZtouG0lKq7cZN1+q7ScV5Bsdz X-Received: by 2002:a63:135d:: with SMTP id 29mr33279070pgt.38.1559643346712; Tue, 04 Jun 2019 03:15:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559643346; cv=none; d=google.com; s=arc-20160816; b=jJB6xY1aslI7jknRc3zA18dPWHbkysGDLPMW1ceXthzXYojBNeKwRWvlgbuMProVcA V/lsXBVHXxM9s5COQpXxZPQHegj+wznmV2zZ/2S5rGUKc+8W/vFJuxuhEDEwh8AtOgp6 LVXr7/Z75viY/OQyBn9j02hicka3rzOnRuTSaOCcGuGr/YfrdmIiUwgX29rmFQ9gLKoH iZT8zQ9LniuLxxwdugFyxT8Q+QCkRMI6v0xOD9ocM5hKR41LN7ePoruLfPESNiAsMNR7 HLuPCDfGlrU/j2wmrdJUoviyrRLI7lmvGgCUsGBz9/UUF6DMGk6kHgVx3MG+pXODEm19 dXjw== 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; bh=1qYLsdaaOh9lptJBCcPQlsjlAs8CxWYpA4nc6lxZdy0=; b=aOK2HDovqvywHVFgbl7Qj8Ta5xgE4gAH6zFYC+if8FYamZjVtvpcJHGyuIPYIPyWjK 23XzLZZCsfgtUZb2x0jCWkYuoVOtXj2Gh89agVo2Oxs/bXvqNDYLIHdZXPCmJ+1YvXP6 A+n26Y63GFuQvPWOT/2qqW7OUF5VdOFLZ6rdGrKD27uN4Z4o7rZZf7wq38Uv30j7McA3 GEucT0UhfezskLchJU9d03XAQvYPLk1fyR0xP/rhJmXrjZSpv93EHXs5Fww9Mn0321y0 seNQlDHGx6T1ZYPVdmotOoKiQox0ot80H/ZO3tqtWf03KaQF62WJ6zshFt6SDiTOsWRs jKeQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=WP+kL1o6; 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 d137si21941851pga.23.2019.06.04.03.15.46; Tue, 04 Jun 2019 03:15:46 -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=WP+kL1o6; 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 S1727388AbfFDKPp (ORCPT + 30 others); Tue, 4 Jun 2019 06:15:45 -0400 Received: from conuserg-08.nifty.com ([210.131.2.75]:39357 "EHLO conuserg-08.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727336AbfFDKPo (ORCPT ); Tue, 4 Jun 2019 06:15:44 -0400 Received: from localhost.localdomain (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-08.nifty.com with ESMTP id x54AEC7E032511; Tue, 4 Jun 2019 19:14:21 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-08.nifty.com x54AEC7E032511 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1559643262; bh=1qYLsdaaOh9lptJBCcPQlsjlAs8CxWYpA4nc6lxZdy0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=WP+kL1o6KLR6eFETe6PdkdPiV8pb5yhoTnWyaXk0PG71b5hzFI/EJF8zRif191GPG YnvOUXoxeVtCG9lJtDG75C7S7UWPU0lA799/Qrp2oXCaXsXxE5KeK3/0Ge2gnWgnjL nFFscaV4e3hh79nk7MaOpF7MW5LbeSmRghBEvE/ByZNcgasshq4gY3B5/z3VQTfsW5 7oYMOf3cEpnjidMf2MMoIywJMzFVjEacDXtq+lJren65TP+CydBcUlMy5zY4G7slgU xWkVcNaXEotke21XuCGzhwp//cssCgyH8X8z1BwELwsKzOnVwjE2bczSkm0Rrc39Q5 OHMx6t5Rs+LDQ== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: Randy Dunlap , Arnd Bergmann , David Howells , Sam Ravnborg , Jani Nikula , Masahiro Yamada , Michal Marek , linux-kernel@vger.kernel.org Subject: [PATCH 08/15] kbuild: add 'headers' target to build up ready-to-install uapi headers Date: Tue, 4 Jun 2019 19:14:02 +0900 Message-Id: <20190604101409.2078-9-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190604101409.2078-1-yamada.masahiro@socionext.com> References: <20190604101409.2078-1-yamada.masahiro@socionext.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org In Linux build system, build targets and installation targets are separated. Examples are: - 'make vmlinux' -> 'make install' - 'make modules' -> 'make modules_install' - 'make dtbs' -> 'make dtbs_install' - 'make vdso' -> 'make vdso_install' The intention is to run the build targets under the normal privilege, then the installation targets under the root privilege since we need the write permission to the system directories. We have 'make headers_install" but the corresponding 'make headers' stage does not exist. The purpose of headers_install is to provide the kernel interface to C library. So, nobody would try to install headers to /usr/include directly. If 'sudo make INSTALL_HDR_PATH=/usr/include headers_install' were run, some build artifacts in the kernel tree would be owned by root because some of uapi headers are generated by 'uapi-asm-generic', 'archheaders' targets. Anyway, I believe it makes sense to split the header installation into two stages. [1] 'make headers' Process headers in uapi directories by scripts/headers_install.sh and copy them to usr/include [2] 'make headers_install' Copy '*.h' verbatim from usr/include to $(INSTALL_HDR_PATH)/include For the backward compatibility, 'headers_install' depends on 'headers'. Some samples expect uapi headers in usr/include. So, the 'headers' target is useful to build up them in the fixed location usr/include irrespective of INSTALL_HDR_PATH. Another benefit is to stop polluting the final destination with the time-stamp files '.install' and '.check'. Maybe you can see them in your toolchains. Lastly, my main motivation is to prepare for compile-testing uapi headers. To build something, we have to creating an object and .*.cmd somewhere. The usr/include/ will be the work directory for that. Signed-off-by: Masahiro Yamada --- Makefile | 23 +++++++++++++++-------- lib/Kconfig.debug | 4 +--- scripts/Makefile.headersinst | 8 ++++---- 3 files changed, 20 insertions(+), 15 deletions(-) -- 2.17.1 diff --git a/Makefile b/Makefile index f9c206eb3583..3c172dd516ff 100644 --- a/Makefile +++ b/Makefile @@ -262,7 +262,7 @@ old_version_h := include/linux/version.h clean-targets := %clean mrproper cleandocs no-dot-config-targets := $(clean-targets) \ cscope gtags TAGS tags help% %docs check% coccicheck \ - $(version_h) headers_% archheaders archscripts \ + $(version_h) headers headers_% archheaders archscripts \ %asm-generic kernelversion %src-pkg no-sync-config-targets := $(no-dot-config-targets) install %install \ kernelrelease @@ -1178,25 +1178,32 @@ headerdep: #Default location for installed headers export INSTALL_HDR_PATH = $(objtree)/usr -PHONY += archheaders archscripts - -PHONY += __headers -__headers: $(version_h) scripts_unifdef uapi-asm-generic archheaders archscripts +quiet_cmd_headers_install = INSTALL $(INSTALL_HDR_PATH)/include + cmd_headers_install = \ + mkdir -p $(INSTALL_HDR_PATH); \ + rsync -mrl --include='*/' --include='*\.h' --exclude='*' \ + usr/include $(INSTALL_HDR_PATH) PHONY += headers_install -headers_install: __headers +headers_install: headers + $(call cmd,headers_install) + +PHONY += archheaders archscripts + +PHONY += headers +headers: $(version_h) scripts_unifdef uapi-asm-generic archheaders archscripts $(if $(wildcard $(srctree)/arch/$(SRCARCH)/include/uapi/asm/Kbuild),, \ $(error Headers not exportable for the $(SRCARCH) architecture)) $(Q)$(MAKE) $(hdr-inst)=include/uapi dst=include $(Q)$(MAKE) $(hdr-inst)=arch/$(SRCARCH)/include/uapi dst=include PHONY += headers_check -headers_check: headers_install +headers_check: headers $(Q)$(MAKE) $(hdr-inst)=include/uapi dst=include HDRCHECK=1 $(Q)$(MAKE) $(hdr-inst)=arch/$(SRCARCH)/include/uapi dst=include HDRCHECK=1 ifdef CONFIG_HEADERS_INSTALL -prepare: headers_install +prepare: headers endif ifdef CONFIG_HEADERS_CHECK diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug index 6a6ea4219d1e..0031a31d98c2 100644 --- a/lib/Kconfig.debug +++ b/lib/Kconfig.debug @@ -324,9 +324,7 @@ config HEADERS_CHECK attempt to include files which were not exported, etc. If you're making modifications to header files which are - relevant for userspace, say 'Y', and check the headers - exported to $(INSTALL_HDR_PATH) (usually 'usr/include' in - your build tree), to make sure they're suitable. + relevant for userspace, say 'Y'. config OPTIMIZE_INLINING bool "Allow compiler to uninline functions marked 'inline'" diff --git a/scripts/Makefile.headersinst b/scripts/Makefile.headersinst index 3d1ebaabd1b6..1af6d0b06585 100644 --- a/scripts/Makefile.headersinst +++ b/scripts/Makefile.headersinst @@ -41,7 +41,7 @@ ifeq ($(skip-inst),) kbuild-file := $(srctree)/$(obj)/Kbuild -include $(kbuild-file) -installdir := $(INSTALL_HDR_PATH)/$(dst) +installdir := usr/$(dst) gendir := $(objtree)/$(subst include/,include/generated/,$(obj)) header-files := $(notdir $(wildcard $(srcdir)/*.h)) header-files := $(filter-out $(no-export-headers), $(header-files)) @@ -60,10 +60,10 @@ output-files := $(addprefix $(installdir)/, $(all-files)) oldheaders := $(patsubst $(installdir)/%,%,$(wildcard $(installdir)/*.h)) unwanted := $(filter-out $(all-files),$(oldheaders)) -# Prefix unwanted with full paths to $(INSTALL_HDR_PATH) +# Prefix unwanted with full paths to objtree unwanted-file := $(addprefix $(installdir)/, $(unwanted)) -printdir = $(patsubst $(INSTALL_HDR_PATH)/%/,%,$(dir $@)) +printdir = $(patsubst %/,%,$(dir $@)) quiet_cmd_install = INSTALL $(printdir) ($(words $(all-files))\ file$(if $(word 2, $(all-files)),s)) @@ -81,7 +81,7 @@ quiet_cmd_check = CHECK $(printdir) ($(words $(all-files)) files) cmd_check = for f in $(all-files); do \ echo "$(installdir)/$${f}"; done \ | xargs \ - $(PERL) $< $(INSTALL_HDR_PATH)/include $(SRCARCH); \ + $(PERL) $< usr/include $(SRCARCH); \ touch $@ ifndef HDRCHECK From patchwork Tue Jun 4 10:14:03 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 165739 Delivered-To: patch@linaro.org Received: by 2002:a92:9e1a:0:0:0:0:0 with SMTP id q26csp5638733ili; Tue, 4 Jun 2019 03:16:05 -0700 (PDT) X-Google-Smtp-Source: APXvYqzi9nWRtKpRWr1whcU6d8pOYwxWiXQOqbvDpHODQCyHSrMF27d84eJK7DZ3A93e/l4oawpR X-Received: by 2002:a63:dd05:: with SMTP id t5mr33466078pgg.229.1559643365161; Tue, 04 Jun 2019 03:16:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559643365; cv=none; d=google.com; s=arc-20160816; b=k/f8IhEo8tISvyqdlo/78NNE26JMWulb09ubqSPOmzyoMK9J2zpgZa4Slu9AAXUUr9 9XF5nbtILjHJOLT26fKlX9LR8aWXcNEpp2xWPDBZghAuVuXV+zdrJ9OrcMmlc3NWMqox ZfI8H8Ue1zbHO+j6HvADcxPZ39moHhhrk9P4t+heJwTk+v2kIMQgUtq8l/dYUySNkqsH tt9CSHTwJ3Ytc+TIKGmI9L8jw6xEMswDs7tTXDu1teVOfXT+4EoUCWQHejuhs3PU//SV RnSMZ1PyKjJA8fHT0Pk9BNwQ2c1YF2IJYR0ittjDlPzHiIvDnzFAaknfWcJNZ3y23o6G 1xFg== 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; bh=a2r32HBmfOPNhRHR6NEw2nxMZDcJlmjbZJmpiqemrdE=; b=xv58o0H6SlMv8S9WrQc0ee1uT5XEeqrSw4EKRWvAr9ns5s7OhuLwB8tgqrJRlpj9X3 8gesFdHyYFlFK7EDWhjWhNCPVWwlIYlU3N+SHLfp+ssLoaCpGKrYwagDfJx61X0si+an OqMetSfvpvH3cqDlrQ/eEW5pGKx0yRKIyb/Q66hKHUj4ia4BAkkhYdOpXOleM+2Txqfj TtiAt3/3OF/uxia+7ZVvkn7e73r9E4gf2SEmZA+azw8DT3WKJ9Rpf25wK2inNq63CN9A YHGKqSIF1ohNfkHVdB6w+UrefCpkEVk4E3sYHHVYVfhdeF2hfNi9HEKIZTP3XtCczPcJ ijkg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=QdVNDT7n; 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 g6si22540992pgu.383.2019.06.04.03.16.04; Tue, 04 Jun 2019 03:16: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=QdVNDT7n; 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 S1727516AbfFDKQD (ORCPT + 30 others); Tue, 4 Jun 2019 06:16:03 -0400 Received: from conuserg-08.nifty.com ([210.131.2.75]:39599 "EHLO conuserg-08.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726982AbfFDKPw (ORCPT ); Tue, 4 Jun 2019 06:15:52 -0400 Received: from localhost.localdomain (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-08.nifty.com with ESMTP id x54AEC7F032511; Tue, 4 Jun 2019 19:14:22 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-08.nifty.com x54AEC7F032511 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1559643262; bh=a2r32HBmfOPNhRHR6NEw2nxMZDcJlmjbZJmpiqemrdE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=QdVNDT7nNkg19+Wlfu/K+AI0Yx1lbQ5iZqx1EHQH9hhnpPYpyNa0thqDI9gC9lpOq dQfvsxeZM1ek9Gx2oA+FOAPwvMdu3RaM6Yrndu6jjuaaHxYFb9YOT1TzP2wpTixDkI j4NQHwarh3frbWvnQnze1UHuAngkxC/x5W31OxJhoMPaLiV5YUEjH/EEh/gSBFmHqQ gubwXc2sYP4EytQTMgQ+OtENpBNetfhNJzrYvXxyD8I0n2clhgtoym8n+U2iy18R9n m1nvMFbzERoKuPAeTdDKpCbAE3c+hHMJ8Ir25WfjtUq5aN4Pd48GsCTvAWueXfcUnc 1s+tEih4LeIsQ== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: Randy Dunlap , Arnd Bergmann , David Howells , Sam Ravnborg , Jani Nikula , Masahiro Yamada , Michal Marek , linux-kernel@vger.kernel.org Subject: [PATCH 09/15] kbuild: re-implement Makefile.headersinst without directory descending Date: Tue, 4 Jun 2019 19:14:03 +0900 Message-Id: <20190604101409.2078-10-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190604101409.2078-1-yamada.masahiro@socionext.com> References: <20190604101409.2078-1-yamada.masahiro@socionext.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Since commit fcc8487d477a ("uapi: export all headers under uapi directories"), the headers in uapi directories are all exported by default although exceptional cases are still allowed by the syntax 'no-export-headers'. The traditional directory descending has been still kept (in a somewhat hacky way), but it is no longer needed. Get rid of it to simplify the code. Also, handle files one by one instead of the previous per-directory processing. This will emit much more log, but I like it. Signed-off-by: Masahiro Yamada --- Makefile | 8 +- include/uapi/{linux => }/Kbuild | 6 +- scripts/Makefile.headersinst | 132 +++++++++++++------------------- 3 files changed, 62 insertions(+), 84 deletions(-) rename include/uapi/{linux => }/Kbuild (77%) -- 2.17.1 diff --git a/Makefile b/Makefile index 3c172dd516ff..608af32cc758 100644 --- a/Makefile +++ b/Makefile @@ -1194,13 +1194,13 @@ PHONY += headers headers: $(version_h) scripts_unifdef uapi-asm-generic archheaders archscripts $(if $(wildcard $(srctree)/arch/$(SRCARCH)/include/uapi/asm/Kbuild),, \ $(error Headers not exportable for the $(SRCARCH) architecture)) - $(Q)$(MAKE) $(hdr-inst)=include/uapi dst=include - $(Q)$(MAKE) $(hdr-inst)=arch/$(SRCARCH)/include/uapi dst=include + $(Q)$(MAKE) $(hdr-inst)=include/uapi + $(Q)$(MAKE) $(hdr-inst)=arch/$(SRCARCH)/include/uapi PHONY += headers_check headers_check: headers - $(Q)$(MAKE) $(hdr-inst)=include/uapi dst=include HDRCHECK=1 - $(Q)$(MAKE) $(hdr-inst)=arch/$(SRCARCH)/include/uapi dst=include HDRCHECK=1 + $(Q)$(MAKE) $(hdr-inst)=include/uapi HDRCHECK=1 + $(Q)$(MAKE) $(hdr-inst)=arch/$(SRCARCH)/include/uapi HDRCHECK=1 ifdef CONFIG_HEADERS_INSTALL prepare: headers diff --git a/include/uapi/linux/Kbuild b/include/uapi/Kbuild similarity index 77% rename from include/uapi/linux/Kbuild rename to include/uapi/Kbuild index 34711c5d6968..61ee6e59c930 100644 --- a/include/uapi/linux/Kbuild +++ b/include/uapi/Kbuild @@ -1,14 +1,14 @@ # SPDX-License-Identifier: GPL-2.0 ifeq ($(wildcard $(srctree)/arch/$(SRCARCH)/include/uapi/asm/a.out.h),) -no-export-headers += a.out.h +no-export-headers += linux/a.out.h endif ifeq ($(wildcard $(srctree)/arch/$(SRCARCH)/include/uapi/asm/kvm.h),) -no-export-headers += kvm.h +no-export-headers += linux/kvm.h endif ifeq ($(wildcard $(srctree)/arch/$(SRCARCH)/include/uapi/asm/kvm_para.h),) ifeq ($(wildcard $(objtree)/arch/$(SRCARCH)/include/generated/uapi/asm/kvm_para.h),) -no-export-headers += kvm_para.h +no-export-headers += linux/kvm_para.h endif endif diff --git a/scripts/Makefile.headersinst b/scripts/Makefile.headersinst index 1af6d0b06585..c96c4c26e240 100644 --- a/scripts/Makefile.headersinst +++ b/scripts/Makefile.headersinst @@ -14,109 +14,87 @@ __headers: include scripts/Kbuild.include -srcdir := $(srctree)/$(obj) +src := $(srctree)/$(obj) +gen := $(objtree)/$(subst include/,include/generated/,$(obj)) +dst := usr/include -# When make is run under a fakechroot environment, the function -# $(wildcard $(srcdir)/*/.) doesn't only return directories, but also regular -# files. So, we are using a combination of sort/dir/wildcard which works -# with fakechroot. -subdirs := $(patsubst $(srcdir)/%/,%,\ - $(filter-out $(srcdir)/,\ - $(sort $(dir $(wildcard $(srcdir)/*/))))) +-include $(src)/Kbuild -# Recursion -__headers: $(subdirs) +src-subdirs := $(patsubst $(src)/%/,%,$(wildcard $(src)/*/)) +gen-subdirs := $(patsubst $(gen)/%/,%,$(wildcard $(gen)/*/)) +all-subdirs := $(sort $(src-subdirs) $(gen-subdirs)) -PHONY += $(subdirs) -$(subdirs): - $(Q)$(MAKE) $(hdr-inst)=$(obj)/$@ dst=$(dst)/$@ +src-headers := $(if $(src-subdirs), $(shell cd $(src) && find $(src-subdirs) -name '*.h')) +src-headers := $(filter-out $(no-export-headers), $(src-headers)) +gen-headers := $(if $(gen-subdirs), $(shell cd $(gen) && find $(gen-subdirs) -name '*.h')) +gen-headers := $(filter-out $(no-export-headers), $(gen-headers)) -# Skip header install/check for include/uapi and arch/$(SRCARCH)/include/uapi. -# We have only sub-directories there. -skip-inst := $(if $(filter %/uapi,$(obj)),1) +# If the same header is exported from source and generated directories, +# the former takes precedence, but this should be warned. +duplicated := $(filter $(gen-headers), $(src-headers)) +$(if $(duplicated), $(warning duplicated header export: $(duplicated))) -ifeq ($(skip-inst),) +gen-headers := $(filter-out $(duplicated), $(gen-headers)) -# Kbuild file is optional -kbuild-file := $(srctree)/$(obj)/Kbuild --include $(kbuild-file) +# Add dst path prefix +all-subdirs := $(addprefix $(dst)/, $(all-subdirs)) +src-headers := $(addprefix $(dst)/, $(src-headers)) +gen-headers := $(addprefix $(dst)/, $(gen-headers)) +all-headers := $(src-headers) $(gen-headers) -installdir := usr/$(dst) -gendir := $(objtree)/$(subst include/,include/generated/,$(obj)) -header-files := $(notdir $(wildcard $(srcdir)/*.h)) -header-files := $(filter-out $(no-export-headers), $(header-files)) -genhdr-files := $(notdir $(wildcard $(gendir)/*.h)) -genhdr-files := $(filter-out $(header-files), $(genhdr-files)) +# Work out what needs to be removed +old-subdirs := $(wildcard $(all-subdirs)) +old-headers := $(if $(old-subdirs),$(shell find $(old-subdirs) -name '*.h')) +unwanted := $(filter-out $(all-headers), $(old-headers)) -# files used to track state of install/check -install-file := $(installdir)/.install -check-file := $(installdir)/.check +# Create directories +existing-dirs := $(sort $(dir $(old-headers))) +wanted-dirs := $(sort $(dir $(all-headers))) +new-dirs := $(filter-out $(existing-dirs), $(wanted-dirs)) +$(if $(new-dirs), $(shell mkdir -p $(new-dirs))) -# all headers files for this dir -all-files := $(header-files) $(genhdr-files) -output-files := $(addprefix $(installdir)/, $(all-files)) +# Rules -# Work out what needs to be removed -oldheaders := $(patsubst $(installdir)/%,%,$(wildcard $(installdir)/*.h)) -unwanted := $(filter-out $(all-files),$(oldheaders)) +ifndef HDRCHECK -# Prefix unwanted with full paths to objtree -unwanted-file := $(addprefix $(installdir)/, $(unwanted)) +quiet_cmd_install = HDRINST $@ + cmd_install = $(CONFIG_SHELL) $(srctree)/scripts/headers_install.sh $(@D) $( X-Patchwork-Id: 165742 Delivered-To: patch@linaro.org Received: by 2002:a92:9e1a:0:0:0:0:0 with SMTP id q26csp5639039ili; Tue, 4 Jun 2019 03:16:22 -0700 (PDT) X-Google-Smtp-Source: APXvYqwCO8qUH33l3nXjqNQKFIYl6/UrVzCEZ5+7duyZXi79naifDBSTmz3RvSSkkG88AEQpYrUE X-Received: by 2002:a62:62c1:: with SMTP id w184mr36751382pfb.95.1559643382878; Tue, 04 Jun 2019 03:16:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559643382; cv=none; d=google.com; s=arc-20160816; b=roA0j9li/2VkcZFHQh9Hvqi2ffGZk2htJ2y3/ytTzL2q/k2RuuanV/cj2w5iyylsST plIk5pTux8QsGKHNM7Wb+F8vg7nCpLiwbRGGTnRXJugd76UAT37IGbvc0d0CtzibXoY6 zL8tJaeQ4Gqui2YR5IAO01vzm6t9lJOpOv5AGZ1/NcqXtDI6+yxMrXm6CUzkrXphFxtH bYYUGKjb74KKcW84QGkDGpeGbb7hQE5/D1tqGmpiYcZnXAsRM+6/CS3PdEsIch4eLI4H htVvpbbyQsg6J89J9oIJvXS/lyrpYXLx9hd3tQFi7q8BOYzSl/PDesXtJuVdDoF9adWu aF5g== 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; bh=VGjPFxsP6kBrwBDYVWYAlv4U8kztKdxrIjkfmrPtJXg=; b=DiE4wa8wcVwnHISkhUR5qzcQpQ8t2RAxgZB2Q2wwK9iEsLtgO0+StQy49z5B35Wzve deUULSycxBWOfNM/YKxEqHp1dL9VKXuDsRP/F1adkNqcdacl0atzlLvKUFtqPzTAD7l+ 6YIHI80bIPIJT120SZ4rDNeObyY0XWPCm1zqgO6yRbhZyAzXU3YZ0n0xBRWrYg123wvw HAmCxRlpyzeaA6N92eO8t1W/ECCSC7BGIf6lzycKqqS1qS30o16vkCCmrNpBhcWlW0ee 9sM/nJPvDJ1S99+UL189UA7YtuUCjGLf74noQYLkKp+MTWlP9Y2f256Tb5YTd1o3wWCW 2Pvg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=mPNAsiSf; 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 d34si22456362pla.214.2019.06.04.03.16.22; Tue, 04 Jun 2019 03:16:22 -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=mPNAsiSf; 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 S1727531AbfFDKQV (ORCPT + 30 others); Tue, 4 Jun 2019 06:16:21 -0400 Received: from conuserg-08.nifty.com ([210.131.2.75]:39165 "EHLO conuserg-08.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727061AbfFDKPi (ORCPT ); Tue, 4 Jun 2019 06:15:38 -0400 Received: from localhost.localdomain (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-08.nifty.com with ESMTP id x54AEC7G032511; Tue, 4 Jun 2019 19:14:23 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-08.nifty.com x54AEC7G032511 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1559643263; bh=VGjPFxsP6kBrwBDYVWYAlv4U8kztKdxrIjkfmrPtJXg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=mPNAsiSfLq57iHEV9xRwWBflUZfrT8ykBp+GDWZIAjQVsJRkpidrYn5NkG9tdx0QX Z4wnRAsDdssWbfEuF/grcOod8QKRBuz5qp1MRl7V8lCPEHVjH0BEs56PXqBZutxt5e 66MwUD6gQ2OAu5/QtgktevdXDj9X4ST08oq01DRS3BK5Uqyv01nWs5TZQZJyahCJQb 0S0lRIy9WXxWAiPFrpoLLjQYe4L5LJOnXmbdbrwESnQQLXqqCx7keYmlD/Hx9UCqoL 2S3L71IWhirlHqf21BD7bSeBFGx/i+0MNV5ytyZJkEEdhnVzQW4tJQ2TG34DraNtat m8IRGhxixPBmQ== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: Randy Dunlap , Arnd Bergmann , David Howells , Sam Ravnborg , Jani Nikula , Masahiro Yamada , Michal Marek , linux-kernel@vger.kernel.org Subject: [PATCH 10/15] kbuild: move hdr-inst shorthand to top Makefile Date: Tue, 4 Jun 2019 19:14:04 +0900 Message-Id: <20190604101409.2078-11-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190604101409.2078-1-yamada.masahiro@socionext.com> References: <20190604101409.2078-1-yamada.masahiro@socionext.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Now that hdr-inst is used only in the top Makefile, move it there from scripts/Kbuild.include. Signed-off-by: Masahiro Yamada --- Makefile | 2 ++ scripts/Kbuild.include | 6 ------ 2 files changed, 2 insertions(+), 6 deletions(-) -- 2.17.1 diff --git a/Makefile b/Makefile index 608af32cc758..48bac02fb72d 100644 --- a/Makefile +++ b/Makefile @@ -1190,6 +1190,8 @@ headers_install: headers PHONY += archheaders archscripts +hdr-inst := -f $(srctree)/scripts/Makefile.headersinst obj + PHONY += headers headers: $(version_h) scripts_unifdef uapi-asm-generic archheaders archscripts $(if $(wildcard $(srctree)/arch/$(SRCARCH)/include/uapi/asm/Kbuild),, \ diff --git a/scripts/Kbuild.include b/scripts/Kbuild.include index f12e81eeb89b..9ae4493d5bcd 100644 --- a/scripts/Kbuild.include +++ b/scripts/Kbuild.include @@ -180,12 +180,6 @@ dtbinst := -f $(srctree)/scripts/Makefile.dtbinst obj # $(Q)$(MAKE) $(clean)=dir clean := -f $(srctree)/scripts/Makefile.clean obj -### -# Shorthand for $(Q)$(MAKE) -f scripts/Makefile.headersinst obj= -# Usage: -# $(Q)$(MAKE) $(hdr-inst)=dir -hdr-inst := -f $(srctree)/scripts/Makefile.headersinst obj - # echo command. # Short version is used, if $(quiet) equals `quiet_', otherwise full one. echo-cmd = $(if $($(quiet)cmd_$(1)),\ From patchwork Tue Jun 4 10:14:05 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 165732 Delivered-To: patch@linaro.org Received: by 2002:a92:9e1a:0:0:0:0:0 with SMTP id q26csp5638347ili; Tue, 4 Jun 2019 03:15:42 -0700 (PDT) X-Google-Smtp-Source: APXvYqxNqABUBmwCHWqOcJZQsGXqCXvpyPNiMWtVCgiOvYnPcEsUVGmciadENA3bdKP/6j+XxufI X-Received: by 2002:a17:902:b495:: with SMTP id y21mr35047796plr.243.1559643341972; Tue, 04 Jun 2019 03:15:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559643341; cv=none; d=google.com; s=arc-20160816; b=hK4nQpeSRhwRRl3G2Z5GWXeNE4Qhca4LZ13E9UtIOsMX1hcoFb3v+/KMuPW1AAHU5f baIm+RdPvId7v5OmNGkbuqKlbgGJc3OUiYV3YT8NeMhQd/7vkK11EYC/6+2KBT23ewzT SjsCG2qF5JjpyH0xnYWCjaxoYRNDQ114WktlxmBXkE2WzZNrLIbHhKbfFFtXEj86o9Zl wcxUqD85XEAuaCDkRC4X+zLkZdUnsajwjkRrzbOVpQETYXTXC/vaxf1gV/iiY2e4zFwL 8/YkoYUxoWl3tZPJ/k5uVwIKEkaVsb+sqID7kOApcIThNGRWnD9kdyHeRSPGYr2QuY9Q KFoA== 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; bh=ZW8oJHHCyujAucqOHf5owysxupf7VvOq0sufCbzCWAs=; b=tMOr3sMYwWPnBIrkTfbSgy90w16janyRtN7GgZV9FsixvqFlS4rqf4wcjRolhu0MQb 3GjXDHlt7PrkG5qzjBrsQJczV6GujF5PKrH2842HzvviD5tKBH5zza6C4eNNtP0UKIFH O6ckLZXBMVpPXzsUDXYHoH/epm916H7ST1MW1DEU0dtc0Me1SAPdb2SU/yWIMEG4Kjq3 jxnF+AjkyQafRMAZrqirdmL4nC0k6Fh7N23rAlu+vspCtnTNJE5EwnSV3pnu08sTrjl1 NBrC2GoV4iu4/BPNhWKPoV5wSYhhnXKXl83AgO6u/ZXouMW4WDZkCz7tHadkfzRjWLpx W0bQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=bbpYgPT7; 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 h1si23704034pld.439.2019.06.04.03.15.41; Tue, 04 Jun 2019 03:15:41 -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=bbpYgPT7; 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 S1727335AbfFDKPk (ORCPT + 30 others); Tue, 4 Jun 2019 06:15:40 -0400 Received: from conuserg-08.nifty.com ([210.131.2.75]:39195 "EHLO conuserg-08.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727110AbfFDKPk (ORCPT ); Tue, 4 Jun 2019 06:15:40 -0400 Received: from localhost.localdomain (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-08.nifty.com with ESMTP id x54AEC7H032511; Tue, 4 Jun 2019 19:14:24 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-08.nifty.com x54AEC7H032511 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1559643264; bh=ZW8oJHHCyujAucqOHf5owysxupf7VvOq0sufCbzCWAs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=bbpYgPT74iM32GjIo997UUOMQ9vWoTSw0PoW8PZguSq4D/k4Va2cIhN41x4E1gqUs TyHDXxYIBw3dMAdm680pEiOiWDdi6V3+qS1+xCwR+mYrtpQrppDU92JOzHssuABdV0 8mI/ysv69ZyRQoCZtdqeDFvHMnBRtjSyz0CEj9KWEc8CFZZsiCK2IaIF0WcZ9m1BYs Gfn2gx5QOX8qnqhtGKPXgyJ0Em7H+AT95vylOg8HAVkgjXLsWsUcFTi/1GHlvJbMEb sygylFj+vTiTtZQCbfEOTVMKaf73xjlVnE2MPUQc7Ya5gm+lnZpVvPPXR2OsvZBYaj ittJ4YlSEshHw== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: Randy Dunlap , Arnd Bergmann , David Howells , Sam Ravnborg , Jani Nikula , Masahiro Yamada , Michal Marek , linux-kernel@vger.kernel.org Subject: [PATCH 11/15] kbuild: simplify scripts/headers_install.sh Date: Tue, 4 Jun 2019 19:14:05 +0900 Message-Id: <20190604101409.2078-12-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190604101409.2078-1-yamada.masahiro@socionext.com> References: <20190604101409.2078-1-yamada.masahiro@socionext.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Now that headers_install.sh is invoked per file, remove the for-loop in the shell script. Signed-off-by: Masahiro Yamada --- scripts/Makefile.headersinst | 2 +- scripts/headers_install.sh | 48 +++++++++++++++--------------------- 2 files changed, 21 insertions(+), 29 deletions(-) -- 2.17.1 diff --git a/scripts/Makefile.headersinst b/scripts/Makefile.headersinst index c96c4c26e240..d2b572a7a628 100644 --- a/scripts/Makefile.headersinst +++ b/scripts/Makefile.headersinst @@ -58,7 +58,7 @@ $(if $(new-dirs), $(shell mkdir -p $(new-dirs))) ifndef HDRCHECK quiet_cmd_install = HDRINST $@ - cmd_install = $(CONFIG_SHELL) $(srctree)/scripts/headers_install.sh $(@D) $(@@ + s/(^|[^a-zA-Z0-9])__packed([^a-zA-Z0-9_]|$)/\1__attribute__((packed))\2/g + s/(^|[[:space:](])(inline|asm|volatile)([[:space:](]|$)/\1__\2__\3/g + s@#(ifndef|define|endif[[:space:]]*/[*])[[:space:]]*_UAPI@#\1 @ +' $INFILE > $TMPFILE || exit 1 -FILE= -trap 'rm -f "$OUTDIR/$FILE" "$OUTDIR/$FILE.sed"' EXIT -for i in "$@" -do - FILE="$(basename "$i")" - sed -E \ - -e 's/([[:space:](])(__user|__force|__iomem)[[:space:]]/\1/g' \ - -e 's/__attribute_const__([[:space:]]|$)/\1/g' \ - -e 's@^#include @@' \ - -e 's/(^|[^a-zA-Z0-9])__packed([^a-zA-Z0-9_]|$)/\1__attribute__((packed))\2/g' \ - -e 's/(^|[[:space:](])(inline|asm|volatile)([[:space:](]|$)/\1__\2__\3/g' \ - -e 's@#(ifndef|define|endif[[:space:]]*/[*])[[:space:]]*_UAPI@#\1 @' \ - "$SRCDIR/$i" > "$OUTDIR/$FILE.sed" || exit 1 - scripts/unifdef -U__KERNEL__ -D__EXPORTED_HEADERS__ "$OUTDIR/$FILE.sed" \ - > "$OUTDIR/$FILE" - [ $? -gt 1 ] && exit 1 - rm -f "$OUTDIR/$FILE.sed" -done +scripts/unifdef -U__KERNEL__ -D__EXPORTED_HEADERS__ $TMPFILE > $OUTFILE +[ $? -gt 1 ] && exit 1 + +rm -f $TMPFILE trap - EXIT From patchwork Tue Jun 4 10:14:06 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 165731 Delivered-To: patch@linaro.org Received: by 2002:a92:9e1a:0:0:0:0:0 with SMTP id q26csp5638324ili; Tue, 4 Jun 2019 03:15:41 -0700 (PDT) X-Google-Smtp-Source: APXvYqz4dzioGQJHEGFxT/mcauRwcDIyAWidoYPKrdqlWBoQes4joo8x8VuSJA2ycKEbyGFWc0Op X-Received: by 2002:a17:902:e591:: with SMTP id cl17mr423445plb.59.1559643341316; Tue, 04 Jun 2019 03:15:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559643341; cv=none; d=google.com; s=arc-20160816; b=gdWhCk8jKkOO+TQcJgoENpflvJrvsLdPjgCQwqWdM25HDw8JoJit+YcfIz4tDyqqqC 9IS6KWIF9QdyxmdeClTcsXpU6C6sOboaiu+x9XRVq7yuYlnc0Qxld0gzr3Gjwt01uk+P uAZObUVypkEurAdLDzX0bObrd8wTsOhH+Nyh5pxnogmx0Pki6pRz+5DgEuN96EXsRYBb uVzJIwNq3IEtLJaLiGUrL+DBLPQBrxIQvIh9XexcCipv9rslk95nfgyb/IFL9mZDjqTX SQaAirCzK0eIe6AhlH+DqQyz4yxGehV+kUsoY1JGJuvSzH/b+LXje1Vibg7FLbxM3EUK Ykcg== 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; bh=PpZBMxg4bzgoXAd/8YiPn6tt8q7c+h3C7+mX9vii/zs=; b=WHdTHenL2QauVFC6kST49XFzevHF0Rcs4E9GxqBcDnZSHyVvM0WWZerXPHaRXyLqEi rHwUDBtsKlG3+KbCYfm0bfKmaBnGkbf10akSjZamA9ciaxf2cUM/ce0UtW3NfMODZM3g eRgIiD/8d+g1QG2CRKWOveEQLbUmexX3xneem5CV/KNjRP085MCc+Z+0k5srpk5KDQOv Cw6yjesV191jG7MuOFHwqa9An058WojeMWsQcorU+LVAMe2TM3okIYK950y47Z/3JWg3 SXA5Se/DzVYgkF2d2mJW0rtnEqWP7Z0ZPfQJsnHoU6NUCda+XshM4xqcjeeg6s7uQrp/ BcsA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=gCSIv1QP; 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 g17si21260403pgi.569.2019.06.04.03.15.40; Tue, 04 Jun 2019 03:15:41 -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=gCSIv1QP; 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 S1727306AbfFDKPj (ORCPT + 30 others); Tue, 4 Jun 2019 06:15:39 -0400 Received: from conuserg-08.nifty.com ([210.131.2.75]:39189 "EHLO conuserg-08.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727107AbfFDKPj (ORCPT ); Tue, 4 Jun 2019 06:15:39 -0400 Received: from localhost.localdomain (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-08.nifty.com with ESMTP id x54AEC7I032511; Tue, 4 Jun 2019 19:14:24 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-08.nifty.com x54AEC7I032511 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1559643265; bh=PpZBMxg4bzgoXAd/8YiPn6tt8q7c+h3C7+mX9vii/zs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=gCSIv1QPdcRJ6xQilbXbvoLZr6xt90IOw0qoumntl15OKD2jRyvNLwoG/RvooA59G flhdZjogSeqZ2Ca9ZJnfoz2j1/9CcYv0RAgmP2e84uL+3tCg6ZcLHNgp1Rrrnm7yGd m5BKXDqli36feukDrAYpvuLIkKT012GanppJ/E833lTAY1/VKoWkxgrpeIXrLH71Ev 67Vok6y5uFUNN4S/55QLFP3OGBmYGfZ0Zikq5CN1HC4eMD+iVJGDJHYsalGxZTVGBC 0qCaxPdmkiJQIpnoZvNyXrxPCkSxJTq4WrQjMyzoZ7v6G2Dz0P6Jj9YB8DbfIJ96jz deNDGwsF1dZ+g== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: Randy Dunlap , Arnd Bergmann , David Howells , Sam Ravnborg , Jani Nikula , Masahiro Yamada , Michal Marek , linux-kernel@vger.kernel.org Subject: [PATCH 12/15] kbuild: deb-pkg: do not run headers_check Date: Tue, 4 Jun 2019 19:14:06 +0900 Message-Id: <20190604101409.2078-13-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190604101409.2078-1-yamada.masahiro@socionext.com> References: <20190604101409.2078-1-yamada.masahiro@socionext.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org It is absolutely fine to add extra sanity checks in package scripts, but it is not necessary to do so. This is already covered by the daily compile-testing (0day bot etc.) because headers_check is run as a part of the normal build process when CONFIG_HEADERS_CHECK=y. Replace it with the newly-added "make headers". Signed-off-by: Masahiro Yamada --- scripts/package/builddeb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.17.1 diff --git a/scripts/package/builddeb b/scripts/package/builddeb index b03dd56a4782..e8ca6dc97e96 100755 --- a/scripts/package/builddeb +++ b/scripts/package/builddeb @@ -130,7 +130,7 @@ if is_enabled CONFIG_MODULES; then fi if [ "$ARCH" != "um" ]; then - $MAKE -f $srctree/Makefile headers_check + $MAKE -f $srctree/Makefile headers $MAKE -f $srctree/Makefile headers_install INSTALL_HDR_PATH="$libc_headers_dir/usr" fi From patchwork Tue Jun 4 10:14:07 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 165738 Delivered-To: patch@linaro.org Received: by 2002:a92:9e1a:0:0:0:0:0 with SMTP id q26csp5638661ili; Tue, 4 Jun 2019 03:16:01 -0700 (PDT) X-Google-Smtp-Source: APXvYqyun8TtktZxNnGiVBHaVLbBS757d/unagP/UYxS/g5dtKwqM2TwGvMRt6eh8Qdq3VcYA5ve X-Received: by 2002:a17:90a:9a8a:: with SMTP id e10mr35793467pjp.109.1559643361126; Tue, 04 Jun 2019 03:16:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559643361; cv=none; d=google.com; s=arc-20160816; b=ZF4KeuRgNi4lSEMi0qoUbaz6+OXGIW9OvaJAlfIhuxf3bbdpPB5rRzByulplB8WsHc gnRvJdQ1q02GMpTQTdUNS1drsZmN0mFtrA1qz1dPxStKyhVXCMvF1Q31Pk5tN8LC2HIK z816dnXrnOHR5ohzpA9P8Z9rJAa4aiEV06wHR+HAPLFsSezWQ7R3AfNjvIJ5eSJYcAeE bkeCt1wtp57FczkIS/9hekLZSReg+HS6duUZvvvQy5auWtFrvQYTqtxAugDjNstLgwY6 OlYsw9s8Z88g2Fjvin574GsZu6Jr32cF88BoWtw2ywZUk82JS0IQ0PAcAGe6f+lYKCyv C5ow== 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; bh=BnyOCSyE+CGMxDknrCFwRpFRPhO2lG/Y/shoIrbI5AY=; b=YlyL4wLrJNubA6ph6nG/P24mEfvGCdpOZWRbPDq9qcOhCFcqV0NMKBaweqUCzr7XcZ nSq8VanZ40G45Ubh5aieb7ZTJb3iLtXGWP5g5yg1OxiOe8kpMIwJqvYbZSFM4uK6jDYD VsHYMQGi+pKW01xlUuiH10hEr+oltUnDJl0A0sL4awUU+eO2O+MmihbSL3ObNf/7/fdE z92Y4KjJJBzfNhc+/KafPr/blfK5/dUcj+DgfvZxADxaLQzgp+cHQaTnukFdcljhbjQg Enptphde5dac9MJpj9BGI1mkQYO67hs2M2BrkcsWAftvXGGr3M/AficOMYz+ntFE7qjG BGXg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b="Z5/reEbe"; 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 s17si1072144pjp.26.2019.06.04.03.16.00; Tue, 04 Jun 2019 03:16:01 -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="Z5/reEbe"; 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 S1727509AbfFDKQA (ORCPT + 30 others); Tue, 4 Jun 2019 06:16:00 -0400 Received: from conuserg-08.nifty.com ([210.131.2.75]:39732 "EHLO conuserg-08.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727110AbfFDKP6 (ORCPT ); Tue, 4 Jun 2019 06:15:58 -0400 Received: from localhost.localdomain (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-08.nifty.com with ESMTP id x54AEC7J032511; Tue, 4 Jun 2019 19:14:25 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-08.nifty.com x54AEC7J032511 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1559643266; bh=BnyOCSyE+CGMxDknrCFwRpFRPhO2lG/Y/shoIrbI5AY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Z5/reEbeHi70KbQtAaW59xxuhoN5CJ6vi0zTzUweFozO6GDDLJBeAGOt0HbBxdGYs kmnBi+G4qTPRlpvorbsKGV4myGYjxSVZF9yHS55WzeKcH13aYk9/cS2UuOW+A6U6aZ /f5GshStK0NXon6uCqj3GinWBcgr25RsSNDCWQXKlTBZ97N9mxffeQvL3rd5WoLYGa izMngyoSmA5ZkdN3JvlFeOHitJlzQ4eiTJeUUasTdqPNdfAWGSchXUCFEgU0oUZFlM SZ9cV3kw61ijSECWdmpFdOLvbCYuVlhModjQaNe7WJUU+jGrifFNh4HnHvf6H1lo40 4S3RsAwPlADag== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: Randy Dunlap , Arnd Bergmann , David Howells , Sam Ravnborg , Jani Nikula , Chris Wilson , Masahiro Yamada , Michal Marek , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, Jonathan Corbet Subject: [PATCH 13/15] kbuild: add support for ensuring headers are self-contained Date: Tue, 4 Jun 2019 19:14:07 +0900 Message-Id: <20190604101409.2078-14-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190604101409.2078-1-yamada.masahiro@socionext.com> References: <20190604101409.2078-1-yamada.masahiro@socionext.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Jani Nikula Sometimes it's useful to be able to explicitly ensure certain headers remain self-contained, i.e. that they are compilable as standalone units, by including and/or forward declaring everything they depend on. Add special target header-test-y where individual Makefiles can add headers to be tested if CONFIG_HEADER_TEST is enabled. This will generate a dummy C file per header that gets built as part of extra-y. Cc: Chris Wilson Cc: Masahiro Yamada Cc: Michal Marek Signed-off-by: Jani Nikula Signed-off-by: Masahiro Yamada --- Documentation/kbuild/makefiles.txt | 7 +++++++ init/Kconfig | 9 +++++++++ scripts/Makefile.build | 10 ++++++++++ scripts/Makefile.lib | 3 +++ 4 files changed, 29 insertions(+) -- 2.17.1 Reviewed-by: Sam Ravnborg diff --git a/Documentation/kbuild/makefiles.txt b/Documentation/kbuild/makefiles.txt index bac301a73a86..ca4b24ec0399 100644 --- a/Documentation/kbuild/makefiles.txt +++ b/Documentation/kbuild/makefiles.txt @@ -1018,6 +1018,13 @@ When kbuild executes, the following steps are followed (roughly): In this example, extra-y is used to list object files that shall be built, but shall not be linked as part of built-in.a. + header-test-y + + header-test-y specifies headers (*.h) in the current directory that + should be compile tested to ensure they are self-contained, + i.e. compilable as standalone units. If CONFIG_HEADER_TEST is enabled, + this autogenerates dummy sources to include the headers, and builds them + as part of extra-y. --- 6.7 Commands useful for building a boot image diff --git a/init/Kconfig b/init/Kconfig index 36894c9fb420..02d8897b91fb 100644 --- a/init/Kconfig +++ b/init/Kconfig @@ -96,6 +96,15 @@ config COMPILE_TEST here. If you are a user/distributor, say N here to exclude useless drivers to be distributed. +config HEADER_TEST + bool "Compile test headers that should be standalone compilable" + help + Compile test headers listed in header-test-y target to ensure they are + self-contained, i.e. compilable as standalone units. + + If you are a developer or tester and want to ensure the requested + headers are self-contained, say Y here. Otherwise, choose N. + config LOCALVERSION string "Local version - append to kernel release" help diff --git a/scripts/Makefile.build b/scripts/Makefile.build index ae9cf740633e..2b4d56483c2e 100644 --- a/scripts/Makefile.build +++ b/scripts/Makefile.build @@ -294,6 +294,16 @@ quiet_cmd_cc_lst_c = MKLST $@ $(obj)/%.lst: $(src)/%.c FORCE $(call if_changed_dep,cc_lst_c) +# Dummy C sources for header test (header-test-y target) +# --------------------------------------------------------------------------- + +quiet_cmd_header_test = HDRTEST $@ + cmd_header_test = echo "\#include \"$( $@ + +# FIXME: would be nice to be able to limit this implicit rule to header-test-y +$(obj)/%.header_test.c: $(src)/%.h FORCE + $(call if_changed,header_test) + # Compile assembler sources (.S) # --------------------------------------------------------------------------- diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib index f1f38c8cdc74..60a739a22b9c 100644 --- a/scripts/Makefile.lib +++ b/scripts/Makefile.lib @@ -66,6 +66,9 @@ extra-y += $(patsubst %.dtb,%.dt.yaml, $(dtb-y)) extra-$(CONFIG_OF_ALL_DTBS) += $(patsubst %.dtb,%.dt.yaml, $(dtb-)) endif +# Test self-contained headers +extra-$(CONFIG_HEADER_TEST) += $(patsubst %.h,%.header_test.o,$(header-test-y)) + # Add subdir path extra-y := $(addprefix $(obj)/,$(extra-y)) From patchwork Tue Jun 4 10:14:08 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 165741 Delivered-To: patch@linaro.org Received: by 2002:a92:9e1a:0:0:0:0:0 with SMTP id q26csp5638980ili; Tue, 4 Jun 2019 03:16:19 -0700 (PDT) X-Google-Smtp-Source: APXvYqwmbWDlMZhj8rcWvDYutmIYD2UAzokjnhKMdnaW0Mwe5PBUkYye9JBePbRKrdOlFtRsRQqz X-Received: by 2002:a17:90a:1541:: with SMTP id y1mr728486pja.88.1559643379531; Tue, 04 Jun 2019 03:16:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559643379; cv=none; d=google.com; s=arc-20160816; b=OQP65C9cb1Oo4VzJ9ojEY6brS2KONYGYL/DeXWoSYMQrNcXONkFfSZMBx/GMsYtHS6 T1S9DIzoMyliWRuEyhLcun+m+dMfKS/Wh9svc9PnVbY1jAxKtWJ+1fG3zhtkqFM+ikrm fKjZqpFgsngFbzn6xsLndi6XgumJR5gvIoL8CcwW7FVIAU5V/NGN1rnQD4H+3VBuDGlE LdFKeI/nnD8Y4/uc+oNH+1s2uqKm9jxtsg0aqPc9hPWVncpMoebZjY9BhydSSA78aZOz w8AZ9y5ves5caXELVtf6d+fubhc+RTSLnvFpY04hlhZBiwkTMJcVmquPcUBes1wRD4BN naKg== 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; bh=LSUJNxijHUvxY1rUpeDqChsQP6kLQbdVLxrgaFhk53Y=; b=rvJeycdP/Jh9KodoUfm/b8xkfRVFJXRcvVia2niLBGB4l9s3RbbYM6ngeAyFpu5oGu LUWXRvjuQPkaaBqYEl9TLAdaCh9dYHiSsGIAdFGS9iVSNap7UoqaCoD6Rvmgv+9SC6NH velLgN5ABvXHw2XMGHPopJIPAdxwFKhRMVxOjii/hSRZsVaKO+bEShAwe4lMWgZmGYNE hVwy3WQnYS6XWQl2oMxBptjq+pQmiMO59kJChMGUDUbSLmS5buqMCI1S/O3skX3QCjKi twSNCviOWGC/xe/+pGPB6jfNhDNVX2sR4J65Di/TPIpNYIDrqHp5740Hx5x85lhPCpPx dtYg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=LAwtFKf2; 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 l27si19859934pgm.172.2019.06.04.03.16.19; Tue, 04 Jun 2019 03:16: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=LAwtFKf2; 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 S1727258AbfFDKPj (ORCPT + 30 others); Tue, 4 Jun 2019 06:15:39 -0400 Received: from conuserg-08.nifty.com ([210.131.2.75]:39190 "EHLO conuserg-08.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727085AbfFDKPi (ORCPT ); Tue, 4 Jun 2019 06:15:38 -0400 Received: from localhost.localdomain (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-08.nifty.com with ESMTP id x54AEC7K032511; Tue, 4 Jun 2019 19:14:26 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-08.nifty.com x54AEC7K032511 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1559643267; bh=LSUJNxijHUvxY1rUpeDqChsQP6kLQbdVLxrgaFhk53Y=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=LAwtFKf2wIw6tMpPoEnHS5RkStUORb0Z3gAA8ZbTb+V88FeU8cv88xStQPNue6h+/ OKqB2KOIaWtFJVVwM+XH+1poPrmHPvEhSSVL64aR0FEAjqIpEIUi5s9yjsXrWEpGnj qO4KjeafCKeZLvlmM6qJBYUQL9bS5ht8nC02ZrPT/RQ8mPP1BVc06RHEGwfVI+ue4j rxsvZeYr0BaXPIlbGxKWpskliA+8MCD5xBXj61OAqPIgTPJ6f5QyvjzBv93/ZNdwyH 7QFsTlFeo0uhbM3zg/0x+64Qoqfphszli/KbT9BhjKBnjg7HLh6ihcNcanikBMUTAC 6J7CTEB97kYPQ== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: Randy Dunlap , Arnd Bergmann , David Howells , Sam Ravnborg , Jani Nikula , Masahiro Yamada , Michal Marek , linux-kernel@vger.kernel.org Subject: [PATCH 14/15] fixup: kbuild: add support for ensuring headers are self-contained Date: Tue, 4 Jun 2019 19:14:08 +0900 Message-Id: <20190604101409.2078-15-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190604101409.2078-1-yamada.masahiro@socionext.com> References: <20190604101409.2078-1-yamada.masahiro@socionext.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This is needed to avoid regeneration of header-test C files. This will go away when Jani send v2. Signed-off-by: Masahiro Yamada --- scripts/Makefile.build | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) -- 2.17.1 diff --git a/scripts/Makefile.build b/scripts/Makefile.build index 2b4d56483c2e..067e98628664 100644 --- a/scripts/Makefile.build +++ b/scripts/Makefile.build @@ -298,10 +298,9 @@ $(obj)/%.lst: $(src)/%.c FORCE # --------------------------------------------------------------------------- quiet_cmd_header_test = HDRTEST $@ - cmd_header_test = echo "\#include \"$( $@ + cmd_header_test = echo "\#include \"$*.h\"" > $@ -# FIXME: would be nice to be able to limit this implicit rule to header-test-y -$(obj)/%.header_test.c: $(src)/%.h FORCE +$(obj)/%.header_test.c: $(call if_changed,header_test) # Compile assembler sources (.S) From patchwork Tue Jun 4 10:14:09 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 165744 Delivered-To: patch@linaro.org Received: by 2002:a92:9e1a:0:0:0:0:0 with SMTP id q26csp5639710ili; Tue, 4 Jun 2019 03:16:59 -0700 (PDT) X-Google-Smtp-Source: APXvYqwZJ012uxJhKcwKoaGfYsdBV8YHvkbZqbxOC+g+zDNkiJXne3brxI2J9pxZvFWpRZf1HxEo X-Received: by 2002:a17:902:8d92:: with SMTP id v18mr12075727plo.211.1559643418927; Tue, 04 Jun 2019 03:16:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1559643418; cv=none; d=google.com; s=arc-20160816; b=lc/aqoKVP8RbKgu9YoAw2g74sIovStWzx3moqgQyL8LDLYBblpY8KWjonD7EqVsGNM W1yxiOdFJTcog+m1zrPHIr3BL5hT+82R44qFTkKkA20/e/BYh2BugnEurqd4VdFW5KlT IdhlwWW9Nb6Lwm8+WiD6dt+KKPyIGfPPuw6+HV4md07JUOfGwdBmhRusZll5rpx9hF9+ Zv8vHMB/zaRk+6W1eQqEvX8aQiMJ4pGoF3b+QU4Fs6ANoKohs8579eEMbjJdi+7DgvIR Oq1ia9zwZDZmG5AkX17bg6dKKjk+JoXdkMEbjlgRACocv88BOlZ9+FG08d4fvgK+ZuDT buEA== 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; bh=89f4NG7T3lIJUXbh+crgcBM9ot/TW/l/GBiNZdH3IcE=; b=GvHMiEimnnSqOi7woaPY7ss2VA99WIz0UiUzlwiy6sAkKqrhCKuoxPAAs3cTBCW1/i 8ydo6xBwtUhRPQyoTjqr8sZCdoii3cPBbUpyyxWCp0sykPZhOUY2O1zaW3SeEwHYFtqY 8hr9vIRKqpIOLQop6TUTv6MGImTHbY3Se6KF/GIJjMh6J2UuwQXgTX2gzvwfMZpR+pX+ 14htDAmuoP+TMyvrjA7TbgSLDmU2SAHYEX2Q4wXC4xrq1mPNQHjHhKcIsUaI2dhc+wOW 4u/3OHYBy5XE0UPm9xIQPMNysmm4Vm3ExYYuQtgp3VVdaAl5elJ2Tb4o0mGOTNE4VSWz zgIQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=B7YyTeOI; 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 m4si22824019pjn.67.2019.06.04.03.16.58; Tue, 04 Jun 2019 03:16:58 -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=B7YyTeOI; 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 S1727457AbfFDKQ6 (ORCPT + 30 others); Tue, 4 Jun 2019 06:16:58 -0400 Received: from conuserg-08.nifty.com ([210.131.2.75]:41277 "EHLO conuserg-08.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727061AbfFDKQ5 (ORCPT ); Tue, 4 Jun 2019 06:16:57 -0400 Received: from localhost.localdomain (p14092-ipngnfx01kyoto.kyoto.ocn.ne.jp [153.142.97.92]) (authenticated) by conuserg-08.nifty.com with ESMTP id x54AEC7L032511; Tue, 4 Jun 2019 19:14:27 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-08.nifty.com x54AEC7L032511 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1559643268; bh=89f4NG7T3lIJUXbh+crgcBM9ot/TW/l/GBiNZdH3IcE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=B7YyTeOIkyiLbhjHLtqXLb1VWv2GjQYy5cTgkr8C8U/cyucPCS5tXvbLRRzUzJ6TE ziZe0sTaCI7+AxfD4MJh54gQr0L1AJ9WvpLuV36i+x53I9JXcPBPn6xdvR2dHK9sML qN05UgT7qHP1pTja6UhXNVyhMW7EtydbRoefYU98Pxmufa5LHg6DmGwKMpHVw/LZeo NqkT9Opk4Tm0y8mmDzNavtG4fIOGm8Jcj2d55/G7CYHnGI/2KymFZgUTQCOWVome3q +O5FFmRsXenLxnlozqVJcD5GQPFx2xNzow+Ov8ya3wThpyW5MD5etP34fHH+iOnJbP iI8KUO3jj3lDg== X-Nifty-SrcIP: [153.142.97.92] From: Masahiro Yamada To: linux-kbuild@vger.kernel.org Cc: Randy Dunlap , Arnd Bergmann , David Howells , Sam Ravnborg , Jani Nikula , Masahiro Yamada , Song Liu , Alexei Starovoitov , netdev@vger.kernel.org, Yonghong Song , linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org, Michal Marek , Martin KaFai Lau , Palmer Dabbelt , bpf@vger.kernel.org, Daniel Borkmann , Albert Ou Subject: [PATCH 15/15] kbuild: compile test UAPI headers to ensure they are self-contained Date: Tue, 4 Jun 2019 19:14:09 +0900 Message-Id: <20190604101409.2078-16-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190604101409.2078-1-yamada.masahiro@socionext.com> References: <20190604101409.2078-1-yamada.masahiro@socionext.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Multiple people have suggested compile-testing UAPI headers to ensure they can be really included from user-space. "make headers_check" is obviously not enough to catch bugs, and we often leak references to kernel-space definition to user-space. The most recent patch I know is David Howells' work: https://patchwork.kernel.org/patch/10590203/ While I agree that we should do this, we must consider how it can be integrated cleanly. That is why it has not been supported in the mainline yet. The idea that has been in my mind is to compile every UAPI header so that it can be included without relying on any include order. Please note usr/include/ is built with a completely different set of compiler flags. The header search path is set to $(objtree)/usr/include since UAPI headers should not include unexported headers. We use -std=gnu89 for the kernel space since the kernel code highly depends on GNU extensions. On the other hand, UAPI headers should be written in somewhat strict C, so they are compiled with -std=c89. This will catch C++ style comments, the keyword 'inline', etc. ('__inline__' should be used instead). There is additional compiler requirement for building under usr/include. because many of UAPI headers include , , , etc. directly or indirectly. You can use kernel.org prebuilt toolchains for building the kernel (https://mirrors.edge.kernel.org/pub/tools/crosstool/index.html) but they do not provide etc. If you want to compile test UAPI headers, you need to use full-featured compilers, which are usually provided by distributions. I added scripts/cc-system-headers.sh to check if necessary system headers are available, which CONFIG_UAPI_HEADER_TEST depends on. For now, a lot of headers need to be excluded because they cannot be compiled standalone, but this is a good start point. Signed-off-by: Masahiro Yamada --- Makefile | 2 +- init/Kconfig | 11 +++ scripts/cc-system-headers.sh | 8 +++ usr/.gitignore | 1 - usr/Makefile | 2 + usr/include/.gitignore | 3 + usr/include/Makefile | 132 +++++++++++++++++++++++++++++++++++ 7 files changed, 157 insertions(+), 2 deletions(-) create mode 100755 scripts/cc-system-headers.sh create mode 100644 usr/include/.gitignore create mode 100644 usr/include/Makefile -- 2.17.1 diff --git a/Makefile b/Makefile index 48bac02fb72d..0d54b073c415 100644 --- a/Makefile +++ b/Makefile @@ -1363,7 +1363,7 @@ CLEAN_DIRS += $(MODVERDIR) include/ksym CLEAN_FILES += modules.builtin.modinfo # Directories & files removed with 'make mrproper' -MRPROPER_DIRS += include/config usr/include include/generated \ +MRPROPER_DIRS += include/config include/generated \ arch/$(SRCARCH)/include/generated .tmp_objdiff MRPROPER_FILES += .config .config.old .version \ Module.symvers tags TAGS cscope* GPATH GTAGS GRTAGS GSYMS \ diff --git a/init/Kconfig b/init/Kconfig index 02d8897b91fb..9a26f0e7e3fb 100644 --- a/init/Kconfig +++ b/init/Kconfig @@ -105,6 +105,17 @@ config HEADER_TEST If you are a developer or tester and want to ensure the requested headers are self-contained, say Y here. Otherwise, choose N. +config UAPI_HEADER_TEST + bool "Compile test UAPI headers" + depends on HEADER_TEST && HEADERS_INSTALL + depends on $(success,$(srctree)/scripts/cc-system-headers.sh $(CC)) + help + Compile test headers exported to user-space to ensure they are + self-contained, i.e. compilable as standalone units. + + If you are a developer or tester and want to ensure the UAPI + headers are self-contained, say Y here. Otherwise, choose N. + config LOCALVERSION string "Local version - append to kernel release" help diff --git a/scripts/cc-system-headers.sh b/scripts/cc-system-headers.sh new file mode 100755 index 000000000000..1b3db369828c --- /dev/null +++ b/scripts/cc-system-headers.sh @@ -0,0 +1,8 @@ +#!/bin/sh +# SPDX-License-Identifier: GPL-2.0-only + +cat << "END" | $@ -E -x c - -o /dev/null >/dev/null 2>&1 +#include +#include +#include +END diff --git a/usr/.gitignore b/usr/.gitignore index 8e48117a3f3d..be5eae1df7eb 100644 --- a/usr/.gitignore +++ b/usr/.gitignore @@ -7,4 +7,3 @@ initramfs_data.cpio.gz initramfs_data.cpio.bz2 initramfs_data.cpio.lzma initramfs_list -include diff --git a/usr/Makefile b/usr/Makefile index 4a70ae43c9cb..6a89eb019275 100644 --- a/usr/Makefile +++ b/usr/Makefile @@ -56,3 +56,5 @@ $(deps_initramfs): klibcdirs $(obj)/$(datafile_y): $(obj)/gen_init_cpio $(deps_initramfs) klibcdirs $(Q)$(initramfs) -l $(ramfs-input) > $(obj)/$(datafile_d_y) $(call if_changed,initfs) + +subdir-$(CONFIG_UAPI_HEADER_TEST) += include diff --git a/usr/include/.gitignore b/usr/include/.gitignore new file mode 100644 index 000000000000..a0991ff4402b --- /dev/null +++ b/usr/include/.gitignore @@ -0,0 +1,3 @@ +* +!.gitignore +!Makefile diff --git a/usr/include/Makefile b/usr/include/Makefile new file mode 100644 index 000000000000..8cba20ba4edb --- /dev/null +++ b/usr/include/Makefile @@ -0,0 +1,132 @@ +# SPDX-License-Identifier: GPL-2.0-only + +# Unlike the kernel space, uapi headers are written in more strict C. +# - Forbid C++ style comments +# - Use '__inline', '__asm__' instead of 'inline', 'asm' +# +# -std=c90 (equivalent to -ansi) catches the violation of those. +# We cannot go as far as adding -Wpedantic since it emits too many warnings. +# +# REVISIT: re-consider the proper set of compiler flags for uapi compile-test. + +UAPI_CFLAGS := -std=c90 -Wall -Werror=implicit-function-declaration + +override c_flags = $(UAPI_CFLAGS) -Wp,-MD,$(depfile) -I$(objtree)/usr/include + +# We want to compile as many headers as possible. We collect all headers +# by using the wildcard, then filter-out some later. +all-uapi-headers = $(shell cd $(obj) && find * -name '*.h') + +# asm-generic/*.h is used by asm/*.h, and should not be included directly +no-header-test += asm-generic/%.h + +# The following are excluded for now just because they fail to build. +# The cause of errors are mostly missing include directives. +# Check one by one, and send a patch to each subsystem. +# +# Do not add a new header to the list without legitimate reason. +# Please consider to fix the header first. +no-header-test += asm/ipcbuf.h +no-header-test += asm/msgbuf.h +no-header-test += asm/sembuf.h +no-header-test += asm/shmbuf.h +no-header-test += asm/signal.h +no-header-test += asm/ucontext.h +no-header-test += drm/vmwgfx_drm.h +no-header-test += linux/am437x-vpfe.h +no-header-test += linux/android/binderfs.h +no-header-test += linux/android/binder.h +no-header-test += linux/coda.h +no-header-test += linux/coda_psdev.h +no-header-test += linux/dvb/audio.h +no-header-test += linux/dvb/osd.h +no-header-test += linux/elfcore.h +no-header-test += linux/errqueue.h +no-header-test += linux/fsmap.h +no-header-test += linux/hdlc/ioctl.h +no-header-test += linux/jffs2.h +no-header-test += linux/kexec.h +no-header-test += linux/matroxfb.h +no-header-test += linux/netfilter_bridge/ebtables.h +no-header-test += linux/netfilter_ipv4/ipt_LOG.h +no-header-test += linux/netfilter_ipv6/ip6t_LOG.h +no-header-test += linux/nfc.h +no-header-test += linux/nilfs2_ondisk.h +no-header-test += linux/omap3isp.h +no-header-test += linux/omapfb.h +no-header-test += linux/patchkey.h +no-header-test += linux/phonet.h +no-header-test += linux/reiserfs_xattr.h +no-header-test += linux/scc.h +no-header-test += linux/sctp.h +no-header-test += linux/signal.h +no-header-test += linux/sysctl.h +no-header-test += linux/usb/audio.h +no-header-test += linux/ivtv.h +no-header-test += linux/v4l2-mediabus.h +no-header-test += linux/v4l2-subdev.h +no-header-test += linux/videodev2.h +no-header-test += linux/vm_sockets.h +no-header-test += misc/ocxl.h +no-header-test += scsi/scsi_bsg_fc.h +no-header-test += scsi/scsi_netlink_fc.h +no-header-test += scsi/scsi_netlink.h +no-header-test += sound/asequencer.h +no-header-test += sound/asound.h +no-header-test += sound/asoc.h +no-header-test += sound/compress_offload.h +no-header-test += sound/emu10k1.h +no-header-test += sound/sfnt_info.h +no-header-test += sound/sof/eq.h +no-header-test += sound/sof/fw.h +no-header-test += sound/sof/header.h +no-header-test += sound/sof/manifest.h +no-header-test += sound/sof/trace.h +no-header-test += xen/evtchn.h +no-header-test += xen/gntdev.h +no-header-test += xen/privcmd.h + +# more headers are broken in some architectures + +ifeq ($(SRCARCH),arc) +no-header-test += linux/bpf_perf_event.h +endif + +ifeq ($(SRCARCH),ia64) +no-header-test += asm/setup.h +no-header-test += asm/sigcontext.h +no-header-test += asm/perfmon.h +no-header-test += asm/perfmon_default_smpl.h +no-header-test += linux/if_bonding.h +endif + +ifeq ($(SRCARCH),mips) +no-header-test += asm/stat.h +endif + +ifeq ($(SRCARCH),powerpc) +no-header-test += asm/stat.h +no-header-test += linux/bpf_perf_event.h +endif + +ifeq ($(SRCARCH),riscv) +no-header-test += linux/bpf_perf_event.h +endif + +ifeq ($(SRCARCH),s390) +no-header-test += asm/runtime_instr.h +no-header-test += asm/zcrypt.h +endif + +ifeq ($(SRCARCH),sparc) +no-header-test += asm/stat.h +no-header-test += asm/uctx.h +no-header-test += asm/fbio.h +no-header-test += asm/openpromio.h +endif + +# Use '=' instead of ':=' to avoid $(shell ...) evaluation when cleaning +header-test-y = $(filter-out $(no-header-test), $(all-uapi-headers)) + +# Use '=' instead of ':=' to avoid $(shell ...) evaluation when building +clean-dirs = $(shell cd $(obj) 2>/dev/null && find * -maxdepth 0 -type d)