All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] kernel: Clean up generated syscall_entries.h file
@ 2024-06-26 19:26 Richard Weinberger
  2024-06-27  6:29 ` Jan Kiszka
  0 siblings, 1 reply; 6+ messages in thread
From: Richard Weinberger @ 2024-06-26 19:26 UTC (permalink / raw)
  To: xenomai; +Cc: upstream+xenomai, Richard Weinberger

Add it to the clean-files list, such that Kbuild will remove it
up make clean.
Also drop it from the target list, this variable seems unused
is most likely a copy&paste relict from the past.

Signed-off-by: Richard Weinberger <richard@nod.at>
---
 kernel/cobalt/posix/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/kernel/cobalt/posix/Makefile b/kernel/cobalt/posix/Makefile
index 5b4f3214a..9e2f3f6e0 100644
--- a/kernel/cobalt/posix/Makefile
+++ b/kernel/cobalt/posix/Makefile
@@ -31,7 +31,7 @@ quiet_cmd_syscall_entries = GEN     $@
 $(obj)/syscall_entries.h: $(syscall_entries) $(wildcard $(srctree)/$(src)/*.c) FORCE
 	$(call if_changed,syscall_entries)
 
-target += syscall_entries.h
+clean-files += syscall_entries.h
 
 $(obj)/syscall.o: $(obj)/syscall_entries.h
 
-- 
2.35.3


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] kernel: Clean up generated syscall_entries.h file
  2024-06-26 19:26 [PATCH] kernel: Clean up generated syscall_entries.h file Richard Weinberger
@ 2024-06-27  6:29 ` Jan Kiszka
  2024-06-27  7:25   ` Richard Weinberger
  0 siblings, 1 reply; 6+ messages in thread
From: Jan Kiszka @ 2024-06-27  6:29 UTC (permalink / raw)
  To: Richard Weinberger, xenomai; +Cc: upstream+xenomai

On 26.06.24 21:26, Richard Weinberger wrote:
> Add it to the clean-files list, such that Kbuild will remove it
> up make clean.
> Also drop it from the target list, this variable seems unused
> is most likely a copy&paste relict from the past.
> 
> Signed-off-by: Richard Weinberger <richard@nod.at>
> ---
>  kernel/cobalt/posix/Makefile | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/kernel/cobalt/posix/Makefile b/kernel/cobalt/posix/Makefile
> index 5b4f3214a..9e2f3f6e0 100644
> --- a/kernel/cobalt/posix/Makefile
> +++ b/kernel/cobalt/posix/Makefile
> @@ -31,7 +31,7 @@ quiet_cmd_syscall_entries = GEN     $@
>  $(obj)/syscall_entries.h: $(syscall_entries) $(wildcard $(srctree)/$(src)/*.c) FORCE
>  	$(call if_changed,syscall_entries)
>  
> -target += syscall_entries.h
> +clean-files += syscall_entries.h

target is generally needed to prevent re-executing the build although
that target file is already present and recent. Did you check that a
second build will not have this problem after that change?

Jan

>  
>  $(obj)/syscall.o: $(obj)/syscall_entries.h
>  

-- 
Siemens AG, Technology
Linux Expert Center


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] kernel: Clean up generated syscall_entries.h file
  2024-06-27  6:29 ` Jan Kiszka
@ 2024-06-27  7:25   ` Richard Weinberger
  2024-06-27  7:36     ` Jan Kiszka
  0 siblings, 1 reply; 6+ messages in thread
From: Richard Weinberger @ 2024-06-27  7:25 UTC (permalink / raw)
  To: Richard Weinberger, xenomai, upstream; +Cc: upstream+xenomai, Jan Kiszka

Am Donnerstag, 27. Juni 2024, 08:29:46 CEST schrieb 'Jan Kiszka' via upstream:
> > @@ -31,7 +31,7 @@ quiet_cmd_syscall_entries = GEN     $@
> >  $(obj)/syscall_entries.h: $(syscall_entries) $(wildcard $(srctree)/$(src)/*.c) FORCE
> >  	$(call if_changed,syscall_entries)
> >  
> > -target += syscall_entries.h
> > +clean-files += syscall_entries.h
> 
> target is generally needed to prevent re-executing the build although
> that target file is already present and recent. Did you check that a
> second build will not have this problem after that change?

I thought you want re-executing because of the "FORCE" property.
Why is FORCE needed then?

Why doesn't the "default" maineline work?
e.g. something like that:
diff --git a/kernel/cobalt/posix/Makefile b/kernel/cobalt/posix/Makefile
index 5b4f3214a..e57628cf1 100644
--- a/kernel/cobalt/posix/Makefile
+++ b/kernel/cobalt/posix/Makefile
@@ -26,13 +26,13 @@ xenomai-y :=                \
 syscall_entries := $(srctree)/$(src)/gen-syscall-entries.sh
 
 quiet_cmd_syscall_entries = GEN     $@
-      cmd_syscall_entries = $(CONFIG_SHELL) '$(syscall_entries)' $(filter-out FORCE,$^) > $@
+      cmd_syscall_entries = $^ > $@
 
-$(obj)/syscall_entries.h: $(syscall_entries) $(wildcard $(srctree)/$(src)/*.c) FORCE
-       $(call if_changed,syscall_entries)
-
-target += syscall_entries.h
+$(obj)/syscall_entries.h: $(syscall_entries) $(wildcard $(srctree)/$(src)/*.c)
+       $(call cmd,syscall_entries)
 
 $(obj)/syscall.o: $(obj)/syscall_entries.h
 
+clean-files    += syscall_entries.h
+
 xenomai-$(CONFIG_XENO_ARCH_SYS3264) += compat.o syscall32.o

LG,
//richard

-- 
​​​​​sigma star gmbh | Eduard-Bodem-Gasse 6, 6020 Innsbruck, AUT
UID/VAT Nr: ATU 66964118 | FN: 374287y



^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] kernel: Clean up generated syscall_entries.h file
  2024-06-27  7:25   ` Richard Weinberger
@ 2024-06-27  7:36     ` Jan Kiszka
  2024-06-27  8:20       ` Richard Weinberger
  0 siblings, 1 reply; 6+ messages in thread
From: Jan Kiszka @ 2024-06-27  7:36 UTC (permalink / raw)
  To: Richard Weinberger, Richard Weinberger, xenomai, upstream
  Cc: upstream+xenomai

On 27.06.24 09:25, Richard Weinberger wrote:
> Am Donnerstag, 27. Juni 2024, 08:29:46 CEST schrieb 'Jan Kiszka' via upstream:
>>> @@ -31,7 +31,7 @@ quiet_cmd_syscall_entries = GEN     $@
>>>  $(obj)/syscall_entries.h: $(syscall_entries) $(wildcard $(srctree)/$(src)/*.c) FORCE
>>>  	$(call if_changed,syscall_entries)
>>>  
>>> -target += syscall_entries.h
>>> +clean-files += syscall_entries.h
>>
>> target is generally needed to prevent re-executing the build although
>> that target file is already present and recent. Did you check that a
>> second build will not have this problem after that change?
> 
> I thought you want re-executing because of the "FORCE" property.
> Why is FORCE needed then?
> 
> Why doesn't the "default" maineline work?
> e.g. something like that:
> diff --git a/kernel/cobalt/posix/Makefile b/kernel/cobalt/posix/Makefile
> index 5b4f3214a..e57628cf1 100644
> --- a/kernel/cobalt/posix/Makefile
> +++ b/kernel/cobalt/posix/Makefile
> @@ -26,13 +26,13 @@ xenomai-y :=                \
>  syscall_entries := $(srctree)/$(src)/gen-syscall-entries.sh
>  
>  quiet_cmd_syscall_entries = GEN     $@
> -      cmd_syscall_entries = $(CONFIG_SHELL) '$(syscall_entries)' $(filter-out FORCE,$^) > $@
> +      cmd_syscall_entries = $^ > $@
>  
> -$(obj)/syscall_entries.h: $(syscall_entries) $(wildcard $(srctree)/$(src)/*.c) FORCE
> -       $(call if_changed,syscall_entries)
> -
> -target += syscall_entries.h
> +$(obj)/syscall_entries.h: $(syscall_entries) $(wildcard $(srctree)/$(src)/*.c)
> +       $(call cmd,syscall_entries)
>  
>  $(obj)/syscall.o: $(obj)/syscall_entries.h
>  
> +clean-files    += syscall_entries.h
> +
>  xenomai-$(CONFIG_XENO_ARCH_SYS3264) += compat.o syscall32.o
> 
> LG,
> //richard
> 

"Any target that utilizes if_changed must be listed in $(targets),
otherwise the command line check will fail, and the target will
always be built."

If you find a better pattern, that propose it - but test all the corner
cases of required as well as unneeded rebuilding first.

Jan

-- 
Siemens AG, Technology
Linux Expert Center


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] kernel: Clean up generated syscall_entries.h file
  2024-06-27  7:36     ` Jan Kiszka
@ 2024-06-27  8:20       ` Richard Weinberger
  2024-06-27 11:31         ` Jan Kiszka
  0 siblings, 1 reply; 6+ messages in thread
From: Richard Weinberger @ 2024-06-27  8:20 UTC (permalink / raw)
  To: Richard Weinberger, xenomai, upstream, Jan Kiszka; +Cc: upstream+xenomai

Am Donnerstag, 27. Juni 2024, 09:36:27 CEST schrieb Jan Kiszka:
> "Any target that utilizes if_changed must be listed in $(targets),
> otherwise the command line check will fail, and the target will
> always be built."

Yes, but why is if_changed needed at all?
syscall_entries is in the prerequisites list of $(obj)/syscall_entries.h.
 
> If you find a better pattern, that propose it - but test all the corner
> cases of required as well as unneeded rebuilding first.

The diff in my last mail should fulfill all that.
I removed if_changed and replaced it with cmd.

But let's stay on the safe side, I'll send a v2 for the syscall_entries.h
file and do more testing wrt. if_changed/target.

Thanks,
//richard

-- 
​​​​​sigma star gmbh | Eduard-Bodem-Gasse 6, 6020 Innsbruck, AUT
UID/VAT Nr: ATU 66964118 | FN: 374287y



^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] kernel: Clean up generated syscall_entries.h file
  2024-06-27  8:20       ` Richard Weinberger
@ 2024-06-27 11:31         ` Jan Kiszka
  0 siblings, 0 replies; 6+ messages in thread
From: Jan Kiszka @ 2024-06-27 11:31 UTC (permalink / raw)
  To: Richard Weinberger, Richard Weinberger, xenomai, upstream
  Cc: upstream+xenomai

On 27.06.24 10:20, Richard Weinberger wrote:
> Am Donnerstag, 27. Juni 2024, 09:36:27 CEST schrieb Jan Kiszka:
>> "Any target that utilizes if_changed must be listed in $(targets),
>> otherwise the command line check will fail, and the target will
>> always be built."
> 
> Yes, but why is if_changed needed at all?
> syscall_entries is in the prerequisites list of $(obj)/syscall_entries.h.
>  

The reason is most likely (I wrote this 9 years ago...) that the list of
prerequisites is not static, rather containing a wildcard. If you add a
file with a syscall entry, this won't be detected, and no rebuild will
be done.

>> If you find a better pattern, that propose it - but test all the corner
>> cases of required as well as unneeded rebuilding first.
> 
> The diff in my last mail should fulfill all that.
> I removed if_changed and replaced it with cmd.
> 
> But let's stay on the safe side, I'll send a v2 for the syscall_entries.h
> file and do more testing wrt. if_changed/target.
> 

Ack.

Jan

-- 
Siemens AG, Technology
Linux Expert Center


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2024-06-27 11:31 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-06-26 19:26 [PATCH] kernel: Clean up generated syscall_entries.h file Richard Weinberger
2024-06-27  6:29 ` Jan Kiszka
2024-06-27  7:25   ` Richard Weinberger
2024-06-27  7:36     ` Jan Kiszka
2024-06-27  8:20       ` Richard Weinberger
2024-06-27 11:31         ` Jan Kiszka

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.