SConstruct (12617:50e248e0788b) | SConstruct (12688:8d2a4af53baa) |
---|---|
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 --- 467 unchanged lines hidden (view full) --- 476 main['LTO_LDFLAGS'] = ['-flto=%d' % GetOption('num_jobs')] 477 478 main.Append(TCMALLOC_CCFLAGS=['-fno-builtin-malloc', '-fno-builtin-calloc', 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 \ | 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 --- 467 unchanged lines hidden (view full) --- 476 main['LTO_LDFLAGS'] = ['-flto=%d' % GetOption('num_jobs')] 477 478 main.Append(TCMALLOC_CCFLAGS=['-fno-builtin-malloc', '-fno-builtin-calloc', 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(env['GCC_VERSION'], '4.9') >= 0: 485 env.Append(CCFLAGS=['-fsanitize=address,undefined', 486 '-fno-omit-frame-pointer'], | 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') 488 else: | 487 LINKFLAGS='-fsanitize=address,undefined') 488 else: |
489 env.Append(CCFLAGS=['-fsanitize=address', 490 '-fno-omit-frame-pointer'], | 489 main.Append(CCFLAGS=['-fsanitize=address', 490 '-fno-omit-frame-pointer'], |
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 \ | 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(env['GCC_VERSION'], '4.9') >= 0: 497 env.Append(CCFLAGS='-fsanitize=undefined') 498 env.Append(LINKFLAGS='-fsanitize=undefined') | 496 compareVersions(main['GCC_VERSION'], '4.9') >= 0: 497 main.Append(CCFLAGS='-fsanitize=undefined') 498 main.Append(LINKFLAGS='-fsanitize=undefined') |
499 500elif main['CLANG']: 501 # Check for a supported version of clang, >= 3.1 is needed to 502 # support similar features as gcc 4.8. See 503 # http://clang.llvm.org/cxx_status.html for details 504 clang_version_re = re.compile(".* version (\d+\.\d+)") 505 clang_version_match = clang_version_re.search(CXX_version) 506 if (clang_version_match): --- 758 unchanged lines hidden --- | 499 500elif main['CLANG']: 501 # Check for a supported version of clang, >= 3.1 is needed to 502 # support similar features as gcc 4.8. See 503 # http://clang.llvm.org/cxx_status.html for details 504 clang_version_re = re.compile(".* version (\d+\.\d+)") 505 clang_version_match = clang_version_re.search(CXX_version) 506 if (clang_version_match): --- 758 unchanged lines hidden --- |