aboutsummaryrefslogtreecommitdiff
path: root/tools/shared.py
diff options
context:
space:
mode:
authorVladimir Vukicevic <vladimir@pobox.com>2013-02-26 21:25:47 -0500
committerVladimir Vukicevic <vladimir@pobox.com>2013-02-26 21:26:09 -0500
commit74141f7fc2961e952f2288e57fb767b95961100c (patch)
tree49767ede15e9d707658f73321f71721d2fce7caa /tools/shared.py
parenta28b5d53d75b428b1bee1efd39ac6d01d68d56d2 (diff)
only put filenames with no space in response file
llvm-link can't seem to handle spaces in response files sanely, and I can't find a way to quote them. So just don't include them, and use it only on Windows.
Diffstat (limited to 'tools/shared.py')
-rw-r--r--tools/shared.py17
1 files changed, 14 insertions, 3 deletions
diff --git a/tools/shared.py b/tools/shared.py
index 6f97737e..d9dd62e8 100644
--- a/tools/shared.py
+++ b/tools/shared.py
@@ -822,14 +822,25 @@ set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)''' % { 'winfix': '' if not WINDOWS e
# 8k is a bit of an arbitrary limit, but a reasonable one
# for max command line size before we use a respose file
response_file = None
- if len(' '.join(link_cmd)) > 8192:
+ if WINDOWS and len(' '.join(link_cmd)) > 8192:
if DEBUG: print >>sys.stderr, 'using response file for llvm-link'
[response_fd, response_file] = mkstemp(suffix='.response', dir=TEMP_DIR)
+
+ link_cmd = [LLVM_LINK, "@" + response_file]
+
response_fh = os.fdopen(response_fd, 'w')
for arg in actual_files:
- response_fh.write(arg + "\n")
+ # we can't put things with spaces in the response file
+ if " " in arg:
+ link_cmd.append(arg)
+ else:
+ response_fh.write(arg + "\n")
response_fh.close()
- link_cmd = [LLVM_LINK, "@" + response_file, '-o', target]
+ link_cmd.append("-o")
+ link_cmd.append(target)
+
+ if len(' '.join(link_cmd)) > 8192:
+ print >>sys.stderr, 'emcc: warning: link command line is very long, even with response file -- use paths with no spaces'
output = Popen(link_cmd, stdout=PIPE).communicate()[0]