dev, virtio: properly set PCI address space to use IOREG
[gem5.git] / src / SConscript
index 2bac0bff3acf165c49b496e0887a16f39ad7fd54..d0835bda3d15f35f85e29aa18209b059ed311c93 100755 (executable)
@@ -962,9 +962,11 @@ env.Depends(SWIG, 'debug/flags.cc')
 Source('debug/flags.cc')
 
 # version tags
+tags = \
 env.Command('sim/tags.cc', None,
             MakeAction('util/cpt_upgrader.py --get-cc-file > $TARGET',
                        Transform("VER TAGS")))
+env.AlwaysBuild(tags)
 
 # Embed python files.  All .py files that have been indicated by a
 # PySource() call in a SConscript need to be embedded into the M5
@@ -1081,17 +1083,27 @@ def makeEnv(env, label, objsfx, strip = False, **kwargs):
             new_env.Append(CCFLAGS='-fsanitize=undefined')
             new_env.Append(LINKFLAGS='-fsanitize=undefined')
 
+        # The address sanitizer is available for gcc >= 4.8
+        if GetOption('with_asan')  and \
+                compareVersions(env['GCC_VERSION'], '4.8') >= 0:
+            new_env.Append(CCFLAGS='-fsanitize=address')
+            new_env.Append(LINKFLAGS='-fsanitize=address')
+
     if env['CLANG']:
         swig_env.Append(CCFLAGS=['-Wno-sometimes-uninitialized',
                                  '-Wno-deprecated-register',
                                  '-Wno-tautological-compare'])
 
-        # All supported clang versions have support for UBSan, so if
-        # asked to use it, append the compiler and linker flags.
+        # We require clang >= 3.1, so there is no need to check any
+        # versions here.
         if GetOption('with_ubsan'):
             new_env.Append(CCFLAGS='-fsanitize=undefined')
             new_env.Append(LINKFLAGS='-fsanitize=undefined')
 
+        if GetOption('with_asan'):
+            new_env.Append(CCFLAGS='-fsanitize=address')
+            new_env.Append(LINKFLAGS='-fsanitize=address')
+
     werror_env = new_env.Clone()
     # Treat warnings as errors but white list some warnings that we
     # want to allow (e.g., deprecation warnings).
@@ -1239,7 +1251,6 @@ needed_envs = [identifyTarget(target) for target in BUILD_TARGETS]
 if 'all' in needed_envs:
     needed_envs += target_types
 
-gem5_root = Dir('.').up().up().abspath
 def makeEnvirons(target, source, env):
     # cause any later Source() calls to be fatal, as a diagnostic.
     Source.done()
@@ -1288,7 +1299,7 @@ def makeEnvirons(target, source, env):
 
     # Set up the regression tests for each build.
     for e in envList:
-        SConscript(os.path.join(gem5_root, 'tests', 'SConscript'),
+        SConscript(os.path.join(env.root.abspath, 'tests', 'SConscript'),
                    variant_dir = variantd('tests', e.Label),
                    exports = { 'env' : e }, duplicate = False)