Chromium Code Reviews| 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 'use_allocator%': 'none', | |
|
earthdok
2014/06/26 16:48:31
UBSan doesn't replace the allocator. Why are we se
| |
| 2066 'clang_use_chrome_plugins%': 0, # Temporally turn plugins off as Ubsan' s vptr now relies on custom Clang binaries. | |
|
earthdok
2014/06/26 16:48:31
Please either pass this explicitly in GYP_DEFINES
| |
| 2067 }], | |
| 2057 ['asan==1 and OS=="mac"', { | 2068 ['asan==1 and OS=="mac"', { |
| 2058 # TODO(glider): we do not strip ASan binaries until the dynamic ASan | 2069 # TODO(glider): we do not strip ASan binaries until the dynamic ASan |
| 2059 # runtime is fully adopted. See http://crbug.com/242503. | 2070 # runtime is fully adopted. See http://crbug.com/242503. |
| 2060 'mac_strip_release': 0, | 2071 'mac_strip_release': 0, |
| 2061 }], | 2072 }], |
| 2062 ['tsan==1', { | 2073 ['tsan==1', { |
| 2063 'use_custom_libcxx%': 1, | 2074 'use_custom_libcxx%': 1, |
| 2064 }], | 2075 }], |
| 2065 ['msan==1', { | 2076 ['msan==1', { |
| 2066 # Use a just-built, MSan-instrumented libc++ instead of the system-wide | 2077 # 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'], | 2521 'defines': ['SYSTEM_NATIVELY_SIGNALS_MEMORY_PRESSURE'], |
| 2511 }], | 2522 }], |
| 2512 ['use_udev==1', { | 2523 ['use_udev==1', { |
| 2513 'defines': ['USE_UDEV'], | 2524 'defines': ['USE_UDEV'], |
| 2514 }], | 2525 }], |
| 2515 ['fastbuild!=0', { | 2526 ['fastbuild!=0', { |
| 2516 'xcode_settings': { | 2527 'xcode_settings': { |
| 2517 'GCC_GENERATE_DEBUGGING_SYMBOLS': 'NO', | 2528 'GCC_GENERATE_DEBUGGING_SYMBOLS': 'NO', |
| 2518 }, | 2529 }, |
| 2519 'conditions': [ | 2530 'conditions': [ |
| 2520 ['clang==1 and asan==0 and msan==0 and tsan==0', { | 2531 ['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 | 2532 # Clang creates chubby debug information, which makes linking very |
| 2522 # slow. For now, don't create debug information with clang. See | 2533 # slow. For now, don't create debug information with clang. See |
| 2523 # http://crbug.com/70000 | 2534 # http://crbug.com/70000 |
| 2524 'conditions': [ | 2535 'conditions': [ |
| 2525 ['OS=="linux"', { | 2536 ['OS=="linux"', { |
| 2526 'variables': { | 2537 'variables': { |
| 2527 'debug_extra_cflags': '-g0', | 2538 'debug_extra_cflags': '-g0', |
| 2528 }, | 2539 }, |
| 2529 }], | 2540 }], |
| 2530 # Android builds symbols on release by default, disable them. | 2541 # Android builds symbols on release by default, disable them. |
| (...skipping 1314 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3845 ], | 3856 ], |
| 3846 }], | 3857 }], |
| 3847 ['clang==1 and "<(GENERATOR)"=="ninja"', { | 3858 ['clang==1 and "<(GENERATOR)"=="ninja"', { |
| 3848 'cflags': [ | 3859 'cflags': [ |
| 3849 # See http://crbug.com/110262 | 3860 # See http://crbug.com/110262 |
| 3850 '-fcolor-diagnostics', | 3861 '-fcolor-diagnostics', |
| 3851 ], | 3862 ], |
| 3852 }], | 3863 }], |
| 3853 # Common options for AddressSanitizer, LeakSanitizer, | 3864 # Common options for AddressSanitizer, LeakSanitizer, |
| 3854 # ThreadSanitizer and MemorySanitizer. | 3865 # ThreadSanitizer and MemorySanitizer. |
| 3855 ['asan==1 or lsan==1 or tsan==1 or msan==1 or ubsan==1', { | 3866 ['asan==1 or lsan==1 or tsan==1 or msan==1 or ubsan==1 or ubsan_vptr== 1', { |
| 3856 'target_conditions': [ | 3867 'target_conditions': [ |
| 3857 ['_toolset=="target"', { | 3868 ['_toolset=="target"', { |
| 3858 'cflags': [ | 3869 'cflags': [ |
| 3859 '-fno-omit-frame-pointer', | 3870 '-fno-omit-frame-pointer', |
| 3860 '-gline-tables-only', | 3871 '-gline-tables-only', |
| 3861 ], | 3872 ], |
| 3862 'cflags!': [ | 3873 'cflags!': [ |
| 3863 '-fomit-frame-pointer', | 3874 '-fomit-frame-pointer', |
| 3864 ], | 3875 ], |
| 3865 }], | 3876 }], |
| 3866 ], | 3877 ], |
| 3867 }], | 3878 }], |
| 3868 ['asan==1 or lsan==1 or tsan==1 or msan==1', { | 3879 ['asan==1 or lsan==1 or tsan==1 or msan==1 or ubsan_vptr==1', { |
|
earthdok
2014/06/26 16:48:31
Again, why define MEMORY_TOOL_REPLACES_ALLOCATOR?
| |
| 3869 'target_conditions': [ | 3880 'target_conditions': [ |
| 3870 ['_toolset=="target"', { | 3881 ['_toolset=="target"', { |
| 3871 'ldflags!': [ | 3882 'ldflags!': [ |
| 3872 # Functions interposed by the sanitizers can make ld think | 3883 # Functions interposed by the sanitizers can make ld think |
| 3873 # that some libraries aren't needed when they actually are, | 3884 # that some libraries aren't needed when they actually are, |
| 3874 # http://crbug.com/234010. As workaround, disable --as-needed. | 3885 # http://crbug.com/234010. As workaround, disable --as-needed. |
| 3875 '-Wl,--as-needed', | 3886 '-Wl,--as-needed', |
| 3876 ], | 3887 ], |
| 3877 'defines': [ | 3888 'defines': [ |
| 3878 'MEMORY_TOOL_REPLACES_ALLOCATOR', | 3889 'MEMORY_TOOL_REPLACES_ALLOCATOR', |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3918 '-w', # http://crbug.com/162783 | 3929 '-w', # http://crbug.com/162783 |
| 3919 ], | 3930 ], |
| 3920 'ldflags': [ | 3931 'ldflags': [ |
| 3921 '-fsanitize=undefined', | 3932 '-fsanitize=undefined', |
| 3922 # -fsanitize=vptr is incompatible with -fno-rtti. | 3933 # -fsanitize=vptr is incompatible with -fno-rtti. |
| 3923 '-fno-sanitize=vptr', | 3934 '-fno-sanitize=vptr', |
| 3924 ], | 3935 ], |
| 3925 }], | 3936 }], |
| 3926 ], | 3937 ], |
| 3927 }], | 3938 }], |
| 3939 ['ubsan_vptr==1', { | |
| 3940 'target_conditions': [ | |
| 3941 ['_toolset=="target"', { | |
| 3942 'cflags': [ | |
| 3943 '-fsanitize=vptr', | |
| 3944 '-fsanitize=null', # Avoid dereferences on null pointer objec ts. | |
| 3945 '-fsanitize-blacklist=<(ubsan_vptr_blacklist)', | |
| 3946 '-w', # http://crbug.com/162783 | |
| 3947 ], | |
| 3948 'cflags_cc!': [ | |
| 3949 '-fno-rtti', | |
| 3950 ], | |
| 3951 'cflags!': [ | |
| 3952 '-fno-rtti', | |
| 3953 ], | |
| 3954 'ldflags': [ | |
| 3955 '-fsanitize=vptr', # -fsanitize=null is not necessary. | |
| 3956 ], | |
| 3957 'defines': [ | |
| 3958 'UNDEFINED_SANITIZER', | |
| 3959 ], | |
| 3960 }], | |
| 3961 ], | |
| 3962 }], | |
| 3928 ['asan_coverage!=0', { | 3963 ['asan_coverage!=0', { |
| 3929 'target_conditions': [ | 3964 'target_conditions': [ |
| 3930 ['_toolset=="target"', { | 3965 ['_toolset=="target"', { |
| 3931 'cflags': [ | 3966 'cflags': [ |
| 3932 '-mllvm -asan-coverage=<(asan_coverage)', | 3967 '-mllvm -asan-coverage=<(asan_coverage)', |
| 3933 ], | 3968 ], |
| 3934 }], | 3969 }], |
| 3935 ], | 3970 ], |
| 3936 }], | 3971 }], |
| 3937 ['lsan==1', { | 3972 ['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 | 5546 # settings in target dicts. SYMROOT is a special case, because many other |
| 5512 # Xcode variables depend on it, including variables such as | 5547 # Xcode variables depend on it, including variables such as |
| 5513 # PROJECT_DERIVED_FILE_DIR. When a source group corresponding to something | 5548 # 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 | 5549 # 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 | 5550 # 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, | 5551 # red "missing file" proxies, the correct path to PROJECT_DERIVED_FILE_DIR, |
| 5517 # and therefore SYMROOT, needs to be set at the project level. | 5552 # and therefore SYMROOT, needs to be set at the project level. |
| 5518 'SYMROOT': '<(DEPTH)/xcodebuild', | 5553 'SYMROOT': '<(DEPTH)/xcodebuild', |
| 5519 }, | 5554 }, |
| 5520 } | 5555 } |
| OLD | NEW |