From 033dba2ec06c47a9fe1b190bc3281058fb20738d Mon Sep 17 00:00:00 2001 From: Masahiro Yamada Date: Sun, 10 Dec 2017 01:02:29 +0900 Subject: kbuild: prepare to remove C files pre-generated by flex and bison In Linux build system convention, pre-generated files are version- controlled with a "_shipped" suffix. During the kernel building, they are simply shipped (copied) removing the suffix. This approach can reduce external tool dependency for the kernel build, but it is tedious to manually regenerate such artifacts from developers' point of view. (We need to do "make REGENERATE_PARSERS=1" every time we touch real source files such as *.l, *.y) Some months ago, I sent out RFC patches to run flex, bison, and gperf during the build. In the review and test, Linus noticed gperf-3.1 had changed the lookup function prototype. Then, the use of gperf in kernel was entirely removed by commit bb3290d91695 ("Remove gperf usage from toolchain"). This time, I tested several versions of flex and bison, and I was not hit by any compatibility issue except a flaw in flex-2.6.3; if you generate lexer for dtc and genksyms with flex-2.6.3, you will see "yywrap redefined" warning. This was not intentional, but a bug, fixed by flex-2.6.4. Otherwise, both flex and bison look fairly stable for a long time. This commit prepares some build rules to remove the _shipped files. Also, document minimal requirement for flex and bison. Rationale for the minimal version: The -Wmissing-prototypes option of GCC warns "no previous prototype" for lexers generated by flex-2.5.34 or older, so I chose 2.5.35 as the required version for flex. Flex-2.5.35 was released in 2008. Bison looks more stable. I did not see any problem with bison-2.0, released in 2004. I did not test bison-1.x, but bison-2.0 should be old enough. Tested flex versions: 2.5.35 2.5.36 2.5.37 2.5.39 2.6.0 2.6.1 2.6.2 2.6.3 (*) 2.6.4 (*) flex-2.6.3 causes "yywrap redefined" warning Tested bison versions: 2.0 2.1 2.2 2.3 2.4 2.4.1 2.5.1 2.6 2.6.1 2.6.2 2.6.3 2.6.4 2.6.5 2.7 2.7.1 3.0 3.0.1 3.0.2 3.0.3 3.0.4 Signed-off-by: Masahiro Yamada --- Documentation/process/changes.rst | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) (limited to 'Documentation') diff --git a/Documentation/process/changes.rst b/Documentation/process/changes.rst index 560beaef5a7c..81cdb528ad46 100644 --- a/Documentation/process/changes.rst +++ b/Documentation/process/changes.rst @@ -32,6 +32,8 @@ you probably needn't concern yourself with isdn4k-utils. GNU C 3.2 gcc --version GNU make 3.81 make --version binutils 2.20 ld -v +flex 2.5.35 flex --version +bison 2.0 bison --version util-linux 2.10o fdformat --version module-init-tools 0.9.10 depmod -V e2fsprogs 1.41.4 e2fsck -V @@ -79,6 +81,19 @@ The build system has, as of 4.13, switched to using thin archives (`ar T`) rather than incremental linking (`ld -r`) for built-in.o intermediate steps. This requires binutils 2.20 or newer. +Flex +---- + +Since Linux 4.16, the build system generates lexical analyzers +during build. This requires flex 2.5.35 or later. + + +Bison +----- + +Since Linux 4.16, the build system generates parsers +during build. This requires bison 2.0 or later. + Perl ---- @@ -333,6 +348,16 @@ Binutils - +Flex +---- + +- + +Bison +----- + +- + OpenSSL ------- -- cgit 1.4.1 From cedd55d49dee941d0e4fabb2f2f555d50c53fad7 Mon Sep 17 00:00:00 2001 From: Marc Herbert Date: Fri, 26 Jan 2018 14:59:00 -0800 Subject: kconfig: Remove silentoldconfig from help and docs; fix kconfig/conf's help As explained by Michal Marek at https://lkml.org/lkml/2011/8/31/189 silentoldconfig has become a misnomer. It has become an internal interface so remove it from "make help" and Documentation/ to stop confusing people using it as seen for instance at https://chromium-review.googlesource.com/835632 Don't remove it from kconfig/Makefile yet not to break any (other) tool using it. On the other hand, correct and expand its description in the help of the (internal) scripts/kconfig/conf.c Signed-off-by: Marc Herbert Signed-off-by: Masahiro Yamada --- Documentation/admin-guide/README.rst | 5 ----- scripts/kconfig/Makefile | 7 ++++--- scripts/kconfig/conf.c | 5 +++-- 3 files changed, 7 insertions(+), 10 deletions(-) (limited to 'Documentation') diff --git a/Documentation/admin-guide/README.rst b/Documentation/admin-guide/README.rst index 63066db39910..af5a437198d0 100644 --- a/Documentation/admin-guide/README.rst +++ b/Documentation/admin-guide/README.rst @@ -170,11 +170,6 @@ Configuring the kernel your existing ./.config file and asking about new config symbols. - "make silentoldconfig" - Like above, but avoids cluttering the screen - with questions already answered. - Additionally updates the dependencies. - "make olddefconfig" Like above, but sets new symbols to their default values without prompting. diff --git a/scripts/kconfig/Makefile b/scripts/kconfig/Makefile index a5ab2f7909de..cb3ec53a7c29 100644 --- a/scripts/kconfig/Makefile +++ b/scripts/kconfig/Makefile @@ -34,6 +34,8 @@ config: $(obj)/conf nconfig: $(obj)/nconf $< $(silent) $(Kconfig) +# This has become an internal implementation detail and is now deprecated +# for external use. silentoldconfig: $(obj)/conf $(Q)mkdir -p include/config include/generated $(Q)test -e include/generated/autoksyms.h || \ @@ -144,7 +146,6 @@ help: @echo ' oldconfig - Update current config utilising a provided .config as base' @echo ' localmodconfig - Update current config disabling modules not loaded' @echo ' localyesconfig - Update current config converting local mods to core' - @echo ' silentoldconfig - Same as oldconfig, but quietly, additionally update deps' @echo ' defconfig - New config with default from ARCH supplied defconfig' @echo ' savedefconfig - Save current config as ./defconfig (minimal config)' @echo ' allnoconfig - New config where all options are answered with no' @@ -153,8 +154,8 @@ help: @echo ' alldefconfig - New config with all symbols set to default' @echo ' randconfig - New config with random answer to all options' @echo ' listnewconfig - List new options' - @echo ' olddefconfig - Same as silentoldconfig but sets new symbols to their' - @echo ' default value' + @echo ' olddefconfig - Same as oldconfig but sets new symbols to their' + @echo ' default value without prompting' @echo ' kvmconfig - Enable additional options for kvm guest kernel support' @echo ' xenconfig - Enable additional options for xen dom0 and guest kernel support' @echo ' tinyconfig - Configure the tiniest possible kernel' diff --git a/scripts/kconfig/conf.c b/scripts/kconfig/conf.c index a8a97efd3dfc..307bc3f7b945 100644 --- a/scripts/kconfig/conf.c +++ b/scripts/kconfig/conf.c @@ -484,8 +484,9 @@ static void conf_usage(const char *progname) printf(" --listnewconfig List new options\n"); printf(" --oldaskconfig Start a new configuration using a line-oriented program\n"); printf(" --oldconfig Update a configuration using a provided .config as base\n"); - printf(" --silentoldconfig Same as oldconfig, but quietly, additionally update deps\n"); - printf(" --olddefconfig Same as silentoldconfig but sets new symbols to their default value\n"); + printf(" --silentoldconfig Similar to oldconfig but generates configuration in\n" + " include/{generated/,config/} (oldconfig used to be more verbose)\n"); + printf(" --olddefconfig Same as oldconfig but sets new symbols to their default value\n"); printf(" --oldnoconfig An alias of olddefconfig\n"); printf(" --defconfig New config with default defined in \n"); printf(" --savedefconfig Save the minimal current configuration to \n"); -- cgit 1.4.1