Gabe Black has submitted this change and it was merged. ( https://gem5-review.googlesource.com/2780 )

Change subject: scons: When spawning the linker process, don't involve the shell.
......................................................................

scons: When spawning the linker process, don't involve the shell.

The command line can be too long, causing bash to choke. This means we can't
use any shell syntax like shell variables or redirection when linking, but
that should be easy to avoid.

Change-Id: Ie6c8ecab337cef6bd3c7e403346ced06f46f0993
Reviewed-on: https://gem5-review.googlesource.com/2780
Reviewed-by: Jason Lowe-Power <[email protected]>
Reviewed-by: Steve Reinhardt <[email protected]>
Maintainer: Jason Lowe-Power <[email protected]>
---
M src/SConscript
1 file changed, 13 insertions(+), 1 deletion(-)

Approvals:
  Jason Lowe-Power: Looks good to me, approved; Looks good to me, approved
  Steve Reinhardt: Looks good to me, but someone else must approve



diff --git a/src/SConscript b/src/SConscript
index 521d73b..645b925 100755
--- a/src/SConscript
+++ b/src/SConscript
@@ -34,6 +34,7 @@
 import marshal
 import os
 import re
+import subprocess
 import sys
 import zlib

@@ -1194,7 +1195,18 @@
     if strip:
         progname += '.unstripped'

-    targets = new_env.Program(progname, main_objs + static_objs)
+    # When linking the gem5 binary, the command line can be too big for the
+    # shell to handle. Use "subprocess" to spawn processes without passing
+    # through the shell to avoid this problem. That means we also can't use
+    # shell syntax in any of the commands this will run, but that isn't
+    # currently an issue.
+    def spawn_with_subprocess(sh, escape, cmd, args, env):
+        return subprocess.call(args, env=env)
+
+ # Since we're not running through a shell, no escaping is necessary either.
+    targets = new_env.Program(progname, main_objs + static_objs,
+                              SPAWN=spawn_with_subprocess,
+                              ESCAPE=lambda x: x)

     if strip:
         if sys.platform == 'sunos5':

--
To view, visit https://gem5-review.googlesource.com/2780
To unsubscribe, visit https://gem5-review.googlesource.com/settings

Gerrit-Project: public/gem5
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: Ie6c8ecab337cef6bd3c7e403346ced06f46f0993
Gerrit-Change-Number: 2780
Gerrit-PatchSet: 3
Gerrit-Owner: Gabe Black <[email protected]>
Gerrit-Reviewer: Gabe Black <[email protected]>
Gerrit-Reviewer: Jason Lowe-Power <[email protected]>
Gerrit-Reviewer: Steve Reinhardt <[email protected]>
_______________________________________________
gem5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/gem5-dev

Reply via email to