ANDROID: kbuild: mod: Move $(obj) prefix inside awk

When compiling modules with a large number of object files,

  echo $(addprefix $(obj)/, /* the member .o's of module */)

may result in an a command line which is too long. To help alleviate
this problem, echo the members intermediate objects and add $(obj)/
prefix within AWK itself.

An equivalent of this patch will land in this larger series refactoring
LTO: https://lore.kernel.org/linux-kbuild/20220424190811.1678416-1-masahiroy@kernel.org/

Bug: 175420575
Change-Id: I02f1ea49d1a8aa29b76c69cadcb5e84dd2ae4aa3
Link: https://lore.kernel.org/all/CAK7LNAStLCBCur3QnfMnBrOUkixYbJK+C6TZVKYcGX9R3M=ANQ@mail.gmail.com/
Suggested-by: Masahiro Yamada <masahiroy@kernel.org>
Signed-off-by: Elliot Berman <quic_eberman@quicinc.com>
This commit is contained in:
Elliot Berman 2022-04-22 08:31:01 -07:00 committed by Todd Kjos
parent b72ece4853
commit f69ae9910d
1 changed files with 2 additions and 2 deletions

View File

@ -296,8 +296,8 @@ $(obj)/%.lto.o: $(obj)/%.o FORCE
$(call if_changed,cc_lto_link_modules)
endif
cmd_mod = echo $(addprefix $(obj)/, $(call real-search, $*.o, .o, -objs -y -m)) | \
$(AWK) -v RS='( |\n)' '!x[$$0]++' > $@
cmd_mod = echo $(call real-search, $*.o, .o, -objs -y -m) | \
$(AWK) -v RS='( |\n)' '!x[$$0]++ { print("$(obj)/"$$0) }' > $@
$(obj)/%.mod: FORCE
$(call if_changed,mod)