Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(256)

Side by Side Diff: build/common.gypi

Issue 391743002: Enable warning on ASan-enabled build (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 # Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 # Use of this source code is governed by a BSD-style license that can be 2 # Use of this source code is governed by a BSD-style license that can be
3 # found in the LICENSE file. 3 # found in the LICENSE file.
4 4
5 # IMPORTANT: 5 # IMPORTANT:
6 # Please don't directly include this file if you are building via gyp_chromium, 6 # Please don't directly include this file if you are building via gyp_chromium,
7 # since gyp_chromium is automatically forcing its inclusion. 7 # since gyp_chromium is automatically forcing its inclusion.
8 { 8 {
9 # Variables expected to be overriden on the GYP command line (-D) or by 9 # Variables expected to be overriden on the GYP command line (-D) or by
10 # ~/.gyp/include.gypi. 10 # ~/.gyp/include.gypi.
(...skipping 3956 matching lines...) Expand 10 before | Expand all | Expand 10 after
3967 '<(DEPTH)/base/base.gyp:sanitizer_options', 3967 '<(DEPTH)/base/base.gyp:sanitizer_options',
3968 ], 3968 ],
3969 }], 3969 }],
3970 ], 3970 ],
3971 }], 3971 }],
3972 ['asan==1', { 3972 ['asan==1', {
3973 'target_conditions': [ 3973 'target_conditions': [
3974 ['_toolset=="target"', { 3974 ['_toolset=="target"', {
3975 'cflags': [ 3975 'cflags': [
3976 '-fsanitize=address', 3976 '-fsanitize=address',
3977 '-w', # http://crbug.com/162783 3977 '-Wno-error=macro-redefined', # http://crbug.com/162783
3978 ], 3978 ],
3979 'ldflags': [ 3979 'ldflags': [
3980 '-fsanitize=address', 3980 '-fsanitize=address',
3981 ], 3981 ],
3982 }], 3982 }],
3983 ], 3983 ],
3984 'conditions': [ 3984 'conditions': [
3985 ['OS=="mac"', { 3985 ['OS=="mac"', {
3986 'cflags': [ 3986 'cflags': [
3987 '-mllvm -asan-globals=0', # http://crbug.com/352073 3987 '-mllvm -asan-globals=0', # http://crbug.com/352073
3988 '-Wno-error=unused-function', # http://crbug.com/162783
3988 ], 3989 ],
3989 }], 3990 }],
3990 ], 3991 ],
3991 }], 3992 }],
3992 ['ubsan==1', { 3993 ['ubsan==1', {
3993 'target_conditions': [ 3994 'target_conditions': [
3994 ['_toolset=="target"', { 3995 ['_toolset=="target"', {
3995 'cflags': [ 3996 'cflags': [
3996 '-fsanitize=undefined', 3997 '-fsanitize=undefined',
3997 # -fsanitize=vptr is incompatible with -fno-rtti. 3998 # -fsanitize=vptr is incompatible with -fno-rtti.
3998 '-fno-sanitize=vptr', 3999 '-fno-sanitize=vptr',
3999 '-w', # http://crbug.com/162783 4000 '-Wno-error=macro-redefined', # http://crbug.com/162783
4000 ], 4001 ],
4001 'ldflags': [ 4002 'ldflags': [
4002 '-fsanitize=undefined', 4003 '-fsanitize=undefined',
4003 # -fsanitize=vptr is incompatible with -fno-rtti. 4004 # -fsanitize=vptr is incompatible with -fno-rtti.
4004 '-fno-sanitize=vptr', 4005 '-fno-sanitize=vptr',
4005 ], 4006 ],
4006 }], 4007 }],
4007 ], 4008 ],
4009 'conditions': [
4010 ['OS=="mac"', {
4011 'cflags': [
4012 '-Wno-error=unused-function', # http://crbug.com/162783
4013 ],
4014 }],
4015 ],
4008 }], 4016 }],
4009 ['ubsan_vptr==1', { 4017 ['ubsan_vptr==1', {
4010 'target_conditions': [ 4018 'target_conditions': [
4011 ['_toolset=="target"', { 4019 ['_toolset=="target"', {
4012 'cflags': [ 4020 'cflags': [
4013 '-fsanitize=vptr', 4021 '-fsanitize=vptr',
4014 '-fsanitize=null', # Avoid dereferences on null pointer objec ts. 4022 '-fsanitize=null', # Avoid dereferences on null pointer objec ts.
4015 '-fsanitize-blacklist=<(ubsan_vptr_blacklist)', 4023 '-fsanitize-blacklist=<(ubsan_vptr_blacklist)',
4016 '-w', # http://crbug.com/162783 4024 '-Wno-error=macro-redefined', # http://crbug.com/162783
4017 ], 4025 ],
4018 'cflags_cc!': [ 4026 'cflags_cc!': [
4019 '-fno-rtti', 4027 '-fno-rtti',
4020 ], 4028 ],
4021 'cflags!': [ 4029 'cflags!': [
4022 '-fno-rtti', 4030 '-fno-rtti',
4023 ], 4031 ],
4024 'ldflags': [ 4032 'ldflags': [
4025 '-fsanitize=vptr', # -fsanitize=null is not necessary. 4033 '-fsanitize=vptr', # -fsanitize=null is not necessary.
4026 ], 4034 ],
4027 'defines': [ 4035 'defines': [
4028 'UNDEFINED_SANITIZER', 4036 'UNDEFINED_SANITIZER',
4029 ], 4037 ],
4030 }], 4038 }],
4031 ], 4039 ],
4040 'conditions': [
4041 ['OS=="mac"', {
4042 'cflags': [
4043 '-Wno-error=unused-function', # http://crbug.com/162783
4044 ],
4045 }],
4046 ],
4032 }], 4047 }],
4033 ['asan_coverage!=0', { 4048 ['asan_coverage!=0', {
4034 'target_conditions': [ 4049 'target_conditions': [
4035 ['_toolset=="target"', { 4050 ['_toolset=="target"', {
4036 'cflags': [ 4051 'cflags': [
4037 '-mllvm -asan-coverage=<(asan_coverage)', 4052 '-mllvm -asan-coverage=<(asan_coverage)',
4038 ], 4053 ],
4039 }], 4054 }],
4040 ], 4055 ],
4041 }], 4056 }],
(...skipping 553 matching lines...) Expand 10 before | Expand all | Expand 10 after
4595 }], 4610 }],
4596 ], 4611 ],
4597 }], 4612 }],
4598 # Settings for building host targets using the system toolchain. 4613 # Settings for building host targets using the system toolchain.
4599 ['_toolset=="host"', { 4614 ['_toolset=="host"', {
4600 'cflags!': [ 4615 'cflags!': [
4601 # Due to issues in Clang build system, using ASan on 32-bit 4616 # Due to issues in Clang build system, using ASan on 32-bit
4602 # binaries on x86_64 host is problematic. 4617 # binaries on x86_64 host is problematic.
4603 # TODO(eugenis): re-enable. 4618 # TODO(eugenis): re-enable.
4604 '-fsanitize=address', 4619 '-fsanitize=address',
4605 '-w', # http://crbug.com/162783 4620 '-Wno-error=macro-redefined', # http://crbug.com/162783
4621
4606 ], 4622 ],
4607 'ldflags!': [ 4623 'ldflags!': [
4608 '-fsanitize=address', 4624 '-fsanitize=address',
4609 '-Wl,-z,noexecstack', 4625 '-Wl,-z,noexecstack',
4610 '-Wl,--gc-sections', 4626 '-Wl,--gc-sections',
4611 '-Wl,-O1', 4627 '-Wl,-O1',
4612 '-Wl,--as-needed', 4628 '-Wl,--as-needed',
4613 '-Wl,--warn-shared-textrel', 4629 '-Wl,--warn-shared-textrel',
4614 '-Wl,--fatal-warnings', 4630 '-Wl,--fatal-warnings',
4615 ], 4631 ],
4632 'conditions': [
4633 ['OS=="mac"', {
4634 'cflags!': [
4635 '-Wno-error=unused-function', # http://crbug.com/162783
4636 ],
4637 }],
4638 ],
4616 }], 4639 }],
4617 # Settings for building host targets on mac. 4640 # Settings for building host targets on mac.
4618 ['_toolset=="host" and host_os=="mac"', { 4641 ['_toolset=="host" and host_os=="mac"', {
4619 'ldflags!': [ 4642 'ldflags!': [
4620 '-Wl,-z,now', 4643 '-Wl,-z,now',
4621 '-Wl,-z,relro', 4644 '-Wl,-z,relro',
4622 ], 4645 ],
4623 }], 4646 }],
4624 ], 4647 ],
4625 }, 4648 },
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after
4758 ['clang==1', { 4781 ['clang==1', {
4759 'variables': { 4782 'variables': {
4760 'clang_dir': '../third_party/llvm-build/Release+Asserts/bin', 4783 'clang_dir': '../third_party/llvm-build/Release+Asserts/bin',
4761 }, 4784 },
4762 }], 4785 }],
4763 ['asan==1', { 4786 ['asan==1', {
4764 'xcode_settings': { 4787 'xcode_settings': {
4765 'OTHER_CFLAGS': [ 4788 'OTHER_CFLAGS': [
4766 '-fsanitize=address', 4789 '-fsanitize=address',
4767 '-mllvm -asan-globals=0', # http://crbug.com/352073 4790 '-mllvm -asan-globals=0', # http://crbug.com/352073
4768 '-w', # http://crbug.com/162783 4791 '-Wno-error=macro-redefined', # http://crbug.com/162783
4792 '-Wno-error=unused-function', # http://crbug.com/162783
4769 '-gline-tables-only', 4793 '-gline-tables-only',
4770 ], 4794 ],
4771 }, 4795 },
4772 }], 4796 }],
4773 ['asan_coverage!=0', { 4797 ['asan_coverage!=0', {
4774 'target_conditions': [ 4798 'target_conditions': [
4775 ['_toolset=="target"', { 4799 ['_toolset=="target"', {
4776 'cflags': [ 4800 'cflags': [
4777 '-mllvm -asan-coverage=<(asan_coverage)', 4801 '-mllvm -asan-coverage=<(asan_coverage)',
4778 ], 4802 ],
(...skipping 837 matching lines...) Expand 10 before | Expand all | Expand 10 after
5616 # settings in target dicts. SYMROOT is a special case, because many other 5640 # settings in target dicts. SYMROOT is a special case, because many other
5617 # Xcode variables depend on it, including variables such as 5641 # Xcode variables depend on it, including variables such as
5618 # PROJECT_DERIVED_FILE_DIR. When a source group corresponding to something 5642 # PROJECT_DERIVED_FILE_DIR. When a source group corresponding to something
5619 # like PROJECT_DERIVED_FILE_DIR is added to a project, in order for the 5643 # like PROJECT_DERIVED_FILE_DIR is added to a project, in order for the
5620 # files to appear (when present) in the UI as actual files and not red 5644 # files to appear (when present) in the UI as actual files and not red
5621 # red "missing file" proxies, the correct path to PROJECT_DERIVED_FILE_DIR, 5645 # red "missing file" proxies, the correct path to PROJECT_DERIVED_FILE_DIR,
5622 # and therefore SYMROOT, needs to be set at the project level. 5646 # and therefore SYMROOT, needs to be set at the project level.
5623 'SYMROOT': '<(DEPTH)/xcodebuild', 5647 'SYMROOT': '<(DEPTH)/xcodebuild',
5624 }, 5648 },
5625 } 5649 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698