* [PATCH v2] tools build: Provide consistent build options for fixdep
@ 2024-08-15 7:20 Alexander Gordeev
2024-08-15 11:06 ` Jiri Olsa
0 siblings, 1 reply; 2+ messages in thread
From: Alexander Gordeev @ 2024-08-15 7:20 UTC (permalink / raw)
To: Brian Norris, Arnaldo Carvalho de Melo
Cc: linux-s390, linux-kernel, linux-kbuild, bpf
The fixdep binary is being compiled and linked in one step. While
the host linker flags are passed to the compiler the host compiler
flags are missed.
That leads to build errors at least on x86_64, arm64 and s390 as
result of the compiler vs linker flags inconsistency. For example,
during RPM package build redhat-hardened-ld script is provided to
gcc, while redhat-hardened-cc1 script is missed.
Provide both KBUILD_HOSTCFLAGS and KBUILD_HOSTLDFLAGS to avoid that.
Closes: https://lore.kernel.org/lkml/99ae0d34-ed76-4ca0-a9fd-c337da33c9f9@leemhuis.info/
Fixes: ea974028a049 ("tools build: Avoid circular .fixdep-in.o.cmd issues")
Tested-by: Thorsten Leemhuis <linux@leemhuis.info>
Reviewed-by: Brian Norris <briannorris@chromium.org>
Signed-off-by: Alexander Gordeev <agordeev@linux.ibm.com>
---
This patch is against kernel-next next-20240815 tag
v2:
- missing tags added
- commit message adjusted
---
tools/build/Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/build/Makefile b/tools/build/Makefile
index fea3cf647f5b..18ad131f6ea7 100644
--- a/tools/build/Makefile
+++ b/tools/build/Makefile
@@ -44,4 +44,4 @@ ifneq ($(wildcard $(TMP_O)),)
endif
$(OUTPUT)fixdep: $(srctree)/tools/build/fixdep.c
- $(QUIET_CC)$(HOSTCC) $(KBUILD_HOSTLDFLAGS) -o $@ $<
+ $(QUIET_CC)$(HOSTCC) $(KBUILD_HOSTCFLAGS) $(KBUILD_HOSTLDFLAGS) -o $@ $<
--
2.43.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH v2] tools build: Provide consistent build options for fixdep
2024-08-15 7:20 [PATCH v2] tools build: Provide consistent build options for fixdep Alexander Gordeev
@ 2024-08-15 11:06 ` Jiri Olsa
0 siblings, 0 replies; 2+ messages in thread
From: Jiri Olsa @ 2024-08-15 11:06 UTC (permalink / raw)
To: Alexander Gordeev
Cc: Brian Norris, Arnaldo Carvalho de Melo, linux-s390, linux-kernel,
linux-kbuild, bpf
On Thu, Aug 15, 2024 at 09:20:46AM +0200, Alexander Gordeev wrote:
> The fixdep binary is being compiled and linked in one step. While
> the host linker flags are passed to the compiler the host compiler
> flags are missed.
>
> That leads to build errors at least on x86_64, arm64 and s390 as
> result of the compiler vs linker flags inconsistency. For example,
> during RPM package build redhat-hardened-ld script is provided to
> gcc, while redhat-hardened-cc1 script is missed.
>
> Provide both KBUILD_HOSTCFLAGS and KBUILD_HOSTLDFLAGS to avoid that.
>
> Closes: https://lore.kernel.org/lkml/99ae0d34-ed76-4ca0-a9fd-c337da33c9f9@leemhuis.info/
> Fixes: ea974028a049 ("tools build: Avoid circular .fixdep-in.o.cmd issues")
> Tested-by: Thorsten Leemhuis <linux@leemhuis.info>
> Reviewed-by: Brian Norris <briannorris@chromium.org>
> Signed-off-by: Alexander Gordeev <agordeev@linux.ibm.com>
Acked-by: Jiri Olsa <jolsa@kernel.org>
jirka
> ---
>
> This patch is against kernel-next next-20240815 tag
>
> v2:
> - missing tags added
> - commit message adjusted
>
> ---
> tools/build/Makefile | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/tools/build/Makefile b/tools/build/Makefile
> index fea3cf647f5b..18ad131f6ea7 100644
> --- a/tools/build/Makefile
> +++ b/tools/build/Makefile
> @@ -44,4 +44,4 @@ ifneq ($(wildcard $(TMP_O)),)
> endif
>
> $(OUTPUT)fixdep: $(srctree)/tools/build/fixdep.c
> - $(QUIET_CC)$(HOSTCC) $(KBUILD_HOSTLDFLAGS) -o $@ $<
> + $(QUIET_CC)$(HOSTCC) $(KBUILD_HOSTCFLAGS) $(KBUILD_HOSTLDFLAGS) -o $@ $<
> --
> 2.43.0
>
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2024-08-15 11:06 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-15 7:20 [PATCH v2] tools build: Provide consistent build options for fixdep Alexander Gordeev
2024-08-15 11:06 ` Jiri Olsa
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox