Skip to content

Commit 60df1ae

Browse files
committed
kbuild: move modpost out of 'scripts' target
I am eagar to build under the scripts/ directory only with $(HOSTCC), but scripts/mod/ highly depends on the $(CC) and target arch headers. That it why the 'scripts' target must depend on 'asm-generic', 'gcc-plugins', and $(autoksyms_h). Move it to the 'prepare0' stage. I know this is a cheesy workaround, but better than the current situation. Signed-off-by: Masahiro Yamada <[email protected]>
1 parent 65bba04 commit 60df1ae

File tree

3 files changed

+3
-5
lines changed

3 files changed

+3
-5
lines changed

Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1075,7 +1075,7 @@ include/config/kernel.release: $(srctree)/Makefile FORCE
10751075
# Carefully list dependencies so we do not try to build scripts twice
10761076
# in parallel
10771077
PHONY += scripts
1078-
scripts: scripts_basic scripts_dtc asm-generic gcc-plugins $(autoksyms_h)
1078+
scripts: scripts_basic scripts_dtc
10791079
$(Q)$(MAKE) $(build)=$(@)
10801080

10811081
# Things we need to do before we recursively start building the kernel
@@ -1113,6 +1113,7 @@ macroprepare: prepare1 archmacros
11131113
archprepare: archheaders archscripts macroprepare scripts_basic gcc-plugins
11141114

11151115
prepare0: archprepare
1116+
$(Q)$(MAKE) $(build)=scripts/mod
11161117
$(Q)$(MAKE) $(build)=.
11171118

11181119
# All the preparing..

scripts/Makefile

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,8 @@ build_unifdef: $(obj)/unifdef
3737
@:
3838

3939
subdir-$(CONFIG_MODVERSIONS) += genksyms
40-
subdir-y += mod
4140
subdir-$(CONFIG_SECURITY_SELINUX) += selinux
4241
subdir-$(CONFIG_GDB_SCRIPTS) += gdb
4342

4443
# Let clean descend into subdirs
45-
subdir- += basic dtc kconfig package gcc-plugins
44+
subdir- += basic dtc kconfig mod package gcc-plugins

scripts/mod/Makefile

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@ OBJECT_FILES_NON_STANDARD := y
44
hostprogs-y := modpost mk_elfconfig
55
always := $(hostprogs-y) empty.o
66

7-
CFLAGS_REMOVE_empty.o := $(ASM_MACRO_FLAGS)
8-
97
modpost-objs := modpost.o file2alias.o sumversion.o
108

119
devicetable-offsets-file := devicetable-offsets.h

0 commit comments

Comments
 (0)