SConscript (11999:252c50d5b736) | SConscript (12063:06cd2c297b04) |
---|---|
1# -*- mode:python -*- 2 3# Copyright (c) 2004-2005 The Regents of The University of Michigan 4# All rights reserved. 5# 6# Redistribution and use in source and binary forms, with or without 7# modification, are permitted provided that the following conditions are 8# met: redistributions of source code must retain the above copyright --- 943 unchanged lines hidden (view full) --- 952 return os.path.join(variant_dir, *path) 953def variantd(*path): 954 return variant(*path)+'/' 955 956# Function to create a new build environment as clone of current 957# environment 'env' with modified object suffix and optional stripped 958# binary. Additional keyword arguments are appended to corresponding 959# build environment vars. | 1# -*- mode:python -*- 2 3# Copyright (c) 2004-2005 The Regents of The University of Michigan 4# All rights reserved. 5# 6# Redistribution and use in source and binary forms, with or without 7# modification, are permitted provided that the following conditions are 8# met: redistributions of source code must retain the above copyright --- 943 unchanged lines hidden (view full) --- 952 return os.path.join(variant_dir, *path) 953def variantd(*path): 954 return variant(*path)+'/' 955 956# Function to create a new build environment as clone of current 957# environment 'env' with modified object suffix and optional stripped 958# binary. Additional keyword arguments are appended to corresponding 959# build environment vars. |
960def makeEnv(env, label, objsfx, strip = False, **kwargs): | 960def makeEnv(env, label, objsfx, strip=False, disable_partial=False, **kwargs): |
961 # SCons doesn't know to append a library suffix when there is a '.' in the 962 # name. Use '_' instead. 963 libname = variant('gem5_' + label) 964 exename = variant('gem5.' + label) 965 secondary_exename = variant('m5.' + label) 966 967 new_env = env.Clone(OBJSUFFIX=objsfx, SHOBJSUFFIX=objsfx + 's') 968 new_env.Label = label --- 85 unchanged lines hidden (view full) --- 1054 continue 1055 1056 # Get a list of the source files compatible with the current guards. 1057 srcs = [ s for s in guarded_source_iterator(all_srcs, **lib_guards) ] 1058 # If there aren't any left, skip this group. 1059 if not srcs: 1060 continue 1061 | 961 # SCons doesn't know to append a library suffix when there is a '.' in the 962 # name. Use '_' instead. 963 libname = variant('gem5_' + label) 964 exename = variant('gem5.' + label) 965 secondary_exename = variant('m5.' + label) 966 967 new_env = env.Clone(OBJSUFFIX=objsfx, SHOBJSUFFIX=objsfx + 's') 968 new_env.Label = label --- 85 unchanged lines hidden (view full) --- 1054 continue 1055 1056 # Get a list of the source files compatible with the current guards. 1057 srcs = [ s for s in guarded_source_iterator(all_srcs, **lib_guards) ] 1058 # If there aren't any left, skip this group. 1059 if not srcs: 1060 continue 1061 |
1062 # If partial linking is disabled, add these sources to the build 1063 # directly, and short circuit this loop. 1064 if disable_partial: 1065 for s in srcs: 1066 static_objs.append(make_obj(s, True)) 1067 shared_objs.append(make_obj(s, False)) 1068 continue 1069 |
|
1062 # Set up the static partially linked objects. 1063 source_objs = [ make_obj(s, True) for s in srcs ] 1064 file_name = new_env.subst("${OBJPREFIX}lib${OBJSUFFIX}.partial") 1065 target = File(joinpath(group, file_name)) 1066 partial = env.PartialStatic(target=target, source=source_objs) 1067 static_objs.append(partial) 1068 1069 # Set up the shared partially linked objects. --- 129 unchanged lines hidden (view full) --- 1199 if 'opt' in needed_envs: 1200 makeEnv(env, 'opt', '.o', 1201 CCFLAGS = Split(ccflags['opt']), 1202 CPPDEFINES = ['TRACING_ON=1'], 1203 LINKFLAGS = Split(ldflags['opt'])) 1204 1205 # "Fast" binary 1206 if 'fast' in needed_envs: | 1070 # Set up the static partially linked objects. 1071 source_objs = [ make_obj(s, True) for s in srcs ] 1072 file_name = new_env.subst("${OBJPREFIX}lib${OBJSUFFIX}.partial") 1073 target = File(joinpath(group, file_name)) 1074 partial = env.PartialStatic(target=target, source=source_objs) 1075 static_objs.append(partial) 1076 1077 # Set up the shared partially linked objects. --- 129 unchanged lines hidden (view full) --- 1207 if 'opt' in needed_envs: 1208 makeEnv(env, 'opt', '.o', 1209 CCFLAGS = Split(ccflags['opt']), 1210 CPPDEFINES = ['TRACING_ON=1'], 1211 LINKFLAGS = Split(ldflags['opt'])) 1212 1213 # "Fast" binary 1214 if 'fast' in needed_envs: |
1215 disable_partial = \ 1216 env.get('BROKEN_INCREMENTAL_LTO', False) and \ 1217 GetOption('force_lto') |
|
1207 makeEnv(env, 'fast', '.fo', strip = True, 1208 CCFLAGS = Split(ccflags['fast']), 1209 CPPDEFINES = ['NDEBUG', 'TRACING_ON=0'], | 1218 makeEnv(env, 'fast', '.fo', strip = True, 1219 CCFLAGS = Split(ccflags['fast']), 1220 CPPDEFINES = ['NDEBUG', 'TRACING_ON=0'], |
1210 LINKFLAGS = Split(ldflags['fast'])) | 1221 LINKFLAGS = Split(ldflags['fast']), 1222 disable_partial=disable_partial) |
1211 1212 # Profiled binary using gprof 1213 if 'prof' in needed_envs: 1214 makeEnv(env, 'prof', '.po', 1215 CCFLAGS = Split(ccflags['prof']), 1216 CPPDEFINES = ['NDEBUG', 'TRACING_ON=0'], 1217 LINKFLAGS = Split(ldflags['prof'])) 1218 --- 28 unchanged lines hidden --- | 1223 1224 # Profiled binary using gprof 1225 if 'prof' in needed_envs: 1226 makeEnv(env, 'prof', '.po', 1227 CCFLAGS = Split(ccflags['prof']), 1228 CPPDEFINES = ['NDEBUG', 'TRACING_ON=0'], 1229 LINKFLAGS = Split(ldflags['prof'])) 1230 --- 28 unchanged lines hidden --- |