Skip to contentSkip to conversation

kbuild: move headers_check.pl to usr/include/

PATCH In review Masahiro Yamada 3 participants 6 messages Dec 6, 2021 – Jan 8, 2022 Kbuild

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/2 kbuild: move headers_check.pl to usr/include/

This script is only used by usr/include/Makefile. Make it local to the directory.

Update the comment in include/uapi/linux/soundcard.h because 'make headers_check' is no longer functional.

---

Changes in v2:
- Fix the comment in soundcard.sh to point to the new file path

 include/uapi/linux/soundcard.h            | 2 +-
 usr/include/Makefile                      | 2 +-
 {scripts => usr/include}/headers_check.pl | 0
 3 files changed, 2 insertions(+), 2 deletions(-)
 rename {scripts => usr/include}/headers_check.pl (100%)
include/uapi/linux/soundcard.h +1 -1
index f3b21f989872..ac1318793a86 100644
@@ -1051,7 +1051,7 @@ typedef struct mixer_vol_table {
  *	the GPL version of OSS-4.x and build against that version
  *	of the header.
  *
- *	We redefine the extern keyword so that make headers_check
+ *	We redefine the extern keyword so that usr/include/headers_check.pl
  *	does not complain about SEQ_USE_EXTBUF.
  */
 #define SEQ_DECLAREBUF()		SEQ_USE_EXTBUF()
usr/include/Makefile +1 -1
index 1c2ae1368079..0e9c3e72f43a 100644
@@ -99,7 +99,7 @@ quiet_cmd_hdrtest = HDRTEST $<
       cmd_hdrtest = \
 		$(CC) $(c_flags) -S -o /dev/null -x c /dev/null \
 			$(if $(filter-out $(no-header-test), $*.h), -include $< -include $<); \
-		$(PERL) $(srctree)/scripts/headers_check.pl $(obj) $(SRCARCH) $<; \
+		$(PERL) $(srctree)/$(src)/headers_check.pl $(obj) $(SRCARCH) $<; \
 		touch $@
 
 $(obj)/%.hdrtest: $(obj)/%.h FORCE
usr/include/headers_check.pl renamed from scripts/headers_check.pl +0 -0
similarity index 100%
rename from scripts/headers_check.pl
rename to usr/include/headers_check.pl
Signature · 1 line
2.32.0
#1 lore raw

PATCH v2 2/2 kbuild: remove headers_check stub

Linux 5.15 is out. Remove this stub now.

---

(no changes since v1)

 Makefile | 9 ---------
 1 file changed, 9 deletions(-)
Makefile +0 -9
index 0a6ecc8bb2d2..8d58f65e226b 100644
@@ -1284,15 +1284,6 @@ headers: $(version_h) scripts_unifdef uapi-asm-generic archheaders archscripts
 	$(Q)$(MAKE) $(hdr-inst)=include/uapi
 	$(Q)$(MAKE) $(hdr-inst)=arch/$(SRCARCH)/include/uapi
 
-# Deprecated. It is no-op now.
-PHONY += headers_check
-headers_check:
-	@echo >&2 "=================== WARNING ==================="
-	@echo >&2 "Since Linux 5.5, 'make headers_check' is no-op,"
-	@echo >&2 "and will be removed after Linux 5.15 release."
-	@echo >&2 "Please remove headers_check from your scripts."
-	@echo >&2 "==============================================="
-
 ifdef CONFIG_HEADERS_INSTALL
 prepare: headers
 endif
Signature · 1 line
2.32.0
Reviewed-by on v2 2/2
#2 lore raw

Re: [PATCH v2 2/2] kbuild: remove headers_check stub

Quoted 4 lines · Masahiro Yamada

Linux 5.15 is out. Remove this stub now.

Quoted 30 lines

---

(no changes since v1)

 Makefile | 9 ---------
 1 file changed, 9 deletions(-)
Makefile +0 -10
index 0a6ecc8bb2d2..8d58f65e226b 100644
@@ -1284,15 +1284,6 @@ headers: $(version_h) scripts_unifdef uapi-asm-generic archheaders archscripts
        $(Q)$(MAKE) $(hdr-inst)=include/uapi
        $(Q)$(MAKE) $(hdr-inst)=arch/$(SRCARCH)/include/uapi
 
-# Deprecated. It is no-op now.
-PHONY += headers_check
-headers_check:
-       @echo >&2 "=================== WARNING ==================="
-       @echo >&2 "Since Linux 5.5, 'make headers_check' is no-op,"
-       @echo >&2 "and will be removed after Linux 5.15 release."
-       @echo >&2 "Please remove headers_check from your scripts."
-       @echo >&2 "==============================================="
-
 ifdef CONFIG_HEADERS_INSTALL
 prepare: headers
 endif
--

2.32.0

Signature · 2 lines
Thanks,
~Nick Desaulniers
#3 lore raw
In reply to Masahiro Yamada
Quoted 9 lines · Masahiro Yamada

This script is only used by usr/include/Makefile. Make it local to the directory.

Update the comment in include/uapi/linux/soundcard.h because 'make headers_check' is no longer functional.

---

Applied to linux-kbuild.

Quoted 42 lines

Changes in v2:
- Fix the comment in soundcard.sh to point to the new file path

 include/uapi/linux/soundcard.h            | 2 +-
 usr/include/Makefile                      | 2 +-
 {scripts => usr/include}/headers_check.pl | 0
 3 files changed, 2 insertions(+), 2 deletions(-)
 rename {scripts => usr/include}/headers_check.pl (100%)
include/uapi/linux/soundcard.h +1 -1
index f3b21f989872..ac1318793a86 100644
@@ -1051,7 +1051,7 @@ typedef struct mixer_vol_table {
  *     the GPL version of OSS-4.x and build against that version
  *     of the header.
  *
- *     We redefine the extern keyword so that make headers_check
+ *     We redefine the extern keyword so that usr/include/headers_check.pl
  *     does not complain about SEQ_USE_EXTBUF.
  */
 #define SEQ_DECLAREBUF()               SEQ_USE_EXTBUF()
usr/include/Makefile +1 -1
index 1c2ae1368079..0e9c3e72f43a 100644
@@ -99,7 +99,7 @@ quiet_cmd_hdrtest = HDRTEST $<
       cmd_hdrtest = \
                $(CC) $(c_flags) -S -o /dev/null -x c /dev/null \
                        $(if $(filter-out $(no-header-test), $*.h), -include $< -include $<); \
-               $(PERL) $(srctree)/scripts/headers_check.pl $(obj) $(SRCARCH) $<; \
+               $(PERL) $(srctree)/$(src)/headers_check.pl $(obj) $(SRCARCH) $<; \
                touch $@
 
 $(obj)/%.hdrtest: $(obj)/%.h FORCE
usr/include/headers_check.pl renamed from scripts/headers_check.pl +0 -1
similarity index 100%
rename from scripts/headers_check.pl
rename to usr/include/headers_check.pl
--

2.32.0

Signature · 2 lines
Best Regards
Masahiro Yamada
#4 lore raw
In reply to Masahiro Yamada

Hi Masahiro,

Quoted 52 lines · Masahiro Yamada

This script is only used by usr/include/Makefile. Make it local to the directory.

Update the comment in include/uapi/linux/soundcard.h because 'make headers_check' is no longer functional.

---

Changes in v2:
- Fix the comment in soundcard.sh to point to the new file path

 include/uapi/linux/soundcard.h            | 2 +-
 usr/include/Makefile                      | 2 +-
 {scripts => usr/include}/headers_check.pl | 0
 3 files changed, 2 insertions(+), 2 deletions(-)
 rename {scripts => usr/include}/headers_check.pl (100%)
include/uapi/linux/soundcard.h +1 -1
index f3b21f989872..ac1318793a86 100644
@@ -1051,7 +1051,7 @@ typedef struct mixer_vol_table {
  *	the GPL version of OSS-4.x and build against that version
  *	of the header.
  *
- *	We redefine the extern keyword so that make headers_check
+ *	We redefine the extern keyword so that usr/include/headers_check.pl
  *	does not complain about SEQ_USE_EXTBUF.
  */
 #define SEQ_DECLAREBUF()		SEQ_USE_EXTBUF()
usr/include/Makefile +1 -1
index 1c2ae1368079..0e9c3e72f43a 100644
@@ -99,7 +99,7 @@ quiet_cmd_hdrtest = HDRTEST $<
       cmd_hdrtest = \
 		$(CC) $(c_flags) -S -o /dev/null -x c /dev/null \
 			$(if $(filter-out $(no-header-test), $*.h), -include $< -include $<); \
-		$(PERL) $(srctree)/scripts/headers_check.pl $(obj) $(SRCARCH) $<; \
+		$(PERL) $(srctree)/$(src)/headers_check.pl $(obj) $(SRCARCH) $<; \
 		touch $@
 
 $(obj)/%.hdrtest: $(obj)/%.h FORCE
usr/include/headers_check.pl renamed from scripts/headers_check.pl +0 -0
similarity index 100%
rename from scripts/headers_check.pl
rename to usr/include/headers_check.pl
Signature · 1 line
2.32.0

After this patch landed in -next, with a completely clean tree, I see:

$ make clean
  CLEAN   usr/include
$ git status --short
 D usr/include/headers_check.pl

Is something like this needed?

usr/include/Makefile +1 -1
index 0e9c3e72f43a..6e9dfd657e89 100644
@@ -105,4 +105,4 @@ quiet_cmd_hdrtest = HDRTEST $<
 $(obj)/%.hdrtest: $(obj)/%.h FORCE
 	$(call if_changed_dep,hdrtest)
 
-clean-files += $(filter-out Makefile, $(notdir $(wildcard $(obj)/*)))
+clean-files += $(filter-out headers_check.pl Makefile, $(notdir $(wildcard $(obj)/*)))
#5 lore raw
Quoted 72 lines · Nathan Chancellor

Hi Masahiro,

Quoted 49 lines · Masahiro Yamada

This script is only used by usr/include/Makefile. Make it local to the directory.

Update the comment in include/uapi/linux/soundcard.h because 'make headers_check' is no longer functional.

---

Changes in v2:
- Fix the comment in soundcard.sh to point to the new file path

 include/uapi/linux/soundcard.h            | 2 +-
 usr/include/Makefile                      | 2 +-
 {scripts => usr/include}/headers_check.pl | 0
 3 files changed, 2 insertions(+), 2 deletions(-)
 rename {scripts => usr/include}/headers_check.pl (100%)
include/uapi/linux/soundcard.h +1 -1
index f3b21f989872..ac1318793a86 100644
@@ -1051,7 +1051,7 @@ typedef struct mixer_vol_table {
  *   the GPL version of OSS-4.x and build against that version
  *   of the header.
  *
- *   We redefine the extern keyword so that make headers_check
+ *   We redefine the extern keyword so that usr/include/headers_check.pl
  *   does not complain about SEQ_USE_EXTBUF.
  */
 #define SEQ_DECLAREBUF()             SEQ_USE_EXTBUF()
usr/include/Makefile +1 -1
index 1c2ae1368079..0e9c3e72f43a 100644
@@ -99,7 +99,7 @@ quiet_cmd_hdrtest = HDRTEST $<
       cmd_hdrtest = \
              $(CC) $(c_flags) -S -o /dev/null -x c /dev/null \
                      $(if $(filter-out $(no-header-test), $*.h), -include $< -include $<); \
-             $(PERL) $(srctree)/scripts/headers_check.pl $(obj) $(SRCARCH) $<; \
+             $(PERL) $(srctree)/$(src)/headers_check.pl $(obj) $(SRCARCH) $<; \
              touch $@
 
 $(obj)/%.hdrtest: $(obj)/%.h FORCE
usr/include/headers_check.pl renamed from scripts/headers_check.pl +0 -1
similarity index 100%
rename from scripts/headers_check.pl
rename to usr/include/headers_check.pl
--
Quoted 3 lines

2.32.0

After this patch landed in -next, with a completely clean tree, I see:

$ make clean
  CLEAN   usr/include
$ git status --short
 D usr/include/headers_check.pl

Is something like this needed?

usr/include/Makefile +0 -0
index 0e9c3e72f43a..6e9dfd657e89 100644

usr/include/Makefile quiet_cmd_hdrtest = HDRTEST $< · line 108

Quoted 5 lines
usr/include/Makefile +1 -1
@@ -105,4 +105,4 @@ quiet_cmd_hdrtest = HDRTEST $<
 $(obj)/%.hdrtest: $(obj)/%.h FORCE
        $(call if_changed_dep,hdrtest)
 
-clean-files += $(filter-out Makefile, $(notdir $(wildcard $(obj)/*)))
+clean-files += $(filter-out headers_check.pl Makefile, $(notdir $(wildcard $(obj)/*)))

Ah, right.
I will squash this.
Thanks.

Signature · 2 lines
Best Regards
Masahiro Yamada