Commit 6fb4fec9 authored by Sam Ravnborg's avatar Sam Ravnborg Committed by Tom Rini

kbuild: Drop use of built-in.o in top level makefile

built-in.o were introduced in top-level Makefile to saves us from
linking the same .o files several times when kallsyms were enabled.
Unfortunately this caused a hard lock-up on x86_64 - so this patch drops
built-in.o again. Please note is was working on i386.

This patch also fixes some wording/spellings noticed by: Horst von Brand <vonbrand@inf.utfsm.cl>
Signed-off-by: default avatarSam Ravnborg <sam@ravnborg.org>
parent ed186fff
......@@ -545,7 +545,7 @@ libs-y := $(libs-y1) $(libs-y2)
# Build vmlinux
# ---------------------------------------------------------------------------
# vmlinux is build from the objects seleted by $(vmlinux-init) and
# vmlinux is build from the objects selected by $(vmlinux-init) and
# $(vmlinux-main). Most are built-in.o files from top-level directories
# in the kernel tree, others are specified in arch/$(ARCH)Makefile.
# Ordering when linking is important, and $(vmlinux-init) must be first.
......@@ -556,30 +556,33 @@ libs-y := $(libs-y1) $(libs-y2)
# +-< $(vmlinux-init)
# | +--< init/version.o + more
# |
# +-< built-in.o
# | +--< $(vmlinux-main)
# | +--< driver/built-in.o mm/built-in.o + more
# +--< $(vmlinux-main)
# | +--< driver/built-in.o mm/built-in.o + more
# |
# +-< kallsyms.o (see description in CONFIG_KALLSYMS section)
#
# vmlinux version cannot be updated during normal descending-into-subdirs
# phase since we do not yet know if we need to update vmlinux.
# vmlinux version (uname -v) cannot be updated during normal
# descending-into-subdirs phase since we do not yet know if we need to
# update vmlinux.
# Therefore this step is delayed until just before final link of vmlinux -
# except in kallsyms case where it is done just before adding the
# except in the kallsyms case where it is done just before adding the
# symbols to the kernel.
#
# System.map is generated to document addresses of all kernel symbols
vmlinux-init := $(head-y) $(init-y)
vmlinux-main := $(core-y) $(libs-y) $(drivers-y) $(net-y)
vmlinux-all := $(vmlinux-init) built-in.o
vmlinux-all := $(vmlinux-init) $(vmlinux-main)
vmlinux-lds := arch/$(ARCH)/kernel/vmlinux.lds
# Rule to link vmlinux - also used during CONFIG_KALLSYMS
# May be overridden by arch/$(ARCH)/Makefile
# Require first prerequisite to be the lds file
quiet_cmd_vmlinux__ = LD $@
cmd_vmlinux__ = $(LD) $(LDFLAGS) $(LDFLAGS_vmlinux) \
-T $(filter-out FORCE, $^) -o $@
cmd_vmlinux__ = $(LD) $(LDFLAGS) $(LDFLAGS_vmlinux) -o $@ \
-T $(vmlinux-lds) $(vmlinux-init) \
--start-group $(vmlinux-main) --end-group \
$(filter-out $(vmlinux-lds) $(vmlinux-init) $(vmlinux-main) FORCE ,$^)
# Generate new vmlinux version
quiet_cmd_vmlinux_version = GEN .version
......@@ -619,7 +622,7 @@ ifdef CONFIG_KALLSYMS
# o .tmp_vmlinux1 has all symbols and sections, but __kallsyms is
# empty
# Running kallsyms on that gives us .tmp_kallsyms1.o with
# the right size - vmlinux version updated during this step
# the right size - vmlinux version (uname -v) is updated during this step
# o .tmp_vmlinux2 now has a __kallsyms section of the right size,
# but due to the added section, some addresses have shifted.
# From here, we generate a correct .tmp_kallsyms2.o
......@@ -684,20 +687,9 @@ $(KALLSYMS): scripts ;
endif # ifdef CONFIG_KALLSYMS
# vmlinux image - including updated kernel symbols
vmlinux: $(vmlinux-lds) $(vmlinux-init) built-in.o $(kallsyms.o) FORCE
vmlinux: $(vmlinux-lds) $(vmlinux-init) $(vmlinux-main) $(kallsyms.o) FORCE
$(call if_changed_rule,vmlinux__)
# Link $(vmlinux-main) to speed up rest of build phase. No need to
# relink this part too many times.
# Use start/end-group to make sure to resolve all possible symbols
quiet_rule_vmlinux_partial = LD $@
cmd_vmlinux_partial = $(LD) $(LDFLAGS) $(LDFLAGS_$(*F)) -r \
--start-group $(filter-out FORCE, $^) \
--end-group -o $@
built-in.o: $(vmlinux-main) FORCE
$(call if_changed,vmlinux_partial)
# The actual objects are generated when descending,
# make sure no implicit rule kicks in
$(sort $(vmlinux-init) $(vmlinux-main)) $(vmlinux-lds): $(vmlinux-dirs) ;
......
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