SConstruct (12920:76a7817ebea3) | SConstruct (13020:b5f05a988593) |
---|---|
1# -*- mode:python -*- 2 3# Copyright (c) 2013, 2015-2017 ARM Limited 4# All rights reserved. 5# 6# The license below extends only to copyright in the software and shall 7# not be construed as granting a license to any other intellectual 8# property including but not limited to intellectual property relating --- 470 unchanged lines hidden (view full) --- 479 '-fno-builtin-realloc', '-fno-builtin-free']) 480 481 # The address sanitizer is available for gcc >= 4.8 482 if GetOption('with_asan'): 483 if GetOption('with_ubsan') and \ 484 compareVersions(main['GCC_VERSION'], '4.9') >= 0: 485 main.Append(CCFLAGS=['-fsanitize=address,undefined', 486 '-fno-omit-frame-pointer'], | 1# -*- mode:python -*- 2 3# Copyright (c) 2013, 2015-2017 ARM Limited 4# All rights reserved. 5# 6# The license below extends only to copyright in the software and shall 7# not be construed as granting a license to any other intellectual 8# property including but not limited to intellectual property relating --- 470 unchanged lines hidden (view full) --- 479 '-fno-builtin-realloc', '-fno-builtin-free']) 480 481 # The address sanitizer is available for gcc >= 4.8 482 if GetOption('with_asan'): 483 if GetOption('with_ubsan') and \ 484 compareVersions(main['GCC_VERSION'], '4.9') >= 0: 485 main.Append(CCFLAGS=['-fsanitize=address,undefined', 486 '-fno-omit-frame-pointer'], |
487 LINKFLAGS='-fsanitize=address,undefined') | 487 LINKFLAGS='-fsanitize=address,undefined') |
488 else: 489 main.Append(CCFLAGS=['-fsanitize=address', 490 '-fno-omit-frame-pointer'], | 488 else: 489 main.Append(CCFLAGS=['-fsanitize=address', 490 '-fno-omit-frame-pointer'], |
491 LINKFLAGS='-fsanitize=address') | 491 LINKFLAGS='-fsanitize=address') |
492 # Only gcc >= 4.9 supports UBSan, so check both the version 493 # and the command-line option before adding the compiler and 494 # linker flags. 495 elif GetOption('with_ubsan') and \ 496 compareVersions(main['GCC_VERSION'], '4.9') >= 0: 497 main.Append(CCFLAGS='-fsanitize=undefined') 498 main.Append(LINKFLAGS='-fsanitize=undefined') 499 --- 36 unchanged lines hidden (view full) --- 536 # On FreeBSD we need libthr. 537 if sys.platform.startswith('freebsd'): 538 main.Append(LIBS=['thr']) 539 540 # We require clang >= 3.1, so there is no need to check any 541 # versions here. 542 if GetOption('with_ubsan'): 543 if GetOption('with_asan'): | 492 # Only gcc >= 4.9 supports UBSan, so check both the version 493 # and the command-line option before adding the compiler and 494 # linker flags. 495 elif GetOption('with_ubsan') and \ 496 compareVersions(main['GCC_VERSION'], '4.9') >= 0: 497 main.Append(CCFLAGS='-fsanitize=undefined') 498 main.Append(LINKFLAGS='-fsanitize=undefined') 499 --- 36 unchanged lines hidden (view full) --- 536 # On FreeBSD we need libthr. 537 if sys.platform.startswith('freebsd'): 538 main.Append(LIBS=['thr']) 539 540 # We require clang >= 3.1, so there is no need to check any 541 # versions here. 542 if GetOption('with_ubsan'): 543 if GetOption('with_asan'): |
544 env.Append(CCFLAGS=['-fsanitize=address,undefined', 545 '-fno-omit-frame-pointer'], | 544 main.Append(CCFLAGS=['-fsanitize=address,undefined', 545 '-fno-omit-frame-pointer'], |
546 LINKFLAGS='-fsanitize=address,undefined') 547 else: | 546 LINKFLAGS='-fsanitize=address,undefined') 547 else: |
548 env.Append(CCFLAGS='-fsanitize=undefined', 549 LINKFLAGS='-fsanitize=undefined') | 548 main.Append(CCFLAGS='-fsanitize=undefined', 549 LINKFLAGS='-fsanitize=undefined') |
550 551 elif GetOption('with_asan'): | 550 551 elif GetOption('with_asan'): |
552 env.Append(CCFLAGS=['-fsanitize=address', 553 '-fno-omit-frame-pointer'], | 552 main.Append(CCFLAGS=['-fsanitize=address', 553 '-fno-omit-frame-pointer'], |
554 LINKFLAGS='-fsanitize=address') 555 556else: 557 print(termcap.Yellow + termcap.Bold + 'Error' + termcap.Normal, end=' ') 558 print("Don't know what compiler options to use for your compiler.") 559 print(termcap.Yellow + ' compiler:' + termcap.Normal, main['CXX']) 560 print(termcap.Yellow + ' version:' + termcap.Normal, end=' ') 561 if not CXX_version: --- 711 unchanged lines hidden --- | 554 LINKFLAGS='-fsanitize=address') 555 556else: 557 print(termcap.Yellow + termcap.Bold + 'Error' + termcap.Normal, end=' ') 558 print("Don't know what compiler options to use for your compiler.") 559 print(termcap.Yellow + ' compiler:' + termcap.Normal, main['CXX']) 560 print(termcap.Yellow + ' version:' + termcap.Normal, end=' ') 561 if not CXX_version: --- 711 unchanged lines hidden --- |