diff options
author | Gabe Black <gabeblack@google.com> | 2017-11-20 21:01:59 -0800 |
---|---|---|
committer | Gabe Black <gabeblack@google.com> | 2017-11-28 10:22:29 +0000 |
commit | 3812ac349ff221d32a0b0378b40b317b6ff61277 (patch) | |
tree | d2b97a356fd86b67b4d0e9123aa077e1b4015942 | |
parent | 5179d0ba2b573435796f9fd9cb6a25c82f5fc292 (diff) | |
download | gem5-3812ac349ff221d32a0b0378b40b317b6ff61277.tar.xz |
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 <andreas.sandberg@arm.com>
Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
-rwxr-xr-x | src/SConscript | 24 |
1 files 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. |