Add (yet another) option to allow stripping the chrome binary after dumping symbols. Chromebot does not like 200MB zip files and 800MB chrome binaries.

BUG=none
TEST=none
Review URL: http://codereview.chromium.org/259008

git-svn-id: http://src.chromium.org/svn/trunk/src/build@27795 4ff67af0-8c30-449e-8e8b-ad334ec8d88c
This commit is contained in:
thestig@chromium.org 2009-10-01 23:29:03 +00:00
Родитель 02a0c3f45a
Коммит 3657852c7c
2 изменённых файлов: 16 добавлений и 6 удалений

Просмотреть файл

@ -42,7 +42,8 @@
# situations. I.e. for Chrome bot.
'linux_chromium_breakpad%': 0,
# And if we want to dump symbols.
'linux_chromium_dump_symbols': 0,
'linux_chromium_dump_symbols%': 0,
# Also see linux_strip_binary below.
# By default, Linux does not use views. To turn on views in Linux,
# set the variable GYP_DEFINES to "toolkit_views=1", or modify
@ -147,6 +148,9 @@
# Set this to true to enable SELinux support.
'selinux%': 0,
# Strip the binary after dumping symbols.
'linux_strip_binary%': 0,
# Set to select the Title Case versions of strings in GRD files.
'use_titlecase_in_grd_files%': 0,

Просмотреть файл

@ -10,19 +10,21 @@
set -e
usage() {
echo "$0 <dump_syms_exe> <binary_with_symbols> <symbols_output>" >&2
echo -n "$0 <dump_syms_exe> <strip_binary> " >&2
echo "<binary_with_symbols> <symbols_output>" >&2
}
if [ $# -ne 3 ]; then
if [ $# -ne 4 ]; then
usage
exit 1
fi
SCRIPTDIR="$(readlink -f "$(dirname "$0")")"
DUMPSYMS="$1"
INFILE="$2"
OUTFILE="$3"
KEEP_STRIPPED_BINARY="$2"
INFILE="$3"
OUTFILE="$4"
STRIPPED=$(mktemp -q -t stripped-XXXXX)
if [ $? -ne 0 ]; then
@ -38,7 +40,11 @@ fi
# Strip the binary and calculate the signature of that, since that's what ships.
strip "$INFILE" -o "$STRIPPED"
NEWSIG=$("$SCRIPTDIR/dump_signature.py" "$STRIPPED")
rm "$STRIPPED"
if [ "$KEEP_STRIPPED_BINARY" != "0" ]; then
mv "$STRIPPED" "$INFILE"
else
rm "$STRIPPED"
fi
# Replace the old signature with the stripped signature in the symbols file.
sed -i "1s/ [0-9A-F]* / $NEWSIG /" "$OUTFILE"