scons: Disable the free-nonheap-object warning for gcc.

g++ 11.1 has a false positive in the systemc kernel for
free-nonheap-object which breaks the build. The check sees that an
EventWrapper is part of the systemc scheduler object, and doesn't
realize that it was *not* set to autodelete, and so would *not* delete
itself (as part of the scheduler) when it is descheduled.

Change-Id: Ia9f48f2113e8c165923e55d7db1442b11bb6a2e8
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/48646
Reviewed-by: Hoa Nguyen <hoanguyen@ucdavis.edu>
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
This commit is contained in:
Gabe Black
2021-07-27 00:41:13 -07:00
parent 5e5205970b
commit db1ec14120

View File

@@ -355,6 +355,10 @@ if main['GCC']:
error('gcc version 7 or newer required.\n'
'Installed version:', main['CXXVERSION'])
with gem5_scons.Configure(main) as conf:
# This warning has a false positive in the systemc code 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'):