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

Side by Side Diff: build/common.gypi

Issue 2018973002: [libfuzzer] Add 'vptr' flag to builds with UndefinedBehaviourSanitizer. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix a typo. Created 4 years, 6 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
« no previous file with comments | « no previous file | build/config/compiler/BUILD.gn » ('j') | 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 480 matching lines...) Expand 10 before | Expand all | Expand 10 after
491 # Track where uninitialized memory originates from. From fastest to 491 # Track where uninitialized memory originates from. From fastest to
492 # slowest: 0 - no tracking, 1 - track only the initial allocation site, 2 492 # slowest: 0 - no tracking, 1 - track only the initial allocation site, 2
493 # - track the chain of stores leading from allocation site to use site. 493 # - track the chain of stores leading from allocation site to use site.
494 'msan_track_origins%': 2, 494 'msan_track_origins%': 2,
495 495
496 # Enable building with UBSan (Clang's -fsanitize=undefined option). 496 # Enable building with UBSan (Clang's -fsanitize=undefined option).
497 # -fsanitize=undefined only works with clang, but ubsan=1 implies clang=1 497 # -fsanitize=undefined only works with clang, but ubsan=1 implies clang=1
498 # See http://clang.llvm.org/docs/UsersManual.html 498 # See http://clang.llvm.org/docs/UsersManual.html
499 'ubsan%': 0, 499 'ubsan%': 0,
500 'ubsan_blacklist%': '<(PRODUCT_DIR)/../../tools/ubsan/blacklist.txt', 500 'ubsan_blacklist%': '<(PRODUCT_DIR)/../../tools/ubsan/blacklist.txt',
501 'ubsan_security_blacklist%': '<(PRODUCT_DIR)/../../tools/ubsan/security_bl acklist.txt',
501 'ubsan_vptr_blacklist%': '<(PRODUCT_DIR)/../../tools/ubsan/vptr_blacklist. txt', 502 'ubsan_vptr_blacklist%': '<(PRODUCT_DIR)/../../tools/ubsan/vptr_blacklist. txt',
502 503
503 # Enable building with UBsan's vptr (Clang's -fsanitize=vptr option). 504 # Enable building with UBsan's vptr (Clang's -fsanitize=vptr option).
504 # -fsanitize=vptr only works with clang, but ubsan_vptr=1 implies clang=1 505 # -fsanitize=vptr only works with clang, but ubsan_vptr=1 implies clang=1
506 # ubsan_security also enables UBSan's vptr.
507 'ubsan_security%': 0,
505 'ubsan_vptr%': 0, 508 'ubsan_vptr%': 0,
506 509
507 # Use dynamic libraries instrumented by one of the sanitizers 510 # Use dynamic libraries instrumented by one of the sanitizers
508 # instead of the standard system libraries. Set this flag to build the 511 # instead of the standard system libraries. Set this flag to build the
509 # libraries from source. 512 # libraries from source.
510 'use_instrumented_libraries%': 0, 513 'use_instrumented_libraries%': 0,
511 514
512 # Use dynamic libraries instrumented by one of the sanitizers 515 # Use dynamic libraries instrumented by one of the sanitizers
513 # instead of the standard system libraries. Set this flag to download 516 # instead of the standard system libraries. Set this flag to download
514 # prebuilt binaries from GCS. 517 # prebuilt binaries from GCS.
(...skipping 684 matching lines...) Expand 10 before | Expand all | Expand 10 after
1199 'kasko_failed_rdv_reports%': '<(kasko_failed_rdv_reports)', 1202 'kasko_failed_rdv_reports%': '<(kasko_failed_rdv_reports)',
1200 'syzygy_optimize%': '<(syzygy_optimize)', 1203 'syzygy_optimize%': '<(syzygy_optimize)',
1201 'lsan%': '<(lsan)', 1204 'lsan%': '<(lsan)',
1202 'msan%': '<(msan)', 1205 'msan%': '<(msan)',
1203 'msan_blacklist%': '<(msan_blacklist)', 1206 'msan_blacklist%': '<(msan_blacklist)',
1204 'msan_track_origins%': '<(msan_track_origins)', 1207 'msan_track_origins%': '<(msan_track_origins)',
1205 'tsan%': '<(tsan)', 1208 'tsan%': '<(tsan)',
1206 'tsan_blacklist%': '<(tsan_blacklist)', 1209 'tsan_blacklist%': '<(tsan_blacklist)',
1207 'ubsan%': '<(ubsan)', 1210 'ubsan%': '<(ubsan)',
1208 'ubsan_blacklist%': '<(ubsan_blacklist)', 1211 'ubsan_blacklist%': '<(ubsan_blacklist)',
1212 'ubsan_security%': '<(ubsan_security)',
1213 'ubsan_security_blacklist%': '<(ubsan_security_blacklist)',
1214 'ubsan_vptr%': '<(ubsan_vptr)',
1209 'ubsan_vptr_blacklist%': '<(ubsan_vptr_blacklist)', 1215 'ubsan_vptr_blacklist%': '<(ubsan_vptr_blacklist)',
1210 'ubsan_vptr%': '<(ubsan_vptr)',
1211 'use_instrumented_libraries%': '<(use_instrumented_libraries)', 1216 'use_instrumented_libraries%': '<(use_instrumented_libraries)',
1212 'use_prebuilt_instrumented_libraries%': '<(use_prebuilt_instrumented_librari es)', 1217 'use_prebuilt_instrumented_libraries%': '<(use_prebuilt_instrumented_librari es)',
1213 'use_custom_libcxx%': '<(use_custom_libcxx)', 1218 'use_custom_libcxx%': '<(use_custom_libcxx)',
1214 'order_profiling%': '<(order_profiling)', 1219 'order_profiling%': '<(order_profiling)',
1215 'order_text_section%': '<(order_text_section)', 1220 'order_text_section%': '<(order_text_section)',
1216 'enable_extensions%': '<(enable_extensions)', 1221 'enable_extensions%': '<(enable_extensions)',
1217 'enable_pdf%': '<(enable_pdf)', 1222 'enable_pdf%': '<(enable_pdf)',
1218 'pdf_enable_v8%': '<(pdf_enable_v8)', 1223 'pdf_enable_v8%': '<(pdf_enable_v8)',
1219 'pdf_enable_xfa%': '<(pdf_enable_xfa)', 1224 'pdf_enable_xfa%': '<(pdf_enable_xfa)',
1220 'enable_plugin_installation%': '<(enable_plugin_installation)', 1225 'enable_plugin_installation%': '<(enable_plugin_installation)',
(...skipping 370 matching lines...) Expand 10 before | Expand all | Expand 10 after
1591 'sanitizer_coverage': 'edge,indirect-calls,8bit-counters', 1596 'sanitizer_coverage': 'edge,indirect-calls,8bit-counters',
1592 }], 1597 }],
1593 # Get binutils version so we can enable debug fission if we can. 1598 # Get binutils version so we can enable debug fission if we can.
1594 ['os_posix==1 and OS!="mac" and OS!="ios"', { 1599 ['os_posix==1 and OS!="mac" and OS!="ios"', {
1595 'conditions': [ 1600 'conditions': [
1596 # compiler_version doesn't work with clang 1601 # compiler_version doesn't work with clang
1597 # TODO(mithro): Land https://codereview.chromium.org/199793014/ so 1602 # TODO(mithro): Land https://codereview.chromium.org/199793014/ so
1598 # compiler_version works with clang. 1603 # compiler_version works with clang.
1599 # TODO(glider): set clang to 1 earlier for ASan and TSan builds so 1604 # TODO(glider): set clang to 1 earlier for ASan and TSan builds so
1600 # that it takes effect here. 1605 # that it takes effect here.
1601 ['clang==0 and asan==0 and lsan==0 and tsan==0 and msan==0 and ubsan== 0 and ubsan_vptr==0', { 1606 ['clang==0 and asan==0 and lsan==0 and tsan==0 and msan==0 and ubsan== 0 and ubsan_security==0 and ubsan_vptr==0', {
1602 'binutils_version%': '<!pymod_do_main(compiler_version target assemb ler)', 1607 'binutils_version%': '<!pymod_do_main(compiler_version target assemb ler)',
1603 }], 1608 }],
1604 # On Android we know the binutils version in the toolchain. 1609 # On Android we know the binutils version in the toolchain.
1605 ['OS=="android"', { 1610 ['OS=="android"', {
1606 'binutils_version%': 222, 1611 'binutils_version%': 222,
1607 }], 1612 }],
1608 ['host_arch=="x64"', { 1613 ['host_arch=="x64"', {
1609 'binutils_dir%': 'third_party/binutils/Linux_x64/Release/bin', 1614 'binutils_dir%': 'third_party/binutils/Linux_x64/Release/bin',
1610 }], 1615 }],
1611 ['host_arch=="ia32"', { 1616 ['host_arch=="ia32"', {
(...skipping 627 matching lines...) Expand 10 before | Expand all | Expand 10 after
2239 # PNaCl toolchain Non-SFI build only supports linux OS build. 2244 # PNaCl toolchain Non-SFI build only supports linux OS build.
2240 # Also, it does not support sanitizers. 2245 # Also, it does not support sanitizers.
2241 'enable_nacl_nonsfi_test%': 1, 2246 'enable_nacl_nonsfi_test%': 1,
2242 }], 2247 }],
2243 ['asan==1 and OS=="linux" and chromeos==0', { 2248 ['asan==1 and OS=="linux" and chromeos==0', {
2244 'use_custom_libcxx%': 1, 2249 'use_custom_libcxx%': 1,
2245 }], 2250 }],
2246 ['ubsan==1', { 2251 ['ubsan==1', {
2247 'clang%': 1, 2252 'clang%': 1,
2248 }], 2253 }],
2254 ['ubsan_security==1', {
2255 'clang%': 1,
2256 }],
2249 ['ubsan_vptr==1', { 2257 ['ubsan_vptr==1', {
2250 'clang%': 1, 2258 'clang%': 1,
2251 }], 2259 }],
2252 ['asan==1 and OS=="mac"', { 2260 ['asan==1 and OS=="mac"', {
2253 'mac_strip_release': 1, 2261 'mac_strip_release': 1,
2254 }], 2262 }],
2255 ['tsan==1', { 2263 ['tsan==1', {
2256 'use_custom_libcxx%': 1, 2264 'use_custom_libcxx%': 1,
2257 }], 2265 }],
2258 ['msan==1', { 2266 ['msan==1', {
(...skipping 1307 matching lines...) Expand 10 before | Expand all | Expand 10 after
3566 }], 3574 }],
3567 # TODO(jochen): Enable this on chromeos on arm. http://crbug.com/356580 3575 # TODO(jochen): Enable this on chromeos on arm. http://crbug.com/356580
3568 ['os_posix==1 and disable_fatal_linker_warnings==0 and use_evdev_gestures==0 and (chromeos==0 or target_arch!="arm")', { 3576 ['os_posix==1 and disable_fatal_linker_warnings==0 and use_evdev_gestures==0 and (chromeos==0 or target_arch!="arm")', {
3569 'target_defaults': { 3577 'target_defaults': {
3570 'ldflags': [ 3578 'ldflags': [
3571 '-Wl,--fatal-warnings', 3579 '-Wl,--fatal-warnings',
3572 ], 3580 ],
3573 }, 3581 },
3574 }], 3582 }],
3575 # -Wl,-z,-defs doesn't work with the sanitiziers, http://crbug.com/452065 3583 # -Wl,-z,-defs doesn't work with the sanitiziers, http://crbug.com/452065
3576 ['(OS=="linux" or OS=="android") and asan==0 and msan==0 and tsan==0 and ubs an==0 and ubsan_vptr==0 and cfi_diag==0', { 3584 ['(OS=="linux" or OS=="android") and asan==0 and msan==0 and tsan==0 and ubs an==0 and ubsan_security==0 and ubsan_vptr==0 and cfi_diag==0', {
3577 'target_defaults': { 3585 'target_defaults': {
3578 'ldflags': [ 3586 'ldflags': [
3579 '-Wl,-z,defs', 3587 '-Wl,-z,defs',
3580 ], 3588 ],
3581 }, 3589 },
3582 }], 3590 }],
3583 ['os_posix==1 and chromeos==0', { 3591 ['os_posix==1 and chromeos==0', {
3584 # Chrome OS enables -fstack-protector-strong via its build wrapper, 3592 # Chrome OS enables -fstack-protector-strong via its build wrapper,
3585 # and we want to avoid overriding this, so stack-protector is only 3593 # and we want to avoid overriding this, so stack-protector is only
3586 # enabled when not building on Chrome OS. 3594 # enabled when not building on Chrome OS.
(...skipping 706 matching lines...) Expand 10 before | Expand all | Expand 10 after
4293 ], 4301 ],
4294 }], 4302 }],
4295 ['clang==1 and "<(GENERATOR)"=="ninja"', { 4303 ['clang==1 and "<(GENERATOR)"=="ninja"', {
4296 'cflags': [ 4304 'cflags': [
4297 # See http://crbug.com/110262 4305 # See http://crbug.com/110262
4298 '-fcolor-diagnostics', 4306 '-fcolor-diagnostics',
4299 ], 4307 ],
4300 }], 4308 }],
4301 # Common options for AddressSanitizer, LeakSanitizer, 4309 # Common options for AddressSanitizer, LeakSanitizer,
4302 # ThreadSanitizer, MemorySanitizer and non-official CFI builds. 4310 # ThreadSanitizer, MemorySanitizer and non-official CFI builds.
4303 ['asan==1 or lsan==1 or tsan==1 or msan==1 or ubsan==1 or ubsan_vptr== 1 or ' 4311 ['asan==1 or lsan==1 or tsan==1 or msan==1 or ubsan==1 or ubsan_securi ty==1 or ubsan_vptr==1 or '
4304 '(cfi_vptr==1 and buildtype!="Official")', { 4312 '(cfi_vptr==1 and buildtype!="Official")', {
4305 'target_conditions': [ 4313 'target_conditions': [
4306 ['_toolset=="target"', { 4314 ['_toolset=="target"', {
4307 'cflags': [ 4315 'cflags': [
4308 '-fno-omit-frame-pointer', 4316 '-fno-omit-frame-pointer',
4309 '-gline-tables-only', 4317 '-gline-tables-only',
4310 ], 4318 ],
4311 'cflags!': [ 4319 'cflags!': [
4312 '-fomit-frame-pointer', 4320 '-fomit-frame-pointer',
4313 ], 4321 ],
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
4391 ], 4399 ],
4392 'ldflags': [ 4400 'ldflags': [
4393 '-fsanitize=undefined', 4401 '-fsanitize=undefined',
4394 ], 4402 ],
4395 'defines': [ 4403 'defines': [
4396 'UNDEFINED_SANITIZER', 4404 'UNDEFINED_SANITIZER',
4397 ], 4405 ],
4398 }], 4406 }],
4399 ], 4407 ],
4400 }], 4408 }],
4409 ['ubsan_security==1', {
4410 'target_conditions': [
4411 ['_toolset=="target"', {
4412 'cflags': [
4413 '-fsanitize=signed-integer-overflow,shift,vptr',
4414 '-fsanitize-blacklist=<(ubsan_security_blacklist)',
4415 ],
4416 'cflags_cc!': [
4417 '-fno-rtti',
4418 ],
4419 'cflags!': [
4420 '-fno-rtti',
4421 ],
4422 'ldflags': [
4423 '-fsanitize=signed-integer-overflow,shift,vptr',
4424 ],
4425 'defines': [
4426 'UNDEFINED_SANITIZER',
4427 ],
4428 }],
4429 ],
4430 }],
4401 ['ubsan_vptr==1', { 4431 ['ubsan_vptr==1', {
4402 'target_conditions': [ 4432 'target_conditions': [
4403 ['_toolset=="target"', { 4433 ['_toolset=="target"', {
4404 'cflags': [ 4434 'cflags': [
4405 '-fsanitize=vptr', 4435 '-fsanitize=vptr',
4406 '-fsanitize-blacklist=<(ubsan_vptr_blacklist)', 4436 '-fsanitize-blacklist=<(ubsan_vptr_blacklist)',
4407 ], 4437 ],
4408 'cflags_cc!': [ 4438 'cflags_cc!': [
4409 '-fno-rtti', 4439 '-fno-rtti',
4410 ], 4440 ],
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
4573 # https://groups.google.com/a/chromium.org/group/chromium-dev/ browse_thread/thread/281527606915bb36 4603 # https://groups.google.com/a/chromium.org/group/chromium-dev/ browse_thread/thread/281527606915bb36
4574 # Only apply this to the target linker, since the host 4604 # Only apply this to the target linker, since the host
4575 # linker might not be gold, but isn't used much anyway. 4605 # linker might not be gold, but isn't used much anyway.
4576 # TODO(raymes): Disable threading because gold is frequently 4606 # TODO(raymes): Disable threading because gold is frequently
4577 # crashing on the bots: crbug.com/161942. 4607 # crashing on the bots: crbug.com/161942.
4578 # '-Wl,--threads', 4608 # '-Wl,--threads',
4579 # '-Wl,--thread-count=4', 4609 # '-Wl,--thread-count=4',
4580 ], 4610 ],
4581 'conditions': [ 4611 'conditions': [
4582 # TODO(thestig): Enable this for disabled cases. 4612 # TODO(thestig): Enable this for disabled cases.
4583 [ 'buildtype!="Official" and chromeos==0 and release_valgrind_ build==0 and asan==0 and lsan==0 and tsan==0 and msan==0 and ubsan==0 and ubsan_ vptr==0', { 4613 [ 'buildtype!="Official" and chromeos==0 and release_valgrind_ build==0 and asan==0 and lsan==0 and tsan==0 and msan==0 and ubsan==0 and ubsan_ security==0 and ubsan_vptr==0', {
4584 'ldflags': [ 4614 'ldflags': [
4585 '-Wl,--detect-odr-violations', 4615 '-Wl,--detect-odr-violations',
4586 ], 4616 ],
4587 }], 4617 }],
4588 ], 4618 ],
4589 }], 4619 }],
4590 ], 4620 ],
4591 'conditions': [ 4621 'conditions': [
4592 ['release_valgrind_build==0 and order_profiling==0 and asan==0 and msan==0 and lsan==0 and tsan==0', { 4622 ['release_valgrind_build==0 and order_profiling==0 and asan==0 and msan==0 and lsan==0 and tsan==0', {
4593 'target_conditions': [ 4623 'target_conditions': [
(...skipping 1702 matching lines...) Expand 10 before | Expand all | Expand 10 after
6296 # settings in target dicts. SYMROOT is a special case, because many other 6326 # settings in target dicts. SYMROOT is a special case, because many other
6297 # Xcode variables depend on it, including variables such as 6327 # Xcode variables depend on it, including variables such as
6298 # PROJECT_DERIVED_FILE_DIR. When a source group corresponding to something 6328 # PROJECT_DERIVED_FILE_DIR. When a source group corresponding to something
6299 # like PROJECT_DERIVED_FILE_DIR is added to a project, in order for the 6329 # like PROJECT_DERIVED_FILE_DIR is added to a project, in order for the
6300 # files to appear (when present) in the UI as actual files and not red 6330 # files to appear (when present) in the UI as actual files and not red
6301 # red "missing file" proxies, the correct path to PROJECT_DERIVED_FILE_DIR, 6331 # red "missing file" proxies, the correct path to PROJECT_DERIVED_FILE_DIR,
6302 # and therefore SYMROOT, needs to be set at the project level. 6332 # and therefore SYMROOT, needs to be set at the project level.
6303 'SYMROOT': '<(DEPTH)/xcodebuild', 6333 'SYMROOT': '<(DEPTH)/xcodebuild',
6304 }, 6334 },
6305 } 6335 }
OLDNEW
« no previous file with comments | « no previous file | build/config/compiler/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698