Hi,

Here is a patch from my personal modifications to SConstruct. It makes scons 
use the system-wide cc/c++ aliases that you can rebind to your liking with, 
e.g., update-alternatives on ubuntu. I’ve tested it successfully with several 
flavors of gcc/clang together with the ld or lld linker (the later being 
noticeably faster on my system). In any case, you can adapt the patch to 
hardcode your compiler in it. Beware with the compiler version checking that is 
a bit picky ;)

Gabriel
diff --git a/SConstruct b/SConstruct
index 4d91eae3f0..d5bb324b1e 100755
--- a/SConstruct
+++ b/SConstruct
@@ -179,8 +179,11 @@ main = Environment(tools=[
         ConfigFile, AddLocalRPATH, SwitchingHeaders, TagImpliesTool, Blob
     ])
 
-main.Tool(SCons.Tool.FindTool(['gcc', 'clang'], main))
-main.Tool(SCons.Tool.FindTool(['g++', 'clang++'], main))
+main.Tool(SCons.Tool.FindTool(['cc', 'gcc', 'clang'], main))
+main.Tool(SCons.Tool.FindTool(['c++', 'g++', 'clang++'], main))
+
+main['CC'] = 'cc'
+main['CXX'] = 'c++'
 
 Export('main')
 
@@ -285,7 +288,8 @@ main['TCMALLOC_CCFLAGS'] = []
 
 CXX_version = readCommand([main['CXX'], '--version'], exception=False)
 
-main['GCC'] = CXX_version and CXX_version.find('g++') >= 0
+main['GCC'] = CXX_version and \
+    (CXX_version.find('g++') >= 0 or CXX_version.find('c++') >= 0)
 main['CLANG'] = CXX_version and CXX_version.find('clang') >= 0
 if main['GCC'] + main['CLANG'] > 1:
     error('Two compilers enabled at once?')
@@ -418,13 +422,6 @@ for variant_path in variant_paths:
                     conf.CheckLinkFlag(
                             '-Wl,--thread-count=%d' % GetOption('num_jobs'))
 
-        # Treat warnings as errors but white list some warnings that we
-        # want to allow (e.g., deprecation warnings).
-        env.Append(CCFLAGS=['-Werror',
-                             '-Wno-error=deprecated-declarations',
-                             '-Wno-error=deprecated',
-                            ])
-
     else:
         error('\n'.join((
               "Don't know what compiler options to use for your compiler.",
_______________________________________________
gem5-users mailing list -- gem5-users@gem5.org
To unsubscribe send an email to gem5-users-le...@gem5.org

Reply via email to