diff options
-rwxr-xr-x | build/mac/strip_from_xcode | 30 | ||||
-rw-r--r-- | chrome/app/app.saves | 8 | ||||
-rw-r--r-- | chrome/app/chrome_exe_main.mm | 1 | ||||
-rw-r--r-- | chrome/chrome.gyp | 1 | ||||
-rw-r--r-- | chrome/chrome_dll.gypi | 1 | ||||
-rw-r--r-- | chrome/chrome_exe.gypi | 1 |
6 files changed, 36 insertions, 6 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}" diff --git a/chrome/app/app.saves b/chrome/app/app.saves new file mode 100644 index 0000000..252f544 --- /dev/null +++ b/chrome/app/app.saves @@ -0,0 +1,8 @@ +# 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. + +# This file lists symbols that should not be stripped from the Mac browser and +# helper app executables. + +_main diff --git a/chrome/app/chrome_exe_main.mm b/chrome/app/chrome_exe_main.mm index 5594282..4f2e474 100644 --- a/chrome/app/chrome_exe_main.mm +++ b/chrome/app/chrome_exe_main.mm @@ -11,6 +11,7 @@ extern "C" { int ChromeMain(int argc, char** argv); } +__attribute__((visibility("default"))) int main(int argc, char* argv[]) { int rv = ChromeMain(argc, argv); diff --git a/chrome/chrome.gyp b/chrome/chrome.gyp index eb07bb5..f3c496a 100644 --- a/chrome/chrome.gyp +++ b/chrome/chrome.gyp @@ -1046,6 +1046,7 @@ 'xcode_settings': { 'CHROMIUM_BUNDLE_ID': '<(mac_bundle_id)', 'CHROMIUM_SHORT_NAME': '<(branding)', + 'CHROMIUM_STRIP_SAVE_FILE': 'app/app.saves', 'INFOPLIST_FILE': 'app/helper-Info.plist', }, 'copies': [ diff --git a/chrome/chrome_dll.gypi b/chrome/chrome_dll.gypi index 3ac0a7c..d6dd68a 100644 --- a/chrome/chrome_dll.gypi +++ b/chrome/chrome_dll.gypi @@ -171,7 +171,6 @@ 'sources': [ 'app/chrome_dll_main.cc', 'app/chrome_dll_resource.h', - 'app/chrome_exe_main.mm', ], 'include_dirs': [ '<(grit_out_dir)', diff --git a/chrome/chrome_exe.gypi b/chrome/chrome_exe.gypi index 995032a..570357d4 100644 --- a/chrome/chrome_exe.gypi +++ b/chrome/chrome_exe.gypi @@ -35,6 +35,7 @@ 'app/app-Info.plist', ], 'xcode_settings': { + 'CHROMIUM_STRIP_SAVE_FILE': 'app/app.saves', 'INFOPLIST_FILE': 'app/app-Info.plist', }, 'conditions': [ |