Skip to contentSkip to conversation

kbuild: fix bug with modpost Makefile warn flag inclusion

PATCH In review Michael Ton 2 participants 2 messages Aug 18, 2014 – Aug 19, 2014 Kbuild

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 kbuild: fix bug with modpost Makefile warn flag inclusion

From: Michael Ton <[email protected]>

The current Makefile.modpost file includes a warn (-w) flag to modpost if KBUILD_EXTMOD or KBUILD_MODPOST_WARN. This flag should only be added if both flags are true. Whenever KBUILD_MODPOST is true, modpost currently only prints warnings and does not exit on error (such as on an undefined symbol).

---

Makefile.modpost 2014-08-18 13:24:20.902520603 -0600 renamed from Makefile.modpost.orig 2014-08-18 13:18:18.704048707 -0600 +0 -0
@@ -77,7 +77,7 @@ modpost = scripts/mod/modpost
  $(if $(KBUILD_EXTRA_SYMBOLS), $(patsubst %, -e 

%,$(KBUILD_EXTRA_SYMBOLS))) \
$(if $(KBUILD_EXTMOD),-o $(modulesymfile)) \
$(if $(CONFIG_DEBUG_SECTION_MISMATCH),,-S) \
- $(if $(KBUILD_EXTMOD)$(KBUILD_MODPOST_WARN),-w)
+ $(if $(KBUILD_EXTMOD), $(if $(KBUILD_MODPOST_WARN),-w))

MODPOST_OPT=$(subst -i,-n,$(filter -i,$(MAKEFLAGS)))

#1 lore raw
Quoted 7 lines · Michael Ton

From: Michael Ton <[email protected]>

The current Makefile.modpost file includes a warn (-w) flag to modpost if KBUILD_EXTMOD or KBUILD_MODPOST_WARN. This flag should only be added if both flags are true. Whenever KBUILD_MODPOST is true, modpost currently only prints warnings and does not exit on error (such as on an undefined symbol).

From the documentation:
KBUILD_MODPOST_WARN
--------------------------------------------------
KBUILD_MODPOST_WARN can be set to avoid errors in case of undefined symbols in the final module linking stage. It changes such errors into warnings.

Nothing here say that we need KBUILD_EXTMOD to use this.

Why did you conclude that KBUILD_MODPOST_WARN is only relevant for KBUILD_EXTMOD? Something must have triggerede the patch...

Sam