changeset 0421e52a57af in /z/repo/gem5
details: http://repo.gem5.org/gem5?cmd=changeset;node=0421e52a57af
description:
        scons: Allow GNU assembler version strings with hyphen

        Make scons a bit more forgiving when determining the GNU assembler 
version.

diffstat:

 SConstruct |  12 +++++++++---
 1 files changed, 9 insertions(+), 3 deletions(-)

diffs (23 lines):

diff -r 282c2a89ace8 -r 0421e52a57af SConstruct
--- a/SConstruct        Sun Jun 07 14:02:40 2015 -0500
+++ b/SConstruct        Tue Jun 09 09:21:11 2015 -0400
@@ -599,10 +599,16 @@
     # assemblers detect this as an error, "Error: expecting string
     # instruction after `rep'"
     if compareVersions(gcc_version, "4.8") > 0:
-        as_version = readCommand([main['AS'], '-v', '/dev/null'],
-                                 exception=False).split()
+        as_version_raw = readCommand([main['AS'], '-v', '/dev/null'],
+                                     exception=False).split()
 
-        if not as_version or compareVersions(as_version[-1], "2.23") < 0:
+        # version strings may contain extra distro-specific
+        # qualifiers, so play it safe and keep only what comes before
+        # the first hyphen
+        as_version = as_version_raw[-1].split('-')[0] if as_version_raw \
+            else None
+
+        if not as_version or compareVersions(as_version, "2.23") < 0:
             print termcap.Yellow + termcap.Bold + \
                 'Warning: This combination of gcc and binutils have' + \
                 ' known incompatibilities.\n' + \
_______________________________________________
gem5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/gem5-dev

Reply via email to