gem5-dev@gem5.org

The gem5 Developer List

View all threads

[S] Change in gem5/gem5[develop]: scons: Add "--no-duplicate-sources" option to SConstruct in util/

HN
Hoa Nguyen (Gerrit)
Thu, Apr 13, 2023 9:26 PM

Hoa Nguyen has uploaded this change for review. (
https://gem5-review.googlesource.com/c/public/gem5/+/69797?usp=email )

Change subject: scons: Add "--no-duplicate-sources" option to SConstruct in
util/
......................................................................

scons: Add "--no-duplicate-sources" option to SConstruct in util/

Patch [1] caused building util/m5 to fail due to the flag was not
an option in the SConstruct file. It is apparently the case for other
programs in util/ relying on scons.

This patch fixes the above problem, and also adheres to the default
behavior introduced by [2].

[1] This patch introduced the "--no-duplicate-sources" flag to the
scons build in util/
https://gem5-review.googlesource.com/c/public/gem5/+/68518

[2] This patch enabled this flag by default,
https://gem5-review.googlesource.com/c/public/gem5/+/69717

Change-Id: I51376f7b3bf06438b7bc7ff84bc599deecac5bd1
Signed-off-by: Hoa Nguyen hoanguyen@ucdavis.edu

M util/m5/SConstruct
M util/statetrace/SConstruct
M util/tlm/SConstruct
3 files changed, 15 insertions(+), 0 deletions(-)

diff --git a/util/m5/SConstruct b/util/m5/SConstruct
index c2c4a50..7f07b94 100644
--- a/util/m5/SConstruct
+++ b/util/m5/SConstruct
@@ -49,6 +49,9 @@
AddOption('--run-tests', dest='run_tests', action='store_true',
help='Enable test output xml files as build targets.')
AddOption('--verbose', dest='verbose', action='store_true')
+AddOption('--no-duplicate-sources', action='store_false', default=True,

  •      dest='duplicate_sources',
    
  •      help='Do not create symlinks to sources in the build directory')
    

    Universal settings.

    if GetOption('debug_build'):
    diff --git a/util/statetrace/SConstruct b/util/statetrace/SConstruct
    index 945976e..2e1a631 100644
    --- a/util/statetrace/SConstruct
    +++ b/util/statetrace/SConstruct
    @@ -57,6 +57,12 @@

    main['CXX'] = ARGUMENTS.get('CXX', main['CXX'])

+# An option not to link source files in the build directory.
+# Not enabled by default.
+AddOption('--no-duplicate-sources', action='store_false', default=True,

  •      dest='duplicate_sources',
    
  •      help='Do not create symlinks to sources in the build directory')
    
  • for arch in arches:
    env = main.Clone()
    env['CXX'] = ARGUMENTS.get(arch.upper() + 'CXX', env['CXX'])
    diff --git a/util/tlm/SConstruct b/util/tlm/SConstruct
    index 6c65cfd..3f4abf8 100644
    --- a/util/tlm/SConstruct
    +++ b/util/tlm/SConstruct
    @@ -80,6 +80,12 @@
    AddOption('--no-colors', dest='use_colors', action='store_false',
    help="Don't add color to abbreviated scons output")

+# An option not to link source files in the build directory.
+# Not enabled by default.
+AddOption('--no-duplicate-sources', action='store_false', default=True,

  •      dest='duplicate_sources',
    
  •      help='Do not create symlinks to sources in the build directory')
    
  • env.SConsignFile('build/systemc/sconsign')
    SConscript(gem5_root + '/ext/systemc/SConscript',
    variant_dir='build/systemc',

--
To view, visit
https://gem5-review.googlesource.com/c/public/gem5/+/69797?usp=email
To unsubscribe, or for help writing mail filters, visit
https://gem5-review.googlesource.com/settings

Gerrit-Project: public/gem5
Gerrit-Branch: develop
Gerrit-Change-Id: I51376f7b3bf06438b7bc7ff84bc599deecac5bd1
Gerrit-Change-Number: 69797
Gerrit-PatchSet: 1
Gerrit-Owner: Hoa Nguyen hoanguyen@ucdavis.edu
Gerrit-MessageType: newchange

Hoa Nguyen has uploaded this change for review. ( https://gem5-review.googlesource.com/c/public/gem5/+/69797?usp=email ) Change subject: scons: Add "--no-duplicate-sources" option to SConstruct in util/ ...................................................................... scons: Add "--no-duplicate-sources" option to SConstruct in util/ Patch [1] caused building util/m5 to fail due to the flag was not an option in the SConstruct file. It is apparently the case for other programs in util/ relying on scons. This patch fixes the above problem, and also adheres to the default behavior introduced by [2]. [1] This patch introduced the "--no-duplicate-sources" flag to the scons build in util/ https://gem5-review.googlesource.com/c/public/gem5/+/68518 [2] This patch enabled this flag by default, https://gem5-review.googlesource.com/c/public/gem5/+/69717 Change-Id: I51376f7b3bf06438b7bc7ff84bc599deecac5bd1 Signed-off-by: Hoa Nguyen <hoanguyen@ucdavis.edu> --- M util/m5/SConstruct M util/statetrace/SConstruct M util/tlm/SConstruct 3 files changed, 15 insertions(+), 0 deletions(-) diff --git a/util/m5/SConstruct b/util/m5/SConstruct index c2c4a50..7f07b94 100644 --- a/util/m5/SConstruct +++ b/util/m5/SConstruct @@ -49,6 +49,9 @@ AddOption('--run-tests', dest='run_tests', action='store_true', help='Enable test output xml files as build targets.') AddOption('--verbose', dest='verbose', action='store_true') +AddOption('--no-duplicate-sources', action='store_false', default=True, + dest='duplicate_sources', + help='Do not create symlinks to sources in the build directory') # Universal settings. if GetOption('debug_build'): diff --git a/util/statetrace/SConstruct b/util/statetrace/SConstruct index 945976e..2e1a631 100644 --- a/util/statetrace/SConstruct +++ b/util/statetrace/SConstruct @@ -57,6 +57,12 @@ main['CXX'] = ARGUMENTS.get('CXX', main['CXX']) +# An option not to link source files in the build directory. +# Not enabled by default. +AddOption('--no-duplicate-sources', action='store_false', default=True, + dest='duplicate_sources', + help='Do not create symlinks to sources in the build directory') + for arch in arches: env = main.Clone() env['CXX'] = ARGUMENTS.get(arch.upper() + 'CXX', env['CXX']) diff --git a/util/tlm/SConstruct b/util/tlm/SConstruct index 6c65cfd..3f4abf8 100644 --- a/util/tlm/SConstruct +++ b/util/tlm/SConstruct @@ -80,6 +80,12 @@ AddOption('--no-colors', dest='use_colors', action='store_false', help="Don't add color to abbreviated scons output") +# An option not to link source files in the build directory. +# Not enabled by default. +AddOption('--no-duplicate-sources', action='store_false', default=True, + dest='duplicate_sources', + help='Do not create symlinks to sources in the build directory') + env.SConsignFile('build/systemc/sconsign') SConscript(gem5_root + '/ext/systemc/SConscript', variant_dir='build/systemc', -- To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/69797?usp=email To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings Gerrit-Project: public/gem5 Gerrit-Branch: develop Gerrit-Change-Id: I51376f7b3bf06438b7bc7ff84bc599deecac5bd1 Gerrit-Change-Number: 69797 Gerrit-PatchSet: 1 Gerrit-Owner: Hoa Nguyen <hoanguyen@ucdavis.edu> Gerrit-MessageType: newchange