help-make
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Make 4.3 rebuilds .o files when unnecessary


From: Tommaso Fonda
Subject: Re: Make 4.3 rebuilds .o files when unnecessary
Date: Tue, 1 Dec 2020 18:51:25 +0100

Hooray! I found the Linux kernel commit that fixes the problem on newer
releases:
https://github.com/torvalds/linux/commit/b42841b7bb6286da56b4fa79835c27166b7e228b
It indeed removes an escaped hash character.
Fortunately, the patch applies without conflicts to my ancient 3.4 tree, so
I can safely say I found the fix for my problem.
Interestingly, adding an instance of the old call to find_map_unquote just
below the new one in src/read.c also works as a workaround. I mean like
this:



diff --git a/src/read.c b/src/read.c
index b66f3d4..51d30ea 100644
--- a/src/read.c
+++ b/src/read.c
@@ -1343,6 +1343,7 @@ remove_comments (char *line)
   char *comment;

   comment = find_map_unquote (line, MAP_COMMENT|MAP_VARIABLE);
+  find_map_unquote (line, MAP_COMMENT);

   if (comment != 0)
     /* Cut off the line at the #.  */



This might seem obvious to you, but it is far less obvious for me :)
Anyway, problem solved. Thank you to both of you for your great help.
Regards,
--
Tommaso Fonda

Il giorno mer 25 nov 2020 alle ore 17:18 Kaz Kylheku (gmake) <
729-670-0061@kylheku.com> ha scritto:

> On 2020-11-25 02:28, Tommaso Fonda wrote:
>
> Thank you for the small tutorial. I've managed to find the commit that
> introduces the issue! It's this one:
> https://git.savannah.gnu.org/cgit/make.git/commit/?id=c6966b323811c37acedff05b576b907b06aea5f4
> What happens now?
>
>
>
> Thus, it looks like the kernel 3.x build system is sensitive to the issue
> of # characters in function or macro invocations.
>
> Ideas:
>
> - Since the build system is old, is search the kernel archives to see if
> they patched the problem already in a newer kernel. (Trying this: not easy!)
>
> - Look for any situations in the Makefile or any included makefiles where
> a # character occurs in a function or macro invocation. See what those
> situations look like in a newer or current kernel tree, and use git blame
> to find where those lines have been touched.
>
> - Patch Make to print a diagnostic when the input triggers the sensitivity.
>
> The last idea seems like it could pinpoint the problem pretty fast. So
> that is to say, basically, the crux of the Make patch is this change in
> remove_comments function:
>
> - comment = find_char_unquote (line, MAP_COMMENT);
> + comment = find_char_unquote (line, MAP_COMMENT|MAP_VARIABLE);
>
> The other code changes are a renaming of a parameter, and some block
> comment rewrites, which do nothing.
>
> So, since the change is a one-liner, we can do something like this:
>
>    char *comment_old_way = find_char_unquote (line, MAP_COMMENT);
>    char *comment_new_way = find_char_unquote (line,
> MAP_COMMENT|MAP_VARIABLE);
>
>    if (comment_new_way != comment_old_way) {
>       /* behavior change! */
>       /* Log useful information here (what makefile, and linenumber), or
> raise(SIGTRAP) for a gdb breakpoint ... */
>    }
>
> - Insert other debugging idea here ... :)
>
>


reply via email to

[Prev in Thread] Current Thread [Next in Thread]