Fix some build symbol configuration.

Remove -gdwarf-4 from GYP build. This is the default for GCC 4.8 which is now required, so this command-line argument is redundant.

Only set use_debug_fission in the GN build in debug mode. This matches GYP. Release mode symbols will be non-fission.

Implement linux_symbols target in GN. Convert dump_app_syms from sh to Python for better GN usability, and it's more readable for normal programmers on the team.

Reland of https://codereview.chromium.org/1179393004/

TBR=thakis@chromium.org

Review URL: https://codereview.chromium.org/1182663007

Cr-Original-Commit-Position: refs/heads/master@{#334690}
Cr-Mirrored-From: https://chromium.googlesource.com/chromium/src
Cr-Mirrored-Commit: 07d847b1c5451748f16f4e7973ce8ef9078d47a2
This commit is contained in:
brettw 2015-06-16 13:59:02 -07:00 коммит произвёл Commit bot
Родитель 21c772dc92
Коммит 3ece569951
4 изменённых файлов: 31 добавлений и 39 удалений

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

@ -3693,7 +3693,6 @@
'cflags': [
'-O>(debug_optimize)',
'-g',
'-gdwarf-4',
],
'conditions' : [
['OS=="android" and target_arch!="mipsel" and target_arch!="mips64el"', {

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

@ -51,8 +51,8 @@ declare_args() {
# with some utilities such as icecc and ccache. Requires gold and
# gcc >= 4.8 or clang.
# http://gcc.gnu.org/wiki/DebugFission
use_debug_fission =
!is_win && use_gold && linux_use_bundled_binutils && !use_ccache
use_debug_fission = is_debug && !is_win && use_gold &&
linux_use_bundled_binutils && !use_ccache
if (is_win) {
# Whether the VS xtree header has been patched to disable warning 4702. If

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

@ -1,36 +0,0 @@
#!/bin/sh
# Copyright (c) 2010 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
#
# Helper script to run dump_syms on Chrome Linux executables and strip
# them if needed.
set -e
usage() {
echo -n "$0 <dump_syms_exe> <strip_binary> " >&2
echo "<binary_with_symbols> <symbols_output>" >&2
}
if [ $# -ne 4 ]; then
usage
exit 1
fi
SCRIPTDIR="$(readlink -f "$(dirname "$0")")"
DUMPSYMS="$1"
STRIP_BINARY="$2"
INFILE="$3"
OUTFILE="$4"
# Dump the symbols from the given binary.
if [ ! -e "$OUTFILE" -o "$INFILE" -nt "$OUTFILE" ]; then
"$DUMPSYMS" -r "$INFILE" > "$OUTFILE"
fi
if [ "$STRIP_BINARY" != "0" ]; then
strip "$INFILE"
fi

29
linux/dump_app_syms.py Normal file
Просмотреть файл

@ -0,0 +1,29 @@
# Copyright 2015 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
# Helper script to run dump_syms on Chrome Linux executables and strip
# them if needed.
import os
import subprocess
import sys
if len(sys.argv) != 5:
print "dump_app_syms.py <dump_syms_exe> <strip_binary>"
print " <binary_with_symbols> <symbols_output>"
sys.exit(1)
dumpsyms = sys.argv[1]
strip_binary = sys.argv[2]
infile = sys.argv[3]
outfile = sys.argv[4]
# Dump only when the output file is out-of-date.
if not os.path.isfile(outfile) or \
os.stat(outfile).st_mtime > os.stat(infile).st_mtime:
with open(outfile, 'w') as outfileobj:
subprocess.check_call([dumpsyms, '-r', infile], stdout=outfileobj)
if strip_binary != '0':
subprocess.check_call(['strip', infile])