aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2014-02-24 21:32:27 -0800
committerAlon Zakai <alonzakai@gmail.com>2014-02-24 21:32:27 -0800
commit80de5f33b5f3ce2b7d938b2f1a1909c1cca81733 (patch)
treeb83661953e245e86cc2ad50b17ee1fef1f2d137b
parent97b05d19563070cb5f75eb3351f66686ec0d4bfe (diff)
warn on emscripten, llvm and clang versions not matching
-rw-r--r--tools/shared.py17
1 files changed, 16 insertions, 1 deletions
diff --git a/tools/shared.py b/tools/shared.py
index 2072fec6..b170972b 100644
--- a/tools/shared.py
+++ b/tools/shared.py
@@ -305,9 +305,24 @@ def check_fastcomp():
print >> sys.stderr, '==========================================================================='
logging.critical('you can fall back to the older (pre-fastcomp) compiler core, although that is not recommended, see https://github.com/kripken/emscripten/wiki/LLVM-Backend')
return False
+
+ # look for a source tree under the llvm binary directory. if there is one, look for emscripten-version.txt files
+ d = os.path.dirname(LLVM_COMPILER)
+ while d != os.path.dirname(d):
+ if os.path.exists(os.path.join(d, 'emscripten-version.txt')):
+ llvm_version = open(os.path.join(d, 'emscripten-version.txt')).read().strip()
+ if os.path.exists(os.path.join(d, 'tools', 'clang', 'emscripten-version.txt')):
+ clang_version = open(os.path.join(d, 'tools', 'clang', 'emscripten-version.txt')).read().strip()
+ else:
+ clang_version = '?'
+ if EMSCRIPTEN_VERSION != llvm_version or EMSCRIPTEN_VERSION != clang_version:
+ logging.error('Emscripten, llvm and clang versions do not match, this is dangerous (%s, %s, %s)', EMSCRIPTEN_VERSION, llvm_version, clang_version)
+ logging.error('Make sure to use the same branch in each repo, and to be up-to-date on each. See https://github.com/kripken/emscripten/wiki/LLVM-Backend')
+ break
+ d = os.path.dirname(d)
return True
except Exception, e:
- logging.warning('cound not check fastcomp: %s' % str(e))
+ logging.warning('could not check fastcomp: %s' % str(e))
return True
EXPECTED_NODE_VERSION = (0,8,0)