diff options
author | mark@chromium.org <mark@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-03-26 20:46:06 +0000 |
---|---|---|
committer | mark@chromium.org <mark@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-03-26 20:46:06 +0000 |
commit | c39df1be83805795e884c691344daf5bde4c9ab2 (patch) | |
tree | bfdaa1027e69b9403f9be29017cbf5aa2ea9c95c /build | |
parent | e2f7713807ec4472db71cabcb0cfa0f03a902e72 (diff) | |
download | chromium_src-c39df1be83805795e884c691344daf5bde4c9ab2.zip chromium_src-c39df1be83805795e884c691344daf5bde4c9ab2.tar.gz chromium_src-c39df1be83805795e884c691344daf5bde4c9ab2.tar.bz2 |
Don't strip main from the browser or helper app executables. This helps
backtraces of stripped executables look more reasonable.
BUG=39232
TEST=gdb backtrace in a stripped executable with no symbols loaded should show
thread 0 beginning in main
Review URL: http://codereview.chromium.org/1460001
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@42817 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'build')
-rwxr-xr-x | build/mac/strip_from_xcode | 30 |
1 files changed, 25 insertions, 5 deletions
diff --git a/build/mac/strip_from_xcode b/build/mac/strip_from_xcode index 7ef0e28..ac39aab 100755 --- a/build/mac/strip_from_xcode +++ b/build/mac/strip_from_xcode @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash # Copyright (c) 2008 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be @@ -19,16 +19,19 @@ if [ "${CONFIGURATION}" != "Release" ] ; then exit 0 fi +declare -a FLAGS + # MACH_O_TYPE is not set for a command-line tool, so check PRODUCT_TYPE too. # Weird. if [ "${MACH_O_TYPE}" = "mh_execute" ] || \ [ "${PRODUCT_TYPE}" = "com.apple.product-type.tool" ] ; then - # Strip everything - STRIPFLAGS= + # Strip everything (no special flags). No-op. + true elif [ "${MACH_O_TYPE}" = "mh_dylib" ] || \ "${MACH_O_TYPE}" = "mh_bundle" ]; then # Strip debugging symbols and local symbols - STRIPFLAGS="-S -x" + FLAGS[${#FLAGS[@]}]=-S + FLAGS[${#FLAGS[@]}]=-x elif [ "${MACH_O_TYPE}" = "staticlib" ] ; then # Don't strip static libraries. exit 0 @@ -38,5 +41,22 @@ else exit 0 fi -exec "$(dirname ${0})/strip_save_dsym" ${STRIPFLAGS} \ +if [ -n "${STRIPFLAGS}" ] ; then + # Pick up the standard STRIPFLAGS Xcode setting, used for "Additional Strip + # Flags". + for stripflag in "${STRIPFLAGS}" ; do + FLAGS[${#FLAGS[@]}]="${stripflag}" + done +fi + +if [ -n "${CHROMIUM_STRIP_SAVE_FILE}" ] ; then + # An Xcode project can communicate a file listing symbols to saved in this + # environment variable by setting it as a build setting. This isn't a + # standard Xcode setting. It's used in preference to STRIPFLAGS to + # eliminate quoting ambiguity concerns. + FLAGS[${#FLAGS[@]}]=-s + FLAGS[${#FLAGS[@]}]="${CHROMIUM_STRIP_SAVE_FILE}" +fi + +exec "$(dirname ${0})/strip_save_dsym" "${FLAGS[@]}" \ "${BUILT_PRODUCTS_DIR}/${EXECUTABLE_PATH}" |