* [PATCH] fixdep: fix U-Boot own code to handle only valid symbol characters
@ 2020-02-18 11:05 Masahiro Yamada
2020-02-18 11:35 ` Masahiro Yamada
` (2 more replies)
0 siblings, 3 replies; 5+ messages in thread
From: Masahiro Yamada @ 2020-02-18 11:05 UTC (permalink / raw)
To: u-boot
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>
---
This patch is applicable to the current upstream code.
scripts/basic/fixdep.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/scripts/basic/fixdep.c b/scripts/basic/fixdep.c
index da7fb2cd4dde..6a668f114096 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;
--
2.17.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH] fixdep: fix U-Boot own code to handle only valid symbol characters
2020-02-18 11:05 [PATCH] fixdep: fix U-Boot own code to handle only valid symbol characters Masahiro Yamada
@ 2020-02-18 11:35 ` Masahiro Yamada
2020-02-18 12:06 ` Tom Rini
2020-02-18 17:40 ` Masahiro Yamada
2020-03-17 15:28 ` Tom Rini
2 siblings, 1 reply; 5+ messages in thread
From: Masahiro Yamada @ 2020-02-18 11:35 UTC (permalink / raw)
To: u-boot
On Tue, Feb 18, 2020 at 8:06 PM Masahiro Yamada <masahiroy@kernel.org> wrote:
>
> 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>
> ---
Maybe, this can have this tag.
Fixes: 8be60f06c258 ("linux/kconfig.h: add CPP macros useful for
per-image config options")
> This patch is applicable to the current upstream code.
>
>
> scripts/basic/fixdep.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/scripts/basic/fixdep.c b/scripts/basic/fixdep.c
> index da7fb2cd4dde..6a668f114096 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;
>
> --
> 2.17.1
>
--
Best Regards
Masahiro Yamada
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH] fixdep: fix U-Boot own code to handle only valid symbol characters
2020-02-18 11:35 ` Masahiro Yamada
@ 2020-02-18 12:06 ` Tom Rini
0 siblings, 0 replies; 5+ messages in thread
From: Tom Rini @ 2020-02-18 12:06 UTC (permalink / raw)
To: u-boot
On Tue, Feb 18, 2020 at 08:35:06PM +0900, Masahiro Yamada wrote:
> On Tue, Feb 18, 2020 at 8:06 PM Masahiro Yamada <masahiroy@kernel.org> wrote:
> >
> > 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>
> > ---
>
>
> Maybe, this can have this tag.
>
> Fixes: 8be60f06c258 ("linux/kconfig.h: add CPP macros useful for
> per-image config options")
Ah, OK, thanks. Yes, I'll go this route to keep bisectability and fully
re-sync the program.
--
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20200218/8aae374a/attachment.sig>
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH] fixdep: fix U-Boot own code to handle only valid symbol characters
2020-02-18 11:05 [PATCH] fixdep: fix U-Boot own code to handle only valid symbol characters Masahiro Yamada
2020-02-18 11:35 ` Masahiro Yamada
@ 2020-02-18 17:40 ` Masahiro Yamada
2020-03-17 15:28 ` Tom Rini
2 siblings, 0 replies; 5+ messages in thread
From: Masahiro Yamada @ 2020-02-18 17:40 UTC (permalink / raw)
To: u-boot
On Tue, Feb 18, 2020 at 8:06 PM Masahiro Yamada <masahiroy@kernel.org> wrote:
>
> 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>
> ---
>
> This patch is applicable to the current upstream code.
One more tag:
Reported-by: Tom Rini <trini@konsulko.com>
--
Best Regards
Masahiro Yamada
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH] fixdep: fix U-Boot own code to handle only valid symbol characters
2020-02-18 11:05 [PATCH] fixdep: fix U-Boot own code to handle only valid symbol characters Masahiro Yamada
2020-02-18 11:35 ` Masahiro Yamada
2020-02-18 17:40 ` Masahiro Yamada
@ 2020-03-17 15:28 ` Tom Rini
2 siblings, 0 replies; 5+ messages in thread
From: Tom Rini @ 2020-03-17 15:28 UTC (permalink / raw)
To: u-boot
On Tue, Feb 18, 2020 at 08:05:39PM +0900, Masahiro Yamada wrote:
> 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>
Applied to u-boot/next, thanks!
--
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20200317/df563ddc/attachment.sig>
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2020-03-17 15:28 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-02-18 11:05 [PATCH] fixdep: fix U-Boot own code to handle only valid symbol characters Masahiro Yamada
2020-02-18 11:35 ` Masahiro Yamada
2020-02-18 12:06 ` Tom Rini
2020-02-18 17:40 ` Masahiro Yamada
2020-03-17 15:28 ` Tom Rini
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox