diff options
author | Masahiro Yamada <masahiroy@kernel.org> | 2020-02-18 14:05:39 +0300 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2020-03-16 19:49:09 +0300 |
commit | 8a266e5800514121044e4654e84a961200294cd5 (patch) | |
tree | 936ab6a586a3a3db9682dfb8c1c77100a51ff052 /scripts | |
parent | e24f0a39d0daa2d8c597650aeb3f559d44a195ae (diff) | |
download | u-boot-8a266e5800514121044e4654e84a961200294cd5.tar.xz |
fixdep: fix U-Boot own code to handle only valid symbol characters
Currently, fixdep skips parsing include/linux/kconfig.h, but if it
parsed it, it would translate the following code in kconfig.h
config_enabled(CONFIG_VAL(option##_MODULE)
into:
$(wildcard include/config/option##/module.h)
When Kbuild includes .*.cmd, it would emit the following error:
*** unterminated call to function 'wildcard': missing ')'. Stop.
This issue prevents us from importing the upstream Linux commit
638e69cf2230 ("fixdep: do not ignore kconfig.h").
Fix this by handling only alphanumerical characters and underscores.
This makes sense because they match to the valid character sets in
Kconfig symbols.
As a side-note, you can reproduce this issue only on GNU Make <= 4.2.1
For GNU Make <= 4.2.1, the '#' always means the start of a comment.
Hence, GNU Make thinks the closing ')' is missing.
The following commit in GNU Make changed how it handles '#' in
function invocations. So, this does not happen for GNU Make 4.3
| commit c6966b323811c37acedff05b576b907b06aea5f4
| Author: Paul Smith <psmith@gnu.org>
| Date: Thu Dec 22 18:47:26 2016 -0500
|
| [SV 20513] Un-escaped # are not comments in function invocations
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Reported-by: Tom Rini <trini@konsulko.com>
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/basic/fixdep.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/scripts/basic/fixdep.c b/scripts/basic/fixdep.c index da7fb2cd4d..6a668f1140 100644 --- a/scripts/basic/fixdep.c +++ b/scripts/basic/fixdep.c @@ -262,7 +262,7 @@ static void parse_config_file(const char *map, size_t len) (q - p == 3 && !memcmp(p, "VAL(", 4))) { p = q + 1; for (q = p; q < map + len; q++) - if (*q == ')') + if (!(isalnum(*q) || *q == '_')) goto found2; continue; |