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.6 is chosen for its 572 # level of c++11 support. See 573 # http://gcc.gnu.org/projects/cxx0x.html for details. 4.6 is also 574 # the first version with proper LTO support. |
575 gcc_version = readCommand([main['CXX'], '-dumpversion'], exception=False) |
576 if compareVersions(gcc_version, "4.6") < 0: 577 print 'Error: gcc version 4.6 or newer required.' |
578 print ' Installed version:', gcc_version 579 Exit(1) 580 581 main['GCC_VERSION'] = gcc_version 582 |
583 # Add the appropriate Link-Time Optimization (LTO) flags 584 # unless LTO is explicitly turned off. Note that these flags 585 # are only used by the fast target. 586 if not GetOption('no_lto'): 587 # Pass the LTO flag when compiling to produce GIMPLE 588 # output, we merely create the flags here and only append 589 # them later/ 590 main['LTO_CCFLAGS'] = ['-flto=%d' % GetOption('num_jobs')] |
591 |
592 # Use the same amount of jobs for LTO as we are running 593 # scons with, we hardcode the use of the linker plugin 594 # which requires either gold or GNU ld >= 2.21 595 main['LTO_LDFLAGS'] = ['-flto=%d' % GetOption('num_jobs'), 596 '-fuse-linker-plugin'] |
597 |
598 main.Append(TCMALLOC_CCFLAGS=['-fno-builtin-malloc', '-fno-builtin-calloc', 599 '-fno-builtin-realloc', '-fno-builtin-free']) 600 601elif main['CLANG']: |
602 # Check for a supported version of clang, >= 3.0 is needed to 603 # support similar features as gcc 4.6. See |
604 # http://clang.llvm.org/cxx_status.html for details 605 clang_version_re = re.compile(".* version (\d+\.\d+)") 606 clang_version_match = clang_version_re.search(CXX_version) 607 if (clang_version_match): 608 clang_version = clang_version_match.groups()[0] |
609 if compareVersions(clang_version, "3.0") < 0: 610 print 'Error: clang version 3.0 or newer required.' |
611 print ' Installed version:', clang_version 612 Exit(1) 613 else: 614 print 'Error: Unable to determine clang version.' 615 Exit(1) 616 617 # clang has a few additional warnings that we disable, 618 # tautological comparisons are allowed due to unsigned integers --- 735 unchanged lines hidden --- |