Bobby R. Bruce has submitted this change. ( https://gem5-review.googlesource.com/c/public/gem5/+/45839 )

Change subject: scons: Reverts LTO for opt, perf and prof builds.
......................................................................

scons: Reverts LTO for opt, perf and prof builds.

This reverts
https://gem5-review.googlesource.com/c/public/gem5/+/40815
and adds the `--with-lto` to enable LTO; and removes `--no-lto`.

Change-Id: I7dbd2b555570c90c98f38c7c02eb052571f7b6bd
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/44886
Reviewed-by: Jason Lowe-Power <power...@gmail.com>
Maintainer: Jason Lowe-Power <power...@gmail.com>
Tested-by: kokoro <noreply+kok...@google.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/45839
Reviewed-by: Bobby R. Bruce <bbr...@ucdavis.edu>
Maintainer: Bobby R. Bruce <bbr...@ucdavis.edu>
---
M SConstruct
1 file changed, 10 insertions(+), 5 deletions(-)

Approvals:
  Bobby R. Bruce: Looks good to me, approved; Looks good to me, approved
  kokoro: Regressions pass



diff --git a/SConstruct b/SConstruct
index bcfd58f..da74803 100755
--- a/SConstruct
+++ b/SConstruct
@@ -108,8 +108,8 @@
 AddOption('--gold-linker', action='store_true', help='Use the gold linker')
 AddOption('--no-compress-debug', action='store_true',
           help="Don't compress debug info in build files")
-AddOption('--no-lto', action='store_true',
-          help='Disable Link-Time Optimization for fast')
+AddOption('--with-lto', action='store_true',
+          help='Enable Link-Time Optimization')
 AddOption('--verbose', action='store_true',
           help='Print full tool command lines')
 AddOption('--without-python', action='store_true',
@@ -341,9 +341,9 @@
         error('gcc version 5 or newer required.\n'
               'Installed version:', main['CXXVERSION'])

-    # Add the appropriate Link-Time Optimization (LTO) flags
-    # unless LTO is explicitly turned off.
-    if not GetOption('no_lto'):
+ # Add the appropriate Link-Time Optimization (LTO) flags if `--with-lto` is
+    # set.
+    if GetOption('with_lto'):
# g++ uses "make" to parallelize LTO. The program can be overriden with # the environment variable "MAKE", but we currently make no attempt to
         # plumb that variable through.
@@ -371,6 +371,11 @@
         error('clang version 3.9 or newer required.\n'
               'Installed version:', main['CXXVERSION'])

+    # Set the Link-Time Optimization (LTO) flags if enabled.
+    if GetOption('with_lto'):
+        for var in 'LTO_CCFLAGS', 'LTO_LDFLAGS':
+            main[var] = ['-flto']
+
     # clang has a few additional warnings that we disable, extraneous
     # parantheses are allowed due to Ruby's printing of the AST,
     # finally self assignments are allowed as the generated CPU code

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

Gerrit-Project: public/gem5
Gerrit-Branch: minor-release-staging-v21-0-1
Gerrit-Change-Id: I7dbd2b555570c90c98f38c7c02eb052571f7b6bd
Gerrit-Change-Number: 45839
Gerrit-PatchSet: 6
Gerrit-Owner: Bobby R. Bruce <bbr...@ucdavis.edu>
Gerrit-Reviewer: Bobby R. Bruce <bbr...@ucdavis.edu>
Gerrit-Reviewer: Gabe Black <gabe.bl...@gmail.com>
Gerrit-Reviewer: Jason Lowe-Power <power...@gmail.com>
Gerrit-Reviewer: kokoro <noreply+kok...@google.com>
Gerrit-MessageType: merged
_______________________________________________
gem5-dev mailing list -- gem5-dev@gem5.org
To unsubscribe send an email to gem5-dev-le...@gem5.org
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s

Reply via email to