Ciro Santilli has submitted this change and it was merged. (
https://gem5-review.googlesource.com/c/public/gem5/+/19048 )
Change subject: scons: allow passing arbitrary CCFLAGS and LDFLAGS from the
CLI
......................................................................
scons: allow passing arbitrary CCFLAGS and LDFLAGS from the CLI
The flags may be passed as:
scons CCFLAGS_EXTRA='-Wno-error -pedantic' \
LDFLAGS_EXTRA='-g -g' build/<arch>/gem5.opt
The initial motivation for this commit is to help disable warning that
have become errors while bisecting.
scons orders the flags by Append call order, and ideally these flags
should be added last to override the others, since the last GCC flags
take precedence. However I haven't found a simple way to put them at
the very end.
Change-Id: Ida24dfb9604d88b99f113392ab5e47d578ba7259
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/19048
Reviewed-by: Juha Jäykkä <[email protected]>
Reviewed-by: Jason Lowe-Power <[email protected]>
Maintainer: Jason Lowe-Power <[email protected]>
Tested-by: kokoro <[email protected]>
---
M SConstruct
1 file changed, 6 insertions(+), 1 deletion(-)
Approvals:
Jason Lowe-Power: Looks good to me, approved; Looks good to me, approved
Juha Jäykkä: Looks good to me, approved
kokoro: Regressions pass
diff --git a/SConstruct b/SConstruct
index 28999a5..9e27b48 100755
--- a/SConstruct
+++ b/SConstruct
@@ -1,6 +1,6 @@
# -*- mode:python -*-
-# Copyright (c) 2013, 2015-2017 ARM Limited
+# Copyright (c) 2013, 2015-2017, 2019 ARM Limited
# All rights reserved.
#
# The license below extends only to copyright in the software and shall
@@ -290,6 +290,8 @@
global_vars.AddVariables(
('CC', 'C compiler', environ.get('CC', main['CC'])),
('CXX', 'C++ compiler', environ.get('CXX', main['CXX'])),
+ ('CCFLAGS_EXTRA', 'Extra C and C++ compiler flags', ''),
+ ('LDFLAGS_EXTRA', 'Extra linker flags', ''),
('PYTHON_CONFIG', 'Python config binary to use',
[ 'python2.7-config', 'python-config' ]),
('PROTOC', 'protoc tool', environ.get('PROTOC', 'protoc')),
@@ -1285,6 +1287,9 @@
if env['USE_SSE2']:
env.Append(CCFLAGS=['-msse2'])
+ env.Append(CCFLAGS='$CCFLAGS_EXTRA')
+ env.Append(LINKFLAGS='$LDFLAGS_EXTRA')
+
# The src/SConscript file sets up the build rules in 'env' according
# to the configured variables. It returns a list of environments,
# one for each variant build (debug, opt, etc.)
--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/19048
To unsubscribe, or for help writing mail filters, visit
https://gem5-review.googlesource.com/settings
Gerrit-Project: public/gem5
Gerrit-Branch: master
Gerrit-Change-Id: Ida24dfb9604d88b99f113392ab5e47d578ba7259
Gerrit-Change-Number: 19048
Gerrit-PatchSet: 2
Gerrit-Owner: Ciro Santilli <[email protected]>
Gerrit-Reviewer: Andreas Sandberg <[email protected]>
Gerrit-Reviewer: Ciro Santilli <[email protected]>
Gerrit-Reviewer: Gabe Black <[email protected]>
Gerrit-Reviewer: Giacomo Travaglini <[email protected]>
Gerrit-Reviewer: Jason Lowe-Power <[email protected]>
Gerrit-Reviewer: Juha Jäykkä <[email protected]>
Gerrit-Reviewer: kokoro <[email protected]>
Gerrit-MessageType: merged
_______________________________________________
gem5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/gem5-dev