scons, tests: Fix occasional linking error
authorAndreas Sandberg <andreas.sandberg@arm.com>
Wed, 13 Dec 2017 14:29:39 +0000 (14:29 +0000)
committerAndreas Sandberg <andreas.sandberg@arm.com>
Wed, 13 Dec 2017 23:57:08 +0000 (23:57 +0000)
commita45289dee8bc5fb325cab1429c6730dcaf86c58d
treec58bd15a69830216f7f5bcc5a37ccbc59b8ddfd7
parented371e0fec0b40a21b5f60ccbca3e40a2e459734
scons, tests: Fix occasional linking error

There are some cases where scons incorrectly adds the same object
multiple times to the linker command line. This seems to be caused by
the test's source list being updated in place when determining test
framework dependencies. Fix this by explicitly copying the source list
and manipulate the copy.

Without this change, the following command fails:
scons ./build/ARM/unittests.opt/base/pixeltest.xml

Whereas this command succeeds:
scons ./build/ARM/base/pixeltest.opt

Change-Id: I642efdf9d62a5478e49ba51efe1a3a5ba453e21f
Signed-off-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-by: Jack Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/6641
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Reviewed-by: Gabe Black <gabeblack@google.com>
src/SConscript