From 3812ac349ff221d32a0b0378b40b317b6ff61277 Mon Sep 17 00:00:00 2001 From: Gabe Black Date: Mon, 20 Nov 2017 21:01:59 -0800 Subject: [PATCH] scons: Minor cleanup of how partial linking is handled in makeEnv. Git rid of the unused partial_objs variable, and change append to extend since the result of builders is a list of nodes and not individual nodes, even if there's only one target. Change-Id: Ie51225d3ea699eb7da18199ac3bf3e868e3994a6 Reviewed-on: https://gem5-review.googlesource.com/5985 Reviewed-by: Andreas Sandberg Reviewed-by: Nikos Nikoleris Maintainer: Andreas Sandberg --- src/SConscript | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/src/SConscript b/src/SConscript index 28ae354d3..2930bab55 100755 --- a/src/SConscript +++ b/src/SConscript @@ -968,42 +968,40 @@ def makeEnv(env, label, objsfx, strip=False, disable_partial=False, **kwargs): static_objs.append(make_static(s)) shared_objs.append(make_shared(s)) - partial_objs = [] - for group in Source.source_groups: srcs = lib_sources.with_tag(Source.link_group_tag(group)) if not srcs: continue + group_static = [ make_static(s) for s in srcs ] + group_shared = [ make_shared(s) for s in srcs ] + # 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_static(s)) - shared_objs.append(make_shared(s)) + static_objs.extend(group_static) + shared_objs.extend(group_shared) continue # Set up the static partially linked objects. - source_objs = [ make_static(s) for s in srcs ] file_name = new_env.subst("${OBJPREFIX}lib${OBJSUFFIX}.partial") target = File(joinpath(group, file_name)) - partial = env.PartialStatic(target=target, source=source_objs) - static_objs.append(partial) + partial = env.PartialStatic(target=target, source=group_static) + static_objs.extend(partial) # Set up the shared partially linked objects. - source_objs = [ make_shared(s) for s in srcs ] file_name = new_env.subst("${SHOBJPREFIX}lib${SHOBJSUFFIX}.partial") target = File(joinpath(group, file_name)) - partial = env.PartialShared(target=target, source=source_objs) - shared_objs.append(partial) + partial = env.PartialShared(target=target, source=group_shared) + shared_objs.extend(partial) static_date = make_static(date_source) new_env.Depends(static_date, static_objs) - static_objs.append(static_date) + static_objs.extend(static_date) shared_date = make_shared(date_source) new_env.Depends(shared_date, shared_objs) - shared_objs.append(shared_date) + shared_objs.extend(shared_date) # First make a library of everything but main() so other programs can # link against m5. -- 2.30.2