diff --git a/core/config.mk b/core/config.mk index fbd4696f6..cb5ddc8a1 100644 --- a/core/config.mk +++ b/core/config.mk @@ -601,6 +601,7 @@ SOONG_JAVAC_WRAPPER := $(SOONG_HOST_OUT_EXECUTABLES)/soong_javac_wrapper SOONG_ZIP := $(SOONG_HOST_OUT_EXECUTABLES)/soong_zip MERGE_ZIPS := $(SOONG_HOST_OUT_EXECUTABLES)/merge_zips XMLLINT := $(SOONG_HOST_OUT_EXECUTABLES)/xmllint +XZ := $(prebuilt_build_tools_bin)/xz ZIP2ZIP := $(SOONG_HOST_OUT_EXECUTABLES)/zip2zip ZIPTIME := $(prebuilt_build_tools_bin)/ziptime diff --git a/core/definitions.mk b/core/definitions.mk index d3d9928af..b0b92de75 100644 --- a/core/definitions.mk +++ b/core/definitions.mk @@ -1853,7 +1853,7 @@ if $(PRIVATE_STRIP) --strip-all -R .comment $< -o $@; then \ $(PRIVATE_OBJCOPY) -S --remove-section .gdb_index --remove-section .comment --keep-symbols=$@.keep_symbols $@.mini_debuginfo && \ $(PRIVATE_OBJCOPY) --rename-section saved_debug_frame=.debug_frame $@.mini_debuginfo && \ rm -f $@.mini_debuginfo.xz && \ - xz $@.mini_debuginfo && \ + $(XZ) $@.mini_debuginfo && \ $(PRIVATE_OBJCOPY) --add-section .gnu_debugdata=$@.mini_debuginfo.xz $@; \ else \ cp -f $< $@; \ diff --git a/core/dynamic_binary.mk b/core/dynamic_binary.mk index f44b8a88f..ebbe71c2d 100644 --- a/core/dynamic_binary.mk +++ b/core/dynamic_binary.mk @@ -145,15 +145,15 @@ endif ifeq ($(my_strip_module),mini-debug-info) # Strip the binary, but keep debug frames and symbol table in a compressed .gnu_debugdata section. -$(strip_output): $(strip_input) | $($(LOCAL_2ND_ARCH_VAR_PREFIX)TARGET_STRIP) $($(LOCAL_2ND_ARCH_VAR_PREFIX)TARGET_OBJCOPY) $($(LOCAL_2ND_ARCH_VAR_PREFIX)TARGET_NM) +$(strip_output): $(strip_input) $($(LOCAL_2ND_ARCH_VAR_PREFIX)TARGET_STRIP) $($(LOCAL_2ND_ARCH_VAR_PREFIX)TARGET_OBJCOPY) $($(LOCAL_2ND_ARCH_VAR_PREFIX)TARGET_NM) $(XZ) $(transform-to-stripped-keep-mini-debug-info) else ifneq ($(filter true no_debuglink,$(my_strip_module)),) # Strip the binary -$(strip_output): $(strip_input) | $($(LOCAL_2ND_ARCH_VAR_PREFIX)TARGET_STRIP) +$(strip_output): $(strip_input) $($(LOCAL_2ND_ARCH_VAR_PREFIX)TARGET_STRIP) $(transform-to-stripped) else ifeq ($(my_strip_module),keep_symbols) # Strip only the debug frames, but leave the symbol table. -$(strip_output): $(strip_input) | $($(LOCAL_2ND_ARCH_VAR_PREFIX)TARGET_STRIP) +$(strip_output): $(strip_input) $($(LOCAL_2ND_ARCH_VAR_PREFIX)TARGET_STRIP) $(transform-to-stripped-keep-symbols) # A product may be configured to strip everything in some build variants.