Commit f0d50ca0 authored by Masahiro Yamada's avatar Masahiro Yamada

kbuild: refactor KBUILD_VMLINUX_{OBJS,LIBS} calculation

Do not overwrite core-y or drivers-y. Remove libs-y1 and libs-y2.
Signed-off-by: default avatarMasahiro Yamada <masahiroy@kernel.org>
parent 95fb6317
...@@ -1069,19 +1069,18 @@ vmlinux-alldirs := $(sort $(vmlinux-dirs) Documentation \ ...@@ -1069,19 +1069,18 @@ vmlinux-alldirs := $(sort $(vmlinux-dirs) Documentation \
build-dirs := $(vmlinux-dirs) build-dirs := $(vmlinux-dirs)
clean-dirs := $(vmlinux-alldirs) clean-dirs := $(vmlinux-alldirs)
core-y := $(patsubst %/, %/built-in.a, $(core-y)) # Externally visible symbols (used by link-vmlinux.sh)
drivers-y := $(patsubst %/, %/built-in.a, $(drivers-y)) KBUILD_VMLINUX_OBJS := $(head-y) $(patsubst %/,%/built-in.a, $(core-y))
libs-y2 := $(patsubst %/, %/built-in.a, $(filter %/, $(libs-y))) KBUILD_VMLINUX_OBJS += $(addsuffix built-in.a, $(filter %/, $(libs-y)))
ifdef CONFIG_MODULES ifdef CONFIG_MODULES
libs-y1 := $(filter-out %/, $(libs-y)) KBUILD_VMLINUX_OBJS += $(patsubst %/, %/lib.a, $(filter %/, $(libs-y)))
libs-y2 += $(patsubst %/, %/lib.a, $(filter %/, $(libs-y))) KBUILD_VMLINUX_LIBS := $(filter-out %/, $(libs-y))
else else
libs-y1 := $(patsubst %/, %/lib.a, $(libs-y)) KBUILD_VMLINUX_LIBS := $(patsubst %/,%/lib.a, $(libs-y))
endif endif
KBUILD_VMLINUX_OBJS += $(patsubst %/,%/built-in.a, $(drivers-y))
# Externally visible symbols (used by link-vmlinux.sh) export KBUILD_VMLINUX_OBJS KBUILD_VMLINUX_LIBS
export KBUILD_VMLINUX_OBJS := $(head-y) $(core-y) $(libs-y2) $(drivers-y)
export KBUILD_VMLINUX_LIBS := $(libs-y1)
export KBUILD_LDS := arch/$(SRCARCH)/kernel/vmlinux.lds export KBUILD_LDS := arch/$(SRCARCH)/kernel/vmlinux.lds
export LDFLAGS_vmlinux export LDFLAGS_vmlinux
# used by scripts/Makefile.package # used by scripts/Makefile.package
......
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