Merge "Use xz prebuilt"

am: 9c6bc37da1

Change-Id: I2c09ecff34403ca2649c16f7e1fb5e517dfc293f
This commit is contained in:
Dan Willemsen
2018-03-10 03:06:00 +00:00
committed by android-build-merger
2 changed files with 5 additions and 3 deletions

View File

@@ -109,13 +109,14 @@ var (
"objcopyCmd", "prefix") "objcopyCmd", "prefix")
_ = pctx.SourcePathVariable("stripPath", "build/soong/scripts/strip.sh") _ = pctx.SourcePathVariable("stripPath", "build/soong/scripts/strip.sh")
_ = pctx.SourcePathVariable("xzCmd", "prebuilts/build-tools/${config.HostPrebuiltTag}/bin/xz")
strip = pctx.AndroidStaticRule("strip", strip = pctx.AndroidStaticRule("strip",
blueprint.RuleParams{ blueprint.RuleParams{
Depfile: "${out}.d", Depfile: "${out}.d",
Deps: blueprint.DepsGCC, Deps: blueprint.DepsGCC,
Command: "CROSS_COMPILE=$crossCompile $stripPath ${args} -i ${in} -o ${out} -d ${out}.d", Command: "CROSS_COMPILE=$crossCompile XZ=$xzCmd $stripPath ${args} -i ${in} -o ${out} -d ${out}.d",
CommandDeps: []string{"$stripPath"}, CommandDeps: []string{"$stripPath", "$xzCmd"},
}, },
"args", "crossCompile") "args", "crossCompile")

View File

@@ -18,6 +18,7 @@
# Inputs: # Inputs:
# Environment: # Environment:
# CROSS_COMPILE: prefix added to readelf, objcopy tools # CROSS_COMPILE: prefix added to readelf, objcopy tools
# XZ: path to the xz binary
# Arguments: # Arguments:
# -i ${file}: input file (required) # -i ${file}: input file (required)
# -o ${file}: output file (required) # -o ${file}: output file (required)
@@ -58,7 +59,7 @@ do_strip_keep_mini_debug_info() {
"${CROSS_COMPILE}objcopy" --rename-section .debug_frame=saved_debug_frame "${outfile}.debug" "${outfile}.mini_debuginfo" "${CROSS_COMPILE}objcopy" --rename-section .debug_frame=saved_debug_frame "${outfile}.debug" "${outfile}.mini_debuginfo"
"${CROSS_COMPILE}objcopy" -S --remove-section .gdb_index --remove-section .comment --keep-symbols="${outfile}.keep_symbols" "${outfile}.mini_debuginfo" "${CROSS_COMPILE}objcopy" -S --remove-section .gdb_index --remove-section .comment --keep-symbols="${outfile}.keep_symbols" "${outfile}.mini_debuginfo"
"${CROSS_COMPILE}objcopy" --rename-section saved_debug_frame=.debug_frame "${outfile}.mini_debuginfo" "${CROSS_COMPILE}objcopy" --rename-section saved_debug_frame=.debug_frame "${outfile}.mini_debuginfo"
xz "${outfile}.mini_debuginfo" "${XZ}" "${outfile}.mini_debuginfo"
"${CROSS_COMPILE}objcopy" --add-section .gnu_debugdata="${outfile}.mini_debuginfo.xz" "${outfile}.tmp" "${CROSS_COMPILE}objcopy" --add-section .gnu_debugdata="${outfile}.mini_debuginfo.xz" "${outfile}.tmp"
else else
cp -f "${infile}" "${outfile}.tmp" cp -f "${infile}" "${outfile}.tmp"