aboutsummaryrefslogtreecommitdiff
path: root/tools/shared.py
diff options
context:
space:
mode:
Diffstat (limited to 'tools/shared.py')
-rw-r--r--tools/shared.py9
1 files changed, 5 insertions, 4 deletions
diff --git a/tools/shared.py b/tools/shared.py
index d850b770..c310afd4 100644
--- a/tools/shared.py
+++ b/tools/shared.py
@@ -328,13 +328,13 @@ except:
try:
PYTHON
except:
- print >> sys.stderr, 'PYTHON not defined in ~/.emscripten, using "python"'
+ if DEBUG: print >> sys.stderr, 'PYTHON not defined in ~/.emscripten, using "python"'
PYTHON = 'python'
try:
JAVA
except:
- print >> sys.stderr, 'JAVA not defined in ~/.emscripten, using "java"'
+ if DEBUG: print >> sys.stderr, 'JAVA not defined in ~/.emscripten, using "java"'
JAVA = 'java'
# Additional compiler options
@@ -344,7 +344,7 @@ try:
except:
COMPILER_OPTS = []
# Force a simple, standard target as much as possible: target 32-bit linux, and disable various flags that hint at other platforms
-COMPILER_OPTS = COMPILER_OPTS + ['-m32', '-U__i386__', '-U__x86_64__', '-U__i386', '-U__x86_64', '-U__SSE__', '-U__SSE2__', '-U__MMX__',
+COMPILER_OPTS = COMPILER_OPTS + ['-m32', '-U__i386__', '-U__x86_64__', '-U__i386', '-U__x86_64', '-Ui386', '-Ux86_64', '-U__SSE__', '-U__SSE2__', '-U__MMX__',
'-UX87_DOUBLE_ROUNDING', '-UHAVE_GCC_ASM_FOR_X87', '-DEMSCRIPTEN', '-U__STRICT_ANSI__', '-U__CYGWIN__',
'-D__STDC__', '-Xclang', '-triple=i386-pc-linux-gnu', '-D__IEEE_LITTLE_ENDIAN', '-fno-math-errno']
@@ -430,7 +430,7 @@ class TempFiles:
def run_and_clean(self, func):
try:
- func()
+ return func()
finally:
self.clean()
@@ -820,6 +820,7 @@ set(CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY)''' % { 'winfix': '' if not WINDOWS e
def llvm_opt(filename, opts):
if type(opts) is int:
opts = Building.pick_llvm_opts(opts)
+ if DEBUG: print >> sys.stderr, 'emcc: LLVM opts:', opts
output = Popen([LLVM_OPT, filename] + opts + ['-o=' + filename + '.opt.bc'], stdout=PIPE).communicate()[0]
assert os.path.exists(filename + '.opt.bc'), 'Failed to run llvm optimizations: ' + output
shutil.move(filename + '.opt.bc', filename)