SConstruct (12246:9ffa51416f39) SConstruct (12304:299452fa8cc4)
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

--- 459 unchanged lines hidden (view full) ---

468
469 main.Append(TCMALLOC_CCFLAGS=['-fno-builtin-malloc', '-fno-builtin-calloc',
470 '-fno-builtin-realloc', '-fno-builtin-free'])
471
472 # add option to check for undeclared overrides
473 if compareVersions(gcc_version, "5.0") > 0:
474 main.Append(CCFLAGS=['-Wno-error=suggest-override'])
475
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

--- 459 unchanged lines hidden (view full) ---

468
469 main.Append(TCMALLOC_CCFLAGS=['-fno-builtin-malloc', '-fno-builtin-calloc',
470 '-fno-builtin-realloc', '-fno-builtin-free'])
471
472 # add option to check for undeclared overrides
473 if compareVersions(gcc_version, "5.0") > 0:
474 main.Append(CCFLAGS=['-Wno-error=suggest-override'])
475
476 # The address sanitizer is available for gcc >= 4.8
477 if GetOption('with_asan'):
478 if GetOption('with_ubsan') and \
479 compareVersions(env['GCC_VERSION'], '4.9') >= 0:
480 env.Append(CCFLAGS=['-fsanitize=address,undefined',
481 '-fno-omit-frame-pointer'],
482 LINKFLAGS='-fsanitize=address,undefined')
483 else:
484 env.Append(CCFLAGS=['-fsanitize=address',
485 '-fno-omit-frame-pointer'],
486 LINKFLAGS='-fsanitize=address')
487 # Only gcc >= 4.9 supports UBSan, so check both the version
488 # and the command-line option before adding the compiler and
489 # linker flags.
490 elif GetOption('with_ubsan') and \
491 compareVersions(env['GCC_VERSION'], '4.9') >= 0:
492 env.Append(CCFLAGS='-fsanitize=undefined')
493 env.Append(LINKFLAGS='-fsanitize=undefined')
494
476elif main['CLANG']:
477 # Check for a supported version of clang, >= 3.1 is needed to
478 # support similar features as gcc 4.8. See
479 # http://clang.llvm.org/cxx_status.html for details
480 clang_version_re = re.compile(".* version (\d+\.\d+)")
481 clang_version_match = clang_version_re.search(CXX_version)
482 if (clang_version_match):
483 clang_version = clang_version_match.groups()[0]

--- 24 unchanged lines hidden (view full) ---

508 if sys.platform == "darwin":
509 main.Append(CXXFLAGS=['-stdlib=libc++'])
510 main.Append(LIBS=['c++'])
511
512 # On FreeBSD we need libthr.
513 if sys.platform.startswith('freebsd'):
514 main.Append(LIBS=['thr'])
515
495elif main['CLANG']:
496 # Check for a supported version of clang, >= 3.1 is needed to
497 # support similar features as gcc 4.8. See
498 # http://clang.llvm.org/cxx_status.html for details
499 clang_version_re = re.compile(".* version (\d+\.\d+)")
500 clang_version_match = clang_version_re.search(CXX_version)
501 if (clang_version_match):
502 clang_version = clang_version_match.groups()[0]

--- 24 unchanged lines hidden (view full) ---

527 if sys.platform == "darwin":
528 main.Append(CXXFLAGS=['-stdlib=libc++'])
529 main.Append(LIBS=['c++'])
530
531 # On FreeBSD we need libthr.
532 if sys.platform.startswith('freebsd'):
533 main.Append(LIBS=['thr'])
534
535 # We require clang >= 3.1, so there is no need to check any
536 # versions here.
537 if GetOption('with_ubsan'):
538 if GetOption('with_asan'):
539 env.Append(CCFLAGS=['-fsanitize=address,undefined',
540 '-fno-omit-frame-pointer'],
541 LINKFLAGS='-fsanitize=address,undefined')
542 else:
543 env.Append(CCFLAGS='-fsanitize=undefined',
544 LINKFLAGS='-fsanitize=undefined')
545
546 elif GetOption('with_asan'):
547 env.Append(CCFLAGS=['-fsanitize=address',
548 '-fno-omit-frame-pointer'],
549 LINKFLAGS='-fsanitize=address')
550
516else:
517 print termcap.Yellow + termcap.Bold + 'Error' + termcap.Normal,
518 print "Don't know what compiler options to use for your compiler."
519 print termcap.Yellow + ' compiler:' + termcap.Normal, main['CXX']
520 print termcap.Yellow + ' version:' + termcap.Normal,
521 if not CXX_version:
522 print termcap.Yellow + termcap.Bold + "COMMAND NOT FOUND!" +\
523 termcap.Normal

--- 697 unchanged lines hidden ---
551else:
552 print termcap.Yellow + termcap.Bold + 'Error' + termcap.Normal,
553 print "Don't know what compiler options to use for your compiler."
554 print termcap.Yellow + ' compiler:' + termcap.Normal, main['CXX']
555 print termcap.Yellow + ' version:' + termcap.Normal,
556 if not CXX_version:
557 print termcap.Yellow + termcap.Bold + "COMMAND NOT FOUND!" +\
558 termcap.Normal

--- 697 unchanged lines hidden ---