Deleted Added
sdiff udiff text old ( 10196:be0e1724eb39 ) new ( 10238:b21b3aad6bd1 )
full compact
1# -*- mode:python -*-
2
3# Copyright (c) 2013 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

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

563 print " environment."
564 print " "
565 print " If you are trying to use a compiler other than those listed"
566 print " above you will need to ease fix SConstruct and "
567 print " src/SConscript to support that compiler."
568 Exit(1)
569
570if main['GCC']:
571 # Check for a supported version of gcc, >= 4.4 is needed for c++0x
572 # support. See http://gcc.gnu.org/projects/cxx0x.html for details
573 gcc_version = readCommand([main['CXX'], '-dumpversion'], exception=False)
574 if compareVersions(gcc_version, "4.4") < 0:
575 print 'Error: gcc version 4.4 or newer required.'
576 print ' Installed version:', gcc_version
577 Exit(1)
578
579 main['GCC_VERSION'] = gcc_version
580
581 # Check for versions with bugs
582 if not compareVersions(gcc_version, '4.4.1') or \
583 not compareVersions(gcc_version, '4.4.2'):
584 print 'Info: Tree vectorizer in GCC 4.4.1 & 4.4.2 is buggy, disabling.'
585 main.Append(CCFLAGS=['-fno-tree-vectorize'])
586
587 # LTO support is only really working properly from 4.6 and beyond
588 if compareVersions(gcc_version, '4.6') >= 0:
589 # Add the appropriate Link-Time Optimization (LTO) flags
590 # unless LTO is explicitly turned off. Note that these flags
591 # are only used by the fast target.
592 if not GetOption('no_lto'):
593 # Pass the LTO flag when compiling to produce GIMPLE
594 # output, we merely create the flags here and only append
595 # them later/
596 main['LTO_CCFLAGS'] = ['-flto=%d' % GetOption('num_jobs')]
597
598 # Use the same amount of jobs for LTO as we are running
599 # scons with, we hardcode the use of the linker plugin
600 # which requires either gold or GNU ld >= 2.21
601 main['LTO_LDFLAGS'] = ['-flto=%d' % GetOption('num_jobs'),
602 '-fuse-linker-plugin']
603
604 main.Append(TCMALLOC_CCFLAGS=['-fno-builtin-malloc', '-fno-builtin-calloc',
605 '-fno-builtin-realloc', '-fno-builtin-free'])
606
607elif main['CLANG']:
608 # Check for a supported version of clang, >= 2.9 is needed to
609 # support similar features as gcc 4.4. See
610 # http://clang.llvm.org/cxx_status.html for details
611 clang_version_re = re.compile(".* version (\d+\.\d+)")
612 clang_version_match = clang_version_re.search(CXX_version)
613 if (clang_version_match):
614 clang_version = clang_version_match.groups()[0]
615 if compareVersions(clang_version, "2.9") < 0:
616 print 'Error: clang version 2.9 or newer required.'
617 print ' Installed version:', clang_version
618 Exit(1)
619 else:
620 print 'Error: Unable to determine clang version.'
621 Exit(1)
622
623 # clang has a few additional warnings that we disable,
624 # tautological comparisons are allowed due to unsigned integers

--- 735 unchanged lines hidden ---