toolchain: switch packaged toolchain to tar.xz
authorPaul Spooren <mail@aparcar.org>
Thu, 21 Oct 2021 01:54:26 +0000 (15:54 -1000)
committerPaul Spooren <mail@aparcar.org>
Thu, 21 Oct 2021 18:25:38 +0000 (08:25 -1000)
Currently the tar.bz2 while ImageBuilder and SDK switched to tar.xz.
Unify it for faster compression since it will make use of
multi-threading.

Signed-off-by: Paul Spooren <mail@aparcar.org>
target/toolchain/Makefile

index c3ba70db04ed7e4041f06d22b28c3109c338c8dd..c33bccee69190f509cb4de888189321c1a87f2cf 100644 (file)
@@ -26,7 +26,7 @@ all: compile
 
 TOOLCHAIN_PREFIX:=$(TOOLCHAIN_BUILD_DIR)/toolchain-$(ARCH)$(ARCH_SUFFIX)_gcc-$(GCCV)$(DIR_SUFFIX)
 
-$(BIN_DIR)/$(TOOLCHAIN_NAME).tar.bz2: clean
+$(BIN_DIR)/$(TOOLCHAIN_NAME).tar.xz: clean
        mkdir -p $(TOOLCHAIN_BUILD_DIR)
        $(TAR) -cf - -C $(TOPDIR)/staging_dir/  \
               $(foreach exclude,$(EXCLUDE_DIRS),--exclude="$(exclude)") \
@@ -62,13 +62,14 @@ $(BIN_DIR)/$(TOOLCHAIN_NAME).tar.bz2: clean
        find $(TOOLCHAIN_BUILD_DIR) -name CVS | $(XARGS) rm -rf
        mkdir -p $(BIN_DIR)
        (cd $(BUILD_DIR); \
-               tar cfj $@ $(TOOLCHAIN_NAME); \
+               tar -I '$(STAGING_DIR_HOST)/bin/xz -7e -T$(if $(filter 1,$(NPROC)),2,0)' -cf $@ $(TOOLCHAIN_NAME) \
+               --mtime="$(shell date --date=@$(SOURCE_DATE_EPOCH))"; \
        )
 
 download:
 prepare:
-compile: $(BIN_DIR)/$(TOOLCHAIN_NAME).tar.bz2
+compile: $(BIN_DIR)/$(TOOLCHAIN_NAME).tar.xz
 install: compile
 
 clean:
-       rm -rf $(TOOLCHAIN_BUILD_DIR) $(BIN_DIR)/$(TOOLCHAIN_NAME).tar.bz2
+       rm -rf $(TOOLCHAIN_BUILD_DIR) $(BIN_DIR)/$(TOOLCHAIN_NAME).tar.xz