linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] kbuild: do not pass $(KBUILD_CFLAGS) to scripts/mkcompile_h
@ 2020-04-03 21:24 Masahiro Yamada
  2020-04-03 22:45 ` Kees Cook
  0 siblings, 1 reply; 2+ messages in thread
From: Masahiro Yamada @ 2020-04-03 21:24 UTC (permalink / raw)
  To: linux-kbuild
  Cc: linux-kernel, Masahiro Yamada, Kees Cook, Nick Desaulniers,
	Thomas Gleixner

scripts/mkcompile_h uses $(CC) only for getting the version string.

I suspected there was a specific reason why the additional flags were
needed, and dug the commit history. This code dates back to at least
2002 [1], but I could not get any more clue.

Just get rid of it.

[1]: https://git.kernel.org/pub/scm/linux/kernel/git/history/history.git/commit/?id=29f3df7eba8ddf91a55183f9967f76fbcc3ab742

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
---

 init/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/init/Makefile b/init/Makefile
index 30aa8ab11120..d45e967483b2 100644
--- a/init/Makefile
+++ b/init/Makefile
@@ -35,4 +35,4 @@ include/generated/compile.h: FORCE
 	@$($(quiet)chk_compile.h)
 	$(Q)$(CONFIG_SHELL) $(srctree)/scripts/mkcompile_h $@	\
 	"$(UTS_MACHINE)" "$(CONFIG_SMP)" "$(CONFIG_PREEMPT)"	\
-	"$(CONFIG_PREEMPT_RT)" "$(CC) $(KBUILD_CFLAGS)" "$(LD)"
+	"$(CONFIG_PREEMPT_RT)" "$(CC)" "$(LD)"
-- 
2.17.1


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

* Re: [PATCH] kbuild: do not pass $(KBUILD_CFLAGS) to scripts/mkcompile_h
  2020-04-03 21:24 [PATCH] kbuild: do not pass $(KBUILD_CFLAGS) to scripts/mkcompile_h Masahiro Yamada
@ 2020-04-03 22:45 ` Kees Cook
  0 siblings, 0 replies; 2+ messages in thread
From: Kees Cook @ 2020-04-03 22:45 UTC (permalink / raw)
  To: Masahiro Yamada
  Cc: linux-kbuild, linux-kernel, Nick Desaulniers, Thomas Gleixner

On Sat, Apr 04, 2020 at 06:24:59AM +0900, Masahiro Yamada wrote:
> scripts/mkcompile_h uses $(CC) only for getting the version string.
> 
> I suspected there was a specific reason why the additional flags were
> needed, and dug the commit history. This code dates back to at least
> 2002 [1], but I could not get any more clue.

I would be alarmed to find it changing the version string with flags. ;)

> Just get rid of it.
> 
> [1]: https://git.kernel.org/pub/scm/linux/kernel/git/history/history.git/commit/?id=29f3df7eba8ddf91a55183f9967f76fbcc3ab742
> 
> Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>

Reviewed-by: Kees Cook <keescook@chromium.org>

-Kees

> ---
> 
>  init/Makefile | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/init/Makefile b/init/Makefile
> index 30aa8ab11120..d45e967483b2 100644
> --- a/init/Makefile
> +++ b/init/Makefile
> @@ -35,4 +35,4 @@ include/generated/compile.h: FORCE
>  	@$($(quiet)chk_compile.h)
>  	$(Q)$(CONFIG_SHELL) $(srctree)/scripts/mkcompile_h $@	\
>  	"$(UTS_MACHINE)" "$(CONFIG_SMP)" "$(CONFIG_PREEMPT)"	\
> -	"$(CONFIG_PREEMPT_RT)" "$(CC) $(KBUILD_CFLAGS)" "$(LD)"
> +	"$(CONFIG_PREEMPT_RT)" "$(CC)" "$(LD)"
> -- 
> 2.17.1
> 

-- 
Kees Cook

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

end of thread, other threads:[~2020-04-03 22:45 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-03 21:24 [PATCH] kbuild: do not pass $(KBUILD_CFLAGS) to scripts/mkcompile_h Masahiro Yamada
2020-04-03 22:45 ` Kees Cook

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).