summaryrefslogtreecommitdiff
path: root/SConstruct
diff options
context:
space:
mode:
authorAndreas Hansson <andreas.hansson@arm.com>2014-08-10 05:38:56 -0400
committerAndreas Hansson <andreas.hansson@arm.com>2014-08-10 05:38:56 -0400
commitb90bdcf8d0330d6472b6bf99bfa594f706879c16 (patch)
tree6ed53e88c5d672fd666a063c6e277f03f7b56ea9 /SConstruct
parenta628afedade8d7b7cab108a81e714fc2755b4af3 (diff)
downloadgem5-b90bdcf8d0330d6472b6bf99bfa594f706879c16.tar.xz
scons: Warn for incompatible gcc and binutils
It seems gcc >4.8 does not get along well with binutils <= 2.22, and to help users this patch adds a warning with an indication for how to fix the issue. It might even be worth adding a Exit(-1) and stop the build.
Diffstat (limited to 'SConstruct')
-rwxr-xr-xSConstruct16
1 files changed, 16 insertions, 0 deletions
diff --git a/SConstruct b/SConstruct
index 6a44f3a94..d5f56b22a 100755
--- a/SConstruct
+++ b/SConstruct
@@ -580,6 +580,22 @@ if main['GCC']:
main['GCC_VERSION'] = gcc_version
+ # gcc from version 4.8 and above generates "rep; ret" instructions
+ # to avoid performance penalties on certain AMD chips. Older
+ # 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()
+
+ if not as_version or compareVersions(as_version[-1], "2.23") < 0:
+ print termcap.Yellow + termcap.Bold + \
+ 'Warning: This combination of gcc and binutils have' + \
+ ' known incompatibilities.\n' + \
+ ' If you encounter build problems, please update ' + \
+ 'binutils to 2.23.' + \
+ termcap.Normal
+
# Add the appropriate Link-Time Optimization (LTO) flags
# unless LTO is explicitly turned off. Note that these flags
# are only used by the fast target.