948,955d947
< # Capture this directory for the closure makeEnv, otherwise when it is
< # called, it won't know what directory it should use.
< variant_dir = Dir('.').path
< def variant(*path):
< return os.path.join(variant_dir, *path)
< def variantd(*path):
< return variant(*path)+'/'
<
963,965c955,957
< libname = variant('gem5_' + label)
< exename = variant('gem5.' + label)
< secondary_exename = variant('m5.' + label)
---
> libname = 'gem5_' + label
> exename = 'gem5.' + label
> secondary_exename = 'm5.' + label
1104c1096
< path = variant('unittest/%s.%s' % (test.target, label))
---
> path = 'unittest/%s.%s' % (test.target, label)
1128c1120
< variant_dir=variantd('tests', new_env.Label),
---
> variant_dir=Dir('tests').Dir(new_env.Label).path,
1195,1197c1187,1192
< def makeEnvirons(target, source, env):
< # cause any later Source() calls to be fatal, as a diagnostic.
< Source.done()
---
> # Debug binary
> if 'debug' in needed_envs:
> makeEnv(env, 'debug', '.do',
> CCFLAGS = Split(ccflags['debug']),
> CPPDEFINES = ['DEBUG', 'TRACING_ON=1'],
> LINKFLAGS = Split(ldflags['debug']))
1199,1204c1194,1199
< # Debug binary
< if 'debug' in needed_envs:
< makeEnv(env, 'debug', '.do',
< CCFLAGS = Split(ccflags['debug']),
< CPPDEFINES = ['DEBUG', 'TRACING_ON=1'],
< LINKFLAGS = Split(ldflags['debug']))
---
> # Optimized binary
> if 'opt' in needed_envs:
> makeEnv(env, 'opt', '.o',
> CCFLAGS = Split(ccflags['opt']),
> CPPDEFINES = ['TRACING_ON=1'],
> LINKFLAGS = Split(ldflags['opt']))
1206,1211c1201,1210
< # Optimized binary
< if 'opt' in needed_envs:
< makeEnv(env, 'opt', '.o',
< CCFLAGS = Split(ccflags['opt']),
< CPPDEFINES = ['TRACING_ON=1'],
< LINKFLAGS = Split(ldflags['opt']))
---
> # "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']),
> disable_partial=disable_partial)
1213,1222c1212,1217
< # "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']),
< disable_partial=disable_partial)
---
> # Profiled binary using gprof
> if 'prof' in needed_envs:
> makeEnv(env, 'prof', '.po',
> CCFLAGS = Split(ccflags['prof']),
> CPPDEFINES = ['NDEBUG', 'TRACING_ON=0'],
> LINKFLAGS = Split(ldflags['prof']))
1224,1258c1219,1224
< # Profiled binary using gprof
< if 'prof' in needed_envs:
< makeEnv(env, 'prof', '.po',
< CCFLAGS = Split(ccflags['prof']),
< CPPDEFINES = ['NDEBUG', 'TRACING_ON=0'],
< LINKFLAGS = Split(ldflags['prof']))
<
< # Profiled binary using google-pprof
< if 'perf' in needed_envs:
< makeEnv(env, 'perf', '.gpo',
< CCFLAGS = Split(ccflags['perf']),
< CPPDEFINES = ['NDEBUG', 'TRACING_ON=0'],
< LINKFLAGS = Split(ldflags['perf']))
<
< # The MakeEnvirons Builder defers the full dependency collection until
< # after processing the ISA definition (due to dynamically generated
< # source files). Add this dependency to all targets so they will wait
< # until the environments are completely set up. Otherwise, a second
< # process (e.g. -j2 or higher) will try to compile the requested target,
< # not know how, and fail.
< env.Append(BUILDERS = {'MakeEnvirons' :
< Builder(action=MakeAction(makeEnvirons,
< Transform("ENVIRONS", 1)))})
<
< 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)
<
< # make sure no -deps targets occur before all ISAs are complete
< env.Depends(isa_target, '#all-isas')
< # likewise for -environs targets and all the -deps targets
< env.Depends(environs, '#all-deps')
---
> # Profiled binary using google-pprof
> if 'perf' in needed_envs:
> makeEnv(env, 'perf', '.gpo',
> CCFLAGS = Split(ccflags['perf']),
> CPPDEFINES = ['NDEBUG', 'TRACING_ON=0'],
> LINKFLAGS = Split(ldflags['perf']))