SConstruct (9589:d2fbb792a8a0) | SConstruct (9590:699f4ee61445) |
---|---|
1# -*- mode:python -*- 2 3# Copyright (c) 2011 Advanced Micro Devices, Inc. 4# Copyright (c) 2009 The Hewlett-Packard Development Company 5# Copyright (c) 2004-2005 The Regents of The University of Michigan 6# All rights reserved. 7# 8# Redistribution and use in source and binary forms, with or without --- 491 unchanged lines hidden (view full) --- 500 main['SHCCCOMSTR'] = Transform("SHCC") 501 main['SHCXXCOMSTR'] = Transform("SHCXX") 502Export('MakeAction') 503 504# Initialize the Link-Time Optimization (LTO) flags 505main['LTO_CCFLAGS'] = [] 506main['LTO_LDFLAGS'] = [] 507 | 1# -*- mode:python -*- 2 3# Copyright (c) 2011 Advanced Micro Devices, Inc. 4# Copyright (c) 2009 The Hewlett-Packard Development Company 5# Copyright (c) 2004-2005 The Regents of The University of Michigan 6# All rights reserved. 7# 8# Redistribution and use in source and binary forms, with or without --- 491 unchanged lines hidden (view full) --- 500 main['SHCCCOMSTR'] = Transform("SHCC") 501 main['SHCXXCOMSTR'] = Transform("SHCXX") 502Export('MakeAction') 503 504# Initialize the Link-Time Optimization (LTO) flags 505main['LTO_CCFLAGS'] = [] 506main['LTO_LDFLAGS'] = [] 507 |
508# According to the readme, tcmalloc works best if the compiler doesn't 509# assume that we're using the builtin malloc and friends. These flags 510# are compiler-specific, so we need to set them after we detect which 511# compiler we're using. 512main['TCMALLOC_CCFLAGS'] = [] 513 |
|
508CXX_version = readCommand([main['CXX'],'--version'], exception=False) 509CXX_V = readCommand([main['CXX'],'-V'], exception=False) 510 511main['GCC'] = CXX_version and CXX_version.find('g++') >= 0 512main['CLANG'] = CXX_version and CXX_version.find('clang') >= 0 513if main['GCC'] + main['CLANG'] > 1: 514 print 'Error: How can we have two at the same time?' 515 Exit(1) --- 60 unchanged lines hidden (view full) --- 576 main['LTO_CCFLAGS'] = ['-flto=%d' % GetOption('num_jobs')] 577 578 # Use the same amount of jobs for LTO as we are running 579 # scons with, we hardcode the use of the linker plugin 580 # which requires either gold or GNU ld >= 2.21 581 main['LTO_LDFLAGS'] = ['-flto=%d' % GetOption('num_jobs'), 582 '-fuse-linker-plugin'] 583 | 514CXX_version = readCommand([main['CXX'],'--version'], exception=False) 515CXX_V = readCommand([main['CXX'],'-V'], exception=False) 516 517main['GCC'] = CXX_version and CXX_version.find('g++') >= 0 518main['CLANG'] = CXX_version and CXX_version.find('clang') >= 0 519if main['GCC'] + main['CLANG'] > 1: 520 print 'Error: How can we have two at the same time?' 521 Exit(1) --- 60 unchanged lines hidden (view full) --- 582 main['LTO_CCFLAGS'] = ['-flto=%d' % GetOption('num_jobs')] 583 584 # Use the same amount of jobs for LTO as we are running 585 # scons with, we hardcode the use of the linker plugin 586 # which requires either gold or GNU ld >= 2.21 587 main['LTO_LDFLAGS'] = ['-flto=%d' % GetOption('num_jobs'), 588 '-fuse-linker-plugin'] 589 |
590 main.Append(TCMALLOC_CCFLAGS=['-fno-builtin-malloc', '-fno-builtin-calloc', 591 '-fno-builtin-realloc', '-fno-builtin-free']) 592 |
|
584elif main['CLANG']: 585 # Check for a supported version of clang, >= 2.9 is needed to 586 # support similar features as gcc 4.4. See 587 # http://clang.llvm.org/cxx_status.html for details 588 clang_version_re = re.compile(".* version (\d+\.\d+)") 589 clang_version_match = clang_version_re.match(CXX_version) 590 if (clang_version_match): 591 clang_version = clang_version_match.groups()[0] --- 10 unchanged lines hidden (view full) --- 602 # being compared to constants that happen to be 0, and extraneous 603 # parantheses are allowed due to Ruby's printing of the AST, 604 # finally self assignments are allowed as the generated CPU code 605 # is relying on this 606 main.Append(CCFLAGS=['-Wno-tautological-compare', 607 '-Wno-parentheses', 608 '-Wno-self-assign']) 609 | 593elif main['CLANG']: 594 # Check for a supported version of clang, >= 2.9 is needed to 595 # support similar features as gcc 4.4. See 596 # http://clang.llvm.org/cxx_status.html for details 597 clang_version_re = re.compile(".* version (\d+\.\d+)") 598 clang_version_match = clang_version_re.match(CXX_version) 599 if (clang_version_match): 600 clang_version = clang_version_match.groups()[0] --- 10 unchanged lines hidden (view full) --- 611 # being compared to constants that happen to be 0, and extraneous 612 # parantheses are allowed due to Ruby's printing of the AST, 613 # finally self assignments are allowed as the generated CPU code 614 # is relying on this 615 main.Append(CCFLAGS=['-Wno-tautological-compare', 616 '-Wno-parentheses', 617 '-Wno-self-assign']) 618 |
619 main.Append(TCMALLOC_CCFLAGS=['-fno-builtin']) 620 |
|
610 # On Mac OS X/Darwin we need to also use libc++ (part of XCode) as 611 # opposed to libstdc++ to make the transition from TR1 to 612 # C++11. See http://libcxx.llvm.org. However, clang has chosen a 613 # strict implementation of the C++11 standard, and does not allow 614 # incomplete types in template arguments (besides unique_ptr and 615 # shared_ptr), and the libc++ STL containers create problems in 616 # combination with the current gem5 code. For now, we stick with 617 # libstdc++ and use the TR1 namespace. --- 291 unchanged lines hidden (view full) --- 909 910# Check for librt. 911have_posix_clock = \ 912 conf.CheckLibWithHeader(None, 'time.h', 'C', 913 'clock_nanosleep(0,0,NULL,NULL);') or \ 914 conf.CheckLibWithHeader('rt', 'time.h', 'C', 915 'clock_nanosleep(0,0,NULL,NULL);') 916 | 621 # On Mac OS X/Darwin we need to also use libc++ (part of XCode) as 622 # opposed to libstdc++ to make the transition from TR1 to 623 # C++11. See http://libcxx.llvm.org. However, clang has chosen a 624 # strict implementation of the C++11 standard, and does not allow 625 # incomplete types in template arguments (besides unique_ptr and 626 # shared_ptr), and the libc++ STL containers create problems in 627 # combination with the current gem5 code. For now, we stick with 628 # libstdc++ and use the TR1 namespace. --- 291 unchanged lines hidden (view full) --- 920 921# Check for librt. 922have_posix_clock = \ 923 conf.CheckLibWithHeader(None, 'time.h', 'C', 924 'clock_nanosleep(0,0,NULL,NULL);') or \ 925 conf.CheckLibWithHeader('rt', 'time.h', 'C', 926 'clock_nanosleep(0,0,NULL,NULL);') 927 |
917if not conf.CheckLib('tcmalloc_minimal'): | 928if conf.CheckLib('tcmalloc_minimal'): 929 main.Append(CCFLAGS=main['TCMALLOC_CCFLAGS']) 930else: |
918 print termcap.Yellow + termcap.Bold + \ 919 "You can get a 12% performance improvement by installing tcmalloc "\ 920 "(libgoogle-perftools-dev package on Ubuntu or RedHat)." + \ 921 termcap.Normal 922 923if not have_posix_clock: 924 print "Can't find library for POSIX clocks." 925 --- 297 unchanged lines hidden --- | 931 print termcap.Yellow + termcap.Bold + \ 932 "You can get a 12% performance improvement by installing tcmalloc "\ 933 "(libgoogle-perftools-dev package on Ubuntu or RedHat)." + \ 934 termcap.Normal 935 936if not have_posix_clock: 937 print "Can't find library for POSIX clocks." 938 --- 297 unchanged lines hidden --- |