Gabe Black has uploaded this change for review. ( https://gem5-review.googlesource.com/c/public/gem5/+/41596 )

Change subject: scons: Use SCons' built in CXXVERSION instead of detecting our own.
......................................................................

scons: Use SCons' built in CXXVERSION instead of detecting our own.

It's not guaranteed that every compiler will set CXXVERSION, but both
gcc and clang do, and for any check of CXXVERSION to be meaningful, we
have to first check which compiler we're talking about.

Change-Id: Icd15e12832920fec6fa8634bc0fde16cc48e3f41
---
M SConstruct
M src/systemc/dt/int/SConscript
2 files changed, 5 insertions(+), 9 deletions(-)



diff --git a/SConstruct b/SConstruct
index 4752d9e..f2fbafb 100755
--- a/SConstruct
+++ b/SConstruct
@@ -345,12 +345,9 @@
           "src/SConscript to support that compiler.")))

 if main['GCC']:
- gcc_version = readCommand([main['CXX'], '-dumpversion'], exception=False)
-    if compareVersions(gcc_version, "5") < 0:
+    if compareVersions(main['CXXVERSION'], "5") < 0:
         error('gcc version 5 or newer required.\n'
-              'Installed version:', gcc_version)
-
-    main['GCC_VERSION'] = gcc_version
+              'Installed version:', main['CXXVERSION'])

     # If not disabled, set the Link-Time Optimization (LTO) flags.
     if not GetOption('no_lto'):
@@ -362,10 +359,9 @@
                                   '-fno-builtin-realloc', '-fno-builtin-free'])

 elif main['CLANG']:
- clang_version = readCommand([main['CXX'], '-dumpversion'], exception=False)
-    if compareVersions(clang_version, "3.9") < 0:
+    if compareVersions(main['CXXVERSION'], "3.9") < 0:
         error('clang version 3.9 or newer required.\n'
-              'Installed version:', clang_version)
+              'Installed version:', main['CXXVERSION'])

     # If not disabled, set the Link-Time Optimization (LTO) flags.
     if not GetOption('no_lto'):
diff --git a/src/systemc/dt/int/SConscript b/src/systemc/dt/int/SConscript
index 92c0f07..b052f04 100644
--- a/src/systemc/dt/int/SConscript
+++ b/src/systemc/dt/int/SConscript
@@ -28,7 +28,7 @@
 from m5.util import compareVersions

 if env['USE_SYSTEMC']:
-    if main['GCC'] and compareVersions(main['GCC_VERSION'], '10.0') >= 0:
+    if main['GCC'] and compareVersions(main['CXXVERSION'], '10.0') >= 0:
         disable_false_positives = {
             "CCFLAGS": [ "-Wno-array-bounds",
                          "-Wno-stringop-overflow" ]

--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/41596
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: Icd15e12832920fec6fa8634bc0fde16cc48e3f41
Gerrit-Change-Number: 41596
Gerrit-PatchSet: 1
Gerrit-Owner: Gabe Black <gabe.bl...@gmail.com>
Gerrit-MessageType: newchange
_______________________________________________
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