Skip to contentSkip to conversation

kbuild: Never respect CONFIG_WERROR / W=e to fixdep

PATCH In review Thomas Weißschuh 2 participants 2 messages Apr 22 Kbuild

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 kbuild: Never respect CONFIG_WERROR / W=e to fixdep

The fixdep hostprog may be built multiple times during a single build. Once during the configuration phase and later during the regular phase. As only the regular build phase respects CONFIG_WERROR / W=e, the compiler flags might change between the phases, leading to rebuilds.

Example, the rebuilds will happen twice on each invocation of the build:

  $ make allyesconfig prepare
  make[1]: Entering directory '/tmp/deleteme'
    HOSTCC  scripts/basic/fixdep
  #
  # No change to .config
  #
    HOSTCC  scripts/basic/fixdep
    DESCEND objtool
    INSTALL libsubcmd_headers
  make[1]: Leaving directory '/tmp/deleteme'

Fix the compilation flags used for scripts/basic/ before scripts/Makefile.warn is evaluated to stop CONFIG_WERROR / W=e influencing the fixdep build to avoid the spurious rebuilds.

Fixes 7ded7d37e5f5 ("scripts/Makefile.extrawarn: Respect CONFIG_WERROR / W=e for hostprogs")
---
 Makefile | 2 ++
 1 file changed, 2 insertions(+)
Makefile +2 -0
index 54e1ae602000..6c8a1b2e7c8a 100644
@@ -657,6 +657,8 @@ export RCS_FIND_IGNORE := \( -name SCCS -o -name BitKeeper -o -name .svn -o    \
 
 # Basic helpers built in scripts/basic/
 PHONY += scripts_basic
+scripts_basic: KBUILD_HOSTCFLAGS := $(KBUILD_HOSTCFLAGS)
+scripts_basic: KBUILD_HOSTLDFLAGS := $(KBUILD_HOSTLDFLAGS)
 scripts_basic:
 	$(Q)$(MAKE) $(build)=scripts/basic
 

---
base-commit: 6596a02b207886e9e00bb0161c7fd59fea53c081
change-id: 20260422-kbuild-scripts-basic-werror-f8f7bfc39cfc

Best regards,

Signature · 1 line
Thomas Weißschuh <[email protected]>
maintainer Reviewed-by on v1 1/1
#1 lore raw
Quoted 18 lines · Thomas Weißschuh

The fixdep hostprog may be built multiple times during a single build. Once during the configuration phase and later during the regular phase. As only the regular build phase respects CONFIG_WERROR / W=e, the compiler flags might change between the phases, leading to rebuilds.

Example, the rebuilds will happen twice on each invocation of the build:

  $ make allyesconfig prepare
  make[1]: Entering directory '/tmp/deleteme'
    HOSTCC  scripts/basic/fixdep
  #
  # No change to .config
  #
    HOSTCC  scripts/basic/fixdep
    DESCEND objtool
    INSTALL libsubcmd_headers
  make[1]: Leaving directory '/tmp/deleteme'
Quoted 6 lines

Fix the compilation flags used for scripts/basic/ before scripts/Makefile.warn is evaluated to stop CONFIG_WERROR / W=e influencing the fixdep build to avoid the spurious rebuilds.

Fixes 7ded7d37e5f5 ("scripts/Makefile.extrawarn: Respect CONFIG_WERROR / W=e for hostprogs")
Quoted 26 lines
---
 Makefile | 2 ++
 1 file changed, 2 insertions(+)
Makefile +2 -1
index 54e1ae602000..6c8a1b2e7c8a 100644
@@ -657,6 +657,8 @@ export RCS_FIND_IGNORE := \( -name SCCS -o -name BitKeeper -o -name .svn -o    \
 
 # Basic helpers built in scripts/basic/
 PHONY += scripts_basic
+scripts_basic: KBUILD_HOSTCFLAGS := $(KBUILD_HOSTCFLAGS)
+scripts_basic: KBUILD_HOSTLDFLAGS := $(KBUILD_HOSTLDFLAGS)
 scripts_basic:
 	$(Q)$(MAKE) $(build)=scripts/basic
 
 
---

base-commit: 6596a02b207886e9e00bb0161c7fd59fea53c081
change-id: 20260422-kbuild-scripts-basic-werror-f8f7bfc39cfc

Best regards,

Signature · 1 line
Thomas Weißschuh <[email protected]>