OLD | NEW |
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 373 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
384 # Track where uninitialized memory originates from. From fastest to | 384 # Track where uninitialized memory originates from. From fastest to |
385 # slowest: 0 - no tracking, 1 - track only the initial allocation site, 2 | 385 # slowest: 0 - no tracking, 1 - track only the initial allocation site, 2 |
386 # - track the chain of stores leading from allocation site to use site. | 386 # - track the chain of stores leading from allocation site to use site. |
387 'msan_track_origins%': 1, | 387 'msan_track_origins%': 1, |
388 | 388 |
389 # Enable building with UBSan (Clang's -fsanitize=undefined option). | 389 # Enable building with UBSan (Clang's -fsanitize=undefined option). |
390 # -fsanitize=undefined only works with clang, but ubsan=1 implies clang=1 | 390 # -fsanitize=undefined only works with clang, but ubsan=1 implies clang=1 |
391 # See http://clang.llvm.org/docs/UsersManual.html | 391 # See http://clang.llvm.org/docs/UsersManual.html |
392 'ubsan%': 0, | 392 'ubsan%': 0, |
393 | 393 |
| 394 # Enable building with UBsan's vptr (Clang's -fsanitize=vptr -fsanitize=nu
ll options). |
| 395 # -fsanitize=vptr only works with clang, but ubsan_vptr=1 implies clang=1 |
| 396 'ubsan_vptr%': 0, |
| 397 'ubsan_vptr_blacklist%': '<(PRODUCT_DIR)/../../tools/ubsan_vptr/blacklist.
txt', |
| 398 |
394 # Use the dynamic libraries instrumented by one of the sanitizers | 399 # Use the dynamic libraries instrumented by one of the sanitizers |
395 # instead of the standard system libraries. | 400 # instead of the standard system libraries. |
396 'use_instrumented_libraries%': 0, | 401 'use_instrumented_libraries%': 0, |
397 | 402 |
398 # Use libc++ (third_party/libc++ and third_party/libc++abi) instead of | 403 # Use libc++ (third_party/libc++ and third_party/libc++abi) instead of |
399 # stdlibc++ as standard library. This is intended to use for instrumented | 404 # stdlibc++ as standard library. This is intended to use for instrumented |
400 # builds. | 405 # builds. |
401 'use_custom_libcxx%': 0, | 406 'use_custom_libcxx%': 0, |
402 | 407 |
403 # Use a modified version of Clang to intercept allocated types and sizes | 408 # Use a modified version of Clang to intercept allocated types and sizes |
(...skipping 655 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1059 'use_sanitizer_options%': '<(use_sanitizer_options)', | 1064 'use_sanitizer_options%': '<(use_sanitizer_options)', |
1060 'syzyasan%': '<(syzyasan)', | 1065 'syzyasan%': '<(syzyasan)', |
1061 'syzygy_optimize%': '<(syzygy_optimize)', | 1066 'syzygy_optimize%': '<(syzygy_optimize)', |
1062 'lsan%': '<(lsan)', | 1067 'lsan%': '<(lsan)', |
1063 'msan%': '<(msan)', | 1068 'msan%': '<(msan)', |
1064 'msan_blacklist%': '<(msan_blacklist)', | 1069 'msan_blacklist%': '<(msan_blacklist)', |
1065 'msan_track_origins%': '<(msan_track_origins)', | 1070 'msan_track_origins%': '<(msan_track_origins)', |
1066 'tsan%': '<(tsan)', | 1071 'tsan%': '<(tsan)', |
1067 'tsan_blacklist%': '<(tsan_blacklist)', | 1072 'tsan_blacklist%': '<(tsan_blacklist)', |
1068 'ubsan%': '<(ubsan)', | 1073 'ubsan%': '<(ubsan)', |
| 1074 'ubsan_vptr%': '<(ubsan_vptr)', |
| 1075 'ubsan_vptr_blacklist%': '<(ubsan_vptr_blacklist)', |
1069 'use_instrumented_libraries%': '<(use_instrumented_libraries)', | 1076 'use_instrumented_libraries%': '<(use_instrumented_libraries)', |
1070 'use_custom_libcxx%': '<(use_custom_libcxx)', | 1077 'use_custom_libcxx%': '<(use_custom_libcxx)', |
1071 'clang_type_profiler%': '<(clang_type_profiler)', | 1078 'clang_type_profiler%': '<(clang_type_profiler)', |
1072 'order_profiling%': '<(order_profiling)', | 1079 'order_profiling%': '<(order_profiling)', |
1073 'order_text_section%': '<(order_text_section)', | 1080 'order_text_section%': '<(order_text_section)', |
1074 'enable_extensions%': '<(enable_extensions)', | 1081 'enable_extensions%': '<(enable_extensions)', |
1075 'enable_plugin_installation%': '<(enable_plugin_installation)', | 1082 'enable_plugin_installation%': '<(enable_plugin_installation)', |
1076 'enable_plugins%': '<(enable_plugins)', | 1083 'enable_plugins%': '<(enable_plugins)', |
1077 'enable_session_service%': '<(enable_session_service)', | 1084 'enable_session_service%': '<(enable_session_service)', |
1078 'enable_themes%': '<(enable_themes)', | 1085 'enable_themes%': '<(enable_themes)', |
(...skipping 370 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1449 'syzygy_optimize%': 0, | 1456 'syzygy_optimize%': 0, |
1450 }], | 1457 }], |
1451 # Get binutils version so we can enable debug fission if we can. | 1458 # Get binutils version so we can enable debug fission if we can. |
1452 ['os_posix==1 and OS!="mac" and OS!="ios"', { | 1459 ['os_posix==1 and OS!="mac" and OS!="ios"', { |
1453 'conditions': [ | 1460 'conditions': [ |
1454 # compiler_version doesn't work with clang | 1461 # compiler_version doesn't work with clang |
1455 # TODO(mithro): Land https://codereview.chromium.org/199793014/ so | 1462 # TODO(mithro): Land https://codereview.chromium.org/199793014/ so |
1456 # compiler_version works with clang. | 1463 # compiler_version works with clang. |
1457 # TODO(glider): set clang to 1 earlier for ASan and TSan builds so | 1464 # TODO(glider): set clang to 1 earlier for ASan and TSan builds so |
1458 # that it takes effect here. | 1465 # that it takes effect here. |
1459 ['clang==0 and asan==0 and lsan==0 and tsan==0 and msan==0 and ubsan==
0', { | 1466 ['clang==0 and asan==0 and lsan==0 and tsan==0 and msan==0 and ubsan==
0 and ubsan_vptr==0', { |
1460 'binutils_version%': '<!pymod_do_main(compiler_version target assemb
ler)', | 1467 'binutils_version%': '<!pymod_do_main(compiler_version target assemb
ler)', |
1461 }], | 1468 }], |
1462 # On Android we know the binutils version in the toolchain. | 1469 # On Android we know the binutils version in the toolchain. |
1463 ['OS=="android"', { | 1470 ['OS=="android"', { |
1464 'binutils_version%': 222, | 1471 'binutils_version%': 222, |
1465 }], | 1472 }], |
1466 ['host_arch=="x64"', { | 1473 ['host_arch=="x64"', { |
1467 'binutils_dir%': 'third_party/binutils/Linux_x64/Release/bin', | 1474 'binutils_dir%': 'third_party/binutils/Linux_x64/Release/bin', |
1468 }], | 1475 }], |
1469 ['host_arch=="ia32"', { | 1476 ['host_arch=="ia32"', { |
1470 'binutils_dir%': 'third_party/binutils/Linux_ia32/Release/bin', | 1477 'binutils_dir%': 'third_party/binutils/Linux_ia32/Release/bin', |
1471 }], | 1478 }], |
1472 # Our version of binutils in third_party/binutils | 1479 # Our version of binutils in third_party/binutils |
1473 ['linux_use_bundled_binutils==1', { | 1480 ['linux_use_bundled_binutils==1', { |
1474 'binutils_version%': 224, | 1481 'binutils_version%': 224, |
1475 }], | 1482 }], |
1476 ], | 1483 ], |
1477 }, { | 1484 }, { |
1478 'binutils_version%': 0, | 1485 'binutils_version%': 0, |
1479 }], | 1486 }], |
1480 # The version of GCC in use, set later in platforms that use GCC and have | 1487 # The version of GCC in use, set later in platforms that use GCC and have |
1481 # not explicitly chosen to build with clang. Currently, this means all | 1488 # not explicitly chosen to build with clang. Currently, this means all |
1482 # platforms except Windows, Mac and iOS. | 1489 # platforms except Windows, Mac and iOS. |
1483 # TODO(glider): set clang to 1 earlier for ASan and TSan builds so that | 1490 # TODO(glider): set clang to 1 earlier for ASan and TSan builds so that |
1484 # it takes effect here. | 1491 # it takes effect here. |
1485 ['os_posix==1 and OS!="mac" and OS!="ios" and clang==0 and asan==0 and lsa
n==0 and tsan==0 and msan==0', { | 1492 ['os_posix==1 and OS!="mac" and OS!="ios" and clang==0 and asan==0 and lsa
n==0 and tsan==0 and msan==0 and ubsan_vptr==0', { |
1486 'conditions': [ | 1493 'conditions': [ |
1487 ['OS=="android"', { | 1494 ['OS=="android"', { |
1488 # We directly set the gcc versions since we know what we use. | 1495 # We directly set the gcc versions since we know what we use. |
1489 'gcc_version%': 48, | 1496 'gcc_version%': 48, |
1490 }, { | 1497 }, { |
1491 'gcc_version%': '<!pymod_do_main(compiler_version target compiler)', | 1498 'gcc_version%': '<!pymod_do_main(compiler_version target compiler)', |
1492 }], | 1499 }], |
1493 ['android_webview_build==1', { | 1500 ['android_webview_build==1', { |
1494 # Android WebView uses a hermetic toolchain even for host, so set it | 1501 # Android WebView uses a hermetic toolchain even for host, so set it |
1495 # manually here. | 1502 # manually here. |
(...skipping 543 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2039 }], | 2046 }], |
2040 ['enable_mdns==1 or OS=="mac"', { | 2047 ['enable_mdns==1 or OS=="mac"', { |
2041 'grit_defines': ['-D', 'enable_service_discovery'], | 2048 'grit_defines': ['-D', 'enable_service_discovery'], |
2042 'enable_service_discovery%': 1 | 2049 'enable_service_discovery%': 1 |
2043 }], | 2050 }], |
2044 ['clang_use_chrome_plugins==1 and OS!="win"', { | 2051 ['clang_use_chrome_plugins==1 and OS!="win"', { |
2045 'clang_chrome_plugins_flags': [ | 2052 'clang_chrome_plugins_flags': [ |
2046 '<!@(<(DEPTH)/tools/clang/scripts/plugin_flags.sh)' | 2053 '<!@(<(DEPTH)/tools/clang/scripts/plugin_flags.sh)' |
2047 ], | 2054 ], |
2048 }], | 2055 }], |
2049 | |
2050 ['asan==1 or msan==1 or lsan==1 or tsan==1', { | 2056 ['asan==1 or msan==1 or lsan==1 or tsan==1', { |
2051 'clang%': 1, | 2057 'clang%': 1, |
2052 'use_allocator%': 'none', | 2058 'use_allocator%': 'none', |
2053 }], | 2059 }], |
2054 ['ubsan==1', { | 2060 ['ubsan==1', { |
2055 'clang%': 1, | 2061 'clang%': 1, |
2056 }], | 2062 }], |
| 2063 ['ubsan_vptr==1', { |
| 2064 'clang%': 1, |
| 2065 }], |
2057 ['asan==1 and OS=="mac"', { | 2066 ['asan==1 and OS=="mac"', { |
2058 # TODO(glider): we do not strip ASan binaries until the dynamic ASan | 2067 # TODO(glider): we do not strip ASan binaries until the dynamic ASan |
2059 # runtime is fully adopted. See http://crbug.com/242503. | 2068 # runtime is fully adopted. See http://crbug.com/242503. |
2060 'mac_strip_release': 0, | 2069 'mac_strip_release': 0, |
2061 }], | 2070 }], |
2062 ['tsan==1', { | 2071 ['tsan==1', { |
2063 'use_custom_libcxx%': 1, | 2072 'use_custom_libcxx%': 1, |
2064 }], | 2073 }], |
2065 ['msan==1', { | 2074 ['msan==1', { |
2066 # Use a just-built, MSan-instrumented libc++ instead of the system-wide | 2075 # Use a just-built, MSan-instrumented libc++ instead of the system-wide |
(...skipping 443 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2510 'defines': ['SYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE'], | 2519 'defines': ['SYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE'], |
2511 }], | 2520 }], |
2512 ['use_udev==1', { | 2521 ['use_udev==1', { |
2513 'defines': ['USE_UDEV'], | 2522 'defines': ['USE_UDEV'], |
2514 }], | 2523 }], |
2515 ['fastbuild!=0', { | 2524 ['fastbuild!=0', { |
2516 'xcode_settings': { | 2525 'xcode_settings': { |
2517 'GCC_GENERATE_DEBUGGING_SYMBOLS': 'NO', | 2526 'GCC_GENERATE_DEBUGGING_SYMBOLS': 'NO', |
2518 }, | 2527 }, |
2519 'conditions': [ | 2528 'conditions': [ |
2520 ['clang==1 and asan==0 and msan==0 and tsan==0', { | 2529 ['clang==1 and asan==0 and msan==0 and tsan==0 and ubsan_vptr==0', { |
2521 # Clang creates chubby debug information, which makes linking very | 2530 # Clang creates chubby debug information, which makes linking very |
2522 # slow. For now, don't create debug information with clang. See | 2531 # slow. For now, don't create debug information with clang. See |
2523 # http://crbug.com/70000 | 2532 # http://crbug.com/70000 |
2524 'conditions': [ | 2533 'conditions': [ |
2525 ['OS=="linux"', { | 2534 ['OS=="linux"', { |
2526 'variables': { | 2535 'variables': { |
2527 'debug_extra_cflags': '-g0', | 2536 'debug_extra_cflags': '-g0', |
2528 }, | 2537 }, |
2529 }], | 2538 }], |
2530 # Android builds symbols on release by default, disable them. | 2539 # Android builds symbols on release by default, disable them. |
(...skipping 1314 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3845 ], | 3854 ], |
3846 }], | 3855 }], |
3847 ['clang==1 and "<(GENERATOR)"=="ninja"', { | 3856 ['clang==1 and "<(GENERATOR)"=="ninja"', { |
3848 'cflags': [ | 3857 'cflags': [ |
3849 # See http://crbug.com/110262 | 3858 # See http://crbug.com/110262 |
3850 '-fcolor-diagnostics', | 3859 '-fcolor-diagnostics', |
3851 ], | 3860 ], |
3852 }], | 3861 }], |
3853 # Common options for AddressSanitizer, LeakSanitizer, | 3862 # Common options for AddressSanitizer, LeakSanitizer, |
3854 # ThreadSanitizer and MemorySanitizer. | 3863 # ThreadSanitizer and MemorySanitizer. |
3855 ['asan==1 or lsan==1 or tsan==1 or msan==1 or ubsan==1', { | 3864 ['asan==1 or lsan==1 or tsan==1 or msan==1 or ubsan==1 or ubsan_vptr==
1', { |
3856 'target_conditions': [ | 3865 'target_conditions': [ |
3857 ['_toolset=="target"', { | 3866 ['_toolset=="target"', { |
3858 'cflags': [ | 3867 'cflags': [ |
3859 '-fno-omit-frame-pointer', | 3868 '-fno-omit-frame-pointer', |
3860 '-gline-tables-only', | 3869 '-gline-tables-only', |
3861 ], | 3870 ], |
3862 'cflags!': [ | 3871 'cflags!': [ |
3863 '-fomit-frame-pointer', | 3872 '-fomit-frame-pointer', |
3864 ], | 3873 ], |
3865 }], | 3874 }], |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3918 '-w', # http://crbug.com/162783 | 3927 '-w', # http://crbug.com/162783 |
3919 ], | 3928 ], |
3920 'ldflags': [ | 3929 'ldflags': [ |
3921 '-fsanitize=undefined', | 3930 '-fsanitize=undefined', |
3922 # -fsanitize=vptr is incompatible with -fno-rtti. | 3931 # -fsanitize=vptr is incompatible with -fno-rtti. |
3923 '-fno-sanitize=vptr', | 3932 '-fno-sanitize=vptr', |
3924 ], | 3933 ], |
3925 }], | 3934 }], |
3926 ], | 3935 ], |
3927 }], | 3936 }], |
| 3937 ['ubsan_vptr==1', { |
| 3938 'target_conditions': [ |
| 3939 ['_toolset=="target"', { |
| 3940 'cflags': [ |
| 3941 '-fsanitize=vptr', |
| 3942 '-fsanitize=null', # Avoid dereferences on null pointer objec
ts. |
| 3943 '-fsanitize-blacklist=<(ubsan_vptr_blacklist)', |
| 3944 '-w', # http://crbug.com/162783 |
| 3945 ], |
| 3946 'cflags_cc!': [ |
| 3947 '-fno-rtti', |
| 3948 ], |
| 3949 'cflags!': [ |
| 3950 '-fno-rtti', |
| 3951 ], |
| 3952 'ldflags': [ |
| 3953 '-fsanitize=vptr', # -fsanitize=null is not necessary. |
| 3954 ], |
| 3955 'defines': [ |
| 3956 'UNDEFINED_SANITIZER', |
| 3957 ], |
| 3958 }], |
| 3959 ], |
| 3960 }], |
3928 ['asan_coverage!=0', { | 3961 ['asan_coverage!=0', { |
3929 'target_conditions': [ | 3962 'target_conditions': [ |
3930 ['_toolset=="target"', { | 3963 ['_toolset=="target"', { |
3931 'cflags': [ | 3964 'cflags': [ |
3932 '-mllvm -asan-coverage=<(asan_coverage)', | 3965 '-mllvm -asan-coverage=<(asan_coverage)', |
3933 ], | 3966 ], |
3934 }], | 3967 }], |
3935 ], | 3968 ], |
3936 }], | 3969 }], |
3937 ['lsan==1', { | 3970 ['lsan==1', { |
(...skipping 1573 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5511 # settings in target dicts. SYMROOT is a special case, because many other | 5544 # settings in target dicts. SYMROOT is a special case, because many other |
5512 # Xcode variables depend on it, including variables such as | 5545 # Xcode variables depend on it, including variables such as |
5513 # PROJECT_DERIVED_FILE_DIR. When a source group corresponding to something | 5546 # PROJECT_DERIVED_FILE_DIR. When a source group corresponding to something |
5514 # like PROJECT_DERIVED_FILE_DIR is added to a project, in order for the | 5547 # like PROJECT_DERIVED_FILE_DIR is added to a project, in order for the |
5515 # files to appear (when present) in the UI as actual files and not red | 5548 # files to appear (when present) in the UI as actual files and not red |
5516 # red "missing file" proxies, the correct path to PROJECT_DERIVED_FILE_DIR, | 5549 # red "missing file" proxies, the correct path to PROJECT_DERIVED_FILE_DIR, |
5517 # and therefore SYMROOT, needs to be set at the project level. | 5550 # and therefore SYMROOT, needs to be set at the project level. |
5518 'SYMROOT': '<(DEPTH)/xcodebuild', | 5551 'SYMROOT': '<(DEPTH)/xcodebuild', |
5519 }, | 5552 }, |
5520 } | 5553 } |
OLD | NEW |