···189189# Alternatively CROSS_COMPILE can be set in the environment.190190# Default value for CROSS_COMPILE is not to prefix executables191191# Note: Some architectures assign CROSS_COMPILE in their arch/*/Makefile192192-192192+export KBUILD_BUILDHOST := $(SUBARCH)193193ARCH ?= $(SUBARCH)194194CROSS_COMPILE ?=195195
+5-1
scripts/Makefile.modpost
···5858# Stop after building .o files if NOFINAL is set. Makes compile tests quicker5959_modpost: $(if $(KBUILD_MODPOST_NOFINAL), $(modules:.ko:.o),$(modules))60606161+ifneq ($(KBUILD_BUILDHOST),$(ARCH))6262+ cross_build := 16363+endif61646265# Step 2), invoke modpost6366# Includes step 3,4···7370 $(if $(CONFIG_DEBUG_SECTION_MISMATCH),,-S) \7471 $(if $(CONFIG_MARKERS),-K $(kernelmarkersfile)) \7572 $(if $(CONFIG_MARKERS),-M $(markersfile)) \7676- $(if $(KBUILD_EXTMOD)$(KBUILD_MODPOST_WARN),-w)7373+ $(if $(KBUILD_EXTMOD)$(KBUILD_MODPOST_WARN),-w) \7474+ $(if $(cross_build),-c)77757876quiet_cmd_modpost = MODPOST $(words $(filter-out vmlinux FORCE, $^)) modules7977 cmd_modpost = $(modpost) -s
+4
scripts/mod/file2alias.c
···5151 sprintf(str + strlen(str), "*"); \5252} while(0)53535454+unsigned int cross_build = 0;5455/**5556 * Check that sizeof(device_id type) are consistent with size of section5657 * in .o file. If in-consistent then userspace and kernel does not agree5758 * on actual size which is a bug.5859 * Also verify that the final entry in the table is all zeros.6060+ * Ignore both checks if build host differ from target host and size differs.5961 **/6062static void device_id_check(const char *modname, const char *device_id,6163 unsigned long size, unsigned long id_size,···6664 int i;67656866 if (size % id_size || size < id_size) {6767+ if (cross_build != 0)6868+ return;6969 fatal("%s: sizeof(struct %s_device_id)=%lu is not a modulo "7070 "of the size of section __mod_%s_device_table=%lu.\n"7171 "Fix definition of struct %s_device_id "