Gabe Black has submitted this change. ( https://gem5-review.googlesource.com/c/public/gem5/+/40861 )

Change subject: scons: Use conf to determine if some flags are supported.
......................................................................

scons: Use conf to determine if some flags are supported.

Use conf rather than checking for particular combinations of OS and/or
compiler versions. This *should* be just as correct, and not require
keeping track of what versions of the tools particular flags were added.

Change-Id: Icaa4c273fe89801e2808e6a814ce476700fd6956
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/40861
Tested-by: kokoro <noreply+kok...@google.com>
Maintainer: Gabe Black <gabe.bl...@gmail.com>
Reviewed-by: Andreas Sandberg <andreas.sandb...@arm.com>
---
M SConstruct
1 file changed, 3 insertions(+), 10 deletions(-)

Approvals:
  Andreas Sandberg: Looks good to me, approved
  Gabe Black: Looks good to me, approved
  kokoro: Regressions pass



diff --git a/SConstruct b/SConstruct
index d648424..214aa48 100755
--- a/SConstruct
+++ b/SConstruct
@@ -323,10 +323,7 @@
         main.Append(CCFLAGS=['-I/usr/local/include'])
         main.Append(CXXFLAGS=['-I/usr/local/include'])

-    # On Mac OS X/Darwin the default linker doesn't support the
-    # option --as-needed
-    if sys.platform != "darwin":
-        main.Append(LINKFLAGS='-Wl,--as-needed')
+    conf.CheckLinkFlag('-Wl,--as-needed')
     if GetOption('gold_linker'):
         main.Append(LINKFLAGS='-fuse-ld=gold')

@@ -397,12 +394,8 @@
                          # interchangeably.
                          '-Wno-mismatched-tags',
                          ])
-    if sys.platform != "darwin" and \
-       compareVersions(clang_version, "10.0") >= 0:
-        main.Append(CCFLAGS=['-Wno-c99-designator'])
-
-    if compareVersions(clang_version, "8.0") >= 0:
-        main.Append(CCFLAGS=['-Wno-defaulted-function-deleted'])
+    conf.CheckCxxFlag('-Wno-c99-designator')
+    conf.CheckCxxFlag('-Wno-defaulted-function-deleted')

     main.Append(TCMALLOC_CCFLAGS=['-fno-builtin'])




The change was submitted with unreviewed changes in the following files:

--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/40861
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: Icaa4c273fe89801e2808e6a814ce476700fd6956
Gerrit-Change-Number: 40861
Gerrit-PatchSet: 8
Gerrit-Owner: Gabe Black <gabe.bl...@gmail.com>
Gerrit-Reviewer: Andreas Sandberg <andreas.sandb...@arm.com>
Gerrit-Reviewer: Gabe Black <gabe.bl...@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