mem: Record the request master ID in the PacketInfo structure.
[gem5.git] / src / SConscript
index fd67533200ba8e3d4331ce0789fb54e6775607b7..519a0a98656c7c6103e55666127e5e9cb04d5a7c 100755 (executable)
@@ -610,7 +610,7 @@ PySource('m5', 'python/m5/info.py')
 def createSimObjectParamStruct(target, source, env):
     assert len(target) == 1 and len(source) == 1
 
-    name = str(source[0].get_contents())
+    name = source[0].get_text_contents()
     obj = sim_objects[name]
 
     code = code_formatter()
@@ -630,21 +630,22 @@ def createSimObjectCxxConfig(is_header):
     return body
 
 def createEnumStrings(target, source, env):
-    assert len(target) == 1 and len(source) == 1
+    assert len(target) == 1 and len(source) == 2
 
-    name = str(source[0].get_contents())
+    name = source[0].get_text_contents()
+    use_python = source[1].read()
     obj = all_enums[name]
 
     code = code_formatter()
     obj.cxx_def(code)
-    if env['USE_PYTHON']:
+    if use_python:
         obj.pybind_def(code)
     code.write(target[0].abspath)
 
 def createEnumDecls(target, source, env):
     assert len(target) == 1 and len(source) == 1
 
-    name = str(source[0].get_contents())
+    name = source[0].get_text_contents()
     obj = all_enums[name]
 
     code = code_formatter()
@@ -652,7 +653,7 @@ def createEnumDecls(target, source, env):
     code.write(target[0].abspath)
 
 def createSimObjectPyBindWrapper(target, source, env):
-    name = source[0].get_contents()
+    name = source[0].get_text_contents()
     obj = sim_objects[name]
 
     code = code_formatter()
@@ -732,7 +733,7 @@ for name,enum in sorted(all_enums.iteritems()):
     extra_deps = [ py_source.tnode ]
 
     cc_file = File('enums/%s.cc' % name)
-    env.Command(cc_file, Value(name),
+    env.Command(cc_file, [Value(name), Value(env['USE_PYTHON'])],
                 MakeAction(createEnumStrings, Transform("ENUM STR")))
     env.Depends(cc_file, depends + extra_deps)
     Source(cc_file)
@@ -956,7 +957,7 @@ def variantd(*path):
 # environment 'env' with modified object suffix and optional stripped
 # binary.  Additional keyword arguments are appended to corresponding
 # build environment vars.
-def makeEnv(env, label, objsfx, strip = False, **kwargs):
+def makeEnv(env, label, objsfx, strip=False, disable_partial=False, **kwargs):
     # SCons doesn't know to append a library suffix when there is a '.' in the
     # name.  Use '_' instead.
     libname = variant('gem5_' + label)
@@ -1058,6 +1059,14 @@ def makeEnv(env, label, objsfx, strip = False, **kwargs):
         if not srcs:
             continue
 
+        # If partial linking is disabled, add these sources to the build
+        # directly, and short circuit this loop.
+        if disable_partial:
+            for s in srcs:
+                static_objs.append(make_obj(s, True))
+                shared_objs.append(make_obj(s, False))
+            continue
+
         # Set up the static partially linked objects.
         source_objs = [ make_obj(s, True) for s in srcs ]
         file_name = new_env.subst("${OBJPREFIX}lib${OBJSUFFIX}.partial")
@@ -1203,10 +1212,14 @@ def makeEnvirons(target, source, env):
 
     # "Fast" binary
     if 'fast' in needed_envs:
+        disable_partial = \
+                env.get('BROKEN_INCREMENTAL_LTO', False) and \
+                GetOption('force_lto')
         makeEnv(env, 'fast', '.fo', strip = True,
                 CCFLAGS = Split(ccflags['fast']),
                 CPPDEFINES = ['NDEBUG', 'TRACING_ON=0'],
-                LINKFLAGS = Split(ldflags['fast']))
+                LINKFLAGS = Split(ldflags['fast']),
+                disable_partial=disable_partial)
 
     # Profiled binary using gprof
     if 'prof' in needed_envs:
@@ -1232,9 +1245,9 @@ env.Append(BUILDERS = {'MakeEnvirons' :
                         Builder(action=MakeAction(makeEnvirons,
                                                   Transform("ENVIRONS", 1)))})
 
-isa_target = env['PHONY_BASE'] + '-deps'
-environs   = env['PHONY_BASE'] + '-environs'
-env.Depends('#all-deps',     isa_target)
+isa_target = '#${VARIANT_NAME}-deps'
+environs = '#${VARIANT_NAME}-environs'
+env.Depends('#all-deps', isa_target)
 env.Depends('#all-environs', environs)
 env.ScanISA(isa_target, File('arch/%s/generated/inc.d' % env['TARGET_ISA']))
 envSetup = env.MakeEnvirons(environs, isa_target)