|
Revision tags: v6.15, v6.15-rc7, v6.15-rc6, v6.15-rc5, v6.15-rc4, v6.15-rc3, v6.15-rc2, v6.15-rc1, v6.14, v6.14-rc7, v6.14-rc6, v6.14-rc5, v6.14-rc4, v6.14-rc3, v6.14-rc2, v6.14-rc1, v6.13, v6.13-rc7, v6.13-rc6, v6.13-rc5, v6.13-rc4, v6.13-rc3, v6.13-rc2, v6.13-rc1, v6.12, v6.12-rc7, v6.12-rc6, v6.12-rc5, v6.12-rc4, v6.12-rc3, v6.12-rc2, v6.12-rc1, v6.11, v6.11-rc7, v6.11-rc6, v6.11-rc5, v6.11-rc4 |
|
| #
a9d83d74 |
| 12-Aug-2024 |
Masahiro Yamada <[email protected]> |
kbuild: split x*alloc() functions in kconfig to scripts/include/xalloc.h
These functions will be useful for other host programs.
Signed-off-by: Masahiro Yamada <[email protected]>
|
|
Revision tags: v6.11-rc3, v6.11-rc2, v6.11-rc1 |
|
| #
fbaf242c |
| 20-Jul-2024 |
Masahiro Yamada <[email protected]> |
kbuild: move some helper headers from scripts/kconfig/ to scripts/include/
Move array_size.h, hashtable.h, list.h, list_types.h from scripts/kconfig/ to scripts/include/.
These headers will be usef
kbuild: move some helper headers from scripts/kconfig/ to scripts/include/
Move array_size.h, hashtable.h, list.h, list_types.h from scripts/kconfig/ to scripts/include/.
These headers will be useful for other host programs.
Remove scripts/mod/list.h.
Signed-off-by: Masahiro Yamada <[email protected]>
show more ...
|
|
Revision tags: v6.10, v6.10-rc7, v6.10-rc6, v6.10-rc5, v6.10-rc4, v6.10-rc3, v6.10-rc2, v6.10-rc1, v6.9, v6.9-rc7, v6.9-rc6, v6.9-rc5, v6.9-rc4, v6.9-rc3, v6.9-rc2, v6.9-rc1, v6.8, v6.8-rc7, v6.8-rc6, v6.8-rc5, v6.8-rc4, v6.8-rc3 |
|
| #
a6dac400 |
| 02-Feb-2024 |
Masahiro Yamada <[email protected]> |
kconfig: move ARRAY_SIZE to a header
To use ARRAY_SIZE from other files, move it to its own header, just like include/linux/array_size.h.
Signed-off-by: Masahiro Yamada <[email protected]>
|
| #
4ff7ceae |
| 02-Feb-2024 |
Masahiro Yamada <[email protected]> |
kconfig: replace remaining current_file->name with cur_filename
Replace the remaining current_file->name in the lexer context.
Signed-off-by: Masahiro Yamada <[email protected]>
|
| #
d3d16228 |
| 02-Feb-2024 |
Masahiro Yamada <[email protected]> |
kconfig: split preprocessor prototypes into preprocess.h
These are needed only for the parse stage. Move the prototypes into a separate header to make sure they are not used after that.
Signed-off-
kconfig: split preprocessor prototypes into preprocess.h
These are needed only for the parse stage. Move the prototypes into a separate header to make sure they are not used after that.
Signed-off-by: Masahiro Yamada <[email protected]>
show more ...
|
| #
56e634b0 |
| 02-Feb-2024 |
Masahiro Yamada <[email protected]> |
kconfig: call env_write_dep() right after yyparse()
This allows preprocess.c to free up all of its resources when the parse stage is finished. It also ensures conf_write_autoconf_cmd() produces cons
kconfig: call env_write_dep() right after yyparse()
This allows preprocess.c to free up all of its resources when the parse stage is finished. It also ensures conf_write_autoconf_cmd() produces consistent results even if called multiple times for any reason.
Signed-off-by: Masahiro Yamada <[email protected]>
show more ...
|
|
Revision tags: v6.8-rc2, v6.8-rc1, v6.7, v6.7-rc8, v6.7-rc7, v6.7-rc6, v6.7-rc5, v6.7-rc4, v6.7-rc3, v6.7-rc2, v6.7-rc1, v6.6, v6.6-rc7, v6.6-rc6, v6.6-rc5, v6.6-rc4, v6.6-rc3, v6.6-rc2, v6.6-rc1 |
|
| #
a3b7039b |
| 05-Sep-2023 |
Konstantin Meskhidze <[email protected]> |
kconfig: fix possible buffer overflow
Buffer 'new_argv' is accessed without bound check after accessing with bound check via 'new_argc' index.
Fixes: e298f3b49def ("kconfig: add built-in function s
kconfig: fix possible buffer overflow
Buffer 'new_argv' is accessed without bound check after accessing with bound check via 'new_argc' index.
Fixes: e298f3b49def ("kconfig: add built-in function support") Co-developed-by: Ivanov Mikhail <[email protected]> Signed-off-by: Konstantin Meskhidze <[email protected]> Signed-off-by: Masahiro Yamada <[email protected]>
show more ...
|
|
Revision tags: v6.5, v6.5-rc7, v6.5-rc6, v6.5-rc5, v6.5-rc4, v6.5-rc3, v6.5-rc2, v6.5-rc1, v6.4, v6.4-rc7, v6.4-rc6, v6.4-rc5, v6.4-rc4, v6.4-rc3, v6.4-rc2, v6.4-rc1, v6.3, v6.3-rc7, v6.3-rc6, v6.3-rc5, v6.3-rc4, v6.3-rc3, v6.3-rc2, v6.3-rc1, v6.2, v6.2-rc8, v6.2-rc7, v6.2-rc6, v6.2-rc5, v6.2-rc4, v6.2-rc3, v6.2-rc2, v6.2-rc1, v6.1, v6.1-rc8, v6.1-rc7, v6.1-rc6, v6.1-rc5, v6.1-rc4, v6.1-rc3, v6.1-rc2, v6.1-rc1, v6.0, v6.0-rc7, v6.0-rc6, v6.0-rc5, v6.0-rc4, v6.0-rc3, v6.0-rc2, v6.0-rc1, v5.19, v5.19-rc8, v5.19-rc7, v5.19-rc6, v5.19-rc5, v5.19-rc4, v5.19-rc3, v5.19-rc2, v5.19-rc1, v5.18, v5.18-rc7, v5.18-rc6, v5.18-rc5, v5.18-rc4, v5.18-rc3, v5.18-rc2, v5.18-rc1, v5.17, v5.17-rc8, v5.17-rc7, v5.17-rc6, v5.17-rc5, v5.17-rc4, v5.17-rc3, v5.17-rc2 |
|
| #
8a4c5b2a |
| 28-Jan-2022 |
Brenda Streiff <[email protected]> |
kconfig: let 'shell' return enough output for deep path names
The 'shell' built-in only returns the first 256 bytes of the command's output. In some cases, 'shell' is used to return a path; by bumpi
kconfig: let 'shell' return enough output for deep path names
The 'shell' built-in only returns the first 256 bytes of the command's output. In some cases, 'shell' is used to return a path; by bumping up the buffer size to 4096 this lets us capture up to PATH_MAX.
The specific case where I ran into this was due to commit 1e860048c53e ("gcc-plugins: simplify GCC plugin-dev capability test"). After this change, we now use `$(shell,$(CC) -print-file-name=plugin)` to return a path; if the gcc path is particularly long, then the path ends up truncated at the 256 byte mark, which makes the HAVE_GCC_PLUGINS depends test always fail.
Signed-off-by: Brenda Streiff <[email protected]> Signed-off-by: Masahiro Yamada <[email protected]>
show more ...
|
|
Revision tags: v5.17-rc1, v5.16, v5.16-rc8, v5.16-rc7, v5.16-rc6, v5.16-rc5, v5.16-rc4, v5.16-rc3, v5.16-rc2, v5.16-rc1, v5.15, v5.15-rc7, v5.15-rc6, v5.15-rc5, v5.15-rc4, v5.15-rc3, v5.15-rc2, v5.15-rc1, v5.14, v5.14-rc7, v5.14-rc6, v5.14-rc5, v5.14-rc4, v5.14-rc3, v5.14-rc2, v5.14-rc1, v5.13, v5.13-rc7, v5.13-rc6, v5.13-rc5, v5.13-rc4, v5.13-rc3, v5.13-rc2, v5.13-rc1, v5.12, v5.12-rc8, v5.12-rc7, v5.12-rc6, v5.12-rc5, v5.12-rc4, v5.12-rc3, v5.12-rc2, v5.12-rc1, v5.12-rc1-dontuse, v5.11, v5.11-rc7, v5.11-rc6, v5.11-rc5, v5.11-rc4, v5.11-rc3, v5.11-rc2, v5.11-rc1 |
|
| #
135b4957 |
| 19-Dec-2020 |
Masahiro Yamada <[email protected]> |
kconfig: fix return value of do_error_if()
$(error-if,...) is expanded to an empty string. Currently, it relies on eval_clause() returning xstrdup("") when all attempts for expansion fail, but the c
kconfig: fix return value of do_error_if()
$(error-if,...) is expanded to an empty string. Currently, it relies on eval_clause() returning xstrdup("") when all attempts for expansion fail, but the correct implementation is to make do_error_if() return xstrdup("").
Fixes: 1d6272e6fe43 ("kconfig: add 'info', 'warning-if', and 'error-if' built-in functions") Signed-off-by: Masahiro Yamada <[email protected]>
show more ...
|
|
Revision tags: v5.10, v5.10-rc7, v5.10-rc6, v5.10-rc5, v5.10-rc4, v5.10-rc3, v5.10-rc2, v5.10-rc1, v5.9, v5.9-rc8, v5.9-rc7, v5.9-rc6, v5.9-rc5, v5.9-rc4, v5.9-rc3, v5.9-rc2, v5.9-rc1, v5.8, v5.8-rc7, v5.8-rc6, v5.8-rc5, v5.8-rc4, v5.8-rc3, v5.8-rc2, v5.8-rc1, v5.7, v5.7-rc7, v5.7-rc6, v5.7-rc5, v5.7-rc4, v5.7-rc3, v5.7-rc2, v5.7-rc1, v5.6, v5.6-rc7, v5.6-rc6, v5.6-rc5, v5.6-rc4, v5.6-rc3, v5.6-rc2, v5.6-rc1, v5.5, v5.5-rc7, v5.5-rc6, v5.5-rc5, v5.5-rc4, v5.5-rc3, v5.5-rc2, v5.5-rc1, v5.4, v5.4-rc8, v5.4-rc7, v5.4-rc6, v5.4-rc5, v5.4-rc4, v5.4-rc3, v5.4-rc2, v5.4-rc1, v5.3, v5.3-rc8, v5.3-rc7, v5.3-rc6, v5.3-rc5, v5.3-rc4, v5.3-rc3, v5.3-rc2, v5.3-rc1, v5.2, v5.2-rc7, v5.2-rc6, v5.2-rc5, v5.2-rc4, v5.2-rc3 |
|
| #
5533397d |
| 27-May-2019 |
Masahiro Yamada <[email protected]> |
kconfig: add static qualifier to expand_string()
Now expand_string() is only used in preprocess.c
Signed-off-by: Masahiro Yamada <[email protected]>
|
|
Revision tags: v5.2-rc2, v5.2-rc1, v5.1, v5.1-rc7, v5.1-rc6, v5.1-rc5, v5.1-rc4, v5.1-rc3, v5.1-rc2, v5.1-rc1, v5.0, v5.0-rc8, v5.0-rc7, v5.0-rc6, v5.0-rc5, v5.0-rc4, v5.0-rc3, v5.0-rc2, v5.0-rc1, v4.20 |
|
| #
558e78e3 |
| 21-Dec-2018 |
Masahiro Yamada <[email protected]> |
kconfig: split some C files out of zconf.y
I want to compile each C file independently instead of including all of them from zconf.y.
Split out confdata.c, expr.c, symbol.c, and preprocess.c . Thes
kconfig: split some C files out of zconf.y
I want to compile each C file independently instead of including all of them from zconf.y.
Split out confdata.c, expr.c, symbol.c, and preprocess.c . These are low-hanging fruits.
Signed-off-by: Masahiro Yamada <[email protected]>
show more ...
|
|
Revision tags: v4.20-rc7 |
|
| #
f5451582 |
| 11-Dec-2018 |
Masahiro Yamada <[email protected]> |
kconfig: stop supporting '.' and '/' in unquoted words
In my understanding, special characters such as '.' and '/' are supported in unquoted words to use bare file paths in the "source" statement.
kconfig: stop supporting '.' and '/' in unquoted words
In my understanding, special characters such as '.' and '/' are supported in unquoted words to use bare file paths in the "source" statement.
With the previous commit surrounding all file paths with double quotes, we can drop this.
Signed-off-by: Masahiro Yamada <[email protected]>
show more ...
|
|
Revision tags: v4.20-rc6, v4.20-rc5, v4.20-rc4, v4.20-rc3, v4.20-rc2, v4.20-rc1, v4.19, v4.19-rc8, v4.19-rc7, v4.19-rc6, v4.19-rc5, v4.19-rc4, v4.19-rc3, v4.19-rc2, v4.19-rc1, v4.18, v4.18-rc8, v4.18-rc7, v4.18-rc6, v4.18-rc5, v4.18-rc4, v4.18-rc3, v4.18-rc2 |
|
| #
73d1c580 |
| 23-Jun-2018 |
Jerry James <[email protected]> |
kconfig: loop boundary condition fix
If buf[-1] just happens to hold the byte 0x0A, then nread can wrap around to (size_t)-1, leading to invalid memory accesses.
This has caused segmentation faults
kconfig: loop boundary condition fix
If buf[-1] just happens to hold the byte 0x0A, then nread can wrap around to (size_t)-1, leading to invalid memory accesses.
This has caused segmentation faults when trying to build the latest kernel snapshots for i686 in Fedora: https://bugzilla.redhat.com/show_bug.cgi?id=1592374
Signed-off-by: Jerry James <[email protected]> [[email protected]: reformatted patch for submission] Signed-off-by: Alexander Ploumistos <[email protected]> Signed-off-by: Masahiro Yamada <[email protected]>
show more ...
|
|
Revision tags: v4.18-rc1, v4.17 |
|
| #
915f6490 |
| 28-May-2018 |
Masahiro Yamada <[email protected]> |
kconfig: error out if a recursive variable references itself
When using a recursively expanded variable, it is a common mistake to make circular reference.
For example, Make terminates the followin
kconfig: error out if a recursive variable references itself
When using a recursively expanded variable, it is a common mistake to make circular reference.
For example, Make terminates the following code:
X = $(X) Y := $(X)
Let's detect the circular expansion in Kconfig, too.
On the other hand, a function that recurses itself is a commonly-used programming technique. So, Make does not check recursion in the reference with 'call'. For example, the following code continues running eternally:
X = $(call X) Y := $(X)
Kconfig allows circular expansion if one or more arguments are given, but terminates when the same function is recursively invoked 1000 times, assuming it is a programming mistake.
Signed-off-by: Masahiro Yamada <[email protected]>
show more ...
|
| #
a702a617 |
| 28-May-2018 |
Masahiro Yamada <[email protected]> |
kconfig: add 'filename' and 'lineno' built-in variables
The special variables, $(filename) and $(lineno), are expanded to a file name and its line number being parsed, respectively.
Suggested-by: R
kconfig: add 'filename' and 'lineno' built-in variables
The special variables, $(filename) and $(lineno), are expanded to a file name and its line number being parsed, respectively.
Suggested-by: Randy Dunlap <[email protected]> Signed-off-by: Masahiro Yamada <[email protected]> Reviewed-by: Kees Cook <[email protected]>
show more ...
|
| #
1d6272e6 |
| 28-May-2018 |
Masahiro Yamada <[email protected]> |
kconfig: add 'info', 'warning-if', and 'error-if' built-in functions
Syntax: $(info,<text>) $(warning-if,<condition>,<text>) $(error-if,<condition>,<text)
The 'info' function prints a message
kconfig: add 'info', 'warning-if', and 'error-if' built-in functions
Syntax: $(info,<text>) $(warning-if,<condition>,<text>) $(error-if,<condition>,<text)
The 'info' function prints a message to stdout as in Make.
The 'warning-if' and 'error-if' are similar to 'warning' and 'error' in Make, but take the condition parameter. They are effective only when the <condition> part is y.
Kconfig does not implement the lazy expansion as used in the 'if' 'and, 'or' functions in Make. In other words, Kconfig does not support conditional expansion. The unconditional 'error' function would always terminate the parsing, hence would be useless in Kconfig.
Signed-off-by: Masahiro Yamada <[email protected]> Reviewed-by: Kees Cook <[email protected]>
show more ...
|
| #
ed2a22f2 |
| 28-May-2018 |
Masahiro Yamada <[email protected]> |
kconfig: support append assignment operator
Support += operator. This appends a space and the text on the righthand side to a variable.
The timing of the evaluation of the righthand side depends o
kconfig: support append assignment operator
Support += operator. This appends a space and the text on the righthand side to a variable.
The timing of the evaluation of the righthand side depends on the flavor of the variable. If the lefthand side was originally defined as a simple variable, the righthand side is expanded immediately. Otherwise, the expansion is deferred. Appending something to an undefined variable results in a recursive variable.
To implement this, we need to remember the flavor of variables.
Signed-off-by: Masahiro Yamada <[email protected]>
show more ...
|
| #
1175c025 |
| 28-May-2018 |
Masahiro Yamada <[email protected]> |
kconfig: support simply expanded variable
The previous commit added variable and user-defined function. They work similarly in the sense that the evaluation is deferred until they are used.
This c
kconfig: support simply expanded variable
The previous commit added variable and user-defined function. They work similarly in the sense that the evaluation is deferred until they are used.
This commit adds another type of variable, simply expanded variable, as we see in Make.
The := operator defines a simply expanded variable, expanding the righthand side immediately. This works like traditional programming language variables.
Signed-off-by: Masahiro Yamada <[email protected]>
show more ...
|
| #
9ced3bdd |
| 28-May-2018 |
Masahiro Yamada <[email protected]> |
kconfig: support user-defined function and recursively expanded variable
Now, we got a basic ability to test compiler capability in Kconfig.
config CC_HAS_STACKPROTECTOR def_bool $(shell,($
kconfig: support user-defined function and recursively expanded variable
Now, we got a basic ability to test compiler capability in Kconfig.
config CC_HAS_STACKPROTECTOR def_bool $(shell,($(CC) -Werror -fstack-protector -E -x c /dev/null -o /dev/null 2>/dev/null) && echo y || echo n)
This works, but it is ugly to repeat this long boilerplate.
We want to describe like this:
config CC_HAS_STACKPROTECTOR bool default $(cc-option,-fstack-protector)
It is straight-forward to add a new function, but I do not like to hard-code specialized functions like that. Hence, here is another feature, user-defined function. This works as a textual shorthand with parameterization.
A user-defined function is defined by using the = operator, and can be referenced in the same way as built-in functions. A user-defined function in Make is referenced like $(call my-func,arg1,arg2), but I omitted the 'call' to make the syntax shorter.
The definition of a user-defined function contains $(1), $(2), etc. in its body to reference the parameters. It is grammatically valid to pass more or fewer arguments when calling it. We already exploit this feature in our makefiles; scripts/Kbuild.include defines cc-option which takes two arguments at most, but most of the callers pass only one argument.
By the way, a variable is supported as a subset of this feature since a variable is "a user-defined function with zero argument". In this context, I mean "variable" as recursively expanded variable. I will add a different flavored variable in the next commit.
The code above can be written as follows:
[Example Code]
success = $(shell,($(1)) >/dev/null 2>&1 && echo y || echo n) cc-option = $(success,$(CC) -Werror $(1) -E -x c /dev/null -o /dev/null)
config CC_HAS_STACKPROTECTOR def_bool $(cc-option,-fstack-protector)
[Result] $ make -s alldefconfig && tail -n 1 .config CONFIG_CC_HAS_STACKPROTECTOR=y
Signed-off-by: Masahiro Yamada <[email protected]>
show more ...
|
| #
2fd5b09c |
| 28-May-2018 |
Masahiro Yamada <[email protected]> |
kconfig: add 'shell' built-in function
This accepts a single command to execute. It returns the standard output from it.
[Example code]
config HELLO string default "$(shell,
kconfig: add 'shell' built-in function
This accepts a single command to execute. It returns the standard output from it.
[Example code]
config HELLO string default "$(shell,echo hello world)"
config Y def_bool $(shell,echo y)
[Result]
$ make -s alldefconfig && tail -n 2 .config CONFIG_HELLO="hello world" CONFIG_Y=y
Caveat: Like environments, functions are expanded in the lexer. You cannot pass symbols to function arguments. This is a limitation to simplify the implementation. I want to avoid the dynamic function evaluation, which would introduce much more complexity.
Signed-off-by: Masahiro Yamada <[email protected]>
show more ...
|
| #
e298f3b4 |
| 28-May-2018 |
Masahiro Yamada <[email protected]> |
kconfig: add built-in function support
This commit adds a new concept 'function' to do more text processing in Kconfig.
A function call looks like this:
$(function,arg1,arg2,arg3,...)
This comm
kconfig: add built-in function support
This commit adds a new concept 'function' to do more text processing in Kconfig.
A function call looks like this:
$(function,arg1,arg2,arg3,...)
This commit adds the basic infrastructure to expand functions. Change the text expansion helpers to take arguments.
Signed-off-by: Masahiro Yamada <[email protected]>
show more ...
|
| #
104daea1 |
| 28-May-2018 |
Masahiro Yamada <[email protected]> |
kconfig: reference environment variables directly and remove 'option env='
To get access to environment variables, Kconfig needs to define a symbol using "option env=" syntax. It is tedious to add
kconfig: reference environment variables directly and remove 'option env='
To get access to environment variables, Kconfig needs to define a symbol using "option env=" syntax. It is tedious to add a symbol entry for each environment variable given that we need to define much more such as 'CC', 'AS', 'srctree' etc. to evaluate the compiler capability in Kconfig.
Adding '$' for symbol references is grammatically inconsistent. Looking at the code, the symbols prefixed with 'S' are expanded by: - conf_expand_value() This is used to expand 'arch/$ARCH/defconfig' and 'defconfig_list' - sym_expand_string_value() This is used to expand strings in 'source' and 'mainmenu'
All of them are fixed values independent of user configuration. So, they can be changed into the direct expansion instead of symbols.
This change makes the code much cleaner. The bounce symbols 'SRCARCH', 'ARCH', 'SUBARCH', 'KERNELVERSION' are gone.
sym_init() hard-coding 'UNAME_RELEASE' is also gone. 'UNAME_RELEASE' should be replaced with an environment variable.
ARCH_DEFCONFIG is a normal symbol, so it should be simply referenced without '$' prefix.
The new syntax is addicted by Make. The variable reference needs parentheses, like $(FOO), but you can omit them for single-letter variables, like $F. Yet, in Makefiles, people tend to use the parenthetical form for consistency / clarification.
At this moment, only the environment variable is supported, but I will extend the concept of 'variable' later on.
The variables are expanded in the lexer so we can simplify the token handling on the parser side.
For example, the following code works.
[Example code]
config MY_TOOLCHAIN_LIST string default "My tools: CC=$(CC), AS=$(AS), CPP=$(CPP)"
[Result]
$ make -s alldefconfig && tail -n 1 .config CONFIG_MY_TOOLCHAIN_LIST="My tools: CC=gcc, AS=as, CPP=gcc -E"
Signed-off-by: Masahiro Yamada <[email protected]> Reviewed-by: Kees Cook <[email protected]>
show more ...
|