From patchwork Sat Aug 19 08:49:34 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Masahiro Yamada X-Patchwork-Id: 110449 Delivered-To: patch@linaro.org Received: by 10.140.95.78 with SMTP id h72csp1915205qge; Sat, 19 Aug 2017 01:52:47 -0700 (PDT) X-Received: by 10.84.134.34 with SMTP id 31mr12224761plg.57.1503132767524; Sat, 19 Aug 2017 01:52:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1503132767; cv=none; d=google.com; s=arc-20160816; b=TgCk5uvYoiP8QcfuyBSF7P7oUZxl2VjFmOBaQycJ02/eAFRUVmJgihd2MSWufeKjum 36xHS9+IFZkFbEvs4LYPM2y0P0idummzZPWdO5uZxG8t2TlwkWItQ7i5QMLRbKva+7hC +++ghvFM7Fzb9yufqm84FhY9DLSe3nx4gELpnfVvSX54wpTP4IN2OmtLt3o5jXTA6vtv O6W+qiEbow85VY1BKNnd8yHx/6Lp6HjtA0w7A/pC+z+v9buYWY9dXtjNssWlSC4Snp92 O6JHxI30SKWCT8VDD1t5yUs5yKgc9HsiZh3zKPW3N7b5tJmKBRcEvobrXufD/4HEIkTK HRZQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:dkim-filter:arc-authentication-results; bh=1dXC8Gn6+Vaa/VPp3sWB0MguMZ3r7lbwub9Yb/mWZIA=; b=Vq9bDrqWKzMO36sZ2vnNtDziB07G4uarR5jwX0WYrGyVxasmmFcWtFqFCZEMFYSZbU awtLrTcn4/prTsyR5qaNTqtrDfjJkJ0U8VdJCx1j1bmJdKHTqOct2sKH/f1h0NTa55jk CfYn4eSz7k/I99AfEkoVivzyA9C1pNV4H2e7mvpBy5Nsd0GIBmyk4LTNzHbQB3J0W5n9 ZjlQANUGgh+l3r9lbRttrGHB+rQOIyp/CCu67GICbSdLF+XABvNbLOc3VBU9ir3VTSiy NPBw/tzhCiMEYBZWIItKmB92TYI/Yhbd6ZiM+V2lc1gqecdQztOl90+BD6E5mK6fSShO 25pg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=xrWsBN1H; 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 e8si5197127plk.206.2017.08.19.01.52.47; Sat, 19 Aug 2017 01:52:47 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@nifty.com header.s=dec2015msa header.b=xrWsBN1H; 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 S1751787AbdHSIwm (ORCPT + 26 others); Sat, 19 Aug 2017 04:52:42 -0400 Received: from conuserg-08.nifty.com ([210.131.2.75]:49320 "EHLO conuserg-08.nifty.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751707AbdHSIwd (ORCPT ); Sat, 19 Aug 2017 04:52:33 -0400 Received: from grover.sesame (FL1-122-131-185-176.osk.mesh.ad.jp [122.131.185.176]) (authenticated) by conuserg-08.nifty.com with ESMTP id v7J8nmnQ018395; Sat, 19 Aug 2017 17:49:48 +0900 DKIM-Filter: OpenDKIM Filter v2.10.3 conuserg-08.nifty.com v7J8nmnQ018395 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nifty.com; s=dec2015msa; t=1503132590; bh=1dXC8Gn6+Vaa/VPp3sWB0MguMZ3r7lbwub9Yb/mWZIA=; h=From:To:Cc:Subject:Date:From; b=xrWsBN1HXtSN6u+hxaDAjN3k8hRyTcASrC4/Ho4CqdOfxat6/EvDM2Dj17lBVbMkL zPQM9xnMQzoB2DIAvmbEOZR9Am/Y5hvAYiE45xIDh6ZYB6DxirXbIojqOswgQiED6i HuokWp4H3p4vbEfOSmveaz7re/HhwPHIFhhzuOy4YJtcIo44Ffy3Dauvep0C2Fc2ml qZgZsd2yp13fPBho0MeO2Rmcdmw8pPTklJBCz3QLqY9pqmd1s6+LOjNkVJmYCeKcib DrjdY9tYDz0OvOBzJoDGNgUvbWL7HNXnfodtSqaubUDyd1blv6SrGRXArhKEDTsE7K FTlcqQuQrGkuQ== X-Nifty-SrcIP: [122.131.185.176] From: Masahiro Yamada To: Sam Ravnborg , Michal Marek , Linus Torvalds , linux-kbuild@vger.kernel.org Cc: devicetree@vger.kernel.org, Rob Herring , Jonathan Corbet , Richard Purdie , Greg Kroah-Hartman , Andrew Morton , Masahiro Yamada , Mauro Carvalho Chehab , Nicholas Piggin , linux-doc@vger.kernel.org, Markus Heiser , linux-kernel@vger.kernel.org, Frank Rowand , Rob Herring , SeongJae Park , "Yann E. MORIN" Subject: [RFC PATCH 0/3] kbuild: generate intermediate C files instead of copying _shipped files Date: Sat, 19 Aug 2017 17:49:34 +0900 Message-Id: <1503132577-24423-1-git-send-email-yamada.masahiro@socionext.com> X-Mailer: git-send-email 2.7.4 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org In Linux build system convention, we do not run tools such as flex, bison, gperf during the kernel building. Instead, manage generated C files in the repository with _shipped suffixes. They are simply shipped (copied) removing the _shipped suffixes during the kernel building. Commit 7373f4f83c71 ("kbuild: add implicit rules for parser generation") added a mechanism to regenerate intermediate C files easily. The build rules are surrounded with ifdef REGENERATE_PARSERS. So, we need to pass REGENERATE_PARSERS=1 from the command line when we want to update them. Here is one question. Is it acceptable to use those rules all the time? That is, generate those C files by flex, bison, gperf during the kernel building. This means, the build system depends on more external tools. >From the users' point of view, they will need to install flex, bison, gperf in order to build the kernel. >From the developers' point of view, the advantage is we do not need to version-control generated files, i.e. _shipped files will be deleted. I'd like to know if this is acceptable or not. For example, currently some files are simply shipped (copied) when building the kconfig program. $ make mrproper; make defconfig HOSTCC scripts/basic/fixdep HOSTCC scripts/kconfig/conf.o SHIPPED scripts/kconfig/zconf.tab.c SHIPPED scripts/kconfig/zconf.lex.c SHIPPED scripts/kconfig/zconf.hash.c HOSTCC scripts/kconfig/zconf.tab.o HOSTLD scripts/kconfig/conf *** Default configuration is based on 'x86_64_defconfig' # # configuration written to .config # With this series, they are created from *real* sources (*.y, *.l, *.gperf files). $ make mrproper; make defconfig HOSTCC scripts/basic/fixdep HOSTCC scripts/kconfig/conf.o YACC scripts/kconfig/zconf.tab.c LEX scripts/kconfig/zconf.lex.c GPERF scripts/kconfig/zconf.hash.c HOSTCC scripts/kconfig/zconf.tab.o HOSTLD scripts/kconfig/conf *** Default configuration is based on 'x86_64_defconfig' # # configuration written to .config # Note: The tool versions in Documentation/process/changes.rst are just place-holders for now. We need to figure out the minimal versions if we like to switch to this approach. Masahiro Yamada (3): kbuild: generate *.hash.c during build kbuild: generate *.lex.c during build kbuild: generate *.tab.c and *.tab.h during build Documentation/process/changes.rst | 36 + scripts/Makefile.lib | 26 +- scripts/dtc/Makefile | 6 +- scripts/dtc/dtc-lexer.lex.c_shipped | 2259 --------------------------- scripts/dtc/dtc-parser.tab.c_shipped | 2303 ---------------------------- scripts/dtc/dtc-parser.tab.h_shipped | 125 -- scripts/genksyms/Makefile | 4 +- scripts/genksyms/keywords.hash.c_shipped | 230 --- scripts/genksyms/lex.lex.c_shipped | 2291 --------------------------- scripts/genksyms/parse.tab.c_shipped | 2394 ----------------------------- scripts/genksyms/parse.tab.h_shipped | 119 -- scripts/kconfig/Makefile | 1 + scripts/kconfig/zconf.hash.c_shipped | 297 ---- scripts/kconfig/zconf.lex.c_shipped | 2473 ------------------------------ scripts/kconfig/zconf.tab.c_shipped | 2471 ----------------------------- 15 files changed, 53 insertions(+), 14982 deletions(-) delete mode 100644 scripts/dtc/dtc-lexer.lex.c_shipped delete mode 100644 scripts/dtc/dtc-parser.tab.c_shipped delete mode 100644 scripts/dtc/dtc-parser.tab.h_shipped delete mode 100644 scripts/genksyms/keywords.hash.c_shipped delete mode 100644 scripts/genksyms/lex.lex.c_shipped delete mode 100644 scripts/genksyms/parse.tab.c_shipped delete mode 100644 scripts/genksyms/parse.tab.h_shipped delete mode 100644 scripts/kconfig/zconf.hash.c_shipped delete mode 100644 scripts/kconfig/zconf.lex.c_shipped delete mode 100644 scripts/kconfig/zconf.tab.c_shipped -- 2.7.4