Commit 951e77cc authored by Kai Germaschewski's avatar Kai Germaschewski

kbuild: Silence some warnings when building vmlinux

For some people (though not me), the '+' indicating that a command will
invoke a sub-make didn't propagated properly, and caused a warning.
Putting the command all into one line should fix that.

Plus some cosmetics and clean up the per_cpu check.
parent 2020d74b
...@@ -319,36 +319,31 @@ define cmd_vmlinux__ ...@@ -319,36 +319,31 @@ define cmd_vmlinux__
endef endef
# set -e makes the rule exit immediately on error # set -e makes the rule exit immediately on error
# Final awk script makes sure per-cpu vars are in per-cpu section, as
# old gcc (eg egcs 2.92.11) ignores section attribute if uninitialized.
define rule_vmlinux__ define rule_vmlinux__
set -e set -e; \
$(if $(filter .tmp_kallsyms%,$^),, $(if $(filter .tmp_kallsyms%,$^),, \
echo ' Generating build number' echo ' GEN .version'; \
. $(src)/scripts/mkversion > .tmp_version . $(src)/scripts/mkversion > .tmp_version; \
mv -f .tmp_version .version mv -f .tmp_version .version; \
$(Q)$(MAKE) $(build)=init $(MAKE) $(build)=init; \
) )
$(call cmd,vmlinux__) $(call cmd,vmlinux__); \
echo 'cmd_$@ := $(cmd_vmlinux__)' > $(@D)/.$(@F).cmd echo 'cmd_$@ := $(cmd_vmlinux__)' > $(@D)/.$(@F).cmd
endef endef
define rule_vmlinux_no_percpu
$(rule_vmlinux__)
$(NM) $@ | grep -v '\(compiled\)\|\(\.o$$\)\|\( [aUw] \)\|\(\.\.ng$$\)\|\(LASH[RL]DI\)' | sort > System.map
endef
ifdef CONFIG_SMP ifdef CONFIG_SMP
# Final awk script makes sure per-cpu vars are in per-cpu section, as
# old gcc (eg egcs 2.92.11) ignores section attribute if uninitialized.
check_per_cpu = $(AWK) -f $(srctree)/scripts/per-cpu-check.awk < System.map
endif
define rule_vmlinux define rule_vmlinux
$(rule_vmlinux_no_percpu) $(rule_vmlinux__)
$(AWK) -f $(srctree)/scripts/per-cpu-check.awk < System.map $(NM) $@ | grep -v '\(compiled\)\|\(\.o$$\)\|\( [aUw] \)\|\(\.\.ng$$\)\|\(LASH[RL]DI\)' | sort > System.map
endef $(check_per_cpu)
else
define rule_vmlinux
$(rule_vmlinux_no_percpu)
endef endef
endif
LDFLAGS_vmlinux += -T arch/$(ARCH)/vmlinux.lds.s LDFLAGS_vmlinux += -T arch/$(ARCH)/vmlinux.lds.s
......
...@@ -17,5 +17,5 @@ $(obj)/version.o: include/linux/compile.h ...@@ -17,5 +17,5 @@ $(obj)/version.o: include/linux/compile.h
# actual file if its content has changed. # actual file if its content has changed.
include/linux/compile.h: FORCE include/linux/compile.h: FORCE
@echo -n ' Generating $@' @echo -n ' GEN $@'
@sh $(srctree)/scripts/mkcompile_h $@ "$(UTS_MACHINE)" "$(CONFIG_SMP)" "$(CC) $(CFLAGS)" @sh $(srctree)/scripts/mkcompile_h $@ "$(UTS_MACHINE)" "$(CONFIG_SMP)" "$(CC) $(CFLAGS)"
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment