Commit d051b21c authored by glider's avatar glider Committed by Commit bot

Another attempt to fix debug info stripping for ASan on OSX

Unce upon a time the ASan runtime library used to be statically linked into
the executables on OSX.
Because that library provided a number of API functions needed by the shared
libraries, we had custom ASan-specific .saves files that told the `strip`
utility to preserve those functions when stripping the executables.

Then ASan switched to using dynamic runtime library, which instantly broke the
stripping step, because the executables weren't necessarily referencing all the
ASan API functions (issue 242503).
As a result, stripping has been disabled, and we haven't had .dSYM debug info
for ASan builds for more than a year now (issue 148383).

Because the ASan API functions are now undefined in the executables, it's
actually senseless to use the .saves files to preserve those functions in each
executable. However __asan_default_options still must be preserved to be accessible
from the ASan runtime.

This CL removes all ASan symbols except for __asan_default_options from the .saves files
and makes Chromium.app and Chromium Helper.app correctly use app_asan.saves.
It also turns mac_strip_release on for ASan builds.

BUG=148383,242503,170739,166857
R=mark@chromium.org
TBR=cpu@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#296413}
parent ab0a39ec
...@@ -2,22 +2,8 @@ ...@@ -2,22 +2,8 @@
# Use of this source code is governed by a BSD-style license that can be # Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file. # found in the LICENSE file.
# This file lists symbols that should not be stripped by Xcode from the binaries # This file lists symbols that should not be stripped from the Mac executables
# built for Mac OS X using AddressSanitizer # built with AddressSanitizer
# (http://dev.chromium.org/developers/testing/addresssanitizer). # (http://dev.chromium.org/developers/testing/addresssanitizer).
___asan_init ___asan_default_options
___asan_handle_no_return
___asan_register_global
___asan_register_globals
___asan_unregister_globals
___asan_report_load1
___asan_report_load2
___asan_report_load4
___asan_report_load8
___asan_report_load16
___asan_report_store1
___asan_report_store2
___asan_report_store4
___asan_report_store8
___asan_report_store16
...@@ -2154,7 +2154,7 @@ ...@@ -2154,7 +2154,7 @@
['asan==1 and OS=="mac"', { ['asan==1 and OS=="mac"', {
# TODO(glider): we do not strip ASan binaries until the dynamic ASan # TODO(glider): we do not strip ASan binaries until the dynamic ASan
# runtime is fully adopted. See http://crbug.com/242503. # runtime is fully adopted. See http://crbug.com/242503.
'mac_strip_release': 0, 'mac_strip_release': 1,
}], }],
['tsan==1', { ['tsan==1', {
'use_custom_libcxx%': 1, 'use_custom_libcxx%': 1,
...@@ -5001,10 +5001,10 @@ ...@@ -5001,10 +5001,10 @@
'conditions': [ 'conditions': [
['asan==1', { ['asan==1', {
'variables': { 'variables': {
'asan_saves_file': 'asan.saves', 'asan_saves_file_path': 'asan.saves',
}, },
'xcode_settings': { 'xcode_settings': {
'CHROMIUM_STRIP_SAVE_FILE': '<(asan_saves_file)', 'CHROMIUM_STRIP_SAVE_FILE': '<(asan_saves_file_path)',
}, },
}], }],
], ],
...@@ -5051,7 +5051,7 @@ ...@@ -5051,7 +5051,7 @@
'conditions': [ 'conditions': [
['asan==1', { ['asan==1', {
'STRIPFLAGS': '-s $(CHROMIUM_STRIP_SAVE_FILE)', 'STRIPFLAGS': '-s $(CHROMIUM_STRIP_SAVE_FILE)',
}] }],
], ],
}], # _type=="executable" and asan==1 }], # _type=="executable" and asan==1
], # target_conditions ], # target_conditions
......
...@@ -8,25 +8,7 @@ ...@@ -8,25 +8,7 @@
# The list of Chromium application-specific symbols should be the same as that # The list of Chromium application-specific symbols should be the same as that
# in chrome/app/app.saves # in chrome/app/app.saves
# The list of symbols that should be preserved in all the binaries built with
# AddressSanitizer should correspond to build/asan.saves
# Chromium-specific symbols.
_main _main
# AddressSanitizer-specific symbols. # AddressSanitizer-specific symbols.
___asan_init ___asan_default_options
___asan_handle_no_return
___asan_register_global
___asan_register_globals
___asan_unregister_globals
___asan_report_load1
___asan_report_load2
___asan_report_load4
___asan_report_load8
___asan_report_load16
___asan_report_store1
___asan_report_store2
___asan_report_store4
___asan_report_store8
___asan_report_store16
...@@ -90,6 +90,12 @@ ...@@ -90,6 +90,12 @@
'../tools/cygprofile/cygprofile.gyp:cygprofile', '../tools/cygprofile/cygprofile.gyp:cygprofile',
], ],
}], }],
['asan==1', {
'xcode_settings': {
'CHROMIUM_STRIP_SAVE_FILE': 'app/app_asan.saves',
'STRIPFLAGS': '-s $(CHROMIUM_STRIP_SAVE_FILE)',
},
}],
['order_text_section!=""', { ['order_text_section!=""', {
'target_conditions' : [ 'target_conditions' : [
['_toolset=="target"', { ['_toolset=="target"', {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment