Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 78e3282d authored by qctecmdr's avatar qctecmdr Committed by Gerrit - the friendly Code Review server
Browse files

Merge "Kbuild: Support nested composite objects"

parents cb6f97e5 ac9f9a91
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -5,6 +5,10 @@ SUBLEVEL = 61
EXTRAVERSION =
NAME = Kleptomaniac Octopus

# indicate that change "Kbuild: Support nested composite objects" is
# present in the kernel so that out-of-tree modules can act upon it
export KERNEL_SUPPORTS_NESTED_COMPOSITES := y

# *DOCUMENTATION*
# To see a list of typical targets execute "make help"
# More info can be located in ./README
+11 −4
Original line number Diff line number Diff line
@@ -41,9 +41,13 @@ obj-m := $(filter-out %/, $(obj-m))
# Subdirectories we need to descend into
subdir-ym	:= $(sort $(subdir-y) $(subdir-m))

# Expand $(foo-objs) $(foo-y) by calling $(call suffix-search,foo.o,-objs -y)
suffix-search = $(foreach s,$(2),$($(1:.o=$s)))
# If $(foo-objs), $(foo-y), $(foo-m), or $(foo-) exists, foo.o is a composite object
multi-used-y := $(sort $(foreach m,$(obj-y), $(if $(strip $($(m:.o=-objs)) $($(m:.o=-y)) $($(m:.o=-))), $(m))))
multi-used-m := $(sort $(foreach m,$(obj-m), $(if $(strip $($(m:.o=-objs)) $($(m:.o=-y)) $($(m:.o=-m)) $($(m:.o=-))), $(m))))
multi-search = $(sort $(foreach m,$(1),$(if $(strip $(call suffix-search,$(m),$(2) -)),\
	$(m) $(call multi-search,$(filter-out $(m),$(call suffix-search,$(m),$(2))),$(2)))))
multi-used-y := $(call multi-search,$(obj-y),-objs -y)
multi-used-m := $(call multi-search,$(obj-m),-objs -y -m)
multi-used   := $(multi-used-y) $(multi-used-m)

# $(subdir-obj-y) is the list of objects in $(obj-y) which uses dir/ to
@@ -52,8 +56,11 @@ subdir-obj-y := $(filter %/built-in.a, $(obj-y))

# Replace multi-part objects by their individual parts,
# including built-in.a from subdirectories
real-obj-y := $(foreach m, $(obj-y), $(if $(strip $($(m:.o=-objs)) $($(m:.o=-y)) $($(m:.o=-))),$($(m:.o=-objs)) $($(m:.o=-y)),$(m)))
real-obj-m := $(foreach m, $(obj-m), $(if $(strip $($(m:.o=-objs)) $($(m:.o=-y)) $($(m:.o=-m)) $($(m:.o=-))),$($(m:.o=-objs)) $($(m:.o=-y)) $($(m:.o=-m)),$(m)))
real-search = $(foreach m,$(1), $(if $(strip $(call suffix-search,$(m),$(2) -)), \
	$(filter $(m),$(call suffix-search,$(m),$(2))) $(call real-search,$(filter-out $(m),$(call suffix-search,$(m),$(2))),$(2)),\
	$(m)))
real-obj-y := $(call real-search, $(obj-y),-objs -y)
real-obj-m := $(call real-search, $(obj-m),-objs -y -m)

# DTB
# If CONFIG_OF_ALL_DTBS is enabled, all DT blobs are built