Skip to contentSkip to conversation

tools build: Provide consistent build options for fixdep

PATCH In review Alexander Gordeev 2 participants 2 messages Aug 15, 2024

Subsystems (3)
lore
Share & tools
lore

Alexander Gordeev

author maintainer
#0 lore raw

PATCH v2 1/1 tools build: Provide consistent build options for fixdep

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.

Fixes ea974028a049 ("tools build: Avoid circular .fixdep-in.o.cmd issues")

---

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(-)
tools/build/Makefile +1 -1
index fea3cf647f5b..18ad131f6ea7 100644
@@ -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 $@ $<
Signature · 1 line
2.43.0
Acked-by on v2 1/1
#1 lore raw
Quoted 9 lines · Alexander Gordeev

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.

Quoted 7 lines

Provide both KBUILD_HOSTCFLAGS and KBUILD_HOSTLDFLAGS to avoid that.

Fixes ea974028a049 ("tools build: Avoid circular .fixdep-in.o.cmd issues")

jirka

Quoted 26 lines

---

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(-)
tools/build/Makefile +1 -1
index fea3cf647f5b..18ad131f6ea7 100644
@@ -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 $@ $<
Signature · 1 line
2.43.0