Skip to contentSkip to conversation

modpost: put modpost options before argument

PATCH In review Richard Acayan 2 participants 2 messages Oct 11, 2022 Kbuild

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 modpost: put modpost options before argument

The musl implementation of getopt stops looking for options after the first non-option argument. Put the options before the non-option argument so environments using musl can still build the kernel and modules.

---
 scripts/Makefile.modpost | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
scripts/Makefile.modpost +1 -1
index 7740ce3b29e8..8489a3402eb8 100644
@@ -119,7 +119,7 @@ quiet_cmd_modpost = MODPOST $@
 		echo >&2 "WARNING: $(missing-input) is missing."; \
 		echo >&2 "         Modules may not have dependencies or modversions."; \
 		echo >&2 "         You may get many unresolved symbol warnings.";) \
-	sed 's/ko$$/o/' $(or $(modorder-if-needed), /dev/null) | $(MODPOST) $(modpost-args) $(vmlinux.o-if-present) -T -
+	sed 's/ko$$/o/' $(or $(modorder-if-needed), /dev/null) | $(MODPOST) $(modpost-args) -T - $(vmlinux.o-if-present)
 
 targets += $(output-symdump)
 $(output-symdump): $(modorder-if-needed) $(vmlinux.o-if-present) $(moudle.symvers-if-present) $(MODPOST) FORCE
Signature · 1 line
2.38.0
#1 lore raw
Quoted 10 lines · Richard Acayan

The musl implementation of getopt stops looking for options after the first non-option argument. Put the options before the non-option argument so environments using musl can still build the kernel and modules.

---

Applied to linux-kbuild. Thanks.

Quoted 19 lines
 scripts/Makefile.modpost | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
scripts/Makefile.modpost +1 -2
index 7740ce3b29e8..8489a3402eb8 100644
@@ -119,7 +119,7 @@ quiet_cmd_modpost = MODPOST $@
                echo >&2 "WARNING: $(missing-input) is missing."; \
                echo >&2 "         Modules may not have dependencies or modversions."; \
                echo >&2 "         You may get many unresolved symbol warnings.";) \
-       sed 's/ko$$/o/' $(or $(modorder-if-needed), /dev/null) | $(MODPOST) $(modpost-args) $(vmlinux.o-if-present) -T -
+       sed 's/ko$$/o/' $(or $(modorder-if-needed), /dev/null) | $(MODPOST) $(modpost-args) -T - $(vmlinux.o-if-present)
 
 targets += $(output-symdump)
 $(output-symdump): $(modorder-if-needed) $(vmlinux.o-if-present) $(moudle.symvers-if-present) $(MODPOST) FORCE
--

2.38.0

Signature · 2 lines
Best Regards
Masahiro Yamada