summaryrefslogtreecommitdiff
path: root/emcc
diff options
context:
space:
mode:
Diffstat (limited to 'emcc')
-rwxr-xr-xemcc29
1 files changed, 12 insertions, 17 deletions
diff --git a/emcc b/emcc
index 03d92fd3..5d22129a 100755
--- a/emcc
+++ b/emcc
@@ -79,6 +79,7 @@ import os, sys, shutil, tempfile, subprocess, shlex, time, re
from subprocess import PIPE, STDOUT
from tools import shared
from tools.shared import Compression, execute, suffix, unsuffixed, unsuffixed_basename
+from tools.response_file import read_response_file
# Mapping of emcc opt levels to llvm opt levels. We use llvm opt level 3 in emcc opt
# levels 2 and 3 (emcc 3 is unsafe opts, so unsuitable for the only level to get
@@ -129,19 +130,10 @@ while response_file:
for index in range(1, len(sys.argv)):
if sys.argv[index][0] == '@':
# found one, loop again next time
- response_file = sys.argv[index][1:]
- print >>sys.stderr, 'emcc: using response file: %s' % response_file
- if not os.path.exists(response_file):
- print >>sys.stderr, 'emcc: error: Response file not found: %s' % response_file
- exit(1)
-
- response_fd = open(response_file, 'r')
- extra_args = shlex.split(response_fd.read())
- response_fd.close()
-
+ response_file = True
+ extra_args = read_response_file(sys.argv[index])
# slice in extra_args in place of the response file arg
sys.argv[index:index+1] = extra_args
- #if DEBUG: print >>sys.stderr, "Expanded response file: " + " | ".join(sys.argv)
break
if sys.argv[1] == '--version':
@@ -171,7 +163,7 @@ Most normal gcc/g++ options will work, for example:
Options that are modified or new in %s include:
-O0 No optimizations (default)
- -O1 Simple optimizations, including LLVM -O1
+ -O1 Simple optimizations, including asm.js, LLVM -O1
optimizations, and no runtime assertions
or C++ exception catching (to re-enable
C++ exception catching, use
@@ -473,7 +465,7 @@ Options that are modified or new in %s include:
--memory-init-file <on> If on, we generate a separate memory initialization
file. This is more efficient than storing the
memory initialization data embedded inside
- JavaScript as text. (default is on)
+ JavaScript as text. (default is off)
The target file, if specified (-o <target>), defines what will
be generated:
@@ -483,8 +475,8 @@ be generated:
<name>.bc LLVM bitcode (default)
<name>.o LLVM bitcode (same as .bc)
-Note that if --memory-init-file is used, then in addition to a
-.js or .html file that is generated, a .mem file will also appear.
+(Note that if --memory-init-file is used, then in addition to a
+.js or .html file that is generated, a .mem file will also appear.)
The -c option (which tells gcc not to run the linker) will
cause LLVM bitcode to be generated, as %s only generates
@@ -727,7 +719,7 @@ try:
bind = False
jcache = False
save_bc = False
- memory_init_file = True
+ memory_init_file = False
if use_cxx:
default_cxx_std = '-std=c++03' # Enforce a consistent C++ standard when compiling .cpp files, if user does not specify one on the cmdline.
@@ -1010,8 +1002,11 @@ try:
# Apply effects from settings
if shared.Settings.ASM_JS:
- assert opt_level == 2, 'asm.js requires -O2'
+ assert opt_level >= 1, 'asm.js requires -O1 or above'
+ if bind:
+ shared.Settings.ASM_JS = 0
+ print >> sys.stderr, 'emcc: warning: disabling asm.js because it is not compatible with embind yet'
if closure:
print >> sys.stderr, 'emcc: warning: disabling closure because it is not compatible with asm.js code generation'
closure = False