All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH B] fixdep: fix U-Boot own code to handle only valid symbol characters
@ 2020-02-18 11:11 Masahiro Yamada
  0 siblings, 0 replies; only message in thread
From: Masahiro Yamada @ 2020-02-18 11:11 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

Fixes: 8be60f06c258 ("linux/kconfig.h: add CPP macros useful for per-image config options")
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
---

This patch is applicable on top of Tom's resync:

 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 8c21dd08d9f7..0ff564a5cc86 100644
--- a/scripts/basic/fixdep.c
+++ b/scripts/basic/fixdep.c
@@ -255,7 +255,7 @@ static void parse_config_file(const char *p)
 		    (q - p == 9 && !memcmp(p, "IS_MODULE(", 10)) ||
 		    (q - p == 3 && !memcmp(p, "VAL(", 4))) {
 			p = q + 1;
-			while (*q && *q != ')')
+			while (isalnum(*q) || *q == '_')
 				q++;
 			r = q;
 			if (r > p && is_spl_build) {
-- 
2.17.1

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2020-02-18 11:11 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-18 11:11 [PATCH B] fixdep: fix U-Boot own code to handle only valid symbol characters Masahiro Yamada

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.