Skip to content

Commit

Permalink
Makefile.lib: Stop calling size_append
Browse files Browse the repository at this point in the history
Fixes extremely slow compile times of techpack driver.

Co-authored-by: Yaroslav Furman <yaro330@gmail.com>
Signed-off-by: Julian Liu <wlootlxt123@gmail.com>
Change-Id: Ifed2ecdabcebdf363d3cca7cb6dedfefaee91b54
Signed-off-by: engstk <eng.stk@sapo.pt>
  • Loading branch information
2 people authored and acuicultor committed Feb 12, 2021
1 parent 4b4872b commit b493376
Showing 1 changed file with 21 additions and 26 deletions.
47 changes: 21 additions & 26 deletions scripts/Makefile.lib
Expand Up @@ -326,38 +326,35 @@ cmd_cat = (cat $(filter-out FORCE,$^) > $@) || (rm -f $@; false)

# Bzip2 and LZMA do not include size in file... so we have to fake that;
# append the size as a 32-bit littleendian number as gzip does.
# size_append = printf $(shell \
# dec_size=0; \
# for F in $1; do \
# fsize=$$($(CONFIG_SHELL) $(srctree)/scripts/file-size.sh $$F); \
# dec_size=$$(expr $$dec_size + $$fsize); \
# done; \
# printf "%08x\n" $$dec_size | \
# sed 's/\(..\)/\1 /g' | { \
# read ch0 ch1 ch2 ch3; \
# for ch in $$ch3 $$ch2 $$ch1 $$ch0; do \
# printf '%s%03o' '\\' $$((0x$$ch)); \
# done; \
# } \
# )

# quiet_cmd_bzip2 = BZIP2 $@
# cmd_bzip2 = (cat $(filter-out FORCE,$^) | \
# bzip2 -9 && $(call size_append, $(filter-out FORCE,$^))) > $@ || \
# (rm -f $@ ; false)
size_append = printf $(shell \
dec_size=0; \
for F in $1; do \
fsize=$$($(CONFIG_SHELL) $(srctree)/scripts/file-size.sh $$F); \
dec_size=$$(expr $$dec_size + $$fsize); \
done; \
printf "%08x\n" $$dec_size | \
sed 's/\(..\)/\1 /g' | { \
read ch0 ch1 ch2 ch3; \
for ch in $$ch3 $$ch2 $$ch1 $$ch0; do \
printf '%s%03o' '\\' $$((0x$$ch)); \
done; \
} \
)

quiet_cmd_bzip2 = BZIP2 $@
cmd_bzip2 = (cat $(filter-out FORCE,$^) | \
bzip2 -9 || (rm -f $@ ; false)

# Lzma
# ---------------------------------------------------------------------------

quiet_cmd_lzma = LZMA $@
cmd_lzma = (cat $(filter-out FORCE,$^) | \
lzma -9 && $(call size_append, $(filter-out FORCE,$^))) > $@ || \
(rm -f $@ ; false)
lzma -9 || (rm -f $@ ; false)

quiet_cmd_lzo = LZO $@
cmd_lzo = (cat $(filter-out FORCE,$^) | \
lzop -9 && $(call size_append, $(filter-out FORCE,$^))) > $@ || \
(rm -f $@ ; false)
lzop -9 || (rm -f $@ ; false)

quiet_cmd_lz4 = LZ4 $@
cmd_lz4 = (cat $(filter-out FORCE,$^) | \
Expand Down Expand Up @@ -407,9 +404,7 @@ quiet_cmd_uimage = UIMAGE $(UIMAGE_OUT)
# decompression mode. A BCJ filter isn't used either.
quiet_cmd_xzkern = XZKERN $@
cmd_xzkern = (cat $(filter-out FORCE,$^) | \
sh $(srctree)/scripts/xz_wrap.sh && \
$(call size_append, $(filter-out FORCE,$^))) > $@ || \
(rm -f $@ ; false)
sh $(srctree)/scripts/xz_wrap.sh || (rm -f $@ ; false)

quiet_cmd_xzmisc = XZMISC $@
cmd_xzmisc = (cat $(filter-out FORCE,$^) | \
Expand Down

0 comments on commit b493376

Please sign in to comment.