Earl Ou has uploaded this change for review. ( https://gem5-review.googlesource.com/c/public/gem5/+/67237?usp=email )

Change subject: systemc: fix -Wno-free-nonheap-object for building scheduler.cc
......................................................................

systemc: fix -Wno-free-nonheap-object for building scheduler.cc

-Wno-free-nonheap-object need to be added into linker flag as
the this check is actually at link time. This change also removes
the global flags so other code is still checked with the flags.

Change-Id: I8f1e20197b25c90b5f439e2ecc474bd99e4f82ed
---
M SConstruct
M src/systemc/core/SConscript
2 files changed, 15 insertions(+), 8 deletions(-)



diff --git a/SConstruct b/SConstruct
index bd26e45..e08c2984 100755
--- a/SConstruct
+++ b/SConstruct
@@ -447,10 +447,6 @@
             error('gcc version 7 or newer required.\n'
                   'Installed version:', env['CXXVERSION'])

-        with gem5_scons.Configure(env) as conf:
-            # This warning has a false positive in the systemc in g++ 11.1.
-            conf.CheckCxxFlag('-Wno-free-nonheap-object')
-
         # Add the appropriate Link-Time Optimization (LTO) flags if
         # `--with-lto` is set.
         if GetOption('with_lto'):
diff --git a/src/systemc/core/SConscript b/src/systemc/core/SConscript
index 2b88111..c7c9dbb 100644
--- a/src/systemc/core/SConscript
+++ b/src/systemc/core/SConscript
@@ -40,6 +40,7 @@
     Source('port.cc')
     Source('process.cc')
     Source('sched_event.cc')
+    Source('scheduler.cc')
     Source('sensitivity.cc')
     Source('time.cc')

@@ -75,7 +76,4 @@
# Disable the false positive warning for the event members of the scheduler.
     with gem5_scons.Configure(env) as conf:
         flag = '-Wno-free-nonheap-object'
-        append = {}
-        if conf.CheckCxxFlag(flag, autoadd=False):
-            append['CCFLAGS'] = [flag]
-        Source('scheduler.cc', append=append)
+        conf.CheckLinkFlag(flag)

--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/67237?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: I8f1e20197b25c90b5f439e2ecc474bd99e4f82ed
Gerrit-Change-Number: 67237
Gerrit-PatchSet: 1
Gerrit-Owner: Earl Ou <shunhsin...@google.com>
Gerrit-MessageType: newchange
_______________________________________________
gem5-dev mailing list -- gem5-dev@gem5.org
To unsubscribe send an email to gem5-dev-le...@gem5.org

Reply via email to