From 4ce6efed48d736e3384c39ff87bda723e1f8e041 Mon Sep 17 00:00:00 2001 From: Sam Ravnborg Date: Sun, 23 Mar 2008 21:38:54 +0100 Subject: kbuild: soften modpost checks when doing cross builds The module alias support in the kernel have a consistency check where it is checked that the size of a structure in the kernel and on the build host are the same. For cross builds this check does not make sense so detect when we do cross builds and silently skip the check in these situations. This fixes a build bug for a wireless driver when cross building for arm. Acked-by: Michael Buesch Tested-by: Gordon Farquharson Signed-off-by: Sam Ravnborg Cc: stable@kernel.org --- scripts/Makefile.modpost | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'scripts/Makefile.modpost') diff --git a/scripts/Makefile.modpost b/scripts/Makefile.modpost index cfc004e04417..2d20640854b7 100644 --- a/scripts/Makefile.modpost +++ b/scripts/Makefile.modpost @@ -58,6 +58,9 @@ modules := $(patsubst %.o,%.ko, $(wildcard $(__modules:.ko=.o))) # Stop after building .o files if NOFINAL is set. Makes compile tests quicker _modpost: $(if $(KBUILD_MODPOST_NOFINAL), $(modules:.ko:.o),$(modules)) +ifneq ($(KBUILD_BUILDHOST),$(ARCH)) + cross_build := 1 +endif # Step 2), invoke modpost # Includes step 3,4 @@ -70,7 +73,8 @@ modpost = scripts/mod/modpost \ $(if $(CONFIG_DEBUG_SECTION_MISMATCH),,-S) \ $(if $(CONFIG_MARKERS),-K $(kernelmarkersfile)) \ $(if $(CONFIG_MARKERS),-M $(markersfile)) \ - $(if $(KBUILD_EXTMOD)$(KBUILD_MODPOST_WARN),-w) + $(if $(KBUILD_EXTMOD)$(KBUILD_MODPOST_WARN),-w) \ + $(if $(cross_build),-c) quiet_cmd_modpost = MODPOST $(words $(filter-out vmlinux FORCE, $^)) modules cmd_modpost = $(modpost) -s -- cgit v1.2.3